Skip to content

Commit

Permalink
Fix typing failures
Browse files Browse the repository at this point in the history
  • Loading branch information
arjxn-py committed Sep 27, 2024
1 parent 883b765 commit 7c0c029
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/base/src/3dview/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const SELECTED_MESH_COLOR = new THREE.Color(

export type BasicMesh = THREE.Mesh<
THREE.BufferGeometry,
THREE.MeshBasicMaterial
THREE.MeshBasicMaterial | THREE.MeshPhongMaterial
>;

/**
Expand Down
10 changes: 7 additions & 3 deletions packages/base/src/3dview/mainview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ export class MainView extends React.Component<IProps, IStates> {
this._model.syncCamera(
{
position: this._camera.position.toArray([]),
rotation: this._camera.rotation.toArray([]),
rotation: [this._camera.rotation.x, this._camera.rotation.y, this._camera.rotation.z],
up: this._camera.up.toArray([])
},
this._mainViewModel.id
Expand Down Expand Up @@ -382,10 +382,11 @@ export class MainView extends React.Component<IProps, IStates> {
this.divRef.current.clientHeight,
false
);
if (this._camera.type === 'PerspectiveCamera') {
if (this._camera instanceof THREE.PerspectiveCamera) {
this._camera.aspect =
this.divRef.current.clientWidth / this.divRef.current.clientHeight;
} else {
}
else if (this._camera instanceof THREE.OrthographicCamera) {
this._camera.left = this.divRef.current.clientWidth / -2;
this._camera.right = this.divRef.current.clientWidth / 2;
this._camera.top = this.divRef.current.clientHeight / 2;
Expand Down Expand Up @@ -821,6 +822,9 @@ export class MainView extends React.Component<IProps, IStates> {
pos.postShape = exported as any;
resolve();
},
() => {
// Intentionally empty: no error handling needed for this case
}, // Empty function to handle errors
options
);
});
Expand Down

0 comments on commit 7c0c029

Please sign in to comment.