Node3D

open class Node3D : Node

Based off of the kool engine implementation.

Author

Colton Daily

Constructors

Link copied to clipboard
fun Node3D()

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun addChild(child: Node): Node

Sets the parent of the child to this Node.

Link copied to clipboard
fun addChildAt(child: Node, index: Int): Node

Sets the parent of the child to this Node sets it at the specified index.

Link copied to clipboard
fun addChildren(vararg children: Node): Node

Sets the parent of the children to this Node.

Link copied to clipboard
open fun callInput(event: InputEvent<*>)
Link copied to clipboard
open fun callUnhandledInput(event: InputEvent<*>)
Link copied to clipboard
open operator override fun compareTo(other: Node): Int

Compares Node by depth and position at each depth.

Link copied to clipboard
fun destroy()

Remove the Node from the SceneGraph and destroys all children.

Link copied to clipboard

Removes & destroys all children nodes.

Link copied to clipboard
fun dirty()
Link copied to clipboard
fun enabled(value: Boolean): Node

Enables/disables the Node. When disabled colliders are removed from the Physics system and will not be called.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard

Sets the position of the Node3D in global space.

Link copied to clipboard
fun globalRotate(x: Angle = Angle.ZERO, y: Angle = Angle.ZERO, z: Angle = Angle.ZERO): Node3D

Rotates in 'global' coordinates.

Link copied to clipboard
fun globalRotation(quaternion: Vec4f): Node3D

Sets the rotation of the Node3D in global space to the given Quaternion.

Link copied to clipboard
fun globalScale(sx: Float, sy: Float, sz: Float): Node3D

Scales up or down by a factor in 'global' coordinates.

Link copied to clipboard

Sets the global scale of the Node3D.

Link copied to clipboard
fun globalTranslate(tx: Float, ty: Float, tz: Float): Node3D

Translates the position by the offset vector in global coordinates.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard

Determines if this Node has zero children nodes.

Link copied to clipboard

Determines if this Node contains any children.

Link copied to clipboard
operator fun minusAssign(child: Node)
Link copied to clipboard
fun moveChild(child: Node, index: Int): Node

Moves a child node to the specified index.

Link copied to clipboard
open fun onDescendantAdded(child: Node)
Link copied to clipboard
open fun onDescendantRemoved(child: Node)
Link copied to clipboard
open fun onDestroy()

Called when destroy is invoked and all of its children have been destroyed.

Link copied to clipboard
open fun parent(parent: Node?): Node

Sets the parent Node of this Node.

Link copied to clipboard
operator fun plusAssign(child: Node)
Link copied to clipboard
fun position(value: Vec3f): Node3D
fun position(x: Float, y: Float, z: Float): Node3D

Sets the position of the Node3D relative to the parent Node. If the Node3D has no parent or if the parent node is NOT a Node3D, then it is the same a globalPosition

Link copied to clipboard
Link copied to clipboard
open fun propagateHit(hx: Float, hy: Float): Control?
Link copied to clipboard
open fun propagateInput(event: InputEvent<*>): Boolean
Link copied to clipboard
open fun propagateInternalDebugRender(batch: Batch, camera: Camera, camera3d: Camera, shapeRenderer: ShapeRenderer, renderCallback: (Node, Batch, Camera, Camera, ShapeRenderer) -> Unit?)
Link copied to clipboard
open fun propagateInternalRender(batch: Batch, camera: Camera, camera3d: Camera, shapeRenderer: ShapeRenderer, renderCallback: (Node, Batch, Camera, Camera, ShapeRenderer) -> Unit?)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun propagateResize(width: Int, height: Int, center: Boolean)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun removeChild(child: Node): Node

Removes the node if this node is its parent.

Link copied to clipboard

Removes the child at the specified index.

Link copied to clipboard
fun rotate(quaternion: Vec4f): Node3D

fun rotate(x: Angle = Angle.ZERO, y: Angle = Angle.ZERO, z: Angle = Angle.ZERO): Node3D

Rotates in 'local' coordinates

Link copied to clipboard
fun rotation(quaternion: Vec4f): Node3D

Sets the rotation of the Node3D relative to the parent Node3D as a Quaternion. If the Node3D has no parent or if the parent node is NOT Node3D, then it is the same a globalRotation

Link copied to clipboard
fun scale(s: Float): Node3D
fun scale(sx: Float, sy: Float, sz: Float): Node3D

Scales up or down by a factor in 'local' coordinates.

Link copied to clipboard
fun scaling(value: Vec3f): Node3D
fun scaling(value: Float): Node3D

