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
(
target
, offset
, minAngle
, maxAngle
, type
, tolerance
, speed
, active
)
|
Signature
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) Parameters
minAngle:
Float
maxAngle:
Float
tolerance:
Float
speed:
Float
active:
Boolean
Returns |
active
: Boolean
[Get][Set] |
Whether entity is actively following or not
Signature
var active: Boolean |
cachable
: BuildConfig.COMPONENTCACHE_LEVEL >= 1
[Get][Set] |
Signature
open override var cachable: BuildConfig.COMPONENTCACHE_LEVEL >= 1 |
entID
: Long
[Get][Set] |
Signature
var entID: Long |
isDirty
: Boolean
[Get][Set] |
Signature
var isDirty: Boolean |
maxAngle
: Float
[Get][Set] |
Maximum Y angle offset a followable will keep from target, 0 is straight ahead, positive values are up, negative values are down
Signature
var maxAngle: Float |
minAngle
: Float
[Get][Set] |
Minimum Y angle offset a followable will keep from target, 0 is straight ahead, positive values are up, negative values are down
Signature
var minAngle: Float |
offset
: Pose
[Get][Set] |
Pose offset to keep from target. Defining a quaternion will rotate the Entity
Signature
var offset: Pose |
recycled
: Boolean
[Get][Set] |
Signature
var recycled: Boolean |
speed
: Float
[Get][Set] |
How fast followable tracks to its desired location. Float value is a percent of default speed
Signature
var speed: Float |
target
: Entity
[Get][Set] |
Target Entity to follow
Signature
var target: Entity |
timeStamp
: Long
[Get][Set] |
Signature
var timeStamp: Long |
tolerance
: Float
[Get][Set] |
This is the change in distance needed to start moving
Signature
var tolerance: Float |
type
: FollowableType
[Get][Set] |
The type of behavior an object has when following (faces user, pivots on y axis, etc.)
Signature
var type: FollowableType |
companion
()
|
Gets the companion object for this component.
The companion object provides metadata about the component.
Signature
open override fun companion(): ComponentCompanion Throws
RuntimeException
|
getComponentDataAttributeType
(
key
)
|
Gets the attribute type for the specified key.
Signature
fun getComponentDataAttributeType(key: Int): AttributePrimitive? Parameters
key:
Int
|
getComponentDataAttributeType
(
keyString
)
|
Gets the attribute type for the specified string key.
Signature
fun getComponentDataAttributeType(keyString: String): AttributePrimitive? Parameters
keyString:
String
Throws
IllegalArgumentException
|
getComponentDataKey
(
key
)
|
Gets the integer key associated with the specified string key.
Signature
fun getComponentDataKey(key: String): Int? Parameters
key:
String
Returns
Int?
|
getComponentDataValue
(
key
)
|
Gets the value for the specified key.
Signature
fun getComponentDataValue(key: Int): Any? Parameters
key:
Int
Returns
Any?
|
getComponentDataValue
(
keyString
)
|
Gets the value for the specified string key.
Signature
fun getComponentDataValue(keyString: String): Any? Parameters
keyString:
String
Returns
Any?
Throws
IllegalArgumentException
|
getEnumClass
(
key
)
|
Gets the enum class associated with the specified string key.
Signature
fun getEnumClass(key: String): Class<out Enum<*>>? Parameters
key:
String
Returns
Class?
|
hasComponentData
(
key
)
|
Checks if this component has data for the specified key.
Signature
fun hasComponentData(key: Int): Boolean Parameters
key:
Int
Returns
Boolean
|
hasComponentData
(
keyString
)
|
Checks if this component has data for the specified string key.
Signature
fun hasComponentData(keyString: String): Boolean Parameters
keyString:
String
Returns
Boolean
|
read
(
e
, cachable
)
|
Reads component data from the specified entity.
Signature
fun read(e: Entity, cachable: Boolean) Parameters
cachable:
Boolean
|
recycle
()
|
Recycles this component by returning it to its pool.
If the component has a pool assigned, it will be returned to that pool for reuse.
Signature
fun recycle() |
reset
()
|
Resets the component to its default state.
This method is called when a component is recycled to clear any state. Subclasses should override this method to reset their specific state.
Signature
open fun reset() |
setComponentDataValue
(
key
, value
)
|
Sets the value for the specified key.
Signature
fun setComponentDataValue(key: Int, value: Any): Boolean Parameters
key:
Int
value:
Any
Returns
Boolean
|
setComponentDataValue
(
keyString
, value
)
|
Sets the value for the specified string key.
Signature
fun setComponentDataValue(keyString: String, value: Any): Boolean Parameters
keyString:
String
value:
Any
Returns
Boolean
|
setPool
(
pool
, entID
)
|
Sets the component pool and entity ID for this component.
This is used for component recycling to track which pool the component belongs to and which entity it was associated with.
Signature
fun setPool(pool: ComponentPool<*>, entID: Long) Parameters
pool:
ComponentPool
entID:
Long
|
toString
()
|
Signature
open override fun toString(): String Returns
String
|
typeID
()
|
Returns the unique type ID of this component.
Each component type must have a unique ID for identification in the entity-component system.
Signature
open override fun typeID(): Int Returns
Int
|
write
(
e
)
|
Writes this component's data to the specified entity.
Signature
fun write(e: Entity) Parameters |
activeData
: BooleanAttributeData
[Get] |
Signature
val activeData: BooleanAttributeData |
activeId
[Get] |
Signature
val activeId: |
attributeKeys_
: IntArray
[Get] |
Signature
val attributeKeys_: IntArray |
attributeTypeCounts_
: IntArray
[Get] |
Signature
val attributeTypeCounts_: IntArray |
attributeTypes_
: IntArray
[Get] |
Signature
val attributeTypes_: IntArray |
attrMetaData_
: Map
[Get] |
Signature
val attrMetaData_: Map |
createDefaultInstance
: Function0
[Get] |
Signature
open override val createDefaultInstance: () -> Followable |
enumClassesMap_
: Map
[Get] |
Signature
val enumClassesMap_: Map<Int, Class<out Enum<*>>> |
id
[Get] |
Signature
open override val id: |
keyStringToKeyIntMap_
: Map
[Get] |
Signature
val keyStringToKeyIntMap_: Map<String, Int> |
maxAngleData
: FloatAttributeData
[Get] |
Signature
val maxAngleData: FloatAttributeData |
maxAngleId
[Get] |
Signature
val maxAngleId: |
minAngleData
: FloatAttributeData
[Get] |
Signature
val minAngleData: FloatAttributeData |
minAngleId
[Get] |
Signature
val minAngleId: |
offsetData
: PoseAttributeData
[Get] |
Signature
val offsetData: PoseAttributeData |
offsetId
[Get] |
Signature
val offsetId: |
speedData
: FloatAttributeData
[Get] |
Signature
val speedData: FloatAttributeData |
speedId
[Get] |
Signature
val speedId: |
targetData
: EntityAttributeData
[Get] |
Signature
val targetData: EntityAttributeData |
targetId
[Get] |
Signature
val targetId: |
toleranceData
: FloatAttributeData
[Get] |
Signature
val toleranceData: FloatAttributeData |
toleranceId
[Get] |
Signature
val toleranceId: |
typeData
: EnumAttributeData
[Get] |
Signature
val typeData: EnumAttributeData |
typeId
[Get] |
Signature
val typeId: |
attributeKeys
()
|
Signature
open override fun attributeKeys(): IntArray Returns
IntArray
|
attributeMetaData
()
| Returns
Map
|
attributeTypeCountAvailable
()
|
Signature
open override fun attributeTypeCountAvailable(): Boolean Returns
Boolean
|
attributeTypeCounts
()
|
Signature
open override fun attributeTypeCounts(): IntArray Returns
IntArray
|
attributeTypes
()
|
Signature
open override fun attributeTypes(): IntArray Returns
IntArray
|
dependents
()
|
Signature
open fun dependents(): IntArray Returns
IntArray
|
enumClassesMap
()
|
Signature
open override fun enumClassesMap(): Map<Int, Class<out Enum<*>>> Returns
Map
|
keyStringToKeyIntMap
(
keyString
)
|
Signature
open override fun keyStringToKeyIntMap(keyString: String): Int? Parameters
keyString:
String
Returns
Int?
|