SSSpring Class Reference

SSSpring Class Reference

#include <springsys.h>

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.
+ Inheritance diagram for SSSpring:

Public Member Functions

 SSSpring ()
 
 SSSpring (SSConstraintPoint *b, Point3 l, float t=2.0f, float d=1.0f)
 
SSSpringoperator= (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)
 
SSConstraintPointGetPointConstraint ()
 
void SetPointConstraint (SSConstraintPoint b)
 
void SetPointConstraint (int id, Point3 pos, Point3 vel)
 
bool operator== (const SSSpring &b) const
 
bool operator!= (const SSSpring &b) const
 
- Public Member Functions inherited from BaseInterfaceServer
virtual UtilExport BaseInterfaceGetInterface (Interface_ID id)
 
virtual UtilExport int NumInterfaces () const
 
virtual UtilExport BaseInterfaceGetInterfaceAt (int i) const
 
virtual UtilExport ~BaseInterfaceServer ()
 
- Public Member Functions inherited from InterfaceServer
virtual UtilExport ~InterfaceServer ()
 Destructor. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 
- Protected Attributes inherited from BaseInterfaceServer
Tab< BaseInterface * > interfaces
 

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;

}
166  {
167  bone = NULL;
168  length = Point3(0.0f, 0.0f, 0.0f);
169  tension = 1.0f;
170  dampening = 0.5f;
171  }
#define NULL
Definition: autoptr.h:18
Definition: point3.h:55
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;

}
192  {
193  bone = *b;
194  length = l;
195  tension = t;
196  dampening = d;
197  }

Member Function Documentation

SSSpring& operator= ( const SSSpring from)
inline
Remarks
Assignment operator.
201  {
202  tension = from.tension;
203  dampening = from.dampening;
204  length = from.length;
205  bone = from.bone;
206 
207  return *this;
208  }
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.
216  {
217  tension = from.tension;
218  dampening = from.dampening;
219  length = from.length;
220  bone = from.bone;
221 
222  return *this;
223  }
float GetTension ( )
inline
Remarks
This method returns the tension value.
226 {return tension;}
void SetTension ( float  t)
inline
Remarks
This method allows you to set the tension value.
Parameters:
float t

The tension to set.
231 {tension = t;}
float GetDampening ( )
inline
Remarks
This method returns the dampening value.
233 {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.
238 {dampening = d;}
Point3 GetLength ( )
inline
Remarks
This method returns the length of the spring.
240 {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.
245 {length = len;}
SSConstraintPoint* GetPointConstraint ( )
inline
Remarks
This method returns the point constraint data.
248 { 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.
253 { 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.
263  {
264  bone.SetIndex(id);
265  bone.SetPos(pos);
266  bone.SetVel(vel);
267  }
void SetPos(Point3 p)
Definition: springsys.h:104
void SetIndex(int id)
Definition: springsys.h:97
void SetVel(Point3 v)
Definition: springsys.h:111
bool operator== ( const SSSpring b) const
inline
Remarks
Compares this class instance to another one
271  {
272  return tension == b.tension && dampening == b.dampening && length == b.length && bone == b.bone;
273  }
bool operator!= ( const SSSpring b) const
inline
276  {
277  return !( *this == b );
278  }