public SimpleVector getReflectionVector(SimpleVector incoming, SimpleVector normal) { SimpleVector cross = incoming.calcCross(normal); cross = normal.calcCross(cross); cross.scalarMul(2); cross = incoming.calcSub(cross); return cross; }
By the way I don't entirely understand the function in the SimpleVector : SimpleVecor rotate(SimpleVector rot). Can you explain how the vector rotate, and how the rot give the angle of the rotate?