Physics3D: Rename PhysObject to RigidBody3D
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
class PhysObject;
|
||||
class RigidBody3D;
|
||||
}
|
||||
|
||||
namespace Ndk
|
||||
@@ -41,14 +41,14 @@ namespace Ndk
|
||||
|
||||
private:
|
||||
void InitializeStaticBody();
|
||||
Nz::PhysObject* GetStaticBody();
|
||||
Nz::RigidBody3D* GetStaticBody();
|
||||
|
||||
void OnAttached() override;
|
||||
void OnComponentAttached(BaseComponent& component) override;
|
||||
void OnComponentDetached(BaseComponent& component) override;
|
||||
void OnDetached() override;
|
||||
|
||||
std::unique_ptr<Nz::PhysObject> m_staticBody;
|
||||
std::unique_ptr<Nz::RigidBody3D> m_staticBody;
|
||||
Nz::Collider3DRef m_geom;
|
||||
bool m_bodyUpdated;
|
||||
};
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace Ndk
|
||||
* \return A pointer to the entity
|
||||
*/
|
||||
|
||||
inline Nz::PhysObject* CollisionComponent::GetStaticBody()
|
||||
inline Nz::RigidBody3D* CollisionComponent::GetStaticBody()
|
||||
{
|
||||
return m_staticBody.get();
|
||||
}
|
||||
|
||||
@@ -56,14 +56,14 @@ namespace Ndk
|
||||
static ComponentIndex componentIndex;
|
||||
|
||||
private:
|
||||
Nz::PhysObject& GetPhysObject();
|
||||
Nz::RigidBody3D& GetPhysObject();
|
||||
|
||||
void OnAttached() override;
|
||||
void OnComponentAttached(BaseComponent& component) override;
|
||||
void OnComponentDetached(BaseComponent& component) override;
|
||||
void OnDetached() override;
|
||||
|
||||
std::unique_ptr<Nz::PhysObject> m_object;
|
||||
std::unique_ptr<Nz::RigidBody3D> m_object;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -350,7 +350,7 @@ namespace Ndk
|
||||
* \return A reference to the physics object
|
||||
*/
|
||||
|
||||
inline Nz::PhysObject& PhysicsComponent::GetPhysObject()
|
||||
inline Nz::RigidBody3D& PhysicsComponent::GetPhysObject()
|
||||
{
|
||||
return *m_object.get();
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace Ndk
|
||||
NazaraAssert(entityWorld->HasSystem<PhysicsSystem>(), "World must have a physics system");
|
||||
Nz::PhysWorld& physWorld = entityWorld->GetSystem<PhysicsSystem>().GetWorld();
|
||||
|
||||
m_staticBody.reset(new Nz::PhysObject(&physWorld, m_geom));
|
||||
m_staticBody.reset(new Nz::RigidBody3D(&physWorld, m_geom));
|
||||
m_staticBody->EnableAutoSleep(false);
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace Ndk
|
||||
else
|
||||
matrix.MakeIdentity();
|
||||
|
||||
m_object.reset(new Nz::PhysObject(&world, geom, matrix));
|
||||
m_object.reset(new Nz::RigidBody3D(&world, geom, matrix));
|
||||
m_object->SetMass(1.f);
|
||||
}
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace Ndk
|
||||
NodeComponent& node = entity->GetComponent<NodeComponent>();
|
||||
PhysicsComponent& phys = entity->GetComponent<PhysicsComponent>();
|
||||
|
||||
Nz::PhysObject& physObj = phys.GetPhysObject();
|
||||
Nz::RigidBody3D& physObj = phys.GetPhysObject();
|
||||
node.SetRotation(physObj.GetRotation(), Nz::CoordSys_Global);
|
||||
node.SetPosition(physObj.GetPosition(), Nz::CoordSys_Global);
|
||||
}
|
||||
@@ -94,7 +94,7 @@ namespace Ndk
|
||||
CollisionComponent& collision = entity->GetComponent<CollisionComponent>();
|
||||
NodeComponent& node = entity->GetComponent<NodeComponent>();
|
||||
|
||||
Nz::PhysObject* physObj = collision.GetStaticBody();
|
||||
Nz::RigidBody3D* physObj = collision.GetStaticBody();
|
||||
|
||||
Nz::Quaternionf oldRotation = physObj->GetRotation();
|
||||
Nz::Vector3f oldPosition = physObj->GetPosition();
|
||||
|
||||
Reference in New Issue
Block a user