Talk:SetAngle - ObjectReference
Revision as of 13:56, 9 November 2014 by imported>Obstipator (→Player.SetAngle() workaround: new section)
Dropped Object
Bug with dropped objects
--Fg109 11:25, 2 May 2012 (EDT)
Conventions for these angles
Assuming that this function applies the same kinds of angles that the Creation Kit uses (and why wouldn't it?), it uses clockwise (left-handed) extrinsic Euler rotations with a ZYX sequence. DavidJCobb (talk) 2014-08-08T23:24:20 (EDT)
Yeah it's been known for some time that the engine uses a ZYX ordering. --Terra Nova2 (talk) 2014-08-11T11:43:34 (EDT)
Player.SetAngle() workaround
The Player object can only be rotated by the Z axis unless collisions have been disabled.
Here's some sample code from screenshot.psc to let you modify the X and Y angle:
; Rotate the camera
; Hack! The X angle doesn't get set if collisions are off, so
; turn collisions ON for a very brief period
ToggleCollisions()
; Set the angle on the player, this will move the camera
GetPlayer().SetAngle(afAngleX, afAngleY, afAngleZ)
; And reset collisions off again, we don't want the player to start falling
ToggleCollisions()
--Obstipator (talk) 2014-11-09T13:56:27 (EST)