Physics2D/RigidBody2D: Temporary remove SetGeom to fix a linking error
This commit is contained in:
parent
119436a642
commit
f3e041c4c0
|
|
@ -50,7 +50,6 @@ namespace Nz
|
|||
bool IsSleeping() const;
|
||||
|
||||
void SetAngularVelocity(float angularVelocity);
|
||||
void SetGeom(Collider2DRef geom);
|
||||
void SetGravityFactor(float gravityFactor);
|
||||
void SetMass(float mass);
|
||||
void SetMassCenter(const Vector2f& center);
|
||||
|
|
@ -63,6 +62,7 @@ namespace Nz
|
|||
|
||||
private:
|
||||
void Destroy();
|
||||
void SetGeom(Collider2DRef geom);
|
||||
|
||||
std::vector<cpShape*> m_shapes;
|
||||
Collider2DRef m_geom;
|
||||
|
|
|
|||
|
|
@ -174,25 +174,6 @@ namespace Nz
|
|||
cpBodySetAngularVelocity(m_handle, angularVelocity);
|
||||
}
|
||||
|
||||
void RigidBody2D::SetGeom(Collider2DRef geom)
|
||||
{
|
||||
if (m_geom.Get() != geom)
|
||||
{
|
||||
for (cpShape* shape : m_shapes)
|
||||
{
|
||||
cpBodyRemoveShape(m_handle, shape);
|
||||
cpShapeFree(shape);
|
||||
}
|
||||
|
||||
if (geom)
|
||||
m_geom = geom;
|
||||
else
|
||||
m_geom = NullCollider2D::New();
|
||||
|
||||
m_shapes = m_geom->CreateShapes(this);
|
||||
}
|
||||
}
|
||||
|
||||
void RigidBody2D::SetGravityFactor(float gravityFactor)
|
||||
{
|
||||
m_gravityFactor = gravityFactor;
|
||||
|
|
@ -267,4 +248,14 @@ namespace Nz
|
|||
if (m_handle)
|
||||
cpBodyFree(m_handle);
|
||||
}
|
||||
|
||||
void RigidBody2D::SetGeom(Collider2DRef geom)
|
||||
{
|
||||
if (geom)
|
||||
m_geom = geom;
|
||||
else
|
||||
m_geom = NullCollider2D::New();
|
||||
|
||||
m_shapes = m_geom->CreateShapes(this);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue