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