Orxonox: orxonox::CollisionShape Class Reference

# orxonox::CollisionShape Class Reference

`#include <src/orxonox/objects/collisionshapes/CollisionShape.h>`

Inheritance diagram for orxonox::CollisionShape:

List of all members.

## Public Member Functions

void | calculateLocalInertia (float mass, btVector3 &inertia) const
| CollisionShape (BaseObject *creator)
btCollisionShape * | getCollisionShape () const
const Quaternion & | getOrientation () const
const Vector3 & | getPosition () const
const Vector3 & | getScale3D () const
bool | hasTransform () const
bool | notifyBeingAttached (CompoundCollisionShape *newParent)
void | notifyDetached ()
void | pitch (const Degree &angle)
void | registerVariables ()
void | roll (const Degree &angle)
void | setOrientation (const Quaternion &orientation)
void | setPosition (const Vector3 &position)
virtual void | setScale (float scale)
virtual void | setScale3D (const Vector3 &scale)
void | updateShape ()
virtual void | XMLPort (Element &xmlelement, XMLPort::Mode mode)
| XML loading and saving.
void | yaw (const Degree &angle)
virtual | ~CollisionShape ()

## Protected Member Functions

virtual btCollisionShape * | createNewShape () const =0
virtual void | parentChanged ()
virtual void | updateParent ()

## Protected Attributes

btCollisionShape * | collisionShape_
CompoundCollisionShape * | parent_
unsigned int | parentID_

## Private Attributes

Quaternion | orientation_
Vector3 | position_
Vector3 | scale_

## Constructor & Destructor Documentation

orxonox::CollisionShape::CollisionShape | ( | BaseObject * | creator | ) |

References collisionShape_, orxonox::OBJECTID_UNKNOWN, orientation_, parent_, parentID_, position_, RegisterObject, registerVariables(), and scale_.

orxonox::CollisionShape::~CollisionShape | ( |  | ) | `[virtual]`

References orxonox::CompoundCollisionShape::detach(), orxonox::BaseObject::isInitialized(), and parent_.

## Member Function Documentation

void orxonox::CollisionShape::calculateLocalInertia | ( | float | mass,
|  | btVector3 & | inertia |
| ) |  |  | const

Referenced by orxonox::WorldEntity::recalculateMassProps().

virtual btCollisionShape* orxonox::CollisionShape::createNewShape | ( |  | ) | const`[protected, pure virtual]`

Implemented in orxonox::BoxCollisionShape, orxonox::CompoundCollisionShape, orxonox::ConeCollisionShape, orxonox::PlaneCollisionShape, and orxonox::SphereCollisionShape.

Referenced by updateShape().

btCollisionShape* orxonox::CollisionShape::getCollisionShape | ( |  | ) | const`[inline]`

Referenced by orxonox::CompoundCollisionShape::attach(), orxonox::CompoundCollisionShape::detach(), orxonox::WorldEntity::notifyCollisionShapeChanged(), orxonox::WorldEntity::setCollisionType(), and orxonox::CompoundCollisionShape::updateAttachedShape().

const Quaternion& orxonox::CollisionShape::getOrientation | ( |  | ) | const`[inline]`

Referenced by orxonox::CompoundCollisionShape::attach(), orxonox::CompoundCollisionShape::updateAttachedShape(), and XMLPort().

const Vector3& orxonox::CollisionShape::getPosition | ( |  | ) | const`[inline]`

Referenced by orxonox::CompoundCollisionShape::attach(), orxonox::CompoundCollisionShape::updateAttachedShape(), and XMLPort().

const Vector3& orxonox::CollisionShape::getScale3D | ( |  | ) | const`[inline]`

Referenced by XMLPort().

bool orxonox::CollisionShape::hasTransform | ( |  | ) | const

References orxonox::MT_Type::Degree, orientation_, position_, orxonox::MT_Type::Quaternion, and orxonox::MT_Type::Vector3.

bool orxonox::CollisionShape::notifyBeingAttached | ( | CompoundCollisionShape * | newParent | ) |

References orxonox::CompoundCollisionShape::detach(), orxonox::Synchronisable::getObjectID(), orxonox::WorldEntityCollisionShape::getWorldEntityOwner(), parent_, and parentID_.

Referenced by orxonox::CompoundCollisionShape::attach().

void orxonox::CollisionShape::notifyDetached | ( |  | ) |

References orxonox::OBJECTID_UNKNOWN, parent_, and parentID_.

Referenced by orxonox::CompoundCollisionShape::detach().

void orxonox::CollisionShape::parentChanged | ( |  | ) | `[protected, virtual]`

Reimplemented in orxonox::WorldEntityCollisionShape.

References orxonox::CompoundCollisionShape::attach(), orxonox::WorldEntity::attachCollisionShape(), orxonox::Synchronisable::getSynchronisable(), and parentID_.

Referenced by registerVariables().

void orxonox::CollisionShape::pitch | ( | const Degree & | angle | ) | `[inline]`

