Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Opcode::BaseModel Class Referenceabstract

#include <Opcode.h>

Inheritance diagram for Opcode::BaseModel:
Inheritance graph
[legend]

Public Member Functions

 BaseModel ()
 
virtual bool Build (const OPCODECREATE &create)=0
 
inline_ const MeshInterfaceGetMeshInterface () const
 
inline_ udword GetModelCode () const
 
inline_ udword GetNbNodes () const
 
inline_ const AABBTreeGetSourceTree () const
 
inline_ const AABBOptimizedTreeGetTree () const
 
inline_ AABBOptimizedTreeGetTree ()
 
virtual udword GetUsedBytes () const =0
 
inline_ BOOL HasLeafNodes () const
 
inline_ BOOL HasSingleNode () const
 
inline_ BOOL IsQuantized () const
 
virtual bool Refit ()
 
inline_ void SetMeshInterface (const MeshInterface *imesh)
 
virtual ~BaseModel ()
 

Protected Member Functions

bool CreateTree (bool no_leaf, bool quantized)
 
void ReleaseBase ()
 

Protected Attributes

const MeshInterfacemIMesh
 User-defined mesh interface. More...
 
udword mModelCode
 Model code = combination of ModelFlag(s) More...
 
AABBTreemSource
 Original source tree. More...
 
AABBOptimizedTreemTree
 Optimized tree owned by the model. More...
 

Detailed Description

Definition at line 51 of file Opcode.h.

Constructor & Destructor Documentation

BaseModel::BaseModel ( )

Constructor.

Definition at line 59 of file OPC_BaseModel.cpp.

BaseModel::~BaseModel ( )
virtual

Destructor.

Definition at line 68 of file OPC_BaseModel.cpp.

Member Function Documentation

virtual bool Opcode::BaseModel::Build ( const OPCODECREATE create)
pure virtual

Builds a collision model.

Parameters
create[in] model creation structure
Returns
true if success
bool BaseModel::CreateTree ( bool  no_leaf,
bool  quantized 
)
protected

Creates an optimized tree according to user-settings, and setups mModelCode.

Parameters
no_leaf[in] true for "no leaf" tree
quantized[in] true for quantized tree
Returns
true if success

Definition at line 92 of file OPC_BaseModel.cpp.

inline_ const MeshInterface* Opcode::BaseModel::GetMeshInterface ( ) const
inline

Gets the mesh interface.

Returns
mesh interface

Definition at line 156 of file Opcode.h.

inline_ udword Opcode::BaseModel::GetModelCode ( ) const
inline

Gets the model's code.

Returns
model's code

Definition at line 148 of file Opcode.h.

inline_ udword Opcode::BaseModel::GetNbNodes ( ) const
inline

Gets the number of nodes in the tree. Should be 2*N-1 for normal trees and N-1 for optimized ones.

Returns
number of nodes

Definition at line 116 of file Opcode.h.

inline_ const AABBTree* Opcode::BaseModel::GetSourceTree ( ) const
inline

Gets the source tree.

Returns
generic tree

Definition at line 91 of file Opcode.h.

inline_ const AABBOptimizedTree* Opcode::BaseModel::GetTree ( ) const
inline

Gets the tree.

Returns
the collision tree

Definition at line 99 of file Opcode.h.

inline_ AABBOptimizedTree* Opcode::BaseModel::GetTree ( )
inline

Gets the tree.

Returns
the collision tree

Definition at line 107 of file Opcode.h.

virtual udword Opcode::BaseModel::GetUsedBytes ( ) const
pure virtual

Gets the number of bytes used by the tree.

Returns
amount of bytes used
inline_ BOOL Opcode::BaseModel::HasLeafNodes ( ) const
inline

Checks whether the tree has leaf nodes or not.

Returns
true if the tree has leaf nodes (normal tree), else false (optimized tree)

Definition at line 124 of file Opcode.h.

inline_ BOOL Opcode::BaseModel::HasSingleNode ( ) const
inline

Checks whether the model has a single node or not. This special case must be handled separately.

Returns
true if the model has only 1 node

Definition at line 140 of file Opcode.h.

inline_ BOOL Opcode::BaseModel::IsQuantized ( ) const
inline

Checks whether the tree is quantized or not.

Returns
true if the tree is quantized

Definition at line 132 of file Opcode.h.

bool BaseModel::Refit ( )
virtual

Refits the collision model. This can be used to handle dynamic meshes. Usage is:

  1. modify your mesh vertices (keep the topology constant!)
  2. refit the tree (call this method)
    Returns
    true if success

Definition at line 127 of file OPC_BaseModel.cpp.

void BaseModel::ReleaseBase ( )
protected

Releases everything.

Definition at line 78 of file OPC_BaseModel.cpp.

inline_ void Opcode::BaseModel::SetMeshInterface ( const MeshInterface imesh)
inline

Sets the mesh interface.

Parameters
imesh[in] mesh interface

Definition at line 164 of file Opcode.h.

Member Data Documentation

const MeshInterface* Opcode::BaseModel::mIMesh
protected

User-defined mesh interface.

Definition at line 167 of file Opcode.h.

udword Opcode::BaseModel::mModelCode
protected

Model code = combination of ModelFlag(s)

Definition at line 168 of file Opcode.h.

AABBTree* Opcode::BaseModel::mSource
protected

Original source tree.

Definition at line 169 of file Opcode.h.

AABBOptimizedTree* Opcode::BaseModel::mTree
protected

Optimized tree owned by the model.

Definition at line 170 of file Opcode.h.


The documentation for this class was generated from the following files:


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Sat Apr 13 2019 02:14:32