OGRE-Next  2.3
Object-Oriented Graphics Rendering Engine
Ogre::PCZLight Class Reference

Specialized version of Ogre::Light which caches which zones the light affects. More...

#include <OgrePCZLight.h>

+ Inheritance diagram for Ogre::PCZLight:

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

 PCZLight ()
 Default constructor (for Python mainly). More...
 
 PCZLight (const String &name)
 Normal constructor. More...
 
 ~PCZLight ()
 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 (void) 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 (void) const
 
const Matrix4_getParentNodeFullTransform (void) 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 _notifyMoved (void)
 MovableObject notified when SceneNode changes. More...
 
virtual void _notifyParentNodeMemoryChanged (void)
 @See Node::_callMemoryChangeListeners More...
 
virtual void _notifyStaticDirty (void) 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...
 
virtual void _updateRenderQueue (RenderQueue *queue, Camera *camera, const Camera *lodCamera)
 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...
 
void addZoneToAffectedZonesList (PCZone *zone)
 Manually add a zone to the zones affected list. More...
 
bool affectsVisibleZone (void)
 
bool affectsZone (PCZone *zone)
 Check if a zone is in the list of zones affected by the light. More...
 
void clearAffectedZones (void)
 Clear the affectedZonesList. More...
 
void clearNeedsUpdate (void)
 Clear update flag. More...
 
AnimableValuePtr createAnimableValue (const String &valueName)
 Create a reference-counted AnimableValuePtr for the named value. More...
 
void detachFromParent (void)
 Detaches an object from a parent SceneNode if attached. More...
 
bool getAffectParentNode (void) const
 
const StringVectorgetAnimableValueNames (void) const
 Gets a list of animable value names for this object. More...
 
Vector4 getAs4DVector (void) const
 
Real getAttenuationConstant (void) const
 Returns the constant factor in the attenuation formula. More...
 
Real getAttenuationLinear (void) const
 Returns the linear factor in the attenuation formula. More...
 
Real getAttenuationQuadric (void) const
 Returns the quadric factor in the attenuation formula. More...
 
Real getAttenuationRange (void) const
 Returns the absolute upper range of the light. More...
 
RealAsUint getCachedDistanceToCamera (void) const
 Returns the distance to camera as calculated in @cullFrustum. More...
 
Real getCachedDistanceToCameraAsReal (void) const
 Returns the distance to camera as calculated in @cullFrustum. More...
 
bool getCastShadows (void) const
 Returns whether shadow casting is enabled for this object. More...
 
unsigned char getCurrentMeshLod (void) const
 
const Vector4getCustomParameter (uint16 index) const
 Gets the custom value associated with this Light at the given index. More...
 
const Vector4getCustomParameterNoThrow (uint16 index) const
 
Vector3 getDerivedDirection (void) const
 Retrieves the direction of the light including any transform from nodes it is attached to. More...
 
Vector3 getDerivedDirectionUpdated (void) const
 
Vector2 getDerivedRectSize (void) const
 
const ColourValuegetDiffuseColour (void) const
 Returns the colour of the diffuse light given off by this light source (see setDiffuseColour for more info). More...
 
Vector3 getDirection (void) const
 Returns the light's direction. More...
 
bool getDoubleSided (void) 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 (void) const
 
ListenergetListener (void) const
 Gets the current listener for this object. More...
 
Aabb getLocalAabb (void) const
 Retrieves the local axis-aligned bounding box for this object. More...
 
float getLocalRadius (void) const
 See getLocalAabb and getWorldRadius. More...
 
const StringgetMovableType (void) const
 Overridden from MovableObject. More...
 
const StringgetName (void) const
 Returns the name of this object. More...
 
bool getNeedsUpdate (void)
 Get status of need for update. this checks all affected zones. More...
 
NodegetParentNode (void) const
 Returns the node to which this object is attached. More...
 
SceneNodegetParentSceneNode (void) const
 
Real getPowerScale (void) const
 Set the scaling factor which indicates the relative power of a light. More...
 
uint32 getQueryFlags (void) const
 Returns the query flags relevant for this object. More...
 
const Vector2getRectSize (void) const
 
Real getRenderingDistance (void) 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 (void) 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 (void) const
 Gets the maximum distance away from the camera that shadows by this light will be visible. More...
 
Real getShadowFarDistanceSquared (void) 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 (void) const
 Gets the distance at which batches are no longer casting shadows. More...
 
SkeletonInstancegetSkeletonInstance (void) const
 
const ColourValuegetSpecularColour (void) const
 Returns the colour of specular light given off by this light source. More...
 
Real getSpotlightFalloff (void) const
 Returns the falloff between the inner and outer cones of the spotlight. More...
 
const RadiangetSpotlightInnerAngle (void) 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 RadiangetSpotlightOuterAngle (void) const
 Returns the angle covered by the spotlights outer cone. More...
 
Real getSpotlightTanHalfAngle (void) const
 
TextureGpugetTexture (void) const
 
LightTypes getType (void) const
 Returns the light type. More...
 
uint32 getTypeFlags (void) const
 Override to return specific type flag. More...
 
UserObjectBindingsgetUserObjectBindings ()
 Return an instance of user objects binding associated with this class. More...
 
const UserObjectBindingsgetUserObjectBindings () const
 Return an instance of user objects binding associated with this class. More...
 
uint32 getVisibilityFlags (void) const
 Returns the visibility flags relevant for this object. More...
 
bool getVisible (void) 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 (void) 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 (void) const
 Returns whether or not this object is supposed to be visible or not. More...
 
virtual void notifyTextureChanged (TextureGpu *texture, TextureGpuListener::Reason reason, void *extraData)
 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 LightListqueryLights (void) 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 removeZoneFromAffectedZonesList (PCZone *zone)
 Manually remove a zone from the affected list. More...
 
void resetShadowFarDistance (void)
 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 setAffectsVisibleZone (bool affects)
 Marks a light as affecting a visible zone. 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...
 
virtual void setRenderQueueGroup (uint8 queueID)
 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...
 
void updateZones (PCZone *defaultZone, unsigned long frameCount)
 Update the list of zones the light affects. 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< Realc_DefaultLodMesh
 

Detailed Description

Specialized version of Ogre::Light which caches which zones the light affects.

Member Typedef Documentation

◆ MovableObjectArray

@See SceneManager::cullFrustum

