Physics · class
RibbonSurface
Explained in Your first game, Rigid bodies.
class RibbonSurfaceimport { RibbonSurface } from '@driftengine/physics';Constructor
new
constructor(spline: Spline, options?: RibbonSurfaceOptions)| Parameter | Type | Description |
|---|---|---|
spline | Spline | |
options? | RibbonSurfaceOptions |
Methods
sample
sample(x: number, z: number, out: SurfaceHit, atY?: number): booleanAsk what the surface is doing in the column above/below (x, z).
| Parameter | Type | Description |
|---|---|---|
x | number | |
z | number | |
out | SurfaceHit | |
atY? | number |
More
Returns false where there is no surface — off the edge, past either end, or
over a hole — and leaves out untouched in that case.
sampleBand
sampleBand(x: number, z: number, out: SurfaceHit, loY: number, hiY: number): booleanSee GroundSurface.sampleBand: the highest pass in the band, exactly.
| Parameter | Type | Description |
|---|---|---|
x | number | |
z | number | |
out | SurfaceHit | |
loY | number | |
hiY | number |