Any 3D map defines an arbitrary 3D region of space. More...
#include <zone.h>
Public Types | |
enum | eType { eType_Parent = 0x01, eType_Leaf = 0x02, eType_VirtualLeaf = 0x12, eType_Invalid = 0x00 } |
Public Member Functions | |
virtual | ~Zone (void) throw () |
virtual const char * | getId (void) const =0 throw () |
get the unique ID of this zone (unique within map) | |
virtual eType | getType (void) const =0 throw () |
what type of Zone is this? | |
virtual void | getBoundingRect (OUT rect3d_t &r) const =0 |
returns axis-aligned bounding box for this zone | |
virtual bool | containsPoint (IN const point3d_t &p) const =0 throw () |
does this zone contain the specified point? | |
virtual LeafZone * | getLeafZone (IN const point3d_t &p)=0 throw () |
return leaf zone within zone that contains specified point, or null | |
virtual const LeafZone * | getLeafZone (IN const point3d_t &p) const =0 throw () |
return leaf zone within zone that contains specified point, or null | |
virtual void * | getUserPointer (void) const =0 throw () |
virtual void | setUserPointer (void *)=0 throw () |
Any 3D map defines an arbitrary 3D region of space.
For efficient rendering and AI, this space must be recursively partitioned into subspaces. Any internet search for "Space Partitioning" will reveal popular and useful methods such as BSP trees, Octrees, kd trees, etc.
The aesop server doesn't care what partitioning strategy is used. All that is important is that the space is correctly partitioned into disjoint sets.
A Zone is a 3D region of space which (in general) completely contains a number of subzones, which contain subzones etc.
Zones are static. That is, for a given map, the zone structure does not change during gameplay. However, objects can move around in and between zones.
Zones should never be aware of drawing or rendering. Other code libraries can use Zone objects to draw.
Definition at line 70 of file zone.h.
enum aesop::Zone::eType |
eType_Parent |
contains subzones |
eType_Leaf |
leaf zone (aesop::LeafZone) |
eType_VirtualLeaf |
leaf zone, no 3D extent |
eType_Invalid |
aesop::Zone::~Zone | ( | void | ) | throw () [virtual] |
Definition at line 40 of file aesop-map.cpp.
virtual const char* aesop::Zone::getId | ( | void | ) | const throw () [pure virtual] |
get the unique ID of this zone (unique within map)
virtual eType aesop::Zone::getType | ( | void | ) | const throw () [pure virtual] |
what type of Zone is this?
virtual void aesop::Zone::getBoundingRect | ( | OUT rect3d_t & | r | ) | const [pure virtual] |
returns axis-aligned bounding box for this zone
virtual bool aesop::Zone::containsPoint | ( | IN const point3d_t & | p | ) | const throw () [pure virtual] |
does this zone contain the specified point?
virtual LeafZone* aesop::Zone::getLeafZone | ( | IN const point3d_t & | p | ) | throw () [pure virtual] |
return leaf zone within zone that contains specified point, or null
virtual const LeafZone* aesop::Zone::getLeafZone | ( | IN const point3d_t & | p | ) | const throw () [pure virtual] |
return leaf zone within zone that contains specified point, or null
virtual void* aesop::Zone::getUserPointer | ( | void | ) | const throw () [pure virtual] |
virtual void aesop::Zone::setUserPointer | ( | void * | ) | throw () [pure virtual] |