mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2026-01-05 10:09:47 +03:00
- Create bodies by duplicating the ones from the scene to allow custom settings on them for testing purpose - Rename 3D test with multiple groups of bodies "Contact Islands" instead of "Contacts Extended" for clarity - Added "Contact Islands" test for 2D - Fixed log spamming with "Contact Islands" tests due to printing log messages for each group of bodies - Added parameter to randomize spawn positions in order to make contact separation more balanced (avoids artifacts like a huge column for circles in 2D test) - Using smaller shapes and larger amount of objects by default to test more extreme case
75 lines
3.2 KiB
Plaintext
75 lines
3.2 KiB
Plaintext
[gd_scene load_steps=8 format=2]
|
|
|
|
[ext_resource path="res://tests/static_scene.tscn" type="PackedScene" id=1]
|
|
[ext_resource path="res://tests/performance/test_perf_contacts.gd" type="Script" id=2]
|
|
[ext_resource path="res://assets/texture/godot-head.png" type="Texture" id=3]
|
|
[ext_resource path="res://tests/test_options.tscn" type="PackedScene" id=4]
|
|
|
|
[sub_resource type="RectangleShape2D" id=1]
|
|
extents = Vector2( 10, 15 )
|
|
|
|
[sub_resource type="CircleShape2D" id=2]
|
|
radius = 15.0
|
|
|
|
[sub_resource type="CapsuleShape2D" id=3]
|
|
height = 15.0
|
|
|
|
[node name="Test" type="Node2D"]
|
|
script = ExtResource( 2 )
|
|
_enable_debug_collision = false
|
|
spawns = [ NodePath("SpawnTarget1") ]
|
|
spawn_count = 500
|
|
spawn_randomize = Vector2( 10, 10 )
|
|
|
|
[node name="Options" parent="." instance=ExtResource( 4 )]
|
|
|
|
[node name="SpawnTarget1" type="Node2D" parent="."]
|
|
position = Vector2( 512, 400 )
|
|
|
|
[node name="StaticScene" parent="." instance=ExtResource( 1 )]
|
|
position = Vector2( 0, 125.017 )
|
|
|
|
[node name="DynamicShapes" type="Node2D" parent="."]
|
|
|
|
[node name="RigidBodyRectangle" type="RigidBody2D" parent="DynamicShapes"]
|
|
position = Vector2( 0, 1024 )
|
|
|
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="DynamicShapes/RigidBodyRectangle"]
|
|
shape = SubResource( 1 )
|
|
|
|
[node name="RigidBodySphere" type="RigidBody2D" parent="DynamicShapes"]
|
|
position = Vector2( 100, 1024 )
|
|
|
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="DynamicShapes/RigidBodySphere"]
|
|
shape = SubResource( 2 )
|
|
|
|
[node name="RigidBodyCapsule" type="RigidBody2D" parent="DynamicShapes"]
|
|
position = Vector2( 200, 1024 )
|
|
|
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="DynamicShapes/RigidBodyCapsule"]
|
|
shape = SubResource( 3 )
|
|
|
|
[node name="RigidBodyConvexPolygon" type="RigidBody2D" parent="DynamicShapes"]
|
|
position = Vector2( 300, 1024 )
|
|
|
|
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="DynamicShapes/RigidBodyConvexPolygon"]
|
|
scale = Vector2( 0.25, 0.25 )
|
|
polygon = PoolVector2Array( 10.7, -54.5, 28.3596, -49.4067, 47.6282, -34.3806, 57.9717, -20.9447, 50.9869, 35.2694, 38.8, 47.5, 15.9852, 54.3613, -14.9507, 54.1845, -36.5, 48.1, -50.4828, 36.33, -58.0115, -20.515, -46.9473, -34.7342, -26.0876, -50.1138, -11.4152, -54.5332 )
|
|
|
|
[node name="GodotIcon" type="Sprite" parent="DynamicShapes/RigidBodyConvexPolygon"]
|
|
self_modulate = Color( 1, 1, 1, 0.392157 )
|
|
scale = Vector2( 0.25, 0.25 )
|
|
texture = ExtResource( 3 )
|
|
|
|
[node name="RigidBodyConcavePolygon" type="RigidBody2D" parent="DynamicShapes"]
|
|
position = Vector2( 400, 1024 )
|
|
|
|
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="DynamicShapes/RigidBodyConcavePolygon"]
|
|
scale = Vector2( 0.25, 0.25 )
|
|
polygon = PoolVector2Array( -5.93512, -43.2195, 6.44476, -42.9695, 11.127, -54.3941, 26.9528, -49.4309, 26.2037, -36.508, 37.5346, -28.1737, 47.6282, -34.3806, 58.0427, -20.9631, 51.113, -10.2876, 50.9869, 35.2694, 38.8, 47.5, 15.9852, 54.3613, -14.9507, 54.1845, -36.5, 48.1, -50.4828, 36.33, -51.3668, -9.98545, -57.8889, -20.5885, -46.9473, -34.7342, -37.4014, -28.547, -26.0876, -37.0323, -26.9862, -49.15, -11.4152, -54.5332 )
|
|
|
|
[node name="GodotIcon" type="Sprite" parent="DynamicShapes/RigidBodyConcavePolygon"]
|
|
self_modulate = Color( 1, 1, 1, 0.392157 )
|
|
scale = Vector2( 0.25, 0.25 )
|
|
texture = ExtResource( 3 )
|