]> icculus.org git repositories - btb/d2x.git/blob - main/physics.h
use the orientation parameter of g3_draw_bitmap
[btb/d2x.git] / main / physics.h
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-1999 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
12 */
13
14 /*
15  *
16  * Headers for physics functions and data
17  *
18  */
19
20
21 #ifndef _PHYSICS_H
22 #define _PHYSICS_H
23
24 #include "vecmat.h"
25 #include "fvi.h"
26
27 //#define FL_NORMAL  0
28 //#define FL_TURBO   1
29 //#define FL_HOVER   2
30 //#define FL_REVERSE 3
31
32 // these global vars are set after a call to do_physics_sim().  Ugly, I know.
33 // list of segments went through
34 extern int phys_seglist[MAX_FVI_SEGS], n_phys_segs;
35
36 // Read contrls and set physics vars
37 void read_flying_controls(object *obj);
38
39 // Simulate a physics object for this frame
40 void do_physics_sim(object *obj);
41
42 // tell us what the given object will do (as far as hiting walls) in
43 // the given time (in seconds) t.  Igores acceleration (sorry)
44 // if check_objects is set, check with objects, else just with walls
45 // returns fate, fills in hit time.  If fate==HIT_NONE, hit_time undefined
46 // Stuff hit_info with fvi data as set by find_vector_intersection.
47 // for fvi_flags, refer to fvi.h for the fvi query flags
48 int physics_lookahead(object *obj, fix t, int fvi_flags, fix *hit_time, fvi_info *hit_info);
49
50 // Applies an instantaneous force on an object, resulting in an instantaneous
51 // change in velocity.
52 void phys_apply_force(object *obj, vms_vector *force_vec);
53 void phys_apply_rot(object *obj, vms_vector *force_vec);
54
55 // this routine will set the thrust for an object to a value that will
56 // (hopefully) maintain the object's current velocity
57 void set_thrust_from_velocity(object *obj);
58
59 #endif /* _PHYSICS_H */