Garry's Mod Wiki

PhysObj:RotateAroundAxis

  Angle PhysObj:RotateAroundAxis( Vector dir, number ang )

Description

A convinience function for Angle:RotateAroundAxis.

Arguments

1 Vector dir
Direction, around which we will rotate
2 number ang
Amount of rotation, in degrees

Returns

1 Angle
The resulting angle

Example

Shows that it is the same as Angle:RotateAroundAxis.

local phys = Entity(1):GetEyeTrace().Entity:GetPhysicsObject() -- Our physics object print( phys:RotateAroundAxis( Vector( 1, 0, 0 ), 20 ) ) local a = phys:GetAngles() a:RotateAroundAxis( Vector( 1, 0, 0 ), 20 ) print( a )
Output: Two exactly the same angles
-27.179 133.246 -23.236 -27.179 133.246 -23.236