This commit is contained in:
Campbell Barton 2009-08-04 05:34:21 +00:00
commit 9bb8540ba9
7 changed files with 7 additions and 39 deletions

@ -1794,7 +1794,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 */

@ -36,6 +36,7 @@
#include "MT_Matrix3x3.h"
#include "KX_GameObject.h"
#include "KX_RayCast.h"
#include "KX_PythonInit.h" // KX_GetActiveScene
#ifdef HAVE_CONFIG_H
#include <config.h>
@ -327,7 +328,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) {
@ -440,7 +441,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) {

@ -101,7 +101,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),
@ -2693,8 +2692,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)
@ -2821,7 +2819,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)

@ -98,8 +98,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;
@ -337,20 +335,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.
*/

@ -1579,11 +1579,6 @@ void KX_Scene::SetGravity(const MT_Vector3& gravity)
GetPhysicsEnvironment()->setGravity(gravity[0],gravity[1],gravity[2]);
}
void KX_Scene::SetNodeTree(SG_Tree* root)
{
m_objecttree = root;
}
void KX_Scene::SetSceneConverter(class KX_BlenderSceneConverter* sceneConverter)
{
m_sceneConverter = sceneConverter;

@ -119,10 +119,6 @@ protected:
// the Qlist is for objects that needs to be rescheduled
// for updates after udpate is over (slow parent, bone parent)
/**
* The tree of objects in the scene.
*/
SG_Tree* m_objecttree;
/**
* The set of cameras for this scene

@ -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))