Sets the local scale of the Node3D.

fun scaling(x: Float, y: Float, z: Float): Node3D

Sets the local of the Node3D.

Link copied to clipboard

Sends the child node at the specified index to the bottom of this list which will be rendered on top.

Link copied to clipboard

Sends the child node at the specified index to the top of this list which will be rendered behind.

Link copied to clipboard

Sends the child node to the bottom of this list which will be rendered on top.

Link copied to clipboard
fun sendChildToTop(child: Node): Node

Sends the child node to the top of this list which will be rendered behind.

Link copied to clipboard
Link copied to clipboard
fun swapChildren(child: Node, child2: Node): Node

Swaps the two children positions within the parents list

Link copied to clipboard
fun swapChildrenAt(idx: Int, idx2: Int): Node

Swaps children positions at the specified indices.

Link copied to clipboard
fun toGlobal(vec: MutableVec3f, w: Float = 1.0f): MutableVec3f

Transforms vec in-place from local to global coordinates.

Link copied to clipboard
fun toLocal(vec: MutableVec3f, w: Float = 1.0f): MutableVec3f

Transforms vec in-place from global to local coordinates.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun translate(offset: Vec3f): Node3D
fun translate(tx: Float, ty: Float, tz: Float): Node3D

Translates the position by the offset vector in local coordinates.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun updateTransform()

Properties

Link copied to clipboard
var canvas: CanvasLayer? = null

The CanvasLayer that this Node belongs to. The closest parent CanvasLayer will be selected. If none are found, the scene root viewport will be used.

Link copied to clipboard

The current child count for this Node. Alias for NodeList.size.

Link copied to clipboard

The children of this Node. Alias for nodes.

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

Enables/disables the node.

Link copied to clipboard

Attempts to grab the SceneGraph.fixedProgressionRatio. Defaults to 1 if not.

Link copied to clipboard
Link copied to clipboard

The position of the Node3D in global space. If you want to set the x,y properties of this Vec3f then use the globalX, globalY, and globalZ properties of this Node3D

Link copied to clipboard

The rotation of the Node3D in global space as a Quaternion.

Link copied to clipboard

The global scale of the Node3D. If you want to set the x,y properties of this Vec3f then use the globalScaleX, globalScaleY, globalScaleZ properties of this Node3D.

Link copied to clipboard

The global x-scale of the Node3D.

Link copied to clipboard

The global y-scale of the Node3D.

Link copied to clipboard

The global z-scale of the Node3D.

Link copied to clipboard
Link copied to clipboard

Global transform. Product of _transform and the _transform of the parent Node3D.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val id: Int

Unique identifier for this node.

Link copied to clipboard
val index: Int

The index of this Node as a child in it's parent.

Link copied to clipboard

Check if this Node is in a SceneGraph

Link copied to clipboard

If destroy was called, this will be true until the next time node's are processed.

Link copied to clipboard
Link copied to clipboard

Node name. useful for doing scene-wide searches for an node

Link copied to clipboard

The list of Nodes in this scene.

Link copied to clipboard

List of 'addedToScene' callbacks called when onAddedToScene is called. Add any additional callbacks directly to this list. The main use is to add callbacks directly to nodes inline when building a SceneGraph vs having to extend a class directly.

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

List of 'destroy' callbacks called when destroy is called. Add any additional callbacks directly to this list. The main use is to add callbacks directly to nodes inline when building a SceneGraph vs having to extend a class directly.

Link copied to clipboard

List of 'onDisabled' callbacks called when onDisabled is called. Add any additional callbacks directly to this list. The main use is to add callbacks directly to nodes inline when building a SceneGraph vs having to extend a class directly.

Link copied to clipboard

List of 'onEnabled' callbacks called when onEnabled is called. Add any additional callbacks directly to this list. The main use is to add callbacks directly to nodes inline when building a SceneGraph vs having to extend a class directly.

Link copied to clipboard

List of 'fixed-update' callbacks called when fixedUpdate is called. Add any additional callbacks directly to this list. The main use is to add callbacks directly to nodes inline when building a SceneGraph vs having to extend a class directly.

Link copied to clipboard

List of 'input' callbacks called when input is called. Add any additional callbacks directly to this list. The main use is to add callbacks directly to nodes inline when building a SceneGraph vs having to extend a class directly.

Link copied to clipboard

List of 'post-update' callbacks called when postUpdate is called. Add any additional callbacks directly to this list. The main use is to add callbacks directly to nodes inline when building a SceneGraph vs having to extend a class directly.

