[][src]Struct gdnative::api::ParticlesMaterial

pub struct ParticlesMaterial { /* fields omitted */ }

core class ParticlesMaterial inherits Material (reference counted).

Official documentation

See the documentation of this class in the Godot engine's official documentation.

Memory management

The lifetime of this object is automatically managed through reference counting.

Class hierarchy

ParticlesMaterial inherits methods from:

Safety

All types in the Godot API have "interior mutability" in Rust parlance. To enforce that the official thread-safety guidelines are followed, the typestate pattern is used in the Ref and TRef smart pointers, and the Instance API. The typestate Access in these types tracks whether the access is unique, shared, or exclusive to the current thread. For more information, see the type-level documentation on Ref.

Implementations

impl ParticlesMaterial[src]

Constants

impl ParticlesMaterial[src]

pub fn new() -> Ref<ParticlesMaterial, Unique>[src]

Creates a new instance of this object.

This is a reference-counted type. The returned object is automatically managed by Ref.

pub fn color(&self) -> Color[src]

Each particle's initial color. If the [Particles2D]'s [code]texture[/code] is defined, it will be multiplied by this color. To have particle display color in a [SpatialMaterial] make sure to set [member SpatialMaterial.vertex_color_use_as_albedo] to [code]true[/code].

pub fn color_ramp(&self) -> Option<Ref<Texture, Shared>>[src]

Each particle's color will vary along this [GradientTexture].

pub fn direction(&self) -> Vector3D<f32, UnknownUnit>[src]

Unit vector specifying the particles' emission direction.

pub fn emission_box_extents(&self) -> Vector3D<f32, UnknownUnit>[src]

The box's extents if [code]emission_shape[/code] is set to [constant EMISSION_SHAPE_BOX].

pub fn emission_color_texture(&self) -> Option<Ref<Texture, Shared>>[src]

Particle color will be modulated by color determined by sampling this texture at the same point as the [member emission_point_texture].

pub fn emission_normal_texture(&self) -> Option<Ref<Texture, Shared>>[src]

Particle velocity and rotation will be set by sampling this texture at the same point as the [member emission_point_texture]. Used only in [constant EMISSION_SHAPE_DIRECTED_POINTS]. Can be created automatically from mesh or node by selecting "Create Emission Points from Mesh/Node" under the "Particles" tool in the toolbar.

pub fn emission_point_count(&self) -> i64[src]

The number of emission points if [code]emission_shape[/code] is set to [constant EMISSION_SHAPE_POINTS] or [constant EMISSION_SHAPE_DIRECTED_POINTS].

pub fn emission_point_texture(&self) -> Option<Ref<Texture, Shared>>[src]

Particles will be emitted at positions determined by sampling this texture at a random position. Used with [constant EMISSION_SHAPE_POINTS] and [constant EMISSION_SHAPE_DIRECTED_POINTS]. Can be created automatically from mesh or node by selecting "Create Emission Points from Mesh/Node" under the "Particles" tool in the toolbar.

pub fn emission_shape(&self) -> EmissionShape[src]

Particles will be emitted inside this region. Use [enum EmissionShape] constants for values.

pub fn emission_sphere_radius(&self) -> f64[src]

The sphere's radius if [code]emission_shape[/code] is set to [constant EMISSION_SHAPE_SPHERE].

pub fn flag(&self, flag: i64) -> bool[src]

If [code]true[/code], particles rotate around Y axis by [member angle].

pub fn flatness(&self) -> f64[src]

Amount of [member spread] in Y/Z plane. A value of [code]1[/code] restricts particles to X/Z plane.

pub fn gravity(&self) -> Vector3D<f32, UnknownUnit>[src]

Gravity applied to every particle.

pub fn lifetime_randomness(&self) -> f64[src]

Particle lifetime randomness ratio.

pub fn param(&self, param: i64) -> f64[src]

Tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion.

pub fn param_randomness(&self, param: i64) -> f64[src]

Tangential acceleration randomness ratio.

pub fn param_texture(&self, param: i64) -> Option<Ref<Texture, Shared>>[src]

Each particle's tangential acceleration will vary along this [CurveTexture].

pub fn spread(&self) -> f64[src]

Each particle's initial direction range from [code]+spread[/code] to [code]-spread[/code] degrees. Applied to X/Z plane and Y/Z planes.

pub fn trail_color_modifier(&self) -> Option<Ref<GradientTexture, Shared>>[src]

Trail particles' color will vary along this [GradientTexture].

pub fn trail_divisor(&self) -> i64[src]

Emitter will emit [code]amount[/code] divided by [code]trail_divisor[/code] particles. The remaining particles will be used as trail(s).

pub fn trail_size_modifier(&self) -> Option<Ref<CurveTexture, Shared>>[src]

Trail particles' size will vary along this [CurveTexture].

pub fn set_color(&self, color: Color)[src]

Each particle's initial color. If the [Particles2D]'s [code]texture[/code] is defined, it will be multiplied by this color. To have particle display color in a [SpatialMaterial] make sure to set [member SpatialMaterial.vertex_color_use_as_albedo] to [code]true[/code].

pub fn set_color_ramp(&self, ramp: impl AsArg<Texture>)[src]

Each particle's color will vary along this [GradientTexture].

pub fn set_direction(&self, degrees: Vector3D<f32, UnknownUnit>)[src]

Unit vector specifying the particles' emission direction.

