Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members

glparticle.h

00001 /***************************************************************************
00002                           glparticle.h  -  description
00003                              -------------------
00004     begin                : Thu Aug 21 2003
00005     copyright            : (C) 2003 by Jacques Gasselin de Richebourg
00006     email                : jacquesgasselin@hotmail.com
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU Lesser General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
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       { } //particle->setPosition( getPosition() ); particle->render( ); };
00060       
00061       virtual void renderForSelection(GLuint&) {};        
00062    };
00063 
00064 };
00065 
00066 #endif

Generated on Wed Feb 4 23:11:33 2004 by doxygen 1.3.3