This release adds support for joint constraints in 2D physics. You can now create joint constraints between collision object components in runtime, we are planning to add support for this in editor in the future as well.
Engine
DEF-3025 - Added: Support for 2D physics joints in runtime.
#4144 - Changed: Both armv7 and arm64 are included by default when building Android custom engines.
#3128 - Changed: Changed precision for the position value in shaders to highp.
#3114 - Fixed: Crash when playing flipbook animations.
#4149 - Fixed: Crash on Win32 when closing engine window.
#4146 - Fixed: Android debug bundles are now always debuggable in Android Studio.
#3118 - Fixed: Crash in ares_addrinfo_callback.
#4114 - Fixed: Profiler stringtable deadlock.
#3116 - Fixed: Font outline disappeared when anti-aliasing was turned off.
#4119 - Fixed: Hot-reload didn’t work when redirect server port was in use.
#4099 - Fixed: go.set_parent() ignored keep world transform when removing parent.
Editor
DEFEDIT-1626 - Added: The Evaluate Lua field in the Debugger now has history you can access using Up / Down.
DEFEDIT-1645 - Added: Modernized look of some dialog boxes. This work is ongoing.
DEFEDIT-1678 - Fixed: Partial path not clickable when full path exists on the same Console line.
DEFEDIT-1682 - Fixed: Search in Files frames match incorrectly on Linux.
DEFEDIT-4102 - Fixed: Show nicer error message when debugger failed to connect.
DEFEDIT-4106 - Removed: Removed non-working Scene settings tab from Preferences. It will return in a future release.
I have a super ugly test project I used while developing, so I think we should create a good sample/manual for it instead… But in essence you need to call physics.create_joint between two collisionobject components. You will need to specify a unique joint name (ie unique to collisionobject A) so you can address it later on with physics.destroy_joint, physics.set_joint_properties, physics.get_joint_properties, physics.get_joint_reaction_force, physics.get_joint_reaction_torque etc…
Super simple example:
-- connect two collisionobjects with a fixed joint constraint
physics.create_joint(physics.JOINT_TYPE_FIXED, "obj_a#collisionobject", "my_test_joint", vmath.vector3(0), "obj_b#collisionobject", vmath.vector3(0), { max_length = 20 })
If you turn on physics debug you will be able to see joint as lines as well.
If anyone is wondering what’s happening with the issue numbers we are moving our issue tracker from JIRA (DEF-xxxx) to GitHub (Issue-xxxx or simply #xxxx). The issue tracker will remain private for now but it makes our own workflow easier when we have the issues closer to the source code.
In the latest mail from Bengan at Defold there is a description of the new physics feature, but the link is to https://www.defold.com/manuals/physics/ which still has no single word about joints The only one I found is in API for now.
I’m glad you guys decided to skip the editor support for joints so we get to use them sooner!
Btw I have also been using physics.set_gravity() since the day 1.2.155 released. Even though I’m not doing anything cool with it, it’s really nice to be able to set it from code, rather than editing the game.project file.
This is next on our list of improvements to physics. But it is dependent on another engine change where we need to make it cheaper to know when a transform hierarchy has changed. We really don’t want to poll for scale changes every frame but rather have a system where we have some kind of dirty flag or similar.