PhysicsEntity

Inherits from GameEntity

Summary

Constructors

PhysicsEntity(other: EntityBusPeer)
PhysicsEntity(other: Entity)
PhysicsEntity(other: SpatialEntity)
PhysicsEntity(other: GameEntity)

Properties

Name Type
internalHealth float
velocity Vec3
defaultMaterial DataContainer | nil
belongsInPhysicsWorld bool
isPredestructible bool
physicsEntityBase PhysicsEntityBase | nil

Methods

Method Returns
GetMaterial(position: Vec3) DataContainer | nil
SetActiveHealthState(state: int) void
ApplyDamage(damageInfo: DamageInfo) void
ApplyImpulse(impulseData: ImpulseData) void
RegisterCollisionCallback(callback: callable) int
RegisterCollisionCallback(context: any, callback: callable) int
UnregisterCollisionCallback(handle: int) void
RegisterDamageCallback(callback: callable) int
RegisterDamageCallback(context: any, callback: callable) int
UnregisterDamageCallback(handle: int) void
RegisterInteractCallback(callback: callable) int
RegisterInteractCallback(context: any, callback: callable) int
UnregisterInteractCallback(handle: int) void
RegisterImpulseCallback(callback: callable) int
RegisterImpulseCallback(context: any, callback: callable) int
UnregisterImpulseCallback(handle: int) void

Constructors

PhysicsEntity

PhysicsEntity(other: EntityBusPeer)

Parameters

Name Type Description
other EntityBusPeer

PhysicsEntity

PhysicsEntity(other: Entity)

Parameters

Name Type Description
other Entity

PhysicsEntity

PhysicsEntity(other: SpatialEntity)

Parameters

Name Type Description
other SpatialEntity

PhysicsEntity

PhysicsEntity(other: GameEntity)

Parameters

Name Type Description
other GameEntity

Properties

internalHealth

float

velocity

Vec3

defaultMaterial

DataContainer | nil

belongsInPhysicsWorld

bool

isPredestructible

bool

physicsEntityBase

PhysicsEntityBase | nil

Methods

GetMaterial

GetMaterial(position: Vec3): DataContainer | nil

Parameters

Name Type Description
position Vec3

Returns

Type Description
DataContainer | nil

SetActiveHealthState

SetActiveHealthState(state: int)

Parameters

Name Type Description
state int

ApplyDamage

ApplyDamage(damageInfo: DamageInfo)

Parameters

Name Type Description
damageInfo DamageInfo

ApplyImpulse

ApplyImpulse(impulseData: ImpulseData)

Parameters

Name Type Description
impulseData ImpulseData

RegisterCollisionCallback

RegisterCollisionCallback(callback: callable): int

Parameters

Name Type Description
callback callable A callback in the form function(entity: Entity, info: CollisionInfo): bool.

Returns

Type Description
int

RegisterCollisionCallback

RegisterCollisionCallback(context: any, callback: callable): int

Parameters

Name Type Description
context any A context value to pass to the callback.
callback callable A callback in the form function(context: any, entity: Entity, info: CollisionInfo): bool.

Returns

Type Description
int

UnregisterCollisionCallback

UnregisterCollisionCallback(handle: int)

Parameters

Name Type Description
handle int

RegisterDamageCallback

RegisterDamageCallback(callback: callable): int

Parameters

Name Type Description
callback callable A callback in the form function(entity: Entity, damageInfo: DamageInfo, damageGiverInfo: DamageGiverInfo | nil): bool.

Returns

Type Description
int

RegisterDamageCallback

RegisterDamageCallback(context: any, callback: callable): int

Parameters

Name Type Description
context any A context value to pass to the callback.
callback callable A callback in the form function(context: any, entity: Entity, damageInfo: DamageInfo, damageGiverInfo: DamageGiverInfo | nil): bool.

Returns

Type Description
int

UnregisterDamageCallback

UnregisterDamageCallback(handle: int)

Parameters

Name Type Description
handle int

RegisterInteractCallback

RegisterInteractCallback(callback: callable): int

Parameters

Name Type Description
callback callable A callback in the form function(entity: Entity, soldier: SoldierEntity | nil): bool.

Returns

Type Description
int

RegisterInteractCallback

RegisterInteractCallback(context: any, callback: callable): int

Parameters

Name Type Description
context any A context value to pass to the callback.
callback callable A callback in the form function(context: any, entity: Entity, soldier: SoldierEntity | nil): bool.

Returns

Type Description
int

UnregisterInteractCallback

UnregisterInteractCallback(handle: int)

Parameters

Name Type Description
handle int

RegisterImpulseCallback

RegisterImpulseCallback(callback: callable): int

Parameters

Name Type Description
callback callable A callback in the form function(entity: Entity, impulseData: ImpulseData | nil): bool.

Returns

Type Description
int

RegisterImpulseCallback

RegisterImpulseCallback(context: any, callback: callable): int

Parameters

Name Type Description
context any A context value to pass to the callback.
callback callable A callback in the form function(context: any, entity: Entity, impulseData: ImpulseData | nil): bool.

Returns

Type Description
int

UnregisterImpulseCallback

UnregisterImpulseCallback(handle: int)

Parameters

Name Type Description
handle int
Last modified May 23, 2022: fix: inherits from EntityBusPeer (4eabb2cb)