-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from superstar54/fix_transform
- fix currentFrame in operations - fix viewRect in transform - create custom Scene and OrthographicCamera
- Loading branch information
1 parent
b7cdca2
commit 7481a85
Showing
49 changed files
with
412 additions
and
193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import * as THREE from "three"; | ||
|
||
export class OrthographicCamera extends THREE.OrthographicCamera { | ||
constructor(left, right, top, bottom, near, far, tjs = null) { | ||
super(left, right, top, bottom, near, far); | ||
this.tjs = tjs; | ||
} | ||
|
||
// Custom method to update zoom | ||
updateZoom(value) { | ||
if (this.zoom !== value) { | ||
this.zoom = value; | ||
this.updateProjectionMatrix(); // Required to apply the zoom change | ||
this.dispatchObjectEvent({ | ||
data: value, | ||
action: "zoom", | ||
catalog: "camera", | ||
}); | ||
} | ||
} | ||
|
||
// Custom method to update position | ||
updatePosition(x, y, z) { | ||
const newPos = new THREE.Vector3(x, y, z); | ||
if (!this.position.equals(newPos)) { | ||
this.position.copy(newPos); | ||
this.dispatchObjectEvent({ | ||
data: [x, y, z], | ||
action: "position", | ||
catalog: "camera", | ||
}); | ||
} | ||
} | ||
|
||
dispatchObjectEvent(data) { | ||
const event = new CustomEvent("weas", { detail: data }); | ||
this.tjs.containerElement.dispatchEvent(event); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.