A ZOne defining a flat ring in the universe. More...
Public Member Functions | |
Ring (const Vector3D &position=Vector3D(0.0f, 0.0f, 0.0f), const Vector3D &normal=Vector3D(0.0f, 1.0f, 0.0f), float minRadius=0.0f, float maxRadius=1.0f) | |
Constructor of ring. | |
void | setNormal (const Vector3D &normal) |
Sets the normal of the plane on which lies this ring. | |
void | setRadius (float minRadius, float maxRadius) |
Sets the min and max radius of this ring. | |
const Vector3D & | getNormal () const |
Gets the normal of this ring. | |
const Vector3D & | getTransformedNormal () const |
Gets the transformed normal of this ring. | |
float | getMinRadius () const |
Gets the minimum radius of this ring. | |
float | getMaxRadius () const |
Gets the maximum radius of this ring. | |
virtual void | generatePosition (Particle &particle, bool full) const |
Randomly generates a position inside this Zone for a given Particle. | |
virtual bool | contains (const Vector3D &v) const |
Checks whether a point is within the Zone. | |
virtual bool | intersects (const Vector3D &v0, const Vector3D &v1, Vector3D *intersection, Vector3D *normal) const |
Checks whether a line intersects the Zone. | |
virtual void | moveAtBorder (Vector3D &v, bool inside) const |
Moves a point at the border of the Zone. | |
virtual Vector3D | computeNormal (const Vector3D &point) const |
Computes the normal for the point. | |
Static Public Member Functions | |
static Ring * | create (const Vector3D &position=Vector3D(0.0f, 0.0f, 0.0f), const Vector3D &normal=Vector3D(0.0f, 1.0f, 0.0f), float minRadius=0.0f, float maxRadius=1.0f) |
Creates and registers a new Ring. | |
Protected Member Functions | |
virtual void | innerUpdateTransform () |
Updates all the parameters in the world coordinates. |
A ZOne defining a flat ring in the universe.
A ring is defined by :
Note that by having the minimum radius equal to 0, the ring becomes a disk in the universe.
Note that the normal does not have to be normalized as it is normalized internally when set.
Definition at line 43 of file SPK_Ring.h.
Ring | ( | const Vector3D & | position = Vector3D(0.0f, 0.0f, 0.0f) , |
|
const Vector3D & | normal = Vector3D(0.0f, 1.0f, 0.0f) , |
|||
float | minRadius = 0.0f , |
|||
float | maxRadius = 1.0f | |||
) |
Constructor of ring.
position | : the position of the ring | |
normal | : the normal of the plane on which lies the ring | |
minRadius | : the minimum radius of the ring | |
maxRadius | : the maximum radius of the ring |
Computes the normal for the point.
point | : the point from where the normal is computed |
Implements Zone.
Definition at line 192 of file SPK_Ring.h.
bool contains | ( | const Vector3D & | point | ) | const [virtual] |
Checks whether a point is within the Zone.
point | : the point to check |
Implements Zone.
Definition at line 187 of file SPK_Ring.h.
Ring * create | ( | const Vector3D & | position = Vector3D(0.0f,0.0f,0.0f) , |
|
const Vector3D & | normal = Vector3D(0.0f,1.0f,0.0f) , |
|||
float | minRadius = 0.0f , |
|||
float | maxRadius = 1.0f | |||
) | [static] |
Creates and registers a new Ring.
position | : the position of the ring | |
normal | : the normal of the plane on which lies the ring | |
minRadius | : the minimum radius of the ring | |
maxRadius | : the maximum radius of the ring |
Definition at line 152 of file SPK_Ring.h.
virtual void generatePosition | ( | Particle & | particle, | |
bool | full | |||
) | const [virtual] |
float getMaxRadius | ( | ) | const |
Gets the maximum radius of this ring.
Definition at line 182 of file SPK_Ring.h.
float getMinRadius | ( | ) | const |
Gets the minimum radius of this ring.
Definition at line 177 of file SPK_Ring.h.
const Vector3D & getNormal | ( | ) | const |
Gets the normal of this ring.
Definition at line 167 of file SPK_Ring.h.
const Vector3D & getTransformedNormal | ( | ) | const |
Gets the transformed normal of this ring.
Definition at line 172 of file SPK_Ring.h.
virtual void innerUpdateTransform | ( | ) | [protected, virtual] |
Updates all the parameters in the world coordinates.
This method can be overriden in derived classes of Transformable (By default it does nothing).
It is this method task to compute all parameters of the class that are dependent of the world transform.
Reimplemented from Zone.
virtual bool intersects | ( | const Vector3D & | v0, | |
const Vector3D & | v1, | |||
Vector3D * | intersection, | |||
Vector3D * | normal | |||
) | const [virtual] |
Checks whether a line intersects the Zone.
The intersection is computed only if the Vector3D* intersection is not NULL.
The normal is computed if the Vector3D* normal AND intersection are not NULL.
v0 | : start of the line | |
v1 | : end of the line | |
intersection | : the Vector3D where the intersection will be stored, NULL not to compute the intersection | |
normal | : the Vector3D where the normal will be stored, NULL not to compute the normal |
Implements Zone.
virtual void moveAtBorder | ( | Vector3D & | point, | |
bool | inside | |||
) | const [virtual] |
void setNormal | ( | const Vector3D & | normal | ) |
Sets the normal of the plane on which lies this ring.
Note that the normal is normalized internally
normal | : the normal of the plane on which lies the ring |
Definition at line 159 of file SPK_Ring.h.
void setRadius | ( | float | minRadius, | |
float | maxRadius | |||
) |
Sets the min and max radius of this ring.
A radius cannot be negative.
Note that negative radius are inverted internally
minRadius | : the minimum radius of this ring | |
maxRadius | : the maximum radius of this ring |