Documentation

Classes

Class CL3D.ParticleSystemSceneNode

A particle system is a simple way to simulate things like fire, smoke, rain, etc in your 3d scene.

Extends CL3D.SceneNode.

Class Overview
CL3D.ParticleSystemSceneNode()
A particle system is a simple way to simulate things like fire, smoke, rain, etc in your 3d scene.
// Example showing how to create a particle system:
// create the 3d engine
var engine = new CL3D.CopperLicht('3darea');

if (!engine.initRenderer())
	return; // this browser doesn't support WebGL
	
// add a new 3d scene

var scene = new CL3D.Scene();
engine.addScene(scene);

scene.setBackgroundColor(CL3D.createColor(1, 0, 0, 64));

// add a user controlled camera with a first person shooter style camera controller
var cam = new CL3D.CameraSceneNode();
cam.Pos.X = 50;
cam.Pos.Y = 20;

var animator = new CL3D.AnimatorCameraFPS(cam, engine);										
cam.addAnimator(animator);										
animator.lookAt(new CL3D.Vect3d(0,20,0));			

scene.getRootSceneNode().addChild(cam);
scene.setActiveCamera(cam);		

// add a particle system to the scene
var psystem = new CL3D.ParticleSystemSceneNode();
scene.getRootSceneNode().addChild(psystem);

psystem.Direction = new CL3D.Vect3d(0, 0.03, 0);
psystem.MaxAngleDegrees = 20;

// set material and texture of the partcle system:
psystem.getMaterial(0).Tex1 = engine.getTextureManager().getTexture("crate_wood.jpg", true);
psystem.getMaterial(0).Type = CL3D.Material.EMT_TRANSPARENT_ADD_COLOR;

Field Summary
Field Attributes Field Name and Description
 
Default direction the particles will be emitted to.
 
Option to disable fog for particle system rendering
 
Area the particles are emitted in.
 
Setting if the fade out affector is active, i.e.
 
If FadeOutAffector is true, this defines the time in milli seconds used for the fade out effect.
 
If FadeOutAffector is true, this defines the target color of the fade out effect.
 
If GravityAffector is true, this will define the gravity vector.
 
If GravityAffector is true, this defines the time in milli seconds after the gravity will have affect
 
Setting if the gravity affector is active, i.e.
 
Maximal amount of degrees the emitting direction is ignored
 
Maximal life time of a particle in milli seconds
 
Maximal amounts of particles in the system
 
Maximal amounts of particles emitted per second
 
Maximal color of a particle when starting.
 
Maximal width of a particle when starting
 
Maximal height of a particle when starting
 
Minimal life time of a particle in milli seconds
 
Minimal amounts of particles emitted per second
 
Minimal color of a particle when starting.
 
Minimal width of a particle when starting
 
Minimal height of a particle when starting
 
Setting if the scale affector is active, i.e.
 
If ScaleAffector is true, this defines the target scale X value.
 
If ScaleAffector is true, this defines the target scale Y value.
Fields borrowed from class CL3D.SceneNode:
Id, Name, Pos, Rot, Scale, Selector, Visible
Method Summary
Method Attributes Method Name and Description
 
createClone(newparent, oldNodeId, newNodeId)
 
Get the axis aligned, not transformed bounding box of this node.
 
Returns the type string of the scene node.
Methods borrowed from class CL3D.SceneNode:
addAnimator, addChild, getAbsolutePosition, getAbsoluteTransformation, getAnimatorOfType, getAnimators, getChildren, getMaterial, getMaterialCount, getParent, getRelativeTransformation, getTransformedBoundingBox, init, isActuallyVisible, OnAnimate, OnRegisterSceneNode, removeAnimator, removeChild, render, updateAbsolutePosition
Field Detail
{CL3D.Vect3d()} Direction
Default direction the particles will be emitted to.
Default Value:
(0, 0.03, 0)

{Number} DisableFog
Option to disable fog for particle system rendering
Default Value:
10

{CL3D.Vect3d()} EmittArea
Area the particles are emitted in. By default, this area has a size of 0, causing this to be a point emitter.
Default Value:
(0, 0, 0)

{Boolean} FadeOutAffector
Setting if the fade out affector is active, i.e. if particles should be faded out at the end of their lifetime
Default Value:
false

{Number} FadeOutTime
If FadeOutAffector is true, this defines the time in milli seconds used for the fade out effect.
Default Value:
500

{Number} FadeTargetColor
If FadeOutAffector is true, this defines the target color of the fade out effect.
Default Value:
0x00000000

{Vect3d} Gravity
If GravityAffector is true, this will define the gravity vector. A useful value would be (0,-0.03,0), for example.
Default Value:
null

{Number} GravityAffectingTime
If GravityAffector is true, this defines the time in milli seconds after the gravity will have affect
Default Value:
500

{Boolean} GravityAffector
Setting if the gravity affector is active, i.e. if should be affected by gravity during their lifetime.
Default Value:
false

{Number} MaxAngleDegrees
Maximal amount of degrees the emitting direction is ignored
Default Value:
10

{Number} MaxLifeTime
Maximal life time of a particle in milli seconds
Default Value:
2000

{Number} MaxParticles
Maximal amounts of particles in the system
Default Value:
200

{Number} MaxParticlesPerSecond
Maximal amounts of particles emitted per second
Default Value:
20

{Number} MaxStartColor
Maximal color of a particle when starting. Set to 0xffffffff to make it white.
Default Value:
0xff000000

{Number} MaxStartSizeX
Maximal width of a particle when starting
Default Value:
7

{Number} MaxStartSizeY
Maximal height of a particle when starting
Default Value:
5

{Number} MinLifeTime
Minimal life time of a particle in milli seconds
Default Value:
1000

{Number} MinParticlesPerSecond
Minimal amounts of particles emitted per second
Default Value:
10

{Number} MinStartColor
Minimal color of a particle when starting. Set to 0xffffffff to make it white.
Default Value:
0xff000000

{Number} MinStartSizeX
Minimal width of a particle when starting
Default Value:
5

{Number} MinStartSizeY
Minimal height of a particle when starting
Default Value:
5

{Boolean} ScaleAffector
Setting if the scale affector is active, i.e. if should be scaled their lifetime.
Default Value:
false

{Number} ScaleToX
If ScaleAffector is true, this defines the target scale X value.
Default Value:
20

{Number} ScaleToY
If ScaleAffector is true, this defines the target scale Y value.
Default Value:
20
Method Detail
createClone(newparent, oldNodeId, newNodeId)
Parameters:
newparent
oldNodeId
newNodeId

{CL3D.Box3d} getBoundingBox()
Get the axis aligned, not transformed bounding box of this node. This means that if this node is an animated 3d character, moving in a room, the bounding box will always be around the origin. To get the box in real world coordinates, just transform it with the matrix you receive with getAbsoluteTransformation() or simply use getTransformedBoundingBox(), which does the same.
Returns:
{CL3D.Box3d} Bounding box of this scene node.

{String} getType()
Returns the type string of the scene node. Returns 'billboard' for the mesh scene node.
Returns:
{String} type name of the scene node.

© 2011-2018 N.Gebhardt, Ambiera
Documentation generated by JsDoc Toolkit