Detailed explanation of Unity plug-in Obi.Rope

foreword

How to use the Obi.Rope plugin

creation of the rope

insert image description here
insert image description here
The created Obi Rope, Inspector panel is as follows, there are many components, among which Obi Solver is the general processor of rope, cloth, liquid, etc., and this component can also be separated out as an independent game object.
insert image description here

rope shape

Obi's own rope editor, ObiCurve, can adjust the shape, length, bending, etc. of the rope. Click the Edit curve button. Then the auxiliary points of the Curve editor as shown below will appear in the Editor panel, and the key points of the rope can be added, deleted, translated, and rotated.
insert image description here
insert image description here

The material of the rope

Find the material that comes with the plug-in, drag it to the rope, and the rope will appear as shown below. Click the Initialize button of Obi Rope to initialize the rope, and the rope changes from the white line just now to the shape of a rope.
insert image description here
The display
UV Scale of the rope can be adjusted as follows: Set the UV Selction Thickness Scale of the texture
: Set the thickness of the rope
insert image description here

rope fixation

One end of the rope generally needs to be fixed to an object or wall.
We click on Obi Rope's Edit particels button. The rope in the Editor panel will turn into a bunch of blue dots as shown below. These blue points are the information points of the rope, which control the fixing, handle, and binding of the rope to the object. There is also information on the smoothness of the rope.

insert image description here
We select the top blue information point, and the particle editor panel will appear in the lower right corner, and we can see many buttons, among which the four red buttons in the third row are for fixing and controlling the set point.
The first one is fixed coordinates, it seems to be enabled, gray when consistent, the
second is fixed coordinates and rotation,
the third is unfixed
, the fourth is to create a handle point, our program can control the handle point to make the rope move
insert image description here

rope control

insert image description here

Binding of ropes and colliders

First create a Cube collider, then add the Obi Collider component, and then the Cube can interact with the rope for collision.
You can also add a Rigidobject rigid body to the Cube, so that the Cube has gravity.
insert image description here
Then we click the blue information point at the bottom of the rope, find the Obi Pin Constraints component in the Inspector panel of the rope, click the Add Pin Constraint button, and then drag the Cube to the Pinned To parameter to realize the binding of the rope and the Cube .
insert image description here
Run, the scene is as follows;
the top of the rope is fixed, and the bottom is bound to the Cube. We move the Cube and find that the rope is shaking.
insert image description here

The parameters of the rope

Stretch: Distance in Obj Solver

The smaller the Iterations, the more slack the rope. The bigger the tighter the rope
insert image description here

Rope Physical Material

You can set the elasticity of the rope, the friction coefficient, etc.
We can create the Obi physical material by ourselves, or use the material that comes with the Obi example.
insert image description here

Guess you like

Origin blog.csdn.net/qq563129582/article/details/128006638