Cyclone Cyclone: C:/data/physeng_code/include/cyclone/particle.h Source File

C:/data/physeng_code/include/cyclone/particle.h

Go to the documentation of this file.
00001 /*
00002  * Interface file for the particle class.
00003  * 
00004  * Part of the Cyclone physics system.
00005  * 
00006  * Copyright (c) Icosagon 2003. All Rights Reserved.
00007  *
00008  * This software is distributed under licence. Use of this software
00009  * implies agreement with all terms and conditions of the accompanying
00010  * software licence.
00011  */
00012 
00020 #ifndef CYCLONE_PARTICLE_H
00021 #define CYCLONE_PARTICLE_H
00022 
00023 #include "core.h"
00024 
00025 namespace cyclone {
00026 
00028 
00032 
00038 
00039 
00040     class Particle
00041     {
00043     public:
00045 
00047         // ... Other Particle code as before ...
00048     
00050         
00051     protected:
00085         
00087 
00095         real inverseMass;
00097         
00099 
00104         real damping;
00106         
00108 
00112         Vector3 position;
00113 
00118         Vector3 velocity;
00119         
00121 
00131 
00133 
00138         Vector3 forceAccum;
00139         
00142 
00147         Vector3 acceleration;
00149 
00152     public:
00161 
00176 
00178 
00184         void integrate(real duration);
00186         
00197 
00210         void setMass(const real mass);
00211 
00217         real getMass() const;
00218 
00231         void setInverseMass(const real inverseMass);
00232 
00238         real getInverseMass() const;
00239 
00243         bool hasFiniteMass() const;
00244 
00248         void setDamping(const real damping);
00249 
00253         real getDamping() const;
00254 
00260         void setPosition(const Vector3 &position);
00261 
00274         void setPosition(const real x, const real y, const real z);
00275 
00282         void getPosition(Vector3 *position) const;
00283 
00289         Vector3 getPosition() const;
00290     
00296         void setVelocity(const Vector3 &velocity);
00297 
00310         void setVelocity(const real x, const real y, const real z);
00311 
00318         void getVelocity(Vector3 *velocity) const;
00319 
00326         Vector3 getVelocity() const;
00327 
00333         void setAcceleration(const Vector3 &acceleration);
00334 
00347         void setAcceleration(const real x, const real y, const real z);
00348 
00355         void getAcceleration(Vector3 *acceleration) const;
00356 
00363         Vector3 getAcceleration() const;
00364 
00374 
00376 
00380         void clearAccumulator();
00382 
00384 
00390         void addForce(const Vector3 &force);
00392 
00394 
00396     };
00398 }
00399 
00400 #endif // CYCLONE_BODY_H