Cyclone Cyclone: cyclone::ParticleAnchoredSpring Class Reference

cyclone::ParticleAnchoredSpring Class Reference

A force generator that applies a Spring force, where one end is attached to a fixed point in space. More...

#include <pfgen.h>

Inheritance diagram for cyclone::ParticleAnchoredSpring:

Inheritance graph
[legend]
Collaboration diagram for cyclone::ParticleAnchoredSpring:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ParticleAnchoredSpring ()
 ParticleAnchoredSpring (Vector3 *anchor, real springConstant, real restLength)
 Creates a new spring with the given parameters.
const Vector3getAnchor () const
 Retrieve the anchor point.
void init (Vector3 *anchor, real springConstant, real restLength)
 Set the spring's properties.
virtual void updateForce (Particle *particle, real duration)
 Applies the spring force to the given particle.

Protected Attributes

Vector3anchor
 The location of the anchored end of the spring.
real springConstant
 Holds the sprint constant.
real restLength
 Holds the rest length of the spring.

Detailed Description

A force generator that applies a Spring force, where one end is attached to a fixed point in space.


Constructor & Destructor Documentation

cyclone::ParticleAnchoredSpring::ParticleAnchoredSpring  ) 
 

cyclone::ParticleAnchoredSpring::ParticleAnchoredSpring Vector3 anchor,
real  springConstant,
real  restLength
 

Creates a new spring with the given parameters.


Member Function Documentation

const Vector3* cyclone::ParticleAnchoredSpring::getAnchor  )  const [inline]
 

Retrieve the anchor point.

void cyclone::ParticleAnchoredSpring::init Vector3 anchor,
real  springConstant,
real  restLength
 

Set the spring's properties.

virtual void cyclone::ParticleAnchoredSpring::updateForce Particle particle,
real  duration
[virtual]
 

Applies the spring force to the given particle.

Implements cyclone::ParticleForceGenerator.

Reimplemented in cyclone::ParticleAnchoredBungee.


Member Data Documentation

Vector3* cyclone::ParticleAnchoredSpring::anchor [protected]
 

The location of the anchored end of the spring.

real cyclone::ParticleAnchoredSpring::restLength [protected]
 

Holds the rest length of the spring.

real cyclone::ParticleAnchoredSpring::springConstant [protected]
 

Holds the sprint constant.


The documentation for this class was generated from the following file: