Representation of a dynamic light source in the scene.
- Remember that simply creating a light and adding it to a scene does not make a scene brighter; the SceneManager must choose to interpret it. Use the SceneManager::setAmbientLight method to set the overall ambient light level. Use the Light methods to configure your individual lights.
Definition at line 22 of file AngelOgre_Light.h.
|
| void | setType (LightTypes type) |
| |
| LightTypes | getType () const |
| |
| void | setDiffuseColour (float r, float g, float b) |
| |
| void | setDiffuseColour (const color &color) |
| |
| const color & | getDiffuseColour () const |
| |
| void | setSpecularColour (float r, float g, float b) |
| |
| void | setSpecularColour (const color &color) |
| |
| const color & | getSpecularColour () const |
| |
| void | setAttenuation (float range, float constant, float linear, float quadratic) |
| |
| float | getAttenuationRange () const |
| |
| float | getAttenuationConstant () const |
| |
| float | getAttenuationLinear () const |
| |
| float | getAttenuationQuadric () const |
| |
| void | setPosition (float x, float y, float z) |
| |
| void | setPosition (const vector3 &pos) |
| |
| const vector3 & | getPosition () const |
| |
| void | setDirection (float x, float y, float z) |
| |
| void | setDirection (const vector3 &direction) |
| |
| const vector3 & | getDirection () const |
| |
| void | setSpotlightRange (const radian &innerAngle, const radian &outerAngle, float falloff=1.0f) |
| |
| const radian & | getSpotlightInnerAngle () const |
| |
| const radian & | getSpotlightOuterAngle () const |
| |
| float | getSpotlightFalloff () const |
| |
| void | setPowerScale (float power) |
| |
| float | getPowerScale () const |
| |
| void | setCastShadows (bool enabled) |
| |
| bool | getCastShadows () const |
| |
| const vector3 & | getDerivedPosition () const |
| |
| const vector3 & | getDerivedDirection () const |
| |
| const string & | getName () const |
| |
| const string & | getMovableType () const |
| |
| Node | getParentNode () const |
| |
| SceneNode | getParentSceneNode () const |
| |
| bool | isAttached () const |
| |
| void | detachFromParent () |
| |
| bool | isInScene () const |
| |
| float | getBoundingRadius () const |
| |
| void | setVisible (bool visible) |
| |
| bool | getVisible () const |
| |
| bool | isVisible () const |
| |
| void | setRenderingDistance (float dist) |
| |
| float | getRenderingDistance () const |
| |
| void | setRenderingMinPixelSize (float pixelSize) |
| |
| float | getRenderingMinPixelSize () const |
| |
◆ detachFromParent()
| void AngelOgre::Light::detachFromParent |
( |
| ) |
|
Detaches an object from a parent SceneNode or TagPoint, if attached.
◆ getAttenuationConstant()
| float AngelOgre::Light::getAttenuationConstant |
( |
| ) |
const |
Returns the constant factor in the attenuation formula.
◆ getAttenuationLinear()
| float AngelOgre::Light::getAttenuationLinear |
( |
| ) |
const |
Returns the linear factor in the attenuation formula.
◆ getAttenuationQuadric()
| float AngelOgre::Light::getAttenuationQuadric |
( |
| ) |
const |
Returns the quadric factor in the attenuation formula.
◆ getAttenuationRange()
| float AngelOgre::Light::getAttenuationRange |
( |
| ) |
const |
Returns the absolute upper range of the light.
◆ getBoundingRadius()
| float AngelOgre::Light::getBoundingRadius |
( |
| ) |
const |
Retrieves the radius of the origin-centered bounding sphere for this object.
◆ getCastShadows()
| bool AngelOgre::Light::getCastShadows |
( |
| ) |
const |
Returns whether or not this light casts shadows.
◆ getDerivedDirection()
| const vector3 & AngelOgre::Light::getDerivedDirection |
( |
| ) |
const |
Gets the direction of the light including any transform from nodes it is attached to.
◆ getDerivedPosition()
| const vector3 & AngelOgre::Light::getDerivedPosition |
( |
| ) |
const |
Gets the position of the light including any transform from nodes it is attached to.
◆ getDiffuseColour()
| const color & AngelOgre::Light::getDiffuseColour |
( |
| ) |
const |
Returns the color of the diffuse light given off by this light source (see setDiffuseColour for more info).
◆ getDirection()
| const vector3 & AngelOgre::Light::getDirection |
( |
| ) |
const |
Returns the light's direction.
- Note
- Applicable to directional and spotlights only.
◆ getMovableType()
| const string & AngelOgre::Light::getMovableType |
( |
| ) |
const |
Returns the type name of this object.
◆ getName()
| const string & AngelOgre::Light::getName |
( |
| ) |
const |
Returns the name of this object.
◆ getParentNode()
| Node AngelOgre::Light::getParentNode |
( |
| ) |
const |
Returns the node to which this object is attached.
◆ getParentSceneNode()
| SceneNode AngelOgre::Light::getParentSceneNode |
( |
| ) |
const |
Returns the scene node to which this object is attached.
◆ getPosition()
| const vector3 & AngelOgre::Light::getPosition |
( |
| ) |
const |
Returns the position of the light.
- Note
- Applicable to point lights and spotlights only.
◆ getPowerScale()
| float AngelOgre::Light::getPowerScale |
( |
| ) |
const |
Returns the scaling factor which indicates the relative power of a light.
◆ getRenderingDistance()
| float AngelOgre::Light::getRenderingDistance |
( |
| ) |
const |
Gets the distance at which batches are no longer rendered.
◆ getRenderingMinPixelSize()
| float AngelOgre::Light::getRenderingMinPixelSize |
( |
| ) |
const |
Returns the minimum pixel size an object needs to be in both screen axes in order to be rendered.
◆ getSpecularColour()
| const color & AngelOgre::Light::getSpecularColour |
( |
| ) |
const |
Returns the color of specular light given off by this light source.
◆ getSpotlightFalloff()
| float AngelOgre::Light::getSpotlightFalloff |
( |
| ) |
const |
Returns the falloff between the inner and outer cones of the spotlight.
◆ getSpotlightInnerAngle()
| const radian & AngelOgre::Light::getSpotlightInnerAngle |
( |
| ) |
const |
Returns the angle covered by the spotlights inner cone.
◆ getSpotlightOuterAngle()
| const radian & AngelOgre::Light::getSpotlightOuterAngle |
( |
| ) |
const |
Returns the angle covered by the spotlights outer cone.
◆ getType()
◆ getVisible()
| bool AngelOgre::Light::getVisible |
( |
| ) |
const |
Gets this object whether to be visible or not, if it has a renderable component.
◆ isAttached()
| bool AngelOgre::Light::isAttached |
( |
| ) |
const |
Returns true if this object is attached to a SceneNode or TagPoint.
◆ isInScene()
| bool AngelOgre::Light::isInScene |
( |
| ) |
const |
Returns true if this object is attached to a SceneNode or TagPoint, and this SceneNode / TagPoint is currently in an active part of the scene graph.
◆ isVisible()
| bool AngelOgre::Light::isVisible |
( |
| ) |
const |
Returns whether or not this object is supposed to be visible or not.
◆ setAttenuation()
| void AngelOgre::Light::setAttenuation |
( |
float |
range, |
|
|
float |
constant, |
|
|
float |
linear, |
|
|
float |
quadratic |
|
) |
| |
Sets the attenuation parameters for this light source.
- Parameters
-
| range | The absolute upper range of the light in world units. If set to 0, light is attenuated to zero by the quadratic factor. In this case, the light will be visible up to infinity. |
| constant | Constant factor, 1.0 means never attenuate, 0.0 is complete attenuation. |
| linear | The linear factor, 1 means attenuate evenly over the distance. |
| quadratic | The quadratic factor, adds a curvature to the attenuation formula. |
◆ setCastShadows()
| void AngelOgre::Light::setCastShadows |
( |
bool |
enabled | ) |
|
Sets whether or not this light should cast shadows.
- Note
- For Light objects, this method refers to whether the light causes shadows itself.
◆ setDiffuseColour() [1/2]
| void AngelOgre::Light::setDiffuseColour |
( |
const color & |
color | ) |
|
Sets the color of the diffuse light given off by this source.
- Parameters
-
◆ setDiffuseColour() [2/2]
| void AngelOgre::Light::setDiffuseColour |
( |
float |
r, |
|
|
float |
g, |
|
|
float |
b |
|
) |
| |
Sets the color of the diffuse light given off by this source.
- Parameters
-
| r | Red component (0.0 to 1.0) |
| g | Green component (0.0 to 1.0) |
| b | Blue component (0.0 to 1.0) |
◆ setDirection() [1/2]
| void AngelOgre::Light::setDirection |
( |
const vector3 & |
direction | ) |
|
Sets the direction in which a light points.
- Parameters
-
| direction | Vector with direction |
◆ setDirection() [2/2]
| void AngelOgre::Light::setDirection |
( |
float |
x, |
|
|
float |
y, |
|
|
float |
z |
|
) |
| |
Sets the direction in which a light points.
- Parameters
-
| x | X component |
| y | Y component |
| z | Z component |
◆ setPosition() [1/2]
| void AngelOgre::Light::setPosition |
( |
const vector3 & |
pos | ) |
|
Sets the position of the light.
- Parameters
-
| pos | Vector with the position |
◆ setPosition() [2/2]
| void AngelOgre::Light::setPosition |
( |
float |
x, |
|
|
float |
y, |
|
|
float |
z |
|
) |
| |
Sets the position of the light.
- Parameters
-
| x | X coordinate |
| y | Y coordinate |
| z | Z coordinate |
◆ setPowerScale()
| void AngelOgre::Light::setPowerScale |
( |
float |
power | ) |
|
Set a scaling factor to indicate the relative power of a light.
- Parameters
-
| power | The power rating of this light, default is 1.0. |
◆ setRenderingDistance()
| void AngelOgre::Light::setRenderingDistance |
( |
float |
dist | ) |
|
Sets the distance at which the object is no longer rendered.
- Parameters
-
| dist | Distance beyond which the object will not be rendered. |
◆ setRenderingMinPixelSize()
| void AngelOgre::Light::setRenderingMinPixelSize |
( |
float |
pixelSize | ) |
|
Sets the minimum pixel size an object needs to be in both screen axes in order to be rendered.
- Parameters
-
| pixelSize | Number of minimum pixels. |
◆ setSpecularColour() [1/2]
| void AngelOgre::Light::setSpecularColour |
( |
const color & |
color | ) |
|
Sets the color of the specular light given off by this source.
- Parameters
-
◆ setSpecularColour() [2/2]
| void AngelOgre::Light::setSpecularColour |
( |
float |
r, |
|
|
float |
g, |
|
|
float |
b |
|
) |
| |
Sets the color of the specular light given off by this source.
- Parameters
-
| r | Red component (0.0 to 1.0) |
| g | Green component (0.0 to 1.0) |
| b | Blue component (0.0 to 1.0) |
◆ setSpotlightRange()
| void AngelOgre::Light::setSpotlightRange |
( |
const radian & |
innerAngle, |
|
|
const radian & |
outerAngle, |
|
|
float |
falloff = 1.0f |
|
) |
| |
Sets the range of a spotlight, i.e.
the angle of the inner and outer cones and the rate of falloff between them.
- Parameters
-
| innerAngle | Angle covered by the bright inner cone. The inner cone is at maximum brightness. |
| outerAngle | Angle covered by the outer cone. The light attenuates from the inner cone to the outer cone. Outside the outer cone the light has zero intensity. |
| falloff | The rate of falloff between the inner and outer cones. 1.0 means a linear falloff, less means slower falloff, higher means faster falloff. Applicable to spotlights only. |
◆ setType()
Sets the type of light - see LightTypes for more info.
◆ setVisible()
| void AngelOgre::Light::setVisible |
( |
bool |
visible | ) |
|
Tells this object whether to be visible or not, if it has a renderable component.
The documentation for this class was generated from the following file: