Rope/rod blueprints

In this page we will learn to generate and edit rope and rod blueprints. Each one has a matching actor type.

Rope:
Ropes are built by chaining particles using distance and bend constraints. Since regular particles have no orientation (only a position), torsion effects cannot be simulated (wikipedia), and ropes cannot retain its rest shape. However, unlike rods, ropes can be torn/split and their length can be changed at runtime.

Rod:
Rods are built by chaining oriented particles using stretch/shear and bend/twist constraints. They are much more sophisticated than ropes, can simulate torsion affects and retain their rest shape. However, their length cannot be changed at runtime and they cannot be torn/split. Rods are ideal to model springs, thick bars, antennae, etc.

Rod (blue) and rope (red), both have the same rest shape. The rod is able to keep its rest shape, the rope is not.

Unlike ropes, rods cannot be torn or dinamically resized. This table sums up the key differences between ropes and rods:

feature ObiRope ObiRod
Rest shape No Yes
Torsion resistance No Yes
Dinamically resizable (ObiCursor) Yes No
Tearable Yes No

To generate a basic rope/rod blueprint, go to Assets->Create->Obi->Rope/Rod blueprint, or right-click on a project folder and select Create->Obi->Rope/Rod blueprint. Rope and rod blueprints have the following parameters:

Thickness:
Radius of the particles used to generate the rope/rod, expressed in meters.

Resolution:
Density of particles per length unit. A value of 1 will generate particles with an overlap equal to the rope thickness. A value of 0.5 will generate particles in such way that they barely touch each other. Values lower than 0.5 will leave gaps between particles, which can be detrimental to collision detection robustness but beneficial for performance. A value of zero will only generate one particle per control point.

Resolution: 1
Resolution: 0.5
Resolution: 0.1
(In the lower resolution rope, bend and distance constraints can be seen as faint purple and green lines.)

Pooled particles:
(Ropes only). Extra particles allocated to be used when tearing or resizing the rope. You can set this value to zero if you do not plan on tearing or resizing the rope at runtime, as no extra particles besides the initial ones will be needed.
Keep initial shape:
(Rods only). Enable this if you want the rod to keep its initial shape as its rest shape. Disabling it will cause the rod to assume a completely straight rest shape.

To edit a rope or rod blueprint, assign it to the blueprint slot of a rope or rod actor. Then, click the edit path button to enter path edit mode:


Path editor

Path edit mode with one control point selected (small white spheres), showing its thickness handle (orange disk) and its two tangent handles (squared at each side).

The resulting rope, using a extruded renderer.

Particles in the rope/rod blueprint are generated along a path, which is a curved shape passing trough several control points. In the path editor you can add/remove control points, move/rotate/scale existing control points, and set per-control point properties that will be interpolated to the rope particles. While editing the path, you will have instant feedback of how the resulting rope/rod looks like. Sometimes it is useful to use a ObiParticleRenderer component while editing the path, to clearly see how the path is translated to particles.

Add control points tooladdcp

This toggle enables a tool to add control points to the spline visually. A green dotted line will appear between the mouse cursor and the closest point in the spline. Clicking will insert a new control point in the curve at that position.

Remove control points toolremovecp

This toggle enables a tool to remove control points from the spline visually. A red dotted line will appear between the mouse cursor and the closest point in the spline. Clicking will delete the closest control point in the curve.

Open/close pathopenclose

A path can be either open (both ends are independent) or closed (the curve follows a closed path, with both ends sharing the same position and tangent).

Orientation tool (rods only)orientcp

This tool allows you to define the orientation of each control point. This lets you specify the rest twist of the rod.

Toggle tangent handlesorientcp

Toggles tangent handles on/off.

Toggle thickness handlesorientcp

Toggles thickness handles on/off.

Editing control points

You can select multiple control points at once by holding "shift", or you can drag a selection marquee using "ctrl". Translate, rotate and scale gizmos work in the same way as they do with regular GameObjects, so do the pivot and transform space toggles.

Each tangent handle has three modes of operation, which can be set per-handle: Free, Aligned, or Mirrored.

Free
Each half of the handle is free to move independently. This allow to create sharp corners or sudden changes in curvature.
Aligned
Both halves will be forced to lie in the tangent to the control point, however their length can be set independently.
Mirrored
Both halves will be forced to be identical, both in direction and length.

In addition to the tangent mode, each control point has several properties that are passed on (via interpolation) to the particles:

Thickness
Thickness of the rope at that point. Interpolated to particles, used for collision detection and rendering.
Mass
Particle mass. Determines how the particle behaves when involved in any constraint (collision, distance, bending...) with another particle or a rigidbody.
Phase
Particle phase, used to determine when collisions with rigidbodies and other particles should be ignored. For an in-depth explanation, see collisions.
Color
Color of the control point, interpolated to particles. This color is passed to the mesh vertex colors when using a ObiRopeExtrudedRenderer.
Name
Obi will automatically create one particle group for each control point, containing the particle closest to that control point. You can set the name of the group here.