mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2026-01-04 23:10:08 +01:00
- 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.
Truck Town
This is a demo implementing different types of trucks of varying complexity using vehicle physics.
Controls:
- Up Arrow, W, Gamepad Right Trigger, Gamepad A/Cross: Accelerate
- Down Arrow, S, Gamepad Left Trigger, Gamepad B/Circle, Gamepad X/Square: Brake/reverse
- Left Arrow, Gamepad Left Stick, Gamepad D-Pad Left: Steer left
- Right Arrow, Gamepad Left Stick, Gamepad D-Pad Right: Steer right
- U, Gamepad Select, left-click speedometer: Change speedometer unit (m/s, km/h, mph)
- C, Gamepad Y/Triangle: Change camera (exterior, interior, top-down)
- M, Gamepad D-Pad Down: Change mood (sunrise, day, sunset, night)
- Escape, Gamepad D-Pad Up: Go back to menu (press again to exit)
On mobile platforms, the vehicle automatically accelerates. Touch the left and right edges of the screen to steer. Touch the middle of the screen to brake/reverse (this also temporarily stops acceleration).
Language: GDScript
Renderer: Forward+
Check out this demo on the asset library: https://godotengine.org/asset-library/asset/2752
How does it work?
The base vehicle uses a
VehicleBody3D
node. The trailer truck is tied together using a
ConeJointTwist
node, and the tow truck is tried together using a chain made of
RigidBody3D
nodes which are pinned together using
PinJoint nodes.