References orxonox::MT_Type::Quaternion.

Referenced by XMLPort().

void orxonox::CollisionShape::registerVariables | ( |  | ) |

Reimplemented in orxonox::BoxCollisionShape, orxonox::ConeCollisionShape, orxonox::PlaneCollisionShape, and orxonox::SphereCollisionShape.

References parentChanged(), parentID_, orxonox::Synchronisable::registerVariable(), and orxonox::VariableDirection::ToClient.

Referenced by CollisionShape().

void orxonox::CollisionShape::roll | ( | const Degree & | angle | ) | `[inline]`

References orxonox::MT_Type::Quaternion.

Referenced by XMLPort().

void orxonox::CollisionShape::setOrientation | ( | const Quaternion & | orientation | ) | `[inline]`

Referenced by orxonox::WorldEntity::notifyBeingAttached(), orxonox::WorldEntity::notifyDetached(), and XMLPort().

void orxonox::CollisionShape::setPosition | ( | const Vector3 & | position | ) | `[inline]`

Referenced by orxonox::WorldEntity::notifyBeingAttached(), orxonox::WorldEntity::notifyDetached(), and XMLPort().

void orxonox::CollisionShape::setScale | ( | float | scale | ) | `[virtual]`

References CCOUT.

Referenced by XMLPort().

void orxonox::CollisionShape::setScale3D | ( | const Vector3 & | scale | ) | `[virtual]`

References CCOUT.

Referenced by XMLPort().

void orxonox::CollisionShape::updateParent | ( |  | ) | `[protected, virtual]`

Reimplemented in orxonox::WorldEntityCollisionShape.

References parent_, and orxonox::CompoundCollisionShape::updateAttachedShape().

Referenced by orxonox::WorldEntityCollisionShape::updateParent(), orxonox::CompoundCollisionShape::updatePublicShape(), and updateShape().

void orxonox::CollisionShape::updateShape | ( |  | ) |

References collisionShape_, createNewShape(), and updateParent().

Referenced by orxonox::BoxCollisionShape::BoxCollisionShape(), orxonox::ConeCollisionShape::ConeCollisionShape(), orxonox::PlaneCollisionShape::PlaneCollisionShape(), orxonox::SphereCollisionShape::registerVariables(), orxonox::PlaneCollisionShape::registerVariables(), orxonox::ConeCollisionShape::registerVariables(), orxonox::BoxCollisionShape::registerVariables(), and orxonox::SphereCollisionShape::SphereCollisionShape().

void orxonox::CollisionShape::XMLPort | ( | Element & | xmlelement,
|  | XMLPort::Mode | mode |
| ) |  |  | `[virtual]`

XML loading and saving.

Parameters:

  | xmlelement | The XML-element
  | loading | Loading (true) or saving (false)

Returns:
  The XML-element

Reimplemented from orxonox::BaseObject.

Reimplemented in orxonox::BoxCollisionShape, orxonox::CompoundCollisionShape, orxonox::ConeCollisionShape, orxonox::PlaneCollisionShape, and orxonox::SphereCollisionShape.

References getOrientation(), getPosition(), getScale3D(), pitch(), orxonox::MT_Type::Quaternion, roll(), setOrientation(), setPosition(), setScale(), setScale3D(), SUPER, orxonox::MT_Type::Vector3, XMLPortParamLoadOnly, XMLPortParamTemplate, and yaw().

void orxonox::CollisionShape::yaw | ( | const Degree & | angle | ) | `[inline]`

References orxonox::MT_Type::Quaternion.

Referenced by XMLPort().

## Member Data Documentation

btCollisionShape* orxonox::CollisionShape::collisionShape_`[protected]`

Referenced by CollisionShape(), orxonox::CompoundCollisionShape::updatePublicShape(), updateShape(), orxonox::BoxCollisionShape::~BoxCollisionShape(), orxonox::ConeCollisionShape::~ConeCollisionShape(), orxonox::PlaneCollisionShape::~PlaneCollisionShape(), and orxonox::SphereCollisionShape::~SphereCollisionShape().

Quaternion orxonox::CollisionShape::orientation_`[private]`

Referenced by CollisionShape(), and hasTransform().

CompoundCollisionShape* orxonox::CollisionShape::parent_`[protected]`

Referenced by CollisionShape(), notifyBeingAttached(), notifyDetached(), updateParent(), and ~CollisionShape().

unsigned int orxonox::CollisionShape::parentID_`[protected]`

Referenced by CollisionShape(), notifyBeingAttached(), notifyDetached(), parentChanged(), and registerVariables().

Vector3 orxonox::CollisionShape::position_`[private]`

Referenced by CollisionShape(), and hasTransform().

Vector3 orxonox::CollisionShape::scale_`[private]`

Referenced by CollisionShape().

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

- src/orxonox/objects/collisionshapes/CollisionShape.h
- src/orxonox/objects/collisionshapes/CollisionShape.cc