Skip to content

Object Bond

Di-Wei Huang edited this page Dec 28, 2016 · 9 revisions

Object bonds simulate how two objects can be put together (assembled, attached, glued) into a single rigid object. For example, screwing a bolt into a nut, or building structures using Lego-like pieces.

Each object can define, using XML, a number of bond points, each of which is a local location on the object that can be attached to another bond point on a different object. When two objects are attached, they act like a single rigid object in physics simulation. A bond point is either a host or a guest. A host bond point can only be attached to one guest bond point and vice versa. Moreover, a host bond point can define a number of tightness levels. The image below illustrates an example containing a bolt and a nut. The host bond point is defined at the top of the nut, and three tightness levels are defined beneath the host bond point. Each tightness level specifies a relative position at which the guest bond point should be placed when the two objects are attached.

bond points

In this example, the three tightness levels specify that, when a demonstrator tightens the bolt, the tip of the bolt (guest bond point) should go progressively deeper into the center of the nut. The image below shows the relative positions of the two objects at tightness levels 0 (detached), 1, 2, and 3 (from left to right). Note that there must be at least one tightness level.

screw tightness

In order to create a bond between two objects, a demonstrator has to bring host and guest bond points close to each other. The demonstrator may then right-click the guest object (the object whose guest bond point is to be attached). A context menu containing the options "fasten" and "loosen" will pop up (see image below). If there is a valid host bond point in the vicinity of the right-clicked guest object, using the "fasten" option will attach the two bond points and set tightness level to 1. If there are multiple guest bond points on the same object, the closest one to the right click location will be used. A valid host bond point satisfies the following conditions: (1) It is not already attached to another guest bond point, (2) its containing object is not connected to the guest object directly or indirectly, and (3) that it is of the same type (a custom string) as the guest bond point. If there has already been a host bond point attached to the right-clicked guest object, the tightness level will increment by one until it reaches the user-defined max value. On the other hand, using the "loosen" option will decrement the tightness level by one until it reaches 0, at which point the guest object will be detached from the host.

context menu

There can be multiple host and guest bond points on each object. Images below showcase an example of screwable cubes, each containing two protruding screws (left and right) as guest bond points as well as two holes (top and front) as host bond points. A demonstrator can assemble the three cubes in a number of different ways.

screwable cubes screwable cubes 1 screwable cubes 2

Clone this wiki locally