It looks like you're new here. If you want to get involved, click one of these buttons!

- 996 All Categories
- 307 Community
- 233 General
- 36 Tutorials
- 38 Work in Progress and Showcase
- 38 Fabric News: Announcements, Events and Releases
- 3 Announcements and Events
- 14 News, Blogs and Articles
- 4 Centipede Central
- 10 Releases
- 156 Canvas Visual Programming
- 84 Canvas Standalone
- 47 Canvas Graphs and Presets
- 9 Blocks
- 138 Technical Assistance
- 37 Extensions
- 83 KL Programming
- 14 Python Bindings
- 4 VR, AR and Visualization
- 210 Fabric Integrations
- 43 Fabric for Maya
- 25 Fabric for 3ds Max
- 5 Fabric for Softimage
- 61 Fabric for MODO
- 98 Fabric for Unreal (Beta)
- 55 Integrations
- 73 Extensions and Tools
- 23 Kludge Auto-Wrapping Tool
- 47 Kraken Rigging Framework
- 3 Rigging Toolbox

Ahmidou
Posts: **181** ✭✭

in Extensions

Hi, I think i found a small problem in the Ray.intersectPlane:

```
inline Scalar Ray.intersectPlane(in Vec3 planePoint, in Vec3 planeNormal) {
Vec3 w;
Scalar D, N;
w = this.start - planePoint;
D = planeNormal.dot(this.direction);
N = - planeNormal.dot(w);
if (abs(D) < DIVIDEPRECISION) {
// segment is parallel to plane
if (N == 0.0)
return -SCALAR_INFINITE; // segment lies in plane
else
return -SCALAR_INFINITE; // no intersection
}
// they are not parallel
// compute intersect param
Scalar sI = N / D;
if (sI < -PRECISION) {
return - 1; // no intersection --->** SHOULD BE -SCALAR_INFINITE**
}
return sI;
}
```

©Copyright 2017 Fabric Software Inc. All rights reserved. | Privacy

## Comments

185Fabric EmployeeHi Ahmidou,

not sure if this is a problem.

I think the idea behind the different return values is that one can differentiate between the cases "the ray doesn't hit the plane" and "the ray is parallel to the plane". Though I must admit that for the latter case I would return +INF for "ray lies on plane" and "-INF for "ray is parallel to plane but doesn't lie on it".

Is the "-1" return value causing issues for you?

Cheers,

Eric

www.fabricengine.com

www.mootzoid.com

185Fabric EmployeeActually forget what I wrote, sorry.

Yes, indeed, I think you are right: it should return -INF.

I filed ticket FE-8848 to look into it.

Thanks!

Eric

www.fabricengine.com

www.mootzoid.com

181✭✭Thanks @mootzoid ,

on the same note I think it would be nice if we have the bidirectional option like the ray/triangle intersection:

185Fabric Employee@Ahmidou, yes, I agree, it would be good to have those, too.

I updated the ticket FE-8848 accordingly!

www.fabricengine.com

www.mootzoid.com

181✭✭Cool, thanks!!