PHYSICS.H 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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. #ifndef _PHYSICS_H
  62. #define _PHYSICS_H
  63. #include "vecmat.h"
  64. #include "fvi.h"
  65. //#define FL_NORMAL 0
  66. //#define FL_TURBO 1
  67. //#define FL_HOVER 2
  68. //#define FL_REVERSE 3
  69. //these global vars are set after a call to do_physics_sim(). Ugly, I know.
  70. //list of segments went through
  71. extern int phys_seglist[MAX_FVI_SEGS],n_phys_segs;
  72. // Read contrls and set physics vars
  73. void read_flying_controls( object * obj );
  74. //Simulate a physics object for this frame
  75. do_physics_sim(object *obj);
  76. //tell us what the given object will do (as far as hiting walls) in
  77. //the given time (in seconds) t. Igores acceleration (sorry)
  78. //if check_objects is set, check with objects, else just with walls
  79. //returns fate, fills in hit time. If fate==HIT_NONE, hit_time undefined
  80. // Stuff hit_info with fvi data as set by find_vector_intersection.
  81. //for fvi_flags, refer to fvi.h for the fvi query flags
  82. int physics_lookahead(object *obj,fix t,int fvi_flags,fix *hit_time, fvi_info *hit_info);
  83. //Applies an instantaneous force on an object, resulting in an instantaneous
  84. //change in velocity.
  85. phys_apply_force(object *obj,vms_vector *force_vec);
  86. phys_apply_rot(object *obj,vms_vector *force_vec);
  87. //this routine will set the thrust for an object to a value that will
  88. //(hopefully) maintain the object's current velocity
  89. set_thrust_from_velocity(object *obj);
  90. #endif