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>2005-03-25 13:33:39 +0300
committerKester Maddock <Christopher.Maddock.1@uni.massey.ac.nz>2005-03-25 13:33:39 +0300
commitc844aa265ad4eb50ad0e18661470fa6092052728 (patch)
treec4a778ab1227e4266022fd076e8a0cb709badd13 /source/gameengine/Physics/Sumo/Fuzzics
parent3dd17cec3bcaa3885e14630e6a71a8486e9b2697 (diff)
Big patches:
Erwin Coumans: Abstract the physics engine Charlie C: Joystick fixes Me: Moved the ray cast (shadows, mouse sensor & ray sensor)
Diffstat (limited to 'source/gameengine/Physics/Sumo/Fuzzics')
-rw-r--r--source/gameengine/Physics/Sumo/Fuzzics/include/SM_Object.h10
-rw-r--r--source/gameengine/Physics/Sumo/Fuzzics/src/SM_Object.cpp12
-rw-r--r--source/gameengine/Physics/Sumo/Fuzzics/src/SM_Scene.cpp4
3 files changed, 19 insertions, 7 deletions
diff --git a/source/gameengine/Physics/Sumo/Fuzzics/include/SM_Object.h b/source/gameengine/Physics/Sumo/Fuzzics/include/SM_Object.h
index 07eb5a7637f..1911e186a1c 100644
--- a/source/gameengine/Physics/Sumo/Fuzzics/include/SM_Object.h
+++ b/source/gameengine/Physics/Sumo/Fuzzics/include/SM_Object.h
@@ -264,7 +264,13 @@ public:
SM_ClientObject *getClientObject() { return m_client_object; }
void setClientObject(SM_ClientObject *client_object) { m_client_object = client_object; }
-
+ void setPhysicsClientObject(void* physicsClientObject)
+ {
+ m_physicsClientObject = physicsClientObject;
+ }
+ void* getPhysicsClientObject() {
+ return m_physicsClientObject;
+ }
void relax();
SM_MotionState &getCurrentFrame();
@@ -325,6 +331,8 @@ private:
// on an SM_Object, there must be a way that the SM_Object client
// can identify it's clientdata after a collision
SM_ClientObject *m_client_object;
+
+ void* m_physicsClientObject;
DT_ShapeHandle m_shape; // Shape for collision detection
diff --git a/source/gameengine/Physics/Sumo/Fuzzics/src/SM_Object.cpp b/source/gameengine/Physics/Sumo/Fuzzics/src/SM_Object.cpp
index ab1db7c7941..fe1ac9becd9 100644
--- a/source/gameengine/Physics/Sumo/Fuzzics/src/SM_Object.cpp
+++ b/source/gameengine/Physics/Sumo/Fuzzics/src/SM_Object.cpp
@@ -42,6 +42,8 @@
#pragma warning( disable : 4786 )
#endif
+#include "MT_assert.h"
+
#include "SM_Object.h"
#include "SM_Scene.h"
#include "SM_FhObject.h"
@@ -147,7 +149,7 @@ SM_Object::SM_Object(
m_dynamicParent(dynamicParent),
m_client_object(0),
-
+ m_physicsClientObject(0),
m_shape(shape),
m_materialProps(materialProps),
m_materialPropsBackup(0),
@@ -385,7 +387,7 @@ void SM_Object::dynamicCollision(const MT_Point3 &local2,
// I guess the GEN_max is not necessary, so let's check it
- assert(impulse >= 0.0);
+ MT_assert(impulse >= 0.0);
/**
* Here's the trick. We compute the impulse to make the
@@ -481,7 +483,7 @@ DT_Bool SM_Object::boing(
if (dist < MT_EPSILON)
return DT_CONTINUE;
- // Now we are definately intersecting.
+ // Now we are definitely intersecting.
// Set callbacks for game engine.
if ((obj1->getClientObject() && obj1->getClientObject()->hasCollisionCallback()) ||
@@ -595,7 +597,7 @@ void SM_Object::relax(void)
SM_Object::SM_Object() :
m_dynamicParent(0),
m_client_object(0),
-
+ m_physicsClientObject(0),
m_shape(0),
m_materialProps(0),
m_materialPropsBackup(0),
@@ -868,7 +870,7 @@ SM_Object::
setOrientation(
const MT_Quaternion& orn
){
- assert(!orn.fuzzyZero());
+ MT_assert(!orn.fuzzyZero());
m_kinematic = true;
getNextFrame().setOrientation(orn);
endFrame();
diff --git a/source/gameengine/Physics/Sumo/Fuzzics/src/SM_Scene.cpp b/source/gameengine/Physics/Sumo/Fuzzics/src/SM_Scene.cpp
index fdd8079b241..081a2fb9794 100644
--- a/source/gameengine/Physics/Sumo/Fuzzics/src/SM_Scene.cpp
+++ b/source/gameengine/Physics/Sumo/Fuzzics/src/SM_Scene.cpp
@@ -140,7 +140,8 @@ void SM_Scene::requestCollisionCallback(SM_Object &object)
// DT_SetResponseClass(m_fixRespTable, object.getObjectHandle(), m_fixResponseClass[OBJECT_RESPONSE]);
}
-void SM_Scene::remove(SM_Object& object) {
+void SM_Scene::remove(SM_Object& object) {
+ //std::cout << "SM_Scene::remove this =" << this << "object = " << &object << std::endl;
T_ObjectList::iterator i =
std::find(m_objectList.begin(), m_objectList.end(), &object);
if (!(i == m_objectList.end()))
@@ -358,6 +359,7 @@ DT_Bool SM_Scene::boing(
SM_Scene::~SM_Scene()
{
+ //std::cout << "SM_Scene::~ SM_Scene(): destroy " << this << std::endl;
// if (m_objectList.begin() != m_objectList.end())
// std::cout << "SM_Scene::~SM_Scene: There are still objects in the Sumo scene!" << std::endl;
for (T_ObjectList::iterator it = m_objectList.begin() ; it != m_objectList.end() ; it++)