2006-04-28 00:08:18 +00:00
|
|
|
/*
|
|
|
|
Bullet Continuous Collision Detection and Physics Library
|
|
|
|
Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
|
|
|
|
|
|
|
|
This software is provided 'as-is', without any express or implied warranty.
|
|
|
|
In no event will the authors be held liable for any damages arising from the use of this software.
|
|
|
|
Permission is granted to anyone to use this software for any purpose,
|
|
|
|
including commercial applications, and to alter it and redistribute it freely,
|
|
|
|
subject to the following restrictions:
|
|
|
|
|
|
|
|
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.
|
|
|
|
2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
|
|
|
|
3. This notice may not be removed or altered from any source distribution.
|
|
|
|
*/
|
|
|
|
|
2011-02-22 12:42:55 +00:00
|
|
|
/** \file CcdPhysicsController.h
|
|
|
|
* \ingroup physbullet
|
|
|
|
*/
|
|
|
|
|
2005-07-16 10:15:31 +00:00
|
|
|
|
|
|
|
#ifndef BULLET2_PHYSICSCONTROLLER_H
|
|
|
|
#define BULLET2_PHYSICSCONTROLLER_H
|
|
|
|
|
2008-08-21 15:19:54 +00:00
|
|
|
#include <vector>
|
2008-09-20 21:33:54 +00:00
|
|
|
#include <map>
|
2008-08-21 15:19:54 +00:00
|
|
|
|
2005-07-16 10:15:31 +00:00
|
|
|
#include "PHY_IPhysicsController.h"
|
|
|
|
|
|
|
|
/// PHY_IPhysicsController is the abstract simplified Interface to a physical object.
|
|
|
|
/// It contains the IMotionState and IDeformableMesh Interfaces.
|
2006-11-21 00:53:40 +00:00
|
|
|
#include "btBulletDynamicsCommon.h"
|
2008-08-21 15:19:54 +00:00
|
|
|
#include "LinearMath/btTransform.h"
|
2005-08-17 19:52:56 +00:00
|
|
|
|
2006-05-22 21:03:43 +00:00
|
|
|
#include "PHY_IMotionState.h"
|
2006-02-21 05:36:56 +00:00
|
|
|
|
2005-08-03 18:22:30 +00:00
|
|
|
extern float gDeactivationTime;
|
|
|
|
extern float gLinearSleepingTreshold;
|
|
|
|
extern float gAngularSleepingTreshold;
|
2005-08-13 08:05:48 +00:00
|
|
|
extern bool gDisableDeactivation;
|
2005-12-31 07:20:08 +00:00
|
|
|
class CcdPhysicsEnvironment;
|
2006-11-21 00:53:40 +00:00
|
|
|
class btMotionState;
|
2008-08-21 15:19:54 +00:00
|
|
|
class RAS_MeshObject;
|
2009-05-14 13:47:08 +00:00
|
|
|
struct DerivedMesh;
|
2008-08-21 15:19:54 +00:00
|
|
|
class btCollisionShape;
|
|
|
|
|
2008-09-28 03:07:13 +00:00
|
|
|
|
|
|
|
#define CCD_BSB_SHAPE_MATCHING 2
|
|
|
|
#define CCD_BSB_BENDING_CONSTRAINTS 8
|
|
|
|
#define CCD_BSB_AERO_VPOINT 16 /* aero model, Vertex normals are oriented toward velocity*/
|
|
|
|
#define CCD_BSB_AERO_VTWOSIDE 32 /* aero model, Vertex normals are flipped to match velocity */
|
|
|
|
|
|
|
|
/* BulletSoftBody.collisionflags */
|
|
|
|
#define CCD_BSB_COL_SDF_RS 2 /* SDF based rigid vs soft */
|
|
|
|
#define CCD_BSB_COL_CL_RS 4 /* Cluster based rigid vs soft */
|
|
|
|
#define CCD_BSB_COL_CL_SS 8 /* Cluster based soft vs soft */
|
|
|
|
#define CCD_BSB_COL_VF_SS 16 /* Vertex/Face based soft vs soft */
|
|
|
|
|
|
|
|
|
2008-08-21 15:19:54 +00:00
|
|
|
// Shape contructor
|
|
|
|
// It contains all the information needed to create a simple bullet shape at runtime
|
|
|
|
class CcdShapeConstructionInfo
|
|
|
|
{
|
|
|
|
public:
|
2009-12-04 11:27:40 +00:00
|
|
|
struct UVco
|
|
|
|
{
|
|
|
|
float uv[2];
|
|
|
|
};
|
|
|
|
|
2010-02-03 21:41:03 +00:00
|
|
|
static CcdShapeConstructionInfo* FindMesh(class RAS_MeshObject* mesh, struct DerivedMesh* dm, bool polytope);
|
2008-09-20 21:33:54 +00:00
|
|
|
|
2008-08-21 15:19:54 +00:00
|
|
|
CcdShapeConstructionInfo() :
|
|
|
|
m_shapeType(PHY_SHAPE_NONE),
|
|
|
|
m_radius(1.0),
|
|
|
|
m_height(1.0),
|
|
|
|
m_halfExtend(0.f,0.f,0.f),
|
2008-09-13 11:46:07 +00:00
|
|
|
m_childScale(1.0f,1.0f,1.0f),
|
2009-01-13 22:59:18 +00:00
|
|
|
m_userData(NULL),
|
2008-09-20 21:33:54 +00:00
|
|
|
m_refCount(1),
|
|
|
|
m_meshObject(NULL),
|
2008-09-26 02:27:59 +00:00
|
|
|
m_unscaledShape(NULL),
|
2009-11-24 22:44:29 +00:00
|
|
|
m_forceReInstance(false),
|
2009-03-29 19:54:05 +00:00
|
|
|
m_weldingThreshold1(0.f),
|
2009-01-13 22:59:18 +00:00
|
|
|
m_shapeProxy(NULL)
|
2008-08-21 15:19:54 +00:00
|
|
|
{
|
|
|
|
m_childTrans.setIdentity();
|
|
|
|
}
|
2005-08-03 18:22:30 +00:00
|
|
|
|
2008-08-21 15:19:54 +00:00
|
|
|
~CcdShapeConstructionInfo();
|
2006-08-28 06:44:29 +00:00
|
|
|
|
2008-08-21 15:19:54 +00:00
|
|
|
CcdShapeConstructionInfo* AddRef()
|
|
|
|
{
|
|
|
|
m_refCount++;
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
int Release()
|
|
|
|
{
|
|
|
|
if (--m_refCount > 0)
|
|
|
|
return m_refCount;
|
|
|
|
delete this;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2009-01-13 22:59:18 +00:00
|
|
|
bool IsUnused(void)
|
|
|
|
{
|
|
|
|
return (m_meshObject==NULL && m_shapeArray.size() == 0 && m_shapeProxy == NULL);
|
|
|
|
}
|
|
|
|
|
2008-08-21 15:19:54 +00:00
|
|
|
void AddShape(CcdShapeConstructionInfo* shapeInfo);
|
|
|
|
|
2008-09-13 16:03:11 +00:00
|
|
|
btTriangleMeshShape* GetMeshShape(void)
|
|
|
|
{
|
2009-12-04 11:27:40 +00:00
|
|
|
return (m_unscaledShape);
|
2008-09-13 16:03:11 +00:00
|
|
|
}
|
BGE patch: KX_GameObject::rayCast() improvements to have X-Ray option, return true face normal and hit polygon information.
rayCast(to,from,dist,prop,face,xray,poly):
The face paremeter determines the orientation of the normal:
0 or omitted => hit normal is always oriented towards the ray origin (as if you casted the ray from outside)
1 => hit normal is the real face normal (only for mesh object, otherwise face has no effect)
The ray has X-Ray capability if xray parameter is 1, otherwise the first object hit (other than self object) stops the ray.
The prop and xray parameters interact as follow:
prop off, xray off: return closest hit or no hit if there is no object on the full extend of the ray.
prop off, xray on : idem.
prop on, xray off: return closest hit if it matches prop, no hit otherwise.
prop on, xray on : return closest hit matching prop or no hit if there is no object matching prop on the full extend of the ray.
if poly is 0 or omitted, returns a 3-tuple with object reference, hit point and hit normal or (None,None,None) if no hit.
if poly is 1, returns a 4-tuple with in addition a KX_PolyProxy as 4th element.
The KX_PolyProxy object holds information on the polygon hit by the ray: the index of the vertex forming the poylgon, material, etc.
Attributes (read-only):
matname: The name of polygon material, empty if no material.
material: The material of the polygon
texture: The texture name of the polygon.
matid: The material index of the polygon, use this to retrieve vertex proxy from mesh proxy
v1: vertex index of the first vertex of the polygon, use this to retrieve vertex proxy from mesh proxy
v2: vertex index of the second vertex of the polygon, use this to retrieve vertex proxy from mesh proxy
v3: vertex index of the third vertex of the polygon, use this to retrieve vertex proxy from mesh proxy
v4: vertex index of the fourth vertex of the polygon, 0 if polygon has only 3 vertex
use this to retrieve vertex proxy from mesh proxy
visible: visible state of the polygon: 1=visible, 0=invisible
collide: collide state of the polygon: 1=receives collision, 0=collision free.
Methods:
getMaterialName(): Returns the polygon material name with MA prefix
getMaterial(): Returns the polygon material
getTextureName(): Returns the polygon texture name
getMaterialIndex(): Returns the material bucket index of the polygon.
getNumVertex(): Returns the number of vertex of the polygon.
isVisible(): Returns whether the polygon is visible or not
isCollider(): Returns whether the polygon is receives collision or not
getVertexIndex(vertex): Returns the mesh vertex index of a polygon vertex
getMesh(): Returns a mesh proxy
New methods of KX_MeshProxy have been implemented to retrieve KX_PolyProxy objects:
getNumPolygons(): Returns the number of polygon in the mesh.
getPolygon(index): Gets the specified polygon from the mesh.
More details in PyDoc.
2008-08-27 19:34:19 +00:00
|
|
|
CcdShapeConstructionInfo* GetChildShape(int i)
|
|
|
|
{
|
2009-04-19 17:29:07 +00:00
|
|
|
if (i < 0 || i >= (int)m_shapeArray.size())
|
2008-09-20 21:33:54 +00:00
|
|
|
return NULL;
|
|
|
|
|
|
|
|
return m_shapeArray.at(i);
|
BGE patch: KX_GameObject::rayCast() improvements to have X-Ray option, return true face normal and hit polygon information.
rayCast(to,from,dist,prop,face,xray,poly):
The face paremeter determines the orientation of the normal:
0 or omitted => hit normal is always oriented towards the ray origin (as if you casted the ray from outside)
1 => hit normal is the real face normal (only for mesh object, otherwise face has no effect)
The ray has X-Ray capability if xray parameter is 1, otherwise the first object hit (other than self object) stops the ray.
The prop and xray parameters interact as follow:
prop off, xray off: return closest hit or no hit if there is no object on the full extend of the ray.
prop off, xray on : idem.
prop on, xray off: return closest hit if it matches prop, no hit otherwise.
prop on, xray on : return closest hit matching prop or no hit if there is no object matching prop on the full extend of the ray.
if poly is 0 or omitted, returns a 3-tuple with object reference, hit point and hit normal or (None,None,None) if no hit.
if poly is 1, returns a 4-tuple with in addition a KX_PolyProxy as 4th element.
The KX_PolyProxy object holds information on the polygon hit by the ray: the index of the vertex forming the poylgon, material, etc.
Attributes (read-only):
matname: The name of polygon material, empty if no material.
material: The material of the polygon
texture: The texture name of the polygon.
matid: The material index of the polygon, use this to retrieve vertex proxy from mesh proxy
v1: vertex index of the first vertex of the polygon, use this to retrieve vertex proxy from mesh proxy
v2: vertex index of the second vertex of the polygon, use this to retrieve vertex proxy from mesh proxy
v3: vertex index of the third vertex of the polygon, use this to retrieve vertex proxy from mesh proxy
v4: vertex index of the fourth vertex of the polygon, 0 if polygon has only 3 vertex
use this to retrieve vertex proxy from mesh proxy
visible: visible state of the polygon: 1=visible, 0=invisible
collide: collide state of the polygon: 1=receives collision, 0=collision free.
Methods:
getMaterialName(): Returns the polygon material name with MA prefix
getMaterial(): Returns the polygon material
getTextureName(): Returns the polygon texture name
getMaterialIndex(): Returns the material bucket index of the polygon.
getNumVertex(): Returns the number of vertex of the polygon.
isVisible(): Returns whether the polygon is visible or not
isCollider(): Returns whether the polygon is receives collision or not
getVertexIndex(vertex): Returns the mesh vertex index of a polygon vertex
getMesh(): Returns a mesh proxy
New methods of KX_MeshProxy have been implemented to retrieve KX_PolyProxy objects:
getNumPolygons(): Returns the number of polygon in the mesh.
getPolygon(index): Gets the specified polygon from the mesh.
More details in PyDoc.
2008-08-27 19:34:19 +00:00
|
|
|
}
|
2009-01-13 22:59:18 +00:00
|
|
|
int FindChildShape(CcdShapeConstructionInfo* shapeInfo, void* userData)
|
|
|
|
{
|
|
|
|
if (shapeInfo == NULL)
|
|
|
|
return -1;
|
2009-04-19 17:29:07 +00:00
|
|
|
for (int i=0; i<(int)m_shapeArray.size(); i++)
|
2009-01-13 22:59:18 +00:00
|
|
|
{
|
|
|
|
CcdShapeConstructionInfo* childInfo = m_shapeArray.at(i);
|
|
|
|
if ((userData == NULL || userData == childInfo->m_userData) &&
|
|
|
|
(childInfo == shapeInfo ||
|
|
|
|
(childInfo->m_shapeType == PHY_SHAPE_PROXY &&
|
|
|
|
childInfo->m_shapeProxy == shapeInfo)))
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool RemoveChildShape(int i)
|
|
|
|
{
|
2009-04-19 17:29:07 +00:00
|
|
|
if (i < 0 || i >= (int)m_shapeArray.size())
|
2009-01-13 22:59:18 +00:00
|
|
|
return false;
|
|
|
|
m_shapeArray.at(i)->Release();
|
2009-04-19 17:29:07 +00:00
|
|
|
if (i < (int)m_shapeArray.size()-1)
|
2009-01-13 22:59:18 +00:00
|
|
|
m_shapeArray[i] = m_shapeArray.back();
|
|
|
|
m_shapeArray.pop_back();
|
|
|
|
return true;
|
|
|
|
}
|
2008-08-21 15:19:54 +00:00
|
|
|
|
2010-02-03 21:41:03 +00:00
|
|
|
bool SetMesh(class RAS_MeshObject* mesh, struct DerivedMesh* dm, bool polytope);
|
2008-09-20 21:33:54 +00:00
|
|
|
RAS_MeshObject* GetMesh(void)
|
|
|
|
{
|
|
|
|
return m_meshObject;
|
|
|
|
}
|
2008-08-21 15:19:54 +00:00
|
|
|
|
2009-07-25 22:57:29 +00:00
|
|
|
bool UpdateMesh(class KX_GameObject* gameobj, class RAS_MeshObject* mesh);
|
|
|
|
|
|
|
|
|
2009-01-13 22:59:18 +00:00
|
|
|
bool SetProxy(CcdShapeConstructionInfo* shapeInfo);
|
|
|
|
CcdShapeConstructionInfo* GetProxy(void)
|
|
|
|
{
|
|
|
|
return m_shapeProxy;
|
|
|
|
}
|
|
|
|
|
2010-02-03 21:41:03 +00:00
|
|
|
btCollisionShape* CreateBulletShape(btScalar margin, bool useGimpact=false, bool useBvh=true);
|
2008-08-21 15:19:54 +00:00
|
|
|
|
|
|
|
// member variables
|
|
|
|
PHY_ShapeType m_shapeType;
|
|
|
|
btScalar m_radius;
|
|
|
|
btScalar m_height;
|
|
|
|
btVector3 m_halfExtend;
|
|
|
|
btTransform m_childTrans;
|
2008-09-13 11:46:07 +00:00
|
|
|
btVector3 m_childScale;
|
2009-01-13 22:59:18 +00:00
|
|
|
void* m_userData;
|
2009-04-27 22:21:42 +00:00
|
|
|
btAlignedObjectArray<btScalar> m_vertexArray; // Contains both vertex array for polytope shape and
|
|
|
|
// triangle array for concave mesh shape. Each vertex is 3 consecutive values
|
2008-08-21 15:19:54 +00:00
|
|
|
// In this case a triangle is made of 3 consecutive points
|
BGE patch: KX_GameObject::rayCast() improvements to have X-Ray option, return true face normal and hit polygon information.
rayCast(to,from,dist,prop,face,xray,poly):
The face paremeter determines the orientation of the normal:
0 or omitted => hit normal is always oriented towards the ray origin (as if you casted the ray from outside)
1 => hit normal is the real face normal (only for mesh object, otherwise face has no effect)
The ray has X-Ray capability if xray parameter is 1, otherwise the first object hit (other than self object) stops the ray.
The prop and xray parameters interact as follow:
prop off, xray off: return closest hit or no hit if there is no object on the full extend of the ray.
prop off, xray on : idem.
prop on, xray off: return closest hit if it matches prop, no hit otherwise.
prop on, xray on : return closest hit matching prop or no hit if there is no object matching prop on the full extend of the ray.
if poly is 0 or omitted, returns a 3-tuple with object reference, hit point and hit normal or (None,None,None) if no hit.
if poly is 1, returns a 4-tuple with in addition a KX_PolyProxy as 4th element.
The KX_PolyProxy object holds information on the polygon hit by the ray: the index of the vertex forming the poylgon, material, etc.
Attributes (read-only):
matname: The name of polygon material, empty if no material.
material: The material of the polygon
texture: The texture name of the polygon.
matid: The material index of the polygon, use this to retrieve vertex proxy from mesh proxy
v1: vertex index of the first vertex of the polygon, use this to retrieve vertex proxy from mesh proxy
v2: vertex index of the second vertex of the polygon, use this to retrieve vertex proxy from mesh proxy
v3: vertex index of the third vertex of the polygon, use this to retrieve vertex proxy from mesh proxy
v4: vertex index of the fourth vertex of the polygon, 0 if polygon has only 3 vertex
use this to retrieve vertex proxy from mesh proxy
visible: visible state of the polygon: 1=visible, 0=invisible
collide: collide state of the polygon: 1=receives collision, 0=collision free.
Methods:
getMaterialName(): Returns the polygon material name with MA prefix
getMaterial(): Returns the polygon material
getTextureName(): Returns the polygon texture name
getMaterialIndex(): Returns the material bucket index of the polygon.
getNumVertex(): Returns the number of vertex of the polygon.
isVisible(): Returns whether the polygon is visible or not
isCollider(): Returns whether the polygon is receives collision or not
getVertexIndex(vertex): Returns the mesh vertex index of a polygon vertex
getMesh(): Returns a mesh proxy
New methods of KX_MeshProxy have been implemented to retrieve KX_PolyProxy objects:
getNumPolygons(): Returns the number of polygon in the mesh.
getPolygon(index): Gets the specified polygon from the mesh.
More details in PyDoc.
2008-08-27 19:34:19 +00:00
|
|
|
std::vector<int> m_polygonIndexArray; // Contains the array of polygon index in the
|
|
|
|
// original mesh that correspond to shape triangles.
|
|
|
|
// only set for concave mesh shape.
|
2009-03-23 06:00:21 +00:00
|
|
|
|
|
|
|
std::vector<int> m_triFaceArray; // Contains an array of triplets of face indicies
|
|
|
|
// quads turn into 2 tris
|
BGE patch: KX_GameObject::rayCast() improvements to have X-Ray option, return true face normal and hit polygon information.
rayCast(to,from,dist,prop,face,xray,poly):
The face paremeter determines the orientation of the normal:
0 or omitted => hit normal is always oriented towards the ray origin (as if you casted the ray from outside)
1 => hit normal is the real face normal (only for mesh object, otherwise face has no effect)
The ray has X-Ray capability if xray parameter is 1, otherwise the first object hit (other than self object) stops the ray.
The prop and xray parameters interact as follow:
prop off, xray off: return closest hit or no hit if there is no object on the full extend of the ray.
prop off, xray on : idem.
prop on, xray off: return closest hit if it matches prop, no hit otherwise.
prop on, xray on : return closest hit matching prop or no hit if there is no object matching prop on the full extend of the ray.
if poly is 0 or omitted, returns a 3-tuple with object reference, hit point and hit normal or (None,None,None) if no hit.
if poly is 1, returns a 4-tuple with in addition a KX_PolyProxy as 4th element.
The KX_PolyProxy object holds information on the polygon hit by the ray: the index of the vertex forming the poylgon, material, etc.
Attributes (read-only):
matname: The name of polygon material, empty if no material.
material: The material of the polygon
texture: The texture name of the polygon.
matid: The material index of the polygon, use this to retrieve vertex proxy from mesh proxy
v1: vertex index of the first vertex of the polygon, use this to retrieve vertex proxy from mesh proxy
v2: vertex index of the second vertex of the polygon, use this to retrieve vertex proxy from mesh proxy
v3: vertex index of the third vertex of the polygon, use this to retrieve vertex proxy from mesh proxy
v4: vertex index of the fourth vertex of the polygon, 0 if polygon has only 3 vertex
use this to retrieve vertex proxy from mesh proxy
visible: visible state of the polygon: 1=visible, 0=invisible
collide: collide state of the polygon: 1=receives collision, 0=collision free.
Methods:
getMaterialName(): Returns the polygon material name with MA prefix
getMaterial(): Returns the polygon material
getTextureName(): Returns the polygon texture name
getMaterialIndex(): Returns the material bucket index of the polygon.
getNumVertex(): Returns the number of vertex of the polygon.
isVisible(): Returns whether the polygon is visible or not
isCollider(): Returns whether the polygon is receives collision or not
getVertexIndex(vertex): Returns the mesh vertex index of a polygon vertex
getMesh(): Returns a mesh proxy
New methods of KX_MeshProxy have been implemented to retrieve KX_PolyProxy objects:
getNumPolygons(): Returns the number of polygon in the mesh.
getPolygon(index): Gets the specified polygon from the mesh.
More details in PyDoc.
2008-08-27 19:34:19 +00:00
|
|
|
|
2009-12-04 11:27:40 +00:00
|
|
|
std::vector<UVco> m_triFaceUVcoArray; // Contains an array of pair of UV coordinate for each vertex of faces
|
|
|
|
// quads turn into 2 tris
|
|
|
|
|
2009-03-29 19:54:05 +00:00
|
|
|
void setVertexWeldingThreshold1(float threshold)
|
2008-09-26 06:25:35 +00:00
|
|
|
{
|
2009-04-27 22:21:42 +00:00
|
|
|
m_weldingThreshold1 = threshold*threshold;
|
2008-09-26 06:25:35 +00:00
|
|
|
}
|
2008-08-21 15:19:54 +00:00
|
|
|
protected:
|
2008-09-20 21:33:54 +00:00
|
|
|
static std::map<RAS_MeshObject*, CcdShapeConstructionInfo*> m_meshShapeMap;
|
2008-08-21 15:19:54 +00:00
|
|
|
int m_refCount; // this class is shared between replicas
|
|
|
|
// keep track of users so that we can release it
|
2008-09-20 21:33:54 +00:00
|
|
|
RAS_MeshObject* m_meshObject; // Keep a pointer to the original mesh
|
|
|
|
btBvhTriangleMeshShape* m_unscaledShape;// holds the shared unscale BVH mesh shape,
|
|
|
|
// the actual shape is of type btScaledBvhTriangleMeshShape
|
|
|
|
std::vector<CcdShapeConstructionInfo*> m_shapeArray; // for compound shapes
|
2009-07-25 22:57:29 +00:00
|
|
|
bool m_forceReInstance; //use gimpact for concave dynamic/moving collision detection
|
2009-03-29 19:54:05 +00:00
|
|
|
float m_weldingThreshold1; //welding closeby vertices together can improve softbody stability etc.
|
2009-01-13 22:59:18 +00:00
|
|
|
CcdShapeConstructionInfo* m_shapeProxy; // only used for PHY_SHAPE_PROXY, pointer to actual shape info
|
2009-08-18 15:37:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
#ifdef WITH_CXX_GUARDEDALLOC
|
|
|
|
public:
|
2010-06-06 01:15:44 +00:00
|
|
|
void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CcdShapeConstructionInfo"); }
|
2009-08-18 15:37:31 +00:00
|
|
|
void operator delete( void *mem ) { MEM_freeN(mem); }
|
|
|
|
#endif
|
2008-08-21 15:19:54 +00:00
|
|
|
};
|
2006-08-28 06:44:29 +00:00
|
|
|
|
2005-07-16 10:15:31 +00:00
|
|
|
struct CcdConstructionInfo
|
|
|
|
{
|
2006-08-28 06:44:29 +00:00
|
|
|
|
|
|
|
///CollisionFilterGroups provides some optional usage of basic collision filtering
|
|
|
|
///this is done during broadphase, so very early in the pipeline
|
2006-11-21 00:53:40 +00:00
|
|
|
///more advanced collision filtering should be done in btCollisionDispatcher::NeedsCollision
|
2006-08-28 06:44:29 +00:00
|
|
|
enum CollisionFilterGroups
|
|
|
|
{
|
2011-09-03 02:15:49 +00:00
|
|
|
DefaultFilter = 1,
|
|
|
|
StaticFilter = 2,
|
|
|
|
KinematicFilter = 4,
|
|
|
|
DebrisFilter = 8,
|
|
|
|
SensorFilter = 16,
|
|
|
|
AllFilter = DefaultFilter | StaticFilter | KinematicFilter | DebrisFilter | SensorFilter,
|
2006-08-28 06:44:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2005-07-16 10:15:31 +00:00
|
|
|
CcdConstructionInfo()
|
2011-06-11 15:37:16 +00:00
|
|
|
:m_localInertiaTensor(1.f, 1.f, 1.f),
|
Merge of first part of changes from the apricot branch, especially
the features that are needed to run the game. Compile tested with
scons, make, but not cmake, that seems to have an issue not related
to these changes. The changes include:
* GLSL support in the viewport and game engine, enable in the game
menu in textured draw mode.
* Synced and merged part of the duplicated blender and gameengine/
gameplayer drawing code.
* Further refactoring of game engine drawing code, especially mesh
storage changed a lot.
* Optimizations in game engine armatures to avoid recomputations.
* A python function to get the framerate estimate in game.
* An option take object color into account in materials.
* An option to restrict shadow casters to a lamp's layers.
* Increase from 10 to 18 texture slots for materials, lamps, word.
An extra texture slot shows up once the last slot is used.
* Memory limit for undo, not enabled by default yet because it
needs the .B.blend to be changed.
* Multiple undo for image painting.
* An offset for dupligroups, so not all objects in a group have to
be at the origin.
2008-09-04 20:51:28 +00:00
|
|
|
m_gravity(0,0,0),
|
2006-08-28 06:44:29 +00:00
|
|
|
m_scaling(1.f,1.f,1.f),
|
2005-07-16 10:15:31 +00:00
|
|
|
m_mass(0.f),
|
2011-06-11 15:37:16 +00:00
|
|
|
m_clamp_vel_min(-1.f),
|
|
|
|
m_clamp_vel_max(-1.f),
|
2005-07-16 10:15:31 +00:00
|
|
|
m_restitution(0.1f),
|
2006-04-26 03:20:28 +00:00
|
|
|
m_friction(0.5f),
|
2005-07-16 10:15:31 +00:00
|
|
|
m_linearDamping(0.1f),
|
|
|
|
m_angularDamping(0.1f),
|
BGE patch: new Physics button and margin parameter in Logic panel. Change subversion.
The Physics button controls the creation of a physics representation
of the object when starting the game. If the button is not selected,
the object is a pure graphical object with no physics representation
and all the other physics buttons are hidden.
Selecting this button gives access to the usual physics buttons.
The physics button is enabled by default to match previous Blender
behavior.
The margin parameter allows to control the collision margin from
the UI. Previously, this parameter was only accessible through
Python. By default, the collision margin is set to 0.0 on static
objects and 0.06 on dynamic objects.
To maintain compatibility with older games, the collision margin
is set to 0.06 on all objects when loading older blend file.
Note about the collision algorithms in Bullet 2.71
--------------------------------------------------
Bullet 2.71 handles the collision margin differently than Bullet 2.53
(the previous Bullet version in Blender). The collision margin is
now kept "inside" the object for box, sphere and cylinder bound
shapes. This means that two objects bound to any of these shape will
come in close contact when colliding.
The static mesh, convex hull and cone shapes still have their
collision margin "outside" the object, which leaves a space of 1
or 2 times the collision margin between objects.
The situation with Bullet 2.53 was more complicated, generally
leading to more space between objects, except for box-box collisions.
This means that running a old game under Bullet 2.71 may cause
visual problems, especially if the objects are small. You can fix
these problems by changing some visual aspect of the objects:
center, shape, size, position of children, etc.
2008-09-14 19:34:06 +00:00
|
|
|
m_margin(0.06f),
|
2008-09-25 03:02:30 +00:00
|
|
|
m_gamesoftFlag(0),
|
2011-06-11 15:37:16 +00:00
|
|
|
m_soft_linStiff(1.f),
|
|
|
|
m_soft_angStiff(1.f),
|
|
|
|
m_soft_volume(1.f),
|
|
|
|
m_soft_viterations(0),
|
|
|
|
m_soft_piterations(1),
|
|
|
|
m_soft_diterations(0),
|
|
|
|
m_soft_citerations(4),
|
|
|
|
m_soft_kSRHR_CL(0.1f),
|
|
|
|
m_soft_kSKHR_CL(1.f),
|
|
|
|
m_soft_kSSHR_CL(0.5f),
|
|
|
|
m_soft_kSR_SPLT_CL(0.5f),
|
|
|
|
m_soft_kSK_SPLT_CL(0.5f),
|
|
|
|
m_soft_kSS_SPLT_CL(0.5f),
|
|
|
|
m_soft_kVCF(1.f),
|
|
|
|
m_soft_kDP(0.f),
|
|
|
|
m_soft_kDG(0.f),
|
|
|
|
m_soft_kLF(0.f),
|
|
|
|
m_soft_kPR(0.f),
|
|
|
|
m_soft_kVC(0.f),
|
|
|
|
m_soft_kDF(0.2f),
|
|
|
|
m_soft_kMT(0),
|
|
|
|
m_soft_kCHR(1.0f),
|
|
|
|
m_soft_kKHR(0.1f),
|
|
|
|
m_soft_kSHR(1.0f),
|
|
|
|
m_soft_kAHR(0.7f),
|
2006-08-28 06:44:29 +00:00
|
|
|
m_collisionFlags(0),
|
2008-05-01 16:00:59 +00:00
|
|
|
m_bRigid(false),
|
2008-09-21 15:17:50 +00:00
|
|
|
m_bSoft(false),
|
BGE: new sensor object to generalize Near and Radar sensor, static-static collision capbility.
A new type of "Sensor" physics object is available in the GE for advanced
collision management. It's called Sensor for its similarities with the
physics objects that underlie the Near and Radar sensors.
Like the Near and Radar object it is:
- static and ghost
- invisible by default
- always active to ensure correct collision detection
- capable of detecting both static and dynamic objects
- ignoring collision with their parent
- capable of broadphase filtering based on:
* Actor option: the collisioning object must have the Actor flag set to be detected
* property/material: as specified in the collision sensors attached to it
Broadphase filtering is important for performance reason: the collision points
will be computed only for the objects that pass the broahphase filter.
- automatically removed from the simulation when no collision sensor is active on it
Unlike the Near and Radar object it can:
- take any shape, including triangle mesh
- be made visible for debugging (just use the Visible actuator)
- have multiple collision sensors using it
Other than that, the sensor objects are ordinary objects. You can move them
freely or parent them. When parented to a dynamic object, they can provide
advanced collision control to this object.
The type of collision capability depends on the shape:
- box, sphere, cylinder, cone, convex hull provide volume detection.
- triangle mesh provides surface detection but you can give some volume
to the suface by increasing the margin in the Advanced Settings panel.
The margin applies on both sides of the surface.
Performance tip:
- Sensor objects perform better than Near and Radar: they do less synchronizations
because of the Scenegraph optimizations and they can have multiple collision sensors
on them (with different property filtering for example).
- Always prefer simple shape (box, sphere) to complex shape whenever possible.
- Always use broadphase filtering (avoid collision sensor with empty propery/material)
- Use collision sensor only when you need them. When no collision sensor is active
on the sensor object, it is removed from the simulation and consume no CPU.
Known limitations:
- When running Blender in debug mode, you will see one warning line of the console:
"warning btCollisionDispatcher::needsCollision: static-static collision!"
In release mode this message is not printed.
- Collision margin has no effect on sphere, cone and cylinder shape.
Other performance improvements:
- Remove unnecessary interpolation for Near and Radar objects and by extension
sensor objects.
- Use direct matrix copy instead of quaternion to synchronize orientation.
Other bug fix:
- Fix Near/Radar position error on newly activated objects. This was causing
several detection problems in YoFrankie
- Fix margin not passed correctly to gImpact shape.
- Disable force/velocity actions on static objects
2009-05-17 12:51:51 +00:00
|
|
|
m_bSensor(false),
|
2010-02-03 21:41:03 +00:00
|
|
|
m_bGimpact(false),
|
2006-08-28 06:44:29 +00:00
|
|
|
m_collisionFilterGroup(DefaultFilter),
|
|
|
|
m_collisionFilterMask(AllFilter),
|
2008-03-01 19:17:37 +00:00
|
|
|
m_collisionShape(0),
|
2005-07-16 10:15:31 +00:00
|
|
|
m_MotionState(0),
|
2008-08-21 15:19:54 +00:00
|
|
|
m_shapeInfo(0),
|
2005-12-31 21:59:56 +00:00
|
|
|
m_physicsEnv(0),
|
2008-09-29 03:09:03 +00:00
|
|
|
m_inertiaFactor(1.f),
|
|
|
|
m_do_anisotropic(false),
|
2009-05-23 22:35:47 +00:00
|
|
|
m_anisotropicFriction(1.f,1.f,1.f),
|
2011-04-20 04:55:58 +00:00
|
|
|
m_do_fh(false),
|
|
|
|
m_do_rot_fh(false),
|
|
|
|
m_fh_spring(0.f),
|
|
|
|
m_fh_damping(0.f),
|
|
|
|
m_fh_distance(1.f),
|
|
|
|
m_fh_normal(false),
|
2011-06-11 15:37:16 +00:00
|
|
|
m_contactProcessingThreshold(1e10f)
|
2005-07-16 10:15:31 +00:00
|
|
|
{
|
2011-04-20 04:55:58 +00:00
|
|
|
|
2005-07-16 10:15:31 +00:00
|
|
|
}
|
2005-12-31 21:59:56 +00:00
|
|
|
|
2006-11-21 00:53:40 +00:00
|
|
|
btVector3 m_localInertiaTensor;
|
|
|
|
btVector3 m_gravity;
|
|
|
|
btVector3 m_scaling;
|
|
|
|
btScalar m_mass;
|
2009-04-14 12:34:39 +00:00
|
|
|
btScalar m_clamp_vel_min;
|
|
|
|
btScalar m_clamp_vel_max;
|
2006-11-21 00:53:40 +00:00
|
|
|
btScalar m_restitution;
|
|
|
|
btScalar m_friction;
|
|
|
|
btScalar m_linearDamping;
|
|
|
|
btScalar m_angularDamping;
|
BGE patch: new Physics button and margin parameter in Logic panel. Change subversion.
The Physics button controls the creation of a physics representation
of the object when starting the game. If the button is not selected,
the object is a pure graphical object with no physics representation
and all the other physics buttons are hidden.
Selecting this button gives access to the usual physics buttons.
The physics button is enabled by default to match previous Blender
behavior.
The margin parameter allows to control the collision margin from
the UI. Previously, this parameter was only accessible through
Python. By default, the collision margin is set to 0.0 on static
objects and 0.06 on dynamic objects.
To maintain compatibility with older games, the collision margin
is set to 0.06 on all objects when loading older blend file.
Note about the collision algorithms in Bullet 2.71
--------------------------------------------------
Bullet 2.71 handles the collision margin differently than Bullet 2.53
(the previous Bullet version in Blender). The collision margin is
now kept "inside" the object for box, sphere and cylinder bound
shapes. This means that two objects bound to any of these shape will
come in close contact when colliding.
The static mesh, convex hull and cone shapes still have their
collision margin "outside" the object, which leaves a space of 1
or 2 times the collision margin between objects.
The situation with Bullet 2.53 was more complicated, generally
leading to more space between objects, except for box-box collisions.
This means that running a old game under Bullet 2.71 may cause
visual problems, especially if the objects are small. You can fix
these problems by changing some visual aspect of the objects:
center, shape, size, position of children, etc.
2008-09-14 19:34:06 +00:00
|
|
|
btScalar m_margin;
|
2008-09-25 03:02:30 +00:00
|
|
|
|
2008-09-28 03:07:13 +00:00
|
|
|
////////////////////
|
|
|
|
int m_gamesoftFlag;
|
|
|
|
float m_soft_linStiff; /* linear stiffness 0..1 */
|
|
|
|
float m_soft_angStiff; /* angular stiffness 0..1 */
|
|
|
|
float m_soft_volume; /* volume preservation 0..1 */
|
|
|
|
|
|
|
|
int m_soft_viterations; /* Velocities solver iterations */
|
|
|
|
int m_soft_piterations; /* Positions solver iterations */
|
|
|
|
int m_soft_diterations; /* Drift solver iterations */
|
|
|
|
int m_soft_citerations; /* Cluster solver iterations */
|
|
|
|
|
|
|
|
float m_soft_kSRHR_CL; /* Soft vs rigid hardness [0,1] (cluster only) */
|
|
|
|
float m_soft_kSKHR_CL; /* Soft vs kinetic hardness [0,1] (cluster only) */
|
|
|
|
float m_soft_kSSHR_CL; /* Soft vs soft hardness [0,1] (cluster only) */
|
|
|
|
float m_soft_kSR_SPLT_CL; /* Soft vs rigid impulse split [0,1] (cluster only) */
|
|
|
|
|
|
|
|
float m_soft_kSK_SPLT_CL; /* Soft vs rigid impulse split [0,1] (cluster only) */
|
|
|
|
float m_soft_kSS_SPLT_CL; /* Soft vs rigid impulse split [0,1] (cluster only) */
|
|
|
|
float m_soft_kVCF; /* Velocities correction factor (Baumgarte) */
|
|
|
|
float m_soft_kDP; /* Damping coefficient [0,1] */
|
|
|
|
|
|
|
|
float m_soft_kDG; /* Drag coefficient [0,+inf] */
|
|
|
|
float m_soft_kLF; /* Lift coefficient [0,+inf] */
|
|
|
|
float m_soft_kPR; /* Pressure coefficient [-inf,+inf] */
|
|
|
|
float m_soft_kVC; /* Volume conversation coefficient [0,+inf] */
|
|
|
|
|
|
|
|
float m_soft_kDF; /* Dynamic friction coefficient [0,1] */
|
|
|
|
float m_soft_kMT; /* Pose matching coefficient [0,1] */
|
|
|
|
float m_soft_kCHR; /* Rigid contacts hardness [0,1] */
|
|
|
|
float m_soft_kKHR; /* Kinetic contacts hardness [0,1] */
|
|
|
|
|
|
|
|
float m_soft_kSHR; /* Soft contacts hardness [0,1] */
|
|
|
|
float m_soft_kAHR; /* Anchors hardness [0,1] */
|
|
|
|
int m_soft_collisionflags; /* Vertex/Face or Signed Distance Field(SDF) or Clusters, Soft versus Soft or Rigid */
|
|
|
|
int m_soft_numclusteriterations; /* number of iterations to refine collision clusters*/
|
|
|
|
///////////////////
|
|
|
|
|
|
|
|
|
2008-09-25 03:02:30 +00:00
|
|
|
|
2006-04-17 01:33:10 +00:00
|
|
|
int m_collisionFlags;
|
2008-05-01 16:00:59 +00:00
|
|
|
bool m_bRigid;
|
2008-09-21 15:17:50 +00:00
|
|
|
bool m_bSoft;
|
BGE: new sensor object to generalize Near and Radar sensor, static-static collision capbility.
A new type of "Sensor" physics object is available in the GE for advanced
collision management. It's called Sensor for its similarities with the
physics objects that underlie the Near and Radar sensors.
Like the Near and Radar object it is:
- static and ghost
- invisible by default
- always active to ensure correct collision detection
- capable of detecting both static and dynamic objects
- ignoring collision with their parent
- capable of broadphase filtering based on:
* Actor option: the collisioning object must have the Actor flag set to be detected
* property/material: as specified in the collision sensors attached to it
Broadphase filtering is important for performance reason: the collision points
will be computed only for the objects that pass the broahphase filter.
- automatically removed from the simulation when no collision sensor is active on it
Unlike the Near and Radar object it can:
- take any shape, including triangle mesh
- be made visible for debugging (just use the Visible actuator)
- have multiple collision sensors using it
Other than that, the sensor objects are ordinary objects. You can move them
freely or parent them. When parented to a dynamic object, they can provide
advanced collision control to this object.
The type of collision capability depends on the shape:
- box, sphere, cylinder, cone, convex hull provide volume detection.
- triangle mesh provides surface detection but you can give some volume
to the suface by increasing the margin in the Advanced Settings panel.
The margin applies on both sides of the surface.
Performance tip:
- Sensor objects perform better than Near and Radar: they do less synchronizations
because of the Scenegraph optimizations and they can have multiple collision sensors
on them (with different property filtering for example).
- Always prefer simple shape (box, sphere) to complex shape whenever possible.
- Always use broadphase filtering (avoid collision sensor with empty propery/material)
- Use collision sensor only when you need them. When no collision sensor is active
on the sensor object, it is removed from the simulation and consume no CPU.
Known limitations:
- When running Blender in debug mode, you will see one warning line of the console:
"warning btCollisionDispatcher::needsCollision: static-static collision!"
In release mode this message is not printed.
- Collision margin has no effect on sphere, cone and cylinder shape.
Other performance improvements:
- Remove unnecessary interpolation for Near and Radar objects and by extension
sensor objects.
- Use direct matrix copy instead of quaternion to synchronize orientation.
Other bug fix:
- Fix Near/Radar position error on newly activated objects. This was causing
several detection problems in YoFrankie
- Fix margin not passed correctly to gImpact shape.
- Disable force/velocity actions on static objects
2009-05-17 12:51:51 +00:00
|
|
|
bool m_bSensor;
|
2010-02-03 21:41:03 +00:00
|
|
|
bool m_bGimpact; // use Gimpact for mesh body
|
2005-07-16 10:15:31 +00:00
|
|
|
|
2006-08-28 06:44:29 +00:00
|
|
|
///optional use of collision group/mask:
|
|
|
|
///only collision with object goups that match the collision mask.
|
|
|
|
///this is very basic early out. advanced collision filtering should be
|
2006-11-21 00:53:40 +00:00
|
|
|
///done in the btCollisionDispatcher::NeedsCollision and NeedsResponse
|
2006-08-28 06:44:29 +00:00
|
|
|
///both values default to 1
|
|
|
|
short int m_collisionFilterGroup;
|
|
|
|
short int m_collisionFilterMask;
|
|
|
|
|
2008-08-21 15:19:54 +00:00
|
|
|
///these pointers are used as argument passing for the CcdPhysicsController constructor
|
|
|
|
///and not anymore after that
|
2008-03-01 19:17:37 +00:00
|
|
|
class btCollisionShape* m_collisionShape;
|
|
|
|
class PHY_IMotionState* m_MotionState;
|
2008-08-21 15:19:54 +00:00
|
|
|
class CcdShapeConstructionInfo* m_shapeInfo;
|
2006-11-21 00:53:40 +00:00
|
|
|
|
2005-12-31 07:20:08 +00:00
|
|
|
CcdPhysicsEnvironment* m_physicsEnv; //needed for self-replication
|
2005-12-31 21:59:56 +00:00
|
|
|
float m_inertiaFactor;//tweak the inertia (hooked up to Blender 'formfactor'
|
2008-09-29 03:09:03 +00:00
|
|
|
bool m_do_anisotropic;
|
|
|
|
btVector3 m_anisotropicFriction;
|
|
|
|
|
2008-09-29 06:58:49 +00:00
|
|
|
bool m_do_fh; ///< Should the object have a linear Fh spring?
|
|
|
|
bool m_do_rot_fh; ///< Should the object have an angular Fh spring?
|
|
|
|
btScalar m_fh_spring; ///< Spring constant (both linear and angular)
|
|
|
|
btScalar m_fh_damping; ///< Damping factor (linear and angular) in range [0, 1]
|
|
|
|
btScalar m_fh_distance; ///< The range above the surface where Fh is active.
|
|
|
|
bool m_fh_normal; ///< Should the object slide off slopes?
|
|
|
|
float m_radius;//for fh backwards compatibility
|
2009-05-23 22:35:47 +00:00
|
|
|
|
|
|
|
///m_contactProcessingThreshold allows to process contact points with positive distance
|
|
|
|
///normally only contacts with negative distance (penetration) are solved
|
|
|
|
///however, rigid body stacking is more stable when positive contacts are still passed into the constraint solver
|
|
|
|
///this might sometimes lead to collisions with 'internal edges' such as a sliding character controller
|
|
|
|
///so disable/set m_contactProcessingThreshold to zero for sliding characters etc.
|
|
|
|
float m_contactProcessingThreshold;///< Process contacts with positive distance in range [0..INF]
|
2008-09-29 06:58:49 +00:00
|
|
|
|
2005-07-16 10:15:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2006-11-21 00:53:40 +00:00
|
|
|
class btRigidBody;
|
2008-09-17 01:49:47 +00:00
|
|
|
class btCollisionObject;
|
|
|
|
class btSoftBody;
|
2008-03-01 19:17:37 +00:00
|
|
|
|
2005-07-16 10:15:31 +00:00
|
|
|
///CcdPhysicsController is a physics object that supports continuous collision detection and time of impact based physics resolution.
|
|
|
|
class CcdPhysicsController : public PHY_IPhysicsController
|
|
|
|
{
|
BGE: new sensor object to generalize Near and Radar sensor, static-static collision capbility.
A new type of "Sensor" physics object is available in the GE for advanced
collision management. It's called Sensor for its similarities with the
physics objects that underlie the Near and Radar sensors.
Like the Near and Radar object it is:
- static and ghost
- invisible by default
- always active to ensure correct collision detection
- capable of detecting both static and dynamic objects
- ignoring collision with their parent
- capable of broadphase filtering based on:
* Actor option: the collisioning object must have the Actor flag set to be detected
* property/material: as specified in the collision sensors attached to it
Broadphase filtering is important for performance reason: the collision points
will be computed only for the objects that pass the broahphase filter.
- automatically removed from the simulation when no collision sensor is active on it
Unlike the Near and Radar object it can:
- take any shape, including triangle mesh
- be made visible for debugging (just use the Visible actuator)
- have multiple collision sensors using it
Other than that, the sensor objects are ordinary objects. You can move them
freely or parent them. When parented to a dynamic object, they can provide
advanced collision control to this object.
The type of collision capability depends on the shape:
- box, sphere, cylinder, cone, convex hull provide volume detection.
- triangle mesh provides surface detection but you can give some volume
to the suface by increasing the margin in the Advanced Settings panel.
The margin applies on both sides of the surface.
Performance tip:
- Sensor objects perform better than Near and Radar: they do less synchronizations
because of the Scenegraph optimizations and they can have multiple collision sensors
on them (with different property filtering for example).
- Always prefer simple shape (box, sphere) to complex shape whenever possible.
- Always use broadphase filtering (avoid collision sensor with empty propery/material)
- Use collision sensor only when you need them. When no collision sensor is active
on the sensor object, it is removed from the simulation and consume no CPU.
Known limitations:
- When running Blender in debug mode, you will see one warning line of the console:
"warning btCollisionDispatcher::needsCollision: static-static collision!"
In release mode this message is not printed.
- Collision margin has no effect on sphere, cone and cylinder shape.
Other performance improvements:
- Remove unnecessary interpolation for Near and Radar objects and by extension
sensor objects.
- Use direct matrix copy instead of quaternion to synchronize orientation.
Other bug fix:
- Fix Near/Radar position error on newly activated objects. This was causing
several detection problems in YoFrankie
- Fix margin not passed correctly to gImpact shape.
- Disable force/velocity actions on static objects
2009-05-17 12:51:51 +00:00
|
|
|
protected:
|
2008-09-17 01:49:47 +00:00
|
|
|
btCollisionObject* m_object;
|
2008-09-26 02:27:59 +00:00
|
|
|
|
2008-09-17 01:49:47 +00:00
|
|
|
|
2008-03-01 19:17:37 +00:00
|
|
|
class PHY_IMotionState* m_MotionState;
|
2006-11-21 00:53:40 +00:00
|
|
|
btMotionState* m_bulletMotionState;
|
2008-08-21 15:19:54 +00:00
|
|
|
class btCollisionShape* m_collisionShape;
|
|
|
|
class CcdShapeConstructionInfo* m_shapeInfo;
|
|
|
|
|
2008-07-20 15:40:03 +00:00
|
|
|
friend class CcdPhysicsEnvironment; // needed when updating the controller
|
2006-11-21 00:53:40 +00:00
|
|
|
|
2008-09-26 02:27:59 +00:00
|
|
|
//some book keeping for replication
|
|
|
|
bool m_softbodyMappingDone;
|
|
|
|
bool m_softBodyTransformInitialized;
|
|
|
|
bool m_prototypeTransformInitialized;
|
|
|
|
btTransform m_softbodyStartTrans;
|
|
|
|
|
2006-02-21 05:36:56 +00:00
|
|
|
|
2005-08-05 17:00:32 +00:00
|
|
|
void* m_newClientInfo;
|
2008-08-05 16:23:33 +00:00
|
|
|
int m_registerCount; // needed when multiple sensors use the same controller
|
2005-12-31 07:20:08 +00:00
|
|
|
CcdConstructionInfo m_cci;//needed for replication
|
2008-09-29 06:58:49 +00:00
|
|
|
|
|
|
|
CcdPhysicsController* m_parentCtrl;
|
|
|
|
|
2006-11-21 00:53:40 +00:00
|
|
|
void GetWorldOrientation(btMatrix3x3& mat);
|
2005-08-17 19:52:56 +00:00
|
|
|
|
2005-12-31 07:20:08 +00:00
|
|
|
void CreateRigidbody();
|
2009-11-24 22:44:29 +00:00
|
|
|
bool CreateSoftbody();
|
2005-12-31 07:20:08 +00:00
|
|
|
|
2008-08-05 16:23:33 +00:00
|
|
|
bool Register() {
|
|
|
|
return (m_registerCount++ == 0) ? true : false;
|
|
|
|
}
|
|
|
|
bool Unregister() {
|
|
|
|
return (--m_registerCount == 0) ? true : false;
|
|
|
|
}
|
|
|
|
|
BGE: new sensor object to generalize Near and Radar sensor, static-static collision capbility.
A new type of "Sensor" physics object is available in the GE for advanced
collision management. It's called Sensor for its similarities with the
physics objects that underlie the Near and Radar sensors.
Like the Near and Radar object it is:
- static and ghost
- invisible by default
- always active to ensure correct collision detection
- capable of detecting both static and dynamic objects
- ignoring collision with their parent
- capable of broadphase filtering based on:
* Actor option: the collisioning object must have the Actor flag set to be detected
* property/material: as specified in the collision sensors attached to it
Broadphase filtering is important for performance reason: the collision points
will be computed only for the objects that pass the broahphase filter.
- automatically removed from the simulation when no collision sensor is active on it
Unlike the Near and Radar object it can:
- take any shape, including triangle mesh
- be made visible for debugging (just use the Visible actuator)
- have multiple collision sensors using it
Other than that, the sensor objects are ordinary objects. You can move them
freely or parent them. When parented to a dynamic object, they can provide
advanced collision control to this object.
The type of collision capability depends on the shape:
- box, sphere, cylinder, cone, convex hull provide volume detection.
- triangle mesh provides surface detection but you can give some volume
to the suface by increasing the margin in the Advanced Settings panel.
The margin applies on both sides of the surface.
Performance tip:
- Sensor objects perform better than Near and Radar: they do less synchronizations
because of the Scenegraph optimizations and they can have multiple collision sensors
on them (with different property filtering for example).
- Always prefer simple shape (box, sphere) to complex shape whenever possible.
- Always use broadphase filtering (avoid collision sensor with empty propery/material)
- Use collision sensor only when you need them. When no collision sensor is active
on the sensor object, it is removed from the simulation and consume no CPU.
Known limitations:
- When running Blender in debug mode, you will see one warning line of the console:
"warning btCollisionDispatcher::needsCollision: static-static collision!"
In release mode this message is not printed.
- Collision margin has no effect on sphere, cone and cylinder shape.
Other performance improvements:
- Remove unnecessary interpolation for Near and Radar objects and by extension
sensor objects.
- Use direct matrix copy instead of quaternion to synchronize orientation.
Other bug fix:
- Fix Near/Radar position error on newly activated objects. This was causing
several detection problems in YoFrankie
- Fix margin not passed correctly to gImpact shape.
- Disable force/velocity actions on static objects
2009-05-17 12:51:51 +00:00
|
|
|
void setWorldOrientation(const btMatrix3x3& mat);
|
|
|
|
void forceWorldTransform(const btMatrix3x3& mat, const btVector3& pos);
|
2008-07-21 12:37:27 +00:00
|
|
|
|
2005-07-16 10:15:31 +00:00
|
|
|
public:
|
|
|
|
|
|
|
|
int m_collisionDelay;
|
|
|
|
|
|
|
|
|
|
|
|
CcdPhysicsController (const CcdConstructionInfo& ci);
|
|
|
|
|
2009-07-25 22:57:29 +00:00
|
|
|
bool DeleteControllerShape();
|
|
|
|
bool ReplaceControllerShape(btCollisionShape *newShape);
|
|
|
|
|
2005-07-16 10:15:31 +00:00
|
|
|
virtual ~CcdPhysicsController();
|
|
|
|
|
2008-09-29 06:58:49 +00:00
|
|
|
CcdConstructionInfo& getConstructionInfo()
|
|
|
|
{
|
|
|
|
return m_cci;
|
|
|
|
}
|
|
|
|
const CcdConstructionInfo& getConstructionInfo() const
|
|
|
|
{
|
|
|
|
return m_cci;
|
|
|
|
}
|
|
|
|
|
2005-07-16 10:15:31 +00:00
|
|
|
|
2008-09-17 01:49:47 +00:00
|
|
|
btRigidBody* GetRigidBody();
|
|
|
|
btCollisionObject* GetCollisionObject();
|
|
|
|
btSoftBody* GetSoftBody();
|
|
|
|
|
2008-08-21 15:19:54 +00:00
|
|
|
CcdShapeConstructionInfo* GetShapeInfo() { return m_shapeInfo; }
|
2005-07-16 10:15:31 +00:00
|
|
|
|
2006-11-21 00:53:40 +00:00
|
|
|
btCollisionShape* GetCollisionShape() {
|
2008-09-17 01:49:47 +00:00
|
|
|
return m_object->getCollisionShape();
|
2006-02-21 05:36:56 +00:00
|
|
|
}
|
2005-07-16 10:15:31 +00:00
|
|
|
////////////////////////////////////
|
|
|
|
// PHY_IPhysicsController interface
|
|
|
|
////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
SynchronizeMotionStates ynchronizes dynas, kinematic and deformable entities (and do 'late binding')
|
|
|
|
*/
|
|
|
|
virtual bool SynchronizeMotionStates(float time);
|
|
|
|
/**
|
|
|
|
WriteMotionStateToDynamics ynchronizes dynas, kinematic and deformable entities (and do 'late binding')
|
|
|
|
*/
|
|
|
|
|
|
|
|
virtual void WriteMotionStateToDynamics(bool nondynaonly);
|
|
|
|
virtual void WriteDynamicsToMotionState();
|
BGE: new sensor object to generalize Near and Radar sensor, static-static collision capbility.
A new type of "Sensor" physics object is available in the GE for advanced
collision management. It's called Sensor for its similarities with the
physics objects that underlie the Near and Radar sensors.
Like the Near and Radar object it is:
- static and ghost
- invisible by default
- always active to ensure correct collision detection
- capable of detecting both static and dynamic objects
- ignoring collision with their parent
- capable of broadphase filtering based on:
* Actor option: the collisioning object must have the Actor flag set to be detected
* property/material: as specified in the collision sensors attached to it
Broadphase filtering is important for performance reason: the collision points
will be computed only for the objects that pass the broahphase filter.
- automatically removed from the simulation when no collision sensor is active on it
Unlike the Near and Radar object it can:
- take any shape, including triangle mesh
- be made visible for debugging (just use the Visible actuator)
- have multiple collision sensors using it
Other than that, the sensor objects are ordinary objects. You can move them
freely or parent them. When parented to a dynamic object, they can provide
advanced collision control to this object.
The type of collision capability depends on the shape:
- box, sphere, cylinder, cone, convex hull provide volume detection.
- triangle mesh provides surface detection but you can give some volume
to the suface by increasing the margin in the Advanced Settings panel.
The margin applies on both sides of the surface.
Performance tip:
- Sensor objects perform better than Near and Radar: they do less synchronizations
because of the Scenegraph optimizations and they can have multiple collision sensors
on them (with different property filtering for example).
- Always prefer simple shape (box, sphere) to complex shape whenever possible.
- Always use broadphase filtering (avoid collision sensor with empty propery/material)
- Use collision sensor only when you need them. When no collision sensor is active
on the sensor object, it is removed from the simulation and consume no CPU.
Known limitations:
- When running Blender in debug mode, you will see one warning line of the console:
"warning btCollisionDispatcher::needsCollision: static-static collision!"
In release mode this message is not printed.
- Collision margin has no effect on sphere, cone and cylinder shape.
Other performance improvements:
- Remove unnecessary interpolation for Near and Radar objects and by extension
sensor objects.
- Use direct matrix copy instead of quaternion to synchronize orientation.
Other bug fix:
- Fix Near/Radar position error on newly activated objects. This was causing
several detection problems in YoFrankie
- Fix margin not passed correctly to gImpact shape.
- Disable force/velocity actions on static objects
2009-05-17 12:51:51 +00:00
|
|
|
|
2005-07-16 10:15:31 +00:00
|
|
|
// controller replication
|
|
|
|
virtual void PostProcessReplica(class PHY_IMotionState* motionstate,class PHY_IPhysicsController* parentctrl);
|
2009-11-15 23:58:56 +00:00
|
|
|
virtual void SetPhysicsEnvironment(class PHY_IPhysicsEnvironment *env);
|
2005-07-16 10:15:31 +00:00
|
|
|
|
|
|
|
// kinematic methods
|
|
|
|
virtual void RelativeTranslate(float dlocX,float dlocY,float dlocZ,bool local);
|
2005-08-13 08:05:48 +00:00
|
|
|
virtual void RelativeRotate(const float drot[9],bool local);
|
2005-07-16 10:15:31 +00:00
|
|
|
virtual void getOrientation(float &quatImag0,float &quatImag1,float &quatImag2,float &quatReal);
|
|
|
|
virtual void setOrientation(float quatImag0,float quatImag1,float quatImag2,float quatReal);
|
|
|
|
virtual void setPosition(float posX,float posY,float posZ);
|
|
|
|
virtual void getPosition(PHY__Vector3& pos) const;
|
|
|
|
|
|
|
|
virtual void setScaling(float scaleX,float scaleY,float scaleZ);
|
|
|
|
|
|
|
|
// physics methods
|
|
|
|
virtual void ApplyTorque(float torqueX,float torqueY,float torqueZ,bool local);
|
|
|
|
virtual void ApplyForce(float forceX,float forceY,float forceZ,bool local);
|
|
|
|
virtual void SetAngularVelocity(float ang_velX,float ang_velY,float ang_velZ,bool local);
|
|
|
|
virtual void SetLinearVelocity(float lin_velX,float lin_velY,float lin_velZ,bool local);
|
|
|
|
virtual void applyImpulse(float attachX,float attachY,float attachZ, float impulseX,float impulseY,float impulseZ);
|
|
|
|
virtual void SetActive(bool active);
|
|
|
|
|
|
|
|
// reading out information from physics
|
|
|
|
virtual void GetLinearVelocity(float& linvX,float& linvY,float& linvZ);
|
2005-12-31 07:20:08 +00:00
|
|
|
virtual void GetAngularVelocity(float& angVelX,float& angVelY,float& angVelZ);
|
2005-07-16 10:15:31 +00:00
|
|
|
virtual void GetVelocity(const float posX,const float posY,const float posZ,float& linvX,float& linvY,float& linvZ);
|
|
|
|
virtual void getReactionForce(float& forceX,float& forceY,float& forceZ);
|
|
|
|
|
|
|
|
// dyna's that are rigidbody are free in orientation, dyna's with non-rigidbody are restricted
|
|
|
|
virtual void setRigidBody(bool rigid);
|
|
|
|
|
|
|
|
|
|
|
|
virtual void resolveCombinedVelocities(float linvelX,float linvelY,float linvelZ,float angVelX,float angVelY,float angVelZ);
|
|
|
|
|
|
|
|
// clientinfo for raycasts for example
|
|
|
|
virtual void* getNewClientInfo();
|
|
|
|
virtual void setNewClientInfo(void* clientinfo);
|
2006-05-22 21:03:43 +00:00
|
|
|
virtual PHY_IPhysicsController* GetReplica();
|
|
|
|
|
2006-08-28 06:44:29 +00:00
|
|
|
///There should be no 'SetCollisionFilterGroup' method, as changing this during run-time is will result in errors
|
|
|
|
short int GetCollisionFilterGroup() const
|
|
|
|
{
|
|
|
|
return m_cci.m_collisionFilterGroup;
|
|
|
|
}
|
|
|
|
///There should be no 'SetCollisionFilterGroup' method, as changing this during run-time is will result in errors
|
|
|
|
short int GetCollisionFilterMask() const
|
|
|
|
{
|
|
|
|
return m_cci.m_collisionFilterMask;
|
|
|
|
}
|
|
|
|
|
2005-07-16 10:15:31 +00:00
|
|
|
virtual void calcXform() {} ;
|
2008-10-01 07:55:02 +00:00
|
|
|
virtual void SetMargin(float margin)
|
|
|
|
{
|
|
|
|
if (m_collisionShape)
|
|
|
|
m_collisionShape->setMargin(btScalar(margin));
|
|
|
|
}
|
|
|
|
virtual float GetMargin() const
|
|
|
|
{
|
|
|
|
return (m_collisionShape) ? m_collisionShape->getMargin() : 0.f;
|
|
|
|
}
|
|
|
|
virtual float GetRadius() const
|
|
|
|
{
|
|
|
|
// this is not the actual shape radius, it's only used for Fh support
|
|
|
|
return m_cci.m_radius;
|
|
|
|
}
|
|
|
|
virtual void SetRadius(float margin)
|
|
|
|
{
|
|
|
|
if (m_collisionShape && m_collisionShape->getShapeType() == SPHERE_SHAPE_PROXYTYPE)
|
|
|
|
{
|
|
|
|
btSphereShape* sphereShape = static_cast<btSphereShape*>(m_collisionShape);
|
|
|
|
sphereShape->setUnscaledRadius(margin);
|
|
|
|
}
|
|
|
|
m_cci.m_radius = margin;
|
|
|
|
}
|
2009-04-14 12:34:39 +00:00
|
|
|
|
|
|
|
// velocity clamping
|
|
|
|
virtual void SetLinVelocityMin(float val)
|
|
|
|
{
|
|
|
|
m_cci.m_clamp_vel_min= val;
|
|
|
|
}
|
|
|
|
virtual float GetLinVelocityMin() const
|
|
|
|
{
|
|
|
|
return m_cci.m_clamp_vel_min;
|
|
|
|
}
|
|
|
|
virtual void SetLinVelocityMax(float val)
|
|
|
|
{
|
|
|
|
m_cci.m_clamp_vel_max= val;
|
|
|
|
}
|
|
|
|
virtual float GetLinVelocityMax() const
|
|
|
|
{
|
|
|
|
return m_cci.m_clamp_vel_max;
|
|
|
|
}
|
2005-07-16 10:15:31 +00:00
|
|
|
|
|
|
|
bool wantsSleeping();
|
|
|
|
|
2005-08-04 19:07:39 +00:00
|
|
|
void UpdateDeactivation(float timeStep);
|
|
|
|
|
2008-09-17 01:49:47 +00:00
|
|
|
void SetCenterOfMassTransform(btTransform& xform);
|
|
|
|
|
BGE: new sensor object to generalize Near and Radar sensor, static-static collision capbility.
A new type of "Sensor" physics object is available in the GE for advanced
collision management. It's called Sensor for its similarities with the
physics objects that underlie the Near and Radar sensors.
Like the Near and Radar object it is:
- static and ghost
- invisible by default
- always active to ensure correct collision detection
- capable of detecting both static and dynamic objects
- ignoring collision with their parent
- capable of broadphase filtering based on:
* Actor option: the collisioning object must have the Actor flag set to be detected
* property/material: as specified in the collision sensors attached to it
Broadphase filtering is important for performance reason: the collision points
will be computed only for the objects that pass the broahphase filter.
- automatically removed from the simulation when no collision sensor is active on it
Unlike the Near and Radar object it can:
- take any shape, including triangle mesh
- be made visible for debugging (just use the Visible actuator)
- have multiple collision sensors using it
Other than that, the sensor objects are ordinary objects. You can move them
freely or parent them. When parented to a dynamic object, they can provide
advanced collision control to this object.
The type of collision capability depends on the shape:
- box, sphere, cylinder, cone, convex hull provide volume detection.
- triangle mesh provides surface detection but you can give some volume
to the suface by increasing the margin in the Advanced Settings panel.
The margin applies on both sides of the surface.
Performance tip:
- Sensor objects perform better than Near and Radar: they do less synchronizations
because of the Scenegraph optimizations and they can have multiple collision sensors
on them (with different property filtering for example).
- Always prefer simple shape (box, sphere) to complex shape whenever possible.
- Always use broadphase filtering (avoid collision sensor with empty propery/material)
- Use collision sensor only when you need them. When no collision sensor is active
on the sensor object, it is removed from the simulation and consume no CPU.
Known limitations:
- When running Blender in debug mode, you will see one warning line of the console:
"warning btCollisionDispatcher::needsCollision: static-static collision!"
In release mode this message is not printed.
- Collision margin has no effect on sphere, cone and cylinder shape.
Other performance improvements:
- Remove unnecessary interpolation for Near and Radar objects and by extension
sensor objects.
- Use direct matrix copy instead of quaternion to synchronize orientation.
Other bug fix:
- Fix Near/Radar position error on newly activated objects. This was causing
several detection problems in YoFrankie
- Fix margin not passed correctly to gImpact shape.
- Disable force/velocity actions on static objects
2009-05-17 12:51:51 +00:00
|
|
|
static btTransform& GetTransformFromMotionState(PHY_IMotionState* motionState);
|
2006-02-21 05:36:56 +00:00
|
|
|
|
2006-11-21 00:53:40 +00:00
|
|
|
void setAabb(const btVector3& aabbMin,const btVector3& aabbMax);
|
2005-07-16 10:15:31 +00:00
|
|
|
|
|
|
|
|
2006-05-11 00:13:42 +00:00
|
|
|
class PHY_IMotionState* GetMotionState()
|
|
|
|
{
|
|
|
|
return m_MotionState;
|
|
|
|
}
|
|
|
|
|
|
|
|
const class PHY_IMotionState* GetMotionState() const
|
|
|
|
{
|
|
|
|
return m_MotionState;
|
|
|
|
}
|
|
|
|
|
2008-03-01 19:17:37 +00:00
|
|
|
class CcdPhysicsEnvironment* GetPhysicsEnvironment()
|
|
|
|
{
|
|
|
|
return m_cci.m_physicsEnv;
|
|
|
|
}
|
2008-09-29 06:58:49 +00:00
|
|
|
|
|
|
|
void setParentCtrl(CcdPhysicsController* parentCtrl)
|
|
|
|
{
|
|
|
|
m_parentCtrl = parentCtrl;
|
|
|
|
}
|
|
|
|
|
|
|
|
CcdPhysicsController* getParentCtrl()
|
|
|
|
{
|
|
|
|
return m_parentCtrl;
|
|
|
|
}
|
|
|
|
|
|
|
|
const CcdPhysicsController* getParentCtrl() const
|
|
|
|
{
|
|
|
|
return m_parentCtrl;
|
|
|
|
}
|
|
|
|
|
2011-03-16 21:20:24 +00:00
|
|
|
virtual const char* getName()
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
2008-09-29 06:58:49 +00:00
|
|
|
|
2009-08-18 15:37:31 +00:00
|
|
|
#ifdef WITH_CXX_GUARDEDALLOC
|
|
|
|
public:
|
2010-06-06 01:15:44 +00:00
|
|
|
void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:CcdPhysicsController"); }
|
2009-08-18 15:37:31 +00:00
|
|
|
void operator delete( void *mem ) { MEM_freeN(mem); }
|
|
|
|
#endif
|
2005-07-16 10:15:31 +00:00
|
|
|
};
|
|
|
|
|
2006-05-22 21:03:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2006-11-21 00:53:40 +00:00
|
|
|
///DefaultMotionState implements standard motionstate, using btTransform
|
2006-05-22 21:03:43 +00:00
|
|
|
class DefaultMotionState : public PHY_IMotionState
|
|
|
|
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
DefaultMotionState();
|
|
|
|
|
|
|
|
virtual ~DefaultMotionState();
|
|
|
|
|
|
|
|
virtual void getWorldPosition(float& posX,float& posY,float& posZ);
|
|
|
|
virtual void getWorldScaling(float& scaleX,float& scaleY,float& scaleZ);
|
|
|
|
virtual void getWorldOrientation(float& quatIma0,float& quatIma1,float& quatIma2,float& quatReal);
|
|
|
|
|
|
|
|
virtual void setWorldPosition(float posX,float posY,float posZ);
|
|
|
|
virtual void setWorldOrientation(float quatIma0,float quatIma1,float quatIma2,float quatReal);
|
2009-04-07 22:14:06 +00:00
|
|
|
virtual void getWorldOrientation(float* ori);
|
BGE: new sensor object to generalize Near and Radar sensor, static-static collision capbility.
A new type of "Sensor" physics object is available in the GE for advanced
collision management. It's called Sensor for its similarities with the
physics objects that underlie the Near and Radar sensors.
Like the Near and Radar object it is:
- static and ghost
- invisible by default
- always active to ensure correct collision detection
- capable of detecting both static and dynamic objects
- ignoring collision with their parent
- capable of broadphase filtering based on:
* Actor option: the collisioning object must have the Actor flag set to be detected
* property/material: as specified in the collision sensors attached to it
Broadphase filtering is important for performance reason: the collision points
will be computed only for the objects that pass the broahphase filter.
- automatically removed from the simulation when no collision sensor is active on it
Unlike the Near and Radar object it can:
- take any shape, including triangle mesh
- be made visible for debugging (just use the Visible actuator)
- have multiple collision sensors using it
Other than that, the sensor objects are ordinary objects. You can move them
freely or parent them. When parented to a dynamic object, they can provide
advanced collision control to this object.
The type of collision capability depends on the shape:
- box, sphere, cylinder, cone, convex hull provide volume detection.
- triangle mesh provides surface detection but you can give some volume
to the suface by increasing the margin in the Advanced Settings panel.
The margin applies on both sides of the surface.
Performance tip:
- Sensor objects perform better than Near and Radar: they do less synchronizations
because of the Scenegraph optimizations and they can have multiple collision sensors
on them (with different property filtering for example).
- Always prefer simple shape (box, sphere) to complex shape whenever possible.
- Always use broadphase filtering (avoid collision sensor with empty propery/material)
- Use collision sensor only when you need them. When no collision sensor is active
on the sensor object, it is removed from the simulation and consume no CPU.
Known limitations:
- When running Blender in debug mode, you will see one warning line of the console:
"warning btCollisionDispatcher::needsCollision: static-static collision!"
In release mode this message is not printed.
- Collision margin has no effect on sphere, cone and cylinder shape.
Other performance improvements:
- Remove unnecessary interpolation for Near and Radar objects and by extension
sensor objects.
- Use direct matrix copy instead of quaternion to synchronize orientation.
Other bug fix:
- Fix Near/Radar position error on newly activated objects. This was causing
several detection problems in YoFrankie
- Fix margin not passed correctly to gImpact shape.
- Disable force/velocity actions on static objects
2009-05-17 12:51:51 +00:00
|
|
|
virtual void setWorldOrientation(const float* ori);
|
2006-05-22 21:03:43 +00:00
|
|
|
|
|
|
|
virtual void calculateWorldTransformations();
|
|
|
|
|
2006-11-21 00:53:40 +00:00
|
|
|
btTransform m_worldTransform;
|
|
|
|
btVector3 m_localScaling;
|
2009-08-18 15:37:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
#ifdef WITH_CXX_GUARDEDALLOC
|
|
|
|
public:
|
2010-06-06 01:15:44 +00:00
|
|
|
void *operator new(size_t num_bytes) { return MEM_mallocN(num_bytes, "GE:DefaultMotionState"); }
|
2009-08-18 15:37:31 +00:00
|
|
|
void operator delete( void *mem ) { MEM_freeN(mem); }
|
|
|
|
#endif
|
2006-05-22 21:03:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2005-07-16 10:15:31 +00:00
|
|
|
#endif //BULLET2_PHYSICSCONTROLLER_H
|