PhysObj/RotateAroundAxis

From Garry's Mod
Jump to: navigation, search
 PhysObj:RotateAroundAxis( )

Contents

Description

A convinience function for Angle:RotateAroundAxis.

Arguments

Vector dir

Direction, around which we will rotate

Arguments

number ang

Amount of rotation, in degrees

Returns

Angle

The resulting angle

Examples

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
Personal tools
Navigation