Added network interpolation and fix send rate for pointer

This commit is contained in:
Mitchell McCaffrey
2020-07-31 11:03:12 +10:00
parent c6f9b29cc3
commit eed47e644c
3 changed files with 104 additions and 14 deletions

View File

@@ -23,9 +23,6 @@ function MapPointer({
);
const mapStageRef = useContext(MapStageContext);
// const [isBrushDown, setIsBrushDown] = useState(false);
// const [brushPosition, setBrushPosition] = useState({ x: 0, y: 0 });
useEffect(() => {
if (!active) {
return;
@@ -47,7 +44,7 @@ function MapPointer({
}
function handleBrushUp() {
onPointerMove && onPointerUp({ x: 0, y: 0 });
onPointerMove && onPointerUp(getBrushPosition());
}
interactionEmitter.on("dragStart", handleBrushDown);