#include <AttractorMotor.h>
Inheritance diagram for opal::AttractorMotor:
Public Member Functions | |
AttractorMotor () | |
virtual | ~AttractorMotor () |
virtual void OPAL_CALL | init (const AttractorMotorData &data) |
virtual const AttractorMotorData &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 | setStrength (real s) |
virtual real OPAL_CALL | getStrength () const |
virtual void OPAL_CALL | setExponent (real e) |
virtual real OPAL_CALL | getExponent () const |
virtual void OPAL_CALL | internal_update () |
virtual bool OPAL_CALL | internal_dependsOnSolid (Solid *s) |
Protected Attributes | |
AttractorMotorData | mData |
real | mSolid0Mass |
real | mSolid1Mass |
real | mMassConstant |
Definition at line 43 of file AttractorMotor.h.
|
Definition at line 33 of file AttractorMotor.cpp. References mMassConstant, mSolid0Mass, and mSolid1Mass. |
|
Definition at line 42 of file AttractorMotor.cpp. |
|
Returns all data describing the Motor.
Definition at line 73 of file AttractorMotor.cpp. References mData. |
|
Returns the exponent parameter.
Definition at line 164 of file AttractorMotor.cpp. References opal::AttractorMotorData::exponent, and mData. |
|
Returns the Motor's name.
Implements opal::Motor. Definition at line 88 of file AttractorMotor.cpp. References mData, and opal::MotorData::name. |
|
Returns the strength parameter.
Definition at line 154 of file AttractorMotor.cpp. References mData, and opal::AttractorMotorData::strength. |
|
Returns the Motor type.
Implements opal::Motor. Definition at line 78 of file AttractorMotor.cpp. References opal::MotorData::getType(), and mData. |
|
Initializes the Motor with the given data structure. If the Solid pointers in the data are NULL, the Motor will do nothing. Definition at line 58 of file AttractorMotor.cpp. References opal::Solid::getMass(), opal::Motor::init(), mData, mMassConstant, mSolid0Mass, mSolid1Mass, opal::AttractorMotorData::solid0, opal::AttractorMotorData::solid1, and opal::AttractorMotorData::strength. |
|
Returns true if this Motor depends on the given Solid.
Reimplemented from opal::Motor. Definition at line 169 of file AttractorMotor.cpp. References mData, opal::AttractorMotorData::solid0, and opal::AttractorMotorData::solid1. |
|
Called regularly to update the Motor. This does nothing if the Motor is disabled. Implements opal::Motor. Definition at line 108 of file AttractorMotor.cpp. References opal::Solid::addForce(), opal::MotorData::enabled, opal::AttractorMotorData::exponent, opal::Solid::getPosition(), opal::GLOBAL_FORCE, opal::Vec3r::length(), opal::Vec3r::lengthSquared(), mData, mMassConstant, opal::Vec3r::normalize(), opal::Force::singleStep, opal::AttractorMotorData::solid0, opal::AttractorMotorData::solid1, opal::Force::type, and opal::Force::vec. |
|
Returns true if the Motor is enabled.
Implements opal::Motor. Definition at line 93 of file AttractorMotor.cpp. References opal::MotorData::enabled, and mData. |
|
Sets whether the Motor has any effect.
Implements opal::Motor. Definition at line 98 of file AttractorMotor.cpp. References opal::MotorData::enabled, and mData. |
|
Sets the exponent parameter.
Definition at line 159 of file AttractorMotor.cpp. References opal::AttractorMotorData::exponent, and mData. |
|
Sets the Motor's name.
Implements opal::Motor. Definition at line 83 of file AttractorMotor.cpp. References mData, and opal::MotorData::name. |
|
Sets the strength parameter.
Definition at line 146 of file AttractorMotor.cpp. References mData, mMassConstant, mSolid0Mass, mSolid1Mass, and opal::AttractorMotorData::strength. |
|
Stores data describing the Motor.
Definition at line 85 of file AttractorMotor.h. Referenced by getData(), getExponent(), getName(), getStrength(), getType(), init(), internal_dependsOnSolid(), internal_update(), isEnabled(), setEnabled(), setExponent(), setName(), and setStrength(). |
|
Cached copy of strength * m0 * m1.
Definition at line 94 of file AttractorMotor.h. Referenced by AttractorMotor(), init(), internal_update(), and setStrength(). |
|
Cached copy of Solid 0's mass.
Definition at line 88 of file AttractorMotor.h. Referenced by AttractorMotor(), init(), and setStrength(). |
|
Cached copy of Solid 1's mass.
Definition at line 91 of file AttractorMotor.h. Referenced by AttractorMotor(), init(), and setStrength(). |