Kaynağa Gözat

Merge pull request #61851 from Calinou/particles-default-global-coordinates

Rémi Verschelde 3 yıl önce
ebeveyn
işleme
2c0c76c415

+ 2 - 2
doc/classes/CPUParticles2D.xml

@@ -192,8 +192,8 @@
 		</member>
 		<member name="linear_accel_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0">
 		</member>
-		<member name="local_coords" type="bool" setter="set_use_local_coordinates" getter="get_use_local_coordinates" default="true">
-			If [code]true[/code], particles use the parent node's coordinate space. If [code]false[/code], they use global coordinates.
+		<member name="local_coords" type="bool" setter="set_use_local_coordinates" getter="get_use_local_coordinates" default="false">
+			If [code]true[/code], particles use the parent node's coordinate space (known as local coordinates). This will cause particles to move and rotate along the [CPUParticles2D] node (and its parents) when it is moved or rotated. If [code]false[/code], particles use global coordinates; they will not move or rotate along the [CPUParticles2D] node (and its parents) when it is moved or rotated.
 		</member>
 		<member name="one_shot" type="bool" setter="set_one_shot" getter="get_one_shot" default="false">
 			If [code]true[/code], only one emission cycle occurs. If set [code]true[/code] during a cycle, emission will stop at the cycle's end.

+ 2 - 2
doc/classes/CPUParticles3D.xml

@@ -224,8 +224,8 @@
 		<member name="linear_accel_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0">
 			Minimum linear acceleration.
 		</member>
-		<member name="local_coords" type="bool" setter="set_use_local_coordinates" getter="get_use_local_coordinates" default="true">
-			If [code]true[/code], particles use the parent node's coordinate space. If [code]false[/code], they use global coordinates.
+		<member name="local_coords" type="bool" setter="set_use_local_coordinates" getter="get_use_local_coordinates" default="false">
+			If [code]true[/code], particles use the parent node's coordinate space (known as local coordinates). This will cause particles to move and rotate along the [CPUParticles3D] node (and its parents) when it is moved or rotated. If [code]false[/code], particles use global coordinates; they will not move or rotate along the [CPUParticles3D] node (and its parents) when it is moved or rotated.
 		</member>
 		<member name="mesh" type="Mesh" setter="set_mesh" getter="get_mesh">
 			The [Mesh] used for each particle. If [code]null[/code], particles will be spheres.

+ 2 - 2
doc/classes/GPUParticles2D.xml

@@ -63,8 +63,8 @@
 		<member name="lifetime" type="float" setter="set_lifetime" getter="get_lifetime" default="1.0">
 			Amount of time each particle will exist.
 		</member>
-		<member name="local_coords" type="bool" setter="set_use_local_coordinates" getter="get_use_local_coordinates" default="true">
-			If [code]true[/code], particles use the parent node's coordinate space. If [code]false[/code], they use global coordinates.
+		<member name="local_coords" type="bool" setter="set_use_local_coordinates" getter="get_use_local_coordinates" default="false">
+			If [code]true[/code], particles use the parent node's coordinate space (known as local coordinates). This will cause particles to move and rotate along the [GPUParticles2D] node (and its parents) when it is moved or rotated. If [code]false[/code], particles use global coordinates; they will not move or rotate along the [GPUParticles2D] node (and its parents) when it is moved or rotated.
 		</member>
 		<member name="one_shot" type="bool" setter="set_one_shot" getter="get_one_shot" default="false">
 			If [code]true[/code], only one emission cycle occurs. If set [code]true[/code] during a cycle, emission will stop at the cycle's end.

+ 2 - 2
doc/classes/GPUParticles3D.xml

@@ -95,8 +95,8 @@
 		<member name="lifetime" type="float" setter="set_lifetime" getter="get_lifetime" default="1.0">
 			Amount of time each particle will exist.
 		</member>
-		<member name="local_coords" type="bool" setter="set_use_local_coordinates" getter="get_use_local_coordinates" default="true">
-			If [code]true[/code], particles use the parent node's coordinate space. If [code]false[/code], they use global coordinates.
+		<member name="local_coords" type="bool" setter="set_use_local_coordinates" getter="get_use_local_coordinates" default="false">
+			If [code]true[/code], particles use the parent node's coordinate space (known as local coordinates). This will cause particles to move and rotate along the [GPUParticles3D] node (and its parents) when it is moved or rotated. If [code]false[/code], particles use global coordinates; they will not move or rotate along the [GPUParticles3D] node (and its parents) when it is moved or rotated.
 		</member>
 		<member name="one_shot" type="bool" setter="set_one_shot" getter="get_one_shot" default="false">
 			If [code]true[/code], only [code]amount[/code] particles will be emitted.

+ 1 - 1
scene/2d/cpu_particles_2d.cpp

@@ -1470,7 +1470,7 @@ CPUParticles2D::CPUParticles2D() {
 
 	set_emitting(true);
 	set_amount(8);
-	set_use_local_coordinates(true);
+	set_use_local_coordinates(false);
 
 	set_param_min(PARAM_INITIAL_LINEAR_VELOCITY, 0);
 	set_param_min(PARAM_ANGULAR_VELOCITY, 0);

+ 1 - 1
scene/2d/gpu_particles_2d.cpp

@@ -660,7 +660,7 @@ GPUParticles2D::GPUParticles2D() {
 	set_explosiveness_ratio(0);
 	set_randomness_ratio(0);
 	set_visibility_rect(Rect2(Vector2(-100, -100), Vector2(200, 200)));
-	set_use_local_coordinates(true);
+	set_use_local_coordinates(false);
 	set_draw_order(DRAW_ORDER_LIFETIME);
 	set_speed_scale(1);
 	set_fixed_fps(30);

+ 1 - 1
scene/3d/cpu_particles_3d.h

@@ -138,7 +138,7 @@ private:
 	real_t randomness_ratio = 0.0;
 	double lifetime_randomness = 0.0;
 	double speed_scale = 1.0;
-	bool local_coords = true;
+	bool local_coords = false;
 	int fixed_fps = 0;
 	bool fractional_delta = true;
 

+ 1 - 1
scene/3d/gpu_particles_3d.cpp

@@ -631,7 +631,7 @@ GPUParticles3D::GPUParticles3D() {
 	set_randomness_ratio(0);
 	set_trail_length(0.3);
 	set_visibility_aabb(AABB(Vector3(-4, -4, -4), Vector3(8, 8, 8)));
-	set_use_local_coordinates(true);
+	set_use_local_coordinates(false);
 	set_draw_passes(1);
 	set_draw_order(DRAW_ORDER_INDEX);
 	set_speed_scale(1);

+ 1 - 1
servers/rendering/renderer_rd/storage_rd/particles_storage.h

@@ -159,7 +159,7 @@ private:
 		real_t randomness = 0.0;
 		bool restart_request = false;
 		AABB custom_aabb = AABB(Vector3(-4, -4, -4), Vector3(8, 8, 8));
-		bool use_local_coords = true;
+		bool use_local_coords = false;
 		bool has_collision_cache = false;
 
 		bool has_sdf_collision = false;