Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gizmo fixes #6763

Merged
merged 11 commits into from
Jun 28, 2024
Next Next commit
disabled depth clipping and set start selection to be near clip inste…
…ad of 1
  • Loading branch information
kpal81xd committed Jun 27, 2024
commit 7ab08458ccf05151d356d7720638d310a5fc7d25
2 changes: 1 addition & 1 deletion src/extras/gizmo/axis-shapes.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const SHADER = {
// store z/w for later use in fragment shader
vZW = gl_Position.zw;
// disable depth clipping
gl_Position.z = 0.0;
// gl_Position.z = 0.0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks cleaner when clipping with this so would prefer to have it in but the selection area and rendered area do not align

}`,
frag: /* glsl */`
precision highp float;
Expand Down
4 changes: 2 additions & 2 deletions src/extras/gizmo/gizmo.js
Original file line number Diff line number Diff line change
Expand Up @@ -393,14 +393,14 @@ class Gizmo extends EventHandler {
}

_getSelection(x, y) {
const start = this._camera.screenToWorld(x, y, 1);
const start = this._camera.screenToWorld(x, y, this._camera.nearClip);
const end = this._camera.screenToWorld(x, y, this._camera.farClip);
const dir = end.clone().sub(start).normalize();

const selection = [];
for (let i = 0; i < this.intersectData.length; i++) {
const { triData, parent, meshInstances } = this.intersectData[i];
const wtm = parent.getWorldTransform().clone();
const wtm = parent.getWorldTransform();
for (let j = 0; j < triData.length; j++) {
const { tris, ptm, priority } = triData[j];
tmpM1.copy(wtm).mul(ptm);
Expand Down