mirror of https://github.com/axmolengine/axmol.git
tab format
This commit is contained in:
parent
7befab0f7b
commit
070705949b
|
@ -177,7 +177,7 @@ void Physics3DComponent::setSyncFlag(PhysicsSyncFlag syncFlag)
|
|||
void Physics3DComponent::syncPhysicsToNode()
|
||||
{
|
||||
if (_physics3DObj->getObjType() == Physics3DObject::PhysicsObjType::RIGID_BODY
|
||||
|| _physics3DObj->getObjType() == Physics3DObject::PhysicsObjType::COLLIDER)
|
||||
|| _physics3DObj->getObjType() == Physics3DObject::PhysicsObjType::COLLIDER)
|
||||
{
|
||||
Mat4 parentMat;
|
||||
if (_owner->getParent())
|
||||
|
@ -211,7 +211,7 @@ void Physics3DComponent::syncPhysicsToNode()
|
|||
void Physics3DComponent::syncNodeToPhysics()
|
||||
{
|
||||
if (_physics3DObj->getObjType() == Physics3DObject::PhysicsObjType::RIGID_BODY
|
||||
|| _physics3DObj->getObjType() == Physics3DObject::PhysicsObjType::COLLIDER)
|
||||
|| _physics3DObj->getObjType() == Physics3DObject::PhysicsObjType::COLLIDER)
|
||||
{
|
||||
auto mat = _owner->getNodeToWorldTransform();
|
||||
//remove scale, no scale support for physics
|
||||
|
@ -236,11 +236,11 @@ void Physics3DComponent::syncNodeToPhysics()
|
|||
motionState->setWorldTransform(convertMat4TobtTransform(mat));
|
||||
body->setMotionState(motionState);
|
||||
}
|
||||
else if (_physics3DObj->getObjType() == Physics3DObject::PhysicsObjType::COLLIDER)
|
||||
{
|
||||
auto object = static_cast<Physics3DCollider*>(_physics3DObj)->getGhostObject();
|
||||
object->setWorldTransform(convertMat4TobtTransform(mat));
|
||||
}
|
||||
else if (_physics3DObj->getObjType() == Physics3DObject::PhysicsObjType::COLLIDER)
|
||||
{
|
||||
auto object = static_cast<Physics3DCollider*>(_physics3DObj)->getGhostObject();
|
||||
object->setWorldTransform(convertMat4TobtTransform(mat));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue