Plane Class Reference

A Zone defining a plane in the universe. More...

Inheritance diagram for Plane:
Zone Registerable Transformable

List of all members.

Public Member Functions

 Plane (const Vector3D &position=Vector3D(0.0f, 0.0f, 0.0f), const Vector3D &normal=Vector3D(0.0f, 1.0f, 0.0f))
 Constructor of Plane.
void setNormal (const Vector3D &normal)
 Sets the normal of this Plane.
const Vector3DgetNormal () const
 Gets the normal of this Plane.
const Vector3DgetTransformedNormal () const
 Gets the transformed normal of this Plane.
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 Planecreate (const Vector3D &position=Vector3D(0.0f, 0.0f, 0.0f), const Vector3D &normal=Vector3D(0.0f, 1.0f, 0.0f))
 Creates and registers a new Plane.

Protected Member Functions

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

Detailed Description

A Zone defining a plane in the universe.

A Plane is defined by 2 parameters :

The defined Plane is the Plane having the normal and passing by the position.
The direction of the normal defines the sens of the plane. The normal goes from inside the Plane to outside.

Note that the normal does not have to be normalized as it is normalized internally when set.

Definition at line 45 of file SPK_Plane.h.


Constructor & Destructor Documentation

Plane ( const Vector3D position = Vector3D(0.0f, 0.0f, 0.0f),
const Vector3D normal = Vector3D(0.0f, 1.0f, 0.0f) 
)

Constructor of Plane.

Parameters:
position : the position of the Plane
normal : the normal of the Plane

Member Function Documentation

Vector3D computeNormal ( const Vector3D point  )  const [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

Implements Zone.

Definition at line 157 of file SPK_Plane.h.

bool contains ( const Vector3D point  )  const [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

Implements Zone.

Definition at line 152 of file SPK_Plane.h.

Plane * create ( const Vector3D position = Vector3D(0.0f,0.0f,0.0f),
const Vector3D normal = Vector3D(0.0f,1.0f,0.0f) 
) [static]

Creates and registers a new Plane.

Parameters:
position : the position of the Plane
normal : the normal of the Plane
Returns:
a new registered plane
Since:
1.04.00

Definition at line 122 of file SPK_Plane.h.

void generatePosition ( Particle particle,
bool  full 
) const [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

Implements Zone.

Definition at line 147 of file SPK_Plane.h.

const Vector3D & getNormal (  )  const

Gets the normal of this Plane.

Returns:
the normal of this Plane

Definition at line 137 of file SPK_Plane.h.

const Vector3D & getTransformedNormal (  )  const

Gets the transformed normal of this Plane.

Returns:
the transformed normal of this Plane
Since:
1.05.00

Definition at line 142 of file SPK_Plane.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.

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

Implements Zone.

virtual void moveAtBorder ( Vector3D point,
bool  inside 
) const [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

Implements Zone.

void setNormal ( const Vector3D normal  ) 

Sets the normal of this Plane.

Note that the normal is normalized internally.

Parameters:
normal : the normal of this Plane

Definition at line 129 of file SPK_Plane.h.


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