LightNode

open class LightNode(val engine: Engine, val entity: Entity) : Node, LightComponent

Light source Node in the scene such as a sun or street lights.

At least one light must be added to a scene in order to see anything (unless the Material.Shading.UNLIT is used).

Creation and destruction:

  • A Light component is created using the LightManager.Builder and destroyed by calling LightManager.destroy.

See also

LightManager

Inheritors

Constructors

Link copied to clipboard
constructor(engine: Engine, entity: Entity = EntityManager.get().create(), builder: LightManager.Builder)
constructor(engine: Engine, type: LightManager.Type, entity: Entity = EntityManager.get().create(), apply: LightManager.Builder.() -> Unit)
constructor(engine: Engine, entity: Entity)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The shape to used to detect collisions for this Node.

Link copied to clipboard
Link copied to clipboard
open var color: Color

Dynamically updates the light's hue as linear sRGB

Link copied to clipboard
Link copied to clipboard
val engine: Engine
Link copied to clipboard
Link copied to clipboard
open var falloff: Float

The falloff distance for point lights and spot lights.

Link copied to clipboard
Link copied to clipboard
open var intensity: Float

Dynamically updates the light's intensity

Link copied to clipboard
open override var isEditable: Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Whether this Light casts shadows (disabled by default)

Link copied to clipboard
open override var isTouchable: Boolean

The node can be selected when a touch event happened.

Link copied to clipboard
open var isVisible: Boolean

The visible state of this node.

Link copied to clipboard

The light's direction in world space

Link copied to clipboard
Link copied to clipboard
open val lightManager: LightManager
Link copied to clipboard

The light's position in world space

Link copied to clipboard
open var lightQuaternion: Quaternion

The light's rotation in world space

Link copied to clipboard
open var name: String?
Link copied to clipboard
var onAddedToScene: (scene: Scene) -> Unit?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var onDown: (e: MotionEvent) -> Boolean?
Link copied to clipboard
var onEditingChanged: (editingTransforms: Set<KProperty1<Node, Any>?>) -> Unit?
Link copied to clipboard
var onFling: (e1: MotionEvent?, e2: MotionEvent, velocity: Float2) -> Boolean?
Link copied to clipboard
var onFrame: (frameTimeNanos: Long) -> Unit?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var onRemovedFromScene: (scene: Scene) -> Unit?
Link copied to clipboard
var onRotate: (detector: RotateGestureDetector, e: MotionEvent, rotationDelta: Quaternion) -> Boolean?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var onScale: (detector: ScaleGestureDetector, e: MotionEvent, scaleFactor: Float) -> Boolean?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var onScroll: (e1: MotionEvent?, e2: MotionEvent, distance: Float2) -> Boolean?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var onSmoothEnd: (node: Node) -> Unit?
Link copied to clipboard
var onTouch: (e: MotionEvent, hitResult: HitResult) -> Boolean?
Link copied to clipboard
Link copied to clipboard
open var parent: Node?

Changes the parent node.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open var position: Position

Position to locate within the coordinate system the parent.

Link copied to clipboard
open var quaternion: Quaternion

Quaternion rotation.

Link copied to clipboard
open var rotation: Rotation

Orientation in Euler Angles Degrees per axis from 0.0f to 360.0f.

Link copied to clipboard
open var scale: Scale

Scale on each axis.

Link copied to clipboard
Link copied to clipboard

The smooth position, rotation and scale speed.

Link copied to clipboard

Dynamically updates the angular radius of a Type.SUN light.

Link copied to clipboard

Dynamically updates the halo falloff of a Type.SUN light.

Link copied to clipboard
open var sunHaloSize: Float

Dynamically updates the halo radius of a Type.SUN light

Link copied to clipboard

Local transform of the transform component (i.e. relative to the parent).

Link copied to clipboard
Link copied to clipboard
val transformManager: TransformManager
Link copied to clipboard
open val type: LightManager.Type
Link copied to clipboard

World-space position.

Link copied to clipboard
open var worldQuaternion: Quaternion

The world-space quaternion.

Link copied to clipboard

World-space rotation.

Link copied to clipboard
open var worldScale: Scale

World-space scale.

Link copied to clipboard

Transform from the world coordinate system to the coordinate system of this node.

Link copied to clipboard

World transform of a transform component (i.e. relative to the root).

Functions

