Pixelpart 1.9.0
Godot Plugin
Loading...
Searching...
No Matches
godot::PixelpartParticleEmitter Class Reference

Node that emits particles. More...

Inheritance diagram for godot::PixelpartParticleEmitter:
[legend]

Public Types

enum  ShapeType {
  SHAPE_POINT = 0 , SHAPE_LINE = 1 , SHAPE_ELLIPSE = 2 , SHAPE_RECTANGLE = 3 ,
  SHAPE_PATH = 4 , SHAPE_ELLIPSOID = 5 , SHAPE_CUBOID = 6 , SHAPE_CYLINDER = 7
}
 Types of emitter shapes. More...
 
enum  DistributionType {
  DISTRIBUTION_UNIFORM = 0 , DISTRIBUTION_CENTER = 1 , DISTRIBUTION_HOLE = 2 , DISTRIBUTION_BOUNDARY = 3 ,
  DISTRIBUTION_GRID_RANDOM = 4 , DISTRIBUTION_GRID_ORDERED = 5
}
 Particle distribution modes. More...
 
enum  GridOrderType {
  GRID_ORDER_X_Y_Z = 0 , GRID_ORDER_X_Z_Y = 1 , GRID_ORDER_Y_X_Z = 2 , GRID_ORDER_Y_Z_X = 3 ,
  GRID_ORDER_Z_X_Y = 4 , GRID_ORDER_Z_Y_X = 5
}
 Order of points for grid distribution mode. More...
 
enum  EmissionMode { EMISSION_CONTINUOUS = 0 , EMISSION_BURST_START = 1 , EMISSION_BURST_END = 2 }
 Modes for particle emission. More...
 
enum  DirectionMode {
  DIRECTION_FIXED = 0 , DIRECTION_OUTWARDS = 1 , DIRECTION_INWARDS = 2 , DIRECTION_INHERIT = 3 ,
  DIRECTION_INHERIT_INVERSE = 4
}
 Modes to determine the initial direction of particles. More...
 

Public Member Functions

void set_shape (ShapeType type)
 Set shape of the emitter area.
 
ShapeType get_shape () const
 Return shape of the emitter area.
 
void add_shape_point (Vector3 point)
 Add a new point to the emitter shape.
 
void remove_shape_point (int index)
 Remove the point at the given index from the emitter shape.
 
void set_shape_point (int index, Vector3 point)
 Change the location of the point at the given index in the emitter shape.
 
Vector3 get_shape_point (int index) const
 Return the location of the point at the given index in the emitter shape.
 
int get_shape_point_count () const
 Return the number of points in the emitter shape.
 
void set_distribution (DistributionType mode)
 Set where particles are spawned inside the emitter area.
 
DistributionType get_distribution () const
 Return where particles are spawned inside the emitter area.
 
void set_grid_order (GridOrderType mode)
 Set the grid order of grid distribution modes.
 
GridOrderType get_grid_order () const
 Get the grid order of grid distribution modes.
 
void set_grid_size (int x, int y, int z)
 Set the number of grid cells.
 
int get_grid_size_x () const
 Return the number of grid cells in X direction.
 
int get_grid_size_y () const
 Return the number of grid cells in Y direction.
 
int get_grid_size_z () const
 Return the number of grid cells in Z direction.
 
void set_emission_mode (EmissionMode mode)
 Set the emission mode.
 
EmissionMode get_emission_mode () const
 Return the emission mode.
 
void set_direction_mode (DirectionMode mode)
 Set the direction mode.
 
DirectionMode get_direction_mode () const
 Get the direction mode.
 
Ref< PixelpartAnimatedPropertyFloat3get_direction () const
 Direction in which particles move when spawned, in degrees.
 
Ref< PixelpartAnimatedPropertyFloatget_spread () const
 How much the direction varies.
 
- Public Member Functions inherited from godot::PixelpartNode
int get_id () const
 ID of the node.
 
int get_parent_id () const
 ID of the node's parent.
 
String get_name () const
 Name of the node.
 
void set_lifetime_start (float time)
 Set time until the node becomes active.
 
void set_lifetime_duration (float time)
 Set how long the node stays active in seconds.
 
void set_repeat (bool value)
 Set whether the node repeats its behavior after its lifetime is over.
 
float get_lifetime_start () const
 Time in seconds until the node becomes active.
 
float get_lifetime_duration () const
 How long the node is active in seconds.
 
bool get_repeat () const
 Wether the node repeats its behavior after its lifetime is over.
 
bool is_active () const
 Return whether the node is active at the current point in time.
 
float get_local_time () const
 Return the time fraction the emitter has been active for, in range 0.0 (0%) to 1.0 (100%).
 
Ref< PixelpartAnimatedPropertyFloat3get_position () const
 Position of the node.
 
