This page has been translated automatically.
Getting Started
Migrating to UNIGINE 2.0
C++ API Migration
UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
Usage Examples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Unigine::ObjectParticles Class

Interface for object particles handling. See also the UnigineScript analog.

To use this class, include the UnigineObjectParticles.h file.

Unigine::ObjectParticles Class

Members


static int type ()

ObjectParticles type.

Return value

ObjectParticles type identifier.

static Ptr< ObjectParticles > create (const NodePtr & node)

ObjectParticles constructor.

Arguments

  • const NodePtr & node - Node smart pointer.

static Ptr< ObjectParticles > create (const ObjectPtr & object)

ObjectParticles constructor.

Arguments

  • const ObjectPtr & object - Object smart pointer.

static Ptr< ObjectParticles > create ()

ObjectParticles constructor.

virtual void setSeed (unsigned int seed) const =0

Sets a seed value for the particles' random generator.

Arguments

  • unsigned int seed - A seed value.

virtual unsigned int getSeed () const =0

Returns the seed value used for the particles' random generator.

Return value

The seed value.

virtual void setParticlesType (int type) const =0

Sets a type of particles to emit.

Arguments

  • int type - A type of particles (one of the TYPE_* values).

virtual int getParticlesType () const =0

Returns the type of emitted particles.

Return value

The type of particles (one of the TYPE_* values).

virtual void setWarming (int warning) const =0

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.

Arguments

  • int warning - 1 to enable the warm start; 0 to disable it.

virtual int getWarming () const =0

Returns 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.

Return value

1 if the warm start is enabled; 0 if it is disabled.

virtual void setDepthSort (int depth_sort) const =0

Enables or disables depth sorting of particles. The depth sorting is required, if particles use alpha blending.

Arguments

  • int depth_sort - 1 to enable the depth sorting, 0 to disable it.

virtual int getDepthSort () const =0

Returns a value indicating if depth sorting of particles is enabled. The depth sorting is required, if particles use alpha blending.

Return value

1 if the depth sorting is enabled; otherwise, 0.

virtual void setVariationX (int variation) const =0

Sets a value indicating if the initial orientation of particles diffuse texture should be randomly varied along the X axis.

Arguments

  • int variation - 1 to add random variation along the X axis, 0 not to add.

virtual int getVariationX () const =0

Returns a value indicating if the initial orientation of particles diffuse texture is randomly varied along the X axis.

Return value

1 if there is random variation along the X axis, 0 if there is not.

virtual void setVariationY (int variation) const =0

Sets a value indicating if the initial orientation of particles diffuse texture should be randomly varied along the Y axis.

Arguments

  • int variation - 1 to add random variation along the Y axis, 0 not to add.

virtual int getVariationY () const =0

Returns a value indicating if the initial orientation of particles diffuse texture is randomly varied along the Y axis.

Return value

1 if there is random variation along the Y axis, 0 if there is not.

virtual void setTextureAtlas (int atlas) const =0

Sets a value indicating if a diffuse texture for the particles is a 4x4 texture atlas.

Arguments

  • int atlas - 1 if a texture atlas is used; 0 if an ordinary diffuse texture is assigned.

virtual int getTextureAtlas () const =0

Returns a value indicating if a diffuse texture for the particles is used as a 4x4 texture atlas.

Return value

1 if a texture atlas is used; otherwise, 0.

virtual void setIntersection (int intersection) const =0

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.

Arguments

  • int intersection - 1 to detect intersections, 0 not to detect.

virtual int getIntersection () const =0

Returns a value indicating if collision is detected by the center of the sphere that approximates the particles. This method is faster than sphere-based collision detection, but less precise.

Return value

1 if the sphere center-based intersection detection is enabled; otherwise, 0.

virtual void setCollision (int collision) const =0

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.

Arguments

  • int collision - 1 to enable sphere-based collision detection, 0 to disable it.

virtual int getCollision () const =0

Returns 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.

Return value

1 if the sphere-based collision detection is enabled; otherwise, 0.

virtual void setCulling (int culling) const =0

Sets a value indicating if particles should disappear upon collision or intersection.

Arguments

  • int culling - 1 to make particles disappear; 0 to continue rendering of particles after collision/intersection.

virtual int getCulling () const =0

Returns a value indicating if particles would disappear upon collision or intersection.

Return value

1 if particles would disappear; otherwise, 0.

virtual void setSpawnRate (float spawn) const =0

Sets a rate at which particles are created.

Arguments

  • float spawn - A new spawn rate. If a too small value is provided, 1E-6 will be used instead.

virtual float getSpawnRate () const =0

Returns the current particle spawn rate.

Return value

The current spawn rate.

virtual void setSpawnScale (float scale) const =0

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.

Arguments

  • float scale - 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.

virtual float getSpawnScale () const =0

Returns 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.

Return value

The current spawn scale.

virtual void setSpawnThreshold (float threshold) const =0

Sets the velocity threshold for spark and random emitters. They spawn particles if the velocity value of the parent particles is high enough.

Arguments

  • float threshold - A velocity threshold for the parent particles.

virtual float getSpawnThreshold () const =0

Returns the current velocity threshold for spark and random emitters. They spawn particles if velocity of the parent particles is high enough.

Return value

The current velocity threshold of the parent particles.

virtual void clearParticles () const =0

Deletes all particles spawned by the emitter.

virtual int getNumParticles () const =0

Returns the current number of particles.

Return value

The number of particles.

virtual float getParticleRadius (int num) const =0

Returns the radius of a given particle.

Arguments

  • int num - The particle number.

Return value

Radius of the particle.

virtual UNIGINE_VEC3 getParticlePosition (int num) const =0

Returns the position of a given particle.

Arguments

  • int num - The particle number.

Return value

Position coordinates for the particle.

virtual vec3 getParticleVelocity (int num) const =0

Returns the velocity vector for a specified particle.

Arguments

  • int num - The particle number.

Return value

The velocity vector.

virtual void getParticleTransforms (Vector< UNIGINE_MAT4 > & transforms) const =0

Returns transformation matrices for spawned particles.

Arguments

  • Vector< UNIGINE_MAT4 > & transforms - Array to which the transformation matrices will be added.

virtual void setPhysicalMask (int mask) const =0

Sets a bit mask for interactions with physicals. Two objects interact, if they both have matching masks.

Arguments

  • int mask - Integer, each bit of which is a mask.

virtual int getPhysicalMask () const =0

Returns the bit mask for interactions with physicals. Two objects interact, if they both have matching masks.

Return value

Integer, each bit of which is a mask.

virtual void setPhysicalMass (float mass) const =0

Sets the mass of the particles. This value matters only for computing physical interactions.

Arguments

  • float mass - The mass of the particles.

virtual float getPhysicalMass () const =0

Returns the current mass of the particles. This value matters only for computing physical interactions.

Return value

The mass of the particles.

virtual void setLengthStretch (float stretch) const =0

Sets a factor by which length particles will be stretched.

Arguments

  • float stretch - A stretch factor. If a negative value is provided, 0 will be used instead.

virtual float getLengthStretch () const =0

Returns the current factor, by which length particles are stretched.

Return value

The current stretch factor.

virtual void setLengthFlattening (float flattening) const =0

Sets a factor of the linear interpolation between the Z axis and the camera direction for the length particles.

Arguments

  • float flattening - A flattening factor. If a negative value is provided, 0 will be used instead.

virtual float getLengthFlattening () const =0

Returns the current factor of the linear interpolation between the Z axis and the camera direction for the length particles.

Return value

The current flattening factor.

virtual void setLinearDamping (float damping) const =0

Sets a linear damping of particles.

Arguments

  • float damping - a new linear damping. If a negative value is provided, 0 will be used instead.

virtual float getLinearDamping () const =0

Returns the current linear damping of particles.

Return value

The current linear damping.

virtual void setAngularDamping (float damping) const =0

Sets an angular damping of particles.

Arguments

  • float damping - A new angular damping. If a negative value is provided, 0 will be used instead.

virtual float getAngularDamping () const =0

Returns the current angular damping of particles.

Return value

The current angular damping.

virtual void setGrowthDamping (float damping) const =0

Sets the damping of particles growth in size.

Arguments

  • float damping - A new growth damping. If a negative value is provided, 0 will be used instead.

virtual float getGrowthDamping () const =0

Returns the current damping of particles growth in size.

Return value

The current growth damping.

virtual void setRestitution (float restitution) const =0

Sets a restitution value for particles.

Arguments

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

virtual float getRestitution () const =0

Returns the current restitution value for particles.

Return value

The current restitution value.

virtual void setRoughness (float roughness) const =0

Sets a roughness of the particle surface.

Arguments

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

virtual float getRoughness () const =0

Returns the current roughness of the particle surface.

Return value

The current roughness.

virtual void setEmitterType (int type) const =0

Sets a type of the emitter.

Arguments

  • int type - The type of the emitter (one of the EMITTER_* values).

virtual int getEmitterType () const =0

Returns the type of the emitter.

Return value

The type of the emitter (one of the EMITTER_* values).

virtual void setEmitterEnabled (int enable) const =0

Enables or disables particle emission.

Arguments

  • int enable - 1 to enable particle emission, 0 to disable it.

virtual int isEmitterEnabled () const =0

Returns a value indicating if particle emission is enabled.

Return value

1 if emission is enabled; otherwise, 0.

virtual void setEmitterBased (int based) const =0

Sets a value indicating if particles should follow emitter transformations, i.e. the direction of their flow should change after the emitter.

Arguments

  • int based - 1 for particles to follow emitter transformations; 0 for them to flow independently.

virtual int isEmitterBased () const =0

Returns a value indicating if particles follow emitter transformations, i.e. the direction of their flow changes after the emitter.

Return value

1 if particles follow emitter transformations; otherwise, 0.

virtual void setEmitterShift (int shift) const =0

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.

Arguments

  • int shift - 1 to enable the shift-based spawning; 0 to disable it.

virtual int isEmitterShift () const =0

Returns 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.

Return value

1 if the shift-based spawning is enabled; 0 if it is not.

virtual void setEmitterContinuous (int continuous) const =0

Sets a value indicating if additional spawn points should be generated when the emitter is moved, which provides a continuous flow of particles.

Arguments

  • int continuous - 1 to create the continuous flow of particles; 0 to create the discrete flow with sparse generation points.

virtual int isEmitterContinuous () const =0

Returns a value indicating if additional spawn points are generated when the emitter is moved, which provides a continuous flow of particles.

Return value

1 if particles are created in the continuous flow; otherwise, 0.

virtual void setEmitterSequence (int sequence) const =0

Sets the rendering order of the particle system inside the particles hierarchy.

Arguments

  • int sequence - The rendering priority. Particle systems with the lowest order number are rendered first.

virtual int getEmitterSequence () const =0

Returns the current rendering order of the particle system inside the particles hierarchy.

Return value

The current rendering priority.

virtual void setEmitterLimit (int limit) const =0

Sets the maximum number of particles that an emitter can possibly spawn per one frame.

Arguments

  • int limit - The maximum possible number of particles. If a negative value is provided, 0 will be used instead.

virtual int getEmitterLimit () const =0

Returns the current maximum number of particles that an emitter can possibly spawn per one frame.

Return value

The maximum possible number of particles.

virtual void setEmitterSync (int sync) const =0

Sets a value indicating if a particle system emitter needs to be synchronized to a parent particle system.

Arguments

  • int sync - 1 to synchronize the emitter; otherwise, 0.

virtual int getEmitterSync () const =0

Returns a value indicating if a particle system emitter is synchronized to a parent particle system.

Return value

1 if it is synchronized; otherwise, 0.

virtual void setEmitterSize (const vec3 & size) const =0

Sets a size of the emitter.

Arguments

  • const vec3 & size - A new emitter size. If negative values are provided, 0 will be used instead of them. Depending on the type of the emitter, this value is interpreted as follows:
    • EMITTER_POINT, EMITTER_SPARK, EMITTER_RANDOM: all vector components are ignored.
    • EMITTER_SPHERE: the first vector component is the radius of the sphere.
    • EMITTER_CYLINDER: the first vector component is the radius of the cylinder, the second vector component is the height of the cylinder.
    • EMITTER_BOX: all vector components are interpreted as box dimensions (x, y, z).

virtual vec3 getEmitterSize () const =0

Returns the current emitter size.

Return value

The current size of the emitter. Depending on the type of the emitter, this value is interpreted as follows:
  • EMITTER_POINT, EMITTER_SPARK, EMITTER_RANDOM: all vector components are ignored.
  • EMITTER_SPHERE: the first vector component is the radius of the sphere.
  • EMITTER_CYLINDER: the first vector component is the radius of the cylinder, the second vector component is the height of the cylinder.
  • EMITTER_BOX: all vector components are interpreted as box dimensions (x, y, z).

virtual void setEmitterDirection (const vec3 & direction) const =0

Sets the direction of particles emission along the axes.

Arguments

  • const vec3 & direction - The emission direction.

virtual vec3 getEmitterDirection () const =0

Returns the current direction of particles emission along the axes.

Return value

The current emission direction.

virtual void setEmitterSpread (const vec3 & spread) const =0

Sets a spread of particles emission along the axes.

Arguments

  • const vec3 & spread - A spread of particles emission.

virtual vec3 getEmitterSpread () const =0

Returns the current spread of particles emission along the axes.

Return value

The spread of particles emission.

virtual void setEmitterVelocity (const vec3 & velocity) const =0

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.

Arguments

  • const vec3 & velocity - An emitter velocity in units per second.

virtual vec3 getEmitterVelocity () const =0

Returns 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.

Return value

The emitter velocity in units per second.

virtual void addEmitterSpark (const UNIGINE_VEC3 & point, const vec3 & normal, const vec3 & velocity) const =0

Adds a spark emitter in the given point.

Arguments

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

virtual void setDelay (float mean, float spread) const =0

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.

virtual float getDelayMean () const =0

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

Return value

The mean value in seconds.

virtual float getDelaySpread () const =0

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

Return value

The spread value in seconds.

virtual void setPeriod (float mean, float spread) const =0

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.

virtual float getPeriodMean () const =0

Returns the current mean value of emitter inactivity intervals.

Return value

The mean value in seconds.

virtual float getPeriodSpread () const =0

Returns the current spread value of emitter inactivity intervals.

Return value

The spread value in seconds.

virtual void setDuration (float mean, float spread) const =0

Sets a duration of each particle emission 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.

virtual float getDurationMean () const =0

Returns the current mean value of particle emission intervals.

Return value

The mean value in seconds.

virtual float getDurationSpread () const =0

Returns the current spread value of particle emission intervals.

Return value

The spread value in seconds.

virtual void setLife (float mean, float spread) const =0

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.

virtual float getLifeMean () const =0

Returns the current mean value of particle lifetime duration.

Return value

The mean value in seconds.

virtual float getLifeSpread () const =0

Returns the current spread value of particle lifetime duration.

Return value

The spread value in seconds.

virtual void setVelocity (float mean, float spread) const =0

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.

virtual float getVelocityMean () const =0

Returns the current mean value of the initial particle velocities.

Return value

The mean value in units per second.

virtual float getVelocitySpread () const =0

Returns the current spread value of the initial particle velocities.

Return value

The spread value in units per second.

virtual void setAngle (float mean, float spread) const =0

Sets an angle of emission.

Arguments

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

virtual float getAngleMean () const =0

Returns the mean value of the emission angle.

Return value

The mean value in degrees.

virtual float getAngleSpread () const =0

Returns the spread value of the emission angle.

Return value

The spread value in degrees.

virtual void setRotation (float mean, float spread) const =0

Sets an angle (in degrees) at which the emitted particles should be rotated.

Arguments

  • float mean - The mean value in degrees.
  • float spread - The spread value in degrees.

virtual float getRotationMean () const =0

Returns the current mean value of the angles at which the emitted particles are rotated.

Return value

The mean value in degrees.

virtual float getRotationSpread () const =0

Returns the current spread value of the angles at which the emitted particles are rotated.

Return value

The spread value in degrees.

virtual void setRadius (float mean, float spread) const =0

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.

virtual float getRadiusMean () const =0

Returns the current mean value of particle radii.

Return value

The mean value in units.

virtual float getRadiusSpread () const =0

Returns the current spread value of particle radii.

Return value

The spread value in units.

virtual void setGrowth (float mean, float spread) const =0

Sets a particle growth factor.

Arguments

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

virtual float getGrowthMean () const =0

Returns the current mean value of the particle growth factor.

Return value

The mean value.

virtual float getGrowthSpread () const =0

Returns the current spread value of the particle growth factor.

Return value

The spread value.

virtual void setGravity (const vec3 & gravity) const =0

Sets a gravity force influencing particles.

Arguments

  • const vec3 & gravity - A gravity force.

virtual vec3 getGravity () const =0

Returns the current gravity force influencing particles.

Return value

The current gravity force.

virtual int addForce () const =0

Adds a force with default settings.

Return value

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

virtual void removeForce (int num) const =0

Removes the given force.

Arguments

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

virtual void setNumForces (int num) const =0

Sets the new number of forces.

Arguments

  • int num - Number of forces.

virtual int getNumForces () const =0

Returns the number of the currently acting forces.

Return value

The number of forces.

virtual void setForceEnabled (int num, int enable) const =0

Enables or disables the given force.

Arguments

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

virtual int isForceEnabled (int num) const =0

Returns a value indicating if the given force is enabled.

Arguments

  • int num - The force number.

Return value

1 if the force is enabled; otherwise, 0.

virtual void setForceAttached (int num, int attached) const =0

Attaches or detaches the given force to the particle system.

Arguments

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

virtual int isForceAttached (int num) const =0

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

Arguments

  • int num - The force number.

Return value

1 if the force is attached; otherwise, 0.

virtual void setForceTransform (int num, const UNIGINE_MAT4 & transform) const =0

Sets a transformation matrix for the specified force.

Arguments

  • int num - The force number.
  • const UNIGINE_MAT4 & transform - A transformation matrix.

virtual UNIGINE_MAT4 getForceTransform (int num) const =0

Returns the current transformation matrix for the specified force.

Arguments

  • int num - The force number.

Return value

The transformation matrix.

virtual void setForceRadius (int num, float radius) const =0

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.

virtual float getForceRadius (int num) const =0

Returns the current radius set for applying the force.

Arguments

  • int num - The force number.

Return value

The current radius in units.

virtual void setForceAttenuation (int num, float attenuation) const =0

Sets an attenuation factor for the specified force.

Arguments

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

virtual float getForceAttenuation (int num) const =0

Returns the current attenuation factor for the specified force.

Arguments

  • int num - The force number.

Return value

The current attenuation factor.

virtual void setForceAttractor (int num, float attractor) const =0

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.

virtual float getForceAttractor (int num) const =0

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.

virtual void setForceRotator (int num, float rotator) const =0

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.

virtual float getForceRotator (int num) const =0

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.

virtual int addNoise () const =0

Adds a new noise with default settings.

Return value

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

virtual void removeNoise (int num) const =0

Removes the given noise.

Arguments

  • int num - The target noise number.

virtual void setNumNoises (int num) const =0

Sets the new number of noises.

Arguments

  • int num - Number of noises.

virtual int getNumNoises () const =0

Returns the current number of noises.

Return value

Number of noises.

virtual void setNoiseEnabled (int num, int enable) const =0

Enables or disables the given noise.

Arguments

  • int num - The target noise number.
  • int enable - 1 to enable the noise, 0 to disable it.

virtual int isNoiseEnabled (int num) const =0

Returns a value indicating if the given noise is enabled.

Arguments

  • int num - The target noise number.

Return value

1 if the noise is enabled; otherwise, 0.

virtual void setNoiseAttached (int num, int attached) const =0

Sets the noise as an attached.

Arguments

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

virtual int isNoiseAttached (int num) const =0

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

Arguments

  • int num - The target noise number.

Return value

1 if the noise is attached; otherwise, 0.

virtual void setNoiseTransform (int num, const UNIGINE_MAT4 & transform) const =0

Sets the transformation matrix for the required noise.

Arguments

  • int num - The target noise number.
  • const UNIGINE_MAT4 & transform - The noise transformation matrix.

virtual UNIGINE_MAT4 getNoiseTransform (int num) const =0

Returns the transformation matrix for the required noise.

Arguments

  • int num - The target noise number.

Return value

The noise transformation matrix.

virtual void setNoiseOffset (int num, const vec3 & offset) const =0

Sets the Offset parameter coordinates values for the required noise.

Arguments

  • int num - The target noise number.
  • const vec3 & offset - Offset coordinates values.

virtual vec3 getNoiseOffset (int num) const =0

Returns the Offset parameter coordinates values for the required noise.

Arguments

  • int num - The target noise number.

Return value

Offset coordinates values.

virtual void setNoiseStep (int num, const vec3 & step) const =0

Sets the Step parameter coordinates values for the required noise.

Arguments

  • int num - The target noise number.
  • const vec3 & step - Step coordinates values.

virtual vec3 getNoiseStep (int num) const =0

Returns the Step parameter coordinates values for the required noise.

Arguments

  • int num - The target noise number.

Return value

Step coordinates values.

virtual void setNoiseForce (int num, float force) const =0

Sets the Force parameter value for the required noise.

Arguments

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

virtual float getNoiseForce (int num) const =0

Returns the Force parameter value for the required noise.

Arguments

  • int num - The target noise number.

Return value

The noise force value.

virtual void setNoiseScale (int num, float scale) const =0

Sets the Scale parameter value for the required noise.

Arguments

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

virtual float getNoiseScale (int num) const =0

Returns the Scale parameter value for the required noise.

Arguments

  • int num - The target noise number.

Return value

The noise scale value.

virtual void setNoiseFrequency (int num, int frequency) const =0

Sets the Frequency parameter value for the required noise.

Arguments

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

virtual int getNoiseFrequency (int num) const =0

Returns the Frequency parameter value for the required noise.

Arguments

  • int num - The target noise number.

Return value

The noise frequency value.

virtual void setNoiseSize (int num, int size) const =0

Sets the Size parameter value for the required noise.

Arguments

  • int num - The target noise number.
  • int size - The noise size value.

virtual int getNoiseSize (int num) const =0

Returns the Size parameter value for the required noise.

Arguments

  • int num - The target noise number.

Return value

The noise size value.

virtual ImagePtr getNoiseImage (int num) const =0

Returns the spatial texture for the required noise.

Arguments

  • int num - The target noise number.

Return value

The texture of the noise.

virtual int addDeflector () const =0

Adds a deflector with default settings.

Return value

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

virtual void removeDeflector (int num) const =0

Removes a given point deflector.

Arguments

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

virtual void setNumDeflectors (int num) const =0

Sets the new number of deflectors.

Arguments

  • int num - Number of deflectiors.

virtual int getNumDeflectors () const =0

Returns the current number of deflectors.

Return value

The number of deflectors.

virtual void setDeflectorType (int num, int type) const =0

Sets a type of a given deflector.

Arguments

  • int num - The deflector number.
  • int type - DEFLECTOR_REFLECTOR or DEFLECTOR_CLIPPER.

virtual int getDeflectorType (int num) const =0

Returns a type of a given deflector.

Arguments

  • int num - The deflector number.

Return value

DEFLECTOR_REFLECTOR or DEFLECTOR_CLIPPER.

virtual void setDeflectorEnabled (int num, int enable) const =0

Enables or disables the given deflector.

Arguments

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

virtual int isDeflectorEnabled (int num) const =0

Returns a value indicating if the given deflector is enabled.

Arguments

  • int num - The deflector number.

Return value

1 if the deflector is enabled; otherwise, 0.

virtual void setDeflectorAttached (int num, int attached) const =0

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.

virtual int isDeflectorAttached (int num) const =0

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

Arguments

  • int num - The deflector number.

Return value

1 if the deflector is attached; otherwise, 0.

virtual void setDeflectorTransform (int num, const UNIGINE_MAT4 & transform) const =0

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

Arguments

  • int num - The deflector number.
  • const UNIGINE_MAT4 & transform - A new transformation matrix.

virtual UNIGINE_MAT4 getDeflectorTransform (int num) const =0

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.

virtual void setDeflectorSize (int num, const vec3 & size) const =0

Sets dimensions of a given deflector.

Arguments

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

virtual vec3 getDeflectorSize (int num) const =0

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

virtual void setDeflectorRestitution (int num, float restitution) const =0

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].

virtual float getDeflectorRestitution (int num) const =0

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

Arguments

  • int num - The deflector number.

Return value

The current restitution.

virtual void setDeflectorRoughness (int num, float roughness) const =0

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].

virtual float getDeflectorRoughness (int num) const =0

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

Arguments

  • int num - The deflector number.

Return value

The current roughness.

virtual int getNumContacts () const =0

Returns the total number of particles collisions with other objects.

Return value

Number of collisions.

virtual UNIGINE_VEC3 getContactPoint (int num) const =0

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.

virtual vec3 getContactNormal (int num) const =0

Returns the point of the particles collision with other objects.

Arguments

  • int num - The collision point number.

Return value

Collision point coordinates.

virtual vec3 getContactVelocity (int num) const =0

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.

virtual ObjectPtr getContactObject (int num) const =0

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.

virtual UNIGINE_VEC3 getWorldOffset () const =0

Returns 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.

Return value

Offset coordinates values.

Unigine::ObjectParticles::anonymous_85 Enumeration

TYPE_BILLBOARD = 0
TYPE_FLAT
TYPE_POINT
TYPE_LENGTH
TYPE_RANDOM
TYPE_ROUTE
TYPE_CHAIN

Unigine::ObjectParticles::anonymous_86 Enumeration

EMITTER_POINT = 0
EMITTER_SPHERE
EMITTER_CYLINDER
EMITTER_BOX
EMITTER_RANDOM
EMITTER_SPARK

Unigine::ObjectParticles::anonymous_87 Enumeration

DEFLECTOR_REFLECTOR = 0
DEFLECTOR_CLIPPER
Last update: 2017-07-03
Build: ()