1

I have two objects, let's call them nearObject and farObject. Once nearObject gets within a certain distance from farObject, I want farObject to rotate to face nearObject. This should happen instantly, it does not need to slowly rotate over time.

1) The distance is arbitrary, so I am using the following to get distance information. nearObject.position.distanceToSquared(farObject.position);

2) Now I want farObject to rotate perpendicular to the vector between the two objects. What is the easiest way to do this?

4

1 に答える 1

1
farObject.lookAt( nearObject.position );
于 2012-07-11T22:16:12.860 に答える