Most visited

Recently visited

OmniLight

public class OmniLight
extends Light

java.lang.Object
   ↳ com.viro.core.Light
     ↳ com.viro.core.OmniLight


OmniLight is a Light that emits light in all directions from a given position, with decreasing intensity over distance. This is also commonly referred to as a point light.

OmniLight does not cast shadows.

For an extended discussion on Lights, refer to the Lighting and Materials Guide.

Summary

Nested classes

class OmniLight.OmniLightBuilder<R extends Light, B extends LightBuilder<R, B>>

Builder for creating OmniLight objects. 

Public constructors

OmniLight()

Construct a new OmniLight with default values: white color, normal intensity, and positioned at the origin of its parent Node.

Public methods

static OmniLightBuilder<? extends Light, ? extends LightBuilder> builder()

Builder for creating OmniLight objects.

float getAttenuationEndDistance()

Get the attenuation end distance, which is the distance from the light at which no illumination will be received.

float getAttenuationStartDistance()

Get the attenuation start distance, which determines when the light starts attenuating.

Vector getPosition()

Get the position of this OmniLight.

void setAttenuationEndDistance(float attenuationEndDistance)

Set the attenuation end distance, which determines when the light drops to zero illumination.

void setAttenuationStartDistance(float attenuationStartDistance)

Set the attenuation start distance, which determines when the light begins to attenuate.

void setPosition(Vector position)

Set the position of this OmniLight within the coordinate system of its parent Node.

Public constructors

OmniLight

OmniLight ()

Construct a new OmniLight with default values: white color, normal intensity, and positioned at the origin of its parent Node.

Public methods

builder

OmniLightBuilder<? extends Light, ? extends LightBuilder> builder ()

Builder for creating OmniLight objects.

Returns
OmniLightBuilder<? extends Light, ? extends LightBuilder>

getAttenuationEndDistance

float getAttenuationEndDistance ()

Get the attenuation end distance, which is the distance from the light at which no illumination will be received.

Returns
float The attenuation end distance.

getAttenuationStartDistance

float getAttenuationStartDistance ()

Get the attenuation start distance, which determines when the light starts attenuating.

Returns
float The attenuation start distance.

getPosition

Vector getPosition ()

Get the position of this OmniLight.

Returns
Vector The positio as a Vector.

setAttenuationEndDistance

void setAttenuationEndDistance (float attenuationEndDistance)

Set the attenuation end distance, which determines when the light drops to zero illumination. Objects positioned at a distance greater than the attenuation end distance from the light's position will receive no illumination from this light.

The default value is Float.MAX_VALUE.

Parameters
attenuationEndDistance float: The distance from the light at which no illumination will be received.

setAttenuationStartDistance

void setAttenuationStartDistance (float attenuationStartDistance)

Set the attenuation start distance, which determines when the light begins to attenuate. Objects positioned closer to the light than the attenuation start distance will receive the light's full illumination.

Objects positioned between the start and end distance will receive a proportion of the lights illumination, transitioning from full illumination to no illumination the further out from the lights position the object is.

The default value is 2.

Parameters
attenuationStartDistance float: The distance from the light at which the light begins to attenuate.

setPosition

void setPosition (Vector position)

Set the position of this OmniLight within the coordinate system of its parent Node.

Parameters
position Vector: The position of as a Vector.

Hooray!