niRotatingParticles⚓︎
An object that represent collections of large numbers of small point-like objects. Each object in the collection can be separately rotated. Rotations are not truly supported in Morrowind's engine.
This type inherits the following: niParticles, niTriBasedGeometry, niGeometry, niAVObject, niObjectNET, niObject
Properties⚓︎
alphaProperty
⚓︎
Convenient access to this object's alpha property. Setting this value to be nil will erase the property, while setting it to a valid alpha property will set (or replace) it.
Returns:
result
(niAlphaProperty, nil)
appCulled
⚓︎
A flag indicating if this object is culled. When culled, it will not render, and raycasts ignore it.
Returns:
result
(boolean)
controller
⚓︎
Read-only. The first controller available on the object.
Returns:
result
(niTimeController)
data
⚓︎
The niRotatingParticlesData of the object. Manipulation should not be done directly. Instead, consider copying the data and assigning it to this shape.
Returns:
result
(niRotatingParticlesData)
extraData
⚓︎
Read-only. The first extra data available on the object.
Returns:
result
(niExtraData)
flags
⚓︎
Flags, dependent on the specific object type.
Returns:
result
(number)
fogProperty
⚓︎
Convenient access to this object's fog property. Setting this value to be nil will erase the property, while setting it to a valid fog property will set (or replace) it.
Returns:
result
(niFogProperty, nil)
materialProperty
⚓︎
Convenient access to this object's material property. Setting this value to be nil will erase the property, while setting it to a valid material property will set (or replace) it.
Returns:
result
(niMaterialProperty, nil)
name
⚓︎
The human-facing name of the given object.
Returns:
result
(string)
parent
⚓︎
Read-only. The object's parent. It may not have one if it is not attached to the scene.
Returns:
result
(niNode)
properties
⚓︎
Read-only. The list of properties attached to this niAVObject
.
Returns:
result
(niPropertyLinkedList)
refCount
⚓︎
Read-only. The number of references that exist for this object. When this value reaches zero, the object will be deleted.
Returns:
result
(number)
rotation
⚓︎
The object's local rotation matrix.
Returns:
result
(tes3matrix33)
RTTI
⚓︎
Read-only. The runtime type information for this object. This is an alias for the .runTimeTypeInformation
property.
Returns:
result
(niRTTI)
runTimeTypeInformation
⚓︎
Read-only. The runtime type information for this object.
Returns:
result
(niRTTI)
scale
⚓︎
The object's local uniform scaling factor.
Returns:
result
(number)
stencilProperty
⚓︎
Convenient access to this object's stencil property. Setting this value to be nil will erase the property, while setting it to a valid stencil property will set (or replace) it.
Returns:
result
(niStencilProperty, nil)
texturingProperty
⚓︎
Convenient access to this object's texturing property. Setting this value to be nil will erase the property, while setting it to a valid texturing property will set (or replace) it.
Returns:
result
(niTexturingProperty, nil)
translation
⚓︎
The object's local translation vector.
Returns:
result
(tes3vector3)
velocity
⚓︎
The object's local velocity.
Returns:
result
(tes3vector3)
vertexColorProperty
⚓︎
Convenient access to this object's vertex coloring property. Setting this value to be nil will erase the property, while setting it to a valid vertex coloring property will set (or replace) it.
Returns:
result
(niVertexColorProperty, nil)
worldBoundOrigin
⚓︎
The world coordinates of the object's bounds origin.
Returns:
result
(tes3vector3)
worldBoundRadius
⚓︎
The radius of the object's bounds.
Returns:
result
(number)
worldTransform
⚓︎
The object's transformations in the world space.
Returns:
result
(tes3transform)
zBufferProperty
⚓︎
Convenient access to this object's z-buffer property. Setting this value to be nil will erase the property, while setting it to a valid z-buffer property will set (or replace) it.
Returns:
result
(niZBufferProperty, nil)
Methods⚓︎
addExtraData
⚓︎
Appends an extra data to the object.
myObject:addExtraData(extraData)
Parameters:
extraData
(niExtraData)
attachProperty
⚓︎
Attaches a property to this object, without checking to see if the property or another of its type is already on the list. Property lists must not have more than one property of a given class (i.e. no two niTexturingProperty objects) attached at once, or else undefined behavior will result.
myObject:attachProperty(property)
Parameters:
property
(niProperty)
clearTransforms
⚓︎
Resets the object's local transform.
myObject:clearTransforms()
clone
⚓︎
Creates a copy of this object.
local result = myObject:clone()
Returns:
result
(niObject)
copyTransforms
⚓︎
Update object's local transform by copying from another source.
myObject:copyTransforms(source)
Parameters:
source
(niAVObject, tes3transform)
detachAllProperties
⚓︎
Detaches all the properties on the object and returns them in the table.
local result = myObject:detachAllProperties()
Returns:
result
(niProperty[])
detachProperty
⚓︎
Detaches and returns a property from the object which matches the given property type.
local result = myObject:detachProperty(type)
Parameters:
type
(ni.propertyType): The types are available inni.propertyType
table.
Returns:
result
(niProperty)
getGameReference
⚓︎
Searches for an niExtraData on this object to see if it has one that holds a related reference.
local reference = myObject:getGameReference(searchParents)
Parameters:
searchParents
(boolean): Default:false
. If true, all parent objects (if applicable) are also searched.
Returns:
reference
(tes3reference)
getObjectByName
⚓︎
Searches this node and all child nodes recursively for a node with a name that matches the argument.
local result = myObject:getObjectByName(name)
Parameters:
name
(string)
Returns:
result
(niAVObject)
getProperty
⚓︎
Gets an attached property by property type.
local result = myObject:getProperty(type)
Parameters:
type
(ni.propertyType): The types are available inni.propertyType
table.
Returns:
result
(niProperty)
getStringDataStartingWith
⚓︎
Searches for an niExtraData on this object to see if it has niStringExtraData that has its string start with the provided value
argument.
local extra = myObject:getStringDataStartingWith(value)
Parameters:
value
(string): The first niStringExtraData starting with this value will be returned.
Returns:
extra
(niStringExtraData)
getStringDataWith
⚓︎
Searches for an niExtraData on this object to see if it has niStringExtraData that has the provided value
argument in its string field.
local extra = myObject:getStringDataWith(value)
Parameters:
value
(string): The first niStringExtraData with this word will be returned.
Returns:
extra
(niStringExtraData)
hasStringDataStartingWith
⚓︎
Searches for an niExtraData on this object to see if it has niStringExtraData that has its string start with the provided value
argument. Returns true if the value was found.
local result = myObject:hasStringDataStartingWith(value)
Parameters:
value
(string): The value to search for.
Returns:
result
(boolean)
hasStringDataWith
⚓︎
Searches for an niExtraData on this object to see if it has niStringExtraData that contains the provided value
argument in its string field. Returns true if the value was found.
local result = myObject:hasStringDataWith(value)
Parameters:
value
(string): The value to search for.
Returns:
result
(boolean)
isAppCulled
⚓︎
Recursively checks if either the object or any of its parents are appCulled.
local result = myObject:isAppCulled()
Returns:
result
(boolean)
isFrustumCulled
⚓︎
Checks if the object is frustum culled for the given camera.
local result = myObject:isFrustumCulled(camera)
Parameters:
camera
(niCamera)
Returns:
result
(boolean)
isInstanceOfType
⚓︎
Determines if the object is of a given type, or of a type derived from the given type.
local result = myObject:isInstanceOfType(type)
Parameters:
Returns:
result
(boolean)
isOfType
⚓︎
Determines if the object is of a given type.
local result = myObject:isOfType(type)
Parameters:
Returns:
result
(boolean)
prependController
⚓︎
Add a controller to the object as the first controller.
myObject:prependController(controller)
Parameters:
controller
(niTimeController)
propagatePositionChange
⚓︎
Alias for update()
method. Updates the world transforms of this node and its children, which makes changes visible for rendering. Use after changing any local rotation, translation, scale, bounds or after attaching and detaching nodes.
Tip
It's best to "batch up" calls to this method. For example, when transform of an object its parent and grandparent are all changed during the same frame, it is much more efficient to call this method only on the grandparent object after all transforms have been changed. Also, consider calling this function as low as possible on a scene graph.
myObject:propagatePositionChange({ time = ..., controllers = ..., bounds = ... })
Parameters:
args
(table): Optional.time
(number): Default:0
. This parameter is the time-slice for transformation and bounds updatescontrollers
(boolean): Default:false
. Update object's controllers?bounds
(boolean): Default:true
. Update object's bounds?
removeAllControllers
⚓︎
Removes all controllers.
myObject:removeAllControllers()
removeAllExtraData
⚓︎
Removes all extra data.
myObject:removeAllExtraData()
removeController
⚓︎
Removes a controller from the object.
myObject:removeController(controller)
Parameters:
controller
(niTimeController)
removeExtraData
⚓︎
Removes a specific extra data from the object.
myObject:removeExtraData(extraData)
Parameters:
extraData
(niExtraData)
saveBinary
⚓︎
Serializes the object, and writes it to the given file.
local success = myObject:saveBinary(path)
Parameters:
path
(string): The path to write the file at, relative to the Morrowind installation folder.
Returns:
success
(boolean): If true the object was successfully serialized.
setFlag
⚓︎
Sets a given flag in the niObjectNET flag data. The specifics use of the flag is dependent on the real underlying type.
myObject:setFlag(state, index)
Parameters:
state
(boolean)index
(number)
update
⚓︎
Updates the world transforms of this node and its children, which makes changes visible for rendering. Use after changing any local rotation, translation, scale, bounds or after attaching and detaching nodes.
Update Efficiency
It's best to "batch up" calls to this method. For example, when transform of an object its parent and grandparent are all changed during the same frame, it is much more efficient to call this method only on the grandparent object after all transforms have been changed. Also, consider calling this function as low as possible on a scene graph.
myObject:update({ time = ..., controllers = ..., children = ... })
Parameters:
args
(table): Optional.time
(number): Default:0
. This parameter is passed to controllers. Only needed if controllers are being updated.controllers
(boolean): Default:false
. Update controllers before updating transforms.children
(boolean): Default:true
. Recursively updates the children of this node.
updateEffects
⚓︎
Update all attached effects. This method must be called at or above any object when dynamic effects are attached or detached from it
myObject:updateEffects()
updateProperties
⚓︎
Update all attached properties.
myObject:updateProperties()
Functions⚓︎
new
⚓︎
Creates a new niParticles.
local particles = niParticles.new(vertexCount, hasNormals, hasColors)
Parameters:
vertexCount
(number): The number of particles.hasNormals
(boolean): Iftrue
, normals will be allocated.hasColors
(boolean): Iftrue
, colors will be allocated.
Returns:
particles
(niParticles)