Class CpuParticles3D
- Namespace
- Godot
- Assembly
- GodotSharp.dll
CPU-based 3D particle node used to create a variety of particle systems and effects.
See also GpuParticles3D, which provides the same functionality with hardware acceleration, but may not run on older devices.
[GodotClassName("CPUParticles3D")]
public class CpuParticles3D : GeometryInstance3D, IDisposable
- Inheritance
-
CpuParticles3D
- Implements
- Inherited Members
Constructors
CpuParticles3D()
public CpuParticles3D()
Properties
Amount
Number of particles emitted in one emission cycle.
public int Amount { get; set; }
Property Value
AngleCurve
Each particle's rotation will be animated along this Curve.
public Curve AngleCurve { get; set; }
Property Value
AngleMax
Maximum angle.
public float AngleMax { get; set; }
Property Value
AngleMin
Minimum angle.
public float AngleMin { get; set; }
Property Value
AngularVelocityCurve
Each particle's angular velocity (rotation speed) will vary along this Curve over its lifetime.
public Curve AngularVelocityCurve { get; set; }
Property Value
AngularVelocityMax
Maximum initial angular velocity (rotation speed) applied to each particle in degrees per second.
public float AngularVelocityMax { get; set; }
Property Value
AngularVelocityMin
Minimum initial angular velocity (rotation speed) applied to each particle in degrees per second.
public float AngularVelocityMin { get; set; }
Property Value
AnimOffsetCurve
Each particle's animation offset will vary along this Curve.
public Curve AnimOffsetCurve { get; set; }
Property Value
AnimOffsetMax
Maximum animation offset.
public float AnimOffsetMax { get; set; }
Property Value
AnimOffsetMin
Minimum animation offset.
public float AnimOffsetMin { get; set; }
Property Value
AnimSpeedCurve
Each particle's animation speed will vary along this Curve.
public Curve AnimSpeedCurve { get; set; }
Property Value
AnimSpeedMax
Maximum particle animation speed.
public float AnimSpeedMax { get; set; }
Property Value
AnimSpeedMin
Minimum particle animation speed.
public float AnimSpeedMin { get; set; }
Property Value
Color
Each particle's initial color.
Note:
Color multiplies the particle mesh's vertex colors. To have a visible effect on a BaseMaterial3D, VertexColorUseAsAlbedomust be true
. For a ShaderMaterial, ALBEDO *= COLOR.rgb;
must be inserted in the shader's fragment()
function. Otherwise, Color will have no visible effect.
public Color Color { get; set; }
Property Value
ColorInitialRamp
Each particle's initial color will vary along this GradientTexture1D (multiplied with Color).
Note:
ColorInitialRamp multiplies the particle mesh's vertex colors. To have a visible effect on a BaseMaterial3D, VertexColorUseAsAlbedomust be true
. For a ShaderMaterial, ALBEDO *= COLOR.rgb;
must be inserted in the shader's fragment()
function. Otherwise, ColorInitialRamp will have no visible effect.
public Gradient ColorInitialRamp { get; set; }
Property Value
ColorRamp
Each particle's color will vary along this GradientTexture1D over its lifetime (multiplied with Color).
Note:
ColorRamp multiplies the particle mesh's vertex colors. To have a visible effect on a BaseMaterial3D, VertexColorUseAsAlbedomust be true
. For a ShaderMaterial, ALBEDO *= COLOR.rgb;
must be inserted in the shader's fragment()
function. Otherwise, ColorRamp will have no visible effect.
public Gradient ColorRamp { get; set; }
Property Value
DampingCurve
Damping will vary along this Curve.
public Curve DampingCurve { get; set; }
Property Value
DampingMax
Maximum damping.
public float DampingMax { get; set; }
Property Value
DampingMin
Minimum damping.
public float DampingMin { get; set; }
Property Value
Direction
Unit vector specifying the particles' emission direction.
public Vector3 Direction { get; set; }
Property Value
DrawOrder
Particle draw order. Uses CpuParticles3D.DrawOrderEnum values.
public CpuParticles3D.DrawOrderEnum DrawOrder { get; set; }
Property Value
EmissionBoxExtents
The rectangle's extents if EmissionShape is set to Box.
public Vector3 EmissionBoxExtents { get; set; }
Property Value
EmissionColors
Sets the Colors to modulate particles by when using Points or DirectedPoints.
Note:
EmissionColors multiplies the particle mesh's vertex colors. To have a visible effect on a BaseMaterial3D, VertexColorUseAsAlbedomust be true
. For a ShaderMaterial, ALBEDO *= COLOR.rgb;
must be inserted in the shader's fragment()
function. Otherwise, EmissionColors will have no visible effect.
public Color[] EmissionColors { get; set; }
Property Value
- Color[]
EmissionNormals
Sets the direction the particles will be emitted in when using DirectedPoints.
public Vector3[] EmissionNormals { get; set; }
Property Value
- Vector3[]
EmissionPoints
Sets the initial positions to spawn particles when using Points or DirectedPoints.
public Vector3[] EmissionPoints { get; set; }
Property Value
- Vector3[]
EmissionRingAxis
The axis of the ring when using the emitter Ring.
public Vector3 EmissionRingAxis { get; set; }
Property Value
EmissionRingHeight
The height of the ring when using the emitter Ring.
public float EmissionRingHeight { get; set; }
Property Value
EmissionRingInnerRadius
The inner radius of the ring when using the emitter Ring.
public float EmissionRingInnerRadius { get; set; }
Property Value
EmissionRingRadius
The radius of the ring when using the emitter Ring.
public float EmissionRingRadius { get; set; }
Property Value
EmissionShape
Particles will be emitted inside this region. See CpuParticles3D.EmissionShapeEnum for possible values.
public CpuParticles3D.EmissionShapeEnum EmissionShape { get; set; }
Property Value
EmissionSphereRadius
The sphere's radius if CpuParticles3D.EmissionShapeEnum is set to Sphere.
public float EmissionSphereRadius { get; set; }
Property Value
Emitting
If true
, particles are being emitted. Emitting can be used to start and stop particles from emitting. However, if OneShot is true
setting Emitting to true
will not restart the emission cycle until after all active particles finish processing. You can use the Finished signal to be notified once all active particles finish processing.
public bool Emitting { get; set; }
Property Value
Explosiveness
How rapidly particles in an emission cycle are emitted. If greater than 0
, there will be a gap in emissions before the next cycle begins.
public float Explosiveness { get; set; }
Property Value
FixedFps
The particle system's frame rate is fixed to a value. For example, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the particle system itself.
public int FixedFps { get; set; }
Property Value
Flatness
Amount of Spread in Y/Z plane. A value of 1
restricts particles to X/Z plane.
public float Flatness { get; set; }
Property Value
FractDelta
If true
, results in fractional delta calculation which has a smoother particles display effect.
public bool FractDelta { get; set; }
Property Value
Gravity
Gravity applied to every particle.
public Vector3 Gravity { get; set; }
Property Value
HueVariationCurve
Each particle's hue will vary along this Curve.
public Curve HueVariationCurve { get; set; }
Property Value
HueVariationMax
Maximum hue variation.
public float HueVariationMax { get; set; }
Property Value
HueVariationMin
Minimum hue variation.
public float HueVariationMin { get; set; }
Property Value
InitialVelocityMax
Maximum value of the initial velocity.
public float InitialVelocityMax { get; set; }
Property Value
InitialVelocityMin
Minimum value of the initial velocity.
public float InitialVelocityMin { get; set; }
Property Value
Lifetime
Amount of time each particle will exist.
public double Lifetime { get; set; }
Property Value
LifetimeRandomness
Particle lifetime randomness ratio.
public double LifetimeRandomness { get; set; }
Property Value
LinearAccelCurve
Each particle's linear acceleration will vary along this Curve.
public Curve LinearAccelCurve { get; set; }
Property Value
LinearAccelMax
Maximum linear acceleration.
public float LinearAccelMax { get; set; }
Property Value
LinearAccelMin
Minimum linear acceleration.
public float LinearAccelMin { get; set; }
Property Value
LocalCoords
If true
, particles use the parent node's coordinate space (known as local coordinates). This will cause particles to move and rotate along the CpuParticles3D node (and its parents) when it is moved or rotated. If false
, particles use global coordinates; they will not move or rotate along the CpuParticles3D node (and its parents) when it is moved or rotated.
public bool LocalCoords { get; set; }
Property Value
Mesh
The Mesh used for each particle. If null
, particles will be spheres.
public Mesh Mesh { get; set; }
Property Value
OneShot
If true
, only one emission cycle occurs. If set true
during a cycle, emission will stop at the cycle's end.
public bool OneShot { get; set; }
Property Value
OrbitVelocityCurve
Each particle's orbital velocity will vary along this Curve.
public Curve OrbitVelocityCurve { get; set; }
Property Value
OrbitVelocityMax
Maximum orbit velocity.
public float OrbitVelocityMax { get; set; }
Property Value
OrbitVelocityMin
Minimum orbit velocity.
public float OrbitVelocityMin { get; set; }
Property Value
ParticleFlagAlignY
Align Y axis of particle with the direction of its velocity.
public bool ParticleFlagAlignY { get; set; }
Property Value
ParticleFlagDisableZ
If true
, particles will not move on the Z axis.
public bool ParticleFlagDisableZ { get; set; }
Property Value
ParticleFlagRotateY
If true
, particles rotate around Y axis by AngleMin.
public bool ParticleFlagRotateY { get; set; }
Property Value
Preprocess
Particle system starts as if it had already run for this many seconds.
public double Preprocess { get; set; }
Property Value
RadialAccelCurve
Each particle's radial acceleration will vary along this Curve.
public Curve RadialAccelCurve { get; set; }
Property Value
RadialAccelMax
Maximum radial acceleration.
public float RadialAccelMax { get; set; }
Property Value
RadialAccelMin
Minimum radial acceleration.
public float RadialAccelMin { get; set; }
Property Value
Randomness
Emission lifetime randomness ratio.
public float Randomness { get; set; }
Property Value
ScaleAmountCurve
Each particle's scale will vary along this Curve.
public Curve ScaleAmountCurve { get; set; }
Property Value
ScaleAmountMax
Maximum scale.
public float ScaleAmountMax { get; set; }
Property Value
ScaleAmountMin
Minimum scale.
public float ScaleAmountMin { get; set; }
Property Value
ScaleCurveX
Curve for the scale over life, along the x axis.
public Curve ScaleCurveX { get; set; }
Property Value
ScaleCurveY
Curve for the scale over life, along the y axis.
public Curve ScaleCurveY { get; set; }
Property Value
ScaleCurveZ
Curve for the scale over life, along the z axis.
public Curve ScaleCurveZ { get; set; }
Property Value
SpeedScale
Particle system's running speed scaling ratio. A value of 0
can be used to pause the particles.
public double SpeedScale { get; set; }
Property Value
SplitScale
If set to true
, three different scale curves can be specified, one per scale axis.
public bool SplitScale { get; set; }
Property Value
Spread
Each particle's initial direction range from +spread
to -spread
degrees. Applied to X/Z plane and Y/Z planes.
public float Spread { get; set; }
Property Value
TangentialAccelCurve
Each particle's tangential acceleration will vary along this Curve.
public Curve TangentialAccelCurve { get; set; }
Property Value
TangentialAccelMax
Maximum tangent acceleration.
public float TangentialAccelMax { get; set; }
Property Value
TangentialAccelMin
Minimum tangent acceleration.
public float TangentialAccelMin { get; set; }
Property Value
Methods
ConvertFromParticles(Node)
Sets this node's properties to match a given GpuParticles3D node with an assigned ParticleProcessMaterial.
public void ConvertFromParticles(Node particles)
Parameters
particles
Node
HasGodotClassMethod(in godot_string_name)
Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.
protected override bool HasGodotClassMethod(in godot_string_name method)
Parameters
method
godot_string_nameName of the method to check for.
Returns
HasGodotClassSignal(in godot_string_name)
Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.
protected override bool HasGodotClassSignal(in godot_string_name signal)
Parameters
signal
godot_string_nameName of the signal to check for.
Returns
InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)
Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.
protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)
Parameters
method
godot_string_nameName of the method to invoke.
args
NativeVariantPtrArgsArguments to use with the invoked method.
ret
godot_variantValue returned by the invoked method.
Returns
Restart()
Restarts the particle emitter.
public void Restart()
Events
Finished
Emitted when all active particles have finished processing. When OneShot is disabled, particles will process continuously, so this is never emitted.
public event Action Finished