Blender V5.0
GIM_BOX_TREE_TEMPLATE_SET< _GIM_PRIMITIVE_MANAGER_PROTOTYPE, _GIM_BOX_TREE_PROTOTYPE > Class Template Reference

Generic Box Tree Template. More...

#include <gim_box_set.h>

Public Member Functions

 GIM_BOX_TREE_TEMPLATE_SET ()
SIMD_FORCE_INLINE GIM_AABB getGlobalBox () const
SIMD_FORCE_INLINE void setPrimitiveManager (const _GIM_PRIMITIVE_MANAGER_PROTOTYPE &primitive_manager)
const _GIM_PRIMITIVE_MANAGER_PROTOTYPE & getPrimitiveManager () const
_GIM_PRIMITIVE_MANAGER_PROTOTYPE & getPrimitiveManager ()
SIMD_FORCE_INLINE void update ()
 this attemps to refit the box set.
SIMD_FORCE_INLINE void buildSet ()
 this rebuild the entire set
SIMD_FORCE_INLINE bool boxQuery (const GIM_AABB &box, gim_array< GUINT > &collided_results) const
 returns the indices of the primitives in the m_primitive_manager
SIMD_FORCE_INLINE bool boxQueryTrans (const GIM_AABB &box, const btTransform &transform, gim_array< GUINT > &collided_results) const
 returns the indices of the primitives in the m_primitive_manager
SIMD_FORCE_INLINE bool rayQuery (const btVector3 &ray_dir, const btVector3 &ray_origin, gim_array< GUINT > &collided_results) const
 returns the indices of the primitives in the m_primitive_manager
SIMD_FORCE_INLINE bool hasHierarchy () const
 tells if this set has hierarcht
SIMD_FORCE_INLINE bool isTrimesh () const
 tells if this set is a trimesh
SIMD_FORCE_INLINE GUINT getNodeCount () const
 node count
SIMD_FORCE_INLINE bool isLeafNode (GUINT nodeindex) const
 tells if the node is a leaf
SIMD_FORCE_INLINE GUINT getNodeData (GUINT nodeindex) const
SIMD_FORCE_INLINE void getNodeBound (GUINT nodeindex, GIM_AABB &bound) const
SIMD_FORCE_INLINE void setNodeBound (GUINT nodeindex, const GIM_AABB &bound)
SIMD_FORCE_INLINE GUINT getLeftNodeIndex (GUINT nodeindex) const
SIMD_FORCE_INLINE GUINT getRightNodeIndex (GUINT nodeindex) const
SIMD_FORCE_INLINE GUINT getScapeNodeIndex (GUINT nodeindex) const
SIMD_FORCE_INLINE void getNodeTriangle (GUINT nodeindex, GIM_TRIANGLE &triangle) const

Protected Member Functions

SIMD_FORCE_INLINE void refit ()

Protected Attributes

_GIM_PRIMITIVE_MANAGER_PROTOTYPE m_primitive_manager
_GIM_BOX_TREE_PROTOTYPE m_box_tree

Detailed Description

template<typename _GIM_PRIMITIVE_MANAGER_PROTOTYPE, typename _GIM_BOX_TREE_PROTOTYPE>
class GIM_BOX_TREE_TEMPLATE_SET< _GIM_PRIMITIVE_MANAGER_PROTOTYPE, _GIM_BOX_TREE_PROTOTYPE >

Generic Box Tree Template.

This class offers an structure for managing a box tree of primitives. Requires a Primitive prototype (like GIM_PRIMITIVE_MANAGER_PROTOTYPE ) and a Box tree structure ( like GIM_BOX_TREE).

Definition at line 190 of file gim_box_set.h.

Constructor & Destructor Documentation

◆ GIM_BOX_TREE_TEMPLATE_SET()

template<typename _GIM_PRIMITIVE_MANAGER_PROTOTYPE, typename _GIM_BOX_TREE_PROTOTYPE>
GIM_BOX_TREE_TEMPLATE_SET< _GIM_PRIMITIVE_MANAGER_PROTOTYPE, _GIM_BOX_TREE_PROTOTYPE >::GIM_BOX_TREE_TEMPLATE_SET ( )
inline

Definition at line 227 of file gim_box_set.h.

Member Function Documentation

◆ boxQuery()

template<typename _GIM_PRIMITIVE_MANAGER_PROTOTYPE, typename _GIM_BOX_TREE_PROTOTYPE>
SIMD_FORCE_INLINE bool GIM_BOX_TREE_TEMPLATE_SET< _GIM_PRIMITIVE_MANAGER_PROTOTYPE, _GIM_BOX_TREE_PROTOTYPE >::boxQuery ( const GIM_AABB & box,
gim_array< GUINT > & collided_results ) const
inline

