diff options
Diffstat (limited to 'source/gameengine/Physics/common/PHY_DynamicTypes.h')
-rw-r--r-- | source/gameengine/Physics/common/PHY_DynamicTypes.h | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/source/gameengine/Physics/common/PHY_DynamicTypes.h b/source/gameengine/Physics/common/PHY_DynamicTypes.h index c5cf92b553a..7ce40001af7 100644 --- a/source/gameengine/Physics/common/PHY_DynamicTypes.h +++ b/source/gameengine/Physics/common/PHY_DynamicTypes.h @@ -19,12 +19,42 @@ subject to the following restrictions: - +struct KX_ClientObjectInfo; class PHY_Shape; struct PHY__Vector3 { float m_vec[4]; + + operator const float* () const + { + return &m_vec[0]; + } + operator float* () + { + return &m_vec[0]; + } +}; + +struct PHY__Vector4 +{ + float m_vec[4]; + PHY__Vector4() {} + void setValue(const float *value) + { + m_vec[0] = *value++; + m_vec[1] = *value++; + m_vec[2] = *value++; + m_vec[3] = *value++; + } + void setValue(const double *value) + { + m_vec[0] = (float)(*value++); + m_vec[1] = (float)(*value++); + m_vec[2] = (float)(*value++); + m_vec[3] = (float)(*value++); + } + operator const float* () const { return &m_vec[0]; @@ -34,6 +64,7 @@ struct PHY__Vector3 return &m_vec[0]; } }; + //typedef float PHY__Vector3[4]; enum @@ -59,7 +90,7 @@ enum void *client_object1, void *client_object2, const PHY_CollData *coll_data); - + typedef void (*PHY_CullingCallback)(KX_ClientObjectInfo* info, void* param); /// PHY_PhysicsType enumerates all possible Physics Entities. |