opal::SpringMotor Class Reference

#include <SpringMotor.h>

Inheritance diagram for opal::SpringMotor:

opal::Motor List of all members.

Public Member Functions

 SpringMotor ()
virtual ~SpringMotor ()
virtual void OPAL_CALL init (const SpringMotorData &data)
virtual const SpringMotorData
&OPAL_CALL 
getData () 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 bool OPAL_CALL isEnabled () const
virtual void OPAL_CALL setEnabled (bool e)
virtual void OPAL_CALL setLocalAttachOffset (const Point3r &offset)
virtual const Point3r &OPAL_CALL getLocalAttachOffset () const
virtual void OPAL_CALL setGlobalAttachPoint (const Point3r &p)
virtual Point3r OPAL_CALL getGlobalAttachPoint () const
virtual void OPAL_CALL setDesiredTransform (const Matrix44r &transform)
virtual void OPAL_CALL setDesiredPosition (const Point3r &pos)
virtual void OPAL_CALL setDesiredOrientation (const Vec3r &forward, const Vec3r &up, const Vec3r &right)
virtual void OPAL_CALL setLinearKd (real kd)
virtual void OPAL_CALL setLinearKs (real ks)
virtual real OPAL_CALL getLinearKd () const
virtual real OPAL_CALL getLinearKs () const
virtual void OPAL_CALL setAngularKd (real kd)
virtual void OPAL_CALL setAngularKs (real ks)
virtual real OPAL_CALL getAngularKd () const
virtual real OPAL_CALL getAngularKs () const
virtual void OPAL_CALL internal_update ()
virtual bool OPAL_CALL internal_dependsOnSolid (Solid *s)

Protected Attributes

SpringMotorData mData

Detailed Description

This is a spring that either 1) operates in 3 dimensions to keep a Solid in a desired position, or 2) operates in 3 degrees of rotational motion to keep a Solid in a desired orientation. It can also do both modes at once.

Definition at line 42 of file SpringMotor.h.


Constructor & Destructor Documentation

opal::SpringMotor::SpringMotor  ) 
 

Definition at line 33 of file SpringMotor.cpp.

opal::SpringMotor::~SpringMotor  )  [virtual]
 

Definition at line 39 of file SpringMotor.cpp.


Member Function Documentation

real opal::SpringMotor::getAngularKd  )  const [virtual]
 

Returns the damping constant for angular mode.

Definition at line 305 of file SpringMotor.cpp.

References opal::SpringMotorData::angularKd, and mData.

real opal::SpringMotor::getAngularKs  )  const [virtual]
 

Returns the spring constant for angular mode.

Definition at line 310 of file SpringMotor.cpp.

References opal::SpringMotorData::angularKs, and mData.

const SpringMotorData & opal::SpringMotor::getData  )  const [virtual]
 

Returns all data describing the Motor.

Definition at line 49 of file SpringMotor.cpp.

References mData.

Point3r opal::SpringMotor::getGlobalAttachPoint  )  const [virtual]
 

Returns the spring's attach point on the Solid in global coordinates.

Definition at line 204 of file SpringMotor.cpp.

References opal::SpringMotorData::attachOffset, opal::Solid::getPosition(), opal::Solid::getTransform(), mData, OPAL_LOGGER, and opal::SpringMotorData::solid.

Referenced by internal_update().

real opal::SpringMotor::getLinearKd  )  const [virtual]
 

Returns the damping constant for linear mode.

Definition at line 285 of file SpringMotor.cpp.

References opal::SpringMotorData::linearKd, and mData.

real opal::SpringMotor::getLinearKs  )  const [virtual]
 

Returns the spring constant for linear mode.

Definition at line 290 of file SpringMotor.cpp.

References opal::SpringMotorData::linearKs, and mData.

const Point3r & opal::SpringMotor::getLocalAttachOffset  )  const [virtual]
 

Returns the spring's attach point on the Solid. This is a local offset point from the Solid's position.

Definition at line 182 of file SpringMotor.cpp.

References opal::SpringMotorData::attachOffset, and mData.

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

Returns the Motor's name.

Implements opal::Motor.

Definition at line 64 of file SpringMotor.cpp.

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

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

Returns the Motor type.

Implements opal::Motor.

Definition at line 54 of file SpringMotor.cpp.

References opal::MotorData::getType(), and mData.

void opal::SpringMotor::init const SpringMotorData data  )  [virtual]
 

Initializes the Motor with the given data structure. If the Solid pointer in the data are NULL, the Motor will do nothing.

Definition at line 43 of file SpringMotor.cpp.

References opal::Motor::init(), and mData.

bool opal::SpringMotor::internal_dependsOnSolid Solid s  )  [virtual]
 

Returns true if this Motor depends on the given Solid.

Reimplemented from opal::Motor.