Ref< PixelpartAnimatedPropertyFloat3get_rotation () const
 Rotation of the node in degrees.
 
Ref< PixelpartAnimatedPropertyFloat3get_scale () const
 Size of the node.
 

Public Attributes

ShapeType shape
 Shape of the emitter area.
 
DistributionType distribution
 Where particles are spawned inside the emitter area.
 
GridOrderType grid_order
 Grid order of grid distribution modes.
 
EmissionMode emission_mode
 Emission mode to control when particles are created during the lifetime of the emitter.
 
DirectionMode direction_mode
 Mode to control initial particle direction.
 
- Public Attributes inherited from godot::PixelpartNode
float lifetime_start
 Time in seconds until the node becomes active.
 
float lifetime_duration
 How long the node stays active in seconds.
 
bool repeat
 Wether the node repeats its behavior after its lifetime is over.
 

Detailed Description

Node that emits particles.

Particle emitters continuously spawn new particles of assigned particle types in a defined area. They also define in which direction particles move initially.

Member Enumeration Documentation

◆ DirectionMode

Modes to determine the initial direction of particles.

When a particle is created by the particle emitter, it decides in which direction to emit the particle based on the specified direction and the given direction mode.

Enumerator
DIRECTION_FIXED 

Particles shoot off in a common direction.

DIRECTION_OUTWARDS 

Particles move away from the emitter.

DIRECTION_INWARDS 

Particles move towards the emitter’s center.

DIRECTION_INHERIT 

Particles move along the direction of the parent particle or emitter.

DIRECTION_INHERIT_INVERSE 

Particles move against the direction of the parent particle or emitter.

◆ DistributionType

Particle distribution modes.

When spawning particles inside the emitter shape, particle emitters can use different techniques to determine the exact points where particles are spawned. For example, you may want to spawn particles near the edge of the shape or in a grid-like pattern.

Enumerator
DISTRIBUTION_UNIFORM 

Particles are spawned at randomly generated locations (uniform distribution) inside the emitter area.

DISTRIBUTION_CENTER 

Particles are created mostly around the center and less at the boundary.

DISTRIBUTION_HOLE 

More particles spawn near the emitter boundary and less in the center.

DISTRIBUTION_BOUNDARY 

Particles are created only on the emitter boundary.

DISTRIBUTION_GRID_RANDOM 

Particles spawn at random points of a grid.

DISTRIBUTION_GRID_ORDERED 

Particles are created on points in a grid, one grid point after the other.

◆ EmissionMode

Modes for particle emission.

The emission mode of particle emitters controls when particles are created during the lifetime of the emitter.

Enumerator
EMISSION_CONTINUOUS 

The emitter continuously spawns particles throughout its lifetime.

EMISSION_BURST_START 

The emitter instantiates all particles immediately after being created.

EMISSION_BURST_END 

Particles are spawned at the end of the emitter lifetime, or

  • if the emitter is a sub-emitter - when particles of the parent emitter reach the end of their lifetime.

◆ GridOrderType

Order of points for grid distribution mode.

Enumerator
GRID_ORDER_X_Y_Z 

X -> Y -> Z

GRID_ORDER_X_Z_Y 

X -> Z -> Y

GRID_ORDER_Y_X_Z 

Y -> X -> Z

GRID_ORDER_Y_Z_X 

Y -> Z -> X

GRID_ORDER_Z_X_Y 

Z -> X -> Y

GRID_ORDER_Z_Y_X 

Z -> Y -> X

◆ ShapeType

Types of emitter shapes.

Enumerator
SHAPE_POINT 

The emitter generates particles at a single point.

SHAPE_LINE 

Particles are emitted on a straight line.

SHAPE_ELLIPSE 

Particles are emitted inside a circular or elliptical shape.

SHAPE_RECTANGLE 

Particles are emitted inside a rectangle.

SHAPE_PATH 

Particles are emitted on a custom path consisting of connected line segments.

SHAPE_ELLIPSOID 

Particles are emitted inside a sphere or ellipsoid. Only for 3D effects.

SHAPE_CUBOID 

Particles are emitted inside a cube. Only for 3D effects.

SHAPE_CYLINDER 

Particles are emitted inside a cylinder. Only for 3D effects.

Member Function Documentation

◆ add_shape_point()

void godot::PixelpartParticleEmitter::add_shape_point ( Vector3 point)

Add a new point to the emitter shape.

Only applicable for emitter shape Path.

Parameters
pointPoint to add

◆ get_direction()

Ref< PixelpartAnimatedPropertyFloat3 > godot::PixelpartParticleEmitter::get_direction ( ) const

Direction in which particles move when spawned, in degrees.

For 3D effects, the direction is composed of roll, yaw and pitch.

Returns
Direction property

◆ get_direction_mode()

PixelpartParticleEmitter::DirectionMode godot::PixelpartParticleEmitter::get_direction_mode ( ) const

