VirtualPhysics the realtime dynamics simulation library

vpSpring Class Reference

Elastic spring. More...

#include <vpSpring.h>

List of all members.

Public Member Functions

void Connect (vpBody *B0, vpBody *B1, const Vec3 &p0, const Vec3 &p1)
void SetElasticity (scalar)
void SetDamping (scalar)
void SetInitialDistance (scalar)
scalar GetElasticity (void) const
scalar GetDamping (void) const
scalar GetInitialDistance (void) const
void Remove (void)


Detailed Description

vpSpring is a class to model a elastic spring. It is a massless component to push or pull connecting bodies.

Member Function Documentation

void vpSpring::Connect ( vpBody B0,
vpBody B1,
const Vec3 p0,
const Vec3 p1 
)

connect bodies B0 and B1 with the spring.

Parameters:
p0 a position of the spring attached to B0. It is represented in a body fixed frame of B0.
p1 a position of the spring attached to B1. It is represented in a body fixed frame of B1.

VP_INLINE void vpSpring::SetElasticity ( scalar  k  ) 

set an elasticity of the spring.

VP_INLINE void vpSpring::SetDamping ( scalar  c  ) 

set a damping parameter of the spring.

VP_INLINE void vpSpring::SetInitialDistance ( scalar  d  ) 

set an initial distance of the spring.

VP_INLINE scalar vpSpring::GetElasticity ( void   )  const

get an elasticity of the spring.

VP_INLINE scalar vpSpring::GetDamping ( void   )  const

get a damping parameter of the spring.

VP_INLINE scalar vpSpring::GetInitialDistance ( void   )  const

get an initial distance of the spring.

void vpSpring::Remove ( void   ) 

remove the joint


Generated on Wed Jun 11 23:11:49 2008 for VirtualPhysics by  doxygen 1.5.5