PhysObj.AddAngleVelocity
From GMod Wiki
Function | |
Syntax | PhysObj:AddAngleVelocity( Vector velocity ) |
Description: | |
Adds angular velocity to an object, making it spin. | |
Returns: | nil |
In Object: | Physobj |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=PhysObj.AddAngleVelocity]PhysObj.AddAngleVelocity [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Example
Additional Notes
- Will not work on players, since they don't have a physics object.
- If you want to apply movement force as well, look at PhysObj.ApplyForceCenter.
- If you're looking for something like SetAngleVelocity, phys:AddAngleVelocity( -1 * phys:GetAngleVelocity( ) + YourAngle) is probably your best bet
- With an input vector, a positive X value (pitch) rotates top part towards you and bottom part away from you when facing north (Y+)
- With an input vector, use Vector(pitch,roll,yaw)
- To perform a rotation relative to the world with a vector angvel, do angvel:Rotate(-1*ent:EyeAngles()) beforehand. (May truncate with roll, untested)