niParticlesData⚓︎
niParticlesData objects contain the geometry data necessary to render a niParticles object. When a niParticles-based object is created, the actual geometry data is stored in an attached niParticlesData object.
There are two ways to adjust particle size within an niParticles object. The radius
affects all the particles in this niParticlesData object. There is also a size
for each particle (available as sizes
array), which is a ratio between 0.0 and 1.0 that is multiplied by the radius to obtain the final rendered size of the particle.
This type inherits the following: niTriBasedGeometryData, niGeometryData, niObject
Properties⚓︎
activeCount
⚓︎
The number of active particles. Must be no larger than vertexCount
.
Returns:
result
(number)
activeTriangleCount
⚓︎
The active triangle count of the object.
Returns:
result
(number)
bounds
⚓︎
The model-space bounding sphere of the object.
Returns:
result
(niBound)
colors
⚓︎
Read-only. The vertex colors for the object. The length of the array is equal to vertexCount
.
Returns:
result
(niPackedColor[])
normals
⚓︎
Read-only. The list of unitized, model-space vertex normals for the object. The length of the array is equal to vertexCount
.
Returns:
result
(tes3vector3[])
radius
⚓︎
The radius (particle size) of the particles.
Returns:
result
(number)
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)
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)
sizes
⚓︎
Read-only. An array controlling individual particle sizes. Values should be in the range 0 to 1. The length of the array is equal to vertexCount
.
Returns:
result
(number[])
texCoords
⚓︎
Read-only. The array of texture coordinates. The length of the array is equal to vertexCount
times textureSets
.
Returns:
result
(tes3vector2[])
textures
⚓︎
Read-only. The array of texture coordinates. The length of the array is equal to vertexCount
times textureSets
.
Returns:
result
(tes3vector2[])
textureSets
⚓︎
The number of texture coordinate sets in the data.
Returns:
result
(number)
triangleCount
⚓︎
Read-only. The triangle count of the object.
Returns:
result
(number)
uniqueID
⚓︎
Read-only. A unique ID for this model, assigned at model creation.
Returns:
result
(number)
vertexCount
⚓︎
Read-only. The vertex count for the object.
Returns:
result
(number)
vertices
⚓︎
Read-only. The array of vertex position data. The length of the array is equal to vertexCount
.
Returns:
result
(tes3vector3[])
Methods⚓︎
clone
⚓︎
Creates a copy of this object.
local result = myObject:clone()
Returns:
result
(niObject)
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)
markAsChanged
⚓︎
Tells the renderer that the object has changed. Should be called after you have finished changing any vertex data.
If you have altered vertex positions, you may need to also call updateModelBound
. You should call it if vertices have been moved outside the bounds of the original model.
myObject:markAsChanged()
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.
updateModelBound
⚓︎
Updates the geometry bounds to match the vertex data. You should call it if vertices have been moved outside the bounds of the original model, or if the effective bounds have become significantly smaller.
If you already know the effective radius of the vertex data, you could more efficiently set the bounds directly instead of calling this function.
myObject:updateModelBound()