- Cal3D 0.11 API Reference -

Public Member Functions | List of all members
CalSpringSystem Class Reference

The spring system class. More...

#include <springsystem.h>

Public Member Functions

 CalSpringSystem (CalModel *pModel)
 Constructs the spring system instance. More...
 
void calculateForces (CalSubmesh *pSubmesh, float deltaTime)
 Calculates the forces on each unbound vertex. More...
 
void calculateVertices (CalSubmesh *pSubmesh, float deltaTime)
 Calculates the vertices influenced by the spring system instance. More...
 
void update (float deltaTime)
 Updates all the spring systems in the attached meshes. More...
 
void resetPositions ()
 Reset the spring system. More...
 
const CalVectorgetGravityVector () const
 Returns the gravity vector. More...
 
void setGravityVector (const CalVector &vGravity)
 Sets the gravity vector. More...
 
const CalVectorgetForceVector () const
 Returns the force vector. More...
 
void setForceVector (const CalVector &vForce)
 Sets the force vector. More...
 
void setCollisionDetection (bool collision)
 Enable or disable the collision system. More...
 

Detailed Description

The spring system class.

Constructor & Destructor Documentation

◆ CalSpringSystem()

CalSpringSystem::CalSpringSystem ( CalModel pModel)

Constructs the spring system instance.

This function is the default constructor of the spring system instance.

Member Function Documentation

◆ calculateForces()

void CalSpringSystem::calculateForces ( CalSubmesh pSubmesh,
float  deltaTime 
)

Calculates the forces on each unbound vertex.

This function calculates the forces on each unbound vertex of a specific submesh.

Parameters
pSubmeshA pointer to the submesh from which the forces should be calculated.
deltaTimeThe elapsed time in seconds since the last calculation.

◆ calculateVertices()

void CalSpringSystem::calculateVertices ( CalSubmesh pSubmesh,
float  deltaTime 
)

Calculates the vertices influenced by the spring system instance.

This function calculates the vertices influenced by the spring system instance.

Parameters
pSubmeshA pointer to the submesh from which the vertices should be calculated.
deltaTimeThe elapsed time in seconds since the last calculation.

◆ getForceVector()

const CalVector & CalSpringSystem::getForceVector ( ) const

Returns the force vector.

This function returns the force vector of the spring system instance.

Returns
the force vector as vector.

◆ getGravityVector()

const CalVector & CalSpringSystem::getGravityVector ( ) const

Returns the gravity vector.

This function returns the gravity vector of the spring system instance.

Returns
the gravity vector as vector.

◆ resetPositions()

void CalSpringSystem::resetPositions ( )

Reset the spring system.

Reset the vertex positions of the vertices to where they would be if their submesh was not springy.

◆ setCollisionDetection()

void CalSpringSystem::setCollisionDetection ( bool  collision)

Enable or disable the collision system.

Parameters
collisiontrue to enable the collision system else false

◆ setForceVector()

void CalSpringSystem::setForceVector ( const CalVector vForce)

Sets the force vector.

This function sets the force vector of the spring system instance.

Parameters
vForcethe force vector as vector.

◆ setGravityVector()

void CalSpringSystem::setGravityVector ( const CalVector vGravity)

Sets the gravity vector.

This function sets the gravity vector of the spring system instance.

Parameters
vGravitythe gravity vector as vector.

◆ update()

void CalSpringSystem::update ( float  deltaTime)

Updates all the spring systems in the attached meshes.

This functon updates all the spring systems in the attached meshes.


The documentation for this class was generated from the following files:

Generated by The Cal3D Team with Doxygen 1.8.14