This page has been translated automatically.
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Landscape Tool
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

Unigine.ObjectParticles Class

Inherits: Object

This class is used to create particle systems. The particles are approximated with a sphere. They can be of different types (see the details) and radius (that can change with time). They are emitted from different emitters (see the details) with a specified spawn rate. The particles disappear after the set life time period or culled when hitting other nodes. They either collide with the outer surface of the approximation sphere or intersect only by the its center.

The particle flow direction can be influenced by:

The particle system can also initialized before it actually appears, so that it starts to be rendered with already spawned particles.

See Also#

A set of UnigineScript API samples located in the <UnigineSDK>/data/samples/objects/ folder:

Synchronizing Particles#

For image consistency in multi-channel rendering use cases, Particle Systems can have more deterministic behavior, i.e. when a particle is spawned on one PC, it can travel to another screen seamlessly.

To synchronize the particle systems across several applications, it is required to define which application is the Master one — it will count all particles and provide all related info via the network to Slaves — applications that only receive data and reproduce them.

Source code (C#)
bool is_master = true; // or false, if the application is a Slave
ObjectParticles particles; // particles that are going to be synchronized
Socket socket; // example of a socket used to send the particles data

void Init()
{
	// For every type of the application, define the particles operation mode
	if (is_master)
		particles.SyncMode(ObjectParticles.MASTER);
	else
		particles.SyncMode(ObjectParticles.SLAVE);
}

void Update()
{
	if (is_master)
	{
		Blob data = new Blob();
		particles.TakeSyncData(data);
		socket.Write(data.GetData(), data.GetSize());
	}
	else
	{
		Blob data = new Blob();
		socket.ReadStream(data, 1048576); // 1Mb, maximum size of the packet
		data.SeekSet(0); // Moving the pointer to the first symbol,
		 				  // because after reading the data from the socket,
						  // the pointer is at the end of the data.
		particles.ApplySyncData(data);
	}
}

ObjectParticles Class

Enums

SYNC_MODE#

Synchronization mode to be used for the particle system.
NameDescription
NONE = 0In this mode, the particle system neither provides nor takes any synchronization data.
MASTER = 1This mode enables storing of the particle system data used for synchronization by the slave system.
SLAVE = 2This mode makes a particle system take the stored synchronization data from the master particle system.

Properties

WorldBoundBox WorldBoundBoxParticles#

The estimated world bounding box considering the changes of the particle system (velocity, length, etc.).

BoundBox BoundBoxSimulation#

The exact bounding box of the particle system.

BoundBox BoundBoxParticles#

The estimated bounding box considering the changes of the particle system (velocity, length, etc.).

vec3 WorldOffset#

The current world offset of the local origin of coordinates of the particle system. the offset of the origin of coordinates is changed depending on the position of the particle system so that the particles are simulated near their emitter.

int NumContacts#

The total number of particles collisions with other objects.

int NumDeflectors#

The current number of deflectors.
set
Sets the new number of deflectors.
set value - Number of deflectors.

int NumNoises#

The current number of noises.
set
Sets the new number of noises.
set value - Number of noises.

int NumForces#

The number of the currently acting forces.
set
Sets the new number of forces.
set value - Number of forces.

vec3 Gravity#

The current gravity force influencing particles.
set
Sets a gravity force influencing particles.
set value - A gravity force.

vec3 EmitterVelocity#

The current emitter velocity, which is added to the initial velocity of spawned particles. if the value equals 0, the actual velocity of emitter node will be used.
set
Sets an emitter velocity, which is added to the initial velocity of spawned particles. If the value equals 0, the actual velocity of emitter node will be used.
set value - Emitter velocity in units per second.

vec3 EmitterSpread#

The current spread of particles emission along the axes.
set
Sets a spread of particles emission along the axes.
set value - The spread of particles emission.

vec3 EmitterDirection#

The current direction of particles emission along the axes.
set
Sets the direction of particles emission along the axes.
set value - The emission direction.

vec3 EmitterSize#

The current emitter size.
set
Sets a size of the emitter.
set value - New emitter size. Depending on the type of the emitter, this value is interpreted as follows: If negative values are provided, 0 will be used instead of them.

int EmitterSync#

A value indicating if a particle system emitter is synchronized to a parent particle system.
set
Sets a value indicating if a particle system emitter needs to be synchronized to a parent particle system.
set value - 1 to synchronize the emitter; otherwise, 0.

int EmitterLimit#

The current maximum number of particles that an emitter can possibly spawn per one frame.
set
Sets the maximum number of particles that an emitter can possibly spawn per one frame.
set value - The maximum possible number of particles. If a negative value is provided, 0 will be used instead.

int EmitterSequence#

The current rendering order of the particle system inside the particles hierarchy.
set
Sets the rendering order of the particle system inside the particles hierarchy.
set value - The rendering priority. Particle systems with the lowest order number are rendered first.

bool IsEmitterContinuous#

A value indicating if additional spawn points are generated when the emitter is moved, which provides a continuous flow of particles.
set
Sets a value indicating if additional spawn points should be generated when the emitter is moved, which provides a continuous flow of particles.
set value - 1 to create the continuous flow of particles; 0 to create the discrete flow with sparse generation points.

bool IsEmitterShift#

A value indicating if the emitter spawns particles only when it is moving. the further it has moved, if compared to its position in the previous frame, the more particles will be spawned. if the emitter is not moving, there are no particles at all.
set
Sets a value indicating if the emitter spawns particles only when it is moving. The further it has moved, if compared to its position in the previous frame, the more particles will be spawned. If the emitter is not moving, there are no particles at all.
set value - 1 to enable the shift-based spawning; 0 to disable.

bool IsEmitterBased#

A value indicating if particles follow emitter transformations, i.e. the direction of their flow changes after the emitter.
set
Sets a value indicating if particles should follow emitter transformations, i.e. the direction of their flow should change after the emitter.
set value - 1 for particles to follow emitter transformations; 0 for them to flow independently.

bool IsEmitterEnabled#

A value indicating if particle emission is enabled.
set
Enables or disables particle emission.
set value - 1 to enable particle emission, 0 to disable it.

int ProceduralParenting#

The current type of relationship between the particle system and a decal / field node that uses the procedural texture.
Notice
Procedural rendering must be enabled.
set
Sets the type of relationship between the particle system and a decal / field node that uses the procedural texture.
Notice
Procedural rendering must be enabled.
set value - Relationship type to be used for rendering the particle system to a procedural texture:
  • 0 - a decal/field node that uses the procedural texture is a child of the particle system.
  • 1 - a decal/field node that uses the procedural texture is a parent of the particle system.

int ProceduralPositioning#

The value indicating the procedural position mode.
Notice
Procedural rendering must be enabled.
set
Sets positioning mode to be used for child nodes using the procedural texture to which the particle system is rendered.
Notice
  • Positioning mode can be set only when the particle system is a parent of a decal/field node that uses the procedural texture (parenting mode is set to 0)
  • Procedural rendering must be enabled.
set value - Mode of the procedural positioning. Can be one of the following:
  • PROCEDURAL_POSITIONING_MANUAL = 0 - position of a child decal/field node, that uses the procedural texture, can be changed manually.
  • PROCEDURAL_POSITIONING_AUTO = 1 - position of a child decal/field node, that uses the procedural texture, is automatically defined by the position of particle system and cannot be changed manually.

bool IsProceduralRendering#

The value indicating if the procedural rendering enabled or not. this feature enables rendering of particles into an orthographic decal or a field height, and can be used, for example, to create ship wake waves.
set
Enables particle system rendering to procedural texture to be used by an orthographic decal or a field height. For example, ship wake waves are simulated using this feature.
set value - 1 to enable rendering to procedural texture, 0 to disable.

int EmitterType#

The type of the emitter.
set
Sets a type of the emitter.
set value - One of the OBJECT_PARTICLES_EMITTER_* variables.

float Roughness#

The current roughness of the particle surface.
set
Sets a roughness of the particle surface.
set value - A new roughness value. The provided value will be saturated in the range [0; 1].

float Restitution#

The current restitution value for particles.
set
Sets a restitution value for particles.
set value - A new restitution value. The provided value will be saturated in the range [0; 1].

float GrowthDamping#

The current damping of particles growth in size.
set
Sets the damping of particles growth in size.
set value - A new growth damping. If a negative value is provided, 0 will be used instead.

float AngularDamping#

The current angular damping of particles.
set
Sets an angular damping of particles.
set value - A new angular damping. If a negative value is provided, 0 will be used instead.

float LinearDamping#

The current linear damping of particles.
set
Sets a linear damping of particles.
set value - A new linear damping. If a negative value is provided, 0 will be used instead.

float LengthFlattening#

The current factor of the linear interpolation between the z axis and the camera direction for the length particles.
set
Sets a factor of the linear interpolation between the Z axis and the camera direction for the length particles.
set value - A flattening factor. If a negative value is provided, 0 will be used instead.

float LengthStretch#

The current factor, by which length particles are stretched.
set
Sets a factor by which length particles will be stretched.
set value - Stretch factor. If a negative value is provided, 0 will be used instead.

float PhysicalMass#

The current mass of the particles. this value matters only for computing physical interactions.
set
Sets the mass of the particles. This value matters only for computing physical interactions.
set value - The mass of the particles.

int PhysicalMask#

The bit mask for interactions with physicals. two objects interact, if they both have matching masks.
set
Sets a bit mask for interactions with physicals. Two objects interact, if they both have matching masks.
set value - Integer, each bit of which is a mask.

int NumParticles#

The current number of particles.

float SpawnThreshold#

The current velocity threshold for spark and random emitters. they spawn particles if velocity of the parent particles is high enough.
set
Sets the velocity threshold for spark and random emitters. They spawn particles if the velocity value of the parent particles is high enough.
set value - A velocity threshold for the parent particles.

float SpawnScale#

The current spawn scale that enables to modulate smooth and gradual initialization of the particle system starting with the given spawn state and up to the specified spawn rate.
set
Sets a spawn scale that enables to modulate smooth and gradual initialization of the particle system starting with the given spawn state and up to the specified spawn rate.
set value - A spawn scale. The provided value is clipped to range [0;1]. By the value of 0, there are no spawned particles at the start. By the value of 1, the system is initialized with the specified spawn rate.

float SpawnRate#

The current particle spawn rate.
set
Sets a rate at which particles are created.
set value - A new spawn rate. If a too small value is provided, 1E-6 will be used instead.

int NumberPerSpawn#

The current number of particles to be spawned simultaneously each time according to the spawn rate.
set
Sets the number of particles to be spawned simultaneously each time according to the spawn rate.
set value - Number of particles to be spawned simultaneously.

bool IsClearOnEnable#

A value indicating if particle system is to be re-initialized each time it is enabled.
set
Enables or disables re-initialization of the particle system each time it is enabled. When this option is disabled, turning on the particle system will restore the state it had before it was turned off.
set value - 1 to re-initialize particle system each time it is enabled; otherwise, 0.

int Culling#

A value indicating if particles would disappear upon collision or intersection.
set
Sets a value indicating if particles should disappear upon collision or intersection.
set value - 1 to make particles disappear; 0 to continue rendering of particles after collision/intersection.

int Collision#

A value indicating if collision is detected by the outer surface of the sphere that approximates the particles. this method is slower than sphere center-based intersection detection, but more precise.
set
Enables or disables detecting collision by the outer surface of the sphere that approximates the particles (each particle is approximated with the sphere). This method is slower than intersection detection, but more precise.
set value - 1 to enable sphere-based collision detection, 0 to disable it.

int PhysicsIntersection#

A value indicating if collision is detected by the center of the sphere that approximates the particles (physics intersection). this method is faster than sphere-based collision detection, but less precise. Physics intersections are detected only for matching bit masks.
set
Enables or disables detecting collision by the center of the sphere that approximates the particles. This method is faster than collision detection, but less precise. Physics intersections are detected only for matching bit masks.
set value - 1 to detect intersections, 0 not to detect.

int TextureAtlas#

A value indicating if a diffuse texture for the particles is used as a 4x4 texture atlas.
set
Sets a value indicating if a diffuse texture for the particles is a 4x4 texture atlas.
set value - Positive number if a texture atlas is used; 0 if an ordinary diffuse texture is assigned.

int VariationY#

A value indicating if the initial orientation of particles diffuse texture is randomly varied along the y axis.
set
Sets a value indicating if the initial orientation of particles diffuse texture should be randomly varied along the Y axis.
set value - 1 to add random variation along the Y axis, 0 not to add.

int VariationX#

A value indicating if the initial orientation of particles diffuse texture is randomly varied along the x axis.
set
Sets a value indicating if the initial orientation of particles diffuse texture should be randomly varied along the X axis.
set value - 1 to add random variation along the X axis, 0 not to add.

int DepthSort#

A value indicating if depth sorting of particles is enabled. the depth sorting is required, if particles use alpha blending.
set
Enables or disables depth sorting of particles. The depth sorting is required, if particles use alpha blending.
set value - Positive number to enable depth sorting, 0 to disable it.

float MaxWarmingTime#

Max time value for particles simulation during the warming, in seconds.
set
Sets max time for particles simulation during the warming, in seconds.
set value - Time, in seconds.

int Warming#

A value indicating if the warm start is enabled for the particles. it means that the particle system starts to be rendered with already emitted particles, rather then from a zero point.
set
Enables the warm start for the particles. It means that the particle system starts to be rendered with already emitted particles, rather then from a zero point.
set value - Positive number to enable the warm start; 0 to disable.

int ParticlesType#

The type of emitted particles.
set
Sets a type of particles to emit.
set value - One of the OBJECT_PARTICLES_TYPE_* variables.

uint Seed#

The seed value used for the particles' random generator.
set
Sets a seed value for the particles' random generator.
set value - Seed value.

ObjectParticles.SYNC_MODE SyncMode#

Synchronization mode used for the particle system.
set
Sets synchronization mode to be used for the particle system.
set value - Synchronization mode to be set, one of the SYNC_MODE values.

float UpdateDistanceLimit#

The distance from the camera within which the object should be updated.
set
Sets the distance from the camera within which the object should be updated. The default value is 1000 units.
set value - Distance from the camera within which the object should be updated.

int FPSInvisible#

The update rate value when the object is not rendered at all.
set
Sets the update rate value when the object is not rendered at all. The default value is 0 fps.
set value - Update rate value when the object is not rendered at all.

int FPSVisibleShadow#

The update rate value when only object shadows are rendered.
set
Sets the update rate value when only object shadows are rendered. The default value is 30 fps.
set value - Update rate value when only object shadows are rendered.

int FPSVisibleCamera#

The update rate value when the object is rendered to the viewport.
set
Sets the update rate value when the object is rendered to the viewport. The default value is infinity.
set value - Update rate value when the object is rendered.

Members


static ObjectParticles ( ) #

Constructor. Creates a particle system.

void SetAngle ( float mean, float spread ) #

Sets an angle of emission.

Arguments

  • float mean - Mean value in degrees.
  • float spread - Spread value in degrees.

vec3 GetContactNormal ( int num ) #

Returns the point of the particles collision with other objects.

Arguments

  • int num - The collision point number.

Return value

Collision point coordinates.

Object GetContactObject ( int num ) #

Returns the object that collided with particles collided in a given collision point.

Arguments

  • int num - The collision point number.

Return value

The object participated in collision.

vec3 GetContactPoint ( int num ) #

Returns the normal vector for the collision point of the particles with other objects.

Arguments

  • int num - The collision point number.

Return value

Normal vector coordinates.

vec3 GetContactVelocity ( int num ) #

Returns the velocity in the collision point of the particles with other objects.

Arguments

  • int num - The collision point number.

Return value

Velocity values for each of space dimensions.

void SetDeflectorAttached ( int num, int attached ) #

Attaches or detaches a given deflector to the particle system.

Arguments

  • int num - The deflector number.
  • int attached - 1 to attach the deflector, 0 to detach it.

int IsDeflectorAttached ( int num ) #

Returns a value indicating if a given deflector is attached to the particle system.

Arguments

  • int num - Number of the deflector.

Return value

1 if the deflector is attached; otherwise, 0.

void SetDeflectorEnabled ( int num, bool enabled ) #

Enables or disables the given deflector.

Arguments

  • int num - The deflector number.
  • bool enabled - 1 to enable the deflector, 0 to disable it.

bool IsDeflectorEnabled ( int num ) #

Returns a value indicating if the given deflector is enabled.

Arguments

  • int num - Number of the deflector.

Return value

1 if the deflector is enabled; otherwise, 0.

void SetDeflectorRestitution ( int num, float restitution ) #

Sets restitution of the deflector. Makes sense only for reflectors.

Arguments

  • int num - The deflector number.
  • float restitution - A new restitution. The provided value will be saturated in the range [0; 1].

float GetDeflectorRestitution ( int num ) #

Returns the current restitution of the deflector. Makes sense only for reflectors.

Arguments

  • int num - The deflector number.

Return value

The current restitution.

void SetDeflectorRoughness ( int num, float roughness ) #

Sets roughness of the deflector surface. Makes sense only for reflectors.

Arguments

  • int num - The deflector number.
  • float roughness - A new roughness. The provided value will be saturated in the range [0; 1].

float GetDeflectorRoughness ( int num ) #

Returns the current roughness of the deflector. Makes sense only for reflectors.

Arguments

  • int num - The deflector number.

Return value

The current roughness.

void SetDeflectorSize ( int num, vec3 size ) #

Sets dimensions of a given deflector.

Arguments

  • int num - The deflector number.
  • vec3 size - New dimensions. Only the first two components are taken into account (x and y).

vec3 GetDeflectorSize ( int num ) #

Returns the current dimensions of the given deflector.

Arguments

  • int num - The deflector number.

Return value

The current dimensions. Only the first two components should be taken into account (x and y).

void SetDeflectorTransform ( int num, mat4 transform ) #

Sets a transformation matrix for a given deflector. This matrix describes the position and orientation of the deflector.

Arguments

  • int num - The deflector number.
  • mat4 transform - A new transformation matrix.

mat4 GetDeflectorTransform ( int num ) #

Returns the transformation matrix of a given deflector. This matrix describes the position and orientation of the deflector. The default is the identity matrix.

Arguments

  • int num - The deflector number.

Return value

The transformation matrix.

void SetDeflectorType ( int num, int type ) #

Sets a type of a given deflector.

Arguments

int GetDeflectorType ( int num ) #

Returns a type of a given deflector.

Arguments

  • int num - The deflector number.

Return value

DEFLECTOR_REFLECTOR or DEFLECTOR_CLIPPER.

void SetDelay ( float mean, float spread ) #

Sets delay of particle system initialization relative to the parent particle one.

Arguments

  • float mean - A mean value in seconds. If a negative value is provided, 0 will be used instead.
  • float spread - A spread value in seconds.

float GetDelayMean ( ) #

Returns the mean value of particles initialization delay relative to the parent particle system.

Return value

The mean value in seconds.

float GetDelaySpread ( ) #

Returns the spread value of particles initialization delay relative to the parent particle system.

Return value

The spread value in seconds.

void SetDuration ( float mean, float spread ) #

Sets a duration of each particle emission in seconds.

Arguments

  • float mean - Mean value in seconds. If a negative value is provided, 0 will be used instead.
  • float spread - Spread value in seconds.

float GetDurationMean ( ) #

Returns the current mean value of particle emission intervals.

Return value

The mean value in seconds.

float GetDurationSpread ( ) #

Returns the current spread value of particle emission intervals.

Return value

The spread value in seconds.

void SetForceAttached ( int num, int attached ) #

Attaches or detaches the given force to the particle system.

Arguments

  • int num - Number of the force.
  • int attached - 1 to attach the force, 0 to detach it.

int IsForceAttached ( int num ) #

Returns a value indicating if the given force is attached to the particle system.

Arguments

  • int num - Number of the force.

Return value

1 if the force is attached; otherwise, 0.

void SetForceAttenuation ( int num, float attenuation ) #

Sets an attenuation factor for the specified force.

Arguments

  • int num - The force number.
  • float attenuation - An attenuation factor.

float GetForceAttenuation ( int num ) #

Returns the current attenuation factor for the specified force.

Arguments

  • int num - The force number.

Return value

The current attenuation factor.

void SetForceAttractor ( int num, float attractor ) #

Sets the attraction force that will be applied to the particles in the specified force radius.

Arguments

  • int num - The attraction force number.
  • float attractor - The force value.

float GetForceAttractor ( int num ) #

Returns the current attraction force applied to the particles in the specified force radius.

Arguments

  • int num - The attraction force number.

Return value

The force value.

void SetForceEnabled ( int num, bool enabled ) #

Enables or disables the given force.

Arguments

  • int num - The force number.
  • bool enabled - 1 to enable the force, 0 to disable it.

bool IsForceEnabled ( int num ) #

Returns a value indicating if the given force is enabled.

Arguments

  • int num - Number of the force.

Return value

1 if the force is enabled; otherwise, 0.

void SetForceRadius ( int num, float radius ) #

Sets a radius for applying the force.

Arguments

  • int num - The force number.
  • float radius - A radius in units. If a negative value is provided, 0 will be used instead.

float GetForceRadius ( int num ) #

Returns the current radius set for applying the force.

Arguments

  • int num - The force number.

Return value

The current radius in units.

void SetForceRotator ( int num, float rotator ) #

Sets a rotation force that will be applied to the particles in the specified force radius.

Arguments

  • int num - The rotation force number.
  • float rotator - The force value.

float GetForceRotator ( int num ) #

Returns the current rotation force applied to the particles in the specified force radius.

Arguments

  • int num - The rotation force number.

Return value

The force value.

void SetForceTransform ( int num, mat4 transform ) #

Sets a transformation matrix for the specified force.

Arguments

  • int num - The force number.
  • mat4 transform - A transformation matrix.

mat4 GetForceTransform ( int num ) #

Returns the current transformation matrix for the specified force.

Arguments

  • int num - The force number.

Return value

The transformation matrix.

void SetGrowth ( float mean, float spread ) #

Sets a particle growth factor.

Arguments

  • float mean - A mean value.
  • float spread - A spread value.

float GetGrowthMean ( ) #

Returns the current mean value of the particle growth factor.

Return value

The mean value.

float GetGrowthSpread ( ) #

Returns the current spread value of the particle growth factor.

Return value

The spread value.

void SetLife ( float mean, float spread ) #

Sets a lifetime duration of particles in seconds.

Arguments

  • float mean - A mean value in seconds. If a too small value is provided, 1E-6 will be used instead.
  • float spread - A spread value in seconds.

float GetLifeMean ( ) #

Returns the current mean value of particle lifetime duration.

Return value

The mean value in seconds.

float GetLifeSpread ( ) #

Returns the current spread value of particle lifetime duration.

Return value

The spread value in seconds.

void SetNoiseAttached ( int num, int attached ) #

Sets the noise as an attached.

Arguments

  • int num - Target noise number.
  • int attached - 1 to enable the Attached flag, 0 to disable it.

int IsNoiseAttached ( int num ) #

Returns a value indicating if the given noise is attached to the particle system.

Arguments

  • int num - Target noise number.

Return value

1 if the noise is attached; otherwise, 0.

void SetNoiseEnabled ( int num, bool enabled ) #

Enables or disables the given noise.

Arguments

  • int num - Target noise number.
  • bool enabled - 1 to enable the noise, 0 to disable it.

bool IsNoiseEnabled ( int num ) #

Returns a value indicating if the given noise is enabled.

Arguments

  • int num - Target noise number.

Return value

1 if the noise is enabled; otherwise, 0.

void SetNoiseForce ( int num, float force ) #

Sets the Force parameter value for the required noise.

Arguments

  • int num - Target noise number.
  • float force - The noise force value.

float GetNoiseForce ( int num ) #

Returns the Force parameter value for the required noise.

Arguments

  • int num - Target noise number.

Return value

The noise force value.

void SetNoiseFrequency ( int num, int frequency ) #

Sets the Frequency parameter value for the required noise.

Arguments

  • int num - Target noise number.
  • int frequency - The noise frequency value.

int GetNoiseFrequency ( int num ) #

Returns the Frequency parameter value for the required noise.

Arguments

  • int num - Target noise number.

Return value

The noise frequency value.

Image GetNoiseImage ( int num ) #

Returns the spatial texture for the required noise.

Arguments

  • int num - Target noise number.

Return value

The texture of the noise.

void SetNoiseOffset ( int num, vec3 offset ) #

Sets the Offset parameter coordinates values for the required noise.

Arguments

  • int num - Target noise number.
  • vec3 offset - Offset coordinates values.

vec3 GetNoiseOffset ( int num ) #

Returns the Offset parameter coordinates values for the required noise.

Arguments

  • int num - Target noise number.

Return value

Offset coordinates values.

void SetNoiseScale ( int num, float scale ) #

Sets the Scale parameter value for the required noise.

Arguments

  • int num - Target noise number.
  • float scale - The noise scale value.

float GetNoiseScale ( int num ) #

Returns the Scale parameter value for the required noise.

Arguments

  • int num - Target noise number.

Return value

The noise scale value.

void SetNoiseSize ( int num, int size ) #

Sets the Size parameter value for the required noise.

Arguments

  • int num - Target noise number.
  • int size - Noise size value.

int GetNoiseSize ( int num ) #

Returns the Size parameter value for the required noise.

Arguments

  • int num - Target noise number.

Return value

The noise size value.

void SetNoiseStep ( int num, vec3 step ) #

Sets the Step parameter coordinates values for the required noise.

Arguments

  • int num - Target noise number.
  • vec3 step - Step coordinates values.

vec3 GetNoiseStep ( int num ) #

Returns the Step parameter coordinates values for the required noise.

Arguments

  • int num - Target noise number.

Return value

Step coordinates values.

void SetNoiseTransform ( int num, mat4 transform ) #

Sets the transformation matrix for the required noise.

Arguments

  • int num - Target noise number.
  • mat4 transform - The noise transformation matrix.

mat4 GetNoiseTransform ( int num ) #

Returns the transformation matrix for the required noise.

Arguments

  • int num - Target noise number.

Return value

The noise transformation matrix.

vec3 GetParticlePosition ( int num ) #

Returns the position of a given particle.

Arguments

  • int num - The particle number.

Return value

Position coordinates for the particle.

float GetParticleRadius ( int num ) #

Returns the radius of a given particle.

Arguments

  • int num - The particle number.

Return value

Radius of the particle.

void SetParticlesRotation ( float mean, float spread ) #

Sets the particle system rotation mean and spread values.

Arguments

  • float mean
  • float spread

float GetParticlesRotationMean ( ) #

Returns the particle system rotation mean value.

Return value

Rotation mean value.

float GetParticlesRotationSpread ( ) #

Returns the particle system rotation spread value.

Return value

Rotation spread value.

void GetParticleTransforms ( mat4[] transforms ) #

Returns transformation matrices for spawned particles.

Arguments

  • mat4[] transforms - Array to which the transformation matrices will be added.

vec3 GetParticleVelocity ( int num ) #

Returns the velocity vector for a specified particle.

Arguments

  • int num - The particle number.

Return value

The velocity vector.

void SetPeriod ( float mean, float spread ) #

Sets an interval of emitter inactivity in seconds.

Arguments

  • float mean - A mean value in seconds. If a negative value is provided, 0 will be used instead.
  • float spread - A spread value in seconds.

float GetPeriodMean ( ) #

Returns the current mean value of emitter inactivity intervals.

Return value

The mean value in seconds.

float GetPeriodSpread ( ) #

Returns the current spread value of emitter inactivity intervals.

Return value

The spread value in seconds.

void SetProceduralTextureResolution ( vec3 res ) #

Sets the resolution of the procedural texture.
Notice
Procedural rendering must be enabled.

Arguments

  • vec3 res - Resolution of the texture.

vec3 GetProceduralTextureResolution ( ) #

Returns the resolution of the procedural texture.
Notice
Procedural rendering must be enabled.

Return value

Resolution of the texture.

void SetRadius ( float mean, float spread ) #

Sets a particle radius in units.

Arguments

  • float mean - A mean value in units. If a too small value is provided, 1E-6 will be used instead.
  • float spread - A spread value in units.

float GetRadiusMean ( ) #

Returns the current mean value of particle radii.

Return value

The mean value in units.

float GetRadiusSpread ( ) #

Returns the current spread value of particle radii.

Return value

The spread value in units.

void SetVelocity ( float mean, float spread ) #

Sets an initial particle velocity in units per second.

Arguments

  • float mean - A mean value in units per second.
  • float spread - A spread value in units per second.

float GetVelocityMean ( ) #

Returns the current mean value of the initial particle velocities.

Return value

The mean value in units per second.

float GetVelocitySpread ( ) #

Returns the current spread value of the initial particle velocities.

Return value

The spread value in units per second.

int AddDeflector ( ) #

Adds a deflector with default settings.

Return value

The number of the new deflector in the list of deflectors.

void AddEmitterSpark ( vec3 point, vec3 normal, vec3 velocity ) #

Adds a spark emitter in the given point.

Arguments

  • vec3 point - Point for sparks emission.
  • vec3 normal - Normal of the point of spark emission.
  • vec3 velocity - Velocity in the point of spark emission (velocity of source particles or node by contact).

int AddForce ( ) #

Adds a force with default settings.

Return value

The number of the new force in the list of forces.

int AddNoise ( ) #

Adds a new noise with default settings.

Return value

The number of the new noise in the list of noises.

void ClearParticles ( ) #

Deletes all particles spawned by the emitter.

void RemoveDeflector ( int num ) #

Removes a given point deflector.

Arguments

  • int num - Number of the deflector to remove.

void RemoveForce ( int num ) #

Removes the given force.

Arguments

  • int num - The number of the force to remove.

void RemoveNoise ( int num ) #

Removes the given noise.

Arguments

  • int num - Target noise number.

static int type ( ) #

Returns the type of the object.

Return value

Object Particles type identifier.

int RestoreStateSelf ( Stream stream ) #

Restores the object's state from the stream.
Notice
This method restores all object's parameters, including forces, noises, and deflectors. To restore any of these parameters individually, use restoreStateForces(), restoreStateNoises(), or restoreStateDeflectors() respectively.

Arguments

  • Stream stream - Stream instance.

Return value

Returns 1 if the object state was successfully restored; otherwise, 0.

int SaveStateSelf ( Stream stream ) #

Saves the object's state to the stream.
Notice
This method saves all object's parameters, including forces, noises, and deflectors. To save any of these parameters individually, use saveStateForces(), saveStateNoises(), or saveStateDeflectors() respectively.

Arguments

  • Stream stream - Stream instance.

Return value

Returns 1 if the object state was successfully saved; otherwise, 0 is returned.

int SaveStateForces ( Stream stream ) #

Saves the state of the object's forces to the specified stream.

Arguments

  • Stream stream - Stream instance.

int RestoreStateForces ( Stream stream ) #

Restores the state of the object's forces from the specified stream.

Arguments

  • Stream stream - Stream instance.

int SaveStateNoises ( Stream stream ) #

Saves the state of the object's noises to the specified stream.

Arguments

  • Stream stream - Stream instance.

int RestoreStateNoises ( Stream stream ) #

Restores the state of the object's noises from the specified stream.

Arguments

  • Stream stream - Stream instance.

int SaveStateDeflectors ( Stream stream ) #

Saves the state of the object's deflectors to the specified stream.

Arguments

  • Stream stream - Stream instance.

int RestoreStateDeflectors ( Stream stream ) #

Restores the state of the object's deflectors from the specified stream.

Arguments

  • Stream stream - Stream instance.

void SetNoiseSeed ( int num, int seed ) #

Sets a new random seed value to be used for the noise with the specified number. This parameter is used to synchronize pseudorandom number generators for particle system noises.

Arguments

  • int num - Target noise number.
  • int seed - Random seed value to be used for the target noise.

int GetNoiseSeed ( int num ) #

Returns the random seed value currently used for the noise with the specified number. This parameter is used to synchronize pseudorandom number generators for particle system noises.

Arguments

  • int num - Target noise number.

Return value

Random seed value currently used for the target noise.

void SetSyncMode ( ObjectParticles.SYNC_MODE mode ) #

Sets synchronization mode to be used for the particle system.

Arguments

  • ObjectParticles.SYNC_MODE mode - Synchronization mode to be set, one of the SYNC_MODE values.

ObjectParticles.SYNC_MODE GetSyncMode ( ) #

Returns the current synchronization mode used for the particle system.

Return value

Current synchronization mode, one of the SYNC_MODE values.

void TakeSyncData ( Stream stream ) #

Writes particle synchronization data to the specified stream. This method should be used by the particle system with the master sync mode.

Arguments

  • Stream stream - Stream to which particle synchronization data is to be written.

void ApplySyncData ( Stream stream ) #

Reads particle synchronization data from the specified stream and applies it to the particle system. This method should be used by the particle system with the slave sync mode.

Arguments

  • Stream stream - Stream with particle synchronization data to be applied.

void SetFPSVisibleCamera ( int camera = -1 ) #

Sets the update rate value when the object is rendered to the viewport. The default value is infinity.

Arguments

  • int camera - Update rate value when the object is rendered.

int GetFPSVisibleCamera ( ) #

Returns the update rate value when the object is rendered to the viewport.

Return value

Update rate value when the object is rendered.

void SetFPSVisibleShadow ( int shadow = 30 ) #

Sets the update rate value when only object shadows are rendered. The default value is 30 fps.

Arguments

  • int shadow - Update rate value when only object shadows are rendered.

int GetFPSVisibleShadow ( ) #

Returns the update rate value when only object shadows are rendered.

Return value

Update rate value when only object shadows are rendered.

void SetFPSInvisible ( int invisible = 0 ) #

Sets the update rate value when the object is not rendered at all. The default value is 0 fps.

Arguments

  • int invisible - Update rate value when the object is not rendered at all.

int GetFPSInvisible ( ) #

Returns the update rate value when the object is not rendered at all.

Return value

Update rate value when the object is not rendered at all.

void SetUpdateDistanceLimit ( float limit = 1000 ) #

Sets the distance from the camera within which the object should be updated. The default value is 1000 units.

Arguments

  • float limit - Distance from the camera within which the object should be updated.

float GetUpdateDistanceLimit ( ) #

Returns the distance from the camera within which the object should be updated.

Return value

Distance from the camera within which the object should be updated.
Last update: 2020-06-01
Build: ()