浏览代码

Removed unnecessary AABB initialization for CPUParticles

Setting an AABB manually for CPUParticles unnecessarily registers as a custom AABB and can cause issues on some platforms and hardware.
Arman Elgudzhyan 1 年之前
父节点
当前提交
c41725c9c6
共有 2 个文件被更改,包括 1 次插入2 次删除
  1. 1 1
      doc/classes/CPUParticles3D.xml
  2. 0 1
      scene/3d/cpu_particles_3d.cpp

+ 1 - 1
doc/classes/CPUParticles3D.xml

@@ -309,7 +309,7 @@
 		<member name="tangential_accel_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0">
 		<member name="tangential_accel_min" type="float" setter="set_param_min" getter="get_param_min" default="0.0">
 			Minimum tangent acceleration.
 			Minimum tangent acceleration.
 		</member>
 		</member>
-		<member name="visibility_aabb" type="AABB" setter="set_visibility_aabb" getter="get_visibility_aabb" default="AABB(-4, -4, -4, 8, 8, 8)">
+		<member name="visibility_aabb" type="AABB" setter="set_visibility_aabb" getter="get_visibility_aabb" default="AABB(0, 0, 0, 0, 0, 0)">
 			The [AABB] that determines the node's region which needs to be visible on screen for the particle system to be active.
 			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.
 			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.
 		</member>
 		</member>

+ 0 - 1
scene/3d/cpu_particles_3d.cpp

@@ -1684,7 +1684,6 @@ CPUParticles3D::CPUParticles3D() {
 
 
 	set_emitting(true);
 	set_emitting(true);
 	set_amount(8);
 	set_amount(8);
-	set_visibility_aabb(AABB(Vector3(-4, -4, -4), Vector3(8, 8, 8)));
 
 
 	set_param_min(PARAM_INITIAL_LINEAR_VELOCITY, 0);
 	set_param_min(PARAM_INITIAL_LINEAR_VELOCITY, 0);
 	set_param_min(PARAM_ANGULAR_VELOCITY, 0);
 	set_param_min(PARAM_ANGULAR_VELOCITY, 0);