C# Класс 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.

Наследование: Axiom.Core.MovableObject, IComparable
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
DefaultDirection Vector3
animableAttributes string[]

Защищенные свойства (Protected)

Свойство Тип Описание
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

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
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.

Описание методов

CompareTo() публичный Метод

Used to compare this light to another light for sorting.
public CompareTo ( object obj ) : int
obj object
Результат int

CreateAnimableValue() публичный Метод

public CreateAnimableValue ( string valueName ) : Axiom.Animating.AnimableValue
valueName string
Результат Axiom.Animating.AnimableValue

GetAs4DVector() публичный Метод

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
Результат Vector4

Light() публичный Метод

Default constructor.
public Light ( ) : System
Результат System

Light() публичный Метод

Normal constructor. Should not be called directly, but rather the SceneManager.CreateLight method should be used.
public Light ( string name ) : System
name string
Результат System

NotifyCurrentCamera() публичный Метод

public NotifyCurrentCamera ( Camera camera ) : void
camera Camera
Результат void

ResetCustomShadowCameraSetup() публичный Метод

Reset the shadow camera setup to the default.
public ResetCustomShadowCameraSetup ( ) : void
Результат void

SetAttenuation() публичный Метод

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
Результат void

SetSpotlightRange() публичный Метод

public SetSpotlightRange ( float innerAngle, float outerAngle ) : void
innerAngle float
outerAngle float
Результат void

SetSpotlightRange() публичный Метод

Sets the spotlight parameters in a single call.
public SetSpotlightRange ( float innerAngle, float outerAngle, float falloff ) : void
innerAngle float
outerAngle float
falloff float
Результат void

Update() публичный Метод

Updates this lights position.
public Update ( ) : void
Результат void

UpdateRenderQueue() публичный Метод

public UpdateRenderQueue ( RenderQueue queue ) : void
queue Axiom.Graphics.RenderQueue
Результат void

Описание свойств

DefaultDirection публичное статическое свойство

public static Vector3 DefaultDirection
Результат Vector3

animableAttributes публичное статическое свойство

public static string[] animableAttributes
Результат string[]

attenuationConst защищенное свойство

protected float attenuationConst
Результат float

attenuationLinear защищенное свойство

protected float attenuationLinear
Результат float

attenuationQuad защищенное свойство

protected float attenuationQuad
Результат float

derivedDirection защищенное свойство

Derived direction of this light.
protected Vector3 derivedDirection
Результат Vector3

derivedPosition защищенное свойство

Derived position of this light.
protected Vector3 derivedPosition
Результат Vector3

diffuse защищенное свойство

Diffuse color.
protected ColorEx,Axiom.Core diffuse
Результат ColorEx

direction защищенное свойство

Direction of this light.
protected Vector3 direction
Результат Vector3

frustumClipVolumes защищенное свойство

protected PlaneBoundedVolumeList frustumClipVolumes
Результат PlaneBoundedVolumeList

lastParentOrientation защищенное свойство

Stored version of parent orientation.
protected Quaternion,Axiom.Math lastParentOrientation
Результат Axiom.Math.Quaternion

lastParentPosition защищенное свойство

Stored version of parent position.
protected Vector3 lastParentPosition
Результат Vector3

localTransformDirty защищенное свойство

protected bool localTransformDirty
Результат bool

nearClipVolume защищенное свойство

Stored version of the last near clip volume tested.
protected PlaneBoundedVolume,Axiom.Math nearClipVolume
Результат Axiom.Math.PlaneBoundedVolume

ownShadowFarDistance защищенное свойство

protected bool ownShadowFarDistance
Результат bool

position защищенное свойство

Position of this light.
protected Vector3 position
Результат Vector3

powerScale защищенное свойство

protected Real powerScale
Результат Real

range защищенное свойство

protected float range
Результат float

shadowFarDistance защищенное свойство

protected Real shadowFarDistance
Результат Real

shadowFarDistanceSquared защищенное свойство

protected Real shadowFarDistanceSquared
Результат Real

specular защищенное свойство

Specular color.
protected ColorEx,Axiom.Core specular
Результат ColorEx

spotFalloff защищенное свойство

protected float spotFalloff
Результат float

spotInner защищенное свойство

protected float spotInner
Результат float

spotOuter защищенное свойство

protected float spotOuter
Результат float

tempSquaredDist защищенное свойство

Used for sorting. Internal for "friend" access to SceneManager.
protected float tempSquaredDist
Результат float

type защищенное свойство

Type of light.
protected LightType type
Результат LightType