C# Class Axiom.Core.Light

Representation of a dynamic light source in the scene.
Lights are added to the scene like any other object. They contain various parameters like type, position, attenuation (how light intensity fades with distance), color etc.

The defaults when a light is created is pure white diffuse light, with no attenuation (does not decrease with distance) and a range of 1000 world units.

Lights are created by using the SceneManager.CreateLight method. They can subsequently be added to a SceneNode if required to allow them to move relative to a node in the scene. A light attached to a SceneNode is assumed to have a base position of (0,0,0) and a direction of (0,0,1) before modification by the SceneNode's own orientation. If note attached to a SceneNode, the light's position and direction is as set using Position and Direction.

Remember also that dynamic lights rely on modifying the color of vertices based on the position of the light compared to an object's vertex normals. Dynamic lighting will only look good if the object being lit has a fair level of tesselation and the normals are properly set. This is particularly true for the spotlight which will only look right on highly tessellated models.

Inheritance: Axiom.Core.MovableObject, IComparable
Afficher le fichier Open project: mono-soc-2011/axiom Class Usage Examples

Méthodes publiques

Свойство Type Description
DefaultDirection Vector3
animableAttributes string[]

Protected Properties

Свойство Type Description
attenuationConst float
attenuationLinear float
attenuationQuad float
derivedDirection Vector3
derivedPosition Vector3
diffuse ColorEx
direction Vector3
frustumClipVolumes PlaneBoundedVolumeList
lastParentOrientation Axiom.Math.Quaternion
lastParentPosition Vector3
localTransformDirty bool
nearClipVolume Axiom.Math.PlaneBoundedVolume
ownShadowFarDistance bool
position Vector3
powerScale Real
range float
shadowFarDistance Real
shadowFarDistanceSquared Real
specular ColorEx
spotFalloff float
spotInner float
spotOuter float
tempSquaredDist float
type LightType

Méthodes publiques

Méthode Description
CompareTo ( object obj ) : int

Used to compare this light to another light for sorting.

CreateAnimableValue ( string valueName ) : Axiom.Animating.AnimableValue
GetAs4DVector ( ) : Vector4

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.

Light ( ) : System

Default constructor.

Light ( string name ) : System

Normal constructor. Should not be called directly, but rather the SceneManager.CreateLight method should be used.

NotifyCurrentCamera ( Camera camera ) : void
ResetCustomShadowCameraSetup ( ) : void

Reset the shadow camera setup to the default.

SetAttenuation ( float range, float constant, float linear, float quadratic ) : void

Sets the attenuation parameters of the light in a single call.

SetSpotlightRange ( float innerAngle, float outerAngle ) : void

SetSpotlightRange ( float innerAngle, float outerAngle, float falloff ) : void

Sets the spotlight parameters in a single call.

Update ( ) : void

Updates this lights position.

UpdateRenderQueue ( RenderQueue queue ) : void

Private Methods

Méthode Description
GetFrustumClipVolumes ( Camera camera ) : PlaneBoundedVolumeList

Internal method for calculating the clip volumes outside of the frustum which can be used to determine which objects are casting shadow on the frustum as a whole.

Each of the volumes is a pyramid for a point/spot light and a cuboid for a directional light.

GetNearClipVolume ( Camera camera ) : PlaneBoundedVolume

Internal method for calculating the 'near clip volume', which is the volume formed between the near clip rectangle of the camera and the light.

This volume is a pyramid for a point/spot light and a cuboid for a directional light. It can used to detect whether an object could be casting a shadow on the viewport. Note that the reference returned is to a shared volume which will be reused across calls to this method.

Method Details

CompareTo() public méthode

Used to compare this light to another light for sorting.
public CompareTo ( object obj ) : int
obj object
Résultat int

CreateAnimableValue() public méthode

public CreateAnimableValue ( string valueName ) : Axiom.Animating.AnimableValue
valueName string
Résultat Axiom.Animating.AnimableValue

GetAs4DVector() public méthode

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.
public GetAs4DVector ( ) : Vector4
Résultat Vector4

