![]() |
Blender V2.61 - r43446
|
#include "KX_ObstacleSimulation.h"#include "KX_NavMeshObject.h"#include "KX_PythonInit.h"#include "DNA_object_types.h"#include "BLI_math.h"Go to the source code of this file.
Classes | |
| struct | TOICircle |
Functions | |
| float | triarea (const float *a, const float *b, const float *c) |
| static void | closestPtPtSeg (const float *pt, const float *sp, const float *sq, float &t) |
| static float | distPtSegSqr (const float *pt, const float *sp, const float *sq) |
| static int | sweepCircleCircle (const MT_Vector3 &pos0, const MT_Scalar r0, const MT_Vector2 &v, const MT_Vector3 &pos1, const MT_Scalar r1, float &tmin, float &tmax) |
| static int | sweepCircleSegment (const MT_Vector3 &pos0, const MT_Scalar r0, const MT_Vector2 &v, const MT_Vector3 &pa, const MT_Vector3 &pb, const MT_Scalar sr, float &tmin, float &tmax) |
| static bool | inBetweenAngle (float a, float amin, float amax, float &t) |
| static float | interpolateToi (float a, const float *dir, const float *toi, const int ntoi) |
| static MT_Point3 | nearestPointToObstacle (MT_Point3 &pos, KX_Obstacle *obstacle) |
| static bool | filterObstacle (KX_Obstacle *activeObst, KX_NavMeshObject *activeNavMeshObj, KX_Obstacle *otherObst, float levelHeight) |
| static void | processSamples (KX_Obstacle *activeObst, KX_NavMeshObject *activeNavMeshObj, KX_Obstacles &obstacles, float levelHeight, const float vmax, const float *spos, const float cs, const int nspos, float *res, float maxToi, float velWeight, float curVelWeight, float sideWeight, float toiWeight) |
Variables | |
| static const int | AVOID_MAX_STEPS = 128 |
| static void closestPtPtSeg | ( | const float * | pt, |
| const float * | sp, | ||
| const float * | sq, | ||
| float & | t | ||
| ) | [static] |
Definition at line 68 of file KX_ObstacleSimulation.cpp.
References simple_enum_gen::d, KDL::diff(), vdot(), and vsub().
Referenced by distPtSegSqr().
| static float distPtSegSqr | ( | const float * | pt, |
| const float * | sp, | ||
| const float * | sq | ||
| ) | [static] |
Definition at line 82 of file KX_ObstacleSimulation.cpp.
References closestPtPtSeg().
Referenced by processSamples().
| static bool filterObstacle | ( | KX_Obstacle * | activeObst, |
| KX_NavMeshObject * | activeNavMeshObj, | ||
| KX_Obstacle * | otherObst, | ||
| float | levelHeight | ||
| ) | [static] |
Definition at line 395 of file KX_ObstacleSimulation.cpp.
References fabs(), KX_OBSTACLE_NAV_MESH, KX_Obstacle::m_gameObj, KX_Obstacle::m_pos, KX_Obstacle::m_type, nearestPointToObstacle(), p, and MT_Tuple3::z().
Referenced by processSamples(), and KX_ObstacleSimulationTOI_rays::sampleRVO().
| static bool inBetweenAngle | ( | float | a, |
| float | amin, | ||
| float | amax, | ||
| float & | t | ||
| ) | [static] |
Definition at line 189 of file KX_ObstacleSimulation.cpp.
References M_PI.
Referenced by interpolateToi().
| static float interpolateToi | ( | float | a, |
| const float * | dir, | ||
| const float * | toi, | ||
| const int | ntoi | ||
| ) | [static] |
Definition at line 202 of file KX_ObstacleSimulation.cpp.
References i, inBetweenAngle(), lerp(), and next.
Referenced by KX_ObstacleSimulationTOI_rays::sampleRVO().
| static MT_Point3 nearestPointToObstacle | ( | MT_Point3 & | pos, |
| KX_Obstacle * | obstacle | ||
| ) | [static] |
Definition at line 372 of file KX_ObstacleSimulation.cpp.
References CLAMP(), MT_Vector3::dot(), MT_Vector3::fuzzyZero(), KX_OBSTACLE_CIRCLE, KX_OBSTACLE_SEGMENT, MT_Vector3::length(), KX_Obstacle::m_pos, KX_Obstacle::m_pos2, KX_Obstacle::m_shape, and MT_Vector3::normalized().
Referenced by filterObstacle().
| static void processSamples | ( | KX_Obstacle * | activeObst, |
| KX_NavMeshObject * | activeNavMeshObj, | ||
| KX_Obstacles & | obstacles, | ||
| float | levelHeight, | ||
| const float | vmax, | ||
| const float * | spos, | ||
| const float | cs, | ||
| const int | nspos, | ||
| float * | res, | ||
| float | maxToi, | ||
| float | velWeight, | ||
| float | curVelWeight, | ||
| float | sideWeight, | ||
| float | toiWeight | ||
| ) | [static] |
Definition at line 616 of file KX_ObstacleSimulation.cpp.
References clamp, distPtSegSqr(), KX_Obstacle::dvel, filterObstacle(), FLT_MAX, i, KX_OBSTACLE_CIRCLE, KX_OBSTACLE_NAV_MESH, KX_OBSTACLE_SEGMENT, KX_Obstacle::m_gameObj, KX_Obstacle::m_pos, KX_Obstacle::m_pos2, KX_Obstacle::m_rad, KX_Obstacle::m_shape, KX_Obstacle::m_type, min, p, KX_Obstacle::pvel, KDL::sqr(), sweepCircleCircle(), sweepCircleSegment(), KX_NavMeshObject::TransformToWorldCoords(), triarea(), vdot(), KX_Obstacle::vel, vscale(), vsub(), MT_Tuple3::x(), and MT_Tuple3::y().
Referenced by KX_ObstacleSimulationTOI_cells::sampleRVO().
| static int sweepCircleCircle | ( | const MT_Vector3 & | pos0, |
| const MT_Scalar | r0, | ||
| const MT_Vector2 & | v, | ||
| const MT_Vector3 & | pos1, | ||
| const MT_Scalar | r1, | ||
| float & | tmin, | ||
| float & | tmax | ||
| ) | [static] |
Definition at line 91 of file KX_ObstacleSimulation.cpp.
References simple_enum_gen::d, EPS, MT_Vector2::length2(), MT_dot(), sqrtf, MT_Tuple3::x(), and MT_Tuple3::y().
Referenced by processSamples(), KX_ObstacleSimulationTOI_rays::sampleRVO(), and sweepCircleSegment().
| static int sweepCircleSegment | ( | const MT_Vector3 & | pos0, |
| const MT_Scalar | r0, | ||
| const MT_Vector2 & | v, | ||
| const MT_Vector3 & | pa, | ||
| const MT_Vector3 & | pb, | ||
| const MT_Scalar | sr, | ||
| float & | tmin, | ||
| float & | tmax | ||
| ) | [static] |
Definition at line 113 of file KX_ObstacleSimulation.cpp.
References simple_enum_gen::d, H, L, MT_dot(), sqrtf, sweepCircleCircle(), MT_Tuple3::x(), and MT_Tuple3::y().
Referenced by processSamples(), and KX_ObstacleSimulationTOI_rays::sampleRVO().
| float triarea | ( | const float * | a, |
| const float * | b, | ||
| const float * | c | ||
| ) | [inline] |
Definition at line 63 of file KX_ObstacleSimulation.cpp.
Referenced by processSamples().
const int AVOID_MAX_STEPS = 128 [static] |
Definition at line 452 of file KX_ObstacleSimulation.cpp.