Renderer · class
ReflectiveSurface
A box a consumer declares, inside which surfaces reflect what the frame drew.
Explained in Hello world.
class ReflectiveSurfaceimport { ReflectiveSurface } from '@driftengine/core';In depth
Held and moved, like DecalProjector and for the same reason: a wet patch follows the rain and
a polished floor does not move at all, and rebuilding two matrices from four vectors is the whole
of a pose. Both matrices live in the object and are rewritten in place.
Constructor
new
constructor(options: ReflectiveSurfaceOptions)| Parameter | Type | Description |
|---|---|---|
options | ReflectiveSurfaceOptions |
Properties
| Name | Type | Description |
|---|---|---|
worldToSurfacereadonly | Float32Array<ArrayBuffer> | World space into the box, [-1, 1] on each axis. |
surfaceToWorldreadonly | Float32Array<ArrayBuffer> | The box back into the world, for the scissor bound. |
axisreadonly | Float32Array<ArrayBuffer> | Which way the reflective surfaces inside the box face, normalised and pointing into them. |
tintreadonly | Float32Array<ArrayBuffer> | |
strength | number | |
fresnel | boolean | See ReflectiveSurfaceOptions.fresnel. |
roughness | number | |
reachM | number | |
thicknessM | number | |
steps | number | |
facingCos | number |
Methods
setPose
setPose(center: ReadonlyVec3, forward: ReadonlyVec3, up: ReadonlyVec3): voidMove the box. Allocation-free, so a wet patch may follow the weather every frame.
| Parameter | Type | Description |
|---|---|---|
center | ReadonlyVec3 | |
forward | ReadonlyVec3 | |
up | ReadonlyVec3 |
setSize
setSize(halfExtents: ReadonlyVec3): void| Parameter | Type | Description |
|---|---|---|
halfExtents | ReadonlyVec3 |