Capítulo 462 de 859

Chapter 462: ReflectorNode

Core Idea

This node can be used to implement mirror-like flat reflective surfaces.

Key Concepts

  • reflector : ReflectorBaseNode: A reference to the internal reflector node.
  • target : Object3D: A reference to 3D object the reflector is linked to.

Code Examples

const groundReflector = reflector();
material.colorNode = groundReflector;
const plane = new Mesh( geometry, material );
plane.add( groundReflector.target );
  • What it demonstrates: Typical usage of ReflectorNode.

Reference Tables

Constructor

Signature
new ReflectorNode( parameters : Object )

Properties

PropertyDescription
.reflector : ReflectorBaseNodeA reference to the internal reflector node.
.target : Object3DA reference to 3D object the reflector is linked to.

Methods

MethodDescription
.dispose()Frees internal resources. Should be called when the node is no longer in use.
.getDepthNode() : NodeReturns a node representing the mirror's depth. That can be used to implement more advanced reflection effects like distance attenuation.

Key Takeaways

  1. ReflectorNode extends: EventDispatcher → Node → InputNode → UniformNode → TextureNode
  2. Most relevant properties: reflector, target.
  3. Key methods: dispose, getDepthNode.

Connects To

  • EventDispatcher: parent class
  • Node: parent class
  • InputNode: parent class
  • UniformNode: parent class
  • TextureNode: parent class
  • Source: src/nodes/utils/ReflectorNode.js