Link copied to clipboard

List of 'pre-update' callbacks called when preUpdate is called. Add any additional callbacks directly to this list. The main use is to add callbacks directly to nodes inline when building a SceneGraph vs having to extend a class directly.

Link copied to clipboard

List of 'ready' callbacks called when ready is called. Add any additional callbacks directly to this list. The main use is to add callbacks directly to nodes inline when building a SceneGraph vs having to extend a class directly.

Link copied to clipboard

List of 'removedFromScene' callbacks called when onRemovedFromScene is called. Add any additional callbacks directly to this list. The main use is to add callbacks directly to nodes inline when building a SceneGraph vs having to extend a class directly.

Link copied to clipboard
Link copied to clipboard

List of 'resize' callbacks called when resize is called. Add any additional callbacks directly to this list. The main use is to add callbacks directly to nodes inline when building a SceneGraph vs having to extend a class directly.

Link copied to clipboard

List of 'unhandledInput' callbacks called when unhandledInput is called. Add any additional callbacks directly to this list. The main use is to add callbacks directly to nodes inline when building a SceneGraph vs having to extend a class directly.

Link copied to clipboard

List of 'update' callbacks called when update is called. Add any additional callbacks directly to this list. The main use is to add callbacks directly to nodes inline when building a SceneGraph vs having to extend a class directly.

Link copied to clipboard
var parent: Node?

The parent Node, if any.

Link copied to clipboard

The position of the Node3D relative to the parent transform. If the Node3D has no parent or if the parent node is NOT a Node3D, then it is the same a globalPosition. If you want to set the x,y properties of this Vec3f then use the x, y, and z properties of this Node3D

Link copied to clipboard
val ppu: Float

Pixels per unit. Mainly used when rendering a Node. This is based off of the SceneGraph.ppu.

Link copied to clipboard

The inverse of ppu. This is based off the SceneGraph.ppuInv.

Link copied to clipboard

The rotation of the Node3D relative to the parent transform's rotation as a Quaternion. If the Node3D has no parent or if the parent node is NOT a Node3D, then it is the same a globalRotation

Link copied to clipboard

The scale of the Node3D relative to the parent transform's scales. If the Node3D has no parent or if the parent node is NOT a Node3D, then it is the same a globalScaling. If you want to set the x,y properties of this Vec3f then use the scaleX, scaleY, scaleZ properties of this Node3D.

Link copied to clipboard

The x-scale of the Node3D relative to the parent transform's scales.

Link copied to clipboard

The y-scale of the Node3D relative to the parent transform's scales.

Link copied to clipboard

The z-scale of the Node3D relative to the parent transform's scales.

Link copied to clipboard
var scene: SceneGraph<*>?

The scene this node belongs to.

Link copied to clipboard

Local transform based on translation, scale, and rotation.

Link copied to clipboard

Specifies how often this node's update method should be called. 1 means every frame, 2 is every other, etc

Link copied to clipboard
var x: Float
Link copied to clipboard
var y: Float
Link copied to clipboard
var z: Float

Inheritors

Link copied to clipboard
Link copied to clipboard

Extensions

Link copied to clipboard
inline fun Node.button(callback: Button.() -> Unit = {}): Button

Adds a Button to the current Node as a child and then triggers the callback

Link copied to clipboard
inline fun Node.camera2d(callback: Camera2D.() -> Unit = {}): Camera2D

Adds a Camera2D to the current Node as a child and then triggers the callback

Link copied to clipboard
inline fun Node.camera3d(callback: Camera3D.() -> Unit = {}): Camera3D

Adds a Camera3D to the current Node as a child and then triggers the callback

Link copied to clipboard
inline fun Node.canvasLayer(callback: CanvasLayer.() -> Unit = {}): CanvasLayer

Adds a CanvasLayer to the current Node as a child and then triggers the callback

Link copied to clipboard
inline fun Node.centerContainer(callback: CenterContainer.() -> Unit = {}): CenterContainer

Adds a CenterContainer to the current Node as a child and then triggers the callback

Link copied to clipboard
inline fun Node.column(callback: VBoxContainer.() -> Unit = {}): VBoxContainer

Adds a VBoxContainer to the current Node as a child and then triggers the callback

Link copied to clipboard
inline fun Node.container(callback: Container.() -> Unit = {}): Container

Adds a Container to the current Node as a child and then triggers the callback

Link copied to clipboard
inline fun Node.control(callback: Control.() -> Unit = {}): Control

Adds a Control to the current Node as a child and then triggers the callback

