- Cal3D 0.11 API Reference -

springsystem.h
1//****************************************************************************//
2// springsystem.h //
3// Copyright (C) 2001, 2002 Bruno 'Beosil' Heidelberger //
4//****************************************************************************//
5// This library is free software; you can redistribute it and/or modify it //
6// under the terms of the GNU Lesser General Public License as published by //
7// the Free Software Foundation; either version 2.1 of the License, or (at //
8// your option) any later version. //
9//****************************************************************************//
10
11#ifndef CAL_SPRINGSYSTEM_H
12#define CAL_SPRINGSYSTEM_H
13
14//****************************************************************************//
15// Includes //
16//****************************************************************************//
17
18#include "cal3d/global.h"
19#include "cal3d/vector.h"
20
21//****************************************************************************//
22// Forward declarations //
23//****************************************************************************//
24
25 class CalModel;
26 class CalSubmesh;
27
28//****************************************************************************//
29// Class declaration //
30//****************************************************************************//
31
32 /*****************************************************************************/
35
36 class CAL3D_API CalSpringSystem
37{
38 public:
39 CalSpringSystem(CalModel* pModel);
40 ~CalSpringSystem() { }
41
42// member functions
43 public:
44 void calculateForces(CalSubmesh *pSubmesh, float deltaTime);
45 void calculateVertices(CalSubmesh *pSubmesh, float deltaTime);
46 void update(float deltaTime);
47
48 CalVector & getGravityVector();
49 void setGravityVector(const CalVector & vGravity);
50 CalVector & getForceVector();
51 void setForceVector(const CalVector & vForce);
52 void setCollisionDetection(bool collision);
53
54
55 /* DEBUG CODE ********************
56 struct
57 {
58 float x, y, z, radius;
59 } Sphere;
60 void setSphere(float x, float y, float z, float radius) { Sphere.x = x; Sphere.y = y; Sphere.z = z; Sphere.radius = radius; };
61 *********************************/
62
63 private:
64 CalModel *m_pModel;
65 CalVector m_vGravity;
66 CalVector m_vForce;
67 bool m_collision;
68};
69
70#endif
71
72//****************************************************************************//
CalModel
Definition model.h:31
CalSpringSystem::CalSpringSystem
CalSpringSystem(CalModel *pModel)
Constructs the spring system instance.
Definition springsystem.cpp:36
CalSpringSystem::getGravityVector
CalVector & getGravityVector()
Returns the gravity vector.
Definition springsystem.cpp:349
CalSpringSystem::update
void update(float deltaTime)
Updates all the spring systems in the attached meshes.
Definition springsystem.cpp:311
CalSpringSystem::calculateVertices
void calculateVertices(CalSubmesh *pSubmesh, float deltaTime)
Calculates the vertices influenced by the spring system instance.
Definition springsystem.cpp:99
CalSpringSystem::setGravityVector
void setGravityVector(const CalVector &vGravity)
Sets the gravity vector.
Definition springsystem.cpp:376
CalSpringSystem::setForceVector
void setForceVector(const CalVector &vForce)
Sets the force vector.
Definition springsystem.cpp:389
CalSpringSystem::calculateForces
void calculateForces(CalSubmesh *pSubmesh, float deltaTime)
Calculates the forces on each unbound vertex.
Definition springsystem.cpp:59
CalSpringSystem::getForceVector
CalVector & getForceVector()
Returns the force vector.
Definition springsystem.cpp:363
CalSpringSystem::setCollisionDetection
void setCollisionDetection(bool collision)
Enable or disable the collision system.
Definition springsystem.cpp:400
CalSubmesh
Definition submesh.h:23
CalVector
The vector class.
Definition vector.h:37

Generated by The Cal3D Team with Doxygen 1.15.0