Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
CPUParticles¶
Inherits: GeometryInstance < VisualInstance < CullInstance < Spatial < Node < Object
Emisor de partículas 3D que utiliza la CPU.
Descripción¶
CPU-based 3D particle node used to create a variety of particle systems and effects.
See also Particles, which provides the same functionality with hardware acceleration, but may not run on older devices.
Note: Unlike Particles, the visibility rect is generated on-the-fly and doesn't need to be configured by the user.
Propiedades¶
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Métodos¶
void |
convert_from_particles ( Node particles ) |
get_param_curve ( Parameter param ) const |
|
get_param_randomness ( Parameter param ) const |
|
get_particle_flag ( Flags flag ) const |
|
void |
restart ( ) |
void |
|
void |
set_param_curve ( Parameter param, Curve curve ) |
void |
set_param_randomness ( Parameter param, float randomness ) |
void |
set_particle_flag ( Flags flag, bool enable ) |
Enumeraciones¶
enum DrawOrder:
DRAW_ORDER_INDEX = 0 --- Las partículas se dibujan en el orden en que se emiten.
DRAW_ORDER_LIFETIME = 1 --- Las partículas se dibujan en orden según el tiempo de vida restante.
DRAW_ORDER_VIEW_DEPTH = 2 --- Las partículas se dibujan en orden de profundidad.
enum Parameter:
PARAM_INITIAL_LINEAR_VELOCITY = 0 --- Utilízalo con set_param, set_param_randomness, y set_param_curve para establecer las propiedades iniciales de la velocidad.
PARAM_ANGULAR_VELOCITY = 1 --- Utilízalo con set_param, set_param_randomness, y set_param_curve para establecer las propiedades de la velocidad angular.
PARAM_ORBIT_VELOCITY = 2 --- Utilízalo con set_param, set_param_randomness, y set_param_curve para establecer las propiedades de la velocidad orbital.
PARAM_LINEAR_ACCEL = 3 --- Utilízalo con set_param, set_param_randomness, y set_param_curve para establecer las propiedades de la aceleración lineal.
PARAM_RADIAL_ACCEL = 4 --- Utilízalo con set_param, set_param_randomness, y set_param_curve para establecer las propiedades de la aceleración radial.
PARAM_TANGENTIAL_ACCEL = 5 --- Utilízalo con set_param, set_param_randomness, y set_param_curve para establecer las propiedades de la aceleración tangencial.
PARAM_DAMPING = 6 --- Utilízalo con set_param, set_param_randomness, y set_param_curve para establecer las propiedades de amortiguación.
PARAM_ANGLE = 7 --- Utilízalo con set_param, set_param_randomness, y set_param_curve para establecer las propiedades de los ángulos.
PARAM_SCALE = 8 --- Utilízalo con set_param, set_param_randomness, y set_param_curve para establecer las propiedades de la escala.
PARAM_HUE_VARIATION = 9 --- Utilízalo con set_param, set_param_randomness, y set_param_curve para establecer las propiedades de la variación del tono.
PARAM_ANIM_SPEED = 10 --- Utilízalo con set_param, set_param_randomness, y set_param_curve para establecer las propiedades de velocidad de la animación.
PARAM_ANIM_OFFSET = 11 --- Utilízalo con set_param, set_param_randomness, y set_param_curve para establecer las propiedades de desplazamiento de la animación.
PARAM_MAX = 12 --- Representa el tamaño del enum Parameter.
enum Flags:
FLAG_ALIGN_Y_TO_VELOCITY = 0 --- Utilízalo con set_particle_flag para establecer flag_align_y.
FLAG_ROTATE_Y = 1 --- Utilícelo con set_particle_flag para establecer flag_rotate_y.
FLAG_DISABLE_Z = 2 --- Usar con set_particle_flag para establecer flag_disable_z.
FLAG_MAX = 3 --- Representa el tamaño del enum Flags.
enum EmissionShape:
EMISSION_SHAPE_POINT = 0 --- Todas las partículas serán emitidas desde un único punto.
EMISSION_SHAPE_SPHERE = 1 --- Las partículas se emitirán en el volumen de una esfera.
EMISSION_SHAPE_BOX = 2 --- Se emitirán partículas en el volumen de una caja.
EMISSION_SHAPE_POINTS = 3 --- Las partículas se emitirán en una posición elegida al azar entre emission_points. El color de las partículas será modulado por emission_colors.
EMISSION_SHAPE_DIRECTED_POINTS = 4 --- Las partículas se emitirán en una posición elegida al azar entre emission_points. La velocidad y rotación de las partículas se fijarán en base a emission_normals. El color de las partículas será modulado por emission_colors.
EMISSION_SHAPE_RING = 5 --- Particles will be emitted in a ring or cylinder.
EMISSION_SHAPE_MAX = 6 --- Representa el tamaño del enum EmissionShape.
Descripciones de Propiedades¶
int amount
Default |
|
Setter |
set_amount(value) |
Getter |
get_amount() |
The number of particles emitted in one emission cycle (corresponding to the lifetime).
Note: Changing amount will reset the particle emission, therefore removing all particles that were already emitted before changing amount.
float angle
Default |
|
Setter |
set_param(value) |
Getter |
get_param() |
Rotación inicial aplicada a cada partícula, en grados.
Curve angle_curve
Setter |
set_param_curve(value) |
Getter |
get_param_curve() |
La rotación de cada partícula será animada a lo largo de esta Curve.
float angle_random
Default |
|
Setter |
set_param_randomness(value) |
Getter |
get_param_randomness() |
Ratio de aleatoriedad de la rotación.
float angular_velocity
Default |
|
Setter |
set_param(value) |
Getter |
get_param() |
Initial angular velocity applied to each particle in degrees per second. Sets the speed of rotation of the particle.
Curve angular_velocity_curve
Setter |
set_param_curve(value) |
Getter |
get_param_curve() |
La velocidad angular de cada partícula variará a lo largo de esta Curve.
float angular_velocity_random
Default |
|
Setter |
set_param_randomness(value) |
Getter |
get_param_randomness() |
Relación de aleatoriedad de la velocidad angular.
float anim_offset
Default |
|
Setter |
set_param(value) |
Getter |
get_param() |
Desplazamiento de la animación de partículas.
Curve anim_offset_curve
Setter |
set_param_curve(value) |
Getter |
get_param_curve() |
El desplazamiento de la animación de cada partícula variará a lo largo de esta Curve.
float anim_offset_random
Default |
|
Setter |
set_param_randomness(value) |
Getter |
get_param_randomness() |
La animación desplaza la proporción de aleatoriedad.
float anim_speed
Default |
|
Setter |
set_param(value) |
Getter |
get_param() |
Velocidad de animación de partículas.
Curve anim_speed_curve
Setter |
set_param_curve(value) |
Getter |
get_param_curve() |
La velocidad de animación de cada partícula variará a lo largo de esta Curve.
float anim_speed_random
Default |
|
Setter |
set_param_randomness(value) |
Getter |
get_param_randomness() |
Ratio de aleatoriedad de la velocidad de la animación.
Color color
Default |
|
Setter |
set_color(value) |
Getter |
get_color() |
Each particle's initial color. To have particle display color in a SpatialMaterial make sure to set SpatialMaterial.vertex_color_use_as_albedo to true
.
Gradient color_initial_ramp
Setter |
set_color_initial_ramp(value) |
Getter |
get_color_initial_ramp() |
Each particle's initial color will vary along this GradientTexture (multiplied with color).
Gradient color_ramp
Setter |
set_color_ramp(value) |
Getter |
get_color_ramp() |
Each particle's color will vary along this GradientTexture over its lifetime (multiplied with color).
float damping
Default |
|
Setter |
set_param(value) |
Getter |
get_param() |
La velocidad a la que las partículas pierden velocidad.
Curve damping_curve
Setter |
set_param_curve(value) |
Getter |
get_param_curve() |
La amortiguación variará a lo largo de esta Curve.
float damping_random
Default |
|
Setter |
set_param_randomness(value) |
Getter |
get_param_randomness() |
Amortiguando la proporción de aleatoriedad.
Vector3 direction
Default |
|
Setter |
set_direction(value) |
Getter |
get_direction() |
Vector unitario que especifica la dirección de emisión de las partículas.
DrawOrder draw_order
Default |
|
Setter |
set_draw_order(value) |
Getter |
get_draw_order() |
Orden de dibujo de las partículas. Utiliza los valores de DrawOrder.
Vector3 emission_box_extents
Setter |
set_emission_box_extents(value) |
Getter |
get_emission_box_extents() |
La extensión del rectángulo si emission_shape se fija en EMISSION_SHAPE_BOX.
PoolColorArray emission_colors
Setter |
set_emission_colors(value) |
Getter |
get_emission_colors() |
Establece los Colors para modular las partículas al usar EMISSION_SHAPE_POINTS o EMISSION_SHAPE_DIRECTED_POINTS.
PoolVector3Array emission_normals
Setter |
set_emission_normals(value) |
Getter |
get_emission_normals() |
Establece la dirección en la que las partículas serán emitidas cuando se use EMISSION_SHAPE_DIRECTED_POINTS.
PoolVector3Array emission_points
Setter |
set_emission_points(value) |
Getter |
get_emission_points() |
Establece las posiciones iniciales para generar partículas cuando se utiliza EMISSION_SHAPE_POINTS o EMISSION_SHAPE_DIRECTED_POINTS.
Vector3 emission_ring_axis
Setter |
set_emission_ring_axis(value) |
Getter |
get_emission_ring_axis() |
The axis for the ring shaped emitter when using EMISSION_SHAPE_RING.
float emission_ring_height
Setter |
set_emission_ring_height(value) |
Getter |
get_emission_ring_height() |
The height for the ring shaped emitter when using EMISSION_SHAPE_RING.
float emission_ring_inner_radius
Setter |
set_emission_ring_inner_radius(value) |
Getter |
get_emission_ring_inner_radius() |
The inner radius for the ring shaped emitter when using EMISSION_SHAPE_RING.
float emission_ring_radius
Setter |
set_emission_ring_radius(value) |
Getter |
get_emission_ring_radius() |
The radius for the ring shaped emitter when using EMISSION_SHAPE_RING.
EmissionShape emission_shape
Default |
|
Setter |
set_emission_shape(value) |
Getter |
get_emission_shape() |
Se emitirán partículas dentro de esta región. Ver EmissionShape para los posibles valores.
float emission_sphere_radius
Setter |
set_emission_sphere_radius(value) |
Getter |
get_emission_sphere_radius() |
El radio de la esfera si EmissionShape se fija en EMISSION_SHAPE_SPHERE.
bool emitting
Default |
|
Setter |
set_emitting(value) |
Getter |
is_emitting() |
Si true
, se están emitiendo partículas.
float explosiveness
Default |
|
Setter |
set_explosiveness_ratio(value) |
Getter |
get_explosiveness_ratio() |
La rapidez con la que se emiten las partículas en un ciclo de emisión. Si es mayor que 0
, habrá una espacio de tiempo en las emisiones antes de que comience el siguiente ciclo.
int fixed_fps
Default |
|
Setter |
set_fixed_fps(value) |
Getter |
get_fixed_fps() |
La velocidad de fotogramas del sistema de partículas está fijada en un valor. Por ejemplo, cambiando el valor a 2 hará que las partículas se rendericen a 2 fotogramas por segundo. Ten en cuenta que esto no ralentiza el sistema de partículas en sí mismo.
bool flag_align_y
Default |
|
Setter |
set_particle_flag(value) |
Getter |
get_particle_flag() |
Alinea el eje Y de la partícula con la dirección de su velocidad.
bool flag_disable_z
Default |
|
Setter |
set_particle_flag(value) |
Getter |
get_particle_flag() |
Si true
, las partículas no se moverán en el eje z.
bool flag_rotate_y
Default |
|
Setter |
set_particle_flag(value) |
Getter |
get_particle_flag() |
Si true
, las partículas giran alrededor del eje Y por angle.
float flatness
Default |
|
Setter |
set_flatness(value) |
Getter |
get_flatness() |
Cantidad de spread en el plano Y/Z. Un valor de 1
restringe las partículas al plano X/Z.
bool fract_delta
Default |
|
Setter |
set_fractional_delta(value) |
Getter |
get_fractional_delta() |
Si true
, resulta en un cálculo delta fraccionario que tiene un efecto de visualización de partículas más suave.
Vector3 gravity
Default |
|
Setter |
set_gravity(value) |
Getter |
get_gravity() |
La gravedad aplicada a cada partícula.
float hue_variation
Default |
|
Setter |
set_param(value) |
Getter |
get_param() |
Variación de tono inicial aplicada a cada partícula.
Curve hue_variation_curve
Setter |
set_param_curve(value) |
Getter |
get_param_curve() |
El tono de cada partícula variará a lo largo de esta Curve.
float hue_variation_random
Default |
|
Setter |
set_param_randomness(value) |
Getter |
get_param_randomness() |
Relación de aleatoriedad de la variación del tono.
float initial_velocity
Default |
|
Setter |
set_param(value) |
Getter |
get_param() |
La magnitud de la velocidad inicial de cada partícula. La dirección viene de spread y la orientación del nodo.
float initial_velocity_random
Default |
|
Setter |
set_param_randomness(value) |
Getter |
get_param_randomness() |
Ratio de aleatoriedad de la velocidad inicial.
float lifetime
Default |
|
Setter |
set_lifetime(value) |
Getter |
get_lifetime() |
The amount of time each particle will exist (in seconds).
float lifetime_randomness
Default |
|
Setter |
set_lifetime_randomness(value) |
Getter |
get_lifetime_randomness() |
El ratio de aleatoriedad del tiempo de vida de las partículas.
float linear_accel
Default |
|
Setter |
set_param(value) |
Getter |
get_param() |
Aceleración lineal aplicada a cada partícula en la dirección del movimiento.
Curve linear_accel_curve
Setter |
set_param_curve(value) |
Getter |
get_param_curve() |
La aceleración lineal de cada partícula variará a lo largo de esta Curve.
float linear_accel_random
Default |
|
Setter |
set_param_randomness(value) |
Getter |
get_param_randomness() |
Ratio de aleatoriedad de aceleración lineal.
bool local_coords
Default |
|
Setter |
set_use_local_coordinates(value) |
Getter |
get_use_local_coordinates() |
Si true
, las partículas usan el espacio de coordenadas del nodo padre. Si false
, usan las coordenadas globales.
Mesh mesh
Setter |
set_mesh(value) |
Getter |
get_mesh() |
La Mesh usada para cada partícula. Si null
, las partículas serán esferas.
bool one_shot
Default |
|
Setter |
set_one_shot(value) |
Getter |
get_one_shot() |
Si true
, sólo se produce un ciclo de emisión. Si se establece true
durante un ciclo, la emisión se detendrá al final del ciclo.
float orbit_velocity
Setter |
set_param(value) |
Getter |
get_param() |
Velocidad orbital aplicada a cada partícula. Hace que las partículas giren alrededor de su origen en el plano XY local. Se especifica en el número de rotaciones completas alrededor del origen por segundo.
Esta propiedad sólo está disponible cuando flag_disable_z es true
.
Curve orbit_velocity_curve
Setter |
set_param_curve(value) |
Getter |
get_param_curve() |
La velocidad orbital de cada partícula variará a lo largo de esta Curve.
float orbit_velocity_random
Setter |
set_param_randomness(value) |
Getter |
get_param_randomness() |
Ratio de aleatoriedad de la velocidad orbital.
float preprocess
Default |
|
Setter |
set_pre_process_time(value) |
Getter |
get_pre_process_time() |
El sistema de partículas se inicia como si ya hubiera funcionado durante este número de segundos.
float radial_accel
Default |
|
Setter |
set_param(value) |
Getter |
get_param() |
Aceleración radial aplicada a cada partícula. Hace que la partícula se acelere lejos de su origen.
Curve radial_accel_curve
Setter |
set_param_curve(value) |
Getter |
get_param_curve() |
La aceleración radial de cada partícula variará a lo largo de esta Curve.
float radial_accel_random
Default |
|
Setter |
set_param_randomness(value) |
Getter |
get_param_randomness() |
Ratio de aleatoriedad de la aceleración radial.
float randomness
Default |
|
Setter |
set_randomness_ratio(value) |
Getter |
get_randomness_ratio() |
Proporción de aleatoriedad de la vida útil de las emisiones.
float scale_amount
Default |
|
Setter |
set_param(value) |
Getter |
get_param() |
Escala inicial aplicada a cada partícula.
Curve scale_amount_curve
Setter |
set_param_curve(value) |
Getter |
get_param_curve() |
Escala inicial aplicada a cada partícula.
float scale_amount_random
Default |
|
Setter |
set_param_randomness(value) |
Getter |
get_param_randomness() |
Ratio de la aleatoriedad de la escala.
float speed_scale
Default |
|
Setter |
set_speed_scale(value) |
Getter |
get_speed_scale() |
El sistema de partículas está funcionando a una velocidad de escalada. Un valor de 0
puede ser usado para pausar las partículas.
float spread
Default |
|
Setter |
set_spread(value) |
Getter |
get_spread() |
La dirección inicial de cada partícula va desde +spread
hasta -spread
grados. Aplicado a los planos X/Z y Y/Z.
float tangential_accel
Default |
|
Setter |
set_param(value) |
Getter |
get_param() |
Aceleración tangencial aplicada a cada partícula. La aceleración tangencial es perpendicular a la velocidad de la partícula, lo que le da a las partículas un movimiento giratorio.
Curve tangential_accel_curve
Setter |
set_param_curve(value) |
Getter |
get_param_curve() |
La aceleración tangencial de cada partícula variará a lo largo de esta Curve.
float tangential_accel_random
Default |
|
Setter |
set_param_randomness(value) |
Getter |
get_param_randomness() |
Ratio de aleatoriedad de la aceleración tangencial.
Descripciones de Métodos¶
void convert_from_particles ( Node particles )
Sets this node's properties to match a given Particles node with an assigned ParticlesMaterial.
Devuelve el valor base del parámetro especificado por Parameter.
Devuelve la Curve del parámetro especificado por Parameter.
Devuelve el factor de aleatoriedad del parámetro especificado por Parameter.
Devuelve el estado habilitado del flag dado (véase Flags para las opciones).
void restart ( )
Reinicia el emisor de partículas.
Establece el valor base del parámetro especificado por Parameter.
Establece la Curve del parámetro especificado por Parameter.
Establece el factor de aleatoriedad del parámetro especificado por Parameter.
Habilita o deshabilita la flag dada (véase Flags para las opciones).