Skip to content

Commit

Permalink
Update dependencies, fix camera updir regression
Browse files Browse the repository at this point in the history
  • Loading branch information
brentyi committed Dec 15, 2023
1 parent 7a8b788 commit e8c4c9e
Show file tree
Hide file tree
Showing 4 changed files with 760 additions and 672 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "viser"
version = "0.1.14"
version = "0.1.15"
description = "3D visualization + Python"
readme = "README.md"
license = { text="MIT" }
Expand Down
2 changes: 1 addition & 1 deletion src/viser/client/src/ControlPanel/FloatingPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ FloatingPanel.Contents = function FloatingPanelContents({
const context = React.useContext(FloatingPanelContext)!;
return (
<Collapse in={context.expanded}>
<ScrollArea.Autosize mah={context.maxHeight}>
<ScrollArea.Autosize mah={context.maxHeight} placeholder={null}>
<Box
/* Prevent internals from getting too wide. Needs to match the
* width of the wrapper element above. */
Expand Down
25 changes: 20 additions & 5 deletions src/viser/client/src/WebsocketInterface.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -445,18 +445,33 @@ function useMessageHandler() {
message.position[0],
message.position[1],
message.position[2],
).applyQuaternion(
new THREE.Quaternion().setFromRotationMatrix(T_threeworld_world),
);
)
.normalize()
.applyQuaternion(
new THREE.Quaternion().setFromRotationMatrix(T_threeworld_world),
);
camera.up.set(updir.x, updir.y, updir.z);

// Back up position.
const prevPosition = new THREE.Vector3();
cameraControls.getPosition(prevPosition);

cameraControls.updateCameraUp();
cameraControls.applyCameraUp();

// Restore position, which can get unexpectedly mutated in updateCameraUp().
cameraControls.setPosition(
prevPosition.x,
prevPosition.y,
prevPosition.z,
false,
);
return;
}
case "SetCameraPositionMessage": {
const cameraControls = viewer.cameraControlRef.current!;

// Set the camera position. Note that this will shift the orientation as-well.
// Set the camera position. Due to the look-at, note that this will
// shift the orientation as-well.
const position_cmd = new THREE.Vector3(
message.position[0],
message.position[1],
Expand Down
Loading

0 comments on commit e8c4c9e

Please sign in to comment.