Difference between revisions of "NiAVObjectGetLocalRotation"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>DragoonWraith
Tag: Manual revert
 
(4 intermediate revisions by 2 users not shown)
Line 2: Line 2:


'''Syntax'''
'''Syntax'''
  (matrix:LocalRotation) NifGetNthChildLocalRotation short:ChildID short:NifID
  (matrix:localRotation) NiAVObjectGetLocalRotation short:nifID ''short:blockID''
(matrix:localRotation) NiAVObjGetLocRot short:nifID ''short:blockID''


Returns the matrix of the local rotation of the specified Child of the root node.
Returns the matrix of the local rotation of the specified <tt>NiAVObject</tt>-derived block. The default value of <tt>blockID</tt> is 0, referring to the root <tt>NiNode</tt>, which is derived from <tt>NiAVObject</tt>. Therefore, this function can be used with the default argument when referring to the root node.


The matrix is a 3x3 array of floats.
The matrix is a 3x3 array of floats, and is compatible with [[:Category:Linear Algebra Functions (OBSE)|OBSE's linear algebra functions]].
 
== 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


== See Also ==
== See Also ==
* [[NifSetNthChildLocalRotationTEMP]]
* [[NiAVObjectSetLocalRotation]]




* [[NifGetNthChildLocalTransform]]
* [[NiAVObjectGetLocalTransform]]
* [[NifGetNthChildLocalTranslation]]
* [[NiAVObjectGetLocalTranslation]]
* [[NifGetNthChildLocalScale]]
* [[NiAVObjectGetLocalScale]]


== External Links ==
== External Links ==
* [http://en.wikipedia.org/wiki/Rotation_representation#Rotation_matrix Wikipedia: Rotation Matrices]
* [http://en.wikipedia.org/wiki/Rotation_representation#Rotation_matrix Wikipedia: Rotation Matrices]


[[Category:NifSE|GetNthChildLocalRotation]]
[[Category:NifSE|AVObjectGetLocalRotation]]
[[Category:NifSE (Children)|GetNthChildLocalRotation]]
[[Category:NifSE (NiAvObject)|GetLocalRotation]]

Latest revision as of 11:58, 21 December 2023

This is a command from NifSE.

Syntax

(matrix:localRotation) NiAVObjectGetLocalRotation short:nifID short:blockID
(matrix:localRotation) NiAVObjGetLocRot short:nifID short:blockID

Returns the matrix of the local rotation of the specified NiAVObject-derived block. The default value of blockID is 0, referring to the root NiNode, which is derived from NiAVObject. Therefore, this function can be used with the default argument when referring to the root node.

The matrix is a 3x3 array of floats, and is compatible with OBSE's linear algebra functions.

Example[edit | edit source]

This script will rotate each of the root's children, which are NiAVObject 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

See Also[edit | edit source]


External Links[edit | edit source]