|
@@ -28,7 +28,7 @@ void PhysicsJoint::unregisterFromWorld()
|
|
|
PhysicsPoint2PointJoint::PhysicsPoint2PointJoint(PhysicsWorld* world, PhysicsBodyPtr bodyA, const Vec3& relPos)
|
|
PhysicsPoint2PointJoint::PhysicsPoint2PointJoint(PhysicsWorld* world, PhysicsBodyPtr bodyA, const Vec3& relPos)
|
|
|
: PhysicsJoint(world, JointType::kP2P)
|
|
: PhysicsJoint(world, JointType::kP2P)
|
|
|
{
|
|
{
|
|
|
- m_bodyA = bodyA;
|
|
|
|
|
|
|
+ m_bodyA = std::move(bodyA);
|
|
|
m_p2p.init(*m_bodyA->getBtBody(), toBt(relPos));
|
|
m_p2p.init(*m_bodyA->getBtBody(), toBt(relPos));
|
|
|
getJoint()->setUserConstraintPtr(static_cast<PhysicsObject*>(this));
|
|
getJoint()->setUserConstraintPtr(static_cast<PhysicsObject*>(this));
|
|
|
}
|
|
}
|
|
@@ -38,8 +38,8 @@ PhysicsPoint2PointJoint::PhysicsPoint2PointJoint(PhysicsWorld* world, PhysicsBod
|
|
|
: PhysicsJoint(world, JointType::kP2P)
|
|
: PhysicsJoint(world, JointType::kP2P)
|
|
|
{
|
|
{
|
|
|
ANKI_ASSERT(bodyA != bodyB);
|
|
ANKI_ASSERT(bodyA != bodyB);
|
|
|
- m_bodyA = bodyA;
|
|
|
|
|
- m_bodyB = bodyB;
|
|
|
|
|
|
|
+ m_bodyA = std::move(bodyA);
|
|
|
|
|
+ m_bodyB = std::move(bodyB);
|
|
|
|
|
|
|
|
m_p2p.init(*m_bodyA->getBtBody(), *m_bodyB->getBtBody(), toBt(relPosA), toBt(relPosB));
|
|
m_p2p.init(*m_bodyA->getBtBody(), *m_bodyB->getBtBody(), toBt(relPosA), toBt(relPosB));
|
|
|
getJoint()->setUserConstraintPtr(static_cast<PhysicsObject*>(this));
|
|
getJoint()->setUserConstraintPtr(static_cast<PhysicsObject*>(this));
|
|
@@ -53,7 +53,7 @@ PhysicsPoint2PointJoint::~PhysicsPoint2PointJoint()
|
|
|
PhysicsHingeJoint::PhysicsHingeJoint(PhysicsWorld* world, PhysicsBodyPtr bodyA, const Vec3& relPos, const Vec3& axis)
|
|
PhysicsHingeJoint::PhysicsHingeJoint(PhysicsWorld* world, PhysicsBodyPtr bodyA, const Vec3& relPos, const Vec3& axis)
|
|
|
: PhysicsJoint(world, JointType::kHinge)
|
|
: PhysicsJoint(world, JointType::kHinge)
|
|
|
{
|
|
{
|
|
|
- m_bodyA = bodyA;
|
|
|
|
|
|
|
+ m_bodyA = std::move(bodyA);
|
|
|
m_hinge.init(*m_bodyA->getBtBody(), toBt(relPos), toBt(axis));
|
|
m_hinge.init(*m_bodyA->getBtBody(), toBt(relPos), toBt(axis));
|
|
|
getJoint()->setUserConstraintPtr(static_cast<PhysicsObject*>(this));
|
|
getJoint()->setUserConstraintPtr(static_cast<PhysicsObject*>(this));
|
|
|
}
|
|
}
|