00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef GLPARTICLE_H
00019 #define GLPARTICLE_H
00020
00021 #include "gldynamic.h"
00022 #include "glsphere.h"
00023 #include "glcube.h"
00024 #include "glrendermode.h"
00025
00030 namespace GLScene
00031 {
00032
00033 class GLParticle : public GLDynamicObject
00034 {
00035 SpherePtr particle;
00036 public:
00037 GLParticle(GLVector pos, GLVector vel, GLfloat m, GLfloat rad);
00038 virtual ~GLParticle();
00041 virtual GLVector getVectorToFurthestPoint(const GLVector& fromPoint)
00042 { return particle->getVectorToFurthestPoint(fromPoint); };
00043 virtual GLVector getVectorToNearestPoint(const GLVector& fromPoint)
00044 { return particle->getVectorToNearestPoint(fromPoint); };
00045
00046 virtual bool intersection( GLGeometricObject* obj ) { return obj->intersection((GLSphere*)particle); };
00047 virtual bool intersection( GLCube* cu ) { return cu->intersection(particle); };
00048 virtual bool intersection( GLSphere* sp ) { return particle->intersection(sp); };
00049 virtual bool intersection( GLParticle* pa ) { return particle->intersection(pa->particle); };
00050 virtual bool inclusion( GLGeometricObject* obj ) { return obj->inclusion((GLSphere*)particle); };
00051 virtual bool inclusion( GLSphere* sp ) { return particle->inclusion(sp); };
00052 virtual void staticCollision( GLGeometricObject* obj );
00053 virtual void dynamicCollision( GLDynamicObject* obj );
00054
00055 virtual void setPosition( const GLVector& _newVal );
00056
00057 inline GLfloat getRadius() { return particle->getRadius(); }
00058 virtual void render( )
00059 { }
00060
00061 virtual void renderForSelection(GLuint&) {};
00062 };
00063
00064 };
00065
00066 #endif