Remarks
We don't pass by reference on purpose (avoid implicit aliasing) We perform frustum culling AND test visibility mask at the same time
Parameters
frustumFrustum to clip against
sceneVisibilityFlagsCombined scene's visibility flags (i.e. viewport | scene). Set LAYER_SHADOW_CASTER bit if you want to exclude non-shadow casters.
outCulledObjectsOut. List of objects that are (fully or partially) inside the frustum and should be rendered
lodCameraCamera 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

Member Enumeration Documentation

◆ LightTypes

enum Ogre::Light::LightTypes
inherited

Defines the type of light.

Enumerator
LT_DIRECTIONAL 

Directional lights simulate parallel light beams from a distant source, hence have direction but no position.

LT_POINT 

Point light sources give off light equally in all directions, so require only position not direction.

LT_SPOTLIGHT 

Spotlights simulate a cone of light from a source so require position and direction, plus extra values for falloff.

LT_VPL 

Virtual point lights, used for Instant Radiosity (Global Illumination fake / approximation)

MAX_FORWARD_PLUS_LIGHTS 
LT_AREA_APPROX 

Non-PBR version of Area lights.

Not an accurate approximation, but they're flexible, useful & cheap. They aren't physically correct at all.

LT_AREA_LTC 

PBR version of Area lights using Linearly Transformed Cosines as researched by Eric Heitz, Jonathan Dupuy, Stephen Hill and David Neubelt.

It's slower than LT_AREA_APPROX, and does not currently support textures. However it's physically accurate.

NUM_LIGHT_TYPES 

◆ Reason

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 

Constructor & Destructor Documentation

◆ PCZLight() [1/2]

Ogre::PCZLight::PCZLight ( )

Default constructor (for Python mainly).

◆ PCZLight() [2/2]

Ogre::PCZLight::PCZLight ( const String name)

Normal constructor.

Should not be called directly, but rather the SceneManager::createLight method should be used.

◆ ~PCZLight()

Ogre::PCZLight::~PCZLight ( )

Standard destructor.

Member Function Documentation

◆ _calcTempSquareDist()

void Ogre::Light::_calcTempSquareDist ( const Vector3 worldPos)
inherited

Internal method for calculating current squared distance from some world position.

◆ _deriveShadowFarClipDistance()

Real Ogre::Light::_deriveShadowFarClipDistance ( const Camera maincam) const
inherited

Derive a shadow camera far distance from either the light, or from the main camera if the light doesn't have its own setting.

◆ _deriveShadowNearClipDistance()

Real Ogre::Light::_deriveShadowNearClipDistance ( const Camera maincam) const
inherited

Derive a shadow camera near distance from either the light, or from the main camera if the light doesn't have its own setting.

◆ _getLightList()

LightList* Ogre::MovableObject::_getLightList ( )
inlineinherited

Returns a pointer to the current list of lights for this object.

Remarks
You should not modify this list outside of MovableObject::Listener::objectQueryLights (say if you want to use it to implement this method, and use the pointer as a return value) and for reading it's only accurate as at the last frame.

◆ _getManager()

SceneManager* Ogre::MovableObject::_getManager ( void  ) const
inlineinherited

Get the manager of this object, if any (internal use only)

◆ _getObjectData()

ObjectData& Ogre::MovableObject::_getObjectData ( )
inlineinherited

Returns a direct access to the ObjectData state.

◆ _getOwnShadowFarDistance()

bool Ogre::Light::_getOwnShadowFarDistance ( void  ) const
inherited

◆ _getParentNodeFullTransform()

const Matrix4& Ogre::MovableObject::_getParentNodeFullTransform ( void  ) const
inherited

Returns the full transformation of the parent sceneNode or the attachingPoint node.

◆ _notifyAttached()

virtual void Ogre::MovableObject::_notifyAttached ( Node parent)
virtualinherited

Internal method called to notify the object that it has been attached to a node.

Reimplemented in Ogre::ParticleSystem, and Ogre::v1::Entity.

Referenced by Ogre::PortalBase::_notifyAttached().

◆ _notifyManager()

void Ogre::MovableObject::_notifyManager ( SceneManager man)
inlineinherited

Notify the object of it's manager (internal use only)

◆ _notifyMoved()

virtual void Ogre::PCZLight::_notifyMoved ( void  )
virtual

MovableObject notified when SceneNode changes.

◆ _notifyParentNodeMemoryChanged()

virtual void Ogre::MovableObject::_notifyParentNodeMemoryChanged ( void  )
inlinevirtualinherited

◆ _notifyStaticDirty()

virtual void Ogre::MovableObject::_notifyStaticDirty ( void  ) const
inlinevirtualinherited

Called by SceneManager when it is telling we're a static MovableObject being dirty Don't call this directly.

See also
SceneManager::notifyStaticDirty

◆ _releaseManualHardwareResources()

virtual void Ogre::MovableObject::_releaseManualHardwareResources ( )
inlinevirtualinherited

Notifies the movable object that hardware resources were lost.

Remarks
Called automatically by RenderSystem if hardware resources were lost and can not be restored using some internal mechanism. Among affected resources are nested shadow renderables, ManualObjects, etc.

Reimplemented in Ogre::v1::Rectangle2D, Ogre::ManualObject, Ogre::v1::ManualObject, and Ogre::v1::BillboardSet.

◆ _restoreManualHardwareResources()

virtual void Ogre::MovableObject::_restoreManualHardwareResources ( )
inlinevirtualinherited

Notifies the movable object that hardware resources should be restored.

Remarks
Called automatically by RenderSystem if hardware resources were lost and can not be restored using some internal mechanism. Among affected resources are nested shadow renderables, ManualObjects, etc.

Reimplemented in Ogre::v1::Rectangle2D.

◆ _setLightProfileIdx()

void Ogre::Light::_setLightProfileIdx ( uint16  profileIdx)
inlineinherited

◆ _updateCustomGpuParameter()

virtual void Ogre::Light::_updateCustomGpuParameter ( uint16  paramIndex,
const GpuProgramParameters_AutoConstantEntry constantEntry,
GpuProgramParameters params 
) const
virtualinherited

Update a custom GpuProgramParameters constant which is derived from information only this Light knows.

Remarks
This method allows a Light to map in a custom GPU program parameter based on it's own data. This is represented by a GPU auto parameter of ACT_LIGHT_CUSTOM, and to allow there to be more than one of these per Light, the 'data' field on the auto parameter will identify which parameter is being updated and on which light. The implementation of this method must identify the parameter being updated, and call a 'setConstant' method on the passed in GpuProgramParameters object.
You do not need to override this method if you're using the standard sets of data associated with the Renderable as provided by setCustomParameter and getCustomParameter. By default, the implementation will map from the value indexed by the 'constantEntry.data' parameter to a value previously set by setCustomParameter. But custom Renderables are free to override this if they want, in any case.
Parameters
paramIndexThe index of the constant being updated
constantEntryThe auto constant entry from the program parameters
paramsThe parameters object which this method should call to set the updated parameters.

◆ _updateRenderQueue()

virtual void Ogre::Light::_updateRenderQueue ( RenderQueue queue,
Camera camera,
const Camera lodCamera 
)
inlinevirtualinherited

Internal method by which the movable object must add Renderable subclass instances to the rendering queue.

Remarks
The engine will call this method when this object is to be rendered. The object must then create one or more Renderable subclass instances which it places on the passed in Queue for rendering.

Reimplemented from Ogre::MovableObject.

◆ addQueryFlags()

void Ogre::MovableObject::addQueryFlags ( uint32  flags)
inlineinherited

As setQueryFlags, except the flags passed as parameters are appended to the existing flags on this object.

◆ addVisibilityFlags()

void Ogre::MovableObject::addVisibilityFlags ( uint32  flags)
inlineinherited

As setVisibilityFlags, except the flags passed as parameters are appended to the existing flags on this object.

◆ addZoneToAffectedZonesList()

void Ogre::PCZLight::addZoneToAffectedZonesList ( PCZone zone)

Manually add a zone to the zones affected list.

◆ affectsVisibleZone()

bool Ogre::PCZLight::affectsVisibleZone ( void  )
inline
Returns
Flag indicating if the light affects a zone which is visible in the current frame

◆ affectsZone()

bool Ogre::PCZLight::affectsZone ( PCZone zone)

Check if a zone is in the list of zones affected by the light.

◆ buildLightList()

static void Ogre::MovableObject::buildLightList ( const size_t  numNodes,
ObjectData  t,
const LightListInfo globalLightList 
)
staticinherited

@See SceneManager::buildLightList

Remarks
We don't pass by reference on purpose (avoid implicit aliasing)
Parameters
globalLightListList of lights already culled against all possible frustums and reorganized contiguously for SoA

◆ calculateCameraDistance()

static ArrayReal Ogre::MovableObject::calculateCameraDistance ( uint32  _cameraSortMode,
const ArrayVector3 cameraPos,
const ArrayVector3 cameraDir,
ArrayAabb *RESTRICT_ALIAS  worldAabb,
ArrayReal *RESTRICT_ALIAS  worldRadius 
)
inlinestaticinherited

◆ calculateCastersBox()

static void Ogre::MovableObject::calculateCastersBox ( const size_t  numNodes,
ObjectData  t,
uint32  sceneVisibilityFlags,
AxisAlignedBox outBox 
)
staticinherited

◆ clearAffectedZones()

void Ogre::PCZLight::clearAffectedZones ( void  )

Clear the affectedZonesList.

◆ clearNeedsUpdate()

void Ogre::PCZLight::clearNeedsUpdate ( void  )
inline

Clear update flag.

◆ createAnimableValue()

AnimableValuePtr Ogre::Light::createAnimableValue ( const String valueName)
virtualinherited

Create a reference-counted AnimableValuePtr for the named value.

Remarks
You can use the returned object to animate a value on this object, using AnimationTrack. Subclasses must override this if they wish to support animation of their values.

Reimplemented from Ogre::AnimableObject.

◆ cullFrustum()

static void Ogre::MovableObject::cullFrustum ( const size_t  numNodes,
ObjectData  t,
const Camera frustum,
uint32  sceneVisibilityFlags,
MovableObjectArray outCulledObjects,
const Camera lodCamera 
)
staticinherited

◆ cullLights()

static void Ogre::MovableObject::cullLights ( const size_t  numNodes,
ObjectData  t,
uint32  sceneLightMask,
LightListInfo outGlobalLightList,
const FrustumVec frustums,
const FrustumVec cubemapFrustums 
)
staticinherited

@See SceneManager::cullLights &

See also
MovableObject::cullFrustum Produces the global list of visible lights that is needed in buildLightList
Remarks
We don't pass ObjectData by reference on purpose (avoid implicit aliasing) It's declared here because all affected elements are from MovableObject IMPORTANT: It is assumed that all objects in ObjectData are Lights.
Parameters
outGlobalLightListOutput, a list of lights, contiguously placed
frustumsAn array of all frustums we need to check against
cubemapFrustumsAn array of all frustums that are used at least once as cubemaps (@See SceneManager::createCamera)

◆ detachFromParent()

void Ogre::MovableObject::detachFromParent ( void  )
inherited

Detaches an object from a parent SceneNode if attached.

◆ getAffectParentNode()

bool Ogre::Light::getAffectParentNode ( void  ) const
inlineinherited

◆ getAnimableValueNames()

const StringVector& Ogre::AnimableObject::getAnimableValueNames ( void  ) const
inlineinherited

Gets a list of animable value names for this object.

References Ogre::Exception::ERR_ITEM_NOT_FOUND, and OGRE_EXCEPT.

◆ getAs4DVector()

Vector4 Ogre::Light::getAs4DVector ( void  ) const
inherited

Remarks
Although lights themselves are not 'visible', setting a light to invisible means it no longer affects the scene. Gets the details of this light as a 4D vector.
Getting details of a light as a 4D vector can be useful for doing general calculations between different light types; for example the vector can represent both position lights (w=1.0f) and directional lights (w=0.0f) and be used in the same calculations.

◆ getAttenuationConstant()

Real Ogre::Light::getAttenuationConstant ( void  ) const
inlineinherited

Returns the constant factor in the attenuation formula.

◆ getAttenuationLinear()

Real Ogre::Light::getAttenuationLinear ( void  ) const
inlineinherited

Returns the linear factor in the attenuation formula.

◆ getAttenuationQuadric()

Real Ogre::Light::getAttenuationQuadric ( void  ) const
inlineinherited

Returns the quadric factor in the attenuation formula.

◆ getAttenuationRange()

Real Ogre::Light::getAttenuationRange ( void  ) const
inlineinherited

Returns the absolute upper range of the light.

◆ getCachedDistanceToCamera()

RealAsUint Ogre::MovableObject::getCachedDistanceToCamera ( void  ) const
inlineinherited

Returns the distance to camera as calculated in @cullFrustum.

◆ getCachedDistanceToCameraAsReal()

Real Ogre::MovableObject::getCachedDistanceToCameraAsReal ( void  ) const
inlineinherited

Returns the distance to camera as calculated in @cullFrustum.

◆ getCastShadows()

bool Ogre::MovableObject::getCastShadows ( void  ) const
inlineinherited

Returns whether shadow casting is enabled for this object.

◆ getCurrentMeshLod()

unsigned char Ogre::MovableObject::getCurrentMeshLod ( void  ) const
inlineinherited

◆ getCustomParameter()

const Vector4& Ogre::Light::getCustomParameter ( uint16  index) const
inherited

Gets the custom value associated with this Light at the given index.

Parameters
indexIndex of the parameter to retrieve
See also
setCustomParameter for full details.

◆ getCustomParameterNoThrow()

const Vector4* Ogre::Light::getCustomParameterNoThrow ( uint16  index) const
inherited

◆ getDefaultLightMask()

static uint32 Ogre::MovableObject::getDefaultLightMask ( )
inlinestaticinherited

Get the default light mask for all future MovableObject instances.

◆ getDefaultQueryFlags()

static uint32 Ogre::MovableObject::getDefaultQueryFlags ( )
inlinestaticinherited

Get the default query flags for all future MovableObject instances.

◆ getDefaultVisibilityFlags()

static uint32 Ogre::MovableObject::getDefaultVisibilityFlags ( )
inlinestaticinherited

Get the default visibility flags for all future MovableObject instances.

◆ getDerivedDirection()

Vector3 Ogre::Light::getDerivedDirection ( void  ) const
inherited

Retrieves the direction of the light including any transform from nodes it is attached to.

◆ getDerivedDirectionUpdated()

Vector3 Ogre::Light::getDerivedDirectionUpdated ( void  ) const
inherited

◆ getDerivedRectSize()

Vector2 Ogre::Light::getDerivedRectSize ( void  ) const
inherited

◆ getDiffuseColour()

const ColourValue& Ogre::Light::getDiffuseColour ( void  ) const
inlineinherited

Returns the colour of the diffuse light given off by this light source (see setDiffuseColour for more info).

◆ getDirection()

Vector3 Ogre::Light::getDirection ( void  ) const
inherited

Returns the light's direction.

Remarks
Applicable only to the spotlight and directional light types. Try to cache the value instead of calling it multiple times in the same scope

◆ getDoubleSided()

bool Ogre::Light::getDoubleSided ( void  ) const
inlineinherited

◆ getId()

IdType Ogre::IdObject::getId ( ) const
inlineinherited

Get the unique id of this object.

◆ getLightMask()

uint32 Ogre::MovableObject::getLightMask ( ) const
inlineinherited

Get a bitwise mask which will filter the lights affecting this object.

Remarks
By default, this mask is fully set meaning all lights will affect this object

◆ getLightProfileIdx()

uint16 Ogre::Light::getLightProfileIdx ( void  ) const
inlineinherited

◆ getListener()

Listener* Ogre::MovableObject::getListener ( void  ) const
inlineinherited

Gets the current listener for this object.

◆ getLocalAabb()

Aabb Ogre::MovableObject::getLocalAabb ( void  ) const
inherited

Retrieves the local axis-aligned bounding box for this object.

Remarks
This bounding box is in local coordinates.

◆ getLocalRadius()

float Ogre::MovableObject::getLocalRadius ( void  ) const
inherited

See getLocalAabb and getWorldRadius.

◆ getMovableType()

const String& Ogre::PCZLight::getMovableType ( void  ) const
virtual

Overridden from MovableObject.

Reimplemented from Ogre::Light.

◆ getName()

const String& Ogre::MovableObject::getName ( void  ) const
inlineinherited

Returns the name of this object.

◆ getNeedsUpdate()

bool Ogre::PCZLight::getNeedsUpdate ( void  )

Get status of need for update. this checks all affected zones.

◆ getParentNode()

Node* Ogre::MovableObject::getParentNode ( void  ) const
inlineinherited

Returns the node to which this object is attached.

◆ getParentSceneNode()

SceneNode* Ogre::MovableObject::getParentSceneNode ( void  ) const
inlineinherited

◆ getPowerScale()

Real Ogre::Light::getPowerScale ( void  ) const
inlineinherited

Set the scaling factor which indicates the relative power of a light.

◆ getQueryFlags()

uint32 Ogre::MovableObject::getQueryFlags ( void  ) const
inlineinherited

Returns the query flags relevant for this object.

◆ getRectSize()

const Vector2& Ogre::Light::getRectSize ( void  ) const
inlineinherited

◆ getRenderingDistance()

Real Ogre::MovableObject::getRenderingDistance ( void  ) const
inlineinherited

Gets the distance at which batches are no longer rendered.

◆ getRenderingMinPixelSize()

Real Ogre::MovableObject::getRenderingMinPixelSize ( ) const
inlineinherited

Returns the minimum pixel size an object needs to be in both screen axes in order to be rendered.

◆ getRenderQueueGroup()

uint8 Ogre::MovableObject::getRenderQueueGroup ( void  ) const
inlineinherited

Gets the queue group for this entity, see setRenderQueueGroup for full details.

◆ getShadowFarClipDistance()

Real Ogre::Light::getShadowFarClipDistance ( ) const
inlineinherited

Get the far clip plane distance to be used by the shadow camera, if this light casts texture shadows.

Remarks
May be zero if the light doesn't have it's own far distance set; use _deriveShadowfarDistance for a version guaranteed to give a result.

◆ getShadowFarDistance()

Real Ogre::Light::getShadowFarDistance ( void  ) const
inherited

Gets the maximum distance away from the camera that shadows by this light will be visible.

◆ getShadowFarDistanceSquared()

Real Ogre::Light::getShadowFarDistanceSquared ( void  ) const
inherited

◆ getShadowNearClipDistance()

Real Ogre::Light::getShadowNearClipDistance ( ) const
inlineinherited

Get the near clip plane distance to be used by the shadow camera, if this light casts texture shadows.

Remarks
May be zero if the light doesn't have it's own near distance set; use _deriveShadowNearDistance for a version guaranteed to give a result.

◆ getShadowRenderingDistance()

Real Ogre::MovableObject::getShadowRenderingDistance ( void  ) const
inlineinherited

Gets the distance at which batches are no longer casting shadows.

◆ getSkeletonInstance()

SkeletonInstance* Ogre::MovableObject::getSkeletonInstance ( void  ) const
inlineinherited

◆ getSpecularColour()

const ColourValue& Ogre::Light::getSpecularColour ( void  ) const
inlineinherited

Returns the colour of specular light given off by this light source.

◆ getSpotlightFalloff()

Real Ogre::Light::getSpotlightFalloff ( void  ) const
inlineinherited

Returns the falloff between the inner and outer cones of the spotlight.

◆ getSpotlightInnerAngle()

const Radian& Ogre::Light::getSpotlightInnerAngle ( void  ) const
inlineinherited

Returns the angle covered by the spotlights inner cone.

◆ getSpotlightNearClipDistance()

Real Ogre::Light::getSpotlightNearClipDistance ( ) const
inlineinherited

Get the near clip plane distance to be used by spotlights that use light clipping.

◆ getSpotlightOuterAngle()

const Radian& Ogre::Light::getSpotlightOuterAngle ( void  ) const
inlineinherited

Returns the angle covered by the spotlights outer cone.

◆ getSpotlightTanHalfAngle()

Real Ogre::Light::getSpotlightTanHalfAngle ( void  ) const
inlineinherited

◆ getTexture()

TextureGpu* Ogre::Light::getTexture ( void  ) const
inlineinherited

◆ getType()

LightTypes Ogre::Light::getType ( void  ) const
inlineinherited

Returns the light type.

◆ getTypeFlags()

uint32 Ogre::Light::getTypeFlags ( void  ) const
inherited

Override to return specific type flag.

◆ getUserObjectBindings() [1/2]

UserObjectBindings& Ogre::MovableObject::getUserObjectBindings ( )
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.

See also
UserObjectBindings::setUserAny.

◆ getUserObjectBindings() [2/2]

const UserObjectBindings& Ogre::MovableObject::getUserObjectBindings ( ) const
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.

See also
UserObjectBindings::setUserAny.

◆ getVisibilityFlags()

uint32 Ogre::MovableObject::getVisibilityFlags ( void  ) const
inlineinherited

Returns the visibility flags relevant for this object.

Reserved visibility flags are not returned.

◆ getVisible()

bool Ogre::MovableObject::getVisible ( void  ) const
inlineinherited

Gets this object whether to be visible or not, if it has a renderable component.

Remarks
Returns the value set by MovableObject::setVisible only.

◆ getWorldAabb()

Aabb Ogre::MovableObject::getWorldAabb ( ) const
inherited

Gets the axis aligned box in world space.

Remarks
Assumes the caches are already updated. Will trigger an assert otherwise. @See getWorldAabbUpdated if you need the update process to be guaranteed

◆ getWorldAabbUpdated()

Aabb Ogre::MovableObject::getWorldAabbUpdated ( )
inherited

Gets the axis aligned box in world space.

Remarks
Unlike getWorldAabb, this function guarantees the cache stays up to date. It is STRONGLY advised against calling this function for a large number of MovableObject. Refactor your queries so that they happen after SceneManager::updateAllBounds() has been called

◆ getWorldRadius()

float Ogre::MovableObject::getWorldRadius ( ) const
inherited

Gets the bounding Radius scaled by max( scale.x, scale.y, scale.z ).

Remarks
Assumes the caches are already updated. Will trigger an assert otherwise. @See getWorldRadiusUpdated if you need the update process to be guaranteed

◆ getWorldRadiusUpdated()

float Ogre::MovableObject::getWorldRadiusUpdated ( )
inherited

Gets the bounding Radius scaled by max( scale.x, scale.y, scale.z ).

Remarks
Unlike getWorldRadius, this function guarantees the cache stays up to date. It is STRONGLY advised against calling this function for a large number of MovableObject. Refactor your queries so that they happen after SceneManager::updateAllBounds() has been called

◆ instanceBatchCullFrustumThreaded()

virtual void Ogre::MovableObject::instanceBatchCullFrustumThreaded ( const Frustum frustum,
const Camera lodCamera,
uint32  combinedVisibilityFlags 
)
inlinevirtualinherited

@See InstancingTheadedCullingMethod,

See also
InstanceBatch::instanceBatchCullFrustumThreaded

◆ isAttached()

bool Ogre::MovableObject::isAttached ( void  ) const
inlineinherited

Returns true if this object is attached to a Node.

◆ isInLightRange() [1/2]

bool Ogre::Light::isInLightRange ( const Ogre::AxisAlignedBox container) const
inherited

Check whether a bounding box is included in the lighted area of the light.

Note
The function trades accuracy for efficiency. As a result you may get false-positives (The function should not return any false-negatives).

◆ isInLightRange() [2/2]

bool Ogre::Light::isInLightRange ( const Ogre::Sphere sphere) const
inherited

Check whether a sphere is included in the lighted area of the light.

Note
The function trades accuracy for efficiency. As a result you may get false-positives (The function should not return any false-negatives).

◆ isStatic()

bool Ogre::MovableObject::isStatic ( ) const
inherited

Checks whether this MovableObject is static. @See setStatic.

◆ isVisible()

bool Ogre::MovableObject::isVisible ( void  ) const
inherited

Returns whether or not this object is supposed to be visible or not.

Remarks
Takes into account visibility flags and the setVisible, but not rendering distance.

◆ notifyTextureChanged()

virtual void Ogre::Light::notifyTextureChanged ( TextureGpu texture,
TextureGpuListener::Reason  reason,
void *  extraData 
)
virtualinherited

Called when a TextureGpu changed in a way that affects how it is displayed:

  1. TextureGpu::notifyDataIsReady got called (texture is ready to be displayed)
  2. Texture changed residency status.
  3. Texture is being deleted. It won't be a valid pointer after this call.

Implements Ogre::TextureGpuListener.

◆ operator delete() [1/3]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr)
inlineinherited

◆ operator delete() [2/3]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr,
const char *  ,
int  ,
const char *   
)
inlineinherited

◆ operator delete() [3/3]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr,
void *   
)
inlineinherited

◆ operator delete[]() [1/2]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void *  ptr)
inlineinherited

◆ operator delete[]() [2/2]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void *  ptr,
const char *  ,
int  ,
const char *   
)
inlineinherited

◆ operator new() [1/3]

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz)
inlineinherited

◆ operator new() [2/3]

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
const char *  file,
int  line,
const char *  func 
)
inlineinherited

operator new, with debug line info

◆ operator new() [3/3]

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
void *  ptr 
)
inlineinherited

placement operator new

◆ operator new[]() [1/2]

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz)
inlineinherited

◆ operator new[]() [2/2]

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz,
const char *  file,
int  line,
const char *  func 
)
inlineinherited

array operator new, with debug line info

◆ operator()() [1/2]

bool Ogre::IdObject::operator() ( const IdObject left,
const IdObject right 
)
inlineinherited

◆ operator()() [2/2]

bool Ogre::IdObject::operator() ( const IdObject left,
const IdObject right 
)
inlineinherited

◆ queryLights()

const LightList& Ogre::MovableObject::queryLights ( void  ) const
inlineinherited

Gets a list of lights, ordered relative to how close they are to this movable object.

Remarks
The lights are filled in
See also
buildLightList
Returns
The list of lights use to lighting this object.

◆ removeQueryFlags()

void Ogre::MovableObject::removeQueryFlags ( uint32  flags)
inlineinherited

As setQueryFlags, except the flags passed as parameters are removed from the existing flags on this object.

◆ removeVisibilityFlags()

void Ogre::MovableObject::removeVisibilityFlags ( uint32  flags)
inlineinherited

As setVisibilityFlags, except the flags passed as parameters are removed from the existing flags on this object.

◆ removeZoneFromAffectedZonesList()

void Ogre::PCZLight::removeZoneFromAffectedZonesList ( PCZone zone)

Manually remove a zone from the affected list.

◆ resetShadowFarDistance()

void Ogre::Light::resetShadowFarDistance ( void  )
inherited

Tells the light to use the shadow far distance of the SceneManager.

◆ setAffectParentNode()

void Ogre::Light::setAffectParentNode ( bool  bAffect)
inherited

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.

However, when changing the range and the spot falloff; the node is not affected. This is intentional in case you want to create (e.g.) a node for a flashlight, and attach both the flashlight entity and the light to the same node; thus controlling the node moves both the flashlight and its visual effect.
Despite this, there are cases where you want the changes to this light to be reflected in the parent node: The most common example are light volumes in deferred shading setups, and debug objects.
Remarks
This setting is only useful for non-directional lights. For point lights, the scale is calculated as setSize( range, range, range ) which means a light volume should be a sphere of radius = 1;
For spot lights, the scale is calc. as setSize( tan( outerAngle * 0.5 * range ), tan( outerAngle * 0.5 * range ), range ); which means a light volume should be a cone with Z = 1, and X & Y = 2
Parameters
bAffectWhen true, the scene node is affected and modified by changes to range and falloff.

◆ setAffectsVisibleZone()

void Ogre::PCZLight::setAffectsVisibleZone ( bool  affects)
inline

Marks a light as affecting a visible zone.

◆ setAttenuation()

void Ogre::Light::setAttenuation ( Real  range,
Real  constant,
Real  linear,
Real  quadratic 
)
inherited

Sets the attenuation parameters of the light source i.e.

how it diminishes with distance.

Remarks
Lights normally get fainter the further they are away. Also, each light is given a maximum range beyond which it cannot affect any objects.
Light attenuation is not applicable to directional lights since they have an infinite range and constant intensity.
This follows a standard attenuation approach - see any good 3D text for the details of what they mean since i don't have room here!
Parameters
rangeThe absolute upper range of the light in world units.
constantThe constant factor in the attenuation formula: 1.0 means never attenuate, 0.0 is complete attenuation.
linearThe linear factor in the attenuation formula: 1 means attenuate evenly over the distance.
quadraticThe quadratic factor in the attenuation formula: adds a curvature to the attenuation formula.

◆ setAttenuationBasedOnRadius()

void Ogre::Light::setAttenuationBasedOnRadius ( Real  radius,
Real  lumThreshold 
)
inherited

Sets the attenuation parameters (range, constant, linear & quadratic,.

See also
setAttenuation) based on a given radius.
Remarks
The actual attenuation formula is:

1

