Open kubecz3k opened 11 months ago
4.2 beta, dce1aab174369e9124507f4614fc007301df52e7
Godot v4.2.beta (dce1aab17) - Ubuntu 22.04.1 LTS 22.04 - X11 - Vulkan (Forward+) - dedicated AMD RADV NAVY_FLOUNDER () - AMD Ryzen 9 3900X 12-Core Processor (24 Threads)
It's impossible to perform a physic engine query that would return more then 2048 results, max_results argument is simply ignored.
max_results
Things that were tested:
const SCALE = 0.1 func _ready() -> void: space_id = PhysicsServer3D.space_create() for idx_x in range(1000): for idx_y in range(1000): var area_id: RID = PhysicsServer3D.area_create() var position: Vector3 = Vector3(idx_x, idx_y, 0) var transform: Transform3D = Transform3D(Basis(), Vector3(idx_x*SCALE, idx_y*SCALE, 0)) var shape_id: RID = PhysicsServer3D.sphere_shape_create() PhysicsServer3D.shape_set_data(shape_id, 0.5 * SCALE) PhysicsServer3D.area_set_space(area_id, space_id) PhysicsServer3D.area_add_shape(area_id, shape_id) PhysicsServer3D.area_set_transform(area_id, transform) PhysicsServer3D.area_set_collision_layer(area_id, 1) PhysicsServer3D.area_set_collision_mask(area_id, 0)
func _physics_process(delta: float) -> void: var physics_direct_state: PhysicsDirectSpaceState3D = PhysicsServer3D.space_get_direct_state(space_id) var box_shape_query: PhysicsShapeQueryParameters3D = PhysicsShapeQueryParameters3D.new() var box_shape: BoxShape3D = BoxShape3D.new() box_shape_query.collide_with_areas = true box_shape_query.collide_with_bodies = false box_shape_query.collision_mask = 1 box_shape.size = Vector3(1000,1000,100) box_shape_query.shape = box_shape var result = physics_direct_state.intersect_shape(box_shape_query, 100000) print("results nmb: ", result.size())
PhysicQueryResultsCountIssue.zip
This is in fact a hard coded limit, should be documented at minimum
I expected it's hard-coded, I think it should be a setting in ProjectSettings
Godot version
4.2 beta, dce1aab174369e9124507f4614fc007301df52e7
System information
Godot v4.2.beta (dce1aab17) - Ubuntu 22.04.1 LTS 22.04 - X11 - Vulkan (Forward+) - dedicated AMD RADV NAVY_FLOUNDER () - AMD Ryzen 9 3900X 12-Core Processor (24 Threads)
Issue description
It's impossible to perform a physic engine query that would return more then 2048 results,
max_results
argument is simply ignored.Things that were tested:
Steps to reproduce
Minimal reproduction project
PhysicQueryResultsCountIssue.zip