Renderer · function
screenRayOrigin
Lift a point off the surface it stands on, along that surface's normal.
Explained in Hello world.
function screenRayOrigin(point: ReadonlyVec3, normal: ReadonlyVec3, biasM: number, out: Float32Array): Float32Arrayimport { screenRayOrigin } from '@driftengine/core';Parameters
| Parameter | Type | Description |
|---|---|---|
point | ReadonlyVec3 | |
normal | ReadonlyVec3 | |
biasM | number | |
out | Float32Array |
In depth
A normal that is not unit length is normalised, because an interpolated one rarely is. A normal
of zero length has no direction to lift along, so the point is returned unmoved rather than as
three NaNs — which would reach the projection and come back as a miss for the wrong reason.