ParticlesMaterial defines particle properties and behavior. It is used in the process_material
of godot.Particles
and godot.Particles2D
emitter nodes.
Some of this material's properties are applied to each particle when emitted, while others can have a godot.CurveTexture
applied to vary values over the lifetime of the particle.
When a randomness ratio is applied to a property it is used to scale that property by a random amount. The random ratio is used to interpolate between 1.0
and a random number less than one, the result is multiplied by the property to obtain the randomized property. For example a random ratio of 0.4
would scale the original property between 0.4-1.0
of its original value.
Constructor
Variables
angle:Single
Initial rotation applied to each particle, in degrees.
Note: Only applied when godot.ParticlesMaterial.flagDisableZ
or godot.ParticlesMaterial.flagRotateY
are true
or the godot.SpatialMaterial
being used to draw the particle is using godot.SpatialMaterial_BillboardMode.particles
.
angularVelocity:Single
Initial angular velocity applied to each particle in degrees per second. Sets the speed of rotation of the particle.
Note: Only applied when godot.ParticlesMaterial.flagDisableZ
or godot.ParticlesMaterial.flagRotateY
are true
or the godot.SpatialMaterial
being used to draw the particle is using godot.SpatialMaterial_BillboardMode.particles
.
angularVelocityCurve:Texture
Each particle's angular velocity will vary along this godot.CurveTexture
.
color:Color
Each particle's initial color. If the godot.Particles2D
's texture
is defined, it will be multiplied by this color. To have particle display color in a godot.SpatialMaterial
make sure to set godot.SpatialMaterial.vertexColorUseAsAlbedo
to true
.
colorRamp:Texture
Each particle's color will vary along this godot.GradientTexture
over its lifetime (multiplied with godot.ParticlesMaterial.color
).
emissionBoxExtents:Vector3
The box's extents if emission_shape
is set to godot.ParticlesMaterial_EmissionShapeEnum.box
.
emissionColorTexture:Texture
Particle color will be modulated by color determined by sampling this texture at the same point as the godot.ParticlesMaterial.emissionPointTexture
.
emissionNormalTexture:Texture
Particle velocity and rotation will be set by sampling this texture at the same point as the godot.ParticlesMaterial.emissionPointTexture
. Used only in godot.ParticlesMaterial_EmissionShapeEnum.directedPoints
. Can be created automatically from mesh or node by selecting "Create Emission Points from Mesh/Node" under the "Particles" tool in the toolbar.
emissionPointCount:Int
The number of emission points if emission_shape
is set to godot.ParticlesMaterial_EmissionShapeEnum.points
or godot.ParticlesMaterial_EmissionShapeEnum.directedPoints
.
emissionPointTexture:Texture
Particles will be emitted at positions determined by sampling this texture at a random position. Used with godot.ParticlesMaterial_EmissionShapeEnum.points
and godot.ParticlesMaterial_EmissionShapeEnum.directedPoints
. Can be created automatically from mesh or node by selecting "Create Emission Points from Mesh/Node" under the "Particles" tool in the toolbar.
emissionRingAxis:Vector3
The axis of the ring when using the emitter godot.ParticlesMaterial_EmissionShapeEnum.ring
.
emissionRingHeight:Single
The height of the ring when using the emitter godot.ParticlesMaterial_EmissionShapeEnum.ring
.
emissionRingInnerRadius:Single
The inner radius of the ring when using the emitter godot.ParticlesMaterial_EmissionShapeEnum.ring
.
emissionRingRadius:Single
The radius of the ring when using the emitter godot.ParticlesMaterial_EmissionShapeEnum.ring
.
emissionShape:ParticlesMaterial_EmissionShapeEnum
Particles will be emitted inside this region. Use godot.ParticlesMaterial_EmissionShapeEnum
constants for values.
emissionSphereRadius:Single
The sphere's radius if emission_shape
is set to godot.ParticlesMaterial_EmissionShapeEnum.sphere
.
initialVelocity:Single
Initial velocity magnitude for each particle. Direction comes from godot.ParticlesMaterial.spread
and the node's orientation.
linearAccelCurve:Texture
Each particle's linear acceleration will vary along this godot.CurveTexture
.
orbitVelocity:Single
Orbital velocity applied to each particle. Makes the particles circle around origin. Specified in number of full rotations around origin per second.
Note: Only available when godot.ParticlesMaterial.flagDisableZ
is true
.
radialAccel:Single
Radial acceleration applied to each particle. Makes particle accelerate away from origin.
radialAccelCurve:Texture
Each particle's radial acceleration will vary along this godot.CurveTexture
.
tangentialAccel:Single
Tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion.
tangentialAccelCurve:Texture
Each particle's tangential acceleration will vary along this godot.CurveTexture
.
trailColorModifier:GradientTexture
Trail particles' color will vary along this godot.GradientTexture
.
trailDivisor:Int
Emitter will emit amount
divided by trail_divisor
particles. The remaining particles will be used as trail(s).
Methods
getParamRandomness(param:ParticlesMaterial_Parameter):Single
Returns the randomness ratio associated with the specified parameter.
getParamTexture(param:ParticlesMaterial_Parameter):Texture
Returns the godot.Texture
used by the specified parameter.
setFlag(flag:ParticlesMaterial_Flags, enable:Bool):Void
If true
, enables the specified flag. See godot.ParticlesMaterial_Flags
for options.
setParam(param:ParticlesMaterial_Parameter, value:Single):Void
Sets the specified godot.ParticlesMaterial_Parameter
.
setParamRandomness(param:ParticlesMaterial_Parameter, randomness:Single):Void
Sets the randomness ratio for the specified godot.ParticlesMaterial_Parameter
.
setParamTexture(param:ParticlesMaterial_Parameter, texture:Texture):Void
Sets the godot.Texture
for the specified godot.ParticlesMaterial_Parameter
.