Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKester Maddock <Christopher.Maddock.1@uni.massey.ac.nz>2004-10-25 03:48:04 +0400
committerKester Maddock <Christopher.Maddock.1@uni.massey.ac.nz>2004-10-25 03:48:04 +0400
commite398ad2c0e147e2a36b34c4bf4e257928da2b515 (patch)
tree79efe6b553a74bfd323f007f3564e2988247e4c7 /source/gameengine
parent657eff7ed7f23e9218a22ff6b3c96d331d69dd47 (diff)
Do a complete physics timestep each step instead of some per frame
Diffstat (limited to 'source/gameengine')
-rw-r--r--source/gameengine/Physics/Sumo/Fuzzics/src/SM_Scene.cpp30
1 files changed, 13 insertions, 17 deletions
diff --git a/source/gameengine/Physics/Sumo/Fuzzics/src/SM_Scene.cpp b/source/gameengine/Physics/Sumo/Fuzzics/src/SM_Scene.cpp
index aee0f1470fe..0af1c22edbd 100644
--- a/source/gameengine/Physics/Sumo/Fuzzics/src/SM_Scene.cpp
+++ b/source/gameengine/Physics/Sumo/Fuzzics/src/SM_Scene.cpp
@@ -196,18 +196,15 @@ void SM_Scene::proceed(MT_Scalar curtime, MT_Scalar ticrate) {
m_lastTime += MT_Scalar(num_samples)*subStep;
- // Apply a forcefield (such as gravity)
- for (i = m_objectList.begin(); i != m_objectList.end(); ++i) {
- (*i)->applyForceField(m_forceField);
- //(*i)->setTimeStep(timeStep);
- }
-
// Do the integration steps per object.
int step;
for (step = 0; step != num_samples; ++step) {
for (i = m_objectList.begin(); i != m_objectList.end(); ++i) {
(*i)->beginFrame();
+ // Apply a forcefield (such as gravity)
+ (*i)->applyForceField(m_forceField);
+ //(*i)->setTimeStep(timeStep);
(*i)->integrateForces(subStep);
// And second we update the object positions by performing
// an integration step for each object
@@ -225,23 +222,22 @@ void SM_Scene::proceed(MT_Scalar curtime, MT_Scalar ticrate) {
// new forces, velocities set externally.
// The collsion and friction impulses are computed here.
DT_Test(m_scene, m_respTable);
- }
// clear the user set velocities.
#if 0
clearObjectCombinedVelocities();
#endif
- DT_Test(m_scene, m_fixRespTable);
-
- // Finish this timestep by saving al state information for the next
- // timestep and clearing the accumulated forces.
- for (i = m_objectList.begin(); i != m_objectList.end(); ++i) {
- (*i)->relax();
- (*i)->proceedKinematic(timeStep);
- (*i)->saveReactionForce(timeStep);
- (*i)->clearForce();
+ DT_Test(m_scene, m_fixRespTable);
+
+ // Finish this timestep by saving al state information for the next
+ // timestep and clearing the accumulated forces.
+ for (i = m_objectList.begin(); i != m_objectList.end(); ++i) {
+ (*i)->relax();
+ (*i)->proceedKinematic(subStep);
+ (*i)->saveReactionForce(subStep);
+ (*i)->clearForce();
+ }
}
-
// For each pair of object that collided, call the corresponding callback.
// Additional collisions of a pair within the same time step are ignored.