Created a KX_SoftBodyDeformer for real-time soft bodies.
[blender.git] / source / gameengine / Physics / 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
23 class PHY_Shape;
24
25 struct  PHY__Vector3
26 {
27         float   m_vec[4];
28         operator const float* () const 
29         { 
30                 return &m_vec[0];
31         }       
32         operator float* () 
33         { 
34                 return &m_vec[0];
35         }       
36 };
37 //typedef       float   PHY__Vector3[4];
38
39 typedef enum
40 {
41         PHY_FH_RESPONSE,
42         PHY_SENSOR_RESPONSE,    /* Touch Sensors */
43         PHY_CAMERA_RESPONSE,    /* Visibility Culling */
44         PHY_OBJECT_RESPONSE,    /* Object Dynamic Geometry Response */
45         PHY_STATIC_RESPONSE,    /* Static Geometry Response */
46         PHY_BROADPH_RESPONSE,   /* broadphase 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=2,
83         PHY_ANGULAR_CONSTRAINT = 3,//hinge without ball socket
84         PHY_CONE_TWIST_CONSTRAINT = 4,
85         PHY_VEHICLE_CONSTRAINT=11,//complex 'constraint' that turns a rigidbody into a vehicle
86         PHY_GENERIC_6DOF_CONSTRAINT=12,//can leave any of the 6 degree of freedom 'free' or 'locked'
87
88 } PHY_ConstraintType;
89
90 typedef enum PHY_ShapeType {
91         PHY_SHAPE_NONE,
92         PHY_SHAPE_BOX,
93         PHY_SHAPE_SPHERE,
94         PHY_SHAPE_CYLINDER,
95         PHY_SHAPE_CONE,
96         PHY_SHAPE_MESH,
97         PHY_SHAPE_POLYTOPE,
98         PHY_SHAPE_COMPOUND
99 } PHY_ShapeType;
100
101
102 typedef float   PHY_Vector3[3];
103
104 #endif //__PHY_DYNAMIC_TYPES
105