Om  1.0.0
A universal framework for multimedia simulation
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
om::physics::shapes::BoxShape Class Reference

A class that represents a 3D box shape. More...

#include <omPhysicsBoxShape.h>

Inheritance diagram for om::physics::shapes::BoxShape:
om::physics::shapes::PhysicsShape

Public Member Functions

 BoxShape ()
 Create a new box shape with width, height, and depth = 1 and centered at the local origin. More...
 
 BoxShape (const Vector3f &newSize)
 Create a new axis-aligned box shape with the specified width, height, and depth centered at the origin. More...
 
 BoxShape (const Vector3f &newSize, const Vector3f &newPosition)
 Create a new axis-aligned box shape with the specified width, height, and depth centered at the given position. More...
 
 BoxShape (const Vector3f &newSize, const Vector3f &newPosition, const Matrix3f &newOrientation)
 Create a new box shape with the specified width, height, and depth centered with the given position and orientation. More...
 
Vector3f getSize () const
 Return the size of this box shape along each axis in its local space. More...
 
const Vector3f & getHalfSize () const
 Return the half size of this box shape along each axis in its local space. More...
 
SIMDFloat4 getHalfSizeSIMD () const
 Return the half size of this box shape along each axis in its local space. More...
 
void setSize (const Vector3f &newSize)
 Set the half size of this box shape along each axis in its local space. More...
 
void setHalfSize (const Vector3f &newHalfSize)
 Set the half size of this box shape along each axis in its local space. More...
 
const Vector3f & getPosition () const
 Return the 3D position of this box shape in its local space. More...
 
SIMDFloat4 getPositionSIMD () const
 Return the 4-wide SIMD position of this box shape in its local space. More...
 
void setPosition (const Vector3f &newPosition)
 Set the 3D position of this box shape in its local space. More...
 
SIMDFloat4 getBasisX () const
 Return the 4-wide SIMD X-column vector of the box's orientation matrix. More...
 
SIMDFloat4 getBasisY () const
 Return the 4-wide SIMD Y-column vector of the box's orientation matrix. More...
 
SIMDFloat4 getBasisZ () const
 Return the 4-wide SIMD Z-column vector of the box's orientation matrix. More...
 
Matrix3f getOrientation () const
 Return a 3x3 orthonormal rotation matrix indicating the axis directions of the box shape. More...
 
void setOrientation (const Matrix3f &newOrientation)
 Set a 3x3 orthonormal rotation matrix indicating the axis directions of the box shape. More...
 
PhysicsMaterialgetMaterial () const
 Return a pointer to the physics material that this box shape is using. More...
 
void setMaterial (PhysicsMaterial *newMaterial)
 Set a pointer to the physics material that this box shape is using. More...
 
virtual void getMassInfo (Float &mass, Vector3f &massCenter, Matrix3f &inertia) const
 Get the mass distribution for this shape in its local space in the output parameters. More...
 
virtual Float getVolume () const
 Return the volume of this shape in distance units cubed (m^3) in its coordinate frame. More...
 
- Public Member Functions inherited from om::physics::shapes::PhysicsShape
virtual ~PhysicsShape ()
 Destroy this physics shape and all resources it has. More...
 
const AABB3f & getBoundingBox () const
 Return a const reference to the local bounding box of this shape in its coordinate frame. More...
 
ShapeFlagsgetFlags ()
 Return a reference to an object that contains boolean parameters of the shape. More...
 
const ShapeFlagsgetFlags () const
 Return an object that contains boolean parameters of the shape. More...
 
void setFlags (const ShapeFlags &newFlags)
 Set an object that contains boolean parameters of the shape. More...
 
Bool flagIsSet (ShapeFlags::Flag flag) const
 Return whether or not the specified boolan flag is set for this shape. More...
 
Bool flagsAreSet (const ShapeFlags &otherFlags) const
 Return whether or not all of the specified boolan flags are set for this shape. More...
 
void setFlag (ShapeFlags::Flag flag, Bool newIsSet=true)
 Set whether or not the specified boolan flag is set for this shape. More...
 
ShapeTypeID getTypeID () const
 Return an integer identifying the type of this collision shape. More...
 
const ShapeTypegetType () const
 Return an object representing the type of this PhysicsShape. More...
 

Static Public Member Functions

static SIMDFloat4 getSupportPoint (const BoxShape *box, const SIMDFloat4 &direction)
 Return the point on the specified box that is farthest in the given normalized direction. More...
 

Static Public Attributes

static const ShapeType TYPE
 A shape type object that represents the type to use for a box shape. More...
 
- Static Public Attributes inherited from om::physics::shapes::PhysicsShape
static const ResourceType RESOURCE_TYPE
 The resource type for a physics shape. More...
 

Additional Inherited Members

- Protected Member Functions inherited from om::physics::shapes::PhysicsShape
 PhysicsShape (const ShapeType *newType)
 Create a PhysicsShape object that has the specified subtype. More...
 
void setBoundingBox (const AABB3f &newBoundingBox)
 Set the local-space bounding box to use for this PhysicsShape. More...
 

Detailed Description

A class that represents a 3D box shape.

Constructor & Destructor Documentation

om::physics::shapes::BoxShape::BoxShape ( )

Create a new box shape with width, height, and depth = 1 and centered at the local origin.

om::physics::shapes::BoxShape::BoxShape ( const Vector3f &  newSize)

Create a new axis-aligned box shape with the specified width, height, and depth centered at the origin.

om::physics::shapes::BoxShape::BoxShape ( const Vector3f &  newSize,
const Vector3f &  newPosition 
)

Create a new axis-aligned box shape with the specified width, height, and depth centered at the given position.

om::physics::shapes::BoxShape::BoxShape ( const Vector3f &  newSize,
const Vector3f &  newPosition,
const Matrix3f &  newOrientation 
)

Create a new box shape with the specified width, height, and depth centered with the given position and orientation.

Member Function Documentation

Vector3f om::physics::shapes::BoxShape::getSize ( ) const
inline

Return the size of this box shape along each axis in its local space.

const Vector3f& om::physics::shapes::BoxShape::getHalfSize ( ) const
inline

Return the half size of this box shape along each axis in its local space.

SIMDFloat4 om::physics::shapes::BoxShape::getHalfSizeSIMD ( ) const
inline

Return the half size of this box shape along each axis in its local space.

void om::physics::shapes::BoxShape::setSize ( const Vector3f &  newSize)
inline

Set the half size of this box shape along each axis in its local space.

void om::physics::shapes::BoxShape::setHalfSize ( const Vector3f &  newHalfSize)
inline

Set the half size of this box shape along each axis in its local space.

const Vector3f& om::physics::shapes::BoxShape::getPosition ( ) const
inline

Return the 3D position of this box shape in its local space.

SIMDFloat4 om::physics::shapes::BoxShape::getPositionSIMD ( ) const
inline

Return the 4-wide SIMD position of this box shape in its local space.

void om::physics::shapes::BoxShape::setPosition ( const Vector3f &  newPosition)
inline

Set the 3D position of this box shape in its local space.

SIMDFloat4 om::physics::shapes::BoxShape::getBasisX ( ) const
inline

Return the 4-wide SIMD X-column vector of the box's orientation matrix.

SIMDFloat4 om::physics::shapes::BoxShape::getBasisY ( ) const
inline

Return the 4-wide SIMD Y-column vector of the box's orientation matrix.

SIMDFloat4 om::physics::shapes::BoxShape::getBasisZ ( ) const
inline

Return the 4-wide SIMD Z-column vector of the box's orientation matrix.

Matrix3f om::physics::shapes::BoxShape::getOrientation ( ) const
inline

Return a 3x3 orthonormal rotation matrix indicating the axis directions of the box shape.

void om::physics::shapes::BoxShape::setOrientation ( const Matrix3f &  newOrientation)
inline

Set a 3x3 orthonormal rotation matrix indicating the axis directions of the box shape.

PhysicsMaterial* om::physics::shapes::BoxShape::getMaterial ( ) const
inline

Return a pointer to the physics material that this box shape is using.

void om::physics::shapes::BoxShape::setMaterial ( PhysicsMaterial newMaterial)
inline

Set a pointer to the physics material that this box shape is using.

virtual void om::physics::shapes::BoxShape::getMassInfo ( Float mass,
Vector3f &  massCenter,
Matrix3f &  inertia 
) const
virtual

Get the mass distribution for this shape in its local space in the output parameters.

Implements om::physics::shapes::PhysicsShape.

virtual Float om::physics::shapes::BoxShape::getVolume ( ) const
virtual

Return the volume of this shape in distance units cubed (m^3) in its coordinate frame.

Implements om::physics::shapes::PhysicsShape.

SIMDFloat4 om::physics::shapes::BoxShape::getSupportPoint ( const BoxShape box,
const SIMDFloat4 &  direction 
)
inlinestatic

Return the point on the specified box that is farthest in the given normalized direction.

Member Data Documentation

const ShapeType om::physics::shapes::BoxShape::TYPE
static

A shape type object that represents the type to use for a box shape.


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