Class CollisionObject

Class Documentation

class CollisionObject

the object for collision or distance computation, contains the geometry and the transform information

Public Functions

inline CollisionObject(const shared_ptr<CollisionGeometry> &cgeom_, bool compute_local_aabb = true)
inline CollisionObject(const shared_ptr<CollisionGeometry> &cgeom_, const Transform3f &tf, bool compute_local_aabb = true)
inline CollisionObject(const shared_ptr<CollisionGeometry> &cgeom_, const Matrix3f &R, const Vec3f &T, bool compute_local_aabb = true)
inline bool operator==(const CollisionObject &other) const
inline bool operator!=(const CollisionObject &other) const
inline ~CollisionObject()
inline OBJECT_TYPE getObjectType() const

get the type of the object

inline NODE_TYPE getNodeType() const

get the node type

inline const AABB &getAABB() const

get the AABB in world space

inline AABB &getAABB()

get the AABB in world space

inline void computeAABB()

compute the AABB in world space

inline void *getUserData() const

get user data in object

inline void setUserData(void *data)

set user data in object

inline const Vec3f &getTranslation() const

get translation of the object

inline const Matrix3f &getRotation() const

get matrix rotation of the object

inline const Transform3f &getTransform() const

get object’s transform

inline void setRotation(const Matrix3f &R)

set object’s rotation matrix

inline void setTranslation(const Vec3f &T)

set object’s translation

inline void setTransform(const Matrix3f &R, const Vec3f &T)

set object’s transform

inline void setTransform(const Transform3f &tf)

set object’s transform

inline bool isIdentityTransform() const

whether the object is in local coordinate

inline void setIdentityTransform()

set the object in local coordinate

inline const shared_ptr<const CollisionGeometry> collisionGeometry() const

get shared pointer to collision geometry of the object instance

inline const shared_ptr<CollisionGeometry> &collisionGeometry()

get shared pointer to collision geometry of the object instance

inline const CollisionGeometry *collisionGeometryPtr() const

get raw pointer to collision geometry of the object instance

inline CollisionGeometry *collisionGeometryPtr()

get raw pointer to collision geometry of the object instance

inline void setCollisionGeometry(const shared_ptr<CollisionGeometry> &collision_geometry, bool compute_local_aabb = true)

Associate a new CollisionGeometry.

Parameters:
  • collision_geometry[in] The new CollisionGeometry

  • compute_local_aabb[in] Whether the local aabb of the input new has to be computed.

Protected Functions

inline void init(bool compute_local_aabb = true)

Protected Attributes

shared_ptr<CollisionGeometry> cgeom
Transform3f t
mutable AABB aabb

AABB in global coordinate.

void *user_data

pointer to user defined data specific to this object