| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- $#include "NavigationMesh.h"
- struct NavigationGeometryInfo
- {
- Component* component_ @ component;
- unsigned lodLevel_ @ lodLevel;
- Matrix3x4 transform_ @ transform;
- BoundingBox boundingBox_ @ boundingBox;
- };
- class NavigationMesh : public Component
- {
- public:
- void SetTileSize(int size);
- void SetCellSize(float size);
- void SetCellHeight(float height);
- void SetAgentHeight(float height);
- void SetAgentRadius(float radius);
- void SetAgentMaxClimb(float maxClimb);
- void SetAgentMaxSlope(float maxSlope);
- void SetRegionMinSize(float size);
- void SetRegionMergeSize(float size);
- void SetEdgeMaxLength(float length);
- void SetEdgeMaxError(float error);
- void SetDetailSampleDistance(float distance);
- void SetDetailSampleMaxError(float error);
- void SetPadding(const Vector3& padding);
- bool Build();
- bool Build(const BoundingBox& boundingBox);
-
- // void FindPath(PODVector<Vector3>& dest, const Vector3& start, const Vector3& end, const Vector3& extents = Vector3::ONE);
- tolua_outside PODVector<Vector3> NavigationMeshFindPath @ FindPath(const Vector3& start, const Vector3& end, const Vector3& extents = Vector3::ONE);
- tolua_outside PODVector<Vector3> NavigationMeshFindPath @ FindPath(const Vector3& start, const Vector3& end);
-
- Vector3 GetRandomPoint();
-
- Vector3 GetRandomPointInCircle(const Vector3& center, float radius, const Vector3& extents = Vector3::ONE);
- Vector3 GetRandomPointInCircle(const Vector3& center, float radius);
-
- float GetDistanceToWall(const Vector3& point, float radius, const Vector3& extents = Vector3::ONE);
- float GetDistanceToWall(const Vector3& point, float radius);
-
- Vector3 Raycast(const Vector3& start, const Vector3& end, const Vector3& extents = Vector3::ONE);
- Vector3 Raycast(const Vector3& start, const Vector3& end);
- int GetTileSize() const;
- float GetCellSize() const;
- float GetCellHeight() const;
- float GetAgentHeight() const;
- float GetAgentRadius() const;
- float GetAgentMaxClimb() const;
- float GetAgentMaxSlope() const;
- float GetRegionMinSize() const;
- float GetRegionMergeSize() const;
- float GetEdgeMaxLength() const;
- float GetEdgeMaxError() const;
- float GetDetailSampleDistance() const;
- float GetDetailSampleMaxError() const;
- const Vector3& GetPadding() const;
- bool IsInitialized() const;
- const BoundingBox& GetBoundingBox() const;
- BoundingBox GetWorldBoundingBox() const;
- IntVector2 GetNumTiles() const;
-
- tolua_property__get_set int tileSize;
- tolua_property__get_set float cellSize;
- tolua_property__get_set float cellHeight;
- tolua_property__get_set float agentHeight;
- tolua_property__get_set float agentRadius;
- tolua_property__get_set float agentMaxClimb;
- tolua_property__get_set float agentMaxSlope;
- tolua_property__get_set float regionMinSize;
- tolua_property__get_set float regionMergeSize;
- tolua_property__get_set float edgeMaxLength;
- tolua_property__get_set float edgeMaxError;
- tolua_property__get_set float detailSampleDistance;
- tolua_property__get_set float detailSampleMaxError;
- tolua_property__get_set Vector3& padding;
- tolua_readonly tolua_property__is_set bool initialized;
- tolua_readonly tolua_property__get_set BoundingBox& boundingBox;
- tolua_readonly tolua_property__get_set BoundingBox worldBoundingBox;
- tolua_readonly tolua_property__get_set IntVector2 numTiles;
- };
- ${
- PODVector<Vector3> NavigationMeshFindPath(NavigationMesh* navMesh, const Vector3& start, const Vector3& end, const Vector3& extents = Vector3::ONE)
- {
- PODVector<Vector3> dest;
- navMesh->FindPath(dest, start, end, extents);
- return dest;
- }
- $}
|