Capítulo 589 de 859
Can be used to create a flat, reflective surface like a mirror.
Note that this class can only be used with WebGLRenderer. When using WebGPURenderer, use ReflectorNode.
const geometry = new THREE.PlaneGeometry( 100, 100 );
const reflector = new Reflector( geometry, {
clipBias: 0.003,
textureWidth: window.innerWidth * window.devicePixelRatio,
textureHeight: window.innerHeight * window.devicePixelRatio,
color: 0xc1cbcb
} );
scene.add( reflector );
Constructor
| Signature |
|---|
new Reflector( geometry : BufferGeometry, options : Reflector~Options ) |
Properties
| Property | Description |
|---|---|
.forceUpdate : boolean | Whether to force an update, no matter if the reflector is in view or not. |
.isReflector : boolean (readonly) | This flag can be used for type testing. |
Methods
| Method | Description |
|---|---|
.dispose() | Frees the GPU-related resources allocated by this instance. Call this method whenever this instance is no longer used in your app. |
.getReflectionCamera( camera : Camera ) : Camera | Returns a reflection camera for the given camera. The reflection camera is used to render the scene from the reflector's view so correct reflections can be produced. |
.getRenderTarget() : WebGLRenderTarget | Returns the reflector's internal render target. |