NTRT Simulator
Version: Master
|
#include <tgRigidAutoCompound.h>
Public Member Functions | |
tgRigidAutoCompound (std::vector< tgRigidInfo * > rigids) | |
tgRigidAutoCompound (std::deque< tgRigidInfo * > rigids) | |
std::vector< tgRigidInfo * > | execute () |
Protected Member Functions | |
void | setRigidBodyForGroup (btCollisionObject *body, std::deque< tgRigidInfo * > &group) |
void | setRigidInfoForGroup (tgRigidInfo *rigidInfo, std::deque< tgRigidInfo * > &group) |
void | groupRigids () |
std::deque< tgRigidInfo * > | findGroup (tgRigidInfo *rigid, std::deque< tgRigidInfo * > &ungrouped) |
void | createCompounds () |
tgRigidInfo * | createCompound (std::deque< tgRigidInfo * > rigids) |
bool | rigidBelongsIn (tgRigidInfo *rigid, std::deque< tgRigidInfo * > group) |
std::string | random_tag_hash () |
Protected Attributes | |
std::deque< tgRigidInfo * > | m_rigids |
std::vector< std::deque < tgRigidInfo * > > | m_groups |
std::vector< tgRigidInfo * > | m_compounded |
Rigids that share nodes should automatically be compounded before initializing. This automatically compounds shapes that rigids that share nodes while maintaining the original mapping for later transformation back into the original list (but with the RigidBody being a compound object that multiple tgRigidInfos may point to).
Definition at line 46 of file tgRigidAutoCompound.h.
|
protected |
Creates tgCompoundRigidInfos for compounded bodies. Also, adds tags to each of the consitutent tgRigidInfos that designate what compound each of the models will belong to. These tags are in the form "compound_h8A0k2", where the second part is a random 6-digit alphanumeric hash via random_tag_hash().
Definition at line 133 of file tgRigidAutoCompound.cpp.
|
protected |
For adding tags to compounded rigid bodies. This function generates a 6-digit alphanumeric hash.
Many thanks to StackOverflow users Ates Goral and Mehrdad Afshari for a framework for this function. http://stackoverflow.com/questions/440133/how-do-i-create-a-random-alpha-numeric-string-in-c
This function should generate a random string with a uniform distribution over the characters in the 'alphanum' char array below.
Definition at line 168 of file tgRigidAutoCompound.cpp.