Utility Scripts · Sockets
Breakable Connections
Optional limits disconnect a connection from the constraint solver's actual reaction force and torque.
No breakable switch is required. max_force or max_torque on the male recipe opts the connection into sampling; with neither field, no per-step reaction read occurs.
API#
var socket = jolt_socket(panel, "male", "panel_mount", {
connection_type: "fixed",
max_force: 1000,
max_torque: 250
});| Type | max_force | max_torque |
|---|---|---|
| fixed | Yes | Yes |
| hinge | Yes | Yes |
| point | Yes | No; configuration is rejected |
| swing_twist | Yes | Yes for the current nonmotor Socket recipe |
Every supplied limit must be positive and finite. An absent value leaves that component unlimited. The immediate rule is force > max_force OR torque > max_torque.
Measured reaction#
- After the solver finishes, the native bridge reads reaction lambdas from the concrete Jolt constraint.
- Force is linear impulse magnitude divided by solver timestep. Torque is the applicable angular impulse magnitude divided by the same timestep.
- An inactive or sleeping constraint returns no valid sample because Jolt may retain its old lambda.
- The check runs after every successful fixed step. Violations are collected, then destroyed outside solver callbacks.
Diagnostics#
var connection = socket.connection;
// The retained reference remains useful after socket.connection is cleared.
if (connection.broken) {
show_debug_message(connection.break_reason); // force, torque, force_torque
show_debug_message(connection.break_force);
show_debug_message(connection.break_torque);
}- Break uses SocketConnection.destroy(), restoring pair collision, occupancy, group state, and cooldown.
- Grabber pulls, explosions, and impacts need no special integration; they only create physical load.
- A multi-socket group has one connection and therefore breaks as a whole.