跳转到内容

Physics3DQueries

此内容尚不支持你的语言。

Defined in: physics3d/Physics3DQueries.ts:41

The 3D world’s spatial queries.

A layer mask of 0 means every layer: a caller that did not ask to filter is asking for everything, and answering “nothing” there would be a silent empty result for the commonest call.

new Physics3DQueries(module_, ppu_): Physics3DQueries

Defined in: physics3d/Physics3DQueries.ts:42

Physics3DWasmModule

number

Physics3DQueries

overlapBox(centre, halfExtents, layerMask?): Overlap3DHit[]

Defined in: physics3d/Physics3DQueries.ts:83

The same for a box, given its half-extents.

number

number

number

number

number

number

number = 0

Overlap3DHit[]


overlapSphere(centre, radius, layerMask?): Overlap3DHit[]

Defined in: physics3d/Physics3DQueries.ts:74

Every body overlapping a sphere — what a spawn point asks before it spawns.

number

number

number

number

number = 0

Overlap3DHit[]


raycast(origin, direction, layerMask?): Cast3DHit | null

Defined in: physics3d/Physics3DQueries.ts:46

The nearest body along a ray, or null. direction carries its length.

number

number

number

number

number

number

number = 0

Cast3DHit | null


sphereCast(origin, radius, direction, layerMask?): Cast3DHit | null

Defined in: physics3d/Physics3DQueries.ts:63

Sweeps a sphere along direction and returns the first body it meets.

What a ray cannot answer: a ray is infinitely thin, so it passes through the very gaps a moving body would not fit — “can this thing get there” is a different question from “is anything on this line”.

number

number

number

number

number

number

number

number = 0

Cast3DHit | null