- 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
25class CalModel;
26class CalSubmesh;
27
28//****************************************************************************//
29// Class declaration //
30//****************************************************************************//
31
32 /*****************************************************************************/
36class CAL3D_API CalSpringSystem
37{
38public:
41
42// member functions
43public:
44 void calculateForces(CalSubmesh *pSubmesh, float deltaTime);
45 void calculateVertices(CalSubmesh *pSubmesh, float deltaTime);
46 void update(float deltaTime);
47 void resetPositions();
48
49 const CalVector & getGravityVector() const;
50 void setGravityVector(const CalVector & vGravity);
51 const CalVector & getForceVector() const;
52 void setForceVector(const CalVector & vForce);
53 void setCollisionDetection(bool collision);
54
55
56 /* DEBUG CODE ********************
57 struct
58 {
59 float x, y, z, radius;
60 } Sphere;
61 void setSphere(float x, float y, float z, float radius) { Sphere.x = x; Sphere.y = y; Sphere.z = z; Sphere.radius = radius; };
62 *********************************/
63
64private:
65 CalModel *m_pModel;
66 CalVector m_vGravity;
67 CalVector m_vForce;
68 bool m_collision;
69};
70
71#endif
72
73//****************************************************************************//
Definition model.h:31
The spring system class.
Definition springsystem.h:37
Definition submesh.h:30
The vector class.
Definition vector.h:37

Generated by The Cal3D Team with Doxygen 1.10.0