WaterBlock tiling to match T2/Torque, improve CLAUDE.md

This commit is contained in:
Brian Beck 2025-12-11 22:07:29 -08:00
parent bcf4f4a1a5
commit aeda3ca8d5
940 changed files with 1207 additions and 337 deletions

View file

@ -0,0 +1,25 @@
import { useCallback, useRef } from "react";
import { Vector3 } from "three";
export function usePositionTracker() {
const positionRef = useRef<Vector3>(null);
const hasChanged = useCallback((position: Vector3) => {
if (!positionRef.current) {
positionRef.current = position.clone();
return true;
}
const isSamePosition =
positionRef.current.x === position.x &&
positionRef.current.y === position.y &&
positionRef.current.z === position.z;
if (!isSamePosition) {
positionRef.current.copy(position);
}
return isSamePosition;
}, []);
return hasChanged;
}