make soft bodies more compatible with rigid body API: disable setCollisionShape (it would delete the shape passed in!)
This commit is contained in:
@@ -143,7 +143,7 @@ public:
|
|||||||
|
|
||||||
virtual ~btCollisionObject();
|
virtual ~btCollisionObject();
|
||||||
|
|
||||||
void setCollisionShape(btCollisionShape* collisionShape)
|
virtual void setCollisionShape(btCollisionShape* collisionShape)
|
||||||
{
|
{
|
||||||
m_collisionShape = collisionShape;
|
m_collisionShape = collisionShape;
|
||||||
m_rootCollisionShape = collisionShape;
|
m_rootCollisionShape = collisionShape;
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ btSoftBody::btSoftBody(btSoftBodyWorldInfo* worldInfo,int node_count, const btV
|
|||||||
pm->m_flags = fMaterial::Default;
|
pm->m_flags = fMaterial::Default;
|
||||||
/* Collision shape */
|
/* Collision shape */
|
||||||
///for now, create a collision shape internally
|
///for now, create a collision shape internally
|
||||||
setCollisionShape(new btSoftBodyCollisionShape(this));
|
m_collisionShape = new btSoftBodyCollisionShape(this);
|
||||||
m_collisionShape->setMargin(0.25);
|
m_collisionShape->setMargin(0.25);
|
||||||
/* Nodes */
|
/* Nodes */
|
||||||
const btScalar margin=getCollisionShape()->getMargin();
|
const btScalar margin=getCollisionShape()->getMargin();
|
||||||
|
|||||||
@@ -606,6 +606,13 @@ public:
|
|||||||
/* dtor */
|
/* dtor */
|
||||||
virtual ~btSoftBody();
|
virtual ~btSoftBody();
|
||||||
/* Check for existing link */
|
/* Check for existing link */
|
||||||
|
|
||||||
|
|
||||||
|
virtual void setCollisionShape(btCollisionShape* collisionShape)
|
||||||
|
{
|
||||||
|
//don't do anything, due to the internal shape hack: todo: fix this
|
||||||
|
}
|
||||||
|
|
||||||
bool checkLink( int node0,
|
bool checkLink( int node0,
|
||||||
int node1) const;
|
int node1) const;
|
||||||
bool checkLink( const Node* node0,
|
bool checkLink( const Node* node0,
|
||||||
|
|||||||
@@ -94,7 +94,6 @@ public:
|
|||||||
virtual void setLocalScaling(const btVector3& /*scaling*/)
|
virtual void setLocalScaling(const btVector3& /*scaling*/)
|
||||||
{
|
{
|
||||||
///na
|
///na
|
||||||
btAssert(0);
|
|
||||||
}
|
}
|
||||||
virtual const btVector3& getLocalScaling() const
|
virtual const btVector3& getLocalScaling() const
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user