Skip to content

Commit

Permalink
🦄 refactor: remove CameraController
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangechen committed Jan 9, 2025
1 parent 75b403a commit 7acca05
Show file tree
Hide file tree
Showing 21 changed files with 323 additions and 454 deletions.
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ module.exports = {
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
moduleNameMapper: {
threeRenderBuilder: "<rootDir>/packages/chili-three/test/threeRenderBuilder.ts",
"camera-controls": "<rootDir>/packages/chili-three/test/cameraControls.ts",
},
};
75 changes: 47 additions & 28 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 0 additions & 18 deletions packages/chili-core/src/visual/cameraController.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/chili-core/src/visual/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright 2022-2023 the Chili authors. All rights reserved. AGPL-3.0 license.

export * from "./cameraController";
export * from "./cursorType";
export * from "./detectedData";
export * from "./eventHandler";
Expand Down
16 changes: 14 additions & 2 deletions packages/chili-core/src/visual/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,35 @@ import { IDisposable, IPropertyChanged } from "../foundation";
import { Plane, Ray, XY, XYZ } from "../math";
import { INodeFilter, IShapeFilter } from "../selectionFilter";
import { ShapeType } from "../shape";
import { ICameraController } from "./cameraController";
import { VisualShapeData } from "./detectedData";
import { IVisualObject } from "./visualObject";

export enum CameraType {
perspective,
orthographic,
}

export interface IView extends IPropertyChanged, IDisposable {
readonly document: IDocument;
readonly cameraController: ICameraController;
get isClosed(): boolean;
name: string;
workplane: Plane;
cameraType: CameraType;
cameraTarget: XYZ;
cameraPosition: XYZ;
onKeyDown(e: KeyboardEvent): void;
onKeyUp(e: KeyboardEvent): void;
update(): void;
up(): XYZ;
toImage(): string;
direction(): XYZ;
rotate(dx: number, dy: number): void;
zoomIn(): void;
zoomOut(): void;
rayAt(mx: number, my: number): Ray;
screenToWorld(mx: number, my: number): XYZ;
worldToScreen(point: XYZ): XY;
fitContent(): void;
resize(width: number, heigth: number): void;
setDom(element: HTMLElement): void;
close(): void;
Expand Down
1 change: 0 additions & 1 deletion packages/chili-core/src/visual/visual.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { IVisualContext } from "./visualContext";
export interface IVisual extends IDisposable {
readonly document: IDocument;
readonly context: IVisualContext;
readonly viewHandler: IEventHandler;
readonly highlighter: IHighlighter;
update(): void;
eventHandler: IEventHandler;
Expand Down
5 changes: 3 additions & 2 deletions packages/chili-three/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
"description": "",
"main": "src/index.ts",
"devDependencies": {
"@types/three": "0.172.0",
"camera-controls": "^2.9.0",
"chili-core": "*",
"chili-vis": "*",
"@types/three": "0.170.0",
"three": "0.171.0",
"three": "0.172.0",
"three-mesh-bvh": "0.8.3"
}
}
Loading

0 comments on commit 7acca05

Please sign in to comment.