Skip to content

Commit

Permalink
geometric (IIntersectable) picking now respects Sg.Active
Browse files Browse the repository at this point in the history
  • Loading branch information
aardvark-platform committed Oct 19, 2024
1 parent 5af7d43 commit 5f19dbe
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
6 changes: 4 additions & 2 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
- Fixed render control samples attribute
- Fixed multisampled raw download
### 1.0.2
* geometric (IIntersectable) picking now respects `Sg.Active`
* Fixed render control samples attribute
* Fixed multisampled raw download

### 1.0.1
* net8.0 updates
Expand Down
27 changes: 15 additions & 12 deletions src/Aardvark.Dom/SceneGraph/SceneHandler.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1033,18 +1033,21 @@ type SceneHandler(signature : IFramebufferSignature, trigger : RenderControlEven


let tryIntersect (skipPickThrough : bool) (tmin : float) (tmax : float) (state : TraversalState) (i : IIntersectable, trafo : Trafo3d) =
let mutable r = 0.0
let mutable n = V3d.Zero
let mutable hit = V3d.Zero
let skip =
if skipPickThrough then state.PickThrough
else false
let localRay = ray.Transformed(trafo.Backward)
if not skip && i.Intersects(localRay, tmin, tmax, &r, &hit, &n) then
let worldPoint = trafo.Forward.TransformPos hit
let depth = vp.Forward.TransformPosProj(worldPoint).Z
let vn = Vec.normalize (v.Backward.TransposedTransformDir (trafo.Backward.TransposedTransformDir n))
Some (r, (state, depth, v.Forward.TransformPos worldPoint, vn))
if AVal.force state.Active then
let mutable r = 0.0
let mutable n = V3d.Zero
let mutable hit = V3d.Zero
let skip =
if skipPickThrough then state.PickThrough
else false
let localRay = ray.Transformed(trafo.Backward)
if not skip && i.Intersects(localRay, tmin, tmax, &r, &hit, &n) then
let worldPoint = trafo.Forward.TransformPos hit
let depth = vp.Forward.TransformPosProj(worldPoint).Z
let vn = Vec.normalize (v.Backward.TransposedTransformDir (trafo.Backward.TransposedTransformDir n))
Some (r, (state, depth, v.Forward.TransformPos worldPoint, vn))
else
None
else
None

Expand Down

0 comments on commit 5f19dbe

Please sign in to comment.