Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OPC_OptimizedTree.h File Reference

Go to the source code of this file.

Classes

class  AABBCollisionNode
 
class  AABBQuantizedNode
 
class  AABBNoLeafNode
 
class  AABBQuantizedNoLeafNode
 
class  AABBOptimizedTree
 
class  AABBCollisionTree
 
class  AABBNoLeafTree
 
class  AABBQuantizedTree
 
class  AABBQuantizedNoLeafTree
 

Macros

#define IMPLEMENT_IMPLICIT_NODE(base_class, volume)
 Common interface for a node of an implicit tree. More...
 
#define IMPLEMENT_NOLEAF_NODE(base_class, volume)
 Common interface for a node of a no-leaf tree. More...
 
#define IMPLEMENT_COLLISION_TREE(base_class, node)
 Common interface for a collision tree. More...
 
#define __OPC_OPTIMIZEDTREE_H__
 
#define IMPLEMENT_IMPLICIT_NODE(base_class, volume)
 
#define IMPLEMENT_NOLEAF_NODE(base_class, volume)
 
#define IMPLEMENT_COLLISION_TREE(base_class, node)
 

Typedefs

typedef bool(* GenericWalkingCallback )(const void *current, void *user_data)
 

Detailed Description

Contains code for optimized trees.

Author
Pierre Terdiman
Date
March, 20, 2001

Definition in file OPC_OptimizedTree.h.

Macro Definition Documentation

#define __OPC_OPTIMIZEDTREE_H__

Definition at line 22 of file Opcode.h.

#define IMPLEMENT_COLLISION_TREE (   base_class,
  node 
)
Value:
public: \
/* Constructor / Destructor */ \
base_class(); \
virtual ~base_class(); \
/* Builds from a standard tree */ \
override(AABBOptimizedTree) bool Build(AABBTree* tree); \
/* Refits the tree */ \
override(AABBOptimizedTree) bool Refit(const MeshInterface* mesh_interface); \
/* Walks the tree */ \
override(AABBOptimizedTree) bool Walk(GenericWalkingCallback callback, void* user_data) const; \
/* Data access */ \
inline_ const node* GetNodes() const { return mNodes; } \
/* Stats */ \
override(AABBOptimizedTree) udword GetUsedBytes() const { return mNbNodes*sizeof(node); } \
private: \
node* mNodes;

Common interface for a collision tree.

Definition at line 114 of file Opcode.h.

#define IMPLEMENT_COLLISION_TREE (   base_class,
  node 
)
Value:
public: \
/* Constructor / Destructor */ \
base_class(); \
virtual ~base_class(); \
/* Builds from a standard tree */ \
override(AABBOptimizedTree) bool Build(AABBTree* tree); \
/* Refits the tree */ \
override(AABBOptimizedTree) bool Refit(const MeshInterface* mesh_interface); \
/* Walks the tree */ \
override(AABBOptimizedTree) bool Walk(GenericWalkingCallback callback, void* user_data) const; \
/* Data access */ \
inline_ const node* GetNodes() const { return mNodes; } \
/* Stats */ \
override(AABBOptimizedTree) udword GetUsedBytes() const { return mNbNodes*sizeof(node); } \
private: \
node* mNodes;
#define IMPLEMENT_IMPLICIT_NODE (   base_class,
  volume 
)
Value:
public: \
/* Constructor / Destructor */ \
inline_ base_class() : mData(0) {} \
inline_ ~base_class() {} \
/* Leaf test */ \
inline_ bool IsLeaf() const { return mData&1; } \
/* Data access */ \
inline_ const base_class* GetPos() const { return (base_class*)mData; } \
inline_ const base_class* GetNeg() const { return ((base_class*)mData)+1; } \
inline_ udword GetPrimitive() const { return (udword)(mData>>1); } \
/* Stats */ \
inline_ udword GetNodeSize() const { return SIZEOFOBJECT; } \
\
volume mAABB; \
uintptr_t mData;
#define IMPLEMENT_IMPLICIT_NODE (   base_class,
  volume 
)
Value:
public: \
/* Constructor / Destructor */ \
inline_ base_class() : mData(0) {} \
inline_ ~base_class() {} \
/* Leaf test */ \
inline_ bool IsLeaf() const { return mData&1; } \
/* Data access */ \
inline_ const base_class* GetPos() const { return (base_class*)mData; } \
inline_ const base_class* GetNeg() const { return ((base_class*)mData)+1; } \
inline_ udword GetPrimitive() const { return (udword)(mData>>1); } \
/* Stats */ \
inline_ udword GetNodeSize() const { return SIZEOFOBJECT; } \
\
volume mAABB; \
uintptr_t mData;

Common interface for a node of an implicit tree.

Definition at line 25 of file Opcode.h.

#define IMPLEMENT_NOLEAF_NODE (   base_class,
  volume 
)
Value:
public: \
/* Constructor / Destructor */ \
inline_ base_class() : mPosData(0), mNegData(0) {} \
inline_ ~base_class() {} \
/* Leaf tests */ \
inline_ bool HasPosLeaf() const { return mPosData&1; } \
inline_ bool HasNegLeaf() const { return mNegData&1; } \
/* Data access */ \
inline_ const base_class* GetPos() const { return (base_class*)mPosData; } \
inline_ const base_class* GetNeg() const { return (base_class*)mNegData; } \
inline_ udword GetPosPrimitive() const { return (udword)(mPosData>>1); } \
inline_ udword GetNegPrimitive() const { return (udword)(mNegData>>1); } \
/* Stats */ \
inline_ udword GetNodeSize() const { return SIZEOFOBJECT; } \
\
volume mAABB; \
uintptr_t mPosData; \
uintptr_t mNegData;
#define IMPLEMENT_NOLEAF_NODE (   base_class,
  volume 
)
Value:
public: \
/* Constructor / Destructor */ \
inline_ base_class() : mPosData(0), mNegData(0) {} \
inline_ ~base_class() {} \
/* Leaf tests */ \
inline_ bool HasPosLeaf() const { return mPosData&1; } \
inline_ bool HasNegLeaf() const { return mNegData&1; } \
/* Data access */ \
inline_ const base_class* GetPos() const { return (base_class*)mPosData; } \
inline_ const base_class* GetNeg() const { return (base_class*)mNegData; } \
inline_ udword GetPosPrimitive() const { return (udword)(mPosData>>1); } \
inline_ udword GetNegPrimitive() const { return (udword)(mNegData>>1); } \
/* Stats */ \
inline_ udword GetNodeSize() const { return SIZEOFOBJECT; } \
\
volume mAABB; \
uintptr_t mPosData; \
uintptr_t mNegData;

Common interface for a node of a no-leaf tree.

Definition at line 43 of file Opcode.h.

Typedef Documentation

typedef bool(* GenericWalkingCallback)(const void *current, void *user_data)

Definition at line 131 of file OPC_OptimizedTree.h.