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

Followable

Followable

class Followable(target: Entity = Entity.nullEntity(), offset: Pose = Pose(Vector3(0.0f, 0.0f, 3.0f), Quaternion(0.0f, 0.0f, 1.0f, 0.0f)), minAngle: Float = -90f, maxAngle: Float = 90.0f, type: FollowableType = FollowableType.FACE, tolerance: Float = 0.2f, speed: Float = 1.0f, active: Boolean = true) : ComponentBase
Followable is a component that enables an entity to stay in front of another entity. Followable will track the orientation of the parent and move itself to stay in front.
Parameters
JVM
NameSummary
target
Target Entity to follow
offset
Pose offset to keep from target. Defining a quaternion will rotate the Entity
minAngle
Minimum Y angle offset a followable will keep from target, 0 is straight ahead, positive values are up, negative values are down
maxAngle
Maximum Y angle offset a followable will keep from target, 0 is straight ahead, positive values are up, negative values are down
type
The behavior an object has when following (faces user, pivots on y axis, etc.)
tolerance
This is the change in distance needed to start moving
speed
How fast followable tracks to its desired location. Float value is a percent of default speed
active
Whether entity is actively following or not

Constructors

NameSummary
Followable
constructor(target: Entity = Entity.nullEntity(), offset: Pose = Pose(Vector3(0.0f, 0.0f, 3.0f), Quaternion(0.0f, 0.0f, 1.0f, 0.0f)), minAngle: Float = -90f, maxAngle: Float = 90.0f, type: FollowableType = FollowableType.FACE, tolerance: Float = 0.2f, speed: Float = 1.0f, active: Boolean = true)

Types

NameSummary
Companion
object Companion : ComponentCompanion

Properties

NameSummary
active
var active: Boolean
Whether entity is actively following or not
cachable
open val cachable: Boolean
entID
var entID: Long
isDirty
var isDirty: Boolean
maxAngle
var maxAngle: Float
Maximum Y angle offset a followable will keep from target, 0 is straight ahead, positive values are up, negative values are down
minAngle
var minAngle: Float
Minimum Y angle offset a followable will keep from target, 0 is straight ahead, positive values are up, negative values are down
offset
var offset: Pose
Pose offset to keep from target. Defining a quaternion will rotate the Entity
recycled
var recycled: Boolean
speed
var speed: Float
How fast followable tracks to its desired location. Float value is a percent of default speed
target
var target: Entity
Target Entity to follow
timeStamp
var timeStamp: Long
tolerance
var tolerance: Float
This is the change in distance needed to start moving
type
var type: FollowableType
The type of behavior an object has when following (faces user, pivots on y axis, etc.)

Functions

NameSummary
companion
open override fun companion(): ComponentCompanion
companionUnsafe
open override fun companionUnsafe(): ComponentCompanion?
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<*>, entID: Long)
toString
open override fun toString(): String
typeID
open override fun typeID(): Int
write
fun write(e: Entity)

Companion

object Companion : ComponentCompanion

Properties

NameSummary
activeData
val activeData: BooleanAttributeData
activeId
val activeId: <Error class: unknown class>
attributeKeys_
val attributeKeys_: IntArray
attributeTypeCounts_
val attributeTypeCounts_: IntArray
attributeTypes_
val attributeTypes_: IntArray
attrMetaData_
val attrMetaData_: Map<Int, <Error class: unknown class><RegisteredAttributeType, String>>
createDefaultInstance
open override val createDefaultInstance: () -> Followable
enumClassesMap_
val enumClassesMap_: Map<Int, Class<out Enum<*>>>
id
open override val id: <Error class: unknown class>
keyStringToKeyIntMap_
val keyStringToKeyIntMap_: Map<String, Int>
maxAngleData
val maxAngleData: FloatAttributeData
maxAngleId
val maxAngleId: <Error class: unknown class>
minAngleData
val minAngleData: FloatAttributeData
minAngleId
val minAngleId: <Error class: unknown class>
offsetData
val offsetData: PoseAttributeData
offsetId
val offsetId: <Error class: unknown class>
speedData
val speedData: FloatAttributeData
speedId
val speedId: <Error class: unknown class>
targetData
val targetData: EntityAttributeData
targetId
val targetId: <Error class: unknown class>
toleranceData
val toleranceData: FloatAttributeData
toleranceId
val toleranceId: <Error class: unknown class>
typeData
val typeData: EnumAttributeData
typeId
val typeId: <Error class: unknown class>

Functions

NameSummary
attributeKeys
open override fun attributeKeys(): IntArray
attributeMetaData
open override fun attributeMetaData(): Map<Int, <Error class: unknown class><RegisteredAttributeType, String>>
attributeTypeCountAvailable
open override fun attributeTypeCountAvailable(): Boolean
attributeTypeCounts
open override fun attributeTypeCounts(): IntArray
attributeTypes
open override fun attributeTypes(): IntArray
dependents
open fun dependents(): IntArray
enumClassesMap
open override fun enumClassesMap(): Map<Int, Class<out Enum<*>>>
keyStringToKeyIntMap
open override fun keyStringToKeyIntMap(keyString: String): Int?
Did you find this page helpful?
Thumbs up icon
Thumbs down icon