Public Member Functions | Private Member Functions
Model Class Reference

#include <OPC_Model.h>

Inheritance diagram for Model:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 Model ()
 override (BaseModel) bool Build(const OPCODECREATE &create)
 override (BaseModel) udword GetUsedBytes() const
virtual ~Model ()

Private Member Functions

void Release ()

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;

                OPCODECREATE OPCC;
                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

virtual Model::~Model ( ) [virtual]

Member Function Documentation

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