Files
lucidia-metaverse/node_modules/three/examples/jsm/nodes/lighting/LightNode.js
Alexa Louise 47cf47f624 Initial commit: Lucidia Metaverse
Complete 3D metaverse platform with:
- Three.js 3D rendering
- Cannon.js physics engine
- Pointer lock controls
- Procedural cityscape
- Floating islands
- Portal system
- Particle effects
- WebXR/VR support ready
- Multiplayer ready (Socket.io)

Features:
- First-person controls (WASD + mouse)
- Jump and run mechanics
- Chat system
- Real-time HUD
- Loading screen
- Responsive design

Built with Vite for fast builds and hot reload.

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-22 19:02:56 -06:00

58 lines
1.0 KiB
JavaScript

import Node, { addNodeClass } from '../core/Node.js';
import { nodeProxy } from '../shadernode/ShaderNode.js';
import { objectPosition } from '../accessors/Object3DNode.js';
import { cameraViewMatrix } from '../accessors/CameraNode.js';
class LightNode extends Node {
constructor( scope = LightNode.TARGET_DIRECTION, light = null ) {
super();
this.scope = scope;
this.light = light;
}
setup() {
const { scope, light } = this;
let output = null;
if ( scope === LightNode.TARGET_DIRECTION ) {
output = cameraViewMatrix.transformDirection( objectPosition( light ).sub( objectPosition( light.target ) ) );
}
return output;
}
serialize( data ) {
super.serialize( data );
data.scope = this.scope;
}
deserialize( data ) {
super.deserialize( data );
this.scope = data.scope;
}
}
LightNode.TARGET_DIRECTION = 'targetDirection';
export default LightNode;
export const lightTargetDirection = nodeProxy( LightNode, LightNode.TARGET_DIRECTION );
addNodeClass( 'LightNode', LightNode );