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

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

Go to the documentation of this file.
00001 /*
00002  * Interface file for the particle links.
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 
00019 #ifndef CYCLONE_PLINKS_H
00020 #define CYCLONE_PLINKS_H
00021 
00022 #include "pcontacts.h"
00023 
00024 namespace cyclone {
00025 
00027 
00033     class ParticleLink : public ParticleContactGenerator
00034     {
00035     public:
00039         Particle* particle[2];
00040 
00041     protected:
00045         real currentLength() const;
00046 
00047     public:
00060         virtual unsigned addContact(ParticleContact *contact,
00061                                     unsigned limit) const = 0;
00062     };
00063 
00068     class ParticleCable : public ParticleLink
00069     {
00070     public:
00074         real maxLength;
00075 
00079         real restitution;
00080 
00081     public:
00086         virtual unsigned addContact(ParticleContact *contact,
00087                                     unsigned limit) const;
00088     };
00089 
00094     class ParticleRod : public ParticleLink
00095     {
00096     public:
00100         real length;
00101 
00102     public:
00107         virtual unsigned addContact(ParticleContact *contact,
00108                                      unsigned limit) const;
00109     };
00110 
00115         class ParticleConstraint : public ParticleContactGenerator
00116         {
00117         public:
00121                 Particle* particle;
00122 
00126                 Vector3 anchor;
00127 
00128         protected:
00132                 real currentLength() const;
00133 
00134         public:
00147                 virtual unsigned addContact(ParticleContact *contact,
00148                         unsigned limit) const = 0;
00149         };
00150 
00155         class ParticleCableConstraint : public ParticleConstraint
00156         {
00157         public:
00161                 real maxLength;
00162 
00166                 real restitution;
00167 
00168         public:
00173                 virtual unsigned addContact(ParticleContact *contact,
00174                         unsigned limit) const;
00175         };
00176 
00181         class ParticleRodConstraint : public ParticleConstraint
00182         {
00183         public:
00187                 real length;
00188 
00189         public:
00194                 virtual unsigned addContact(ParticleContact *contact,
00195                         unsigned limit) const;
00196         };
00197 } // namespace cyclone
00198 
00199 #endif // CYCLONE_CONTACTS_H