- Home /
Applying a rotation to a point?
I'm currently working with BoxCollider.bounds.Contains(), however noticed in the documentation it deals only with AABB. Yet my box itself is rotated. Therefore I'm translating my test point into the boxes world space with point - box.center; However would I still need to apply the rotation to the point, and if so how would I accomplish that. (box.transform.rotation gives a quaternion)
Answer by Mike 3 · Mar 23, 2011 at 09:37 PM
You generally want transform.TransformPoint or transform.TransformDirection, probably the former
You also have transform.InverseTransformPoint for the opposite
Answer by Eric5h5 · Mar 23, 2011 at 09:57 PM
Mesh.bounds isn't AABB, so if you use that, you don't have to translate anything.
Your answer
Follow this Question
Related Questions
Make sphere rotate when controlled 7 Answers
Constant Force doesn't work 0 Answers
I can't rotate a point around a pivot 2 Answers
2d - calculating velocity needed to pass by point 1 Answer
Compute the torque needed to rotate an object at a constant rate 3 Answers