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:
authorNick Samarin <nicks1987@bigmir.net>2010-08-11 00:48:28 +0400
committerNick Samarin <nicks1987@bigmir.net>2010-08-11 00:48:28 +0400
commit3a8f3dd3f5e843ef8abad41996ebe5f7041e3807 (patch)
tree41390eb56e14df0beb83285f0f7cf71ce49e6ee5 /source/gameengine/Ketsji/KX_Scene.cpp
parent7ec16a7c6e44cc5cb5dd52a2d49dec5dbe712efc (diff)
reworked obstacle simulation in order to have two realizations: with "cell" and "ray" sampling
Diffstat (limited to 'source/gameengine/Ketsji/KX_Scene.cpp')
-rw-r--r--source/gameengine/Ketsji/KX_Scene.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp
index 6b4c8ae2f42..cbd4b96f566 100644
--- a/source/gameengine/Ketsji/KX_Scene.cpp
+++ b/source/gameengine/Ketsji/KX_Scene.cpp
@@ -212,9 +212,11 @@ KX_Scene::KX_Scene(class SCA_IInputDevice* keyboarddevice,
bool showObstacleSimulation = scene->gm.flag & GAME_SHOW_OBSTACLE_SIMULATION;
switch (scene->gm.obstacleSimulation)
{
- case OBSTSIMULATION_TOI:
-
- m_obstacleSimulation = new KX_ObstacleSimulationTOI((MT_Scalar)scene->gm.levelHeight, showObstacleSimulation);
+ case OBSTSIMULATION_TOI_rays:
+ m_obstacleSimulation = new KX_ObstacleSimulationTOI_rays((MT_Scalar)scene->gm.levelHeight, showObstacleSimulation);
+ break;
+ case OBSTSIMULATION_TOI_cells:
+ m_obstacleSimulation = new KX_ObstacleSimulationTOI_cells((MT_Scalar)scene->gm.levelHeight, showObstacleSimulation);
break;
default:
m_obstacleSimulation = NULL;
@@ -1475,10 +1477,6 @@ void KX_Scene::LogicBeginFrame(double curtime)
}
}
- //prepare obstacle simulation for new frame
- if (m_obstacleSimulation)
- m_obstacleSimulation->UpdateObstacles();
-
m_logicmgr->BeginFrame(curtime, 1.0/KX_KetsjiEngine::GetTicRate());
}
@@ -1506,6 +1504,10 @@ void KX_Scene::LogicEndFrame()
obj->Release();
RemoveObject(obj);
}
+
+ //prepare obstacle simulation for new frame
+ if (m_obstacleSimulation)
+ m_obstacleSimulation->UpdateObstacles();
}