(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.

Parameters
radiusThe 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.
lumThresholdValue 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.
The value you want as threshold to use depends on your HDR pipeline and the power of the light. For example, with a power = 1 in LDR, a lumThreshold < 1 / 255 (roughly 0.00392) is pointless. Past that point the actual RGB value will always be (0, 0, 0). But for an LDR pipeline with a light power of 50, lumThreshold < 1 / (255 * 50) is pointless. For an HDR pipeline, the answer is more faint, as it depends on the threshold of your HDR tonemapping past which it stops adjusting the exposure.

◆ setCastShadows()

void Ogre::MovableObject::setCastShadows ( bool  enabled)
inlineinherited

Sets whether or not this object will cast shadows.

Remarks
This setting simply allows you to turn on/off shadows for a given object. An object will not cast shadows unless the scene supports it in any case (see SceneManager::setShadowTechnique), and also the material which is in use must also have shadow casting enabled. By default all entities cast shadows. If, however, for some reason you wish to disable this for a single object then you can do so using this method.
Note
This method normally refers to objects which block the light, but since Light is also a subclass of MovableObject, in that context it means whether the light causes shadows itself.

◆ setCustomParameter()

void Ogre::Light::setCustomParameter ( uint16  index,
const Vector4 value 
)
inherited

Sets a custom parameter for this Light, which may be used to drive calculations for this specific Renderable, like GPU program parameters.

Remarks
Calling this method simply associates a numeric index with a 4-dimensional value for this specific Light. This is most useful if the material which this Renderable uses a vertex or fragment program, and has an ACT_LIGHT_CUSTOM parameter entry. This parameter entry can refer to the index you specify as part of this call, thereby mapping a custom parameter for this renderable to a program parameter.
Parameters
indexThe 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.
valueThe value to associate.

◆ setDefaultLightMask()

static void Ogre::MovableObject::setDefaultLightMask ( uint32  mask)
inlinestaticinherited

Set the default light mask for all future MovableObject instances.

◆ setDefaultQueryFlags()

static void Ogre::MovableObject::setDefaultQueryFlags ( uint32  flags)
inlinestaticinherited

Set the default query flags for all future MovableObject instances.

◆ setDefaultVisibilityFlags()

static void Ogre::MovableObject::setDefaultVisibilityFlags ( uint32  flags)
inlinestaticinherited

Set the default visibility flags for all future MovableObject instances.

◆ setDiffuseColour() [1/2]

void Ogre::Light::setDiffuseColour ( const ColourValue colour)
inlineinherited

Sets the colour of the diffuse light given off by this source.

Remarks
Material objects have ambient, diffuse and specular values which indicate how much of each type of light an object reflects. This value denotes the amount and colour of this type of light the light exudes into the scene. The actual appearance of objects is a combination of the two.
Diffuse light simulates the typical light emanating from light sources and affects the base colour of objects together with ambient light.

◆ setDiffuseColour() [2/2]

void Ogre::Light::setDiffuseColour ( Real  red,
Real  green,
Real  blue 
)
inlineinherited

Sets the colour of the diffuse light given off by this source.

Remarks
Material objects have ambient, diffuse and specular values which indicate how much of each type of light an object reflects. This value denotes the amount and colour of this type of light the light exudes into the scene. The actual appearance of objects is a combination of the two.
Diffuse light simulates the typical light emanating from light sources and affects the base colour of objects together with ambient light.

◆ setDirection()

void Ogre::Light::setDirection ( const Vector3 vec)
inherited

Sets the direction in which a light points.

Remarks
Applicable only to the spotlight and directional light types.
Note
This direction will be concatenated with the parent SceneNode.

◆ setDoubleSided()

void Ogre::Light::setDoubleSided ( bool  bDoubleSided)
inherited

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.

Parameters
bDoubleSidedTrue to enable. Default: false.

◆ setLightMask()

void Ogre::MovableObject::setLightMask ( uint32  lightMask)
inlineinherited

Set a bitwise mask which will filter the lights affecting this object.

Remarks
This mask will be compared against the mask held against Light to determine if a light should affect a given object. By default, this mask is fully set meaning all lights will affect this object

◆ setListener()

void Ogre::MovableObject::setListener ( Listener listener)
inlineinherited

Sets a listener for this object.

Remarks
Note for size and performance reasons only one listener per object is allowed.

◆ setLocalAabb()

void Ogre::MovableObject::setLocalAabb ( const Aabb  box)
inherited

Sets the local axis-aligned bounding box for this object.

Remarks
This bounding box is in local coordinates.

◆ setName()

void Ogre::MovableObject::setName ( const String name)
inlineinherited

Sets a custom name for this node.

Doesn't have to be unique

◆ setPowerScale()

void Ogre::Light::setPowerScale ( Real  power)
inherited

Set a scaling factor to indicate the relative power of a light.

Remarks
This factor is only useful in High Dynamic Range (HDR) rendering. You can bind it to a shader variable to take it into account,
See also
GpuProgramParameters
Parameters
powerThe power rating of this light, default is 1.0.

◆ setQueryFlags()

void Ogre::MovableObject::setQueryFlags ( uint32  flags)
inlineinherited

Sets the query flags for this object.

Remarks
When performing a scene query, this object will be included or excluded according to flags on the object and flags on the query. This is a bitwise value, so only when a bit on these flags is set, will it be included in a query asking for that flag. The meaning of the bits is application-specific.

◆ setRectSize()

void Ogre::Light::setRectSize ( Vector2  rectSize)
inherited

For custom 2D shape and area lights, sets the dimensions of the rectangle, in half size.

Parameters
halfSize

◆ setRenderingDistance()

void Ogre::MovableObject::setRenderingDistance ( Real  dist)
inlineinherited

Sets the distance at which the object is no longer rendered.

Parameters
distDistance 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.

◆ setRenderingMinPixelSize()

void Ogre::MovableObject::setRenderingMinPixelSize ( Real  pixelSize)
inlineinherited

Sets the minimum pixel size an object needs to be in both screen axes in order to be rendered.

Note
Camera::setUseMinPixelSize() needs to be called for this parameter to be used.
Parameters
pixelSizeNumber of minimum pixels (the default is 0, which means objects are always rendered).

◆ setRenderQueueGroup()

virtual void Ogre::Light::setRenderQueueGroup ( uint8  queueID)
virtualinherited

Overload to avoid it. Light::setType uses the RenderQueue ID to classify lights per type.

Reimplemented from Ogre::MovableObject.

◆ setShadowFarClipDistance()

void Ogre::Light::setShadowFarClipDistance ( Real  farClip)
inlineinherited

Set the far clip plane distance to be used by the shadow camera, if this light casts texture shadows.

Remarks
This is different from the 'shadow far distance', which is always measured from the main camera. This distance is the far clip plane of the light camera.
Parameters
farClipThe distance, or -1 to use the main camera setting.

◆ setShadowFarDistance()

void Ogre::Light::setShadowFarDistance ( Real  distance)
inherited

Sets the maximum distance away from the camera that shadows by this light will be visible.

Remarks
Shadow techniques can be expensive, therefore it is a good idea to limit them to being rendered close to the camera if possible, and to skip the expense of rendering shadows for distance objects. This method allows you to set the distance at which shadows will no longer be rendered.
Note
Each shadow technique can interpret this subtely differently. For example, one technique may use this to eliminate casters, another might use it to attenuate the shadows themselves. You should tweak this value to suit your chosen shadow technique and scene setup.

◆ setShadowNearClipDistance()

void Ogre::Light::setShadowNearClipDistance ( Real  nearClip)
inlineinherited

Set the near clip plane distance to be used by the shadow camera, if this light casts texture shadows.

Parameters
nearClipThe distance, or -1 to use the main camera setting.

◆ setShadowRenderingDistance()

void Ogre::MovableObject::setShadowRenderingDistance ( Real  dist)
inlineinherited

Sets the distance at which the object is no longer casting shadows.

Parameters
distDistance 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.
Note
ShadowRenderingDistance will be clamped to RenderingDistance value
See also
setRenderingDistance

◆ setSpecularColour() [1/2]

void Ogre::Light::setSpecularColour ( const ColourValue colour)
inlineinherited

Sets the colour of the specular light given off by this source.

Remarks
Material objects have ambient, diffuse and specular values which indicate how much of each type of light an object reflects. This value denotes the amount and colour of this type of light the light exudes into the scene. The actual appearance of objects is a combination of the two.
Specular light affects the appearance of shiny highlights on objects, and is also dependent on the 'shininess' Material value.

◆ setSpecularColour() [2/2]

void Ogre::Light::setSpecularColour ( Real  red,
Real  green,
Real  blue 
)
inlineinherited

Sets the colour of the specular light given off by this source.

Remarks
Material objects have ambient, diffuse and specular values which indicate how much of each type of light an object reflects. This value denotes the amount and colour of this type of light the light exudes into the scene. The actual appearance of objects is a combination of the two.
Specular light affects the appearance of shiny highlights on objects, and is also dependent on the 'shininess' Material value.

◆ setSpotlightFalloff()

void Ogre::Light::setSpotlightFalloff ( Real  val)
inlineinherited

Sets the falloff between the inner and outer cones of the spotlight.

◆ setSpotlightInnerAngle()

void Ogre::Light::setSpotlightInnerAngle ( const Radian val)
inherited

Sets the angle covered by the spotlights inner cone.

◆ setSpotlightNearClipDistance()

void Ogre::Light::setSpotlightNearClipDistance ( Real  nearClip)
inlineinherited

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.

Parameters
nearClipThe near distance.

◆ setSpotlightOuterAngle()

void Ogre::Light::setSpotlightOuterAngle ( const Radian val)
inherited

Sets the angle covered by the spotlights outer cone.

◆ setSpotlightRange()

void Ogre::Light::setSpotlightRange ( const Radian innerAngle,
const Radian outerAngle,
Real  falloff = 1.0 
)
inherited

Sets the range of a spotlight, i.e.

the angle of the inner and outer cones and the rate of falloff between them.

Parameters
innerAngleAngle covered by the bright inner cone
Note
The inner cone applicable only to Direct3D, it'll always treat as zero in OpenGL.
Parameters
outerAngleAngle covered by the outer cone
falloffThe rate of falloff between the inner and outer cones. 1.0 means a linear falloff, less means slower falloff, higher means faster falloff.

◆ setStatic()

bool Ogre::MovableObject::setStatic ( bool  bStatic)
inherited

Turns this Node into static or dynamic.

Remarks
Switching between dynamic and static has some overhead and forces to update all static scene when converted to static. So don't do it frequently. Static objects are not updated every frame, only when requested explicitly. Use this feature if you plan to have this object unaltered for a very long times
Note all MovableObjects support switching between static & dynamic after they have been created (eg. InstancedEntity)
Changing this attribute will cause to switch the attribute to our parent node, and as a result, all of its other attached entities. @See Node::setStatic
Returns
True if setStatic made an actual change. False otherwise. Can fail because the object was already static/dynamic, or because switching is not supported

◆ setTexture()

void Ogre::Light::setTexture ( TextureGpu texture)
inherited

Sets a textured for types of light that support it.

At the time of writing only LT_AREA_APPROX supports it.

Remarks
Note that HlmsPbs only supports one 2D Array texture active at a time. i.e. you must call hlmsPbs->setAreaLightMasks( texture ); and if that texture belongs to a different pool as the one you're inputting here, the wrong texture will be displayed!
Parameters
textureTexture. Can be monochrome or coloured. For Raw version must be a 2D Array texture. For non-Raw version, must be a 2D texture.
sliceIdxSlice to the texture.

◆ setTextureRaw()

void Ogre::Light::setTextureRaw ( TextureGpu texture,
uint32  sliceIdx 
)
inherited

◆ setType()

void Ogre::Light::setType ( LightTypes  type)
inherited

Sets the type of light - see LightTypes for more info.

◆ setVisibilityFlags()

void Ogre::MovableObject::setVisibilityFlags ( uint32  flags)
inlineinherited

Sets the visibility flags for this object.

Remarks
As well as a simple true/false value for visibility (as seen in setVisible), you can also set visibility flags that is applied a binary 'and' with the SceneManager's mask and a compositor node pass. To exclude particular objects from rendering. Changes to reserved visibility flags are ignored (won't take effect).

