Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

oxygen::AngularMotor Class Reference

An angular motor allows the relative angular velocities of two bodies to be controlled. More...

#include <angularmotor.h>

Inheritance diagram for oxygen::AngularMotor:

Inheritance graph
[legend]
Collaboration diagram for oxygen::AngularMotor:

Collaboration graph
[legend]
List of all members.

Public Types

enum  EMotorMode { MM_USER = dAMotorUser, MM_EULER = dAMotorEuler }
enum  EAxisAnchor { AA_GLOBAL = 0, AA_FIRSTBODY = 1, AA_SECONDBODY = 2 }

Public Member Functions

 AngularMotor ()
virtual ~AngularMotor ()
void SetMode (EMotorMode mode)
 sets the motor mode.
EMotorMode GetMode ()
 returns the current motor mode
void SetNumAxes (int num)
 sets the number of angular axes that will be controlled by the angular motor.
int GetNumAxes ()
 returns the number of angular axes that are controlled by the angular motor
void SetMotorAxis (EAxisIndex idx, EAxisAnchor anchor, const salt::Vector3f &axis)
 sets one of the motor axis.
salt::Vector3f GetMotorAxis (EAxisIndex idx)
 returns the motor axis
EAxisAnchor GetAxisAnchor (EAxisIndex idx)
 returns the relative anchor mode of the motor axis
void SetAxisAngle (EAxisIndex idx, float degAngle)
 sets the current angle along axis
float GetAxisAngle (EAxisIndex idx)
 returns the current angle in degrees for axis idx.
float GetAxisAngleRate (EAxisIndex idx)
 Return the current angle rate for axis anum.

Protected Member Functions

virtual void OnLink ()
 creates a new angularmotor joint
virtual void SetParameter (int parameter, float value)
 sets a joint parameter value
virtual float GetParameter (int parameter)
 returns a joint parameter value

Detailed Description

An angular motor allows the relative angular velocities of two bodies to be controlled.

The angular velocity can be controlled on up to three axes, allowing torque motors and stops to be set for rotation about those axes.

Definition at line 34 of file angularmotor.h.


Member Enumeration Documentation

enum oxygen::AngularMotor::EAxisAnchor
 

Enumerator:
AA_GLOBAL 
AA_FIRSTBODY 
AA_SECONDBODY 

Definition at line 43 of file angularmotor.h.

enum oxygen::AngularMotor::EMotorMode
 

Enumerator:
MM_USER 
MM_EULER 

Definition at line 37 of file angularmotor.h.


Constructor & Destructor Documentation

AngularMotor::AngularMotor  ) 
 

Definition at line 27 of file angularmotor.cpp.

AngularMotor::~AngularMotor  )  [virtual]
 

Definition at line 31 of file angularmotor.cpp.


Member Function Documentation

AngularMotor::EAxisAnchor AngularMotor::GetAxisAnchor EAxisIndex  idx  ) 
 

returns the relative anchor mode of the motor axis

Parameters:
idx 

Definition at line 82 of file angularmotor.cpp.

References oxygen::Joint::mODEJoint.

float AngularMotor::GetAxisAngle EAxisIndex  idx  ) 
 

returns the current angle in degrees for axis idx.

In 'user' mode this is simply the value that was previoulsy set with SetAxisAngle(). In 'euler' mode this is the corresponding euler angle.

Definition at line 99 of file angularmotor.cpp.

References salt::gRadToDeg(), and oxygen::Joint::mODEJoint.

Here is the call graph for this function:

float AngularMotor::GetAxisAngleRate EAxisIndex  idx  ) 
 

Return the current angle rate for axis anum.

In dAMotorUser mode this is always zero, as not enough information is available. In dAMotorEuler mode this is the corresponding euler angle rate.

Definition at line 104 of file angularmotor.cpp.

References salt::gRadToDeg(), and oxygen::Joint::mODEJoint.

Here is the call graph for this function:

AngularMotor::EMotorMode AngularMotor::GetMode  ) 
 

returns the current motor mode

Definition at line 51 of file angularmotor.cpp.

References oxygen::Joint::mODEJoint.

Vector3f AngularMotor::GetMotorAxis EAxisIndex  idx  ) 
 

returns the motor axis

Parameters:
idx 

Definition at line 87 of file angularmotor.cpp.

References oxygen::Joint::mODEJoint.

int AngularMotor::GetNumAxes  ) 
 

returns the number of angular axes that are controlled by the angular motor

Definition at line 69 of file angularmotor.cpp.

References oxygen::Joint::mODEJoint.

float AngularMotor::GetParameter int  parameter  )  [protected, virtual]
 

returns a joint parameter value

Implements oxygen::Joint.

Definition at line 114 of file angularmotor.cpp.

References oxygen::Joint::mODEJoint.

void AngularMotor::OnLink  )  [protected, virtual]
 

creates a new angularmotor joint

Reimplemented from oxygen::Joint.

Definition at line 35 of file angularmotor.cpp.

References oxygen::ODEObject::GetWorldID(), and oxygen::Joint::mODEJoint.

Here is the call graph for this function:

void AngularMotor::SetAxisAngle EAxisIndex  idx,
float  degAngle
 

sets the current angle along axis

Parameters:
idx. This function should only be called in 'user' mode, as in this mode the motor has no other way of knowing the joint angles.

Definition at line 94 of file angularmotor.cpp.

References salt::gDegToRad(), and oxygen::Joint::mODEJoint.

Here is the call graph for this function:

void AngularMotor::SetMode EMotorMode  mode  ) 
 

sets the motor mode.

The angular motor can be used in different modes. In 'user' mode (the default mode), the user directly sets the axes that the angular motor controls. In 'euler' mode, it computes the euler angles corresponding to the relative rotation, allowing euler angle torque motors and stops to be set.

Definition at line 46 of file angularmotor.cpp.

References oxygen::Joint::mODEJoint.

void AngularMotor::SetMotorAxis EAxisIndex  idx,
EAxisAnchor  anchor,
const salt::Vector3f axis
 

sets one of the motor axis.

Parameters:
idx gives the motor axis to be set.
anchor gives the relative anchor mode of the axis.
axis gives the axis vector relative to the joint node orientation.
For Euler mode only axes 0 and 2 need to be set. Axis 1 will be determined automatically at each time step. Axes 0 and 2 must be perpendicular to each other. Axis 0 must be anchored to the first body, axis 2 must be anchored to the second body.

Definition at line 74 of file angularmotor.cpp.

References oxygen::BaseNode::GetWorldTransform(), and oxygen::Joint::mODEJoint.

Here is the call graph for this function:

void AngularMotor::SetNumAxes int  num  ) 
 

sets the number of angular axes that will be controlled by the angular motor.

Parameters:
num can range from 0 which effectively disables the motor to 3, which are automatically set in euler mode.

Definition at line 56 of file angularmotor.cpp.

References oxygen::Joint::mODEJoint.

void AngularMotor::SetParameter int  parameter,
float  value
[protected, virtual]
 

sets a joint parameter value

Implements oxygen::Joint.

Definition at line 109 of file angularmotor.cpp.

References oxygen::Joint::mODEJoint.


The documentation for this class was generated from the following files:
Generated on Thu Apr 6 15:44:55 2006 for rcssserver3d by  doxygen 1.4.4