Notifications
Clear all
[Closed] Intersect Ray
Aug 04, 2013 2:01 pm
Hey,
I’m trying to get a point to collide with a plane, using RayMeshGridIntersect. I’m getting lost in the logic.
This is what i have so far. Any help would be great!
rm = RayMeshGridIntersect ()
rm.Initialize 6
rm.addNode theplane
rm.buildGrid ()
thePos = thepoint1.pos
theNormal = thepoint1.dir
hit = rm.intersectRay thePos -theNormal false
hitdist = rm.getHitDist hit
hitPos = thePos-hitdist
if hit == 0 then
(
test = hitPos.z-thepoint1.pos.z
test
)else(
print "false"
0
)