CopperLicht API Documentation
Class CL3D.LightSceneNode
class rendering a point light.
Extends
CL3D.SceneNode.
Class Overview
CL3D.LightSceneNode(size)
A class rendering a point light.
Lighting works like this: Simply add a light scene node to the scene (as shown in the example below), and
set the 'Lighting' flag of the material of the scene nodes you want to be lighted to 'true'. That's it,
your scene will now by lit by dynamic light. For changing how the light looks like, change the LightData
structure of the light, it holds the attenuation, position, and color of the light.
Example showing how to add this to the current scene:
// add a cube to the scene var lightnode = new CL3D.LightSceneNode(); scene.getRootSceneNode().addChild(lightnode);
- Parameters:
- size
Field Attributes | Field Name and Description |
---|---|
Radius, Position, Color and Attenuation of the light
|
Method Attributes | Method Name and Description |
---|---|
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, createClone, getAbsolutePosition, getAbsoluteTransformation, getAnimatorOfType, getAnimators, getChildren, getMaterial, getMaterialCount, getParent, getRelativeTransformation, getTransformedBoundingBox, init, isActuallyVisible, OnAnimate, OnRegisterSceneNode, removeAnimator, removeChild, render, updateAbsolutePosition
Field Detail
{CL3D.Light}
LightData
Radius, Position, Color and Attenuation of the light
Method Detail
{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 'light' for the light scene node.
- Returns:
- {String} type name of the scene node.