So I am used to setting helpers like this:
useHelper(sLightRef, THREE.SpotLightHelper);
return (
<spotLight
castShadow
ref={sLightRef}
position={[0, 2, 2]}
args={["#fff", 0.4, 10, Math.PI * 0.3]}
>
</spotLight>
)
Which will create a helper on the SpotLight
object.
What I don't understand is how to create one on the SpotLight's shadow camera. (spotlight.shadow.camera) We can't assign a ref()
to it, since it's not in my return statement. It's created inside of SpotLight component.
In normal Three.js, this is easy:
const helper = new THREE.CameraHelper(spotlight.shadow.camera);
scene.add(helper);
How would I go about doing this in react-three-fiber? Is there something obvious i'm missing? Thank you.