Light() public méthode

Default constructor.
public Light ( ) : System
Résultat System

Light() public méthode

Normal constructor. Should not be called directly, but rather the SceneManager.CreateLight method should be used.
public Light ( string name ) : System
name string
Résultat System

NotifyCurrentCamera() public méthode

public NotifyCurrentCamera ( Camera camera ) : void
camera Camera
Résultat void

ResetCustomShadowCameraSetup() public méthode

Reset the shadow camera setup to the default.
public ResetCustomShadowCameraSetup ( ) : void
Résultat void

SetAttenuation() public méthode

Sets the attenuation parameters of the light in a single call.
public SetAttenuation ( float range, float constant, float linear, float quadratic ) : void
range float
constant float
linear float
quadratic float
Résultat void

SetSpotlightRange() public méthode

public SetSpotlightRange ( float innerAngle, float outerAngle ) : void
innerAngle float
outerAngle float
Résultat void

SetSpotlightRange() public méthode

Sets the spotlight parameters in a single call.
public SetSpotlightRange ( float innerAngle, float outerAngle, float falloff ) : void
innerAngle float
outerAngle float
falloff float
Résultat void

Update() public méthode

Updates this lights position.
public Update ( ) : void
Résultat void

UpdateRenderQueue() public méthode

public UpdateRenderQueue ( RenderQueue queue ) : void
queue Axiom.Graphics.RenderQueue
Résultat void

Property Details

DefaultDirection public_oe static_oe property

public static Vector3 DefaultDirection
Résultat Vector3

animableAttributes public_oe static_oe property

public static string[] animableAttributes
Résultat string[]

attenuationConst protected_oe property

protected float attenuationConst
Résultat float

attenuationLinear protected_oe property

protected float attenuationLinear
Résultat float

attenuationQuad protected_oe property

protected float attenuationQuad
Résultat float

derivedDirection protected_oe property

Derived direction of this light.
protected Vector3 derivedDirection
Résultat Vector3

derivedPosition protected_oe property

Derived position of this light.
protected Vector3 derivedPosition
Résultat Vector3

diffuse protected_oe property

Diffuse color.
protected ColorEx,Axiom.Core diffuse
Résultat ColorEx

direction protected_oe property

Direction of this light.
protected Vector3 direction
Résultat Vector3

frustumClipVolumes protected_oe property

protected PlaneBoundedVolumeList frustumClipVolumes
Résultat PlaneBoundedVolumeList

lastParentOrientation protected_oe property

Stored version of parent orientation.
protected Quaternion,Axiom.Math lastParentOrientation
Résultat Axiom.Math.Quaternion

lastParentPosition protected_oe property

Stored version of parent position.
protected Vector3 lastParentPosition
Résultat Vector3

localTransformDirty protected_oe property

protected bool localTransformDirty
Résultat bool

nearClipVolume protected_oe property

Stored version of the last near clip volume tested.
protected PlaneBoundedVolume,Axiom.Math nearClipVolume
Résultat Axiom.Math.PlaneBoundedVolume

ownShadowFarDistance protected_oe property

protected bool ownShadowFarDistance
Résultat bool

position protected_oe property

Position of this light.
protected Vector3 position
Résultat Vector3

powerScale protected_oe property

protected Real powerScale
Résultat Real

range protected_oe property

protected float range
Résultat float

shadowFarDistance protected_oe property

protected Real shadowFarDistance
Résultat Real

shadowFarDistanceSquared protected_oe property

protected Real shadowFarDistanceSquared
Résultat Real

specular protected_oe property

Specular color.
protected ColorEx,Axiom.Core specular
Résultat ColorEx

spotFalloff protected_oe property

protected float spotFalloff
Résultat float

spotInner protected_oe property

protected float spotInner
Résultat float

spotOuter protected_oe property

protected float spotOuter
Résultat float

tempSquaredDist protected_oe property

Used for sorting. Internal for "friend" access to SceneManager.
protected float tempSquaredDist
Résultat float

type protected_oe property

Type of light.
protected LightType type
Résultat LightType