Maxscript move to surface but with collision detection

Maxscript move to surface but with collision detection

giuseppetonello
Advocate Advocate
493 Views
1 Reply
Message 1 of 2

Maxscript move to surface but with collision detection

giuseppetonello
Advocate
Advocate

So, I can easily drop an object to a surface using 

 

MyRay = ray $.pos [0,0,-1]
intersection = intersectRay $terrain MyRay
$.pos = intersection.pos

 

But this limits me to an arbitrary surface called "terrain".

I was wondering if there's a way to search in the negative z direction until an object is found.

Kind of a collision detection towards the first object that is encountered.

 

 

Joey
0 Likes
Accepted solutions (1)
494 Views
1 Reply
Reply (1)
Message 2 of 2

Serejah
Advocate
Advocate
Accepted solution

@giuseppetonello  написал (-а):

 

Kind of a collision detection towards the first object that is encountered.

 


use intersectRayScene and then sort the result by the distance

 

0 Likes