fix cursor position setting
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit

This commit is contained in:
austin 2025-06-08 18:34:58 -04:00
parent 75f0d76170
commit 96de6ad8e8
2 changed files with 5 additions and 4 deletions

View File

@ -2131,6 +2131,7 @@ Sim range update
Fix scene re-adding tree that was previously removed Fix scene re-adding tree that was previously removed
Fix client toolbar update deleting entity that shouldn't be deleted Fix client toolbar update deleting entity that shouldn't be deleted
Fix attachment bug Fix attachment bug
Fix cursor position setting

View File

@ -211,7 +211,7 @@ public class CursorState {
if(cursorPos == null){ if(cursorPos == null){
cursorPos = new Vector3d(centerPos).add(new Vector3d(eyePos).normalize().mul(-CollisionEngine.DEFAULT_INTERACT_DISTANCE)); cursorPos = new Vector3d(centerPos).add(new Vector3d(eyePos).normalize().mul(-CollisionEngine.DEFAULT_INTERACT_DISTANCE));
} }
EntityUtils.getPosition(Globals.cursorState.playerCursor).set(cursorPos); EntityUtils.setPosition(Globals.cursorState.playerCursor, cursorPos);
//clamp block cursor to nearest voxel //clamp block cursor to nearest voxel
if(clampToExistingBlock){ if(clampToExistingBlock){
@ -219,14 +219,14 @@ public class CursorState {
} }
cursorPos.set(this.clampPositionToNearestBlock(cursorPos)); cursorPos.set(this.clampPositionToNearestBlock(cursorPos));
if(Globals.cursorState.playerBlockCursor != null){ if(Globals.cursorState.playerBlockCursor != null){
EntityUtils.getPosition(Globals.cursorState.playerBlockCursor).set(cursorPos); EntityUtils.setPosition(Globals.cursorState.playerBlockCursor, cursorPos);
} }
cursorPos.sub(BlockChunkData.BLOCK_SIZE_MULTIPLIER / 2.0,BlockChunkData.BLOCK_SIZE_MULTIPLIER / 2.0,BlockChunkData.BLOCK_SIZE_MULTIPLIER / 2.0); cursorPos.sub(BlockChunkData.BLOCK_SIZE_MULTIPLIER / 2.0,BlockChunkData.BLOCK_SIZE_MULTIPLIER / 2.0,BlockChunkData.BLOCK_SIZE_MULTIPLIER / 2.0);
EntityUtils.getPosition(CursorState.playerFabCursor).set(cursorPos); EntityUtils.setPosition(CursorState.playerFabCursor, cursorPos);
if(gridAlignmentData != null){ if(gridAlignmentData != null){
CursorState.nudgeGridAlignment(cursorPos,gridAlignmentData); CursorState.nudgeGridAlignment(cursorPos,gridAlignmentData);
} }
EntityUtils.getPosition(CursorState.playerGridAlignedCursor).set(cursorPos); EntityUtils.setPosition(CursorState.playerGridAlignedCursor, cursorPos);
} }
Globals.profiler.endCpuSample(); Globals.profiler.endCpuSample();
} }