mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2026-09-03 23:39:26 +03:00
Soft body demo: Lowered impulses because of lowered default mass
Since #116041, the default mass of a soft body is 1 kg for Jolt Physics (just like Godot Physics). The demos were tweaked with the previous default mass, which is 1 kg per vertex for a total mass of >4000 kg. This change reduces the applied impulses so that the demos behave sensibly again.
This commit is contained in:
@@ -8,13 +8,17 @@
|
||||
|
||||
config_version=5
|
||||
|
||||
[animation]
|
||||
|
||||
compatibility/default_parent_skeleton_in_mesh_instance_3d=true
|
||||
|
||||
[application]
|
||||
|
||||
config/name="Soft Body Physics"
|
||||
config/description="An example of soft body physics (deformable objects) such as cloth, boxes and spheres."
|
||||
config/tags=PackedStringArray("3d", "demo", "official", "rendering")
|
||||
run/main_scene="res://test.tscn"
|
||||
config/features=PackedStringArray("4.5")
|
||||
config/features=PackedStringArray("4.7")
|
||||
config/icon="uid://c5uks4gy25jah"
|
||||
|
||||
[debug]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://2hid4xcw3jf1"]
|
||||
[gd_scene format=3 uid="uid://2hid4xcw3jf1"]
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_cbx31"]
|
||||
colors = PackedColorArray(0.619608, 0.227451, 0, 1, 1, 0.564706, 0, 1)
|
||||
@@ -32,6 +32,7 @@ height = 0.5
|
||||
radial_segments = 32
|
||||
rings = 16
|
||||
|
||||
[node name="SoftBody3D" type="SoftBody3D"]
|
||||
[node name="SoftBody3D" type="SoftBody3D" unique_id=1279711992]
|
||||
mesh = SubResource("SphereMesh_6uqi0")
|
||||
pressure_coefficient = 1400.0
|
||||
total_mass = 10.0
|
||||
pressure_coefficient = 100.0
|
||||
|
||||
@@ -154,7 +154,7 @@ func _process(delta: float) -> void:
|
||||
func _physics_process(delta: float) -> void:
|
||||
# Strong sideways wind force, which pushes the cloth while airborne and
|
||||
# makes it wave around once it has landed.
|
||||
const WIND_FORCE: float = 2_450_000.0
|
||||
const WIND_FORCE: float = 100.0
|
||||
for node in $Testers/CentralForceWind.get_children():
|
||||
if node is SoftBody3D:
|
||||
node.apply_central_force(Vector3(1.0, 0.0, 0.0) * WIND_FORCE * delta)
|
||||
@@ -194,7 +194,7 @@ func _on_central_impulse_timer_timeout() -> void:
|
||||
# When using `apply_central_impulse()` instead of `apply_impulse()`,
|
||||
# we have to use a much larger value to get significant movement as the impulse is distributed
|
||||
# across all points.
|
||||
const INTENSITY: float = 8000.0
|
||||
const INTENSITY: float = 1.0
|
||||
|
||||
for node in $Testers/CentralImpulseTimer.get_children():
|
||||
if node is SoftBody3D:
|
||||
@@ -203,7 +203,7 @@ func _on_central_impulse_timer_timeout() -> void:
|
||||
|
||||
|
||||
func _on_per_point_impulse_timer_timeout() -> void:
|
||||
const INTENSITY: float = 600.0
|
||||
const INTENSITY: float = 0.2
|
||||
|
||||
for node in $Testers/PerPointImpulseTimer.get_children():
|
||||
if node is SoftBody3D:
|
||||
|
||||
Reference in New Issue
Block a user