3
$\begingroup$

I'm working toward a system where the player can bounce a ray around toward a target using mirror objects. Essential to this process will be making the ray reflect properly. Essentially, I thought it would be best if I simply added an object at the ray hitPosition that would emit a new ray. This adds the object, but not in the right orientation. Is there a way I can have the game engine calculate which way the new object should face?

I want to make the new ray reflect at a equal angle (when bisected by a perpendicular of the mirror face) to the angle that the ray came in on.

$\endgroup$

1 Answer 1

1
$\begingroup$

this, and .rayCast() should set you right

vector.reflect(hitNormal) http://www.tutorialsforblender3d.com/GameModule/MathutilsModule_5_4.html

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .