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-07-15 22:41:29 +0400
committerNick Samarin <nicks1987@bigmir.net>2010-07-15 22:41:29 +0400
commit0fbca1dc19afaa034377d5aeed10fa8c25e2a102 (patch)
tree0cdfcd270bba96ae536f4b91c56da7e73c2d56d7 /source/gameengine/Ketsji/KX_ObstacleSimulation.cpp
parent219e9022b9a2718abbe9bbd61514fcc1b8fa9b73 (diff)
- added options to enable visualization for obstacle simulation and steering actuator
- added python attributes for parameters of steering actuator
Diffstat (limited to 'source/gameengine/Ketsji/KX_ObstacleSimulation.cpp')
-rw-r--r--source/gameengine/Ketsji/KX_ObstacleSimulation.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/source/gameengine/Ketsji/KX_ObstacleSimulation.cpp b/source/gameengine/Ketsji/KX_ObstacleSimulation.cpp
index 14487a2e75c..dcaadd23e3f 100644
--- a/source/gameengine/Ketsji/KX_ObstacleSimulation.cpp
+++ b/source/gameengine/Ketsji/KX_ObstacleSimulation.cpp
@@ -166,8 +166,9 @@ static float interpolateToi(float a, const float* dir, const float* toi, const i
return 0;
}
-KX_ObstacleSimulation::KX_ObstacleSimulation(MT_Scalar levelHeight)
+KX_ObstacleSimulation::KX_ObstacleSimulation(MT_Scalar levelHeight, bool enableVisualization)
: m_levelHeight(levelHeight)
+, m_enableVisualization(enableVisualization)
{
}
@@ -276,6 +277,8 @@ void KX_ObstacleSimulation::AdjustObstacleVelocity(KX_Obstacle* activeObst, KX_N
void KX_ObstacleSimulation::DrawObstacles()
{
+ if (!m_enableVisualization)
+ return;
static const MT_Vector3 bluecolor(0,0,1);
static const MT_Vector3 normal(0.,0.,1.);
static const int SECTORS_NUM = 32;
@@ -341,8 +344,8 @@ bool KX_ObstacleSimulation::FilterObstacle(KX_Obstacle* activeObst, KX_NavMeshOb
return true;
}
-KX_ObstacleSimulationTOI::KX_ObstacleSimulationTOI(MT_Scalar levelHeight):
- KX_ObstacleSimulation(levelHeight),
+KX_ObstacleSimulationTOI::KX_ObstacleSimulationTOI(MT_Scalar levelHeight, bool enableVisualization):
+ KX_ObstacleSimulation(levelHeight, enableVisualization),
m_avoidSteps(32),
m_minToi(0.5f),
m_maxToi(1.2f),