Definition at line 315 of file SpringMotor.cpp.

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

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

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

Implements opal::Motor.

Definition at line 84 of file SpringMotor.cpp.

References opal::Solid::addForce(), opal::ANGULAR_MODE, opal::SpringMotorData::attachOffset, opal::SpringMotorData::desiredPos, opal::MotorData::enabled, opal::Matrix44r::getForward(), getGlobalAttachPoint(), opal::Solid::getGlobalLinearVel(), opal::Solid::getMass(), opal::Matrix44r::getRight(), opal::Solid::getTransform(), opal::Matrix44r::getUp(), opal::GLOBAL_FORCE_AT_LOCAL_POS, opal::Vec3r::lengthSquared(), opal::LINEAR_AND_ANGULAR_MODE, opal::LINEAR_MODE, opal::SpringMotorData::linearKd, opal::SpringMotorData::linearKs, mData, opal::SpringMotorData::mode, opal::Vec3r::normalize(), opal::Force::pos, opal::Force::singleStep, opal::SpringMotorData::solid, opal::Force::type, and opal::Force::vec.

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

Returns true if the Motor is enabled.

Implements opal::Motor.

Definition at line 69 of file SpringMotor.cpp.

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

void opal::SpringMotor::setAngularKd real  kd  )  [virtual]
 

Sets the damping constant for angular mode.

Definition at line 295 of file SpringMotor.cpp.

References opal::SpringMotorData::angularKd, and mData.

void opal::SpringMotor::setAngularKs real  ks  )  [virtual]
 

Sets the spring constant for angular mode.

Definition at line 300 of file SpringMotor.cpp.

References opal::SpringMotorData::angularKs, and mData.

void opal::SpringMotor::setDesiredOrientation const Vec3r forward,
const Vec3r up,
const Vec3r right
[virtual]
 

Sets the desired orientation.

Definition at line 253 of file SpringMotor.cpp.

References opal::SpringMotorData::desiredForward, opal::Vec3r::lengthSquared(), mData, and opal::Vec3r::normalize().

void opal::SpringMotor::setDesiredPosition const Point3r pos  )  [virtual]
 

Sets the desired position.

Definition at line 248 of file SpringMotor.cpp.

References opal::SpringMotorData::desiredPos, and mData.

void opal::SpringMotor::setDesiredTransform const Matrix44r transform  )  [virtual]
 

Sets the desired position and orientation.

Definition at line 225 of file SpringMotor.cpp.

References opal::SpringMotorData::desiredForward, opal::SpringMotorData::desiredPos, opal::Matrix44r::getForward(), opal::Matrix44r::getPosition(), opal::Vec3r::lengthSquared(), mData, and opal::Vec3r::normalize().

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

Sets whether the Motor has any effect.

Implements opal::Motor.

Definition at line 74 of file SpringMotor.cpp.

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

void opal::SpringMotor::setGlobalAttachPoint const Point3r p  )  [virtual]
 

Sets the spring's attach point on the Solid in global coordinates.

Definition at line 187 of file SpringMotor.cpp.

References opal::SpringMotorData::attachOffset, opal::Matrix44r::fastInvert(), opal::Solid::getTransform(), mData, OPAL_LOGGER, and opal::SpringMotorData::solid.

void opal::SpringMotor::setLinearKd real  kd  )  [virtual]
 

Sets the damping constant for linear mode.

Definition at line 275 of file SpringMotor.cpp.

References opal::SpringMotorData::linearKd, and mData.

void opal::SpringMotor::setLinearKs real  ks  )  [virtual]
 

Sets the spring constant for linear mode.

Definition at line 280 of file SpringMotor.cpp.

References opal::SpringMotorData::linearKs, and mData.

void opal::SpringMotor::setLocalAttachOffset const Point3r offset  )  [virtual]
 

Sets the spring's attach point on the Solid. This is a local offset point from the Solid's position.

Definition at line 177 of file SpringMotor.cpp.

References opal::SpringMotorData::attachOffset, and mData.

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

Sets the Motor's name.

Implements opal::Motor.

Definition at line 59 of file SpringMotor.cpp.

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


Member Data Documentation

SpringMotorData opal::SpringMotor::mData [protected]
 

Stores data describing the Motor.

Definition at line 122 of file SpringMotor.h.

Referenced by getAngularKd(), getAngularKs(), getData(), getGlobalAttachPoint(), getLinearKd(), getLinearKs(), getLocalAttachOffset(), getName(), getType(), init(), internal_dependsOnSolid(), internal_update(), isEnabled(), setAngularKd(), setAngularKs(), setDesiredOrientation(), setDesiredPosition(), setDesiredTransform(), setEnabled(), setGlobalAttachPoint(), setLinearKd(), setLinearKs(), setLocalAttachOffset(), and setName().


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