22 #ifndef __ND_WORLD_H__
23 #define __ND_WORLD_H__
25 #include "ndNewtonStdafx.h"
26 #include "ndModelList.h"
27 #include "ndJointList.h"
28 #include "ndSkeletonList.h"
40 #define D_NEWTON_ENGINE_MAJOR_VERSION 4
41 #define D_NEWTON_ENGINE_MINOR_VERSION 00
43 #define D_SLEEP_ENTRIES 8
60 D_NEWTON_API
virtual ~
ndWorld();
62 D_NEWTON_API
virtual void CleanUp();
64 D_NEWTON_API ndInt32 GetEngineVersion()
const;
66 D_NEWTON_API
void Sync()
const;
67 D_NEWTON_API
void Update(ndFloat32 timestep);
68 D_NEWTON_API
void CollisionUpdate(ndFloat32 timestep);
70 D_NEWTON_API
virtual void OnPostUpdate(ndFloat32 timestep);
72 D_NEWTON_API ndInt32 GetThreadCount()
const;
73 D_NEWTON_API
void SetThreadCount(ndInt32 count);
75 D_NEWTON_API ndInt32 GetSubSteps()
const;
76 D_NEWTON_API
void SetSubSteps(ndInt32 subSteps);
78 D_NEWTON_API ndSolverModes GetSelectedSolver()
const;
79 D_NEWTON_API
void SelectSolver(ndSolverModes solverMode);
81 D_NEWTON_API
bool IsGPU()
const;
82 D_NEWTON_API
ndScene* GetScene()
const;
83 D_NEWTON_API
const char* GetSolverString()
const;
90 D_NEWTON_API
virtual void RemoveBody(
ndBody*
const body);
91 D_NEWTON_API
virtual void RemoveModel(
ndModel*
const model);
94 D_NEWTON_API
const ndJointList& GetJointList()
const;
95 D_NEWTON_API
const ndModelList& GetModelList()
const;
97 D_NEWTON_API
const ndBodyList& GetParticleList()
const;
101 D_NEWTON_API ndInt32 GetSolverIterations()
const;
102 D_NEWTON_API
void SetSolverIterations(ndInt32 iterations);
104 D_NEWTON_API ndFloat32 GetUpdateTime()
const;
105 D_NEWTON_API ndUnsigned32 GetFrameNumber()
const;
106 D_NEWTON_API ndUnsigned32 GetSubFrameNumber()
const;
107 D_NEWTON_API ndFloat32 GetAverageUpdateTime()
const;
108 D_NEWTON_API ndFloat32 GetExtensionAverageUpdateTime()
const;
116 D_NEWTON_API
void ClearCache();
122 void ThreadFunction();
123 void PostUpdate(ndFloat32 timestep);
126 D_NEWTON_API
virtual void UpdateSkeletons();
127 D_NEWTON_API
virtual void UpdateTransforms();
128 D_NEWTON_API
virtual void PostModelTransform();
135 class dgSolverProgressiveSleepEntry
138 ndFloat32 m_maxAccel;
139 ndFloat32 m_maxVeloc;
151 void ModelPostUpdate();
152 void CalculateAverageUpdateTime();
153 void SubStepUpdate(ndFloat32 timestep);
154 void ParticleUpdate(ndFloat32 timestep);
171 ndFloat32 m_timestep;
172 ndFloat32 m_freezeAccel2;
173 ndFloat32 m_freezeSpeed2;
174 ndFloat32 m_averageUpdateTime;
175 ndFloat32 m_averageTimestepAcc;
176 ndFloat32 m_averageFramesCount;
177 ndFloat32 m_lastExecutionTime;
178 ndFloat32 m_extensionAverageUpdateTime;
179 ndFloat32 m_extensionAverageTimestepAcc;
181 dgSolverProgressiveSleepEntry m_sleepTable[D_SLEEP_ENTRIES];
184 ndSolverModes m_solverMode;
185 ndInt32 m_solverIterations;
197 } D_GCC_NEWTON_ALIGN_32;