OGRE-Next
2.3
Object-Oriented Graphics Rendering Engine
|
Representation of a dynamic light source in the scene. More...
#include <OgreLight.h>
Public Types | |
enum | LightTypes { LT_DIRECTIONAL = 0 , LT_POINT = 1 , LT_SPOTLIGHT = 2 , LT_VPL = 3 , MAX_FORWARD_PLUS_LIGHTS = 4 , LT_AREA_APPROX = 4 , LT_AREA_LTC = 5 , NUM_LIGHT_TYPES } |
Defines the type of light. More... | |
typedef FastArray< MovableObject * > | MovableObjectArray |
@See SceneManager::cullFrustum More... | |
enum | Reason { Unknown , FromStorageToSysRam , FromSysRamToStorage , GainedResidency , LostResidency , PoolTextureSlotChanged , ResidentToSysRamSync , MetadataCacheOutOfDate , ExceptionThrown , FsaaSettingAlteredByApi , ReadyForRendering , Deleted } |
Public Member Functions | |
Light (IdType id, ObjectMemoryManager *objectMemoryManager, SceneManager *manager) | |
Normal constructor. More... | |
~Light () | |
Standard destructor. More... | |
void | _calcTempSquareDist (const Vector3 &worldPos) |
Internal method for calculating current squared distance from some world position. More... | |
Real | _deriveShadowFarClipDistance (const Camera *maincam) const |
Derive a shadow camera far distance from either the light, or from the main camera if the light doesn't have its own setting. More... | |
Real | _deriveShadowNearClipDistance (const Camera *maincam) const |
Derive a shadow camera near distance from either the light, or from the main camera if the light doesn't have its own setting. More... | |
LightList * | _getLightList () |
Returns a pointer to the current list of lights for this object. More... | |
SceneManager * | _getManager () const |
Get the manager of this object, if any (internal use only) More... | |
ObjectData & | _getObjectData () |
Returns a direct access to the ObjectData state. More... | |
bool | _getOwnShadowFarDistance () const |
const Matrix4 & | _getParentNodeFullTransform () const |
Returns the full transformation of the parent sceneNode or the attachingPoint node. More... | |
virtual void | _notifyAttached (Node *parent) |
Internal method called to notify the object that it has been attached to a node. More... | |
void | _notifyManager (SceneManager *man) |
Notify the object of it's manager (internal use only) More... | |
virtual void | _notifyParentNodeMemoryChanged () |
@See Node::_callMemoryChangeListeners More... | |
virtual void | _notifyStaticDirty () const |
Called by SceneManager when it is telling we're a static MovableObject being dirty Don't call this directly. More... | |
virtual void | _releaseManualHardwareResources () |
Notifies the movable object that hardware resources were lost. More... | |
virtual void | _restoreManualHardwareResources () |
Notifies the movable object that hardware resources should be restored. More... | |
void | _setLightProfileIdx (uint16 profileIdx) |
virtual void | _updateCustomGpuParameter (uint16 paramIndex, const GpuProgramParameters_AutoConstantEntry &constantEntry, GpuProgramParameters *params) const |
Update a custom GpuProgramParameters constant which is derived from information only this Light knows. More... | |
void | _updateRenderQueue (RenderQueue *queue, Camera *camera, const Camera *lodCamera) override |
Internal method by which the movable object must add Renderable subclass instances to the rendering queue. More... | |
void | addQueryFlags (uint32 flags) |
As setQueryFlags, except the flags passed as parameters are appended to the existing flags on this object. More... | |
void | addVisibilityFlags (uint32 flags) |
As setVisibilityFlags, except the flags passed as parameters are appended to the existing flags on this object. More... | |
AnimableValuePtr | createAnimableValue (const String &valueName) override |
Create a reference-counted AnimableValuePtr for the named value. More... | |
void | detachFromParent () |
Detaches an object from a parent SceneNode if attached. More... | |
bool | getAffectParentNode () const |
const StringVector & | getAnimableValueNames () const |
Gets a list of animable value names for this object. More... | |
Vector4 | getAs4DVector () const |
Real | getAttenuationConstant () const |
Returns the constant factor in the attenuation formula. More... | |
Real | getAttenuationLinear () const |
Returns the linear factor in the attenuation formula. More... | |
Real | getAttenuationQuadric () const |
Returns the quadric factor in the attenuation formula. More... | |
Real | getAttenuationRange () const |
Returns the absolute upper range of the light. More... | |
RealAsUint | getCachedDistanceToCamera () const |
Returns the distance to camera as calculated in @cullFrustum. More... | |
Real | getCachedDistanceToCameraAsReal () const |
Returns the distance to camera as calculated in @cullFrustum. More... | |
bool | getCastShadows () const |
Returns whether shadow casting is enabled for this object. More... | |
unsigned char | getCurrentMeshLod () const |
const Vector4 & | getCustomParameter (uint16 index) const |
Gets the custom value associated with this Light at the given index. More... | |
const Vector4 * | getCustomParameterNoThrow (uint16 index) const |
Vector3 | getDerivedDirection () const |
Retrieves the direction of the light including any transform from nodes it is attached to. More... | |
Vector3 | getDerivedDirectionUpdated () const |
Vector2 | getDerivedRectSize () const |
const ColourValue & | getDiffuseColour () const |
Returns the colour of the diffuse light given off by this light source (see setDiffuseColour for more info). More... | |
Vector3 | getDirection () const |
Returns the light's direction. More... | |
bool | getDoubleSided () const |
IdType | getId () const |
Get the unique id of this object. More... | |
uint32 | getLightMask () const |
Get a bitwise mask which will filter the lights affecting this object. More... | |
uint16 | getLightProfileIdx () const |
Listener * | getListener () const |
Gets the current listener for this object. More... | |
Aabb | getLocalAabb () const |
Retrieves the local axis-aligned bounding box for this object. More... | |
float | getLocalRadius () const |
See getLocalAabb and getWorldRadius. More... | |
const String & | getMovableType () const override |
Returns the type name of this object. More... | |
const String & | getName () const |
Returns the name of this object. More... | |
Node * | getParentNode () const |
Returns the node to which this object is attached. More... | |
SceneNode * | getParentSceneNode () const |
Real | getPowerScale () const |
Set the scaling factor which indicates the relative power of a light. More... | |
uint32 | getQueryFlags () const |
Returns the query flags relevant for this object. More... | |
const Vector2 & | getRectSize () const |
Real | getRenderingDistance () const |
Gets the distance at which batches are no longer rendered. More... | |
Real | getRenderingMinPixelSize () const |
Returns the minimum pixel size an object needs to be in both screen axes in order to be rendered. More... | |
uint8 | getRenderQueueGroup () const |
Gets the queue group for this entity, see setRenderQueueGroup for full details. More... | |
Real | getShadowFarClipDistance () const |
Get the far clip plane distance to be used by the shadow camera, if this light casts texture shadows. More... | |
Real | getShadowFarDistance () const |
Gets the maximum distance away from the camera that shadows by this light will be visible. More... | |
Real | getShadowFarDistanceSquared () const |
Real | getShadowNearClipDistance () const |
Get the near clip plane distance to be used by the shadow camera, if this light casts texture shadows. More... | |
Real | getShadowRenderingDistance () const |
Gets the distance at which batches are no longer casting shadows. More... | |
SkeletonInstance * | getSkeletonInstance () const |
const ColourValue & | getSpecularColour () const |
Returns the colour of specular light given off by this light source. More... | |
Real | getSpotlightFalloff () const |
Returns the falloff between the inner and outer cones of the spotlight. More... | |
const Radian & | getSpotlightInnerAngle () const |
Returns the angle covered by the spotlights inner cone. More... | |
Real | getSpotlightNearClipDistance () const |
Get the near clip plane distance to be used by spotlights that use light clipping. More... | |
const Radian & | getSpotlightOuterAngle () const |
Returns the angle covered by the spotlights outer cone. More... | |
Real | getSpotlightTanHalfAngle () const |
TextureGpu * | getTexture () const |
LightTypes | getType () const |
Returns the light type. More... | |
uint32 | getTypeFlags () const |
Override to return specific type flag. More... | |
UserObjectBindings & | getUserObjectBindings () |
Return an instance of user objects binding associated with this class. More... | |
const UserObjectBindings & | getUserObjectBindings () const |
Return an instance of user objects binding associated with this class. More... | |
uint32 | getVisibilityFlags () const |
Returns the visibility flags relevant for this object. More... | |
bool | getVisible () const |
Gets this object whether to be visible or not, if it has a renderable component. More... | |
Aabb | getWorldAabb () const |
Gets the axis aligned box in world space. More... | |
Aabb | getWorldAabbUpdated () |
Gets the axis aligned box in world space. More... | |
float | getWorldRadius () const |
Gets the bounding Radius scaled by max( scale.x, scale.y, scale.z ). More... | |
float | getWorldRadiusUpdated () |
Gets the bounding Radius scaled by max( scale.x, scale.y, scale.z ). More... | |
virtual void | instanceBatchCullFrustumThreaded (const Frustum *frustum, const Camera *lodCamera, uint32 combinedVisibilityFlags) |
@See InstancingTheadedCullingMethod, More... | |
bool | isAttached () const |
Returns true if this object is attached to a Node. More... | |
bool | isInLightRange (const Ogre::AxisAlignedBox &container) const |
Check whether a bounding box is included in the lighted area of the light. More... | |
bool | isInLightRange (const Ogre::Sphere &sphere) const |
Check whether a sphere is included in the lighted area of the light. More... | |
bool | isStatic () const |
Checks whether this MovableObject is static. @See setStatic. More... | |
bool | isVisible () const |
Returns whether or not this object is supposed to be visible or not. More... | |
void | notifyTextureChanged (TextureGpu *texture, TextureGpuListener::Reason reason, void *extraData) override |
Called when a TextureGpu changed in a way that affects how it is displayed: More... | |
void | operator delete (void *ptr) |
void | operator delete (void *ptr, const char *, int, const char *) |
void | operator delete (void *ptr, void *) |
void | operator delete[] (void *ptr) |
void | operator delete[] (void *ptr, const char *, int, const char *) |
void * | operator new (size_t sz) |
void * | operator new (size_t sz, const char *file, int line, const char *func) |
operator new, with debug line info More... | |
void * | operator new (size_t sz, void *ptr) |
placement operator new More... | |
void * | operator new[] (size_t sz) |
void * | operator new[] (size_t sz, const char *file, int line, const char *func) |
array operator new, with debug line info More... | |
bool | operator() (const IdObject &left, const IdObject &right) |
bool | operator() (const IdObject *left, const IdObject *right) |
const LightList & | queryLights () const |
Gets a list of lights, ordered relative to how close they are to this movable object. More... | |
void | removeQueryFlags (uint32 flags) |
As setQueryFlags, except the flags passed as parameters are removed from the existing flags on this object. More... | |
void | removeVisibilityFlags (uint32 flags) |
As setVisibilityFlags, except the flags passed as parameters are removed from the existing flags on this object. More... | |
void | resetShadowFarDistance () |
Tells the light to use the shadow far distance of the SceneManager. More... | |
void | setAffectParentNode (bool bAffect) |
A Light must always have a Node attached to it. More... | |
void | setAttenuation (Real range, Real constant, Real linear, Real quadratic) |
Sets the attenuation parameters of the light source i.e. More... | |
void | setAttenuationBasedOnRadius (Real radius, Real lumThreshold) |
Sets the attenuation parameters (range, constant, linear & quadratic,. More... | |
void | setCastShadows (bool enabled) |
Sets whether or not this object will cast shadows. More... | |
void | setCustomParameter (uint16 index, const Vector4 &value) |
Sets a custom parameter for this Light, which may be used to drive calculations for this specific Renderable, like GPU program parameters. More... | |
void | setDiffuseColour (const ColourValue &colour) |
Sets the colour of the diffuse light given off by this source. More... | |
void | setDiffuseColour (Real red, Real green, Real blue) |
Sets the colour of the diffuse light given off by this source. More... | |
void | setDirection (const Vector3 &vec) |
Sets the direction in which a light points. More... | |
void | setDoubleSided (bool bDoubleSided) |
For area lights and custom 2d shapes, specifies whether the light lits in both directions (positive & negative sides of the plane) or if only towards one. More... | |
void | setLightMask (uint32 lightMask) |
Set a bitwise mask which will filter the lights affecting this object. More... | |
void | setListener (Listener *listener) |
Sets a listener for this object. More... | |
void | setLocalAabb (const Aabb box) |
Sets the local axis-aligned bounding box for this object. More... | |
void | setName (const String &name) |
Sets a custom name for this node. More... | |
void | setPowerScale (Real power) |
Set a scaling factor to indicate the relative power of a light. More... | |
void | setQueryFlags (uint32 flags) |
Sets the query flags for this object. More... | |
void | setRectSize (Vector2 rectSize) |
For custom 2D shape and area lights, sets the dimensions of the rectangle, in half size. More... | |
void | setRenderingDistance (Real dist) |
Sets the distance at which the object is no longer rendered. More... | |
void | setRenderingMinPixelSize (Real pixelSize) |
Sets the minimum pixel size an object needs to be in both screen axes in order to be rendered. More... | |
void | setRenderQueueGroup (uint8 queueID) override |
Overload to avoid it. Light::setType uses the RenderQueue ID to classify lights per type. More... | |
void | setShadowFarClipDistance (Real farClip) |
Set the far clip plane distance to be used by the shadow camera, if this light casts texture shadows. More... | |
void | setShadowFarDistance (Real distance) |
Sets the maximum distance away from the camera that shadows by this light will be visible. More... | |
void | setShadowNearClipDistance (Real nearClip) |
Set the near clip plane distance to be used by the shadow camera, if this light casts texture shadows. More... | |
void | setShadowRenderingDistance (Real dist) |
Sets the distance at which the object is no longer casting shadows. More... | |
void | setSpecularColour (const ColourValue &colour) |
Sets the colour of the specular light given off by this source. More... | |
void | setSpecularColour (Real red, Real green, Real blue) |
Sets the colour of the specular light given off by this source. More... | |
void | setSpotlightFalloff (Real val) |
Sets the falloff between the inner and outer cones of the spotlight. More... | |
void | setSpotlightInnerAngle (const Radian &val) |
Sets the angle covered by the spotlights inner cone. More... | |
void | setSpotlightNearClipDistance (Real nearClip) |
Set the near clip plane distance to be used by spotlights that use light clipping, allowing you to render spots as if they start from further down their frustum. More... | |
void | setSpotlightOuterAngle (const Radian &val) |
Sets the angle covered by the spotlights outer cone. More... | |
void | setSpotlightRange (const Radian &innerAngle, const Radian &outerAngle, Real falloff=1.0) |
Sets the range of a spotlight, i.e. More... | |
bool | setStatic (bool bStatic) |
Turns this Node into static or dynamic. More... | |
void | setTexture (TextureGpu *texture) |
Sets a textured for types of light that support it. More... | |
void | setTextureRaw (TextureGpu *texture, uint32 sliceIdx) |
void | setType (LightTypes type) |
Sets the type of light - see LightTypes for more info. More... | |
void | setVisibilityFlags (uint32 flags) |
Sets the visibility flags for this object. More... | |
void | setVisible (bool visible) |
Tells this object whether to be visible or not, if it has a renderable component. More... | |
virtual bool | shouldStayLoaded (TextureGpu *texture) |
Return true if this TextureGpu should likely stay loaded or else graphical changes could occur. More... | |
Static Public Member Functions | |
static void | buildLightList (const size_t numNodes, ObjectData t, const LightListInfo &globalLightList) |
@See SceneManager::buildLightList More... | |
static ArrayReal | calculateCameraDistance (uint32 _cameraSortMode, const ArrayVector3 &cameraPos, const ArrayVector3 &cameraDir, ArrayAabb *RESTRICT_ALIAS worldAabb, ArrayReal *RESTRICT_ALIAS worldRadius) |
static void | calculateCastersBox (const size_t numNodes, ObjectData t, uint32 sceneVisibilityFlags, AxisAlignedBox *outBox) |
static void | cullFrustum (const size_t numNodes, ObjectData t, const Camera *frustum, uint32 sceneVisibilityFlags, MovableObjectArray &outCulledObjects, const Camera *lodCamera) |
static void | cullLights (const size_t numNodes, ObjectData t, uint32 sceneLightMask, LightListInfo &outGlobalLightList, const FrustumVec &frustums, const FrustumVec &cubemapFrustums) |
@See SceneManager::cullLights & More... | |
static uint32 | getDefaultLightMask () |
Get the default light mask for all future MovableObject instances. More... | |
static uint32 | getDefaultQueryFlags () |
Get the default query flags for all future MovableObject instances. More... | |
static uint32 | getDefaultVisibilityFlags () |
Get the default visibility flags for all future MovableObject instances. More... | |
static void | setDefaultLightMask (uint32 mask) |
Set the default light mask for all future MovableObject instances. More... | |
static void | setDefaultQueryFlags (uint32 flags) |
Set the default query flags for all future MovableObject instances. More... | |
static void | setDefaultVisibilityFlags (uint32 flags) |
Set the default visibility flags for all future MovableObject instances. More... | |
static void | updateAllBounds (const size_t numNodes, ObjectData t) |
@See SceneManager::updateAllBounds More... | |
Public Attributes | |
size_t | mGlobalIndex |
Index in the vector holding this MO reference (could be our parent node, or a global array tracking all movable objecst to avoid memory leaks). More... | |
size_t | mParentIndex |
Index in the vector holding this MO reference (could be our parent node, or a global array tracking all movable objecst to avoid memory leaks). More... | |
RenderableArray | mRenderables |
uint16 | mTexLightMaskDiffuseMipStart |
Control the start of mip level for diffuse component for area lights The value is UNORM, thus the range [0; 65535] maps to [0; 1] where 1.0 means to use the highest mip level, and 0 the lowest mip. More... | |
uint16 | mTextureLightMaskIdx |
Real | tempSquareDist |
Temp tag used for sorting. More... | |
Static Public Attributes | |
static const FastArray< Real > | c_DefaultLodMesh |
Representation of a dynamic light source in the scene.
|
inherited |
@See SceneManager::cullFrustum
frustum | Frustum to clip against |
sceneVisibilityFlags | Combined scene's visibility flags (i.e. viewport | scene). Set LAYER_SHADOW_CASTER bit if you want to exclude non-shadow casters. |
outCulledObjects | Out. List of objects that are (fully or partially) inside the frustum and should be rendered |
lodCamera | Camera in which lod levels calculations are based (i.e. during shadow pass renders) Note however, we only use this camera to calulate if should be visible according to mUpperDistance |
Defines the type of light.
|
inherited |
Enumerator | |
---|---|
Unknown | |
FromStorageToSysRam | OnStorage -> OnSystemRam. |
FromSysRamToStorage | OnSystemRam -> OnStorage. |
GainedResidency | OnStorage -> Resident OnSystemRam -> Resident See ReadyForRendering. |
LostResidency | Resident -> OnStorage Resident -> OnSystemRam. |
PoolTextureSlotChanged | |
ResidentToSysRamSync | Only called while TextureGpu is still Resident, and strategy is AlwaysKeepSystemRamCopy. This listener happens when something was done to the TextureGpu that modifies its contents in the GPU, and were thus forced to sync those values back to SystemRam. This listener calls tells that sync is over. |
MetadataCacheOutOfDate | The Metadata cache was out of date and we had to do a ping-pong. Expect this to be followed by at least LostResidency and GainedResidency calls This is very important, because if you were expecting certain sequence of calls (e.g. you were expecting a LostResidency soon to arrive), expect that to be changed. See TextureGpuManager for details about the metadata cache. |
ExceptionThrown | Called when the worker thread caught an exception. This exception has already been logged, and the texture resumed loading normally with a white 2x2 RGBA8 fallback. This listener will get called from the main thread. The texture may still have pending residency transitions (e.g. it may still be loading the 2x2 fallback) Cast Exception e = reinterpret_cast<Exception>( extraData ); to know more info |
FsaaSettingAlteredByApi | Requested FSAA (MSAA / CSAA / EQAA / etc) is not supported by the API, and thus the setting had to be downgraded. Note this may happen on device lost, and a new GPU became in use; thus it's possible for a TextureGpu to initially support certain FSAA but later change. |
ReadyForRendering | This Reason is called when TextureGpu::notifyDataIsReady is called. This normally means worker thread is done loading texture from file and uploading it to GPU; and can now be used for rendering. It does NOT mean that Ogre has finished issueing rendering commands to a RenderTexture and is now ready to be presented to the monitor. |
Deleted |
Ogre::Light::Light | ( | IdType | id, |
ObjectMemoryManager * | objectMemoryManager, | ||
SceneManager * | manager | ||
) |
Normal constructor.
Should not be called directly, but rather the SceneManager::createLight method should be used.
Ogre::Light::~Light | ( | ) |
Standard destructor.
void Ogre::Light::_calcTempSquareDist | ( | const Vector3 & | worldPos | ) |
Internal method for calculating current squared distance from some world position.
Derive a shadow camera far distance from either the light, or from the main camera if the light doesn't have its own setting.
Derive a shadow camera near distance from either the light, or from the main camera if the light doesn't have its own setting.
|
inlineinherited |
Returns a pointer to the current list of lights for this object.
|
inlineinherited |
Get the manager of this object, if any (internal use only)
|
inlineinherited |
Returns a direct access to the ObjectData state.
bool Ogre::Light::_getOwnShadowFarDistance | ( | ) | const |
|
inherited |
Returns the full transformation of the parent sceneNode or the attachingPoint node.
|
virtualinherited |
Internal method called to notify the object that it has been attached to a node.
Reimplemented in Ogre::ParticleSystem, and Ogre::v1::Entity.
|
inlineinherited |
Notify the object of it's manager (internal use only)
|
inlinevirtualinherited |
@See Node::_callMemoryChangeListeners
Reimplemented in Ogre::Item.
|
inlinevirtualinherited |
Called by SceneManager when it is telling we're a static MovableObject being dirty Don't call this directly.
|
inlinevirtualinherited |
Notifies the movable object that hardware resources were lost.
Reimplemented in Ogre::v1::Rectangle2D, Ogre::ManualObject, Ogre::v1::ManualObject, and Ogre::v1::BillboardSet.
|
inlinevirtualinherited |
Notifies the movable object that hardware resources should be restored.
Reimplemented in Ogre::v1::Rectangle2D.
|
inline |
|
virtual |
Update a custom GpuProgramParameters constant which is derived from information only this Light knows.
paramIndex | The index of the constant being updated |
constantEntry | The auto constant entry from the program parameters |
params | The parameters object which this method should call to set the updated parameters. |
|
inlineoverridevirtual |
Internal method by which the movable object must add Renderable subclass instances to the rendering queue.
Reimplemented from Ogre::MovableObject.
|
inlineinherited |
As setQueryFlags, except the flags passed as parameters are appended to the existing flags on this object.
|
inlineinherited |
As setVisibilityFlags, except the flags passed as parameters are appended to the existing flags on this object.
|
staticinherited |
@See SceneManager::buildLightList
globalLightList | List of lights already culled against all possible frustums and reorganized contiguously for SoA |
|
inlinestaticinherited |
|
staticinherited |
|
overridevirtual |
Create a reference-counted AnimableValuePtr for the named value.
Reimplemented from Ogre::AnimableObject.
|
staticinherited |
|
staticinherited |
@See SceneManager::cullLights &
outGlobalLightList | Output, a list of lights, contiguously placed |
frustums | An array of all frustums we need to check against |
cubemapFrustums | An array of all frustums that are used at least once as cubemaps (@See SceneManager::createCamera) |
|
inherited |
Detaches an object from a parent SceneNode if attached.
|
inline |
|
inlineinherited |
Gets a list of animable value names for this object.
References Ogre::Exception::ERR_ITEM_NOT_FOUND, and OGRE_EXCEPT.
Vector4 Ogre::Light::getAs4DVector | ( | ) | const |
|
inline |
Returns the constant factor in the attenuation formula.
|
inline |
Returns the linear factor in the attenuation formula.
|
inline |
Returns the quadric factor in the attenuation formula.
|
inline |
Returns the absolute upper range of the light.
|
inlineinherited |
Returns the distance to camera as calculated in @cullFrustum.
|
inlineinherited |
Returns the distance to camera as calculated in @cullFrustum.
|
inlineinherited |
Returns whether shadow casting is enabled for this object.
|
inlineinherited |
Gets the custom value associated with this Light at the given index.
index | Index of the parameter to retrieve |
|
inlinestaticinherited |
Get the default light mask for all future MovableObject instances.
|
inlinestaticinherited |
Get the default query flags for all future MovableObject instances.
|
inlinestaticinherited |
Get the default visibility flags for all future MovableObject instances.
Vector3 Ogre::Light::getDerivedDirection | ( | ) | const |
Retrieves the direction of the light including any transform from nodes it is attached to.
Vector3 Ogre::Light::getDerivedDirectionUpdated | ( | ) | const |
Vector2 Ogre::Light::getDerivedRectSize | ( | ) | const |
|
inline |
Returns the colour of the diffuse light given off by this light source (see setDiffuseColour for more info).
Vector3 Ogre::Light::getDirection | ( | ) | const |
Returns the light's direction.
|
inline |
|
inlineinherited |
Get the unique id of this object.
|
inlineinherited |
Get a bitwise mask which will filter the lights affecting this object.
|
inline |
|
inlineinherited |
Gets the current listener for this object.
|
inherited |
Retrieves the local axis-aligned bounding box for this object.
|
inherited |
See getLocalAabb and getWorldRadius.
|
overridevirtual |
Returns the type name of this object.
Implements Ogre::MovableObject.
|
inlineinherited |
Returns the name of this object.
|
inlineinherited |
Returns the node to which this object is attached.
|
inlineinherited |
|
inline |
Set the scaling factor which indicates the relative power of a light.
|
inlineinherited |
Returns the query flags relevant for this object.
|
inline |
|
inlineinherited |
Gets the distance at which batches are no longer rendered.
|
inlineinherited |
Returns the minimum pixel size an object needs to be in both screen axes in order to be rendered.
|
inlineinherited |
Gets the queue group for this entity, see setRenderQueueGroup for full details.
|
inline |
Get the far clip plane distance to be used by the shadow camera, if this light casts texture shadows.
Real Ogre::Light::getShadowFarDistance | ( | ) | const |
Gets the maximum distance away from the camera that shadows by this light will be visible.
Real Ogre::Light::getShadowFarDistanceSquared | ( | ) | const |
|
inline |
Get the near clip plane distance to be used by the shadow camera, if this light casts texture shadows.
|
inlineinherited |
Gets the distance at which batches are no longer casting shadows.
|
inlineinherited |
|
inline |
Returns the colour of specular light given off by this light source.
|
inline |
Returns the falloff between the inner and outer cones of the spotlight.
|
inline |
Returns the angle covered by the spotlights inner cone.
|
inline |
Get the near clip plane distance to be used by spotlights that use light clipping.
|
inline |
Returns the angle covered by the spotlights outer cone.
|
inline |
|
inline |
|
inline |
Returns the light type.
uint32 Ogre::Light::getTypeFlags | ( | ) | const |
Override to return specific type flag.
|
inlineinherited |
Return an instance of user objects binding associated with this class.
You can use it to associate one or more custom objects with this class instance.
|
inlineinherited |
Return an instance of user objects binding associated with this class.
You can use it to associate one or more custom objects with this class instance.
|
inlineinherited |
Returns the visibility flags relevant for this object.
Reserved visibility flags are not returned.
|
inlineinherited |
Gets this object whether to be visible or not, if it has a renderable component.
|
inherited |
Gets the axis aligned box in world space.
|
inherited |
Gets the axis aligned box in world space.
|
inherited |
Gets the bounding Radius scaled by max( scale.x, scale.y, scale.z ).
|
inherited |
Gets the bounding Radius scaled by max( scale.x, scale.y, scale.z ).
|
inlinevirtualinherited |
@See InstancingTheadedCullingMethod,
|
inlineinherited |
Returns true if this object is attached to a Node.
bool Ogre::Light::isInLightRange | ( | const Ogre::AxisAlignedBox & | container | ) | const |
Check whether a bounding box is included in the lighted area of the light.
bool Ogre::Light::isInLightRange | ( | const Ogre::Sphere & | sphere | ) | const |
Check whether a sphere is included in the lighted area of the light.
|
inherited |
Checks whether this MovableObject is static. @See setStatic.
|
inherited |
Returns whether or not this object is supposed to be visible or not.
|
overridevirtual |
Called when a TextureGpu changed in a way that affects how it is displayed:
Implements Ogre::TextureGpuListener.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
operator new, with debug line info
|
inlineinherited |
placement operator new
|
inlineinherited |
|
inlineinherited |
array operator new, with debug line info
|
inlineinherited |
Gets a list of lights, ordered relative to how close they are to this movable object.
|
inlineinherited |
As setQueryFlags, except the flags passed as parameters are removed from the existing flags on this object.
|
inlineinherited |
As setVisibilityFlags, except the flags passed as parameters are removed from the existing flags on this object.
void Ogre::Light::resetShadowFarDistance | ( | ) |
Tells the light to use the shadow far distance of the SceneManager.
void Ogre::Light::setAffectParentNode | ( | bool | bAffect | ) |
A Light must always have a Node attached to it.
The direction is taken from the node's orientation, and thus setDirection modifies the attached node directly.
bAffect | When true, the scene node is affected and modified by changes to range and falloff. |
Sets the attenuation parameters of the light source i.e.
how it diminishes with distance.
range | The absolute upper range of the light in world units. |
constant | The constant factor in the attenuation formula: 1.0 means never attenuate, 0.0 is complete attenuation. |
linear | The linear factor in the attenuation formula: 1 means attenuate evenly over the distance. |
quadratic | The quadratic factor in the attenuation formula: adds a curvature to the attenuation formula. |
Sets the attenuation parameters (range, constant, linear & quadratic,.
(distance / radius)² * 0.5 + 0.5
The original formula never ends, that is the range is infinity. This function calculates a range based on "lumThreshold": When the luminosity past certain distance is below the established threshold, the light calculations are cut.
radius | The radius of the light. i.e. A light bulb is a couple centimeters, the sun is ~696km; but be sure to be consistent in the unit of measurement you use (i.e. don't use km if your default unit is in meters). Note: Having a radius = 2 means that at distance = 2 the pixel is lit 100% Anything inside that radius (which is supposedly impossible) will have more than 100% light power. |
lumThreshold | Value in the range [0; 1) Sets range at which the luminance (in percentage) of a point would go below the threshold. For example lumThreshold = 0 means the attenuation range is infinity; lumThreshold = 1 means the range is set to 0. |
|
inlineinherited |
Sets whether or not this object will cast shadows.
Sets a custom parameter for this Light, which may be used to drive calculations for this specific Renderable, like GPU program parameters.
index | The index with which to associate the value. Note that this does not have to start at 0, and can include gaps. It also has no direct correlation with a GPU program parameter index - the mapping between the two is performed by the ACT_LIGHT_CUSTOM entry, if that is used. |
value | The value to associate. |
|
inlinestaticinherited |
Set the default light mask for all future MovableObject instances.
|
inlinestaticinherited |
Set the default query flags for all future MovableObject instances.
|
inlinestaticinherited |
Set the default visibility flags for all future MovableObject instances.
|
inline |
Sets the colour of the diffuse light given off by this source.
Sets the colour of the diffuse light given off by this source.
void Ogre::Light::setDirection | ( | const Vector3 & | vec | ) |
Sets the direction in which a light points.
void Ogre::Light::setDoubleSided | ( | bool | bDoubleSided | ) |
For area lights and custom 2d shapes, specifies whether the light lits in both directions (positive & negative sides of the plane) or if only towards one.
bDoubleSided | True to enable. Default: false. |
|
inlineinherited |
Set a bitwise mask which will filter the lights affecting this object.
|
inlineinherited |
Sets a listener for this object.
|
inherited |
Sets the local axis-aligned bounding box for this object.
|
inlineinherited |
Sets a custom name for this node.
Doesn't have to be unique
void Ogre::Light::setPowerScale | ( | Real | power | ) |
Set a scaling factor to indicate the relative power of a light.
power | The power rating of this light, default is 1.0. |
|
inlineinherited |
Sets the query flags for this object.
void Ogre::Light::setRectSize | ( | Vector2 | rectSize | ) |
For custom 2D shape and area lights, sets the dimensions of the rectangle, in half size.
halfSize |
|
inlineinherited |
Sets the distance at which the object is no longer rendered.
dist | Distance beyond which the object will not be rendered (the default is FLT_MAX, which means objects are always rendered). Values equal or below zero will be ignored, and cause an assertion in debug mode. |
|
inlineinherited |
Sets the minimum pixel size an object needs to be in both screen axes in order to be rendered.
pixelSize | Number of minimum pixels (the default is 0, which means objects are always rendered). |
|
overridevirtual |
Overload to avoid it. Light::setType uses the RenderQueue ID to classify lights per type.
Reimplemented from Ogre::MovableObject.
|
inline |
Set the far clip plane distance to be used by the shadow camera, if this light casts texture shadows.
farClip | The distance, or -1 to use the main camera setting. |
void Ogre::Light::setShadowFarDistance | ( | Real | distance | ) |
Sets the maximum distance away from the camera that shadows by this light will be visible.
|
inline |
Set the near clip plane distance to be used by the shadow camera, if this light casts texture shadows.
nearClip | The distance, or -1 to use the main camera setting. |
|
inlineinherited |
Sets the distance at which the object is no longer casting shadows.
dist | Distance beyond which the object will not cast shadows (the default is FLT_MAX, which means objects are always casting shadows). Values equal or below zero will be ignored, and cause an assertion in debug mode. |
|
inline |
Sets the colour of the specular light given off by this source.
Sets the colour of the specular light given off by this source.
|
inline |
Sets the falloff between the inner and outer cones of the spotlight.
void Ogre::Light::setSpotlightInnerAngle | ( | const Radian & | val | ) |
Sets the angle covered by the spotlights inner cone.
|
inline |
Set the near clip plane distance to be used by spotlights that use light clipping, allowing you to render spots as if they start from further down their frustum.
nearClip | The near distance. |
void Ogre::Light::setSpotlightOuterAngle | ( | const Radian & | val | ) |
Sets the angle covered by the spotlights outer cone.
void Ogre::Light::setSpotlightRange | ( | const Radian & | innerAngle, |
const Radian & | outerAngle, | ||
Real | falloff = 1.0 |
||
) |
Sets the range of a spotlight, i.e.
the angle of the inner and outer cones and the rate of falloff between them.
innerAngle | Angle covered by the bright inner cone |
outerAngle | Angle covered by the outer cone |
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. |
|
inherited |
Turns this Node into static or dynamic.
void Ogre::Light::setTexture | ( | TextureGpu * | texture | ) |
Sets a textured for types of light that support it.
At the time of writing only LT_AREA_APPROX supports it.
texture | Texture. Can be monochrome or coloured. For Raw version must be a 2D Array texture. For non-Raw version, must be a 2D texture. |
sliceIdx | Slice to the texture. |
void Ogre::Light::setTextureRaw | ( | TextureGpu * | texture, |
uint32 | sliceIdx | ||
) |
void Ogre::Light::setType | ( | LightTypes | type | ) |
Sets the type of light - see LightTypes for more info.
|
inlineinherited |
Sets the visibility flags for this object.
|
inlineinherited |
Tells this object whether to be visible or not, if it has a renderable component.
|
inlinevirtualinherited |
Return true if this TextureGpu should likely stay loaded or else graphical changes could occur.
Return false if it is certainly safe to unload.
Reimplemented in Ogre::VctLighting, and Ogre::OGRE_HLMS_TEXTURE_BASE_CLASS.
|
staticinherited |
@See SceneManager::updateAllBounds
|
inherited |
Index in the vector holding this MO reference (could be our parent node, or a global array tracking all movable objecst to avoid memory leaks).
Used for O(1) removals.
|
inherited |
Index in the vector holding this MO reference (could be our parent node, or a global array tracking all movable objecst to avoid memory leaks).
Used for O(1) removals.
|
inherited |
uint16 Ogre::Light::mTexLightMaskDiffuseMipStart |
Control the start of mip level for diffuse component for area lights The value is UNORM, thus the range [0; 65535] maps to [0; 1] where 1.0 means to use the highest mip level, and 0 the lowest mip.
uint16 Ogre::Light::mTextureLightMaskIdx |
Real Ogre::Light::tempSquareDist |
Temp tag used for sorting.