00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00021
00022
00023 #ifndef H_SPK_POINT
00024 #define H_SPK_POINT
00025
00026 #include "Core/SPK_Zone.h"
00027 #include "Core/SPK_Particle.h"
00028
00029
00030 namespace SPK
00031 {
00036 class SPK_PREFIX Point : public Zone
00037 {
00038 SPK_IMPLEMENT_REGISTERABLE(Point)
00039
00040 public :
00041
00043
00045
00050 Point(const Vector3D& position = Vector3D(0.0f,0.0f,0.0f));
00051
00058 static Point* create(const Vector3D& position = Vector3D(0.0f,0.0f,0.0f));
00059
00060
00061 virtual void generatePosition(Particle& particle,bool full) const;
00062 virtual bool contains(const Vector3D& v) const;
00063 virtual bool intersects(const Vector3D& v0,const Vector3D& v1,Vector3D* intersection,Vector3D* normal) const;
00064 virtual void moveAtBorder(Vector3D& v,bool inside) const;
00065 virtual Vector3D computeNormal(const Vector3D& point) const;
00066 };
00067
00068 inline Point* Point::create(const Vector3D& position)
00069 {
00070 Point* obj = new Point(position);
00071 registerObject(obj);
00072 return obj;
00073 }
00074
00075 inline void Point::generatePosition(Particle& particle,bool full) const
00076 {
00077 particle.position() = getTransformedPosition();
00078 }
00079
00080 inline bool Point::contains(const Vector3D& v) const
00081 {
00082 return false;
00083 }
00084
00085 inline bool Point::intersects(const Vector3D& v0,const Vector3D& v1,Vector3D* intersection,Vector3D* normal) const
00086 {
00087 return false;
00088 }
00089
00090 inline void Point::moveAtBorder(Vector3D& v,bool inside) const {}
00091 }
00092
00093 #endif