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:
-rw-r--r--source/gameengine/Converter/BL_MeshDeformer.cpp24
-rw-r--r--source/gameengine/Ketsji/KX_KetsjiEngine.h8
-rw-r--r--source/gameengine/Ketsji/KX_TouchEventManager.h2
-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
-rw-r--r--source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.cpp3
-rw-r--r--source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.h9
-rw-r--r--source/gameengine/Rasterizer/RAS_IRasterizer.h2
-rw-r--r--source/gameengine/Rasterizer/RAS_IRenderTools.h2
10 files changed, 29 insertions, 65 deletions
diff --git a/source/gameengine/Converter/BL_MeshDeformer.cpp b/source/gameengine/Converter/BL_MeshDeformer.cpp
index e9aeb547409..f7df35af21d 100644
--- a/source/gameengine/Converter/BL_MeshDeformer.cpp
+++ b/source/gameengine/Converter/BL_MeshDeformer.cpp
@@ -73,21 +73,10 @@ bool BL_MeshDeformer::Apply(RAS_IPolyMaterial *mat)
// For each vertex
for (j=0; j<array[i]->size(); j++){
tv = &((*array[i])[j]);
- MT_Point3 pt = tv->xyz();
-
index = ((*diarray[i])[j]);
mvert = &(m_bmesh->mvert[((*mvarray[i])[index])]);
- // Do the nasty (in this case, copy the untransformed data from the blender mesh)
- co[0]=mvert->co[0];
- co[1]=mvert->co[1];
- co[2]=mvert->co[2];
-
- pt[0] = co[0];
- pt[1] = co[1];
- pt[2] = co[2];
-
- tv->SetXYZ(pt);
+ tv->SetXYZ(MT_Point3(mvert->co));
}
}
return true;
@@ -101,6 +90,9 @@ BL_MeshDeformer::~BL_MeshDeformer()
delete []m_transnors;
};
+/**
+ * @warning This function is expensive!
+ */
void BL_MeshDeformer::RecalcNormals()
{
int v, f;
@@ -143,12 +135,12 @@ void BL_MeshDeformer::RecalcNormals()
}
for (v =0; v<m_bmesh->totvert; v++){
- float nor[3];
+// float nor[3];
m_transnors[v]=m_transnors[v].safe_normalized();
- nor[0]=m_transnors[v][0];
- nor[1]=m_transnors[v][1];
- nor[2]=m_transnors[v][2];
+// nor[0]=m_transnors[v][0];
+// nor[1]=m_transnors[v][1];
+// nor[2]=m_transnors[v][2];
};
}
diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.h b/source/gameengine/Ketsji/KX_KetsjiEngine.h
index 83e0fe229d7..79baf09f597 100644
--- a/source/gameengine/Ketsji/KX_KetsjiEngine.h
+++ b/source/gameengine/Ketsji/KX_KetsjiEngine.h
@@ -67,14 +67,14 @@ class KX_KetsjiEngine
{
private:
- class RAS_ICanvas* m_canvas; // 2D Canvas (2D Rendering Device Context)
+ class RAS_ICanvas* m_canvas; // 2D Canvas (2D Rendering Device Context)
class RAS_IRasterizer* m_rasterizer; // 3D Rasterizer (3D Rendering)
- class KX_ISystem* m_kxsystem;
+ class KX_ISystem* m_kxsystem;
class RAS_IRenderTools* m_rendertools;
class KX_ISceneConverter* m_sceneconverter;
- class NG_NetworkDeviceInterface* m_networkdevice;
+ class NG_NetworkDeviceInterface* m_networkdevice;
class SND_IAudioDevice* m_audiodevice;
- PyObject* m_pythondictionary;
+ PyObject* m_pythondictionary;
class SCA_IInputDevice* m_keyboarddevice;
class SCA_IInputDevice* m_mousedevice;
diff --git a/source/gameengine/Ketsji/KX_TouchEventManager.h b/source/gameengine/Ketsji/KX_TouchEventManager.h
index e53dc264494..4439ba6f3bd 100644
--- a/source/gameengine/Ketsji/KX_TouchEventManager.h
+++ b/source/gameengine/Ketsji/KX_TouchEventManager.h
@@ -43,7 +43,7 @@ class KX_TouchEventManager : public SCA_EventManager
class SCA_LogicManager* m_logicmgr;
SM_Scene *m_scene;
- static DT_Bool KX_TouchEventManager::collisionResponse(void *client_data,
+ static DT_Bool collisionResponse(void *client_data,
void *object1,
void *object2,
const DT_CollData *coll_data);
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
diff --git a/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.cpp b/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.cpp
index 78e902ce221..e9a2148bedd 100644
--- a/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.cpp
+++ b/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.cpp
@@ -40,9 +40,6 @@
//#include <SOLID/SOLID.h>
-const MT_Scalar UpperBoundForFuzzicsIntegrator = 0.01;
-// At least 100Hz (isn't this CPU hungry ?)
-
SumoPhysicsEnvironment::SumoPhysicsEnvironment()
{
diff --git a/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.h b/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.h
index 1f175df6ec9..683257a8310 100644
--- a/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.h
+++ b/source/gameengine/Physics/Sumo/SumoPhysicsEnvironment.h
@@ -32,6 +32,8 @@
#ifndef _SUMOPhysicsEnvironment
#define _SUMOPhysicsEnvironment
+#include "MT_Scalar.h"
+
#include "PHY_IPhysicsEnvironment.h"
/**
@@ -64,10 +66,9 @@ public:
return m_sumoScene;
}
-private:
-
-
-
+protected:
+ // At least 100Hz (isn't this CPU hungry ?)
+ static const MT_Scalar UpperBoundForFuzzicsIntegrator = 0.01;
};
diff --git a/source/gameengine/Rasterizer/RAS_IRasterizer.h b/source/gameengine/Rasterizer/RAS_IRasterizer.h
index 44823836450..815c095e583 100644
--- a/source/gameengine/Rasterizer/RAS_IRasterizer.h
+++ b/source/gameengine/Rasterizer/RAS_IRasterizer.h
@@ -216,7 +216,7 @@ public:
* from camera coordinates to window coordinates.
* @param mat The projection matrix.
*/
- virtual void SetProjectionMatrix(MT_Matrix4x4 & mat)=0;
+ virtual void SetProjectionMatrix(const MT_Matrix4x4 & mat)=0;
/**
* Sets the modelview matrix.
*/
diff --git a/source/gameengine/Rasterizer/RAS_IRenderTools.h b/source/gameengine/Rasterizer/RAS_IRenderTools.h
index 91b8fab5d18..47246d60c5c 100644
--- a/source/gameengine/Rasterizer/RAS_IRenderTools.h
+++ b/source/gameengine/Rasterizer/RAS_IRenderTools.h
@@ -59,7 +59,7 @@ public:
RAS_TEXT_RENDER_NODEF = 0,
RAS_TEXT_NORMAL,
RAS_TEXT_PADDED,
- RAS_TEXT_MAX,
+ RAS_TEXT_MAX
};
RAS_IRenderTools(