WIP on materials

This commit is contained in:
Lynix
2017-12-10 22:17:41 +01:00
parent f1b84bfc9e
commit afa874de26
10 changed files with 151 additions and 3 deletions

View File

@@ -52,6 +52,8 @@ namespace Ndk
void SetLinearVelocity(const Nz::Vector3f& velocity);
void SetMass(float mass);
void SetMassCenter(const Nz::Vector3f& center);
void SetMaterial(const Nz::String& materialName);
void SetMaterial(int materialIndex);
void SetPosition(const Nz::Vector3f& position);
void SetRotation(const Nz::Quaternionf& rotation);

View File

@@ -365,7 +365,6 @@ namespace Ndk
*
* \remark Produces a NazaraAssert if the physics object is invalid
*/
inline void PhysicsComponent3D::SetMassCenter(const Nz::Vector3f& center)
{
NazaraAssert(m_object, "Invalid physics object");
@@ -373,6 +372,34 @@ namespace Ndk
m_object->SetMassCenter(center);
}
/*!
* \brief Sets the material of the object, affecting how object does respond to collisions
*
* \param materialName Name of the material, previously registered to physics world
*
* \remark materialName must exists in PhysWorld before this call
*/
inline void PhysicsComponent3D::SetMaterial(const Nz::String& materialName)
{
NazaraAssert(m_object, "Invalid physics object");
m_object->SetMaterial(materialName);
}
/*!
* \brief Sets the material of the object, affecting how object does respond to collisions
*
* \param materialIndex Id of the material, previously retrieved from a physics world
*
* \remark materialIndex must come from a call to in PhysWorld::CreateMaterial
*/
inline void PhysicsComponent3D::SetMaterial(int materialIndex)
{
NazaraAssert(m_object, "Invalid physics object");
m_object->SetMaterial(materialIndex);
}
/*!
* \brief Sets the position of the physics object
*

View File

@@ -18,7 +18,6 @@ namespace Ndk
{
public:
PhysicsSystem3D();
PhysicsSystem3D(const PhysicsSystem3D& system);
~PhysicsSystem3D() = default;
Nz::PhysWorld3D& GetWorld();