#include <OgreLight.h>
Inheritance diagram for Ogre::Light:
Public Types | |
enum | LightTypes { LT_POINT, LT_DIRECTIONAL, LT_SPOTLIGHT } |
Defines the type of light. More... | |
Public Methods | |
Light () | |
Default constructor (for Python mainly). More... | |
Light (String name) | |
Normal constructor. More... | |
~Light () | |
Standard destructor. More... | |
const String & | getName (void) const |
Returns the name of this light (cannot be modified). More... | |
void | setType (LightTypes type) |
Sets the type of light - see LightTypes for more info. More... | |
LightTypes | getType (void) |
Returns the light type. More... | |
void | setDiffuseColour (Real red, Real green, Real blue) |
Sets the colour of the diffuse light given off by this source. More... | |
void | setDiffuseColour (const ColourValue &colour) |
Sets the colour of the diffuse light given off by this source. More... | |
ColourValue | getDiffuseColour (void) |
Returns the colour of the diffuse light given off by this light source (see setDiffuseColour for more info). More... | |
void | setSpecularColour (Real red, Real green, Real blue) |
Sets the colour of the specular light given off by this source. More... | |
void | setSpecularColour (const ColourValue &colour) |
Sets the colour of the specular light given off by this source. More... | |
ColourValue | getSpecularColour (void) |
Returns the colour of specular light given off by this light source. More... | |
void | setAttenuation (Real range, Real constant, Real linear, Real quadratic) |
Sets the attenuation parameters of the light source ie how it diminishes with distance. More... | |
Real | getAttenuationRange (void) |
Returns the absolute upper range of the light. More... | |
Real | getAttenuationConstant (void) |
Returns the constant factor in the attenuation formula. More... | |
Real | getAttenuationLinear (void) |
Returns the linear factor in the attenuation formula. More... | |
Real | getAttenuationQuadric (void) |
Returns the quadric factor in the attenuation formula. More... | |
void | setPosition (Real x, Real y, Real z) |
Sets the position of the light. More... | |
void | setPosition (const Vector3 &vec) |
Sets the position of the light. More... | |
Vector3 | getPosition (void) |
Returns the position of the light. More... | |
void | setDirection (Real x, Real y, Real z) |
Sets the direction in which a light points. More... | |
void | setDirection (const Vector3 &vec) |
Sets the direction in which a light points. More... | |
Vector3 | getDirection (void) |
Returns the light's direction. More... | |
void | setSpotlightRange (Real innerAngle, Real outerAngle, Real falloff=1.0) |
Sets the range of a spotlight, i.e. More... | |
Real | getSpotlightInnerAngle (void) |
Returns the angle covered by the spotlights inner cone, in degrees. More... | |
Real | getSpotlightOuterAngle (void) |
Returns the angle covered by the spotlights outer cone, in degrees. More... | |
Real | getSpotlightFalloff (void) |
Returns the falloff between the inner and outer cones of the spotlight. More... | |
bool | isModified (void) |
Returns a true/false value indicating if this light has changed since it was last issued to the renderer. More... | |
void | _clearModified (void) |
Clears the light's modified flag (should only be done by the engine itself). More... | |
void | _notifyCurrentCamera (Camera *cam) |
Overridden from MovableObject. More... | |
const AxisAlignedBox & | getBoundingBox (void) const |
Overridden from MovableObject. More... | |
void | _updateRenderQueue (RenderQueue *queue) |
Overridden from MovableObject. More... | |
const String | getMovableType (void) const |
Overridden from MovableObject. More... | |
const Vector3 & | getDerivedPosition (void) |
Retrieves the position of the light including any transform from nodes it is attached to. More... | |
const Vector3 & | getDerivedDirection (void) |
Retrieves the direction of the light including any transform from nodes it is attached to. More... | |
void | setVisible (bool visible) |
Overridden from MovableObject. More... | |
virtual SceneNode * | getParentNode (void) |
Returns the node to which this object is attached. More... | |
virtual void | _notifyAttached (SceneNode *parent) |
Internal method called to notify the object that it has been attached to a node. More... | |
virtual bool | isAttached (void) const |
Returns true if this object is attached to a SceneNode. More... | |
virtual bool | isVisible (void) const |
Returns whether or not this object is supposed to be visible or not. More... | |
virtual void | setUserObject (UserDefinedObject *obj) |
Call this to associate your own custom user object instance with this MovableObject. More... | |
virtual UserDefinedObject * | getUserObject (void) |
Retrieves a pointer to a custom application object associated with this movable by an earlier call to setUserObject. More... | |
virtual void | setRenderQueueGroup (RenderQueueGroupID queueID) |
Sets the render queue group this entity will be rendered through. More... | |
virtual RenderQueueGroupID | getRenderQueueGroup (void) |
Gets the queue group for this entity, see setRenderQueueGroup for full details. More... | |
Protected Attributes | |
SceneNode * | mParentNode |
node to which this object is attached. More... | |
bool | mVisible |
Is this object visible? More... | |
UserDefinedObject * | mUserObject |
User defined object which is linked to this object. More... | |
RenderQueueGroupID | mRenderQueueID |
The render queue to use when rendering this object. More... | |
Private Attributes | |
String | mName |
LightTypes | mLightType |
Vector3 | mPosition |
ColourValue | mDiffuse |
ColourValue | mSpecular |
Vector3 | mDirection |
Real | mSpotOuter |
Real | mSpotInner |
Real | mSpotFalloff |
Real | mRange |
Real | mAttenuationConst |
Real | mAttenuationLinear |
Real | mAttenuationQuad |
bool | mModified |
Vector3 | mDerivedPosition |
Vector3 | mDerivedDirection |
Quaternion | mLastParentOrientation |
Stored versions of parent orientation / position. More... | |
Vector3 | mLastParentPosition |
Static Private Attributes | |
String | msMovableType = "Light" |
Shared class-level name for Movable type. More... |
The defaults when a light is created is pure white diffues light, with linear attenuation (decreases steadily with distance) and a range of 1000 world units.
Lights are created by using the SceneManager::createLight method. They can subsequently be added to a SceneNode if required to allow them to move relative to a node in the scene. A light attached to a SceneNode is assumed to havea base position of (0,0,0) and a direction of (0,0,1) before modification by the SceneNode's own orientation. If not attached to a SceneNode, the light's position and direction is as set using setPosition and setDirection.
Remember also that dynamic lights rely on modifying the colour of vertices based on the position of the light compared to an object's vertex normals. Dynamic lighting will only look good if the object being lit has a fair level of tesselation and the normals are properly set. This is particularly true for the spotlight which will only look right on highly tesselated models. In the future OGRE may be extended for certain scene types so an alternative to the standard dynamic lighting may be used, such as dynamic lightmaps.
|
|
Default constructor (for Python mainly).
|
|
Normal constructor. Should not be called directly, but rather the SceneManager::createLight method should be used. |
|
Standard destructor.
|
|
Clears the light's modified flag (should only be done by the engine itself).
|
|
Internal method called to notify the object that it has been attached to a node.
Reimplemented in Ogre::SimpleRenderable. |
|
Overridden from MovableObject.
Implements Ogre::MovableObject. |
|
Overridden from MovableObject.
Implements Ogre::MovableObject. |
|
Returns the constant factor in the attenuation formula.
|
|
Returns the linear factor in the attenuation formula.
|
|
Returns the quadric factor in the attenuation formula.
|
|
Returns the absolute upper range of the light.
|
|
Overridden from MovableObject.
Implements Ogre::MovableObject. |
|
Retrieves the direction of the light including any transform from nodes it is attached to.
|
|
Retrieves the position of the light including any transform from nodes it is attached to.
|
|
Returns the colour of the diffuse light given off by this light source (see setDiffuseColour for more info).
|
|
Returns the light's direction.
|
|
Overridden from MovableObject.
Implements Ogre::MovableObject. |
|
Returns the name of this light (cannot be modified).
Implements Ogre::MovableObject. |
|
Returns the node to which this object is attached.
Reimplemented in Ogre::SimpleRenderable. |
|
Returns the position of the light.
|
|
Gets the queue group for this entity, see setRenderQueueGroup for full details.
|
|
Returns the colour of specular light given off by this light source.
|
|
Returns the falloff between the inner and outer cones of the spotlight.
|
|
Returns the angle covered by the spotlights inner cone, in degrees.
|
|
Returns the angle covered by the spotlights outer cone, in degrees.
|
|
Returns the light type.
|
|
Retrieves a pointer to a custom application object associated with this movable by an earlier call to setUserObject.
|
|
Returns true if this object is attached to a SceneNode.
|
|
Returns a true/false value indicating if this light has changed since it was last issued to the renderer.
|
|
Returns whether or not this object is supposed to be visible or not.
|
|
Sets the attenuation parameters of the light source ie how it diminishes with distance.
|
|
Sets the colour of the diffuse light given off by this source.
|
|
Sets the colour of the diffuse light given off by this source.
|
|
Sets the direction in which a light points.
|
|
Sets the direction in which a light points.
|
|
Sets the position of the light.
|
|
Sets the position of the light.
|
|
Sets the render queue group this entity will be rendered through.
|
|
Sets the colour of the specular light given off by this source.
|
|
Sets the colour of the specular light given off by this source.
|
|
Sets the range of a spotlight, i.e. the angle of the inner and outer cones and the rate of falloff between them.
|
|
Sets the type of light - see LightTypes for more info.
|
|
Call this to associate your own custom user object instance with this MovableObject.
|
|
Overridden from MovableObject.
Reimplemented from Ogre::MovableObject. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Stored versions of parent orientation / position.
|
|
|
|
|
|
|
|
|
|
node to which this object is attached.
|
|
|
|
|
|
The render queue to use when rendering this object.
|
|
Shared class-level name for Movable type.
|
|
|
|
|
|
|
|
|
|
User defined object which is linked to this object.
|
|
Is this object visible?
|
Copyright © 2002 by The OGRE Team