Difference between revisions of "NiAVObjectSetLocalRotation"
Jump to navigation
Jump to search
no edit summary
imported>DragoonWraith m (NifSetNthChildLocalRotationTEMP moved to NiAVObjectSetLocalRotation: alpha 5 version) |
imported>DragoonWraith |
||
|
'''Syntax'''
(bool:success)
(bool:success) NiAVObjSetLocRotT float:a11 float:a12 float:a13 \
float:a21 float:a22 float:a23 \
float:a31 float:a32 float:a33 short:nifID ''short:blockID''
Sets the local rotation of the specified <tt>NiAVObject</tt>-derived block. Since <tt>blockID</tt> defaults to 0, the NIF's root <tt>NiNode</tt>, and <tt>NiNode</tt> is derived from <tt>NiAVObject</tt>, this function will change the local rotation of the NIF's root if called with no explicit <tt>blockID</tt>.
== Example ==
This script will rotate each of the root's children, which are <tt>NiAVObject</tt> blocks, 180° about the X axis. This will effectively flip the NIF upside-down.
array_var R
array_var children
array_var child
short nifID
short blockID
...
let R := GenerateRotationMatrix X 180
let children := NiNodeGetChildren nifID
foreach child <- children
let blockID := *child
let locRot := NiAVObjectGetLocalRotation nifID blockID
let locRot := MatrixMultiply R locRot ; order matters
NiAVObjectSetLocalRotation locRot nifID blockID
loop
== Notes ==
* Because OBSE Plug-Ins cannot currently accept arrays as arguments,
** Due to Wiki software limitations, the syntax
== See Also ==
* [[NiAVObjectGetLocalRotation]]
* [[NiAVObjectSetLocalTransform]]
* [[NiAVObjectSetLocalTranslation]]
* [[NiAVObjectSetLocalScale]]
== External Links ==
* [http://en.wikipedia.org/wiki/Rotation_representation#Rotation_matrix Wikipedia: Rotation Matrices]
[[Category:NifSE|
[[Category:NifSE (
| |||