NiStencilPropertyGetStencilMask

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search

This is a command from NifSE.

Syntax

(long:stencilMask) NiStencilPropertyGetStencilMask short:nifID short:blockID
(long:stencilMask) NiStenPropGetMask short:nifID short:blockID

Returns the current bitmask of the NiStencilProperty specified by blockID. The reference value and the stored stencil value are both bitwise ANDed with this mask before being compared. The default is 0xFFFFFFFF.

The default value of blockID, 0, indicates the NIF's root, a NiNode. NiNode blocks are not derived from NiStencilProperty, so this function will always require an explicit blockID.

Notes[edit | edit source]

  • 0xFFFFFFFF is an unsigned long integer value, which means it requires 32 bits of information. Signed variables (like all of Oblivion's) reserve one bit for the sign, which means that all values from 0x10000000 to 0xFFFFFFFF will be treated as negative numbers (see two's complement). However, a true signed long would have enough precision to store all of the possible values, provided one coded things cleverly to deal with the negative numbers.
    • Unfortunately, Oblivion does not have true long numbers. Instead, all numbers are treated as floats, which have only 23 bits of data assigned to the actual number (one is reserved for the sign and 8 are reserved for the exponent). This means that Oblivion's variables do not have the precision necessary to accurately use this function. In practice, therefore, this function may be impossible to use, unless one happens to need a mask value that only requires precision that a float can handle (i.e. of the 32 bits, either the first 9 or the last 9 bits are 0).

See Also[edit | edit source]