Physics/PhysWorld3D: Add [Get|Set]ThreadCount

This commit is contained in:
Lynix 2018-07-15 16:46:01 +02:00
parent a870954762
commit 01ccca433d
2 changed files with 12 additions and 0 deletions

View File

@ -45,11 +45,13 @@ namespace Nz
int GetMaterial(const String& name);
std::size_t GetMaxStepCount() const;
float GetStepSize() const;
unsigned int GetThreadCount() const;
void SetGravity(const Vector3f& gravity);
void SetMaxStepCount(std::size_t maxStepCount);
void SetSolverModel(unsigned int model);
void SetStepSize(float stepSize);
void SetThreadCount(unsigned int threadCount);
void SetMaterialCollisionCallback(int firstMaterial, int secondMaterial, AABBOverlapCallback aabbOverlapCallback, CollisionCallback collisionCallback);
void SetMaterialDefaultCollidable(int firstMaterial, int secondMaterial, bool collidable);

View File

@ -76,6 +76,11 @@ namespace Nz
return m_stepSize;
}
unsigned int PhysWorld3D::GetThreadCount() const
{
return NewtonGetThreadsCount(m_world);
}
void PhysWorld3D::SetGravity(const Vector3f& gravity)
{
m_gravity = gravity;
@ -96,6 +101,11 @@ namespace Nz
m_stepSize = stepSize;
}
void PhysWorld3D::SetThreadCount(unsigned int threadCount)
{
NewtonSetThreadsCount(m_world, threadCount);
}
void PhysWorld3D::SetMaterialCollisionCallback(int firstMaterial, int secondMaterial, AABBOverlapCallback aabbOverlapCallback, CollisionCallback collisionCallback)
{
static_assert(sizeof(UInt64) >= 2 * sizeof(int), "Oops");