Blender V2.61 - r43446
|
#include <KX_NavMeshObject.h>
Public Types | |
enum | NavMeshRenderMode { RM_WALLS, RM_POLYS, RM_TRIS, RM_MAX } |
Public Member Functions | |
KX_NavMeshObject (void *sgReplicationInfo, SG_Callbacks callbacks) | |
~KX_NavMeshObject () | |
virtual CValue * | GetReplica () |
virtual void | ProcessReplica () |
bool | BuildNavMesh () |
dtStatNavMesh * | GetNavMesh () |
int | FindPath (const MT_Point3 &from, const MT_Point3 &to, float *path, int maxPathLen) |
float | Raycast (const MT_Point3 &from, const MT_Point3 &to) |
void | DrawNavMesh (NavMeshRenderMode mode) |
void | DrawPath (const float *path, int pathLen, const MT_Vector3 &color) |
MT_Point3 | TransformToLocalCoords (const MT_Point3 &wpos) |
MT_Point3 | TransformToWorldCoords (const MT_Point3 &lpos) |
KX_PYMETHOD_DOC (KX_NavMeshObject, findPath) | |
KX_PYMETHOD_DOC (KX_NavMeshObject, raycast) | |
KX_PYMETHOD_DOC (KX_NavMeshObject, draw) | |
KX_PYMETHOD_DOC_NOARGS (KX_NavMeshObject, rebuild) | |
Protected Member Functions | |
bool | BuildVertIndArrays (float *&vertices, int &nverts, unsigned short *&polys, int &npolys, unsigned short *&dmeshes, float *&dvertices, int &ndvertsuniq, unsigned short *&dtris, int &ndtris, int &vertsPerPoly) |
Protected Attributes | |
dtStatNavMesh * | m_navMesh |
Definition at line 37 of file KX_NavMeshObject.h.
Definition at line 62 of file KX_NavMeshObject.h.
KX_NavMeshObject::KX_NavMeshObject | ( | void * | sgReplicationInfo, |
SG_Callbacks | callbacks | ||
) |
Definition at line 76 of file KX_NavMeshObject.cpp.
Referenced by GetReplica().
KX_NavMeshObject::~KX_NavMeshObject | ( | ) |
Definition at line 83 of file KX_NavMeshObject.cpp.
References m_navMesh.
bool KX_NavMeshObject::BuildNavMesh | ( | ) |
Definition at line 280 of file KX_NavMeshObject.cpp.
References BuildVertIndArrays(), calcMeshBounds(), simple_enum_gen::d, data, flipAxes(), KX_GameObject::GetMeshCount(), i, KX_GameObject::m_name, m_navMesh, MEM_freeN(), NULL, p, and STR_String::ReadPtr().
Referenced by BL_ConvertBlenderObjects(), and ProcessReplica().
bool KX_NavMeshObject::BuildVertIndArrays | ( | float *& | vertices, |
int & | nverts, | ||
unsigned short *& | polys, | ||
int & | npolys, | ||
unsigned short *& | dmeshes, | ||
float *& | dvertices, | ||
int & | ndvertsuniq, | ||
unsigned short *& | dtris, | ||
int & | ndtris, | ||
int & | vertsPerPoly | ||
) | [protected] |
Definition at line 108 of file KX_NavMeshObject.cpp.
References buildNavMeshDataByDerivedMesh(), CD_MASK_MESH, CD_RECAST, copy_v3_v3(), KX_GameObject::GetBlenderObject(), DerivedMesh::getFaceDataArray, KX_GameObject::GetMesh(), RAS_TexVert::getOrigIndex(), RAS_MeshObject::GetPolygon(), RAS_Polygon::GetVertex(), RAS_MeshObject::GetVertexLocation(), i, KX_GetActiveScene(), RAS_MeshObject::m_sharedvertex_map, MEM_freeN(), mesh_create_derived_no_virtual(), NULL, RAS_MeshObject::NumPolygons(), p, polyFindVertex(), polyNumVerts(), DerivedMesh::release, and RAS_Polygon::VertexCount().
Referenced by BuildNavMesh().
void KX_NavMeshObject::DrawNavMesh | ( | NavMeshRenderMode | mode | ) |
Definition at line 474 of file KX_NavMeshObject.cpp.
References MakeCursor::color, flipAxes(), i, KX_RasterizerDrawDebugLine(), m_navMesh, p, RM_POLYS, RM_TRIS, RM_WALLS, MT_Tuple3::setValue(), and TransformToWorldCoords().
void KX_NavMeshObject::DrawPath | ( | const float * | path, |
int | pathLen, | ||
const MT_Vector3 & | color | ||
) |
Definition at line 611 of file KX_NavMeshObject.cpp.
References i, KX_RasterizerDrawDebugLine(), and MT_Tuple3::setValue().
Referenced by KX_SteeringActuator::Update().
int KX_NavMeshObject::FindPath | ( | const MT_Point3 & | from, |
const MT_Point3 & | to, | ||
float * | path, | ||
int | maxPathLen | ||
) |
Definition at line 561 of file KX_NavMeshObject.cpp.
References flipAxes(), MT_Tuple3::getValue(), i, m_navMesh, polyPickExt, TransformToLocalCoords(), and TransformToWorldCoords().
Referenced by KX_SteeringActuator::Update().
dtStatNavMesh * KX_NavMeshObject::GetNavMesh | ( | ) |
Definition at line 469 of file KX_NavMeshObject.cpp.
References m_navMesh.
Referenced by KX_ObstacleSimulation::AddObstaclesForNavMesh().
CValue * KX_NavMeshObject::GetReplica | ( | void | ) | [virtual] |
Inherited from CValue -- return a new copy of this instance allocated on the heap. Ownership of the new object belongs with the caller.
Reimplemented from KX_GameObject.
Definition at line 89 of file KX_NavMeshObject.cpp.
References KX_NavMeshObject(), and ProcessReplica().
KX_NavMeshObject::KX_PYMETHOD_DOC | ( | KX_NavMeshObject | , |
raycast | |||
) |
KX_NavMeshObject::KX_PYMETHOD_DOC | ( | KX_NavMeshObject | , |
findPath | |||
) |
KX_NavMeshObject::KX_PYMETHOD_DOC | ( | KX_NavMeshObject | , |
draw | |||
) |
KX_NavMeshObject::KX_PYMETHOD_DOC_NOARGS | ( | KX_NavMeshObject | , |
rebuild | |||
) |
void KX_NavMeshObject::ProcessReplica | ( | ) | [virtual] |
Inherited from CValue -- Makes sure any internal data owned by this class is deep copied. Called internally
Reimplemented from KX_GameObject.
Definition at line 96 of file KX_NavMeshObject.cpp.
References KX_ObstacleSimulation::AddObstaclesForNavMesh(), BuildNavMesh(), KX_Scene::GetObstacleSimulation(), and KX_GetActiveScene().
Referenced by GetReplica().
Definition at line 595 of file KX_NavMeshObject.cpp.
References flipAxes(), MT_Tuple3::getValue(), m_navMesh, MAX_PATH_LEN, polyPickExt, and TransformToLocalCoords().
Definition at line 539 of file KX_NavMeshObject.cpp.
References MT_Transform::invert(), KX_GameObject::NodeGetWorldOrientation(), KX_GameObject::NodeGetWorldPosition(), and KX_GameObject::NodeGetWorldScaling().
Referenced by FindPath(), and Raycast().
Definition at line 551 of file KX_NavMeshObject.cpp.
References KX_GameObject::NodeGetWorldOrientation(), KX_GameObject::NodeGetWorldPosition(), and KX_GameObject::NodeGetWorldScaling().
Referenced by DrawNavMesh(), KX_ObstacleSimulation::DrawObstacles(), FindPath(), processSamples(), and KX_ObstacleSimulationTOI_rays::sampleRVO().
dtStatNavMesh* KX_NavMeshObject::m_navMesh [protected] |
Definition at line 42 of file KX_NavMeshObject.h.
Referenced by BuildNavMesh(), DrawNavMesh(), FindPath(), GetNavMesh(), Raycast(), and ~KX_NavMeshObject().