returns the indices of the primitives in the m_primitive_manager

Definition at line 279 of file gim_box_set.h.

References getNodeBound(), getNodeCount(), getNodeData(), getScapeNodeIndex(), GUINT, GIM_AABB::has_collision(), isLeafNode(), gim_array< T >::push_back(), SIMD_FORCE_INLINE, and gim_array< T >::size().

Referenced by boxQueryTrans().

◆ boxQueryTrans()

template<typename _GIM_PRIMITIVE_MANAGER_PROTOTYPE, typename _GIM_BOX_TREE_PROTOTYPE>
SIMD_FORCE_INLINE bool GIM_BOX_TREE_TEMPLATE_SET< _GIM_PRIMITIVE_MANAGER_PROTOTYPE, _GIM_BOX_TREE_PROTOTYPE >::boxQueryTrans ( const GIM_AABB & box,
const btTransform & transform,
gim_array< GUINT > & collided_results ) const
inline

returns the indices of the primitives in the m_primitive_manager

Definition at line 315 of file gim_box_set.h.

References GIM_AABB::appy_transform(), boxQuery(), btTransform, SIMD_FORCE_INLINE, and transform().

◆ buildSet()

template<typename _GIM_PRIMITIVE_MANAGER_PROTOTYPE, typename _GIM_BOX_TREE_PROTOTYPE>
SIMD_FORCE_INLINE void GIM_BOX_TREE_TEMPLATE_SET< _GIM_PRIMITIVE_MANAGER_PROTOTYPE, _GIM_BOX_TREE_PROTOTYPE >::buildSet ( )
inline

◆ getGlobalBox()

template<typename _GIM_PRIMITIVE_MANAGER_PROTOTYPE, typename _GIM_BOX_TREE_PROTOTYPE>
SIMD_FORCE_INLINE GIM_AABB GIM_BOX_TREE_TEMPLATE_SET< _GIM_PRIMITIVE_MANAGER_PROTOTYPE, _GIM_BOX_TREE_PROTOTYPE >::getGlobalBox ( ) const
inline

Definition at line 231 of file gim_box_set.h.

References getNodeBound(), and SIMD_FORCE_INLINE.

◆ getLeftNodeIndex()

template<typename _GIM_PRIMITIVE_MANAGER_PROTOTYPE, typename _GIM_BOX_TREE_PROTOTYPE>
SIMD_FORCE_INLINE GUINT GIM_BOX_TREE_TEMPLATE_SET< _GIM_PRIMITIVE_MANAGER_PROTOTYPE, _GIM_BOX_TREE_PROTOTYPE >::getLeftNodeIndex ( GUINT nodeindex) const
inline

Definition at line 400 of file gim_box_set.h.

References GUINT, m_box_tree, and SIMD_FORCE_INLINE.

Referenced by refit().

◆ getNodeBound()

template<typename _GIM_PRIMITIVE_MANAGER_PROTOTYPE, typename _GIM_BOX_TREE_PROTOTYPE>
SIMD_FORCE_INLINE void GIM_BOX_TREE_TEMPLATE_SET< _GIM_PRIMITIVE_MANAGER_PROTOTYPE, _GIM_BOX_TREE_PROTOTYPE >::getNodeBound ( GUINT nodeindex,
GIM_AABB & bound ) const
inline

Definition at line 390 of file gim_box_set.h.

References GUINT, m_box_tree, and SIMD_FORCE_INLINE.

Referenced by boxQuery(), getGlobalBox(), rayQuery(), and refit().

◆ getNodeCount()

template<typename _GIM_PRIMITIVE_MANAGER_PROTOTYPE, typename _GIM_BOX_TREE_PROTOTYPE>
SIMD_FORCE_INLINE GUINT GIM_BOX_TREE_TEMPLATE_SET< _GIM_PRIMITIVE_MANAGER_PROTOTYPE, _GIM_BOX_TREE_PROTOTYPE >::getNodeCount ( ) const
inline

node count

Definition at line 374 of file gim_box_set.h.

References GUINT, m_box_tree, and SIMD_FORCE_INLINE.

Referenced by boxQuery(), rayQuery(), and refit().

◆ getNodeData()

template<typename _GIM_PRIMITIVE_MANAGER_PROTOTYPE, typename _GIM_BOX_TREE_PROTOTYPE>
SIMD_FORCE_INLINE GUINT GIM_BOX_TREE_TEMPLATE_SET< _GIM_PRIMITIVE_MANAGER_PROTOTYPE, _GIM_BOX_TREE_PROTOTYPE >::getNodeData ( GUINT nodeindex) const
inline

