Skip to content

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⚓︎

Read-only. The number of active particles.

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:


normals⚓︎

Read-only. The list of unitized, model-space vertex normals for the object. The length of the array is equal to vertexCount.

Returns:


radius⚓︎

Read-only. The radius 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:


runTimeTypeInformation⚓︎

Read-only. The runtime type information for this object.

Returns:


sizes⚓︎

Read-only. The particle sizes. 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:


textures⚓︎

Read-only. The array of texture coordinates. The length of the array is equal to vertexCount times textureSets.

Returns:


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:


Methods⚓︎

clone⚓︎

Creates a copy of this object.

local result = myObject:clone()

Returns:


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()