pub fn set_emission_box_extents(&self, extents: Vector3D<f32, UnknownUnit>)[src]

The box's extents if [code]emission_shape[/code] is set to [constant EMISSION_SHAPE_BOX].

pub fn set_emission_color_texture(&self, texture: impl AsArg<Texture>)[src]

Particle color will be modulated by color determined by sampling this texture at the same point as the [member emission_point_texture].

pub fn set_emission_normal_texture(&self, texture: impl AsArg<Texture>)[src]

Particle velocity and rotation will be set by sampling this texture at the same point as the [member emission_point_texture]. Used only in [constant EMISSION_SHAPE_DIRECTED_POINTS]. Can be created automatically from mesh or node by selecting "Create Emission Points from Mesh/Node" under the "Particles" tool in the toolbar.

pub fn set_emission_point_count(&self, point_count: i64)[src]

The number of emission points if [code]emission_shape[/code] is set to [constant EMISSION_SHAPE_POINTS] or [constant EMISSION_SHAPE_DIRECTED_POINTS].

pub fn set_emission_point_texture(&self, texture: impl AsArg<Texture>)[src]

Particles will be emitted at positions determined by sampling this texture at a random position. Used with [constant EMISSION_SHAPE_POINTS] and [constant EMISSION_SHAPE_DIRECTED_POINTS]. Can be created automatically from mesh or node by selecting "Create Emission Points from Mesh/Node" under the "Particles" tool in the toolbar.

pub fn set_emission_shape(&self, shape: i64)[src]

Particles will be emitted inside this region. Use [enum EmissionShape] constants for values.

pub fn set_emission_sphere_radius(&self, radius: f64)[src]

The sphere's radius if [code]emission_shape[/code] is set to [constant EMISSION_SHAPE_SPHERE].

pub fn set_flag(&self, flag: i64, enable: bool)[src]

If [code]true[/code], particles rotate around Y axis by [member angle].

pub fn set_flatness(&self, amount: f64)[src]

Amount of [member spread] in Y/Z plane. A value of [code]1[/code] restricts particles to X/Z plane.

pub fn set_gravity(&self, accel_vec: Vector3D<f32, UnknownUnit>)[src]

Gravity applied to every particle.

pub fn set_lifetime_randomness(&self, randomness: f64)[src]

Particle lifetime randomness ratio.

pub fn set_param(&self, param: i64, value: f64)[src]

Tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion.

pub fn set_param_randomness(&self, param: i64, randomness: f64)[src]

Tangential acceleration randomness ratio.

pub fn set_param_texture(&self, param: i64, texture: impl AsArg<Texture>)[src]

Each particle's tangential acceleration will vary along this [CurveTexture].

pub fn set_spread(&self, degrees: f64)[src]

Each particle's initial direction range from [code]+spread[/code] to [code]-spread[/code] degrees. Applied to X/Z plane and Y/Z planes.

pub fn set_trail_color_modifier(&self, texture: impl AsArg<GradientTexture>)[src]

Trail particles' color will vary along this [GradientTexture].

pub fn set_trail_divisor(&self, divisor: i64)[src]

Emitter will emit [code]amount[/code] divided by [code]trail_divisor[/code] particles. The remaining particles will be used as trail(s).

pub fn set_trail_size_modifier(&self, texture: impl AsArg<CurveTexture>)[src]

Trail particles' size will vary along this [CurveTexture].

Methods from Deref<Target = Material>

pub fn next_pass(&self) -> Option<Ref<Material, Shared>>[src]

Sets the [Material] to be used for the next pass. This renders the object again using a different material.
			[b]Note:[/b] only applies to [SpatialMaterial]s and [ShaderMaterial]s with type "Spatial".

pub fn render_priority(&self) -> i64[src]

Sets the render priority for transparent objects in 3D scenes. Higher priority objects will be sorted in front of lower priority objects.
			[b]Note:[/b] this only applies to sorting of transparent objects. This will not impact how transparent objects are sorted relative to opaque objects. This is because opaque objects are not sorted, while transparent objects are sorted from back to front (subject to priority).

pub fn set_next_pass(&self, next_pass: impl AsArg<Material>)[src]

Sets the [Material] to be used for the next pass. This renders the object again using a different material.
			[b]Note:[/b] only applies to [SpatialMaterial]s and [ShaderMaterial]s with type "Spatial".

pub fn set_render_priority(&self, priority: i64)[src]

Sets the render priority for transparent objects in 3D scenes. Higher priority objects will be sorted in front of lower priority objects.
			[b]Note:[/b] this only applies to sorting of transparent objects. This will not impact how transparent objects are sorted relative to opaque objects. This is because opaque objects are not sorted, while transparent objects are sorted from back to front (subject to priority).

Trait Implementations

impl Debug for ParticlesMaterial[src]

impl Deref for ParticlesMaterial[src]

type Target = Material

The resulting type after dereferencing.

impl DerefMut for ParticlesMaterial[src]

impl GodotObject for ParticlesMaterial[src]

type RefKind = RefCounted

The memory management kind of this type. This modifies the behavior of the Ref smart pointer. See its type-level documentation for more information. Read more

impl Instanciable for ParticlesMaterial[src]

impl SubClass<Material> for ParticlesMaterial[src]

impl SubClass<Object> for ParticlesMaterial[src]

impl SubClass<Reference> for ParticlesMaterial[src]

impl SubClass<Resource> for ParticlesMaterial[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SubClass<T> for T where
    T: GodotObject
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.