WIP on materials
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user