Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

OpenCAL::Spring Class Reference

#include <Spring.h>

Inheritance diagram for OpenCAL::Spring:

Inheritance graph
[legend]
Collaboration diagram for OpenCAL::Spring:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Spring (PhysicsSystem *parent, PhysicalObject *object1=0, PhysicalObject *object2=0)
const PhysicalObjectgetObject1 () const
PhysicalObjectgetObject1 ()
const PhysicalObjectgetObject2 () const
PhysicalObjectgetObject2 ()
float getStiffness () const
float getDamping () const
float getRestLength () const
float getSnapFactor () const
bool doesSnap ()
bool isConnected ()
void setObject1 (PhysicalObject *object)
void setObject2 (PhysicalObject *object)
void setStiffness (float stiffness)
void setDamping (float damping)
void setRestLength (float restLength)
void setSnapFactor (float snapFactor)
void setNoSnap ()
void initialize ()
void execute (float seconds)
void render ()
void connect (PhysicalObject *object1, PhysicalObject *object2)
void calculateRestLength ()

Protected Attributes

PhysicalObjectm_object1
PhysicalObjectm_object2
float m_stiffness
float m_damping
float m_restLength
float m_snapFactor

Detailed Description

This class represents a virtual spring, with damper

Definition at line 26 of file Spring.h.


Member Function Documentation

void Spring::execute float  seconds  )  [virtual]
 

\[ f_1 = -f_2 = \ldots \]

<

Todo:
same as !isConnected() ???

Reimplemented from OpenCAL::Actor.

Definition at line 63 of file Spring.cpp.

References OpenCAL::Physical::addForce(), OpenCAL::Utils::Vector3::dotProduct(), OpenCAL::Object::getPosition(), OpenCAL::Physical::getVelocity(), OpenCAL::Utils::Vector3::length(), and OpenCAL::Utils::Vector3::normalized().

Here is the call graph for this function:


The documentation for this class was generated from the following files:
Generated on Sun Aug 15 19:19:35 2004 for OpenCAL: Open Computer Animation Library by doxygen 1.3.8