Public Member Functions

SSSpring Class Reference

Search for all occurrences

Detailed Description

See also:
Class BaseInterfaceServer, Class SSConstraintPoint, Class SpringSys

Description:
This class is available in release 4.0 and later only.

This class represents the particle cache to store the state of particle data as it is used in the spring system.

Data Members:
private:

float tension;

The spring tension value.

float dampening;

The spring dampening value.

Point3 length;

The spring length.

SSConstraintPoint bone;

The spring system constraint point.

#include <springsys.h>

Inheritance diagram for SSSpring:
Inheritance graph
[legend]

List of all members.

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)

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);
        }

SSSpring SSSpring SSSpring SSSpring SSSpring SSSpring SSSpring SSSpring SSSpring SSSpring
SSSpring SSSpring SSSpring SSSpring SSSpring SSSpring SSSpring SSSpring SSSpring SSSpring