Link copied to clipboard
fun addChildNode(node: Node): Node
Link copied to clipboard
fun addChildNodes(nodes: Set<Node>): Node
Link copied to clipboard
fun animatePositions(vararg positions: Position): ObjectAnimator
Link copied to clipboard
fun animateQuaternions(vararg quaternions: Quaternion): ObjectAnimator
Link copied to clipboard
fun animateRotations(vararg rotations: Rotation): ObjectAnimator
Link copied to clipboard
fun animateScales(vararg scales: Scale): ObjectAnimator
Link copied to clipboard
fun animateTransforms(vararg transforms: Transform): AnimatorSet
Link copied to clipboard
Link copied to clipboard
open override fun destroy()

Detach and destroy the node and all its children.

Link copied to clipboard
open fun getLightChannel(@IntRange(from = 0, to = 7) channel: Int): Boolean

Returns whether a light channel is enabled on a specified renderable.

Link copied to clipboard
fun getLocalPosition(worldPosition: Position): Float3

Converts a position in the world-space to a local-space of this node.

Link copied to clipboard
fun getLocalQuaternion(worldQuaternion: Quaternion): Quaternion

Converts a quaternion in the world-space to a local-space of this node.

Link copied to clipboard
fun getLocalRotation(worldRotation: Rotation): Float3

Converts a rotation in the world-space to a local-space of this node.

Link copied to clipboard
fun getLocalScale(worldScale: Scale): Float3

Converts a scale in the world-space to a local-space of this node.

Link copied to clipboard
fun getLocalTransform(worldTransform: Transform): Mat4

Converts a transform in the world-space to a local-space of this node.

fun getLocalTransform(node: Node): Mat4

Converts a node transform in the world-space to a local-space of this node.

Link copied to clipboard
open override fun getTransformationMatrix(): Matrix
Link copied to clipboard
fun getWorldPosition(localPosition: Position): Float3

Converts a position in the local-space of this node to world-space.

Link copied to clipboard
fun getWorldQuaternion(quaternion: Quaternion): Quaternion

Converts a quaternion in the local-space of this node to world-space.

Link copied to clipboard
fun getWorldRotation(rotation: Rotation): Float3

Converts a rotation in the local-space of this node to world-space.

Link copied to clipboard
fun getWorldScale(scale: Scale): Float3

Converts a scale in the local-space of this node to world-space.

Link copied to clipboard
fun getWorldTransform(localTransform: Transform): Mat4

Converts a transform in the local-space of this node to world-space.

fun getWorldTransform(node: Node): Mat4

Converts a node transform in the local-space of this node to world-space.

Link copied to clipboard
fun lookAt(targetWorldPosition: Position, upDirection: Direction = Direction(y = 1.0f), smooth: Boolean = isSmoothTransformEnabled, smoothSpeed: Float = smoothTransformSpeed): Node

Rotates the node to face a point in world-space.

fun lookAt(targetNode: Node, upDirection: Direction = Direction(y = 1.0f), smooth: Boolean = isSmoothTransformEnabled, smoothSpeed: Float = smoothTransformSpeed): Node

Rotates the node to face another node.

Link copied to clipboard
fun lookTowards(lookDirection: Direction, upDirection: Direction = Direction(y = 1.0f), smooth: Boolean = isSmoothTransformEnabled, smoothSpeed: Float = smoothTransformSpeed): Node

Rotates the node to face a direction in world-space.

Link copied to clipboard
open fun onAddedToScene(scene: Scene)
Link copied to clipboard
open override fun onContextClick(e: MotionEvent): Boolean
Link copied to clipboard
open override fun onDoubleTap(e: MotionEvent): Boolean
Link copied to clipboard
open override fun onDoubleTapEvent(e: MotionEvent): Boolean
Link copied to clipboard
open override fun onDown(e: MotionEvent): Boolean
Link copied to clipboard
open override fun onFling(e1: MotionEvent?, e2: MotionEvent, velocityX: Float, velocityY: Float): Boolean
Link copied to clipboard
open fun onFrame(frameTimeNanos: Long)
Link copied to clipboard
open override fun onLongPress(e: MotionEvent)
Link copied to clipboard
open override fun onMove(detector: MoveGestureDetector, e: MotionEvent): Boolean

Responds to moving events for a gesture in progress

open fun onMove(detector: MoveGestureDetector, e: MotionEvent, worldPosition: Position): Boolean
Link copied to clipboard
open override fun onMoveBegin(detector: MoveGestureDetector, e: MotionEvent): Boolean

Responds to the beginning of a moving gesture

Link copied to clipboard
open override fun onMoveEnd(detector: MoveGestureDetector, e: MotionEvent)

Responds to the end of a move gesture

Link copied to clipboard
open fun onRemovedFromScene(scene: Scene)
Link copied to clipboard
open override fun onRotate(detector: RotateGestureDetector, e: MotionEvent): Boolean

Responds to rotating events for a gesture in progress.

open fun onRotate(detector: RotateGestureDetector, e: MotionEvent, rotationDelta: Quaternion): Boolean
Link copied to clipboard
open override fun onRotateBegin(detector: RotateGestureDetector, e: MotionEvent): Boolean

Responds to the beginning of a scaling gesture.

Link copied to clipboard
open override fun onRotateEnd(detector: RotateGestureDetector, e: MotionEvent)

Responds to the end of a scale gesture.

Link copied to clipboard
open override fun onScale(detector: ScaleGestureDetector, e: MotionEvent): Boolean

Responds to scaling events for a gesture in progress.

open fun onScale(detector: ScaleGestureDetector, e: MotionEvent, scaleFactor: Float): Boolean
Link copied to clipboard
open override fun onScaleBegin(detector: ScaleGestureDetector, e: MotionEvent): Boolean

Responds to the beginning of a scaling gesture. Reported by new pointers going down.

Link copied to clipboard
open override fun onScaleEnd(detector: ScaleGestureDetector, e: MotionEvent)

Responds to the end of a scale gesture. Reported by existing pointers going up.

Link copied to clipboard
open override fun onScroll(e1: MotionEvent?, e2: MotionEvent, distanceX: Float, distanceY: Float): Boolean
Link copied to clipboard
open override fun onShowPress(e: MotionEvent)
Link copied to clipboard
Link copied to clipboard
open override fun onSingleTapUp(e: MotionEvent): Boolean
Link copied to clipboard
open fun onTouchEvent(e: MotionEvent, hitResult: HitResult): Boolean
Link copied to clipboard

The transformation (position, rotation or scale) of the Node has changed.

Link copied to clipboard

The transformation (position, rotation or scale) of the Node has changed.

Link copied to clipboard
fun overlapTest(): Node?

Tests to see if this node collision shape overlaps the collision shape of any other nodes in the scene using Node.collisionShape.

Link copied to clipboard
fun overlapTestAll(): List<Node>

Tests to see if a node is overlapping any other nodes within the scene using Node.collisionShape.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun setIntensity(watts: Float, efficiency: Float)

Dynamically updates the light's intensity. The intensity can be negative.

Link copied to clipboard
open fun setIntensityCandela(intensity: Float)

Dynamically updates the light's intensity in candela. The intensity can be negative.

Link copied to clipboard
open fun setLightChannel(@IntRange(from = 0, to = 7) channel: Int, enable: Boolean)

Enables or disables a light channel. Light channel 0 is enabled by default.

Link copied to clipboard
fun setScale(scale: Float)

The node scale.

Link copied to clipboard
open fun setSpotLightCone(inner: Float, outer: Float)

Dynamically updates a spot light's cone as angles

Link copied to clipboard
open fun transform(transform: Transform, smooth: Boolean = isSmoothTransformEnabled, smoothSpeed: Float = smoothTransformSpeed): Node
fun transform(position: Position = this.position, rotation: Rotation, scale: Scale = this.scale, smooth: Boolean = isSmoothTransformEnabled, smoothSpeed: Float = smoothTransformSpeed): Node
fun transform(position: Position = this.position, quaternion: Quaternion = this.quaternion, scale: Scale = this.scale, smooth: Boolean = isSmoothTransformEnabled, smoothSpeed: Float = smoothTransformSpeed): Node

Change the node transform.

Link copied to clipboard
open fun worldTransform(worldTransform: Transform, smooth: Boolean = isSmoothTransformEnabled, smoothSpeed: Float = smoothTransformSpeed): Node
fun worldTransform(position: Position = this.worldPosition, rotation: Rotation, scale: Scale = this.worldScale, smooth: Boolean = isSmoothTransformEnabled, smoothSpeed: Float = smoothTransformSpeed): Node
fun worldTransform(position: Position = this.worldPosition, quaternion: Quaternion = this.worldQuaternion, scale: Scale = this.worldScale, smooth: Boolean = isSmoothTransformEnabled, smoothSpeed: Float = smoothTransformSpeed): Node

Change the node world transform.