Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Issues with Rotated QMeshNode Editing #2

Merged
merged 1 commit into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .sconsign.dblite
Binary file not shown.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ QuarkPhysics is a physics engine for 2D games, capable of simulating Rigid Body,
## How to Use?
You can use it like other Godot 4 native extension and plugins. Simply download the latest version from the Releases section and add the `addons` folder to your project as is. If you want to use the `QMeshEditor` plugin, make sure it is activated in Godot's project settings.

Additionally, you can check out the example scenes and applications in the `examples` folder. If you don't need them, there's no need to add anything other than the addon folder to your project.
Additionally, you can check out the example scenes and applications in the `examples` folder. If you don't need them, there's no need to add anything other than the `addons` folder to your project.


## How to Contribute?
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ func _init():
if(Engine.is_editor_hint()):
setup_controls()
update_values_from_editor()







func setup_controls():
Expand Down
17 changes: 9 additions & 8 deletions project/addons/quarkphysics/qmesh_editor/qmesh_editor_tool.gd
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ var plugin:EditorPlugin
#Helpers
var snapHelper:QMeshSnapHelper=QMeshSnapHelper.new()


func _reset_tool() :
mouse_drag_mode=false
last_mouse_pressed_position=Vector2.ZERO
Expand Down Expand Up @@ -48,7 +49,7 @@ func fromScreen(point:Vector2)->Vector2 :

