SPK::SFML Namespace Reference

the namespace for SFML dependent SPARK code More...

Classes

class  SFMLDrawableRenderer
 A Renderer drawing particles as SFML Drawables for the SFML 2D rendering engine. More...
class  SFMLLineRenderer
 A Renderer drawing particles as lines for the SFML 2D rendering engine. More...
class  SFMLPointRenderer
 A Renderer drawing particles as points for the SFML 2D rendering engine. More...
class  SFMLQuadRenderer
 A Renderer drawing particles as Quads for the SFML 2D rendering engine. More...
class  SFMLRenderer
 An abstract Renderer for the SFML renderers. More...
class  SFMLSystem
 A System to use particle systems as SFML Drawable object. More...

Enumerations

enum  CameraAnchor {
  CAMERA_CENTER = 0,
  CAMERA_LEFT = -1,
  CAMERA_RIGHT = 1,
  CAMERA_TOP = -1,
  CAMERA_BOTTOM = 1
}
 

Constatns to position the camera in SFML 2D engine.

More...
enum  ResizeMode {
  RESIZE_NONE,
  RESIZE_ZOOM_X,
  RESIZE_ZOOM_Y
}
 

Constants defining the way primitives must be resized when zooming.

More...

Functions

Vector3D vectorSPK (sf::Vector2f &v)
 Converts an SFML Vector2 into a SPARK Vector3D.
Vector3D vectorSPK (sf::Vector3f &v)
 Converts an SFML Vector3 into a SPARK Vector3D.
sf::Vector2f vector2SFML (Vector3D &v, bool addZ=false)
 Converts an SPARK Vector3D into a SFML Vector2.
sf::Vector3f vector3SFML (Vector3D &v)
 Converts an SPARK Vector3D into a SFML Vector3.
void setCameraPosition (CameraAnchor anchorX=CAMERA_RIGHT, CameraAnchor anchorY=CAMERA_BOTTOM, float altitude=10000.0f, float offset=1000.0f)
 Sets the camera position for a use in the SFML 2D engine.
void setMatrix (Transformable &transformable, const sf::Matrix3 &matrix)
 A helper function to set a SFML matrix to a transformable.

Detailed Description

the namespace for SFML dependent SPARK code

Since:
1.01.00

Enumeration Type Documentation

Constatns to position the camera in SFML 2D engine.

Since:
1.01.01
Enumerator:
CAMERA_CENTER 

Constant defining the center

CAMERA_LEFT 

Constant defining the left

CAMERA_RIGHT 

Constant defining the right

CAMERA_TOP 

Constant defining the top

CAMERA_BOTTOM 

Constant defining the bottom

Definition at line 41 of file SPK_SFML_GLOBAL.h.

enum ResizeMode

Constants defining the way primitives must be resized when zooming.

Since:
1.01.00
Enumerator:
RESIZE_NONE 

Constant defining no resize

RESIZE_ZOOM_X 

Constant defining a resize function of the X axis

RESIZE_ZOOM_Y 

Constant defining a resize function of the Y axis

Definition at line 39 of file SPK_SFMLRenderer.h.


Function Documentation

void SPK::SFML::setCameraPosition ( CameraAnchor  anchorX = CAMERA_RIGHT,
CameraAnchor  anchorY = CAMERA_BOTTOM,
float  altitude = 10000.0f,
float  offset = 1000.0f 
)

Sets the camera position for a use in the SFML 2D engine.

This is an helper function to set up the camera position for either particle sorting or particle distance computation.

The user has to define where to place the camera with the anchor. This will influence the way particle are sorted. By default the anchor are CAMERA_RIGHT and CAMERA_BOTTOM <hich correspond to a classical way to sort objects in 2D.

The altitude and offset parameters can be used by default. However the user has the possibility to manually set them.
Basically any sorted System must be contained in the cube defined by (2 * offset,2 * offset,altitude)

System::setCameraPosition(const Vector3D&) can be used for more control.
This function basically calls System::setCameraPosition(Vector3D(anchorX * offset,anchorY * offset,altitude)).

Parameters:
anchorX : the anchor on the X axis
anchorY : the anchot on the Y axis
altitude : the altitude of the camera
offset : the offset the camera is positioned if not centered
Since:
1.01.01

Definition at line 138 of file SPK_SFML_GLOBAL.h.

void SPK::SFML::setMatrix ( Transformable &  transformable,
const sf::Matrix3 &  matrix 
)

A helper function to set a SFML matrix to a transformable.

Parameters:
transformable : the transformable which transform should be set
matrix : the SFML matrix to set to the transformable /
Since:
1.03.01

Definition at line 152 of file SPK_SFML_GLOBAL.h.

sf::Vector2f SPK::SFML::vector2SFML ( Vector3D &  v,
bool  addZ = false 
)

Converts an SPARK Vector3D into a SFML Vector2.

It performs this convertion :

  • If addZ is false :
    sf::Vector2f(v.x,v.y)
  • If addZ is true :
    sf::Vector2f(v.x,v.y - zFactor * v.z)
Parameters:
v : the SPARK Vector3D to convert
addZ : if true the z coodinate of the SPARK Vector is added th its y coordinate for the convertion
Returns:
the converted sf::Vector2f
Since:
1.01.01

Definition at line 95 of file SPK_SFML_GLOBAL.h.

sf::Vector3f SPK::SFML::vector3SFML ( Vector3D &  v  ) 

Converts an SPARK Vector3D into a SFML Vector3.

It performs this convertion :
sf::Vector3f(v.x,v.y,v.z)

Parameters:
v : the SPARK Vector3D to convert
Returns:
the converted sf::Vector3f
Since:
1.01.01

Definition at line 110 of file SPK_SFML_GLOBAL.h.

Vector3D SPK::SFML::vectorSPK ( sf::Vector3f &  v  ) 

Converts an SFML Vector3 into a SPARK Vector3D.

It performs this convertion :
Vector3D(v.x,v.y,v.z)

Parameters:
v : the SFML Vector3 to convert
Returns:
the converted Vector3D
Since:
1.01.01

Definition at line 75 of file SPK_SFML_GLOBAL.h.

Vector3D SPK::SFML::vectorSPK ( sf::Vector2f &  v  ) 

Converts an SFML Vector2 into a SPARK Vector3D.

It performs this convertion :
Vector3D(v.x,v.y,0.0f)

Parameters:
v : the SFML Vector2 to convert
Returns:
the converted Vector3D
Since:
1.01.01

Definition at line 60 of file SPK_SFML_GLOBAL.h.


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