Ricochet2DCollisionContext
@zylem/game-lib / behavior / Ricochet2DCollisionContext
Interface: Ricochet2DCollisionContext
Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/ricochet-2d.d.ts:31
Properties
contact
contact:
object
Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/ricochet-2d.d.ts:41
Contact information from the collision
normal?
optionalnormal?:object
The collision normal
normal.x
x:
number
normal.y
y:
number
normal.z?
optionalz?:number
position?
optionalposition?:object
Optional position where the collision occurred. If provided, used for precise offset calculation.
position.x
x:
number
position.y
y:
number
position.z?
optionalz?:number
entity?
optionalentity?:BaseEntityInterface
Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/ricochet-2d.d.ts:32
otherEntity?
optionalotherEntity?:BaseEntityInterface
Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/ricochet-2d.d.ts:33
otherPosition?
optionalotherPosition?:object
Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/ricochet-2d.d.ts:71
Optional position of the other entity in the collision. Used for paddle-style deflection: offset = (contactY - otherY) / halfHeight.
x
x:
number
y
y:
number
z?
optionalz?:number
otherSize?
optionalotherSize?:object
Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/ricochet-2d.d.ts:80
Optional size of the other entity (e.g., paddle size). If provided, used to normalize the offset based on the collision face.
x
x:
number
y
y:
number
z?
optionalz?:number
selfPosition?
optionalselfPosition?:object
Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/ricochet-2d.d.ts:62
Optional position of the entity that owns this behavior. Used with contact.position for offset calculations.
x
x:
number
y
y:
number
z?
optionalz?:number
selfVelocity?
optionalselfVelocity?:object
Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/ricochet-2d.d.ts:35
Current velocity of the entity (optional if entity is provided)
x
x:
number
y
y:
number
z?
optionalz?:number