From c844aa265ad4eb50ad0e18661470fa6092052728 Mon Sep 17 00:00:00 2001 From: Kester Maddock Date: Fri, 25 Mar 2005 10:33:39 +0000 Subject: Big patches: Erwin Coumans: Abstract the physics engine Charlie C: Joystick fixes Me: Moved the ray cast (shadows, mouse sensor & ray sensor) --- .../gameengine/Physics/common/PHY_DynamicTypes.h | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'source/gameengine/Physics/common/PHY_DynamicTypes.h') diff --git a/source/gameengine/Physics/common/PHY_DynamicTypes.h b/source/gameengine/Physics/common/PHY_DynamicTypes.h index 336e29e827a..f800a5494cb 100644 --- a/source/gameengine/Physics/common/PHY_DynamicTypes.h +++ b/source/gameengine/Physics/common/PHY_DynamicTypes.h @@ -42,6 +42,54 @@ typedef enum PHY_ScalarType { PHY_FIXEDPOINT88 } PHY_ScalarType; +class PHY_ResponseTable; + +class PHY_Shape; + +struct PHY__Vector3 +{ + float m_vec[4]; + operator const float* () const + { + return &m_vec[0]; + } + operator float* () + { + return &m_vec[0]; + } +}; +//typedef float PHY__Vector3[4]; + +typedef enum +{ + PHY_FH_RESPONSE, + PHY_SENSOR_RESPONSE, /* Touch Sensors */ + PHY_CAMERA_RESPONSE, /* Visibility Culling */ + PHY_OBJECT_RESPONSE, /* Object Dynamic Geometry Response */ + PHY_STATIC_RESPONSE, /* Static Geometry Response */ + + PHY_NUM_RESPONSE +}; + + typedef struct PHY_CollData { + PHY__Vector3 m_point1; /* Point in object1 in world coordinates */ + PHY__Vector3 m_point2; /* Point in object2 in world coordinates */ + PHY__Vector3 m_normal; /* point2 - point1 */ + } PHY_CollData; + +/* A response callback is called by SOLID for each pair of collding objects. 'client-data' + is a pointer to an arbitrary structure in the client application. The client objects are + pointers to structures in the client application associated with the coliding objects. + 'coll_data' is the collision data computed by SOLID. +*/ + + typedef bool (*PHY_ResponseCallback)(void *client_data, + void *client_object1, + void *client_object2, + const PHY_CollData *coll_data); + + + /// PHY_PhysicsType enumerates all possible Physics Entities. /// It is mainly used to create/add Physics Objects -- cgit v1.2.3