Public Member Functions

bl7::particles2::Spring Class Reference

#include <Spring.h>

Inheritance diagram for bl7::particles2::Spring:
bl7::particles2::ForceGenerator

List of all members.

Public Member Functions

virtual ~Spring (void)
 Spring (Particle *particle, const float d, const float s0)
Particleget_attached_particle () const
float get_spring_constant () const
float get_rest_length () const
void set_attached_particle (Particle *particle)
void set_spring_constant (const float d)
void set_rest_length (const float s0)

Detailed Description

A force generator that applies spring forces to 2d particles. One instance should not be used for multiple particles. However, you may attach one instance to a particle and apply the same spring force between this particle and multiple others. Notice that the force generator creates a force for only one object (the particle passed in to function update_force). If you want to link two objects with a spring, then you have to individually create and register a generator for each.


Constructor & Destructor Documentation

virtual bl7::particles2::Spring::~Spring ( void   )  [inline, virtual]

Destructor.

bl7::particles2::Spring::Spring ( Particle particle,
const float  d,
const float  s0 
) [inline]

Explicit constructor with parameters specifying the permanently attached particle on the other side of the spring, the spring constant d and the rest length of the spring s0.


Member Function Documentation

Particle* bl7::particles2::Spring::get_attached_particle (  )  const [inline]

Returns the particle permanently attached to the spring.

float bl7::particles2::Spring::get_rest_length (  )  const [inline]

Returns the rest length of the spring.

float bl7::particles2::Spring::get_spring_constant (  )  const [inline]

Returns the spring constant.

void bl7::particles2::Spring::set_attached_particle ( Particle particle  )  [inline]

Sets the particle permanently attached to the spring.

void bl7::particles2::Spring::set_rest_length ( const float  s0  )  [inline]

Sets the rest length of the spring.

void bl7::particles2::Spring::set_spring_constant ( const float  d  )  [inline]

Sets the spring constant.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines