401 bool debugRenderables =
false);
A 3D box aligned with the x/y/z axes.
A viewpoint from which the scene will be rendered.
Class representing colour.
Structure recording the use of an automatic parameter.
Collects together the program parameters used for a GpuProgram.
Factory object for creating Light instances.
MovableObject * createInstanceImpl(const String &name, const NameValuePairList *params)
Internal implementation of create method - must be overridden.
static String FACTORY_TYPE_NAME
void destroyInstance(MovableObject *obj)
Destroy an instance of the object.
const String & getType(void) const
Get the type of the object to be created.
Representation of a dynamic light source in the scene.
Real getBoundingRadius(void) const
Retrieves the radius of the origin-centered bounding sphere for this object.
Vector4 getAs4DVector(bool cameraRelativeIfSet=false) const
Gets the details of this light as a 4D vector.
void setSpecularColour(Real red, Real green, Real blue)
Sets the colour of the specular light given off by this source.
Real _deriveShadowNearClipDistance(const Camera *maincam) const
Derive a shadow camera near distance from either the light, or from the main camera if the light does...
Camera * mCameraToBeRelativeTo
void resetShadowFarDistance(void)
Tells the light to use the shadow far distance of the SceneManager.
void visitRenderables(Renderable::Visitor *visitor, bool debugRenderables=false)
Method to allow a caller to abstractly iterate over the Renderable instances that this MovableObject ...
const Vector3 & getPosition(void) const
Returns the position of the light.
void setDirection(const Vector3 &vec)
Sets the direction in which a light points.
const String & getAnimableDictionaryName(void) const
Get the name of the animable dictionary for this class.
void setDiffuseColour(const ColourValue &colour)
Sets the colour of the diffuse light given off by this source.
PlaneBoundedVolume mNearClipVolume
const Radian & getSpotlightOuterAngle(void) const
Returns the angle covered by the spotlights outer cone.
void setVisible(bool visible)
Tells this object whether to be visible or not, if it has a renderable component.
void setAttenuation(Real range, Real constant, Real linear, Real quadratic)
Sets the attenuation parameters of the light source i.e.
void _notifyAttached(Node *parent, bool isTagPoint=false)
Internal method called to notify the object that it has been attached to a node.
bool mDerivedTransformDirty
Is the derived transform dirty?
const Vector3 & getDerivedPosition(bool cameraRelativeIfSet=false) const
Retrieves the position of the light including any transform from nodes it is attached to.
size_t _getIndexInFrame() const
Gets the index at which this light is in the current render.
static String msMovableType
Shared class-level name for Movable type.
const String & getMovableType(void) const
Returns the type name of this object.
void setCustomShadowCameraSetup(const ShadowCameraSetupPtr &customShadowSetup)
Set this light to use a custom shadow camera when rendering texture shadows.
uint32 getTypeFlags(void) const
Override to return specific type flag.
Real getAttenuationConstant(void) const
Returns the constant factor in the attenuation formula.
void setCustomParameter(uint16 index, const Vector4 &value)
Sets a custom parameter for this Light, which may be used to drive calculations for this specific Ren...
LightTypes
Defines the type of light.
map< uint16, Vector4 >::type CustomParameterMap
bool isInLightRange(const Ogre::AxisAlignedBox &container) const
Check whether a bounding box is included in the lighted area of the light.
const Radian & getSpotlightInnerAngle(void) const
Returns the angle covered by the spotlights inner cone.
void setType(LightTypes type)
Sets the type of light - see LightTypes for more info.
void setSpecularColour(const ColourValue &colour)
Sets the colour of the specular light given off by this source.
const AxisAlignedBox & getBoundingBox(void) const
Retrieves the local axis-aligned bounding box for this object.
Real getSpotlightFalloff(void) const
Returns the falloff between the inner and outer cones of the spotlight.
Real getShadowFarDistance(void) const
Gets the maximum distance away from the camera that shadows by this light will be visible.
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...
bool isInLightRange(const Ogre::Sphere &sphere) const
Check whether a sphere is included in the lighted area of the light.
void _calcTempSquareDist(const Vector3 &worldPos)
internal method for calculating current squared distance from some world position
const ColourValue & getSpecularColour(void) const
Returns the colour of specular light given off by this light source.
AnimableValuePtr createAnimableValue(const String &valueName)
Create a reference-counted AnimableValuePtr for the named value.
Real getShadowNearClipDistance() const
Get the near clip plane distance to be used by the shadow camera, if this light casts texture shadows...
void initialiseAnimableDictionary(StringVector &vec) const
Internal method for initialising dictionary; should be implemented by subclasses wanting to expose an...
void setPowerScale(Real power)
Set a scaling factor to indicate the relative power of a light.
void _notifyIndexInFrame(size_t i)
void resetCustomShadowCameraSetup(void)
Reset the shadow camera setup to the default.
void setSpotlightRange(const Radian &innerAngle, const Radian &outerAngle, Real falloff=1.0)
Sets the range of a spotlight, i.e.
LightTypes getType(void) const
Returns the light type.
void setShadowNearClipDistance(Real nearClip)
Set the near clip plane distance to be used by the shadow camera, if this light casts texture shadows...
virtual const PlaneBoundedVolumeList & _getFrustumClipVolumes(const Camera *const cam) const
Internal method for calculating the clip volumes outside of the frustum which can be used to determin...
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...
virtual void update(void) const
Internal method for synchronising with parent node (if any)
Real getAttenuationRange(void) const
Returns the absolute upper range of the light.
Vector3 mDerivedDirection
const Vector3 & getDirection(void) const
Returns the light's direction.
Real getAttenuationLinear(void) const
Returns the linear factor in the attenuation formula.
Real getAttenuationQuadric(void) const
Returns the quadric factor in the attenuation formula.
void setDirection(Real x, Real y, Real z)
Sets the direction in which a light points.
Real getPowerScale(void) const
Set the scaling factor which indicates the relative power of a light.
Real getShadowFarDistanceSquared(void) const
const Vector4 & getCustomParameter(uint16 index) const
Gets the custom value associated with this Light at the given index.
void setPosition(const Vector3 &vec)
Sets the position of the light.
void _updateRenderQueue(RenderQueue *queue)
Internal method by which the movable object must add Renderable subclass instances to the rendering q...
Vector3 mDerivedCamRelativePosition
void _notifyMoved(void)
Internal method called to notify the object that it has been moved.
Real getSpotlightNearClipDistance() const
Get the near clip plane distance to be used by spotlights that use light clipping.
Light(const String &name)
Normal constructor.
void setShadowFarDistance(Real distance)
Sets the maximum distance away from the camera that shadows by this light will be visible.
Light()
Default constructor (for Python mainly).
void _setCameraRelative(Camera *cam)
Set the camera which this light should be relative to, for camera-relative rendering.
const Vector3 & getDerivedDirection(void) const
Retrieves the direction of the light including any transform from nodes it is attached to.
void setSpotlightOuterAngle(const Radian &val)
Sets the angle covered by the spotlights outer cone.
ShadowCameraSetupPtr mCustomShadowCameraSetup
Pointer to a custom shadow camera setup.
void setSpotlightInnerAngle(const Radian &val)
Sets the angle covered by the spotlights inner cone.
const ShadowCameraSetupPtr & getCustomShadowCameraSetup(void) const
Return a pointer to the custom shadow camera setup (null means use SceneManager global version).
virtual const PlaneBoundedVolume & _getNearClipVolume(const Camera *const cam) const
Internal method for calculating the 'near clip volume', which is the volume formed between the near c...
void setDiffuseColour(Real red, Real green, Real blue)
Sets the colour of the diffuse light given off by this source.
Real tempSquareDist
Temp tag used for sorting.
void setSpotlightNearClipDistance(Real nearClip)
Set the near clip plane distance to be used by spotlights that use light clipping,...
void setShadowFarClipDistance(Real farClip)
Set the far clip plane distance to be used by the shadow camera, if this light casts texture shadows.
void setSpotlightFalloff(Real val)
Sets the falloff between the inner and outer cones of the spotlight.
Real mShadowFarDistSquared
Real getShadowFarClipDistance() const
Get the far clip plane distance to be used by the shadow camera, if this light casts texture shadows.
CustomParameterMap mCustomParameters
Stores the custom parameters for the light.
void setPosition(Real x, Real y, Real z)
Sets the position of the light.
bool mDerivedCamRelativeDirty
~Light()
Standard destructor.
PlaneBoundedVolumeList mFrustumClipVolumes
const ColourValue & getDiffuseColour(void) const
Returns the colour of the diffuse light given off by this light source (see setDiffuseColour for more...
Interface definition for a factory class which produces a certain kind of MovableObject,...
Abstract class defining a movable object in a scene.
Class representing a general-purpose node an articulated scene graph.
Represents a convex volume bounded by planes.
Wrapper class which indicates a given angle value is in Radians.
Class to manage the scene object rendering queue.
Visitor object that can be used to iterate over a collection of Renderable instances abstractly.
A sphere primitive, mostly used for bounds checking.
Standard 3-dimensional vector.
4-dimensional homogeneous vector.
vector< String >::type StringVector
map< String, String >::type NameValuePairList
Name / value parameter pair (first = name, second = value)
vector< PlaneBoundedVolume >::type PlaneBoundedVolumeList
float Real
Software floating point type.
std::map< K, V, P, A > type