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

A class that encapsulates the different boolean flags that a shape can have. More...

#include <omPhysicsShapeFlags.h>

Public Types

enum  Flag {
  ENABLED = (1 << 0), COLLISION = (1 << 1), MASS = (1 << 2), DEFAULT = ENABLED | COLLISION | MASS,
  UNDEFINED = 0
}
 An enum that specifies the different shape flags. More...
 

Public Member Functions

 ShapeFlags ()
 Create a new shape flags object with no flags set. More...
 
 ShapeFlags (Flag flag)
 Create a new shape flags object with the specified flag value initially set. More...
 
 ShapeFlags (UInt32 newFlags)
 Create a new shape flags object with the specified initial combined flags value. More...
 
 operator UInt32 () const
 Convert this shape flags object to an integer value. More...
 
Bool isSet (Flag flag) const
 Return whether or not the specified flag value is set for this flags object. More...
 
void set (Flag flag, Bool newIsSet)
 Set whether or not the specified flag value is set for this flags object. More...
 

Static Public Member Functions

static String toString (Flag flag)
 Convert the specified flag to human-readable string representation. More...
 

Detailed Description

A class that encapsulates the different boolean flags that a shape can have.

These flags provide boolean information about a certain shape. Flags are indicated by setting a single bit of a 32-bit unsigned integer to 1.

Enum values for the different flags are defined as members of the class. Typically, the user would bitwise-OR the flag enum values together to produce a final set of set flags.

Member Enumeration Documentation

An enum that specifies the different shape flags.

Enumerator
ENABLED 

A flag indicating that a shape should be enabled for collision detection.

COLLISION 

A flag indicating whether or not a shape can have collisions with other shapes.

If the flag is not set, the shape still produces collision results, but these results are not used to resolve collisions between the objects.

MASS 

A flag indicating whether or not a shape should contribute mass to the physics simulation.

If this flag is set, the shape's mass should be used when calculating the mass of its parent object.

DEFAULT 

The default flags to use for a shape.

UNDEFINED 

The flag value when all flags are not set.

Constructor & Destructor Documentation

om::physics::shapes::ShapeFlags::ShapeFlags ( )
inline

Create a new shape flags object with no flags set.

om::physics::shapes::ShapeFlags::ShapeFlags ( Flag  flag)
inline

Create a new shape flags object with the specified flag value initially set.

om::physics::shapes::ShapeFlags::ShapeFlags ( UInt32  newFlags)
inline

Create a new shape flags object with the specified initial combined flags value.

Member Function Documentation

om::physics::shapes::ShapeFlags::operator UInt32 ( ) const
inline

Convert this shape flags object to an integer value.

This operator is provided so that the ShapeFlags shape can be used as an integer value for bitwise logical operations.

Bool om::physics::shapes::ShapeFlags::isSet ( Flag  flag) const
inline

Return whether or not the specified flag value is set for this flags object.

void om::physics::shapes::ShapeFlags::set ( Flag  flag,
Bool  newIsSet 
)
inline

Set whether or not the specified flag value is set for this flags object.

static String om::physics::shapes::ShapeFlags::toString ( Flag  flag)
static

Convert the specified flag to human-readable string representation.


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