Expose the cell_size affecting VisibilityNotifier2D precision
Refs: #4803
(cherry picked from commit d49ff7aff7
)
This commit is contained in:
parent
2859ceec6f
commit
4b58d453d4
4 changed files with 6 additions and 3 deletions
|
@ -1164,6 +1164,9 @@
|
||||||
<member name="rendering/vram_compression/import_s3tc" type="bool" setter="" getter="" default="true">
|
<member name="rendering/vram_compression/import_s3tc" type="bool" setter="" getter="" default="true">
|
||||||
If [code]true[/code], the texture importer will import VRAM-compressed textures using the S3 Texture Compression algorithm. This algorithm is only supported on desktop platforms and consoles.
|
If [code]true[/code], the texture importer will import VRAM-compressed textures using the S3 Texture Compression algorithm. This algorithm is only supported on desktop platforms and consoles.
|
||||||
</member>
|
</member>
|
||||||
|
<member name="world/2d/cell_size" type="int" setter="" getter="" default="100">
|
||||||
|
Cell size used for the 2D hash grid that [VisibilityNotifier2D] uses.
|
||||||
|
</member>
|
||||||
</members>
|
</members>
|
||||||
<constants>
|
<constants>
|
||||||
</constants>
|
</constants>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
</brief_description>
|
</brief_description>
|
||||||
<description>
|
<description>
|
||||||
The VisibilityEnabler2D will disable [RigidBody2D], [AnimationPlayer], and other nodes when they are not visible. It will only affect nodes with the same root node as the VisibilityEnabler2D, and the root node itself.
|
The VisibilityEnabler2D will disable [RigidBody2D], [AnimationPlayer], and other nodes when they are not visible. It will only affect nodes with the same root node as the VisibilityEnabler2D, and the root node itself.
|
||||||
[b]Note:[/b] VisibilityEnabler2D uses an approximate heuristic for performance reasons. If you need exact visibility checking, use another method such as adding an [Area2D] node as a child of a [Camera2D] node.
|
[b]Note:[/b] For performance reasons, VisibilityEnabler2D uses an approximate heuristic with precision determined by [member ProjectSettings.world/2d/cell_size]. If you need exact visibility checking, use another method such as adding an [Area2D] node as a child of a [Camera2D] node.
|
||||||
[b]Note:[/b] VisibilityEnabler2D will not affect nodes added after scene initialization.
|
[b]Note:[/b] VisibilityEnabler2D will not affect nodes added after scene initialization.
|
||||||
</description>
|
</description>
|
||||||
<tutorials>
|
<tutorials>
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
</brief_description>
|
</brief_description>
|
||||||
<description>
|
<description>
|
||||||
The VisibilityNotifier2D detects when it is visible on the screen. It also notifies when its bounding rectangle enters or exits the screen or a viewport.
|
The VisibilityNotifier2D detects when it is visible on the screen. It also notifies when its bounding rectangle enters or exits the screen or a viewport.
|
||||||
[b]Note:[/b] VisibilityNotifier2D uses an approximate heuristic for performance reasons. If you need exact visibility checking, use another method such as adding an [Area2D] node as a child of a [Camera2D] node.
|
[b]Note:[/b] For performance reasons, VisibilityNotifier2D uses an approximate heuristic with precision determined by [member ProjectSettings.world/2d/cell_size]. If you need exact visibility checking, use another method such as adding an [Area2D] node as a child of a [Camera2D] node.
|
||||||
</description>
|
</description>
|
||||||
<tutorials>
|
<tutorials>
|
||||||
</tutorials>
|
</tutorials>
|
||||||
|
|
|
@ -314,7 +314,7 @@ struct SpatialIndexer2D {
|
||||||
|
|
||||||
pass = 0;
|
pass = 0;
|
||||||
changed = false;
|
changed = false;
|
||||||
cell_size = 100; //should be configurable with GLOBAL_DEF("") i guess
|
cell_size = GLOBAL_DEF("world/2d/cell_size", 100);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue