Public Member Functions | Private Member Functions | Private Attributes
HybridModel Class Reference

#include <OPC_HybridModel.h>

Inheritance diagram for HybridModel:
Inheritance graph
[legend]

List of all members.

Public Member Functions

inline_ const udwordGetIndices () const
inline_ const LeafTrianglesGetLeafTriangles () const
 HybridModel ()
 override (BaseModel) bool Build(const OPCODECREATE &create)
 override (BaseModel) udword GetUsedBytes() const
 override (BaseModel) bool Refit()
virtual ~HybridModel ()

Private Member Functions

void Release ()

Private Attributes

udwordmIndices
 Array of primitive indices.
udword mNbLeaves
 Number of leaf nodes in the model.
udword mNbPrimitives
 Number of primitives in the model.
LeafTrianglesmTriangles
 Array of mNbLeaves leaf descriptors.

Detailed Description

An hybrid collision model.

The problem :

Opcode really shines for mesh-mesh collision, especially when meshes are deeply overlapping (it typically outperforms RAPID in those cases).

Unfortunately this is not the typical scenario in games.

For close-proximity cases, especially for volume-mesh queries, it's relatively easy to run faster than Opcode, that suffers from a relatively high setup time.

In particular, Opcode's "vanilla" trees in those cases -can- run faster. They can also use -less- memory than the optimized ones, when you let the system stop at ~10 triangles / leaf for example (i.e. when you don't use "complete" trees). However, those trees tend to fragment memory quite a lot, increasing cache misses : since they're not "complete", we can't predict the final number of nodes and we have to allocate nodes on-the-fly. For the same reasons we can't use Opcode's "optimized" trees here, since they rely on a known layout to perform the "optimization".

Hybrid trees :

Hybrid trees try to combine best of both worlds :

All of that is wrapped in this "hybrid model" that contains the minimal data required for this to work. It's a mix between old "vanilla" trees, and old "optimized" trees.

Extra advantages:

Information to take home:

Author:
Pierre Terdiman
Version:
1.3
Date:
May, 18, 2003

Definition at line 46 of file OPC_HybridModel.h.


Constructor & Destructor Documentation

virtual HybridModel::~HybridModel ( ) [virtual]

Member Function Documentation

Gets array of indices.

Returns:
array of indices

Definition at line 94 of file OPC_HybridModel.h.

Gets array of triangles.

Returns:
array of triangles

Definition at line 86 of file OPC_HybridModel.h.

Builds a collision model.

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

Gets the number of bytes used by the tree.

Returns:
amount of bytes used

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
void HybridModel::Release ( ) [private]

Member Data Documentation

Array of primitive indices.

Definition at line 100 of file OPC_HybridModel.h.

Number of leaf nodes in the model.

Definition at line 97 of file OPC_HybridModel.h.

Number of primitives in the model.

Definition at line 99 of file OPC_HybridModel.h.

Array of mNbLeaves leaf descriptors.

Definition at line 98 of file OPC_HybridModel.h.


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 Apr 11 2019 03:30:21