added hinge constraint support to Bullet physics
[blender.git] / extern / bullet / Extras / PhysicsInterface / Common / PHY_DynamicTypes.h
1 /*
2 Bullet Continuous Collision Detection and Physics Library
3 Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
4
5 This software is provided 'as-is', without any express or implied warranty.
6 In no event will the authors be held liable for any damages arising from the use of this software.
7 Permission is granted to anyone to use this software for any purpose, 
8 including commercial applications, and to alter it and redistribute it freely, 
9 subject to the following restrictions:
10
11 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
12 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
13 3. This notice may not be removed or altered from any source distribution.
14 */
15
16
17 #ifndef __PHY_DYNAMIC_TYPES
18 #define __PHY_DYNAMIC_TYPES
19
20
21
22 class   PHY_ResponseTable;
23
24 class PHY_Shape;
25
26 struct  PHY__Vector3
27 {
28         float   m_vec[4];
29         operator const float* () const 
30         { 
31                 return &m_vec[0];
32         }       
33         operator float* () 
34         { 
35                 return &m_vec[0];
36         }       
37 };
38 //typedef       float   PHY__Vector3[4];
39
40 typedef enum
41 {
42         PHY_FH_RESPONSE,
43         PHY_SENSOR_RESPONSE,            /* Touch Sensors */
44         PHY_CAMERA_RESPONSE,    /* Visibility Culling */
45         PHY_OBJECT_RESPONSE,    /* Object Dynamic Geometry Response */
46         PHY_STATIC_RESPONSE,    /* Static Geometry Response */
47         
48         PHY_NUM_RESPONSE
49 };
50
51         typedef struct PHY_CollData {
52                 PHY__Vector3 m_point1;               /* Point in object1 in world coordinates */ 
53                 PHY__Vector3 m_point2;               /* Point in object2 in world coordinates */
54                 PHY__Vector3 m_normal;               /* point2 - point1 */ 
55         } PHY_CollData;
56
57
58         typedef bool (*PHY_ResponseCallback)(void *client_data,
59                                                                                    void *client_object1,
60                                                                                    void *client_object2,
61                                                                                    const PHY_CollData *coll_data);
62                 
63
64
65 /// PHY_PhysicsType enumerates all possible Physics Entities.
66 /// It is mainly used to create/add Physics Objects
67
68 typedef enum PHY_PhysicsType {
69         PHY_CONVEX_RIGIDBODY=16386,
70         PHY_CONCAVE_RIGIDBODY=16399,
71         PHY_CONVEX_FIXEDBODY=16388,//'collision object'
72         PHY_CONCAVE_FIXEDBODY=16401,
73         PHY_CONVEX_KINEMATICBODY=16387,// 
74         PHY_CONCAVE_KINEMATICBODY=16400,
75         PHY_CONVEX_PHANTOMBODY=16398,
76         PHY_CONCAVE_PHANTOMBODY=16402
77 } PHY_PhysicsType;
78
79 /// PHY_ConstraintType enumerates all supported Constraint Types
80 typedef enum PHY_ConstraintType {
81         PHY_POINT2POINT_CONSTRAINT=1,
82         PHY_LINEHINGE_CONSTRAINT,
83         PHY_VEHICLE_CONSTRAINT
84
85 } PHY_ConstraintType;
86
87 typedef float   PHY_Vector3[3];
88
89 #endif //__PHY_DYNAMIC_TYPES
90