From fcf8071ec95fc47dd18eba138f528cbb1eb0ac47 Mon Sep 17 00:00:00 2001 From: Marcel Admiraal Date: Sat, 1 May 2021 09:56:32 +0100 Subject: Fix documentation following implementation of particle trails --- doc/classes/BaseMaterial3D.xml | 6 +++++- doc/classes/Curve.xml | 2 +- doc/classes/GPUParticles3D.xml | 20 +++++++++++++++++++- doc/classes/RibbonTrailMesh.xml | 31 +++++++++++++++++++++++++++++++ doc/classes/TubeTrailMesh.xml | 27 +++++++++++++++++++++++++++ scene/3d/gpu_particles_3d.cpp | 8 ++++---- scene/resources/primitive_meshes.cpp | 8 +++----- 7 files changed, 90 insertions(+), 12 deletions(-) create mode 100644 doc/classes/RibbonTrailMesh.xml create mode 100644 doc/classes/TubeTrailMesh.xml diff --git a/doc/classes/BaseMaterial3D.xml b/doc/classes/BaseMaterial3D.xml index fa9068e2ad..0a7b4c5dab 100644 --- a/doc/classes/BaseMaterial3D.xml +++ b/doc/classes/BaseMaterial3D.xml @@ -364,6 +364,8 @@ If [code]true[/code], transparency is enabled on the body. See also [member blend_mode]. + + If [code]true[/code], render point size can be changed. [b]Note:[/b] this is only effective for objects whose geometry is point-based rather than triangle-based. See also [member point_size]. @@ -655,7 +657,9 @@ Enables the skin mode for subsurface scattering which is used to improve the look of subsurface scattering when used for human skin. - + + + Represents the size of the [enum Flags] enum. diff --git a/doc/classes/Curve.xml b/doc/classes/Curve.xml index 26872e1f8e..e47c420a3b 100644 --- a/doc/classes/Curve.xml +++ b/doc/classes/Curve.xml @@ -108,7 +108,7 @@ Returns the Y value for the point that would exist at the X position [code]offset[/code] along the curve. - + diff --git a/doc/classes/GPUParticles3D.xml b/doc/classes/GPUParticles3D.xml index aea106af50..e5d6581ddc 100644 --- a/doc/classes/GPUParticles3D.xml +++ b/doc/classes/GPUParticles3D.xml @@ -87,18 +87,22 @@ The number of draw passes when rendering particles. + + If [code]true[/code], particles are being emitted. Time ratio between each emission. If [code]0[/code], particles are emitted continuously. If [code]1[/code], all particles are emitted simultaneously. - + The particle system's frame rate is fixed to a value. For instance, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the simulation of the particle system itself. If [code]true[/code], results in fractional delta calculation which has a smoother particles display effect. + + Amount of time each particle will exist. @@ -122,6 +126,12 @@ + + + + + + The [AABB] that determines the node's region which needs to be visible on screen for the particle system to be active. Grow the box if particles suddenly appear/disappear when the node enters/exits the screen. The [AABB] can be grown via code or with the [b]Particles → Generate AABB[/b] editor tool. @@ -150,5 +160,13 @@ Maximum number of draw passes supported. + + + + + + + + diff --git a/doc/classes/RibbonTrailMesh.xml b/doc/classes/RibbonTrailMesh.xml new file mode 100644 index 0000000000..771f2e444b --- /dev/null +++ b/doc/classes/RibbonTrailMesh.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/classes/TubeTrailMesh.xml b/doc/classes/TubeTrailMesh.xml new file mode 100644 index 0000000000..2782791a62 --- /dev/null +++ b/doc/classes/TubeTrailMesh.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/scene/3d/gpu_particles_3d.cpp b/scene/3d/gpu_particles_3d.cpp index ab85338f36..5339b8a8da 100644 --- a/scene/3d/gpu_particles_3d.cpp +++ b/scene/3d/gpu_particles_3d.cpp @@ -605,10 +605,10 @@ void GPUParticles3D::_bind_methods() { BIND_CONSTANT(MAX_DRAW_PASSES); - BIND_CONSTANT(TRANSFORM_ALIGN_DISABLED); - BIND_CONSTANT(TRANSFORM_ALIGN_Z_BILLBOARD); - BIND_CONSTANT(TRANSFORM_ALIGN_Y_TO_VELOCITY); - BIND_CONSTANT(TRANSFORM_ALIGN_Z_BILLBOARD_Y_TO_VELOCITY); + BIND_ENUM_CONSTANT(TRANSFORM_ALIGN_DISABLED); + BIND_ENUM_CONSTANT(TRANSFORM_ALIGN_Z_BILLBOARD); + BIND_ENUM_CONSTANT(TRANSFORM_ALIGN_Y_TO_VELOCITY); + BIND_ENUM_CONSTANT(TRANSFORM_ALIGN_Z_BILLBOARD_Y_TO_VELOCITY); } GPUParticles3D::GPUParticles3D() { diff --git a/scene/resources/primitive_meshes.cpp b/scene/resources/primitive_meshes.cpp index 78cbb5d90f..c3d84aeda2 100644 --- a/scene/resources/primitive_meshes.cpp +++ b/scene/resources/primitive_meshes.cpp @@ -2075,16 +2075,14 @@ void RibbonTrailMesh::_bind_methods() { ClassDB::bind_method(D_METHOD("get_shape"), &RibbonTrailMesh::get_shape); ADD_PROPERTY(PropertyInfo(Variant::INT, "shape", PROPERTY_HINT_ENUM, "Flat,Cross"), "set_shape", "get_shape"); - ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "size", PROPERTY_HINT_RANGE, "0.001,100.0,0.001,or_greater"), "set_size", "get_size"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "sections", PROPERTY_HINT_RANGE, "2,128,1"), "set_sections", "get_sections"); - ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "section_length", PROPERTY_HINT_RANGE, "0.001,1024.0,0.001,or_greater"), "set_section_length", "get_section_length"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "section_segments", PROPERTY_HINT_RANGE, "1,128,1"), "set_section_segments", "get_section_segments"); - ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "curve", PROPERTY_HINT_RESOURCE_TYPE, "Curve"), "set_curve", "get_curve"); + + BIND_ENUM_CONSTANT(SHAPE_FLAT) + BIND_ENUM_CONSTANT(SHAPE_CROSS) } RibbonTrailMesh::RibbonTrailMesh() { -- cgit v1.2.3