Skip to content

@modoki/engine / index / shapeCast3D

Function: shapeCast3D() ​

shapeCast3D(world, ox, oy, oz, dx, dy, dz, radius, opts?): { distance: number; entityId: number; nx: number; ny: number; nz: number; x: number; y: number; z: number; } | null

Sweep a sphere of radius (world units) from the origin along the direction and return the first collider it would hit — the "would this fit if I move it here" query. x,y,z is the swept sphere's CENTER at impact. maxDistance in world units.

Parameters ​

world ​

World

ox ​

number

oy ​

number

oz ​

number

dx ​

number

dy ​

number

dz ​

number

radius ​

number

opts? ​

maxDistance? ​

number

Returns ​

Type Literal ​

{ distance: number; entityId: number; nx: number; ny: number; nz: number; x: number; y: number; z: number; }

Physics ​

distance ​

distance: number

entityId ​

entityId: number

nx ​

nx: number

ny ​

ny: number

nz ​

nz: number

x ​

x: number

y ​

y: number

z ​

z: number


null

Built with Modoki.