SSSpring Class Reference
 
 
 
SSSpring Class Reference

#include <springsys.h>

Inheritance diagram for SSSpring:
BaseInterfaceServer InterfaceServer MaxHeapOperators

Class Description

See also:
Class BaseInterfaceServer, Class SSConstraintPoint, Class SpringSys

Stores the parameters for binding an object to any force with a controllable spring. This class represents the particle cache to store the state of particle data as it is used in the spring system.

Public Member Functions

  SSSpring ()
  SSSpring (SSConstraintPoint *b, Point3 l, float t=2.0f, float d=1.0f)
SSSpring operator= (const SSSpring &from)
SSSpring  Copy (const SSSpring from)
float  GetTension ()
void  SetTension (float t)
float  GetDampening ()
void  SetDampening (float d)
Point3  GetLength ()
void  SetLength (Point3 len)
SSConstraintPoint GetPointConstraint ()
void  SetPointConstraint (SSConstraintPoint b)
void  SetPointConstraint (int id, Point3 pos, Point3 vel)
bool  operator== (const SSSpring &b) const
bool  operator!= (const SSSpring &b) const

Constructor & Destructor Documentation

SSSpring ( ) [inline]
Remarks:
Constructor.
Default Implementation:
{

bone = NULL;

length = Point3(0.0f, 0.0f, 0.0f);

tension = 1.0f;

dampening = 0.5f;

}
                {
                        bone = NULL;
                        length = Point3(0.0f, 0.0f, 0.0f);
                        tension = 1.0f;
                        dampening = 0.5f;
                }
SSSpring ( SSConstraintPoint b,
Point3  l,
float  t = 2.0f,
float  d = 1.0f 
) [inline]
Remarks:
Constructor.

This allows you to initialize the spring.
Parameters:
SSConstraintPoint *b

The constraint point to set.

Point3 l

The spring length to set.

float t=2.0f

The tension to set.

float d=1.0f

The dampening to set.
Default Implementation:
{

bone = *b;

length = l;

tension = t;

dampening = d;

}
                {
                        bone = *b;
                        length = l;
                        tension = t;
                        dampening = d;
                }

Member Function Documentation

SSSpring& operator= ( const SSSpring from ) [inline]
Remarks:
Assignment operator.
                {
                        tension = from.tension;
                        dampening = from.dampening;
                        length = from.length;
                        bone = from.bone;

                        return *this;
                }
SSSpring Copy ( const SSSpring  from ) [inline]
Remarks:
This method allows you to copy the data from the specified spring object.
Parameters:
const SSSpring from

The spring to copy from.
                {
                        tension = from.tension;
                        dampening = from.dampening;
                        length = from.length;
                        bone = from.bone;

                        return *this;
                }
float GetTension ( ) [inline]
Remarks:
This method returns the tension value.
{return tension;}
void SetTension ( float  t ) [inline]
Remarks:
This method allows you to set the tension value.
Parameters:
float t

The tension to set.
{tension = t;}
float GetDampening ( ) [inline]
Remarks:
This method returns the dampening value.
{return dampening;}
void SetDampening ( float  d ) [inline]
Remarks:
This method allows you to set the dampening value.
Parameters:
float d

The dampening value to set.
{dampening = d;}
Point3 GetLength ( ) [inline]
Remarks:
This method returns the length of the spring.
{return length;}
void SetLength ( Point3  len ) [inline]
Remarks:
This method allows you to set the spring length.
Parameters:
Point3 len

The spring length to set.
{length = len;}
SSConstraintPoint* GetPointConstraint ( ) [inline]
Remarks:
This method returns the point constraint data.
{ return &bone;}
void SetPointConstraint ( SSConstraintPoint  b ) [inline]
Remarks:
This method allows you to set the point constraint data.
Parameters:
SSConstraintPoint b

The constraint point to set.
{ bone = b; }
void SetPointConstraint ( int  id,
Point3  pos,
Point3  vel 
) [inline]
Remarks:
This method allos you to set the point constraint data.
Parameters:
int id

The index.

Point3 pos

The position data.

Point3 vel

The velocity data.
                {
                        bone.SetIndex(id);
                        bone.SetPos(pos);
                        bone.SetVel(vel);
                }
bool operator== ( const SSSpring b ) const [inline]
Remarks:
Compares this class instance to another one
                {
                        return tension == b.tension && dampening == b.dampening && length == b.length && bone == b.bone;
                }
bool operator!= ( const SSSpring b ) const [inline]
                {
                        return !( *this == b );
                }