A spot_light_component
emits light from a single point in a cone shape. The shape of the light is defined by two cones: the InnerConeAngleDegrees
and OuterConeAngleDegrees
. Within the InnerConeAngleDegrees
the light achieves full brightness. As you go from the extent of the inner radius to the
extents of the OuterConeAngleDegrees
a falloff takes place, creating a penumbra, or softening around the spot_light_component
's disc of
illumination. The Radius of the light defines the length of the cones. More simply, this will work like a flash light or stage can light.
Verse using statement |
using { /Verse.org/SceneGraph } |
Inheritance Hierarchy
This class is derived from the following hierarchy, starting with component
:
Name | Description |
---|---|
component |
Base class for authoring logic and data in the SceneGraph. Using components you can author re-usable building blocks of logic and data which can then be added to entities in the scene. Components are a very low level building block which can be used in many ways. For example:
As components are generic there is no specific way that they must be used. It is up to the needs of your experience if you use one big game component or if you break up logic into many small components. Classes deriving from component must also specify Only one instance of a component from each subclass group can be added to an entity at a time. For example, given this group of components, only one light_component can exist on a single entity. To create multiple lights you should use multiple entities. light_component := class ============================================================================== Component Lifetime Components move through a series of lifetime functions as they are added to entities, added to the scene, and begin running in the simulation. Components should override these methods to perform setup and run their simulation. As a component shuts down it will then move through shutdown version of these
functions, giving users the opportunity to clean up any retained state on the
component before it is disposed
.
Lifetime Methods:
OnAddedToScene
OnBeginSimulation -> OnSimulate |
light_component |
Base class for light components in the SceneGraph. Dependencies:
Examples of components implementing
|
Members
This class has both data members and functions.
Data
Data Member Name | Type | Description |
---|---|---|
AttenuationRadius |
??float |
The bounds of the light's visible influence, in centimeters. This clamping of the light's influence is not physically correct but very important for performance, larger lights cost more. The light falloff is based on Inverse Square law. Towards the tail end of the AttenuationRadius, there is an additional smoothing factor to fade out the light contribution to 0 to avoid a hard cutoff. |
CastShadows |
?logic |
Whether the light should cast any shadows. |
ColorFilter |
?color |
Set the filter color of the light. This acts as a colored filter in front of the light source. Note that this can change the light's effective intensity. In normalized range 0-1. |
DiffuseScale |
?float |
Multiplier on diffuse lighting. Any value besides 1.0 is not physical. 0.0 means no diffuse contribution from this light. |
Entity |
entity |
The parent entity of this component.
|
InnerConeAngleDegrees |
?float |
The light's inner cone shaped angle in degrees. Clamped between 0.0 and 80.0. |
Intensity |
?float |
Set the visible light intensity emitted in SI unit Candela. Specified before ColorFilter (which multiplies each color component after the intensity calculation and can change the effective intensity of the light). |
OuterConeAngleDegrees |
?float |
The light's outer cone shaped angle in degrees. Clamped between 1.0 and 80.0. |
SourceRadius |
?float |
Radius of the source shape, in centimeters. Note that light shapes which intersect shadow casting geometry can cause shadowing artifacts. |
SpecularScale |
?float |
Multiplier on specular highlights. Can be used to artistically remove highlights mimicking polarizing filters or photo touch up. Any value besides 1.0 is not physical. 0.0 means no specular contribution from this light. |
TickEvents |
?tick_events |
Set callbacks to |
Functions
Function Name | Description |
---|---|
Disable |
Disables rendering of this light. |
Enable |
Enables rendering of this light. |
IsEnabled |
Succeeds if the component is enabled, fails if it's disabled. |
IsInScene |
Succeeds if the component is currently in the scene.
|
IsSimulating |
Succeeds if the component is currently simulating.
|
OnAddedToScene |
Called when the component is added to the scene by parenting it under the simulation entity or another entity already in the scene.
|
OnBeginSimulation |
Called when the component begins simulating within the scene.
|
OnEndSimulation |
Called when the component ends simulation within the scene.
|
OnReceive |
Respond to an event being propagated through the scene graph. Returns if the event is consumed, in which case the event will not be passed to the next entity, depending on how the event is being sent through the hierarchy. |
OnRemovingFromScene |
Called when the component is about to be removed from the scene.
|
OnSimulate |
Called when the component begins simulating within the scene.
|
RemoveFromEntity |
Removes the component from the entity.
|