API reference
API reference
Select your platform
No SDKs available
No versions available

Controller

Controller

class Controller(buttonState: Int = 0, changedButtons: Int = 0, isActive: Boolean = false, type: ControllerType = ControllerType.CONTROLLER, directTouchEnabled: Boolean = false, directTouchButtonState: Int = 0, laserEnabled: Boolean = true) : ComponentBase
Represents Controller Data and properties that can be used to facilitate input.
Parameters
JVM
NameSummary
buttonState
The current state of the buttons being pressed represented by integer bits
changedButtons
Which buttons (represented by integer bits) have been changed (pressed or unpressed)
isActive
Whether the controller is active or not
type
What type of controller it is: 0->controller 1->hand
directTouchEnabled
Whether direct touch is enabled or not
directTouchButtonState
The state of the direct touch buttons
laserEnabled
Whether the laser is enabled or not

Constructors

NameSummary
Controller
constructor(buttonState: Int = 0, changedButtons: Int = 0, isActive: Boolean = false, type: ControllerType = ControllerType.CONTROLLER, directTouchEnabled: Boolean = false, directTouchButtonState: Int = 0, laserEnabled: Boolean = true)

Types

NameSummary
Companion
object Companion : ComponentCompanion

Properties

NameSummary
buttonState
var buttonState: Int
The current state of the buttons being pressed represented by integer bits
cachable
open val cachable: Boolean = false
changedButtons
var changedButtons: Int
Which buttons (represented by integer bits) have been changed (pressed or unpressed since the last frame)
creationTime
var creationTime: Long
directTouchButtonState
var directTouchButtonState: Int
The state of the direct touch buttons
directTouchEnabled
var directTouchEnabled: Boolean
isActive
var isActive: Boolean
isDirty
var isDirty: Boolean
laserEnabled
var laserEnabled: Boolean
recycled
var recycled: Boolean
type
var type: ControllerType
What type of controller it is: 0->controller 1->hand 2->eye

Functions

NameSummary
getComponentDataAttributeType
fun getComponentDataAttributeType(key: Int): AttributePrimitive?
fun getComponentDataAttributeType(keyString: String): AttributePrimitive?
getComponentDataKey
fun getComponentDataKey(key: String): Int?
getComponentDataValue
fun getComponentDataValue(key: Int): Any?
fun getComponentDataValue(keyString: String): Any?
getEnumClass
fun getEnumClass(key: String): Class<out Enum<*>>?
hasComponentData
fun hasComponentData(key: Int): Boolean
fun hasComponentData(keyString: String): Boolean
read
fun read(e: Entity, cachable: Boolean)
recycle
fun recycle()
reset
open fun reset()
setComponentDataValue
fun setComponentDataValue(key: Int, value: Any?): Boolean
fun setComponentDataValue(keyString: String, value: Any?): Boolean
setPool
fun setPool(pool: ComponentPool<*>)
toString
open override fun toString(): String
typeID
open override fun typeID(): Int
write
fun write(e: Entity)

Companion

object Companion : ComponentCompanion

Properties

NameSummary
buttonStateId
val buttonStateId: <Error class: unknown class>
changedButtonsId
val changedButtonsId: <Error class: unknown class>
createDefaultInstance
open override val createDefaultInstance: () -> Controller
directTouchButtonStateId
val directTouchButtonStateId: <Error class: unknown class>
directTouchEnabledId
val directTouchEnabledId: <Error class: unknown class>
id
open override val id: <Error class: unknown class>
isActiveId
val isActiveId: <Error class: unknown class>
laserEnabledId
val laserEnabledId: <Error class: unknown class>
typeId
val typeId: <Error class: unknown class>

Functions

NameSummary
dependents
open fun dependents(): IntArray
Did you find this page helpful?