PixelLightAPI  .
Public Types | Public Member Functions | Protected Types | Protected Member Functions
PLScene::SNSpotLight Class Reference

Spot light scene node. More...

#include <SNSpotLight.h>

Inheritance diagram for PLScene::SNSpotLight:
Inheritance graph
[legend]

List of all members.

Public Types

enum  EFlags { NoCone = 1<<13 }
 Scene node flags (SceneNode flags extension) More...

Public Member Functions

 pl_enum (EFlags) pl_enum_base(SNPointLight
 Scene node debug flags (SceneNode debug flags extension)
PLS_API void SetOuterAngle (float fValue)
PLS_API float GetInnerAngle () const
PLS_API void SetInnerAngle (float fValue)
PLS_API float GetZNear () const
PLS_API void SetZNear (float fValue)
PLS_API float GetAspect () const
PLS_API void SetAspect (float fValue)
PLS_API SNSpotLight ()
 Default constructor.
virtual PLS_API ~SNSpotLight ()
 Destructor.
PLS_API const PLMath::Matrix4x4GetProjectionMatrix ()
 Returns the projection matrix.
PLS_API const PLMath::Matrix3x4GetViewMatrix ()
 Returns the view matrix.
PLS_API const PLMath::FrustumGetFrustum ()
 Returns the spot light frustum.
PLS_API const PLCore::Array
< PLMath::Vector3 > & 
GetFrustumVertices ()
 Returns the 8 spot light frustum vertices.
virtual PLS_API bool IsSpotLight () const override
 Returns whether this scene node is a spot light (SNSpotLight) or not.
virtual PLS_API void DrawDebug (PLRenderer::Renderer &cRenderer, const VisNode *pVisNode=nullptr) override
 This function is called when the debug parts of the scene are drawn.

Protected Types

enum  EInternalLightFlags { RecalculateProjectionMatrix = 1<<1, RecalculateViewMatrix = 1<<2, RecalculateFrustum = 1<<3, RecalculateFrustumVertices = 1<<4 }
 Flags which hold ínternal light information ('SNPointLight::EInternalLightFlags' extension) More...

Protected Member Functions

virtual PLS_API void UpdateAABoundingBox () override
 Updates the axis align bounding box in 'scene node space'.
virtual PLS_API void GetBoundingSphere (PLMath::Sphere &cSphere) override
 Returns the bounding sphere in 'scene node space'.
virtual PLS_API void GetContainerBoundingSphere (PLMath::Sphere &cSphere) override
 Returns the current bounding sphere in 'scene container space'.

Detailed Description

Spot light scene node.

Remarks:
PixelLight is using a right-handed coordinate system like OpenGL does, therefore the spot light usually looks along the negative z-axis. While this fact may be ok in 'low level' functionality, it makes spot lights less comfortable within the scene graph because this 'look along negative z' doesn't go along with universal features like 'look at this point'. So, we decided to 'break' the right-handed coordinate system convention within the spot light scene node when it's coming to 'look along negative z'. Instead we 'look along positive z' and we profit from an universal behavior and don't need to care about flipping axis.
Note:
  • By default, the 'NoCone' flag is not set meaning that the given outer and inner angles are used for lighting

Member Enumeration Documentation

Scene node flags (SceneNode flags extension)

Enumerator:
NoCone 

Do not use the given outer and inner angles for lighting

Reimplemented from PLScene::SNLight.

Reimplemented in PLScene::SNProjectiveSpotLight.

Flags which hold ínternal light information ('SNPointLight::EInternalLightFlags' extension)

Enumerator:
RecalculateProjectionMatrix 

Recalculation of projection matrix required

RecalculateViewMatrix 

Recalculation of view matrix required

RecalculateFrustum 

Recalculation of frustum required

RecalculateFrustumVertices 

Recalculation of frustum vertices required

Reimplemented from PLScene::SNPointLight.


Constructor & Destructor Documentation

Default constructor.

virtual PLS_API PLScene::SNSpotLight::~SNSpotLight ( ) [virtual]

Destructor.


Member Function Documentation

Scene node debug flags (SceneNode debug flags extension)

< Perform a depth test when render the debug stuff like lines

< Do not draw the (green) frustum

< Draw the (green) frustum vertices

Reimplemented from PLScene::SceneNode.

PLS_API void PLScene::SNSpotLight::SetOuterAngle ( float  fValue)
PLS_API float PLScene::SNSpotLight::GetInnerAngle ( ) const
PLS_API void PLScene::SNSpotLight::SetInnerAngle ( float  fValue)
PLS_API float PLScene::SNSpotLight::GetZNear ( ) const
PLS_API void PLScene::SNSpotLight::SetZNear ( float  fValue)
PLS_API float PLScene::SNSpotLight::GetAspect ( ) const
PLS_API void PLScene::SNSpotLight::SetAspect ( float  fValue)

Returns the projection matrix.

Returns:
Projection matrix

Returns the view matrix.

Remarks:
PixelLight is using a right-handed coordinate system like OpenGL does, therefore the view matrix 'looks' along the negative z-axis. (unlike the spot light scene node itself, have a look into the class documentation)
Returns:
View matrix

Returns the spot light frustum.

Returns:
Spot light frustum in 'scene container space'

Returns the 8 spot light frustum vertices.

Returns:
8 spot light frustum vertices in 'scene container space'
Note:
  • This vertices can for instance be used to check the spot frustum visibility
virtual PLS_API bool PLScene::SNSpotLight::IsSpotLight ( ) const [override, virtual]

Returns whether this scene node is a spot light (SNSpotLight) or not.

Returns:
'true' if this scene node is a spot light, else 'false'
Note:
  • More performant than IsInstanceOf("PLScene::SNSpotLight")

Reimplemented from PLScene::SNLight.

virtual PLS_API void PLScene::SNSpotLight::DrawDebug ( PLRenderer::Renderer cRenderer,
const VisNode pVisNode = nullptr 
) [override, virtual]

This function is called when the debug parts of the scene are drawn.

Parameters:
[in]cRendererThe used renderer
[in]pVisNodeThe current visibility node of this scene node, can be a null pointer
Note:
  • Should only be called if the 'UseDrawDebug' draw flag and the 'DebugEnabled' debug flag is set
  • Beside drawing scene node stuff, the default implementation emits the SignalDrawDebug signal
See also:

Reimplemented from PLScene::SNPointLight.

virtual PLS_API void PLScene::SNSpotLight::UpdateAABoundingBox ( ) [override, protected, virtual]

Updates the axis align bounding box in 'scene node space'.

Remarks:
This function is called when the axis align bounding box needs to be calculated. One can overwrite the default implementation to calculate the axis align bounding box in another way. The default implementation is empty. (current set axis align bounding box is still used)
Note:
  • We recommend to use 'SetAABoundingBox()' inside your own implementation to set the new axis align bounding box, this function will take care of all other required updates

Reimplemented from PLScene::SNPointLight.

virtual PLS_API void PLScene::SNSpotLight::GetBoundingSphere ( PLMath::Sphere cSphere) [override, protected, virtual]

Returns the bounding sphere in 'scene node space'.

Parameters:
[out]cSphereReceives the bounding sphere in 'scene node space'
Remarks:
This function is called when the sphere needs to be calculated. One can overwrite the default implementation to calculate the sphere in another way.

Reimplemented from PLScene::SNPointLight.

virtual PLS_API void PLScene::SNSpotLight::GetContainerBoundingSphere ( PLMath::Sphere cSphere) [override, protected, virtual]

Returns the current bounding sphere in 'scene container space'.

Parameters:
[out]cSphereReceives the current bounding in 'scene container space'
See also:

Reimplemented from PLScene::SNPointLight.


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


PixelLight PixelLight 0.9.11-R1
Copyright (C) 2002-2012 by The PixelLight Team
Last modified Thu Feb 23 2012 14:09:42
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported