Public Member Functions

bl7::rigidbodies2::AnchoredSpring Class Reference

#include <AnchoredSpring.h>

Inheritance diagram for bl7::rigidbodies2::AnchoredSpring:
bl7::rigidbodies2::ForceGenerator

List of all members.

Public Member Functions

virtual ~AnchoredSpring (void)
 AnchoredSpring (const ml7::Vector2 &anchor, const float d, const float s0, const ml7::Vector2 &local_point=ml7::Vector2(0.0f))
const ml7::Vector2get_anchor () const
float get_spring_constant () const
float get_rest_length () const
const ml7::Vector2get_local_point () const
void set_anchor (const ml7::Vector2 &anchor)
void set_spring_constant (const float d)
void set_rest_length (const float s0)
void set_local_point (const ml7::Vector2 &local_point)

Detailed Description

A force generator that applies spring forces to 2d rigid bodies. One instance may be used for multiple rigid bodies, if they are connected to the same anchor point in the world via the same spring.


Constructor & Destructor Documentation

virtual bl7::rigidbodies2::AnchoredSpring::~AnchoredSpring ( void   )  [inline, virtual]

Destructor.

bl7::rigidbodies2::AnchoredSpring::AnchoredSpring ( const ml7::Vector2 anchor,
const float  d,
const float  s0,
const ml7::Vector2 local_point = ml7::Vector2(0.0f) 
) [inline]

Explicit constructor with parameters specifying the anchor point in world coordinates on the other side of the spring, the spring constant d, the rest length of the spring s0 and, finally, the local connection point of the the rigid body to apply the force to.


Member Function Documentation

const ml7::Vector2& bl7::rigidbodies2::AnchoredSpring::get_anchor (  )  const [inline]

Returns the anchor point of the spring in world coordinates.

const ml7::Vector2& bl7::rigidbodies2::AnchoredSpring::get_local_point (  )  const [inline]

Returns the local connection point of the rigid body to apply forces to.

float bl7::rigidbodies2::AnchoredSpring::get_rest_length (  )  const [inline]

Returns the rest length of the spring.

float bl7::rigidbodies2::AnchoredSpring::get_spring_constant (  )  const [inline]

Returns the spring constant.

void bl7::rigidbodies2::AnchoredSpring::set_anchor ( const ml7::Vector2 anchor  )  [inline]

Sets the anchor point of the spring in world coordinates.

void bl7::rigidbodies2::AnchoredSpring::set_local_point ( const ml7::Vector2 local_point  )  [inline]

Sets the local connection point of the rigid body to apply forces to.

void bl7::rigidbodies2::AnchoredSpring::set_rest_length ( const float  s0  )  [inline]

Sets the rest length of the spring.

void bl7::rigidbodies2::AnchoredSpring::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