◆ setVisible()

void Ogre::MovableObject::setVisible ( bool  visible)
inlineinherited

Tells this object whether to be visible or not, if it has a renderable component.

Note
An alternative approach of making an object invisible is to detach it from it's SceneNode, or to remove the SceneNode entirely. Detaching a node means that structurally the scene graph changes. Once this change has taken place, the objects / nodes that have been removed have less overhead to the visibility detection pass than simply making the object invisible, so if you do this and leave the objects out of the tree for a long time, it's faster. However, the act of detaching / reattaching nodes is in itself more expensive than setting an object visibility flag, since in the latter case structural changes are not made. Therefore, small or frequent visibility changes are best done using this method; large or more longer term changes are best done by detaching.

◆ shouldStayLoaded()

virtual bool Ogre::TextureGpuListener::shouldStayLoaded ( TextureGpu texture)
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.

◆ updateAllBounds()

static void Ogre::MovableObject::updateAllBounds ( const size_t  numNodes,
ObjectData  t 
)
staticinherited

@See SceneManager::updateAllBounds

Remarks
We don't pass by reference on purpose (avoid implicit aliasing)

◆ updateZones()

void Ogre::PCZLight::updateZones ( PCZone defaultZone,
unsigned long  frameCount 
)

Update the list of zones the light affects.

Member Data Documentation

◆ c_DefaultLodMesh

const FastArray<Real> Ogre::MovableObject::c_DefaultLodMesh
staticinherited

◆ mGlobalIndex

size_t Ogre::MovableObject::mGlobalIndex
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.

Remarks
It is the parent (or our creator) the one that sets this value, not ourselves. Do NOT modify it manually.

◆ mParentIndex

size_t Ogre::MovableObject::mParentIndex
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.

Remarks
It is the parent (or our creator) the one that sets this value, not ourselves. Do NOT modify it manually.

◆ mRenderables

RenderableArray Ogre::MovableObject::mRenderables
inherited

◆ mTexLightMaskDiffuseMipStart

uint16 Ogre::Light::mTexLightMaskDiffuseMipStart
inherited

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.

◆ mTextureLightMaskIdx

uint16 Ogre::Light::mTextureLightMaskIdx
inherited

◆ tempSquareDist

Real Ogre::Light::tempSquareDist
inherited

Temp tag used for sorting.


The documentation for this class was generated from the following file: