GPUParticlesAttractor3D
继承: VisualInstance3D
< Node3D
< Node
< Object
派生: GPUParticlesAttractorBox3D
, GPUParticlesAttractorSphere3D
, GPUParticlesAttractorVectorField3D
Abstract base class for 3D particle attractors.
描述
Particle attractors can be used to attract particles towards the attractor's origin, or to push them away from the attractor's origin.
Particle attractors work in real-time and can be moved, rotated and scaled during gameplay. Unlike collision shapes, non-uniform scaling of attractors is also supported.
Attractors can be temporarily disabled by hiding them, or by setting their strength
to 0.0
.
Note: Particle attractors only affect GPUParticles3D
, not CPUParticles3D
.
属性
属性说明
float
attenuation = 1.0
The particle attractor's attenuation. Higher values result in more gradual pushing of particles as they come closer to the attractor's origin. Zero or negative values will cause particles to be pushed very fast as soon as the touch the attractor's edges.
int
cull_mask = 4294967295
The particle rendering layers (VisualInstance3D.layers
) that will be affected by the attractor. By default, all particles are affected by an attractor.
After configuring particle nodes accordingly, specific layers can be unchecked to prevent certain particles from being affected by attractors. For example, this can be used if you're using an attractor as part of a spell effect but don't want the attractor to affect unrelated weather particles at the same position.
Particle attraction can also be disabled on a per-process material basis by setting ParticleProcessMaterial.attractor_interaction_enabled
on the GPUParticles3D
node.
float
directionality = 0.0
Adjusts how directional the attractor is. At 0.0
, the attractor is not directional at all: it will attract particles towards its center. At 1.0
, the attractor is fully directional: particles will always be pushed towards local -Z (or +Z if strength
is negative).
Note: If directionality
is greater than 0.0
, the direction in which particles are pushed can be changed by rotating the GPUParticlesAttractor3D node.
float
strength = 1.0
Adjusts the strength of the attractor. If strength
is negative, particles will be pushed in the opposite direction. Particles will be pushed away from the attractor's origin if directionality
is 0.0
, or towards local +Z if directionality
is greater than 0.0
.
本方法通常需要用户覆盖才能生效。
本方法无副作用,不会修改该实例的任何成员变量。
本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。
本方法用于构造某个类型。
调用本方法无需实例,可直接使用类名进行调用。
本方法描述的是使用本类型作为左操作数的有效运算符。
这个值是由下列位标志构成位掩码的整数。
无返回值。