Files
godot-demo-projects/3d/physics_tests/tests/functional/test_rigidbody_impact.tscn
Hugo Locurcio a531235db3 Use Jolt Physics in all 3D demos that use physics, improve physics tests demos (#1195)
- Add options for physics ticks per second, time scale, max physics steps per frame
  and physics interpolation to the 2D and 3D physics tests demos.
  - Physics ticks per second are always multiplied by time scale so that
    time scale does not affect the physics simulation quality.
- Enable 4× MSAA for better debug shape display. Remove meshes/lights as
  the debug collision fill make these unnecessary.
  - Switch to the Mobile rendering method in the 2D physics tests demo
    to allow for 2D MSAA, as it's not implemented in Compatibility yet.
- Improve collision shapes color in the 2D and 3D physics tests demos
  for better visibility. Each PhysicsBody type now has its own collision
  shape color.
2025-04-21 21:59:31 +02:00

91 lines
3.4 KiB
Plaintext

[gd_scene load_steps=10 format=3 uid="uid://cw38dssdgqkti"]
[ext_resource type="Script" uid="uid://cy2w4686igcmr" path="res://utils/rigidbody_pick.gd" id="1"]
[ext_resource type="Script" uid="uid://cu0nmknf22ua2" path="res://test.gd" id="2"]
[ext_resource type="PackedScene" uid="uid://3gkujifjokqw" path="res://tests/static_scene_plane.tscn" id="3"]
[ext_resource type="Script" uid="uid://cx8vo58lobtgu" path="res://utils/camera_orbit.gd" id="4"]
[sub_resource type="BoxShape3D" id="1"]
[sub_resource type="CapsuleShape3D" id="2"]
[sub_resource type="CylinderShape3D" id="3"]
[sub_resource type="ConvexPolygonShape3D" id="4"]
points = PackedVector3Array(-0.7, 0, -0.7, -0.3, 0, 0.8, 0.8, 0, -0.3, 0, -1, 0)
[sub_resource type="SphereShape3D" id="5"]
[node name="Test" type="Node3D"]
script = ExtResource("2")
[node name="DynamicShapes" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 9.35591, 0)
[node name="RigidBodyBox" type="RigidBody3D" parent="DynamicShapes"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -6, 1, 0)
axis_lock_angular_x = true
axis_lock_angular_y = true
axis_lock_angular_z = true
script = ExtResource("1")
[node name="CollisionShape" type="CollisionShape3D" parent="DynamicShapes/RigidBodyBox"]
transform = Transform3D(0.6, 0, 0, 0, 1, 0, 0, 0, 0.6, 0, 0, 0)
shape = SubResource("1")
debug_color = Color(1, 1, 0, 1)
[node name="RigidBodyCapsule" type="RigidBody3D" parent="DynamicShapes"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3, 1.0034, 0)
axis_lock_angular_x = true
axis_lock_angular_y = true
axis_lock_angular_z = true
script = ExtResource("1")
[node name="CollisionShape" type="CollisionShape3D" parent="DynamicShapes/RigidBodyCapsule"]
transform = Transform3D(0.8, 0, 0, 0, 0.8, 0, 0, 0, 0.8, 0, 0, 0)
shape = SubResource("2")
debug_color = Color(1, 1, 0, 1)
[node name="RigidBodyCylinder" type="RigidBody3D" parent="DynamicShapes"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.0034, 0)
axis_lock_angular_x = true
axis_lock_angular_y = true
axis_lock_angular_z = true
script = ExtResource("1")
[node name="CollisionShape" type="CollisionShape3D" parent="DynamicShapes/RigidBodyCylinder"]
transform = Transform3D(0.8, 0, 0, 0, 1, 0, 0, 0, 0.8, 0, 0, 0)
shape = SubResource("3")
debug_color = Color(1, 1, 0, 1)
[node name="RigidBodyConvex" type="RigidBody3D" parent="DynamicShapes"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3, 1.97795, 0)
axis_lock_angular_x = true
axis_lock_angular_y = true
axis_lock_angular_z = true
script = ExtResource("1")
[node name="CollisionShape" type="CollisionShape3D" parent="DynamicShapes/RigidBodyConvex"]
transform = Transform3D(1.5, 0, 0, 0, 2, 0, 0, 0, 1.5, 0, 0, 0)
shape = SubResource("4")
debug_color = Color(1, 1, 0, 1)
[node name="RigidBodySphere" type="RigidBody3D" parent="DynamicShapes"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6, 1, 0)
axis_lock_angular_x = true
axis_lock_angular_y = true
axis_lock_angular_z = true
script = ExtResource("1")
[node name="CollisionShape" type="CollisionShape3D" parent="DynamicShapes/RigidBodySphere"]
transform = Transform3D(0.8, 0, 0, 0, 0.8, 0, 0, 0, 0.8, 0, 0, 0)
shape = SubResource("5")
debug_color = Color(1, 1, 0, 1)
[node name="StaticBodyPlane" parent="." instance=ExtResource("3")]
[node name="Camera3D" type="Camera3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3.604, 22.124)
fov = 35.0
script = ExtResource("4")