Link copied to clipboard
inline fun Node.directionalLight(callback: DirectionalLight.() -> Unit = {}): DirectionalLight

Adds a DirectionalLight to the current Node as a child and then triggers the callback

Link copied to clipboard
inline fun <T : Node> Node.findFirstNodeOfType(): T?
Link copied to clipboard
inline fun Node.frameBuffer(callback: FrameBufferNode.() -> Unit = {}): FrameBufferNode
Link copied to clipboard

Adds a FrameBufferContainer to the current Node as a child and then triggers the callback

Link copied to clipboard
inline fun Node.hBoxContainer(callback: HBoxContainer.() -> Unit = {}): HBoxContainer

Adds a HBoxContainer to the current Node as a child and then triggers the callback

Link copied to clipboard
inline fun Node.hScrollBar(callback: HScrollBar.() -> Unit = {}): HScrollBar

Adds a HScrollBar to the current Node as a child and then triggers the callback

Link copied to clipboard
inline fun Node.label(callback: Label.() -> Unit = {}): Label

Adds a Label to the current Node as a child and then triggers the callback

Link copied to clipboard
inline fun Node.lineEdit(callback: LineEdit.() -> Unit = {}): LineEdit

Adds a LineEdit to the current Node as a child and then triggers the callback

Link copied to clipboard
inline fun Node.meshNode(callback: MeshNode.() -> Unit = {}): MeshNode

Adds a MeshNode to the current Node as a child and then triggers the callback

Link copied to clipboard
inline fun Node.ninePatchRect(callback: NinePatchRect.() -> Unit = {}): NinePatchRect

Adds a NinePatchRect to the current Node as a child and then triggers the callback

Link copied to clipboard
inline fun Node.node(callback: Node.() -> Unit = {}): Node

Adds a Node to the current Node as a child and then triggers the callback

inline fun <T : Node> Node.node(node: T, callback: T.() -> Unit = {}): T

Adds the specified Node to the current Node as a child and then triggers the callback. This can be used for classes that extend node that perhaps they don't have a DSL method to initialize it.

Link copied to clipboard
inline fun Node.node2d(callback: Node2D.() -> Unit = {}): Node2D

Adds a Node2D to the current Node as a child and then triggers the callback

Link copied to clipboard
inline fun Node.node3d(callback: Node3D.() -> Unit = {}): Node3D

Adds a Node3D to the current Node as a child and then triggers the callback

Link copied to clipboard
inline fun Node.paddedContainer(callback: PaddedContainer.() -> Unit = {}): PaddedContainer

Adds a PaddedContainer to the current Node as a child and then triggers the callback

Link copied to clipboard
inline fun Node.panel(callback: Panel.() -> Unit = {}): Panel

Adds a Panel to the current Node as a child and then triggers the callback

Link copied to clipboard
inline fun Node.panelContainer(callback: PanelContainer.() -> Unit = {}): PanelContainer

Adds a PanelContainer to the current Node as a child and then triggers the callback

Link copied to clipboard
inline fun Node.progressBar(callback: ProgressBar.() -> Unit = {}): ProgressBar

Adds a ProgressBar to the current Node as a child and then triggers the callback

Link copied to clipboard
inline fun Node.row(callback: HBoxContainer.() -> Unit = {}): HBoxContainer

Adds a HBoxContainer to the current Node as a child and then triggers the callback

Link copied to clipboard
inline fun Node.scrollContainer(callback: ScrollContainer.() -> Unit = {}): ScrollContainer

Adds a ScrollContainer to the current Node as a child and then triggers the callback

Link copied to clipboard
inline fun Node.textureProgress(callback: TextureProgress.() -> Unit = {}): TextureProgress

Adds a TextureProgress to the current Node as a child and then triggers the callback

Link copied to clipboard
inline fun Node.textureRect(callback: TextureRect.() -> Unit = {}): TextureRect

Adds a TextureRect to the current Node as a child and then triggers the callback

Link copied to clipboard
inline fun Node.vBoxContainer(callback: VBoxContainer.() -> Unit = {}): VBoxContainer

Adds a VBoxContainer to the current Node as a child and then triggers the callback

Link copied to clipboard
inline fun Node.viewport(callback: ViewportCanvasLayer.() -> Unit = {}): ViewportCanvasLayer

Adds a ViewportCanvasLayer to the current Node as a child and then triggers the callback

Link copied to clipboard
inline fun Node.vScrollBar(callback: VScrollBar.() -> Unit = {}): VScrollBar

Adds a VScrollBar to the current Node as a child and then triggers the callback