d85efa328296abf76326016a78fa394b1d76f907
[blender.git] / extern / bullet / Extras / PhysicsInterface / Common / PHY_DynamicTypes.h
1 /*
2  * Copyright (c) 2001-2005 Erwin Coumans <phy@erwincoumans.com>
3  *
4  * Permission to use, copy, modify, distribute and sell this software
5  * and its documentation for any purpose is hereby granted without fee,
6  * provided that the above copyright notice appear in all copies and
7  * that both that copyright notice and this permission notice appear
8  * in supporting documentation.  Erwin Coumans makes no
9  * representations about the suitability of this software for any
10  * purpose.  It is provided "as is" without express or implied warranty.
11  *
12  */
13
14 #ifndef __PHY_DYNAMIC_TYPES
15 #define __PHY_DYNAMIC_TYPES
16
17
18
19 class   PHY_ResponseTable;
20
21 class PHY_Shape;
22
23 struct  PHY__Vector3
24 {
25         float   m_vec[4];
26         operator const float* () const 
27         { 
28                 return &m_vec[0];
29         }       
30         operator float* () 
31         { 
32                 return &m_vec[0];
33         }       
34 };
35 //typedef       float   PHY__Vector3[4];
36
37 typedef enum
38 {
39         PHY_FH_RESPONSE,
40         PHY_SENSOR_RESPONSE,            /* Touch Sensors */
41         PHY_CAMERA_RESPONSE,    /* Visibility Culling */
42         PHY_OBJECT_RESPONSE,    /* Object Dynamic Geometry Response */
43         PHY_STATIC_RESPONSE,    /* Static Geometry Response */
44         
45         PHY_NUM_RESPONSE
46 };
47
48         typedef struct PHY_CollData {
49                 PHY__Vector3 m_point1;               /* Point in object1 in world coordinates */ 
50                 PHY__Vector3 m_point2;               /* Point in object2 in world coordinates */
51                 PHY__Vector3 m_normal;               /* point2 - point1 */ 
52         } PHY_CollData;
53
54
55         typedef bool (*PHY_ResponseCallback)(void *client_data,
56                                                                                    void *client_object1,
57                                                                                    void *client_object2,
58                                                                                    const PHY_CollData *coll_data);
59                 
60
61
62 /// PHY_PhysicsType enumerates all possible Physics Entities.
63 /// It is mainly used to create/add Physics Objects
64
65 typedef enum PHY_PhysicsType {
66         PHY_CONVEX_RIGIDBODY=16386,
67         PHY_CONCAVE_RIGIDBODY=16399,
68         PHY_CONVEX_FIXEDBODY=16388,//'collision object'
69         PHY_CONCAVE_FIXEDBODY=16401,
70         PHY_CONVEX_KINEMATICBODY=16387,// 
71         PHY_CONCAVE_KINEMATICBODY=16400,
72         PHY_CONVEX_PHANTOMBODY=16398,
73         PHY_CONCAVE_PHANTOMBODY=16402
74 } PHY_PhysicsType;
75
76 /// PHY_ConstraintType enumerates all supported Constraint Types
77 typedef enum PHY_ConstraintType {
78         PHY_POINT2POINT_CONSTRAINT=1,
79         PHY_LINEHINGE_CONSTRAINT,
80         PHY_VEHICLE_CONSTRAINT
81
82 } PHY_ConstraintType;
83
84 typedef float   PHY_Vector3[3];
85
86 #endif //__PHY_DYNAMIC_TYPES
87