-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix shape scale issue and extra contacts reported. Also update rigidb…
…odies to use collision groups (#128) - Fixes #127 - Fixes #126 - Fixes #129 - Fixes #130 - Fixes #102
- Loading branch information
Showing
16 changed files
with
282 additions
and
286 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,54 @@ | ||
[gd_scene load_steps=5 format=3 uid="uid://cn4jscixu2bmf"] | ||
[gd_scene load_steps=4 format=3 uid="uid://cn4jscixu2bmf"] | ||
|
||
[sub_resource type="GDScript" id="GDScript_gph3d"] | ||
script/source = "extends Node2D | ||
[sub_resource type="CircleShape2D" id="CircleShape2D_lc8oa"] | ||
|
||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_irytb"] | ||
|
||
func _ready() -> void: | ||
var space := get_viewport().find_world_2d().direct_space_state as RapierDirectSpaceState2D | ||
var space_json := FileAccess.open(\"user://space.json\", FileAccess.WRITE) | ||
var shapes_json := FileAccess.open(\"user://shapes.json\", FileAccess.WRITE) | ||
#space_json.store_string(space.export_json()) | ||
#shapes_json.store_string(RapierPhysicsServer2D.shapes_export_json()) | ||
" | ||
[sub_resource type="CircleShape2D" id="CircleShape2D_ykjo6"] | ||
[sub_resource type="CircleShape2D" id="CircleShape2D_6y2xx"] | ||
[sub_resource type="GDScript" id="GDScript_swyq8"] | ||
script/source = "extends ShapeCast2D | ||
|
||
|
||
# Called when the node enters the scene tree for the first time. | ||
func _ready() -> void: | ||
pass # Replace with function body. | ||
|
||
|
||
# Called every frame. 'delta' is the elapsed time since the previous frame. | ||
func _process(delta: float) -> void: | ||
print(get_collision_count()) | ||
print(get_collision_point(0)) | ||
print(get_collision_point(1)) | ||
" | ||
[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_ila5n"] | ||
normal = Vector2(-0.0425147, -0.999096) | ||
|
||
[node name="SceneRayOnSwitch" type="Node2D"] | ||
|
||
[node name="Node2D" type="Node2D" parent="."] | ||
script = SubResource("GDScript_gph3d") | ||
[node name="Node2D2" type="Node2D" parent="."] | ||
[node name="RigidBody2D" type="StaticBody2D" parent="."] | ||
position = Vector2(133, 63) | ||
[node name="CollisionShape2D" type="CollisionShape2D" parent="RigidBody2D"] | ||
position = Vector2(65, 27) | ||
shape = SubResource("CircleShape2D_ykjo6") | ||
[node name="RigidBody2D2" type="StaticBody2D" parent="."] | ||
position = Vector2(132, 67) | ||
[node name="RigidBody2D2" type="RigidBody2D" parent="."] | ||
position = Vector2(-54, -682) | ||
rotation = -1.51672 | ||
scale = Vector2(4, 2.51) | ||
mass = 100.0 | ||
max_contacts_reported = 1 | ||
|
||
[node name="CollisionShape2D" type="CollisionShape2D" parent="RigidBody2D2"] | ||
position = Vector2(65, 27) | ||
shape = SubResource("CircleShape2D_ykjo6") | ||
[node name="ShapeCast" type="ShapeCast2D" parent="."] | ||
position = Vector2(123, 62) | ||
shape = SubResource("CircleShape2D_6y2xx") | ||
target_position = Vector2(205, 82) | ||
script = SubResource("GDScript_swyq8") | ||
[node name="Marker2D" type="Marker2D" parent="."] | ||
position = Vector2(207, 92) | ||
position = Vector2(-89, 3) | ||
scale = Vector2(1.89, 1) | ||
shape = SubResource("CircleShape2D_lc8oa") | ||
|
||
[node name="CollisionShape2D2" type="CollisionShape2D" parent="RigidBody2D2"] | ||
position = Vector2(-88.2483, 25.9664) | ||
scale = Vector2(1.89, 1) | ||
shape = SubResource("CircleShape2D_lc8oa") | ||
|
||
[node name="CollisionShape2D3" type="CollisionShape2D" parent="RigidBody2D2"] | ||
position = Vector2(-87.2888, 54.2119) | ||
scale = Vector2(1.89, 1) | ||
shape = SubResource("CircleShape2D_lc8oa") | ||
|
||
[node name="RigidBody2D3" type="RigidBody2D" parent="."] | ||
position = Vector2(-80, -513) | ||
rotation = -1.51672 | ||
scale = Vector2(4, 2.51) | ||
max_contacts_reported = 1 | ||
|
||
[node name="CollisionShape2D" type="CollisionShape2D" parent="RigidBody2D3"] | ||
position = Vector2(-89, 3) | ||
scale = Vector2(1.89, 1) | ||
shape = SubResource("RectangleShape2D_irytb") | ||
|
||
[node name="StaticBody2D" type="StaticBody2D" parent="."] | ||
position = Vector2(-1, 55) | ||
|
||
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D"] | ||
position = Vector2(-6, 61) | ||
rotation = -0.060205 | ||
shape = SubResource("WorldBoundaryShape2D_ila5n") | ||
|
||
[node name="Camera2D" type="Camera2D" parent="."] | ||
zoom = Vector2(2, 2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.