Zone Class Reference

An abstract class that defines a zone in space. More...

Inheritance diagram for Zone:
Registerable Transformable AABox Cylinder Line Plane Point Ring Sphere

List of all members.

Public Member Functions

 Zone (const Vector3D &position=Vector3D())
 Default constructor for Zone.
virtual ~Zone ()
 Destructor of Zone.
virtual void setPosition (const Vector3D &v)
 Sets the position of this Zone.
const Vector3DgetPosition () const
 Gets the position of this Zone.
const Vector3DgetTransformedPosition () const
 Gets the transformed position of this Zone.
virtual void generatePosition (Particle &particle, bool full) const =0
 Randomly generates a position inside this Zone for a given Particle.
virtual bool contains (const Vector3D &point) const =0
 Checks whether a point is within the Zone.
virtual bool intersects (const Vector3D &v0, const Vector3D &v1, Vector3D *intersection, Vector3D *normal) const =0
 Checks whether a line intersects the Zone.
virtual void moveAtBorder (Vector3D &point, bool inside) const =0
 Moves a point at the border of the Zone.
virtual Vector3D computeNormal (const Vector3D &point) const =0
 Computes the normal for the point.

Protected Member Functions

virtual void innerUpdateTransform ()
 Updates all the parameters in the world coordinates.

Static Protected Member Functions

static void normalizeOrRandomize (Vector3D &v)
 A helper static method to normalize a Vector3D.

Static Protected Attributes

static const float APPROXIMATION_VALUE
 Value used for approximation.

Detailed Description

An abstract class that defines a zone in space.

A Zone is used in SPARK to :

Definition at line 46 of file SPK_Zone.h.


Constructor & Destructor Documentation

Zone ( const Vector3D position = Vector3D()  ) 

Default constructor for Zone.

Parameters:
position : the position of the Zone
virtual ~Zone (  )  [virtual]

Destructor of Zone.

Definition at line 65 of file SPK_Zone.h.


Member Function Documentation

virtual Vector3D computeNormal ( const Vector3D point  )  const [pure virtual]

Computes the normal for the point.

Parameters:
point : the point from where the normal is computed
Returns:
the normal vector
Since:
1.02.00

Implemented in AABox, Cylinder, Line, Plane, Point, Ring, and Sphere.

virtual bool contains ( const Vector3D point  )  const [pure virtual]

Checks whether a point is within the Zone.

Parameters:
point : the point to check
Returns:
true if the point is within the Zone, false otherwise

Implemented in AABox, Cylinder, Line, Plane, Point, Ring, and Sphere.

virtual void generatePosition ( Particle particle,
bool  full 
) const [pure virtual]

Randomly generates a position inside this Zone for a given Particle.

Parameters:
particle : the Particle whose position will be generated
full : true to generate a position in the whole volume of this Zone, false to generate a position only at borders

Implemented in AABox, Cylinder, Line, Plane, Point, Ring, and Sphere.

const Vector3D & getPosition (  )  const

Gets the position of this Zone.

Returns:
the position of this Zone

Definition at line 172 of file SPK_Zone.h.

const Vector3D & getTransformedPosition (  )  const

Gets the transformed position of this Zone.

Returns:
the transformed position of this Zone
Since:
1.03.00

Definition at line 177 of file SPK_Zone.h.

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 Transformable.

Reimplemented in Cylinder, Line, Plane, and Ring.

Definition at line 191 of file SPK_Zone.h.

virtual bool intersects ( const Vector3D v0,
const Vector3D v1,
Vector3D intersection,
Vector3D normal 
) const [pure 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.

Parameters:
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
Returns:
true if the line intersects with the Zone, false otherwise

Implemented in AABox, Cylinder, Line, Plane, Point, Ring, and Sphere.

virtual void moveAtBorder ( Vector3D point,
bool  inside 
) const [pure virtual]

Moves a point at the border of the Zone.

Parameters:
point : the point that will be moved to the border of the Zone
inside : true to move the point inside the Zone of APPROXIMATION_VALUE, false to move it outside of APPROXIMATION_VALUE

Implemented in AABox, Cylinder, Line, Plane, Point, Ring, and Sphere.

void normalizeOrRandomize ( Vector3D v  )  [static, protected]

A helper static method to normalize a Vector3D.

If the Vector3D is NULL, a random normal Vector3D is set.
The randomness is guaranteed to be uniformely distributed.

Parameters:
v : the Vector3D to normalize or randomize if not normalizable
Since:
1.03.00

Definition at line 182 of file SPK_Zone.h.

void setPosition ( const Vector3D v  )  [virtual]

Sets the position of this Zone.

Parameters:
v : the position of this Zone

Reimplemented in Line.

Definition at line 166 of file SPK_Zone.h.


Member Data Documentation

const float APPROXIMATION_VALUE [static, protected]

Value used for approximation.

Definition at line 144 of file SPK_Zone.h.


Generated on Wed Apr 27 21:09:26 2011 for SPARK Particle Engine by  doxygen 1.6.1