func get_nearest_particle_index(targetMeshNode:QMeshNode,position:Vector2) ->int:
for i in range(targetMeshNode.data_particle_positions.size() ) :
var point=targetMeshNode.data_particle_positions[i]
var point=targetMeshNode.data_particle_positions[i].rotated(meshNode.global_rotation)
if ((point+targetMeshNode.global_position)-position).length()<5.0 :
return i
return -1;
Expand All @@ -60,8 +61,8 @@ func get_nearest_spring_index(targetMeshNode:QMeshNode, position:Vector2, intern
var springs=targetMeshNode.data_internal_springs if internal else targetMeshNode.data_springs
for i in range(springs.size()) :
var spring=springs[i]
var pA=targetMeshNode.data_particle_positions[ spring[0] ]+meshNode.global_position
var pB=targetMeshNode.data_particle_positions[ spring[1] ]++meshNode.global_position
var pA=targetMeshNode.data_particle_positions[ spring[0] ].rotated(meshNode.global_rotation)+meshNode.global_position
var pB=targetMeshNode.data_particle_positions[ spring[1] ].rotated(meshNode.global_rotation)+meshNode.global_position
var a_vec=(pB-pA)
var unit=a_vec.normalized()
var normal=unit.orthogonal()
Expand All @@ -77,10 +78,10 @@ func get_nearest_spring_index(targetMeshNode:QMeshNode, position:Vector2, intern

return spring_index

func snap_to_grid(point:Vector2) ->Vector2:
var snapped_x = roundf(point.x / snapHelper.snap_step.x) * snapHelper.snap_step.x
var snapped_y = roundf(point.y / snapHelper.snap_step.y) * snapHelper.snap_step.y
var res = Vector2(snapped_x, snapped_y) + snapHelper.snap_offset
func snap_to_grid(point:Vector2,snap_step:Vector2,snap_offset:Vector2) ->Vector2:
var snapped_x = roundf(point.x / snap_step.x) * snap_step.x
var snapped_y = roundf(point.y / snap_step.y) * snap_step.y
var res = Vector2(snapped_x, snapped_y) + snap_offset
return res


Expand All @@ -89,7 +90,7 @@ func get_uv_map_index_at_position(targetMeshNode:QMeshNode, position:Vector2) ->
var map=targetMeshNode.data_uv_maps[i]
var uv_poly:PackedVector2Array
for j in range(map.size()):
uv_poly.push_back( targetMeshNode.data_particle_positions[ map[j] ]+targetMeshNode.global_position )
uv_poly.push_back( targetMeshNode.data_particle_positions[ map[j] ].rotated(targetMeshNode.global_rotation)+targetMeshNode.global_position )
if Geometry2D.is_point_in_polygon(position,uv_poly) :
return i
return -1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ func _handle_event(event:InputEvent)->bool:
if operationOptionButton.selected==0 :
var new_particle_global_pos=mPos
if snapHelper.snap_enabled :
new_particle_global_pos=snap_to_grid(new_particle_global_pos)
new_particle_global_pos=snap_to_grid(new_particle_global_pos,snapHelper.snap_step,snapHelper.snap_offset)
var new_particle_local_pos=(new_particle_global_pos-meshNode.global_position).rotated(-meshNode.global_rotation)
#Add a new particle
var undo_redo=plugin.get_undo_redo()
undo_redo.create_action("Add a Particle to Position: "+str(mPos) )
undo_redo.add_do_method(self,"command_add_particle",plugin,meshNode,new_particle_global_pos-meshNode.global_position,0.5,false )
undo_redo.add_do_method(self,"command_add_particle",plugin,meshNode,new_particle_local_pos,0.5,false )
undo_redo.add_undo_method(self,"command_remove_particle",plugin,meshNode,meshNode.data_particle_positions.size() )
undo_redo.commit_action(true)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func _handle_event(event:InputEvent)->bool:
else:
var polygon:PackedVector2Array
for i in range(meshNode.data_polygon.size() ):
polygon.push_back( meshNode.data_particle_positions[meshNode.data_polygon[i] ]+meshNode.global_position )
polygon.push_back( meshNode.data_particle_positions[meshNode.data_polygon[i] ].rotated(meshNode.global_rotation)+meshNode.global_position )
if Geometry2D.is_point_in_polygon(mPos,polygon) :
var undo_redo=plugin.get_undo_redo()
var polygon_points=meshNode.data_polygon.duplicate()
Expand Down Expand Up @@ -83,8 +83,8 @@ func _handle_event(event:InputEvent)->bool:
func _handle_canvas_draw(overlay: Control):
if selected_particle_indexes.size()>1 :
for i in range(selected_particle_indexes.size()-1) :
var pA=toScreen(meshNode.data_particle_positions[selected_particle_indexes[i] ]+meshNode.global_position )
var pB=toScreen(meshNode.data_particle_positions[ selected_particle_indexes[i+1] ]+meshNode.global_position )
var pA=toScreen(meshNode.data_particle_positions[selected_particle_indexes[i] ].rotated(meshNode.global_rotation)+meshNode.global_position )
var pB=toScreen(meshNode.data_particle_positions[ selected_particle_indexes[i+1] ].rotated(meshNode.global_rotation)+meshNode.global_position )
overlay.draw_dashed_line(pA,pB,Color.GREEN,-1.0,10.0)

func _internal_checkbox_toggled(toggled_on:bool) :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func _handle_event(event:InputEvent)->bool:
last_mouse_motion_position=mPos
var soloSelectedParticle:int=-1
for i in range(meshNode.data_particle_positions.size() ) :
var point=meshNode.data_particle_positions[i]
var point=meshNode.data_particle_positions[i].rotated(meshNode.global_rotation)
if ((point+meshNode.global_position)-mPos).length()<5.0 :
soloSelectedParticle=i
break
Expand Down Expand Up @@ -74,12 +74,12 @@ func _handle_event(event:InputEvent)->bool:
if selected_particle_indexes.size()>0 && repositioning_particles :
var delta=mPos-last_mouse_pressed_position
if snapHelper.snap_enabled and selected_particle_indexes.size()>1 :
delta=snap_to_grid(delta)
delta=snap_to_grid(delta,snapHelper.snap_step,snapHelper.snap_offset)

for i in range(selected_particle_indexes.size()) :
var new_pos=selected_particle_previous_positions[i]+delta
if snapHelper.snap_enabled and selected_particle_indexes.size()==1 :
new_pos=snap_to_grid(new_pos)
new_pos=snap_to_grid(new_pos,snapHelper.snap_step,snapHelper.snap_offset)
meshNode.data_particle_positions[ selected_particle_indexes[i] ]=new_pos


Expand All @@ -101,7 +101,7 @@ func _handle_event(event:InputEvent)->bool:

#Checking which particles is inside of the rect
for i in range(meshNode.data_particle_positions.size() ):
var particle_position=meshNode.data_particle_positions[i]+meshNode.global_position
var particle_position=meshNode.data_particle_positions[i].rotated(meshNode.global_rotation)+meshNode.global_position
if rect.has_point(particle_position):
selected_particle_indexes.append(i)
plugin.update_overlays()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func _handle_event(event:InputEvent)->bool:

func _handle_canvas_draw(overlay: Control):
if first_selected_particle_index!=-1 :
var first_pos:Vector2=toScreen( meshNode.data_particle_positions[first_selected_particle_index]+meshNode.global_position )
var first_pos:Vector2=toScreen( meshNode.data_particle_positions[first_selected_particle_index].rotated(meshNode.global_rotation)+meshNode.global_position )
var second_pos:Vector2=toScreen( last_mouse_motion_position )
overlay.draw_dashed_line(first_pos,second_pos,Color.GRAY,-1.0,10.0)
pass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func _handle_canvas_draw(overlay: Control):
var uv_map=meshNode.data_uv_maps[i]
var polygon:PackedVector2Array
for n in range(uv_map.size() ) :
var pos=meshNode.data_particle_positions[ uv_map[n] ]+meshNode.global_position
var pos=meshNode.data_particle_positions[ uv_map[n] ].rotated(meshNode.global_rotation)+meshNode.global_position
pos=toScreen(pos)
polygon.push_back( pos )
var color=uv_debug_colors[i%uv_debug_colors.size()]
Expand All @@ -96,11 +96,11 @@ func _handle_canvas_draw(overlay: Control):

if selected_particle_indexes.size()>1 :
for i in range(selected_particle_indexes.size()-1) :
var pA=toScreen(meshNode.data_particle_positions[selected_particle_indexes[i] ]+meshNode.global_position )
var pB=toScreen(meshNode.data_particle_positions[ selected_particle_indexes[i+1] ]+meshNode.global_position )
var pA=toScreen(meshNode.data_particle_positions[selected_particle_indexes[i] ].rotated(meshNode.global_rotation)+meshNode.global_position )
var pB=toScreen(meshNode.data_particle_positions[ selected_particle_indexes[i+1] ].rotated(meshNode.global_rotation)+meshNode.global_position )
overlay.draw_dashed_line(pA,pB,uv_line_color,-1.0,10.0)
if selected_particle_indexes.size()>0:
var first_pos:Vector2=meshNode.data_particle_positions[selected_particle_indexes[selected_particle_indexes.size()-1]]+meshNode.global_position
var first_pos:Vector2=meshNode.data_particle_positions[selected_particle_indexes[selected_particle_indexes.size()-1]].rotated(meshNode.global_rotation)+meshNode.global_position
first_pos=toScreen(first_pos)
var second_pos:Vector2=toScreen( last_mouse_motion_position )
overlay.draw_dashed_line(first_pos,second_pos,uv_line_color,-1.0,10.0)
Expand Down
4 changes: 3 additions & 1 deletion project/addons/quarkphysics/qmesh_editor_plugin.gd
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ func _forward_canvas_draw_over_viewport(overlay: Control) -> void:
return

for i in range(meshNode.data_particle_positions.size()):
var circlePos=toScreen( meshNode.global_position+meshNode.data_particle_positions[i] )
var particle_pos=meshNode.data_particle_positions[i]
particle_pos=particle_pos.rotated(meshNode.global_rotation)
var circlePos=toScreen( meshNode.global_position+particle_pos )
var circleRadius=5
var color=Color.GREEN
if editor_tool.selected_particle_indexes.has(i) :
Expand Down
29 changes: 19 additions & 10 deletions project/examples/1_welcome/main.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ gravity = Vector2(0, 0.1)
debug_renderer = false
enable_debug_mouse_interactions = true

[node name="background" type="ColorRect" parent="."]
offset_right = 1030.0
offset_bottom = 580.0
mouse_filter = 2

[node name="Floor" type="QRigidBodyNode" parent="."]
mode = 1
layers = 2
Expand All @@ -18,7 +23,6 @@ position = Vector2(519, 555)
[node name="QMeshRectNode" type="QMeshRectNode" parent="Floor"]
rectangle_size = Vector2(1000, 300)
enable_vector_rendering = true
enable_fill = false
enable_stroke = true
data_particle_positions = PackedVector2Array(-500, -150, 500, -150, 500, 150, -500, 150)
data_particle_radius = PackedFloat32Array(0.5, 0.5, 0.5, 0.5)
Expand Down Expand Up @@ -65,9 +69,10 @@ data_polygon = PackedInt32Array(0, 1, 2, 3)
data_uv_maps = Array[PackedInt32Array]([PackedInt32Array(0, 1, 3), PackedInt32Array(1, 2, 3)])

[node name="WordQ" type="QSoftBodyNode" parent="."]
rigidity = 0.1
rigidity = 0.3
self_collision = true
shape_matching = true
shape_matching_rate = 0.35
position = Vector2(238, 35)
rotation = -0.261799

Expand All @@ -79,17 +84,18 @@ enable_stroke = true
stroke_color = Color(0.0862745, 0.0901961, 0.101961, 1)
enable_curved_corners = true
curve_length = 3.0
data_particle_positions = PackedVector2Array(-48, -80, 48, -80, -32, -48, -32, 16, -32, -16, 64, -16, 64, 32, 64, -48, -64, -48, -64, -16, -64, 16, -64, 48, -32, 48, -48, 80, -32, 80, -2e-06, 80, 32, 80, 64, 48, 48, 96, 80, 96, -32, -80, -3e-06, -80, -2e-06, -48, 32, -48, 32, -80, 0, 48, 32, 48, 32, -16, 32, 32)
data_particle_positions = PackedVector2Array(-48, -80, 48, -80, -32, -48, -32, 16, -32, -16, 64, -16, 64, 32, 60.5, -49.5, -64, -48, -64, -16, -64, 16, -64, 48, -32, 48, -48, 80, -32, 80, -2e-06, 80, 32, 80, 64, 48, 48, 96, 80, 96, -32, -80, -3e-06, -80, -2e-06, -48, 32, -48, 32, -80, 0, 48, 32, 48, 32, -16, 32, 32)
data_particle_radius = PackedFloat32Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
data_particle_is_internal = PackedByteArray(0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
data_springs = Array[PackedInt32Array]([PackedInt32Array(13, 11), PackedInt32Array(11, 10), PackedInt32Array(10, 9), PackedInt32Array(9, 8), PackedInt32Array(8, 0), PackedInt32Array(1, 7), PackedInt32Array(7, 5), PackedInt32Array(5, 6), PackedInt32Array(16, 15), PackedInt32Array(15, 14), PackedInt32Array(14, 13), PackedInt32Array(2, 4), PackedInt32Array(4, 3), PackedInt32Array(3, 12), PackedInt32Array(17, 19), PackedInt32Array(19, 18), PackedInt32Array(18, 16), PackedInt32Array(0, 20), PackedInt32Array(20, 21), PackedInt32Array(2, 22), PackedInt32Array(21, 24), PackedInt32Array(22, 23), PackedInt32Array(9, 9), PackedInt32Array(12, 25), PackedInt32Array(25, 26), PackedInt32Array(23, 27), PackedInt32Array(27, 28), PackedInt32Array(28, 6), PackedInt32Array(24, 1), PackedInt32Array(26, 17)])
data_internal_springs = Array[PackedInt32Array]([PackedInt32Array(28, 5), PackedInt32Array(6, 27), PackedInt32Array(27, 5), PackedInt32Array(27, 7), PackedInt32Array(5, 23), PackedInt32Array(23, 7), PackedInt32Array(23, 24), PackedInt32Array(1, 23), PackedInt32Array(7, 24), PackedInt32Array(22, 24), PackedInt32Array(23, 21), PackedInt32Array(21, 22), PackedInt32Array(22, 20), PackedInt32Array(20, 2), PackedInt32Array(2, 21), PackedInt32Array(2, 8), PackedInt32Array(0, 2), PackedInt32Array(8, 20), PackedInt32Array(9, 4), PackedInt32Array(9, 2), PackedInt32Array(4, 8), PackedInt32Array(9, 3), PackedInt32Array(10, 4), PackedInt32Array(3, 10), PackedInt32Array(11, 3), PackedInt32Array(12, 10), PackedInt32Array(11, 12), PackedInt32Array(12, 14), PackedInt32Array(14, 11), PackedInt32Array(12, 13), PackedInt32Array(14, 25), PackedInt32Array(12, 15), PackedInt32Array(15, 25), PackedInt32Array(25, 16), PackedInt32Array(15, 26), PackedInt32Array(26, 16), PackedInt32Array(16, 17), PackedInt32Array(16, 19), PackedInt32Array(17, 18), PackedInt32Array(26, 19)])
data_particle_is_internal = PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1)
data_springs = Array[PackedInt32Array]([PackedInt32Array(13, 11), PackedInt32Array(11, 10), PackedInt32Array(10, 9), PackedInt32Array(9, 8), PackedInt32Array(8, 0), PackedInt32Array(1, 7), PackedInt32Array(7, 5), PackedInt32Array(5, 6), PackedInt32Array(16, 15), PackedInt32Array(15, 14), PackedInt32Array(14, 13), PackedInt32Array(2, 4), PackedInt32Array(4, 3), PackedInt32Array(3, 12), PackedInt32Array(17, 19), PackedInt32Array(19, 18), PackedInt32Array(18, 16), PackedInt32Array(0, 20), PackedInt32Array(20, 21), PackedInt32Array(2, 22), PackedInt32Array(21, 24), PackedInt32Array(22, 23), PackedInt32Array(12, 25), PackedInt32Array(25, 26), PackedInt32Array(23, 27), PackedInt32Array(27, 28), PackedInt32Array(28, 6), PackedInt32Array(24, 1), PackedInt32Array(26, 17)])
data_internal_springs = Array[PackedInt32Array]([PackedInt32Array(28, 5), PackedInt32Array(6, 27), PackedInt32Array(27, 5), PackedInt32Array(27, 7), PackedInt32Array(5, 23), PackedInt32Array(23, 7), PackedInt32Array(23, 24), PackedInt32Array(22, 24), PackedInt32Array(23, 21), PackedInt32Array(21, 22), PackedInt32Array(22, 20), PackedInt32Array(20, 2), PackedInt32Array(2, 21), PackedInt32Array(2, 8), PackedInt32Array(0, 2), PackedInt32Array(8, 20), PackedInt32Array(9, 4), PackedInt32Array(9, 2), PackedInt32Array(4, 8), PackedInt32Array(9, 3), PackedInt32Array(10, 4), PackedInt32Array(3, 10), PackedInt32Array(11, 3), PackedInt32Array(12, 10), PackedInt32Array(11, 12), PackedInt32Array(12, 14), PackedInt32Array(14, 11), PackedInt32Array(12, 13), PackedInt32Array(12, 15), PackedInt32Array(25, 16), PackedInt32Array(15, 26), PackedInt32Array(26, 16), PackedInt32Array(16, 17), PackedInt32Array(16, 19), PackedInt32Array(17, 18), PackedInt32Array(26, 19), PackedInt32Array(1, 23), PackedInt32Array(7, 24), PackedInt32Array(14, 25), PackedInt32Array(15, 25)])
data_polygon = PackedInt32Array(13, 11, 10, 9, 8, 0, 20, 21, 24, 1, 7, 5, 6, 28, 27, 23, 22, 2, 4, 3, 12, 25, 26, 17, 19, 18, 16, 15, 14)

[node name="WordU" type="QSoftBodyNode" parent="."]
rigidity = 0.1
rigidity = 0.3
self_collision = true
shape_matching = true
shape_matching_rate = 0.35
position = Vector2(377, -80)
rotation = 0.261799

Expand All @@ -109,9 +115,10 @@ data_internal_springs = Array[PackedInt32Array]([PackedInt32Array(2, 15), Packed
data_polygon = PackedInt32Array(0, 2, 14, 13, 12, 11, 9, 10, 23, 21, 19, 3, 1, 20, 22, 24, 25, 7, 6, 8, 5, 4, 18, 17, 16, 15)

[node name="WordA" type="QSoftBodyNode" parent="."]
rigidity = 0.1
rigidity = 0.3
self_collision = true
shape_matching = true
shape_matching_rate = 0.35
position = Vector2(541, 136)
rotation = -0.261799

Expand All @@ -131,9 +138,10 @@ data_internal_springs = Array[PackedInt32Array]([PackedInt32Array(9, 5), PackedI
data_polygon = PackedInt32Array(8, 5, 1, 2, 0, 6, 10, 12, 16, 15, 18, 19, 20, 14, 23, 24, 26, 29, 27, 28, 25, 22, 21, 17, 13, 11, 4, 3, 7, 9)

[node name="WordR" type="QSoftBodyNode" parent="."]
rigidity = 0.1
rigidity = 0.3
self_collision = true
shape_matching = true
shape_matching_rate = 0.35
position = Vector2(694, -39)

[node name="QMeshAdvancedNode" type="QMeshAdvancedNode" parent="WordR"]
Expand All @@ -152,9 +160,10 @@ data_internal_springs = Array[PackedInt32Array]([PackedInt32Array(0, 16), Packed
data_polygon = PackedInt32Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 18, 16, 17)

[node name="WordK" type="QSoftBodyNode" parent="."]
rigidity = 0.1
rigidity = 0.3
self_collision = true
shape_matching = true
shape_matching_rate = 0.35
position = Vector2(782, 133)
rotation = -0.261799

Expand Down
7 changes: 6 additions & 1 deletion project/examples/2_softbody_show/main.tscn
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://b8rm1mcftb5pr"]

[ext_resource type="Texture2D" uid="uid://e4vap6jhlmpk" path="res://icon.svg" id="2_kxaay"]
[ext_resource type="Texture2D" uid="uid://cm01ugnxqwp12" path="res://examples/icon.svg" id="2_kxaay"]

[node name="Node2D" type="Node2D"]

Expand All @@ -9,6 +9,11 @@ gravity = Vector2(0, 0.1)
debug_renderer = false
enable_debug_mouse_interactions = true

[node name="background" type="ColorRect" parent="."]
offset_right = 1030.0
offset_bottom = 580.0
mouse_filter = 2

[node name="Floor" type="QRigidBodyNode" parent="."]
mode = 1
layers = 2
Expand Down
5 changes: 5 additions & 0 deletions project/examples/3_joints/main.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ enable_sleeping = false
debug_renderer = false
enable_debug_mouse_interactions = true

[node name="background" type="ColorRect" parent="."]
offset_right = 1030.0
offset_bottom = 580.0
mouse_filter = 2

[node name="Floor" type="QRigidBodyNode" parent="."]
mode = 1
layers = 2
Expand Down
5 changes: 5 additions & 0 deletions project/examples/4_frictions/main.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ metadata/_edit_vertical_guides_ = [168.0, 80.0]
debug_renderer = false
enable_debug_mouse_interactions = true

[node name="background" type="ColorRect" parent="."]
offset_right = 1030.0
offset_bottom = 580.0
mouse_filter = 2

[node name="Floor" type="QRigidBodyNode" parent="."]
mode = 1
layers = 2
Expand Down
12 changes: 4 additions & 8 deletions project/examples/5_so_soft_world/main.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,10 @@ time_scale = 0.5
debug_renderer = false
enable_debug_mouse_interactions = true

[node name="ColorRect" type="ColorRect" parent="."]
visible = false
custom_minimum_size = Vector2(2000, 2000)
offset_left = -470.0
offset_top = -866.0
offset_right = 1530.0
offset_bottom = 1134.0
color = Color(0.603501, 0.762121, 0.903595, 1)
[node name="background" type="ColorRect" parent="."]
offset_right = 1030.0
offset_bottom = 580.0
mouse_filter = 2

[node name="blobs" type="Node2D" parent="."]

Expand Down
5 changes: 5 additions & 0 deletions project/examples/6_box_stack/main.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ metadata/_edit_vertical_guides_ = [168.0, 80.0]
debug_renderer = false
enable_debug_mouse_interactions = true

[node name="background" type="ColorRect" parent="."]
offset_right = 1030.0
offset_bottom = 580.0
mouse_filter = 2

[node name="Floor" type="QRigidBodyNode" parent="."]
mode = 1
layers = 2
Expand Down
Loading