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:
authorCampbell Barton <ideasman42@gmail.com>2009-08-04 09:14:10 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-08-04 09:14:10 +0400
commit856dba000b09409bf6da2865bca2c79dba378683 (patch)
tree8a28a274a6f21fbfbb93dc4ac7b50c98ac604c82
parentd595f6f2034ff9b74064975f351b7c42a8c651ac (diff)
no need to store the physics env in each KX_GameObject
-rw-r--r--source/gameengine/Converter/BL_BlenderDataConversion.cpp1
-rw-r--r--source/gameengine/Ketsji/KX_ConstraintActuator.cpp5
-rw-r--r--source/gameengine/Ketsji/KX_GameObject.cpp6
-rw-r--r--source/gameengine/Ketsji/KX_GameObject.h16
-rw-r--r--source/gameengine/Rasterizer/RAS_BucketManager.cpp9
5 files changed, 7 insertions, 30 deletions
diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
index 7a902a72795..d27c544ccb4 100644
--- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp
+++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
@@ -1806,7 +1806,6 @@ static KX_GameObject *gameobject_from_blenderobject(
}
if (gameobj)
{
- gameobj->SetPhysicsEnvironment(kxscene->GetPhysicsEnvironment());
gameobj->SetLayer(ob->lay);
gameobj->SetBlenderObject(ob);
/* set the visibility state based on the objects render option in the outliner */
diff --git a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp
index 6f66faaeafb..c90f4e23316 100644
--- a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp
+++ b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp
@@ -36,6 +36,7 @@
#include "MT_Matrix3x3.h"
#include "KX_GameObject.h"
#include "KX_RayCast.h"
+#include "KX_PythonInit.h" // KX_GetActiveScene
#include "blendef.h"
#ifdef HAVE_CONFIG_H
@@ -329,7 +330,7 @@ bool KX_ConstraintActuator::Update(double curtime, bool frame)
}
{
MT_Point3 topoint = position + (m_maximumBound) * direction;
- PHY_IPhysicsEnvironment* pe = obj->GetPhysicsEnvironment();
+ PHY_IPhysicsEnvironment* pe = KX_GetActiveScene()->GetPhysicsEnvironment();
KX_IPhysicsController *spc = obj->GetPhysicsController();
if (!pe) {
@@ -442,7 +443,7 @@ bool KX_ConstraintActuator::Update(double curtime, bool frame)
}
normal.normalize();
{
- PHY_IPhysicsEnvironment* pe = obj->GetPhysicsEnvironment();
+ PHY_IPhysicsEnvironment* pe = KX_GetActiveScene()->GetPhysicsEnvironment();
KX_IPhysicsController *spc = obj->GetPhysicsController();
if (!pe) {
diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp
index e9263ee62e0..d04174a32aa 100644
--- a/source/gameengine/Ketsji/KX_GameObject.cpp
+++ b/source/gameengine/Ketsji/KX_GameObject.cpp
@@ -103,7 +103,6 @@ KX_GameObject::KX_GameObject(
m_bOccluder(false),
m_pPhysicsController1(NULL),
m_pGraphicController(NULL),
- m_pPhysicsEnvironment(NULL),
m_xray(false),
m_pHitObject(NULL),
m_isDeformable(false),
@@ -2604,8 +2603,7 @@ KX_PYMETHODDEF_DOC(KX_GameObject, rayCastTo,
toDir.normalize();
toPoint = fromPoint + (dist) * toDir;
}
-
- PHY_IPhysicsEnvironment* pe = GetPhysicsEnvironment();
+ PHY_IPhysicsEnvironment* pe = KX_GetActiveScene()->GetPhysicsEnvironment();
KX_IPhysicsController *spc = GetPhysicsController();
KX_GameObject *parent = GetParent();
if (!spc && parent)
@@ -2732,7 +2730,7 @@ KX_PYMETHODDEF_DOC(KX_GameObject, rayCast,
return none_tuple_3();
}
- PHY_IPhysicsEnvironment* pe = GetPhysicsEnvironment();
+ PHY_IPhysicsEnvironment* pe = KX_GetActiveScene()->GetPhysicsEnvironment();
KX_IPhysicsController *spc = GetPhysicsController();
KX_GameObject *parent = GetParent();
if (!spc && parent)
diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h
index 32df5803f31..88ef44c41c6 100644
--- a/source/gameengine/Ketsji/KX_GameObject.h
+++ b/source/gameengine/Ketsji/KX_GameObject.h
@@ -94,8 +94,6 @@ protected:
KX_IPhysicsController* m_pPhysicsController1;
PHY_IGraphicController* m_pGraphicController;
- // used for ray casting
- PHY_IPhysicsEnvironment* m_pPhysicsEnvironment;
STR_String m_testPropName;
bool m_xray;
KX_GameObject* m_pHitObject;
@@ -334,20 +332,6 @@ public:
bool ang_vel_local
);
-
- /**
- * @return a pointer to the physics environment in use during the game, for rayCasting
- */
- PHY_IPhysicsEnvironment* GetPhysicsEnvironment()
- {
- return m_pPhysicsEnvironment;
- }
-
- void SetPhysicsEnvironment(PHY_IPhysicsEnvironment* physicsEnvironment)
- {
- m_pPhysicsEnvironment = physicsEnvironment;
- }
-
/**
* @return a pointer to the physics controller owned by this class.
*/
diff --git a/source/gameengine/Rasterizer/RAS_BucketManager.cpp b/source/gameengine/Rasterizer/RAS_BucketManager.cpp
index 200b1c6c89f..8b3c4990a7a 100644
--- a/source/gameengine/Rasterizer/RAS_BucketManager.cpp
+++ b/source/gameengine/Rasterizer/RAS_BucketManager.cpp
@@ -126,10 +126,7 @@ void RAS_BucketManager::OrderBuckets(const MT_Transform& cameratrans, BucketList
RAS_MaterialBucket* bucket = *bit;
RAS_MeshSlot* ms;
// remove the mesh slot form the list, it culls them automatically for next frame
- for(ms = bucket->GetNextActiveMeshSlot();
- ms!= NULL;
- ms = bucket->GetNextActiveMeshSlot())
- {
+ while((ms = bucket->GetNextActiveMeshSlot())) {
slots[i++].set(ms, bucket, pnorm);
}
}
@@ -179,9 +176,7 @@ void RAS_BucketManager::RenderSolidBuckets(
RAS_MaterialBucket* bucket = *bit;
RAS_MeshSlot* ms;
// remove the mesh slot form the list, it culls them automatically for next frame
- for(ms = bucket->GetNextActiveMeshSlot();
- ms!= NULL;
- ms = bucket->GetNextActiveMeshSlot())
+ while((ms = bucket->GetNextActiveMeshSlot()))
{
rendertools->SetClientObject(rasty, ms->m_clientObj);
while (bucket->ActivateMaterial(cameratrans, rasty, rendertools))