Get the direction mode.

When a particle is created by the particle emitter, it decides in which direction to emit the particle based on the specified direction and the given direction mode.

Returns
Direction mode

◆ get_distribution()

PixelpartParticleEmitter::DistributionType godot::PixelpartParticleEmitter::get_distribution ( ) const

Return where particles are spawned inside the emitter area.

When spawning particles inside the emitter shape, particle emitters can use different techniques to determine the exact points where particles are spawned.

Returns
Distribution mode

◆ get_emission_mode()

PixelpartParticleEmitter::EmissionMode godot::PixelpartParticleEmitter::get_emission_mode ( ) const

Return the emission mode.

The emission mode of particle emitters controls when particles are created during the lifetime of the emitter.

Returns
Emission mode

◆ get_grid_order()

PixelpartParticleEmitter::GridOrderType godot::PixelpartParticleEmitter::get_grid_order ( ) const

Get the grid order of grid distribution modes.

Returns
Grid order

◆ get_grid_size_x()

int godot::PixelpartParticleEmitter::get_grid_size_x ( ) const

Return the number of grid cells in X direction.

Only applicable for grid distribution modes.

Returns
Number of cells

◆ get_grid_size_y()

int godot::PixelpartParticleEmitter::get_grid_size_y ( ) const

Return the number of grid cells in Y direction.

Only applicable for grid distribution modes.

Returns
Number of cells

◆ get_grid_size_z()

int godot::PixelpartParticleEmitter::get_grid_size_z ( ) const

Return the number of grid cells in Z direction.

Only applicable for grid distribution modes.

Returns
Number of cells

◆ get_shape()

PixelpartParticleEmitter::ShapeType godot::PixelpartParticleEmitter::get_shape ( ) const

Return shape of the emitter area.

Returns
Shape of the emitter area

◆ get_shape_point()

Vector3 godot::PixelpartParticleEmitter::get_shape_point ( int index) const

Return the location of the point at the given index in the emitter shape.

Parameters
indexIndex of point
Returns
Vector3 Location of point

◆ get_shape_point_count()

int godot::PixelpartParticleEmitter::get_shape_point_count ( ) const

Return the number of points in the emitter shape.

Only applicable for emitter shape Path.

Returns
Number of points

◆ get_spread()

Ref< PixelpartAnimatedPropertyFloat > godot::PixelpartParticleEmitter::get_spread ( ) const

How much the direction varies.

A spread of 0° means that particles only move in the specified direction, while 360° leads to particles shooting off in all directions.

Returns
Spread property

◆ remove_shape_point()

void godot::PixelpartParticleEmitter::remove_shape_point ( int index)

Remove the point at the given index from the emitter shape.

Only applicable for emitter shape Path.

Parameters
indexIndex of point to remove

◆ set_direction_mode()

void godot::PixelpartParticleEmitter::set_direction_mode ( DirectionMode mode)

Set the direction mode.

When a particle is created by the particle emitter, it decides in which direction to emit the particle based on the specified direction and the given direction mode.

Parameters
modeDirection mode

◆ set_distribution()

void godot::PixelpartParticleEmitter::set_distribution ( DistributionType mode)

Set where particles are spawned inside the emitter area.

When spawning particles inside the emitter shape, particle emitters can use different techniques to determine the exact points where particles are spawned.

Parameters
modeDistribution mode

◆ set_emission_mode()

void godot::PixelpartParticleEmitter::set_emission_mode ( EmissionMode mode)

Set the emission mode.

The emission mode of particle emitters controls when particles are created during the lifetime of the emitter.

Parameters
modeEmission mode

◆ set_grid_order()

void godot::PixelpartParticleEmitter::set_grid_order ( GridOrderType mode)

Set the grid order of grid distribution modes.

Parameters
modeGrid order

◆ set_grid_size()

void godot::PixelpartParticleEmitter::set_grid_size ( int x,
int y,
int z )

Set the number of grid cells.

Only applicable for grid distribution modes.

Parameters
xNumber of cells in X direction
yNumber of cells in Y direction
zNumber of cells in Z direction

◆ set_shape()

void godot::PixelpartParticleEmitter::set_shape ( ShapeType type)

Set shape of the emitter area.

Parameters
typeShape of the emitter area

◆ set_shape_point()

void godot::PixelpartParticleEmitter::set_shape_point ( int index,
Vector3 point )

Change the location of the point at the given index in the emitter shape.

Only applicable for emitter shape Path.

Parameters
indexIndex of point to change
pointNew location

Member Data Documentation

◆ direction_mode

DirectionMode godot::PixelpartParticleEmitter::direction_mode

Mode to control initial particle direction.

When a particle is created by the particle emitter, it decides in which direction to emit the particle based on the specified direction and the given direction mode.


The documentation for this class was generated from the following files: