Gkills
Gkills

Reputation: 587

What is the difference between Transform.RotateAround(point,axis,angle); and Transform.RotateAround(axis,angle)

What I understand is -

transform.RotateAround(point,axis,angle);  

This rotates the transform from point along the axis by the given angle,

but then what does the following statement do

transform.RotateAround(axis,angle); 

Are the following 2 statements equivalent???

transform.RotateAround(transform.position,axis,angle); and        transform.RotateAround(axis,angle);

Upvotes: 0

Views: 3416

Answers (1)

Josh
Josh

Reputation: 760

As weird as this seems I believe the difference between the two is as follows

transform.RotateAround(Point, axis, angle);

The above take radians to perform transform

transform.RotateAround(axis, angle);

The above takes radians to rotate around transform.position

The two parameter version used to take degrees instead of radians but some claim this has changed, though may not be updated in documentation as of yet.

So basically your last statement about their equalities should be correct yes.

Here's a source from unity that I used as well: http://answers.unity3d.com/questions/181575/transformrotatearoundvector3-axis-float-angle-what.html

Upvotes: 2

Related Questions