1
Fork 0
mirror of https://github.com/Steffo99/swear-jar.git synced 2024-11-21 15:24:18 +00:00

Physics improvements for performance

This commit is contained in:
Steffo 2023-10-14 03:30:40 +02:00
parent bc5fd6fa96
commit c57052f537
Signed by: steffo
GPG key ID: 2A24051445686895
13 changed files with 30 additions and 32 deletions

View file

@ -1,10 +1,8 @@
[gd_scene load_steps=5 format=3 uid="uid://bllsprv8orpn4"] [gd_scene load_steps=5 format=3 uid="uid://bllsprv8orpn4"]
[ext_resource type="PhysicsMaterial" uid="uid://b5egitifjvcqo" path="res://entity/gem_physics_material.tres" id="1_4mug4"]
[ext_resource type="Texture2D" uid="uid://vmedndbi8crf" path="res://bottle/glass_tileset.png" id="1_qvgnf"] [ext_resource type="Texture2D" uid="uid://vmedndbi8crf" path="res://bottle/glass_tileset.png" id="1_qvgnf"]
[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_y0g3v"]
friction = 0.1
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_6tyce"] [sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_6tyce"]
texture = ExtResource("1_qvgnf") texture = ExtResource("1_qvgnf")
0:0/0 = 0 0:0/0 = 0
@ -107,7 +105,7 @@ texture = ExtResource("1_qvgnf")
[sub_resource type="TileSet" id="TileSet_tr7be"] [sub_resource type="TileSet" id="TileSet_tr7be"]
physics_layer_0/collision_layer = 18 physics_layer_0/collision_layer = 18
physics_layer_0/collision_mask = 0 physics_layer_0/collision_mask = 0
physics_layer_0/physics_material = SubResource("PhysicsMaterial_y0g3v") physics_layer_0/physics_material = ExtResource("1_4mug4")
sources/1 = SubResource("TileSetAtlasSource_6tyce") sources/1 = SubResource("TileSetAtlasSource_6tyce")
[node name="Bottle" type="TileMap"] [node name="Bottle" type="TileMap"]

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=5 format=3 uid="uid://diy8fj7mcc00p"] [gd_scene load_steps=5 format=3 uid="uid://diy8fj7mcc00p"]
[ext_resource type="PhysicsMaterial" uid="uid://c6kn1an85lccr" path="res://entity/coin_physics_material.tres" id="1_ftt7x"] [ext_resource type="PhysicsMaterial" uid="uid://b2ghrg3vynbi8" path="res://entity/coal_physics_material.tres" id="1_03a3j"]
[ext_resource type="Texture2D" uid="uid://bnfwmlf7ems16" path="res://entity/coal_diamond/coal.png" id="2_ok4kf"] [ext_resource type="Texture2D" uid="uid://bnfwmlf7ems16" path="res://entity/coal_diamond/coal.png" id="2_ok4kf"]
[ext_resource type="PackedScene" uid="uid://bk1vvq5rug01m" path="res://collector/collectible.tscn" id="4_e8hbs"] [ext_resource type="PackedScene" uid="uid://bk1vvq5rug01m" path="res://collector/collectible.tscn" id="4_e8hbs"]
[ext_resource type="PackedScene" uid="uid://ujpra0s1kpqi" path="res://value/valuable.tscn" id="5_3e4d8"] [ext_resource type="PackedScene" uid="uid://ujpra0s1kpqi" path="res://value/valuable.tscn" id="5_3e4d8"]
@ -8,10 +8,9 @@
[node name="Coal" type="RigidBody2D"] [node name="Coal" type="RigidBody2D"]
collision_layer = 4 collision_layer = 4
collision_mask = 14 collision_mask = 14
mass = 0.75 mass = 0.5
inertia = 1200.0 inertia = 300.0
physics_material_override = ExtResource("1_ftt7x") physics_material_override = ExtResource("1_03a3j")
continuous_cd = 1
can_sleep = false can_sleep = false
linear_damp = 0.1 linear_damp = 0.1
angular_damp = 0.1 angular_damp = 0.1

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=5 format=3 uid="uid://cr5tiep20hk0s"] [gd_scene load_steps=5 format=3 uid="uid://cr5tiep20hk0s"]
[ext_resource type="PhysicsMaterial" uid="uid://c6kn1an85lccr" path="res://entity/coin_physics_material.tres" id="1_mma75"] [ext_resource type="PhysicsMaterial" uid="uid://b5egitifjvcqo" path="res://entity/gem_physics_material.tres" id="1_1hg8e"]
[ext_resource type="Texture2D" uid="uid://bquk2q5g6bst5" path="res://entity/coal_diamond/diamond.png" id="2_abwth"] [ext_resource type="Texture2D" uid="uid://bquk2q5g6bst5" path="res://entity/coal_diamond/diamond.png" id="2_abwth"]
[ext_resource type="PackedScene" uid="uid://bk1vvq5rug01m" path="res://collector/collectible.tscn" id="3_n4fa5"] [ext_resource type="PackedScene" uid="uid://bk1vvq5rug01m" path="res://collector/collectible.tscn" id="3_n4fa5"]
[ext_resource type="PackedScene" uid="uid://ujpra0s1kpqi" path="res://value/valuable.tscn" id="4_yfos5"] [ext_resource type="PackedScene" uid="uid://ujpra0s1kpqi" path="res://value/valuable.tscn" id="4_yfos5"]
@ -8,10 +8,9 @@
[node name="Diamond" type="RigidBody2D"] [node name="Diamond" type="RigidBody2D"]
collision_layer = 4 collision_layer = 4
collision_mask = 14 collision_mask = 14
mass = 3.0 mass = 10.0
inertia = 400.0 inertia = 1500.0
physics_material_override = ExtResource("1_mma75") physics_material_override = ExtResource("1_1hg8e")
continuous_cd = 1
can_sleep = false can_sleep = false
linear_damp = 0.1 linear_damp = 0.1
angular_damp = 0.1 angular_damp = 0.1

View file

@ -0,0 +1,4 @@
[gd_resource type="PhysicsMaterial" format=3 uid="uid://b2ghrg3vynbi8"]
[resource]
rough = true

View file

@ -15,7 +15,6 @@ collision_layer = 4
collision_mask = 14 collision_mask = 14
inertia = 1000.0 inertia = 1000.0
physics_material_override = ExtResource("1_1fypc") physics_material_override = ExtResource("1_1fypc")
continuous_cd = 1
can_sleep = false can_sleep = false
linear_damp = 0.1 linear_damp = 0.1
angular_damp = 0.1 angular_damp = 0.1

View file

@ -15,7 +15,6 @@ collision_mask = 14
mass = 2.0 mass = 2.0
inertia = 600.0 inertia = 600.0
physics_material_override = ExtResource("1_nfq5t") physics_material_override = ExtResource("1_nfq5t")
continuous_cd = 1
can_sleep = false can_sleep = false
linear_damp = 0.1 linear_damp = 0.1
angular_damp = 0.1 angular_damp = 0.1

View file

@ -1,5 +1,6 @@
[gd_resource type="PhysicsMaterial" format=3 uid="uid://c6kn1an85lccr"] [gd_resource type="PhysicsMaterial" format=3 uid="uid://c6kn1an85lccr"]
[resource] [resource]
friction = 0.5 friction = 0.65
rough = true
bounce = 0.1 bounce = 0.1

View file

