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-05-16 17:10:10 +0400
committerKester Maddock <Christopher.Maddock.1@uni.massey.ac.nz>2004-05-16 17:10:10 +0400
commitbab6e5ce3645eaf8fce445e6109fcca390075ead (patch)
treec346b5527a5f1fec8927dc9b54ba2b57a90bca02 /source/gameengine/Physics/Sumo/Fuzzics
parentd5fde6c48b4b6758d1f31dc2f401fa8c63843735 (diff)
Cleanup unused/commented out code, compiler warnings, coding standards etc.
Diffstat (limited to 'source/gameengine/Physics/Sumo/Fuzzics')
-rw-r--r--source/gameengine/Physics/Sumo/Fuzzics/include/SM_Object.h5
-rw-r--r--source/gameengine/Physics/Sumo/Fuzzics/src/SM_Object.cpp26
-rw-r--r--source/gameengine/Physics/Sumo/Fuzzics/src/SM_Scene.cpp13
3 files changed, 9 insertions, 35 deletions
diff --git a/source/gameengine/Physics/Sumo/Fuzzics/include/SM_Object.h b/source/gameengine/Physics/Sumo/Fuzzics/include/SM_Object.h
index a0475c39bbb..571e1cf71cc 100644
--- a/source/gameengine/Physics/Sumo/Fuzzics/include/SM_Object.h
+++ b/source/gameengine/Physics/Sumo/Fuzzics/include/SM_Object.h
@@ -266,6 +266,11 @@ public:
}
private:
+ // Tweak parameters
+ static const MT_Scalar ImpulseThreshold = -10.;
+ static const MT_Scalar FixThreshold = 0.01;
+ static const MT_Scalar FixVelocity = 0.01;
+
// return the actual linear_velocity of this object this
// is the addition of m_combined_lin_vel and m_lin_vel.
diff --git a/source/gameengine/Physics/Sumo/Fuzzics/src/SM_Object.cpp b/source/gameengine/Physics/Sumo/Fuzzics/src/SM_Object.cpp
index 6609279acb5..b86d7ccdcdd 100644
--- a/source/gameengine/Physics/Sumo/Fuzzics/src/SM_Object.cpp
+++ b/source/gameengine/Physics/Sumo/Fuzzics/src/SM_Object.cpp
@@ -50,10 +50,6 @@
#include "MT_MinMax.h"
-// Tweak parameters
-static const MT_Scalar ImpulseThreshold = -10.;
-static const MT_Scalar FixThreshold = 0.01;
-static const MT_Scalar FixVelocity = 0.01;
SM_Object::SM_Object(
DT_ShapeHandle shape,
const SM_MaterialProps *materialProps,
@@ -459,28 +455,10 @@ DT_Bool SM_Object::fix(
MT_Vector3 error = normal * 0.5f;
obj1->m_error += error;
obj2->m_error -= error;
- // Remove the velocity component in the normal direction
- // Calculate collision parameters
- /*MT_Vector3 rel_vel = obj1->getLinearVelocity() - obj2->getLinearVelocity();
- if (normal.length() > FixThreshold && rel_vel.length() < FixVelocity) {
- normal.normalize();
- MT_Scalar rel_vel_normal = 0.49*(normal.dot(rel_vel));
-
- obj1->addLinearVelocity(-rel_vel_normal*normal);
- obj2->addLinearVelocity(rel_vel_normal*normal);
- }*/
}
else {
// Same again but now obj1 is non-dynamic
obj2->m_error -= normal;
- /*MT_Vector3 rel_vel = obj2->getLinearVelocity();
- if (normal.length() > FixThreshold && rel_vel.length() < FixVelocity) {
- // Calculate collision parameters
- normal.normalize();
- MT_Scalar rel_vel_normal = -0.99*(normal.dot(rel_vel));
-
- obj2->addLinearVelocity(rel_vel_normal*normal);
- }*/
}
return DT_CONTINUE;
@@ -494,10 +472,6 @@ void SM_Object::relax(void)
m_pos += m_error;
m_error.setValue(0., 0., 0.);
-/* m_pos.getValue(pos);
- DT_SetPosition(m_object, pos);
- m_xform.setOrigin(m_pos);
- m_xform.getValue(m_ogl_matrix); */
calcXform();
notifyClient();
}
diff --git a/source/gameengine/Physics/Sumo/Fuzzics/src/SM_Scene.cpp b/source/gameengine/Physics/Sumo/Fuzzics/src/SM_Scene.cpp
index f7057fecb6e..8034cfdc86d 100644
--- a/source/gameengine/Physics/Sumo/Fuzzics/src/SM_Scene.cpp
+++ b/source/gameengine/Physics/Sumo/Fuzzics/src/SM_Scene.cpp
@@ -175,22 +175,20 @@ void SM_Scene::proceed(MT_Scalar timeStep, MT_Scalar subSampling) {
// Apply a forcefield (such as gravity)
for (i = m_objectList.begin(); i != m_objectList.end(); ++i) {
(*i)->applyForceField(m_forceField);
- //(*i)->integrateForces(subStep);
- //(*i)->integrateMomentum(subStep);
+ //(*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)->integrateForces(subStep);
- //(*i)->backup();
- // And second we update the object positions by performing
- // an integration step for each object
+ // And second we update the object positions by performing
+ // an integration step for each object
(*i)->integrateMomentum(subStep);
}
+
// I changed the order of the next 2 statements.
// Originally objects were first integrated with a call
// to proceed(). However if external objects were
@@ -208,9 +206,6 @@ void SM_Scene::proceed(MT_Scalar timeStep, MT_Scalar subSampling) {
#if 0
clearObjectCombinedVelocities();
#endif
-/* if (DT_Test(m_scene, m_fixRespTable))
- for (i = m_objectList.begin(); i != m_objectList.end(); ++i)
- (*i)->relax(); */
DT_Test(m_scene, m_fixRespTable);
// Finish this timestep by saving al state information for the next