本文へスキップ

物理学イベント

イベント

COLLISION_START_EVENT

エンティティが他のエンティティとの衝突を開始したときに発せられる。

プロパティ

プロパティタイプ概要
otherイード衝突するエンティティのイード

defineState('initial-state').initial().listen(eid, ecs.physics.COLLISION_START_EVENT, (event) => {
console.log('Collided with', event.data.other)
})

COLLISION_END_EVENT

エンティティが他のエンティティとの衝突を停止したときに発せられる。

Properties

プロパティタイプ説明
othereid衝突するエンティティのイード

defineState('initial-state').initial().listen(eid, ecs.physics.COLLISION_END_EVENT, (event) => {
console.log('Stopped colliding with', event.data.other)
})

UPDATE_EVENT

物理アップデートの直後、レンダリング前にworld.events.globalIdで発せられる。

プロパティ

いない。

defineState('initial-state').initial().listen(world.events.globalId, ecs.physics.UPDATE_EVENT, () => {
console.log('Physics update')
})