@ -16,7 +16,6 @@ collision_mask = 14
mass = 1.5 mass = 1.5
inertia = 800.0 inertia = 800.0
physics_material_override = ExtResource("1_4sq1a") physics_material_override = ExtResource("1_4sq1a")
continuous_cd = 1
can_sleep = false can_sleep = false
linear_damp = 0.1 linear_damp = 0.1
angular_damp = 0.1 angular_damp = 0.1

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=9 format=3 uid="uid://bawprh8kluilq"] [gd_scene load_steps=9 format=3 uid="uid://bawprh8kluilq"]
[ext_resource type="PhysicsMaterial" uid="uid://c6kn1an85lccr" path="res://entity/coin_physics_material.tres" id="1_vmemd"] [ext_resource type="PhysicsMaterial" uid="uid://b5egitifjvcqo" path="res://entity/gem_physics_material.tres" id="1_bt3de"]
[ext_resource type="Texture2D" uid="uid://b21bsbo5f0ed7" path="res://entity/gem/gemstone.png" id="3_6jejy"] [ext_resource type="Texture2D" uid="uid://b21bsbo5f0ed7" path="res://entity/gem/gemstone.png" id="3_6jejy"]
[ext_resource type="PackedScene" uid="uid://vkvtap437nnf" path="res://color/colored.tscn" id="4_2cetq"] [ext_resource type="PackedScene" uid="uid://vkvtap437nnf" path="res://color/colored.tscn" id="4_2cetq"]
[ext_resource type="PackedScene" uid="uid://bk1vvq5rug01m" path="res://collector/collectible.tscn" id="4_idoeu"] [ext_resource type="PackedScene" uid="uid://bk1vvq5rug01m" path="res://collector/collectible.tscn" id="4_idoeu"]
@ -15,10 +15,9 @@ height = 9.0
[node name="Gem" type="RigidBody2D"] [node name="Gem" type="RigidBody2D"]
collision_layer = 4 collision_layer = 4
collision_mask = 14 collision_mask = 14
mass = 1.5 mass = 8.0
inertia = 800.0 inertia = 1500.0
physics_material_override = ExtResource("1_vmemd") physics_material_override = ExtResource("1_bt3de")
continuous_cd = 1
can_sleep = false can_sleep = false
linear_damp = 0.1 linear_damp = 0.1
angular_damp = 0.1 angular_damp = 0.1

View file

@ -0,0 +1,4 @@
[gd_resource type="PhysicsMaterial" format=3 uid="uid://b5egitifjvcqo"]
[resource]
friction = 0.1

View file

@ -12,10 +12,9 @@
[node name="ItemChalice" type="RigidBody2D"] [node name="ItemChalice" type="RigidBody2D"]
collision_layer = 4 collision_layer = 4
collision_mask = 14 collision_mask = 14
mass = 2.7 mass = 24.0
inertia = 450.0 inertia = 1250.0
physics_material_override = ExtResource("1_vp2el") physics_material_override = ExtResource("1_vp2el")
continuous_cd = 1
linear_damp = 0.1 linear_damp = 0.1
angular_damp = 0.1 angular_damp = 0.1

View file

@ -15,10 +15,9 @@ radius = 12.25
[node name="ItemCrown" type="RigidBody2D"] [node name="ItemCrown" type="RigidBody2D"]
collision_layer = 4 collision_layer = 4
collision_mask = 14 collision_mask = 14
mass = 2.8 mass = 48.0
inertia = 425.0 inertia = 2500.0
physics_material_override = ExtResource("1_j1ug7") physics_material_override = ExtResource("1_j1ug7")
continuous_cd = 1
linear_damp = 0.1 linear_damp = 0.1
angular_damp = 0.1 angular_damp = 0.1

View file

@ -16,10 +16,9 @@ height = 14.5
[node name="ItemRing" type="RigidBody2D"] [node name="ItemRing" type="RigidBody2D"]
collision_layer = 4 collision_layer = 4
collision_mask = 14 collision_mask = 14
mass = 2.6 mass = 12.0
inertia = 475.0 inertia = 800.0
physics_material_override = ExtResource("1_yyeot") physics_material_override = ExtResource("1_yyeot")
continuous_cd = 1
linear_damp = 0.1 linear_damp = 0.1
angular_damp = 0.1 angular_damp = 0.1