## Documentation

- Overview
- Website
- Tutorials
- Class Index

## Classes

- _global_
- CL3D
- CL3D.AnimatedMeshSceneNode
- CL3D.Animator
- CL3D.AnimatorAnimateTexture
- CL3D.AnimatorCameraFPS
- CL3D.AnimatorCameraModelViewer
- CL3D.AnimatorCollisionResponse
- CL3D.AnimatorFlyCircle
- CL3D.AnimatorFlyStraight
- CL3D.AnimatorFollowPath
- CL3D.AnimatorOnClick
- CL3D.AnimatorOnProximity
- CL3D.AnimatorRotation
- CL3D.BillboardSceneNode
- CL3D.BoundingBoxTriangleSelector
- CL3D.Box3d
- CL3D.CameraSceneNode
- CL3D.ColorF
- CL3D.CopperCubeVariable
- CL3D.CopperLicht
- CL3D.CubeSceneNode
- CL3D.HotspotSceneNode
- CL3D.Light
- CL3D.LightSceneNode
- CL3D.Line3d
- CL3D.Material
- CL3D.Matrix4
- CL3D.Mesh
- CL3D.MeshBuffer
- CL3D.MeshSceneNode
- CL3D.MeshTriangleSelector
- CL3D.MetaTriangleSelector
- CL3D.Mobile2DInputSceneNode
- CL3D.OctTreeTriangleSelector
- CL3D.Overlay2DSceneNode
- CL3D.ParticleSystemSceneNode
- CL3D.PathSceneNode
- CL3D.Plane3d
- CL3D.Quaternion
- CL3D.Renderer
- CL3D.Scene
- CL3D.SceneNode
- CL3D.SkyBoxSceneNode
- CL3D.SoundSceneNode
- CL3D.TerrainSceneNode
- CL3D.Texture
- CL3D.TextureManager
- CL3D.Triangle3d
- CL3D.TriangleSelector
- CL3D.Vect2d
- CL3D.Vect3d
- CL3D.Vertex3D
- CL3D.WaterSurfaceSceneNode

CopperLicht API Documentation

# 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
--- | ---
| Direction Default direction the particles will be emitted to.
| DisableFog Option to disable fog for particle system rendering
| EmittArea Area the particles are emitted in.
| FadeOutAffector Setting if the fade out affector is active, i.e.
| FadeOutTime If FadeOutAffector is true, this defines the time in milli seconds used for the fade out effect.
| FadeTargetColor If FadeOutAffector is true, this defines the target color of the fade out effect.
| Gravity If GravityAffector is true, this will define the gravity vector.
| GravityAffectingTime If GravityAffector is true, this defines the time in milli seconds after the gravity will have affect
| GravityAffector Setting if the gravity affector is active, i.e.
| MaxAngleDegrees Maximal amount of degrees the emitting direction is ignored
| MaxLifeTime Maximal life time of a particle in milli seconds
| MaxParticles Maximal amounts of particles in the system
| MaxParticlesPerSecond Maximal amounts of particles emitted per second
| MaxStartColor Maximal color of a particle when starting.
| MaxStartSizeX Maximal width of a particle when starting
| MaxStartSizeY Maximal height of a particle when starting
| MinLifeTime Minimal life time of a particle in milli seconds
| MinParticlesPerSecond Minimal amounts of particles emitted per second
| MinStartColor Minimal color of a particle when starting.
| MinStartSizeX Minimal width of a particle when starting
| MinStartSizeY Minimal height of a particle when starting
| ScaleAffector Setting if the scale affector is active, i.e.
| ScaleToX If ScaleAffector is true, this defines the target scale X value.
| ScaleToY 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)
| getBoundingBox() Get the axis aligned, not transformed bounding box of this node.
| getType() 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