Blender V2.61 - r43446
|
#include <KX_ObstacleSimulation.h>
Public Member Functions | |
KX_ObstacleSimulation (MT_Scalar levelHeight, bool enableVisualization) | |
virtual | ~KX_ObstacleSimulation () |
void | DrawObstacles () |
void | AddObstacleForObj (KX_GameObject *gameobj) |
void | DestroyObstacleForObj (KX_GameObject *gameobj) |
void | AddObstaclesForNavMesh (KX_NavMeshObject *navmesh) |
KX_Obstacle * | GetObstacle (KX_GameObject *gameobj) |
void | UpdateObstacles () |
virtual void | AdjustObstacleVelocity (KX_Obstacle *activeObst, KX_NavMeshObject *activeNavMeshObj, MT_Vector3 &velocity, MT_Scalar maxDeltaSpeed, MT_Scalar maxDeltaAngle) |
Protected Member Functions | |
KX_Obstacle * | CreateObstacle (KX_GameObject *gameobj) |
Protected Attributes | |
KX_Obstacles | m_obstacles |
MT_Scalar | m_levelHeight |
bool | m_enableVisualization |
Definition at line 69 of file KX_ObstacleSimulation.h.
KX_ObstacleSimulation::KX_ObstacleSimulation | ( | MT_Scalar | levelHeight, |
bool | enableVisualization | ||
) |
Definition at line 216 of file KX_ObstacleSimulation.cpp.
KX_ObstacleSimulation::~KX_ObstacleSimulation | ( | ) | [virtual] |
Definition at line 223 of file KX_ObstacleSimulation.cpp.
References i, and m_obstacles.
void KX_ObstacleSimulation::AddObstacleForObj | ( | KX_GameObject * | gameobj | ) |
Definition at line 250 of file KX_ObstacleSimulation.cpp.
References CreateObstacle(), KX_GameObject::GetBlenderObject(), KX_OBSTACLE_CIRCLE, KX_OBSTACLE_OBJ, KX_Obstacle::m_rad, KX_Obstacle::m_shape, KX_Obstacle::m_type, and Object::obstacleRad.
Referenced by BL_ConvertBlenderObjects(), and KX_GameObject::ProcessReplica().
void KX_ObstacleSimulation::AddObstaclesForNavMesh | ( | KX_NavMeshObject * | navmesh | ) |
Definition at line 259 of file KX_ObstacleSimulation.cpp.
References CreateObstacle(), KX_NavMeshObject::GetNavMesh(), i, KX_OBSTACLE_NAV_MESH, KX_OBSTACLE_SEGMENT, KX_Obstacle::m_pos, KX_Obstacle::m_pos2, KX_Obstacle::m_rad, KX_Obstacle::m_shape, and KX_Obstacle::m_type.
Referenced by BL_ConvertBlenderObjects(), and KX_NavMeshObject::ProcessReplica().
void KX_ObstacleSimulation::AdjustObstacleVelocity | ( | KX_Obstacle * | activeObst, |
KX_NavMeshObject * | activeNavMeshObj, | ||
MT_Vector3 & | velocity, | ||
MT_Scalar | maxDeltaSpeed, | ||
MT_Scalar | maxDeltaAngle | ||
) | [virtual] |
Reimplemented in KX_ObstacleSimulationTOI.
Definition at line 336 of file KX_ObstacleSimulation.cpp.
Referenced by KX_SteeringActuator::Update().
KX_Obstacle * KX_ObstacleSimulation::CreateObstacle | ( | KX_GameObject * | gameobj | ) | [protected] |
Definition at line 232 of file KX_ObstacleSimulation.cpp.
References KX_Obstacle::dvel, KX_Obstacle::hhead, KX_Obstacle::hvel, i, KX_Obstacle::m_gameObj, m_obstacles, KX_Obstacle::nvel, KX_Obstacle::pvel, KX_GameObject::RegisterObstacle(), KX_Obstacle::vel, and VEL_HIST_SIZE.
Referenced by AddObstacleForObj(), and AddObstaclesForNavMesh().
void KX_ObstacleSimulation::DestroyObstacleForObj | ( | KX_GameObject * | gameobj | ) |
Definition at line 286 of file KX_ObstacleSimulation.cpp.
References i, KX_Obstacle::m_gameObj, m_obstacles, and KX_GameObject::UnregisterObstacle().
Referenced by KX_GameObject::~KX_GameObject().
void KX_ObstacleSimulation::DrawObstacles | ( | ) |
Definition at line 341 of file KX_ObstacleSimulation.cpp.
References i, KX_OBSTACLE_CIRCLE, KX_OBSTACLE_NAV_MESH, KX_OBSTACLE_SEGMENT, KX_RasterizerDrawDebugCircle(), KX_RasterizerDrawDebugLine(), m_enableVisualization, m_obstacles, and KX_NavMeshObject::TransformToWorldCoords().
KX_Obstacle * KX_ObstacleSimulation::GetObstacle | ( | KX_GameObject * | gameobj | ) |
Definition at line 325 of file KX_ObstacleSimulation.cpp.
References i, m_obstacles, and NULL.
Referenced by KX_SteeringActuator::KX_SteeringActuator().
void KX_ObstacleSimulation::UpdateObstacles | ( | ) |
Definition at line 303 of file KX_ObstacleSimulation.cpp.
References KX_GameObject::GetLinearVelocity(), KX_Obstacle::hhead, KX_Obstacle::hvel, i, KX_OBSTACLE_NAV_MESH, KX_OBSTACLE_SEGMENT, KX_Obstacle::m_gameObj, m_obstacles, KX_Obstacle::m_pos, KX_GameObject::NodeGetWorldPosition(), KX_Obstacle::pvel, vadd(), KX_Obstacle::vel, VEL_HIST_SIZE, vscale(), MT_Tuple3::x(), and MT_Tuple3::y().
Referenced by KX_Scene::LogicEndFrame().
bool KX_ObstacleSimulation::m_enableVisualization [protected] |
Definition at line 75 of file KX_ObstacleSimulation.h.
Referenced by DrawObstacles().
MT_Scalar KX_ObstacleSimulation::m_levelHeight [protected] |
Definition at line 74 of file KX_ObstacleSimulation.h.
Referenced by KX_ObstacleSimulationTOI_cells::sampleRVO(), and KX_ObstacleSimulationTOI_rays::sampleRVO().
KX_Obstacles KX_ObstacleSimulation::m_obstacles [protected] |
Definition at line 72 of file KX_ObstacleSimulation.h.
Referenced by KX_ObstacleSimulationTOI::AdjustObstacleVelocity(), CreateObstacle(), DestroyObstacleForObj(), DrawObstacles(), GetObstacle(), KX_ObstacleSimulationTOI_cells::sampleRVO(), KX_ObstacleSimulationTOI_rays::sampleRVO(), UpdateObstacles(), and ~KX_ObstacleSimulation().