Definition at line 385 of file gim_box_set.h.

References GUINT, m_box_tree, and SIMD_FORCE_INLINE.

Referenced by boxQuery(), getNodeTriangle(), rayQuery(), and refit().

◆ getNodeTriangle()

template<typename _GIM_PRIMITIVE_MANAGER_PROTOTYPE, typename _GIM_BOX_TREE_PROTOTYPE>
SIMD_FORCE_INLINE void GIM_BOX_TREE_TEMPLATE_SET< _GIM_PRIMITIVE_MANAGER_PROTOTYPE, _GIM_BOX_TREE_PROTOTYPE >::getNodeTriangle ( GUINT nodeindex,
GIM_TRIANGLE & triangle ) const
inline

Definition at line 415 of file gim_box_set.h.

References getNodeData(), GUINT, m_primitive_manager, and SIMD_FORCE_INLINE.

◆ getPrimitiveManager() [1/2]

template<typename _GIM_PRIMITIVE_MANAGER_PROTOTYPE, typename _GIM_BOX_TREE_PROTOTYPE>
_GIM_PRIMITIVE_MANAGER_PROTOTYPE & GIM_BOX_TREE_TEMPLATE_SET< _GIM_PRIMITIVE_MANAGER_PROTOTYPE, _GIM_BOX_TREE_PROTOTYPE >::getPrimitiveManager ( )
inline

Definition at line 248 of file gim_box_set.h.

References m_primitive_manager.

◆ getPrimitiveManager() [2/2]

template<typename _GIM_PRIMITIVE_MANAGER_PROTOTYPE, typename _GIM_BOX_TREE_PROTOTYPE>
const _GIM_PRIMITIVE_MANAGER_PROTOTYPE & GIM_BOX_TREE_TEMPLATE_SET< _GIM_PRIMITIVE_MANAGER_PROTOTYPE, _GIM_BOX_TREE_PROTOTYPE >::getPrimitiveManager ( ) const
inline

Definition at line 243 of file gim_box_set.h.

References m_primitive_manager.

◆ getRightNodeIndex()

template<typename _GIM_PRIMITIVE_MANAGER_PROTOTYPE, typename _GIM_BOX_TREE_PROTOTYPE>
SIMD_FORCE_INLINE GUINT GIM_BOX_TREE_TEMPLATE_SET< _GIM_PRIMITIVE_MANAGER_PROTOTYPE, _GIM_BOX_TREE_PROTOTYPE >::getRightNodeIndex ( GUINT nodeindex) const
inline

Definition at line 405 of file gim_box_set.h.

References GUINT, m_box_tree, and SIMD_FORCE_INLINE.

Referenced by refit().

◆ getScapeNodeIndex()

template<typename _GIM_PRIMITIVE_MANAGER_PROTOTYPE, typename _GIM_BOX_TREE_PROTOTYPE>
SIMD_FORCE_INLINE GUINT GIM_BOX_TREE_TEMPLATE_SET< _GIM_PRIMITIVE_MANAGER_PROTOTYPE, _GIM_BOX_TREE_PROTOTYPE >::getScapeNodeIndex ( GUINT nodeindex) const
inline

Definition at line 410 of file gim_box_set.h.

References GUINT, m_box_tree, and SIMD_FORCE_INLINE.

Referenced by boxQuery(), and rayQuery().

◆ hasHierarchy()

template<typename _GIM_PRIMITIVE_MANAGER_PROTOTYPE, typename _GIM_BOX_TREE_PROTOTYPE>
SIMD_FORCE_INLINE bool GIM_BOX_TREE_TEMPLATE_SET< _GIM_PRIMITIVE_MANAGER_PROTOTYPE, _GIM_BOX_TREE_PROTOTYPE >::hasHierarchy ( ) const
inline

tells if this set has hierarcht

Definition at line 362 of file gim_box_set.h.

References SIMD_FORCE_INLINE.

◆ isLeafNode()

template<typename _GIM_PRIMITIVE_MANAGER_PROTOTYPE, typename _GIM_BOX_TREE_PROTOTYPE>
SIMD_FORCE_INLINE bool GIM_BOX_TREE_TEMPLATE_SET< _GIM_PRIMITIVE_MANAGER_PROTOTYPE, _GIM_BOX_TREE_PROTOTYPE >::isLeafNode ( GUINT nodeindex) const
inline

tells if the node is a leaf

Definition at line 380 of file gim_box_set.h.

References GUINT, m_box_tree, and SIMD_FORCE_INLINE.

◆ isTrimesh()

