| 1 | /* |
| 2 | * $Logfile: /DescentIII/Main/Lib/PHYSICS.H $ |
| 3 | * $Revision: 15 $ |
| 4 | * $Date: 4/14/99 3:59a $ |
| 5 | * $Author: Jeff $ |
| 6 | * |
| 7 | * Descent III Physics Header |
| 8 | * |
| 9 | * $Log: /DescentIII/Main/Lib/PHYSICS.H $ |
| 10 | * |
| 11 | * 15 4/14/99 3:59a Jeff |
| 12 | * fixed case mismatches in #includes |
| 13 | * |
| 14 | * 14 1/10/99 6:45a Jeff |
| 15 | * Changes made to get linux version to compile |
| 16 | * |
| 17 | * 13 12/21/98 1:39p Chris |
| 18 | * Matcens can hurt (or not hurt) players that are close to them |
| 19 | * |
| 20 | * 12 11/10/98 5:17p Jeff |
| 21 | * peppered in some more forcefeedback effects |
| 22 | * |
| 23 | * 11 10/16/98 3:39p Chris |
| 24 | * Improved the object linking system and AI and physics |
| 25 | * |
| 26 | * 10 10/15/98 3:26p Chris |
| 27 | * Fixed known ground plane issues and used PhysCalcGround everywhere |
| 28 | * |
| 29 | * 9 8/27/98 6:23p Jeff |
| 30 | * changed autoleveling in config so it is a slider...had to convert |
| 31 | * global from bool->uint8_t. Added fast headlight and mirrored surfaces to |
| 32 | * config menu |
| 33 | * |
| 34 | * 8 6/15/98 7:01a Chris |
| 35 | * Cleaned out DII stuff and added new PhysicsSim extern's |
| 36 | * |
| 37 | * 7 5/01/98 4:27p Chris |
| 38 | * Added externals for terrain and room autoleveling |
| 39 | * |
| 40 | * 6 4/16/98 6:50p Chris |
| 41 | * |
| 42 | * 5 2/19/98 6:17p Chris |
| 43 | * Added some debug info |
| 44 | * |
| 45 | * 4 1/20/98 5:27p Chris |
| 46 | * Added physics support for the vis. system |
| 47 | * |
| 48 | * 3 10/28/97 12:23p Chris |
| 49 | * Added a walking sim |
| 50 | * |
| 51 | * 2 9/11/97 12:43p Chris |
| 52 | * Added new support for face_physics_info from room.h. Also, changed how |
| 53 | * we detect portals. Also added recorded faces. |
| 54 | * |
| 55 | * 6 3/27/97 10:50a Chris |
| 56 | * Added bounce constant (PHYSICS_BOUNCE_UNLIMITED) for objects that can |
| 57 | * bounce forever |
| 58 | * |
| 59 | * 5 3/15/97 1:29p Chris |
| 60 | * |
| 61 | * $NoKeywords: $ |
| 62 | */ |
| 63 | |
| 64 | #ifndef PHYSICS_H |
| 65 | #define PHYSICS_H |
| 66 | |
| 67 | #include "findintersection.h" |
| 68 | #include "object.h" |
| 69 | #include "vecmat.h" |
| 70 | #include "viseffect.h" |
| 71 | |
| 72 | extern int Physics_normal_counter; |
| 73 | extern int Physics_normal_looping_counter; |
| 74 | extern int Physics_walking_counter; |
| 75 | extern int Physics_walking_looping_counter; |
| 76 | extern int Physics_vis_counter; |
| 77 | |
| 78 | // The current strength of the world's gravity |
| 79 | extern float Gravity_strength; |
| 80 | |
| 81 | #define PHYSICS_UNLIMITED_BOUNCE (-1) |
| 82 | |
| 83 | #ifdef _DEBUG |
| 84 | extern int Physics_player_verbose; |
| 85 | #endif |
| 86 | |
| 87 | extern uint8_t Default_player_terrain_leveling; |
| 88 | extern uint8_t Default_player_room_leveling; |
| 89 | |
| 90 | bool PhysicsDoSimRot(object *obj, float frame_time, matrix *orient, vector *rotforce, vector *rotvel, angle *turn_roll); |
| 91 | void PhysicsDoSimLinear(const object &obj, const vector &pos, const vector &force, vector &velocity, |
| 92 | vector &movementVec, vector &movementPos, float simTime, int count); |
| 93 | |
| 94 | extern int Physics_NumLinked; |
| 95 | extern int PhysicsLinkList[MAX_OBJECTS]; |
| 96 | |
| 97 | // Simulate a physics object for this frame |
| 98 | void do_physics_sim(object *obj); |
| 99 | |
| 100 | // Quick sim for vis stuff |
| 101 | void do_vis_physics_sim(vis_effect *vis); |
| 102 | |
| 103 | // Simulate a physics object for this frame |
| 104 | void do_walking_sim(object *obj); |
| 105 | |
| 106 | // Applies an instantaneous force on an object, resulting in an instantaneous |
| 107 | // change in velocity. |
| 108 | void phys_apply_force(object *obj, vector *force_vec, int16_t weapon_index = -1); |
| 109 | |
| 110 | // Applies an instantaneous whack on an object, resulting in an instantaneous change in orientation. |
| 111 | // TODO: does nothing |
| 112 | void phys_apply_rot(object *obj, vector *force_vec); |
| 113 | |
| 114 | // Determines the point and normal of the ground point |
| 115 | bool PhysCalcGround(vector *ground_point, vector *ground_normal, object *obj, int ground_num); |
| 116 | |
| 117 | // Linked objects arbitrary linking for things like weapons (unlike attached objects) |
| 118 | void DoPhysLinkedFrame(object *obj); |
| 119 | |
| 120 | #endif |