Public Member Functions | Private Member Functions | List of all members
Model Class Reference

#include <OPC_Model.h>

Inheritance diagram for Model:
Inheritance graph
[legend]

Public Member Functions

 Model ()
 
 override (BaseModel) bool Build(const OPCODECREATE &create)
 
 override (BaseModel) udword GetUsedBytes() const
 
virtual ~Model ()
 
- Public Member Functions inherited from BaseModel
 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 ()
 

Private Member Functions

void Release ()
 

Additional Inherited Members

- Protected Member Functions inherited from BaseModel
bool CreateTree (bool no_leaf, bool quantized)
 
void ReleaseBase ()
 
- Protected Attributes inherited from BaseModel
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

The main collision wrapper, for all trees. Supported trees are:

Usage:

1) Create a static mesh interface using callbacks or pointers. (see OPC_MeshInterface.cpp). Keep it around in your app, since a pointer to this interface is saved internally and used until you release the collision structures.

2) Build a Model using a creation structure:

Model Sample;
OPCC.IMesh = ...;
OPCC.Rules = ...;
OPCC.NoLeaf = ...;
OPCC.Quantized = ...;
OPCC.KeepOriginal = ...;
bool Status = Sample.Build(OPCC);

3) Create a tree collider and set it up:

4) Perform a collision query

// Setup cache
static BVTCache ColCache;
ColCache.Model0 = &Model0;
ColCache.Model1 = &Model1;
// Collision query
bool IsOk = TC.Collide(ColCache, World0, World1);
// Get collision status => if true, objects overlap
BOOL Status = TC.GetContactStatus();
// Number of colliding pairs and list of pairs
udword NbPairs = TC.GetNbPairs();
const Pair* p = TC.GetPairs()

5) Stats

Model0.GetUsedBytes() = number of bytes used for this collision tree
TC.GetNbBVBVTests() = number of BV-BV overlap tests performed during last query
TC.GetNbPrimPrimTests() = number of Triangle-Triangle overlap tests performed during last query
TC.GetNbBVPrimTests() = number of Triangle-BV overlap tests performed during last query
Author
Pierre Terdiman
Version
1.3
Date
March, 20, 2001

Definition at line 23 of file OPC_Model.h.

Constructor & Destructor Documentation

◆ Model()

Model::Model ( )

◆ ~Model()

virtual Model::~Model ( )
virtual

Member Function Documentation

◆ override() [1/2]

Model::override ( BaseModel  ) const &

Builds a collision model.

Parameters
create[in] model creation structure
Returns
true if success

◆ override() [2/2]

Model::override ( BaseModel  ) const

Gets the number of bytes used by the tree.

Returns
amount of bytes used

◆ Release()

void Model::Release ( )
private

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


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Thu Sep 8 2022 02:24:07