-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* centering changes `c` now centers on the bounding sphere of current frame if no atoms selected initiallly center the camera on the bounding sphere on start up added event.js file to improve code organisation * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Generalising get_center to get center of selected atoms Now center corresponds to overall center if no atoms are selected and to the center of selected atoms otherwise Also inverted the if loop in World since the if part was empty * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
a0c0209
commit 33d1316
Showing
6 changed files
with
70 additions
and
23 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import * as THREE from "three"; | ||
|
||
export function centerCamera(controls, particlesGroup) { | ||
if (controls.enablePan) { | ||
// get the first object that is selected | ||
const dummy = new THREE.Vector3(); | ||
dummy.copy(controls.getCenter(particlesGroup.selection)); | ||
controls.target.copy(dummy); | ||
} else { | ||
// follow is currently not working due to instancing | ||
// document.getElementById("alertBoxCamera").style.display = "none"; | ||
// controls.target = controls.target.clone(); | ||
// controls.enablePan = true; | ||
} | ||
} |
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