opal::VelocityMotor Class Reference

#include <VelocityMotor.h>

Inheritance diagram for opal::VelocityMotor:

opal::Motor List of all members.

Public Member Functions

 VelocityMotor (Simulator *sim)
virtual ~VelocityMotor ()
virtual void OPAL_CALL init (const VelocityMotorData &data)
virtual void OPAL_CALL setEnabled (bool e)
virtual bool OPAL_CALL isEnabled () const
virtual MotorType OPAL_CALL getType () const
virtual void OPAL_CALL setName (const std::string &name)
virtual const std::string
&OPAL_CALL 
getName () const
virtual void OPAL_CALL setVelocity (const Vec3r &velocity)
virtual const Vec3r &OPAL_CALL getVelocity () const
virtual void OPAL_CALL internal_update ()
virtual bool OPAL_CALL internal_dependsOnSolid (Solid *s) const
virtual void OPAL_CALL letGravityAffectSolid (bool affect)
virtual bool OPAL_CALL doesGravityAffectSolid () const
virtual void OPAL_CALL setMaximumForce (real maxForce)
virtual real OPAL_CALL getMaximumForce () const

Protected Attributes

VelocityMotorData mData

Private Attributes

SimulatormSimulator

Detailed Description

Tries to achieve given velocity in one time step of the simulation.

Author:
Oleksandr Lozitskiy

Definition at line 49 of file VelocityMotor.h.


Constructor & Destructor Documentation

opal::VelocityMotor::VelocityMotor Simulator sim  ) 
 

constructor

Parameters:
sim physical simulator

Definition at line 37 of file VelocityMotor.cpp.

References mSimulator.

opal::VelocityMotor::~VelocityMotor  )  [virtual]
 

destructor

Definition at line 42 of file VelocityMotor.cpp.


Member Function Documentation

bool opal::VelocityMotor::doesGravityAffectSolid  )  const [virtual]
 

Returns true if gravity is being ignored by the motor.

Definition at line 103 of file VelocityMotor.cpp.

References opal::VelocityMotorData::letGravityAffectSolid, and mData.

Referenced by internal_update().

real opal::VelocityMotor::getMaximumForce  )  const [virtual]
 

What is the maximum allowed force for this motor?

Definition at line 154 of file VelocityMotor.cpp.

References opal::VelocityMotorData::maxForce, and mData.

const std::string & opal::VelocityMotor::getName  )  const [virtual]
 

Returns the Motor's name.

Implements opal::Motor.

Definition at line 85 of file VelocityMotor.cpp.

References mData, and opal::MotorData::name.

MotorType opal::VelocityMotor::getType  )  const [virtual]
 

Returns the Motor type.

Implements opal::Motor.

Definition at line 75 of file VelocityMotor.cpp.

References opal::VELOCITY_MOTOR.

const Vec3r & opal::VelocityMotor::getVelocity  )  const [virtual]
 

Return target velocity.

Definition at line 50 of file VelocityMotor.cpp.

References mData, and opal::VelocityMotorData::velocity.

void opal::VelocityMotor::init const VelocityMotorData data  )  [virtual]
 

Initializes the Motor with the given data structure.

Definition at line 55 of file VelocityMotor.cpp.

References opal::Motor::init(), mData, opal::Solid::setLinearDamping(), and opal::VelocityMotorData::solid.

bool opal::VelocityMotor::internal_dependsOnSolid Solid s  )  const [virtual]
 

Returns true if motors controls this solid.

Definition at line 90 of file VelocityMotor.cpp.

References mData, and opal::VelocityMotorData::solid.

void opal::VelocityMotor::internal_update  )  [virtual]
 

Called regularly to update the Motor. This does nothing if the Motor is disabled.

Implements opal::Motor.

Definition at line 108 of file VelocityMotor.cpp.

References doesGravityAffectSolid(), opal::Solid::getGlobalLinearVel(), opal::Simulator::getGravity(), opal::defaults::gravity, isEnabled(), opal::Vec3r::length(), mData, mSimulator, opal::project(), opal::VelocityMotorData::solid, and opal::VelocityMotorData::velocity.

bool opal::VelocityMotor::isEnabled  )  const [virtual]
 

Returns true if the Motor is enabled.

Implements opal::Motor.

Definition at line 70 of file VelocityMotor.cpp.

References opal::MotorData::enabled, and mData.

Referenced by internal_update().

void opal::VelocityMotor::letGravityAffectSolid bool  affect  )  [virtual]
 

against gravity or not?

Parameters:
affect if true, motor will NOT work against gravity, so solid will be affected by gravity

Definition at line 98 of file VelocityMotor.cpp.

References opal::VelocityMotorData::letGravityAffectSolid, and mData.

void opal::VelocityMotor::setEnabled bool  e  )  [virtual]
 

Sets whether the Motor has any effect.

Implements opal::Motor.

Definition at line 65 of file VelocityMotor.cpp.

References opal::MotorData::enabled, and mData.

void opal::VelocityMotor::setMaximumForce real  maxForce  )  [virtual]
 

Maximum allowed force for the motor to use.

Definition at line 149 of file VelocityMotor.cpp.

References opal::VelocityMotorData::maxForce, and mData.

void opal::VelocityMotor::setName const std::string &  name  )  [virtual]
 

Sets the Motor's name.

Implements opal::Motor.

Definition at line 80 of file VelocityMotor.cpp.

References mData, and opal::MotorData::name.

void opal::VelocityMotor::setVelocity const Vec3r velocity  )  [virtual]
 

Set target velocity.

Definition at line 45 of file VelocityMotor.cpp.

References mData, and opal::VelocityMotorData::velocity.


Member Data Documentation

VelocityMotorData opal::VelocityMotor::mData [protected]
 

Stores data describing the Motor.

Definition at line 110 of file VelocityMotor.h.

Referenced by doesGravityAffectSolid(), getMaximumForce(), getName(), getVelocity(), init(), internal_dependsOnSolid(), internal_update(), isEnabled(), letGravityAffectSolid(), setEnabled(), setMaximumForce(), setName(), and setVelocity().

Simulator* opal::VelocityMotor::mSimulator [private]
 

Definition at line 113 of file VelocityMotor.h.

Referenced by internal_update(), and VelocityMotor().


The documentation for this class was generated from the following files:
Generated on Tue May 16 17:49:58 2006 for OPAL by  doxygen 1.4.6-NO