Go to the documentation of this file.
29 #ifndef __ConvexBody_H__
30 #define __ConvexBody_H__
34 #if OGRE_THREAD_SUPPORT
65 #if OGRE_THREAD_SUPPORT
98 void clip(
const Plane& pl,
bool keepNegative =
true);
152 {
return !( *
this == rhs ); }
void logInfo() const
Log details of this body.
void deleteVertex(size_t poly, size_t vertex)
Deletes a specific vertex of a specific polygon.
void define(const AxisAlignedBox &aab)
Build a new polygon representation from an AAB.
Defines a plane in 3D space.
void mergePolygons(void)
Merges all neighboring polygons into one single polygon if they are lay in the same plane.
size_t getPolygonCount(void) const
Returns the current number of polygons.
const Vector3 & getVertex(size_t poly, size_t vertex) const
Returns a specific vertex of a polygon.
multimap< Vector3, Vector3 >::type EdgeMap
void extend(const Vector3 &pt)
Extends the existing body to incorporate the passed in point as a convex hull.
void define(const Frustum &frustum)
Build a new polygon representation from a frustum.
Polygon::EdgeMap getSingleEdges() const
Returns the single edges in an EdgeMap (= edges where one side is a vertex and the other is empty spa...
static PolygonList msFreePolygons
void clip(const AxisAlignedBox &aab)
Clips the body with an AAB.
void insertPolygon(Polygon *pdata, size_t poly)
Inserts a polygon at a particular point in the body.
void clip(const Plane &pl, bool keepNegative=true)
Clips the object by the positive half space of a plane.
void moveDataFromBody(ConvexBody &body)
Moves all polygons from the parameter body to this instance.
void insertVertex(size_t poly, const Vector3 &vdata, size_t vertex)
Inserts a vertex for a polygon at a particular point.
size_t getVertexCount(size_t poly) const
Returns the number of vertices for a polygon.
static Polygon * allocatePolygon()
Get a new polygon from the pool.
bool operator!=(STLAllocator< T, P > const &, STLAllocator< T2, P > const &)
determine equality, can memory from another allocator be released by this allocator,...
bool hasClosedHull(void) const
Checks if the body has a closed hull.
void deletePolygon(size_t poly)
Deletes a specific polygon.
Polygon * unlinkPolygon(size_t poly)
Removes a specific polygon from the body without deleting it.
static void freePolygon(Polygon *poly)
Release a polygon back tot he pool.
std::ostream & operator<<(std::ostream &o, const TRect< T > &r)
#define OGRE_STATIC_MUTEX(name)
Holds a solid representation of a convex body.
void setVertex(size_t poly, const Vector3 &vdata, size_t vertex)
Replace a specific vertex of a polygon.
AxisAlignedBox getAABB(void) const
Returns an AABB representation.
A 3D box aligned with the x/y/z axes.
vector< Polygon * >::type PolygonList
void setPolygon(Polygon *pdata, size_t poly)
Replace a polygon at a particular index.
void reset(void)
Resets the object.
const Vector3 & getNormal(size_t poly)
Returns the normal of a specified polygon.
A frustum represents a pyramid, capped at the near and far end which is used to represent either a vi...
void clip(const Frustum &frustum)
Clips the body with a frustum.
void clip(const ConvexBody &body)
Clips the body with another body.
const Polygon & getPolygon(size_t poly) const
Returns a polygon.
void insertPolygon(Polygon *pdata)
Inserts a polygon at the end.
static void _destroyPool()
Tear down the internal polygon pool used to minimise allocations.
ConvexBody(const ConvexBody &cpy)
void allocateSpace(size_t numPolygons, size_t numVertices)
Allocates space for an specified amount of polygons with each of them having a specified number of ve...
static void _initialisePool()
Initialise the internal polygon pool used to minimise allocations.
bool operator==(STLAllocator< T, P > const &, STLAllocator< T2, P > const &)
determine equality, can memory from another allocator be released by this allocator,...
void insertVertex(size_t poly, const Vector3 &vdata)
Inserts a vertex for a polygon at the end.
bool findAndEraseEdgePair(const Vector3 &vec, Polygon::EdgeMap &intersectionEdges, Vector3 &vNext) const
Searches for a pair (an edge) in the intersectionList with an entry that equals vec,...
void storeEdgesOfPolygon(size_t poly, Polygon::EdgeMap *edgeMap) const
Stores the edges of a specific polygon in a passed in structure.
The class represents a polygon in 3D space.
Standard 3-dimensional vector.
Copyright © 2012 Torus Knot Software Ltd

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.