Blender V2.61 - r43446
Classes | Functions | Variables

KX_ObstacleSimulation.cpp File Reference

#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

Function Documentation

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]
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]
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]
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]
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]
float triarea ( const float *  a,
const float *  b,
const float *  c 
) [inline]

Definition at line 63 of file KX_ObstacleSimulation.cpp.

Referenced by processSamples().


Variable Documentation

const int AVOID_MAX_STEPS = 128 [static]

Definition at line 452 of file KX_ObstacleSimulation.cpp.