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

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

#include <omPhysicsObjectFlags.h>

Public Types

enum  Flag {
  ENABLED = (1 << 0), STATIC = (1 << 1), CONTINUOUS = (1 << 2), DEACTIVATION = (1 << 3),
  SHAPE_MASS = (1 << 4), SHAPE_INERTIA = (1 << 5), DEFAULT = ENABLED | DEACTIVATION | SHAPE_MASS | SHAPE_INERTIA, UNDEFINED = 0
}
 An enum that specifies the different physics object flags. More...
 

Public Member Functions

 ObjectFlags ()
 Create a new physics object flags object with no flags set. More...
 
 ObjectFlags (Flag flag)
 Create a new physics object flags object with the specified flag value initially set. More...
 
 ObjectFlags (UInt32 newFlags)
 Create a new physics object flags object with the specified initial combined flags value. More...
 
 operator UInt32 () const
 Convert this physics object 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...
 

Detailed Description

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

These flags provide boolean information about a certain physics object. 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 physics object flags.

Enumerator
ENABLED 

A flag indicating that a physics object is enabled for simulation.

STATIC 

A flag indicating whether or not a physics object is static.

CONTINUOUS 

A flag indicating whether or not continuous collision detection is performed for this object.

DEACTIVATION 

A flag indicating whether or not a physics object can be deactivated if it stops moving.

SHAPE_MASS 

A flag indicating whether or not a physics object should derive its mass from its shapes.

If set, the object uses its shapes to calculate its mass. Otherwise, the user-specified mass is used for simulation.

SHAPE_INERTIA 

A flag indicating whether or not a physics object should derive its inertia from its shapes.

If set, the object uses its shapes to calculate its inertia and center of mass quantities. Otherwise, the user-specified inertia and center of mass is used for simulation.

DEFAULT 

The default flags to use for a physics object.

UNDEFINED 

The flag value when all flags are not set.

Constructor & Destructor Documentation

om::physics::base::ObjectFlags::ObjectFlags ( )
inline

Create a new physics object flags object with no flags set.

om::physics::base::ObjectFlags::ObjectFlags ( Flag  flag)
inline

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

om::physics::base::ObjectFlags::ObjectFlags ( UInt32  newFlags)
inline

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

Member Function Documentation

om::physics::base::ObjectFlags::operator UInt32 ( ) const
inline

Convert this physics object flags object to an integer value.

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

Bool om::physics::base::ObjectFlags::isSet ( Flag  flag) const
inline

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

void om::physics::base::ObjectFlags::set ( Flag  flag,
Bool  newIsSet 
)
inline

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


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