template<typename _GIM_PRIMITIVE_MANAGER_PROTOTYPE, typename _GIM_BOX_TREE_PROTOTYPE>
SIMD_FORCE_INLINE bool GIM_BOX_TREE_TEMPLATE_SET< _GIM_PRIMITIVE_MANAGER_PROTOTYPE, _GIM_BOX_TREE_PROTOTYPE >::isTrimesh ( ) const
inline

tells if this set is a trimesh

Definition at line 368 of file gim_box_set.h.

References m_primitive_manager, and SIMD_FORCE_INLINE.

◆ rayQuery()

template<typename _GIM_PRIMITIVE_MANAGER_PROTOTYPE, typename _GIM_BOX_TREE_PROTOTYPE>
SIMD_FORCE_INLINE bool GIM_BOX_TREE_TEMPLATE_SET< _GIM_PRIMITIVE_MANAGER_PROTOTYPE, _GIM_BOX_TREE_PROTOTYPE >::rayQuery ( const btVector3 & ray_dir,
const btVector3 & ray_origin,
gim_array< GUINT > & collided_results ) const
inline

returns the indices of the primitives in the m_primitive_manager

Definition at line 324 of file gim_box_set.h.

References btVector3, GIM_AABB::collide_ray(), getNodeBound(), getNodeCount(), getNodeData(), getScapeNodeIndex(), GUINT, isLeafNode(), gim_array< T >::push_back(), SIMD_FORCE_INLINE, and gim_array< T >::size().

◆ refit()

template<typename _GIM_PRIMITIVE_MANAGER_PROTOTYPE, typename _GIM_BOX_TREE_PROTOTYPE>
SIMD_FORCE_INLINE void GIM_BOX_TREE_TEMPLATE_SET< _GIM_PRIMITIVE_MANAGER_PROTOTYPE, _GIM_BOX_TREE_PROTOTYPE >::refit ( )
inlineprotected

◆ setNodeBound()

template<typename _GIM_PRIMITIVE_MANAGER_PROTOTYPE, typename _GIM_BOX_TREE_PROTOTYPE>
SIMD_FORCE_INLINE void GIM_BOX_TREE_TEMPLATE_SET< _GIM_PRIMITIVE_MANAGER_PROTOTYPE, _GIM_BOX_TREE_PROTOTYPE >::setNodeBound ( GUINT nodeindex,
const GIM_AABB & bound )
inline

Definition at line 395 of file gim_box_set.h.

References GUINT, m_box_tree, and SIMD_FORCE_INLINE.

Referenced by refit().

◆ setPrimitiveManager()

template<typename _GIM_PRIMITIVE_MANAGER_PROTOTYPE, typename _GIM_BOX_TREE_PROTOTYPE>
SIMD_FORCE_INLINE void GIM_BOX_TREE_TEMPLATE_SET< _GIM_PRIMITIVE_MANAGER_PROTOTYPE, _GIM_BOX_TREE_PROTOTYPE >::setPrimitiveManager ( const _GIM_PRIMITIVE_MANAGER_PROTOTYPE & primitive_manager)
inline

Definition at line 238 of file gim_box_set.h.

References m_primitive_manager, and SIMD_FORCE_INLINE.

◆ update()

template<typename _GIM_PRIMITIVE_MANAGER_PROTOTYPE, typename _GIM_BOX_TREE_PROTOTYPE>
SIMD_FORCE_INLINE void GIM_BOX_TREE_TEMPLATE_SET< _GIM_PRIMITIVE_MANAGER_PROTOTYPE, _GIM_BOX_TREE_PROTOTYPE >::update ( )
inline

this attemps to refit the box set.

node manager prototype functions

Definition at line 257 of file gim_box_set.h.

References refit(), and SIMD_FORCE_INLINE.

Member Data Documentation

◆ m_box_tree

template<typename _GIM_PRIMITIVE_MANAGER_PROTOTYPE, typename _GIM_BOX_TREE_PROTOTYPE>
_GIM_BOX_TREE_PROTOTYPE GIM_BOX_TREE_TEMPLATE_SET< _GIM_PRIMITIVE_MANAGER_PROTOTYPE, _GIM_BOX_TREE_PROTOTYPE >::m_box_tree
protected

◆ m_primitive_manager

template<typename _GIM_PRIMITIVE_MANAGER_PROTOTYPE, typename _GIM_BOX_TREE_PROTOTYPE>
_GIM_PRIMITIVE_MANAGER_PROTOTYPE GIM_BOX_TREE_TEMPLATE_SET< _GIM_PRIMITIVE_MANAGER_PROTOTYPE, _GIM_BOX_TREE_PROTOTYPE >::m_primitive_manager
protected

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