Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  ReattachingParticle
#11
(10-03-2022, 10:36 AM)josemendez Wrote: Ok, I think I understand now. This you're talking about is the intended behavior.

When you disable the rope, or remove the attachment and re-add it, the attachment will automatically call Bind(). What this does is it attaches the rope particle at its current position relative to the target.

If you always want the rope to be attached at a specific point, you want to manually set the particle position and then call Bind() afterwards. Anytime you call Bind(), the particle's current position/orientation will be used as the reference position/orientation to attach it.

This topic was also brought up by another user in this thread, might be helpful:
http://obi.virtualmethodstudio.com/forum...-3344.html
Kind of, I also wrote, that I did this (and asked if it's legit solution or it can ruin something), but I have problem that I don't know how to set Particle orientation as I do with position through teleportation... This shift is not something intended, but sometimes happens and easiest way to test fixes is by this method...
Reply
#12
(10-03-2022, 10:50 AM)alex798 Wrote: Kind of, I also wrote, that I did this (and asked if it's legit solution or it can ruin something),

It's 100% legit, since it's the method used internally by the engine to establish a "reference pose" for attachments.

(10-03-2022, 10:50 AM)alex798 Wrote: but I have problem that I don't know how to set Particle orientation as I do with position through teleportation... This shift is not something intended, but sometimes happens and easiest way to test fixes is by this method...

Code:
rod.solver.orientations[particleIndexInSolver] = yourOrientation;
See: http://obi.virtualmethodstudio.com/manua...icles.html

Note that orientations are only used by rods. Ropes do not use particle orientation at all, setting their position is all you need.
Reply
#13
(10-03-2022, 11:01 AM)josemendez Wrote: It's 100% legit, since it's the method used internally by the engine to establish a "reference pose" for attachments.


Code:
rod.solver.orientations[particleIndexInSolver] = yourOrientation;
See: http://obi.virtualmethodstudio.com/manua...icles.html

Note that orientations are only used by rods. Ropes do not use particle orientation at all, setting their position is all you need.
That's strange- because with this method the rotation of rope ends(particle connected) is off of target - maybe tangents update is needed to fix this? (in this case would like to know how it's done)
Reply
#14
(10-03-2022, 11:24 AM)alex798 Wrote: That's strange- because with this method the rotation of rope ends(particle connected) is off of target

Ropes have no rotation or orientation of any kind. Rope particles are just points, and ropes are simply a sequence of lines drawn from one point (particle) to the next. You can't control rope "rotation", because there's no rotation. As stated in the manual:

Quote: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.

If you want to explicitly control orientation/rotation, use rods instead. When using rods, attachments have a "constrain orientation" checkbox that allows them to remove all rotational DOFs.

(10-03-2022, 11:24 AM)alex798 Wrote: maybe tangents update is needed to fix this? (in this case would like to know how it's done)

Tangents only exist in the blueprint, since their only purpose is to define a bézier curve for initial particle placement. At runtime, path tangents have no influence at all on the simulation since they're an editor tool. At runtime all you have are particles.

(10-03-2022, 11:24 AM)alex798 Wrote: because with this method the rotation of rope ends(particle connected) is off of target

I think what you mean by "the rotation of rope ends" is simply the position of particles other than the one at the end. If you want to constraint the "rotation" of the rope, the obvious solution is to attach more than one particle.

From a geometrical point of view, you can think of it this way: a single point in space does not define a "direction" or "orientation". Two points however, do. So if you only attach one particle, the rope is free to rotate around it. If you attach two particles however, the rope is forced to pass trough the line segment defined by them.

Check the wall-mounted ropes in the RopeShowcase scene. They use this technique to stay perpendicular to the wall.
Reply
#15
(10-03-2022, 11:37 AM)josemendez Wrote: Rope particles have no rotation or orientation of any kind, so neither do ropes. Particles are just points, and ropes are simply a sequence of lines drawn from one point (particle) to the next. You can't control rope "rotation", because there's no rotation. As stated in the manual:


If you want to explicitly control orientation, use rods instead.


Tangents only exist in the blueprint, since their only purpose is to define a bézier curve for initial particle placement. At runtime, path tangents have no influence at all on the simulation.


I think what you mean by "the rotation of rope ends" is simply the position of particles other than the one at the end. If you want to constraint the "rotation" of the rope, you need to attach more than one particle in the rope. From a geometrical point of view, you can think of it this way: a single point in space does not define a "direction" or "orientation". Two points however, do.
Oh thanks - so the second particle was the problem of such behavior...

Users usually don't know what intristic works are done- so they know only about blueprint editors which shows tangents and orientations- so I thought thats how its adjusted- now everything is a lot easier Sonrisa

Off the topic, but do u have any ready rope blueprints looking like this?

Off the topic, but do u have any ready rope blueprints looking like this?


Attached Files
.png   Rope.png (Size: 62.77 KB / Downloads: 31)
Reply
#16
(10-03-2022, 11:42 AM)alex798 Wrote: Oh thanks - so the second particle was the problem of such behavior...
[...]now everything is a lot easier Sonrisa

No worries!

(10-03-2022, 11:42 AM)alex798 Wrote: Users usually don't know what intristic works are done- so they know only about blueprint editors which shows tangents and orientations- so I thought thats how its adjusted-

Obi is a particle-based engine, blueprints/editor tools are just that: tools to help you place particles. At runtime, there's only particles and constraints. This keeps things nice and simple since all your game has to worry about is particle data.

http://obi.virtualmethodstudio.com/manua...index.html

Quote:Obi is a collection of particle-based physics plugins for Unity. Everything in Obi is made out of small spheres called particles. Particles can interact with each other, affect and be affected by other objects trough the the use of constraints.

This is also how many other systems in Unity (and other game engines) work, it's an ubiquitous pattern: not every tool that you use in editor is available at runtime, oftentimes they only exist to make your life easier. For instance, when making a forest in Unity, all the game needs to know is where are trees placed, and the type of each tree. You can quickly paint vegetation on terrains using Unity's terrain editor, but at runtime there's no "brush" or "splat" tools. They are there just to help you place trees in the editor.

Same for ropes/rods: you can use the path editor - with control points, tangents, etc- to quickly define the initial placement, thickness, color, and meaning of particles. But at runtime, there's no "tree splatting tool": all you have are trees.
Reply
#17
(10-03-2022, 11:42 AM)alex798 Wrote: Off the topic, but do u have any ready rope blueprints looking like this?

Do you mean the spiral-like path of the rope, or the rope mesh? Blueprints only determine the initial "path" of the rope, the actual look of the rope is determined by the renderer component you use. Take a look at the rendering page of the manual:

http://obi.virtualmethodstudio.com/manua...modes.html

For this I'd use a ObiRopeExtrudedRenderer, with a custom section shape and some twisting.
Reply
#18
(10-03-2022, 11:54 AM)josemendez Wrote: Do you mean the spiral-like path of the rope, or the rope mesh? Blueprints only determine the initial "path" of the rope, the actual look of the rope is determined by the renderer component you use. Take a look at the rendering page of the manual:

http://obi.virtualmethodstudio.com/manua...modes.html

For this I'd use a ObiRopeExtrudedRenderer, with a custom section shape and some twisting.
I need an initial position- after that user will pull it by upper end to get long cable... Seems like that I have outdated Renderer- don't have twist option, but won't custom shapes and twistes prevent rope from unwinding?
Reply
#19
(10-03-2022, 12:13 PM)alex798 Wrote: I need an initial position- after that user will pull it by upper end to get long cable...

Then you can set the initial position using the path editor.

(10-03-2022, 12:13 PM)alex798 Wrote: Seems like that I have outdated Renderer- don't have twist option

See "section twist" in the ObiPathSmoother component:
http://obi.virtualmethodstudio.com/manua...modes.html

There should be a "Twist" parameter in the ObiPathSmoother component inspector.

Edit: just realized there's a "twist" parameter listed in the manual, as part of the renderer. This is a leftover from older versions, this parameter only exists in the path smoother component. Will update the docs.

(10-03-2022, 12:13 PM)alex798 Wrote: but won't custom shapes and twistes prevent rope from unwinding?

Rendering and simulation are two completely separate things. How you render something will not affect its physical behavior, this is a basic concept that applies not only to Obi but to all physics/rendering engines.
Reply
#20
(10-03-2022, 12:26 PM)josemendez Wrote: Then you can set the initial position using the path editor.


See "section twist" in the ObiPathSmoother component:
http://obi.virtualmethodstudio.com/manua...modes.html

There should be a "Twist" parameter in the ObiPathSmoother component inspector.

Edit: just realized there's a "twist" parameter listed in the manual, as part of the renderer. This is a leftover from older versions, this parameter only exists in the path smoother component. Will update the docs.


Rendering and simulation are two completely separate things. How you render something will not affect its physical behavior, this is a basic concept that applies not only to Obi but to all physics/rendering engines.
Good day,
Thanks to your instruction managed to make suck rope from Sample's SpringRod by editting asset in notepad and deleting rotations (your explanations) - writing just to thank and say that U can easilly make coiled rope using sample and creativity Sonrisa


Attached Files Thumbnail(s)
   
Reply