home *** CD-ROM | disk | FTP | other *** search
/ Amiga ACS 1998 #6 / amigaacscoverdisc1998-061998.iso / games / descent / source / main / physics.h < prev    next >
C/C++ Source or Header  |  1998-06-08  |  4KB  |  101 lines

  1. /*
  2. THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
  3. SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
  4. END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
  5. ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
  6. IN USING, DISPLAYING,  AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
  7. SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
  8. FREE PURPOSES.  IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
  9. CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES.  THE END-USER UNDERSTANDS
  10. AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.  
  11. COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
  12. */
  13. /*
  14.  * $Source: f:/miner/source/main/rcs/physics.h $
  15.  * $Revision: 2.0 $
  16.  * $Author: john $
  17.  * $Date: 1995/02/27 11:33:06 $
  18.  * 
  19.  * Headers for physics functions and data
  20.  * 
  21.  * $Log: physics.h $
  22.  * Revision 2.0  1995/02/27  11:33:06  john
  23.  * New version 2.0, which has no anonymous unions, builds with
  24.  * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
  25.  * 
  26.  * Revision 1.29  1995/02/06  19:47:18  matt
  27.  * New function (untested), set_thrust_from_velocity()
  28.  * 
  29.  * Revision 1.28  1994/12/04  22:14:20  mike
  30.  * apply instantaneous rotation to an object due to a force blow.
  31.  * 
  32.  * Revision 1.27  1994/08/01  13:29:42  matt
  33.  * Made fvi() check holes in transparent walls, and changed fvi() calling
  34.  * parms to take all input data in query structure.
  35.  * 
  36.  * Revision 1.26  1994/07/28  12:35:22  matt
  37.  * Added prototype
  38.  * 
  39.  * Revision 1.25  1994/07/13  21:48:05  matt
  40.  * FVI() and physics now keep lists of segments passed through which the
  41.  * trigger code uses.
  42.  * 
  43.  * Revision 1.24  1994/06/30  19:01:55  matt
  44.  * Moved flying controls code from physics.c to controls.c
  45.  * 
  46.  * Revision 1.23  1994/06/16  14:14:20  mike
  47.  * Change physics_lookahead to return hit_info.
  48.  * 
  49.  * Revision 1.22  1994/06/09  09:58:43  matt
  50.  * Moved find_vector_intersection() from physics.c to new file fvi.c
  51.  * 
  52.  * Revision 1.21  1994/05/20  16:11:07  matt
  53.  * Added new parm, ignore_obj, to find_vector_intersection()
  54.  * 
  55.  * Revision 1.20  1994/05/20  15:16:58  matt
  56.  * Added new fvi return type; took out some troublesome (and troubling) asserts
  57.  * 
  58.  * 
  59.  * 
  60.  */
  61.  
  62. #ifndef _PHYSICS_H
  63. #define _PHYSICS_H
  64.  
  65. #include "vecmat.h"
  66. #include "fvi.h"
  67.  
  68. //#define FL_NORMAL  0
  69. //#define FL_TURBO   1
  70. //#define FL_HOVER   2
  71. //#define FL_REVERSE 3
  72.  
  73. //these global vars are set after a call to do_physics_sim().  Ugly, I know.
  74. //list of segments went through
  75. extern int phys_seglist[MAX_FVI_SEGS],n_phys_segs;
  76.  
  77. // Read contrls and set physics vars
  78. void read_flying_controls( object * obj );
  79.  
  80. //Simulate a physics object for this frame
  81. do_physics_sim(object *obj);
  82.  
  83. //tell us what the given object will do (as far as hiting walls) in
  84. //the given time (in seconds) t.  Igores acceleration (sorry) 
  85. //if check_objects is set, check with objects, else just with walls
  86. //returns fate, fills in hit time.  If fate==HIT_NONE, hit_time undefined
  87. //    Stuff hit_info with fvi data as set by find_vector_intersection.
  88. //for fvi_flags, refer to fvi.h for the fvi query flags
  89. int physics_lookahead(object *obj,fix t,int fvi_flags,fix *hit_time, fvi_info *hit_info);
  90.  
  91. //Applies an instantaneous force on an object, resulting in an instantaneous
  92. //change in velocity.
  93. phys_apply_force(object *obj,vms_vector *force_vec);
  94. phys_apply_rot(object *obj,vms_vector *force_vec);
  95.  
  96. //this routine will set the thrust for an object to a value that will
  97. //(hopefully) maintain the object's current velocity
  98. set_thrust_from_velocity(object *obj);
  99.  
  100. #endif
  101.