Latest Threads |
How to dynamically change...
Forum: Obi Rope
Last Post: josemendez
1 hour ago
» Replies: 3
» Views: 113
|
Pipeline that bends
Forum: Obi Softbody
Last Post: josemendez
04-07-2025, 09:52 AM
» Replies: 13
» Views: 809
|
How to implement/sync Obi...
Forum: Obi Rope
Last Post: quent_1982
01-07-2025, 01:48 PM
» Replies: 2
» Views: 188
|
Collisions don't work con...
Forum: Obi Rope
Last Post: chenji
27-06-2025, 03:05 AM
» Replies: 3
» Views: 257
|
Force Zone apply differen...
Forum: Obi Rope
Last Post: chenji
26-06-2025, 11:41 AM
» Replies: 11
» Views: 745
|
Can I blend in and out of...
Forum: Obi Cloth
Last Post: josemendez
24-06-2025, 04:42 PM
» Replies: 3
» Views: 243
|
Using a rigidbody/collide...
Forum: Obi Cloth
Last Post: josemendez
24-06-2025, 09:29 AM
» Replies: 1
» Views: 146
|
Solver is too performance...
Forum: Obi Rope
Last Post: quent_1982
20-06-2025, 08:09 AM
» Replies: 40
» Views: 4,234
|
Obi 7 Model Scaling
Forum: Obi Cloth
Last Post: alkis
19-06-2025, 02:37 PM
» Replies: 2
» Views: 257
|
Obi Softbody instability?
Forum: Obi Softbody
Last Post: Aroosh
18-06-2025, 06:35 PM
» Replies: 0
» Views: 137
|
|
|
Ropes and cloth with guaranteed no tunnelling? |
Posted by: Hatchling - 03-06-2021, 12:06 AM - Forum: Obi Rope
- Replies (1)
|
 |
I don't really need something like this for my project, but I've been following SIGGRAPH papers that deal with rope and cloth simulation and I think some of them managed to write their simulations such that, a knot for example, will never become untied by pulling on the two ends with any amount of force. Or if you tried to pull a cloth through another, it will never poke through.
Have you looked into any of these solutions? I'm guessing most of them are not realtime.
A method I had used to ensure tunnelling doesn't occur in some of my earlier simulation projects was fairly simple, though the content being simulated was also simple:
- A particle was in an 2D environment. In the environment were horizontal line segments that the particles would collide with.
- For simplicity, assume the particle and line segments have 0 radius.
- The space around a line segment was divided into 6 parts: above to the right, above, above to the left, below to the right, below, and below to the left. (I'll abbreviate these as AR, A, AL, BR, B, and BL.)
- If the particle passed through from one region to another suggesting a collision occurred, like A to B, it'd add a force that pushes the particle into region A (a point on the line segment).
- If, at the end of frame 1, after summing all forces acting on the particle still resulted in the particle being in region B, it'd remember that the particle is "supposed" to be in region A and continue pushing the particle into it on the next frame.
- If the particle passed through from, for example, AR to BR, the line segment would now remember that the particle switched from "supposed to be above" to "supposed to be below" and no longer try to push the particle above it.
Another way to describe it:
Code: for each line segment L
for each particle P
P.Zone[L] is the current zone around L that P resides despite collision
L.Zone[P] is the zone that L remembers P residing in last frame
if a comparison of the two zones, P.Zone[L] and L.Zone[P] suggest a collision occurred
newZone is the zone closest to P.Zone[L] that doesn't suggest a collision:
For example, if P.Zone[L] is BL and L.Zone[P] is A, newZone would be AL.
Apply a force to P that pushes it into zone newZone.
L.Zone[P] <= newZone
else
L.Zone[P] <= P.Zone[L]
This approach could be made more accurrate by checking if the path of the particle intersected the line, rather than just comparing the 6-mode states for an invalid zone passing. Also, instead of just remembering the "last valid zone", it could remember the "last valid state", that is where the particle WOULD be if its collision force was the only force acting on it; the state resulting from projecting the particle.
Also, this approach does permit the particle to "poke through" the line segment, but it will always try to push the particle above it unless the particle makes a "legal" collision-free path around it. If there were a heavy object trying to pull the particle through the line segment, it wouldn't pass through freely; it'd likely reach equilibrium somewhere under the line but prevent it from falling.
This approach could be generalized to all simplices, but would require temporary memory that is freed when the collision is resolved. E.g. a list of collisions that is populated when a collision is detected, which are then removed from the list when the collision resolves.
Another challenge of this approach would be allowing adjacent simplices to "pass on" the knowledge that a collision is occurring to their neighbors, otherwise the particle could pass between two joined simplices.
This is to my knowledge the "fastest" way to ensure tunnelling-free collision, though the collision would be "soft" and not prevent interprenetration.
Another interesting approach I've seen was to create a Deluaney triangulation of the scene, where vertex points are the corners of collision shapes. If an inversion of any of the triangles occurred from frame 1 to frame 2, it'd check whether the inversion involves a collision. (E.g. a triangle's top vertex passing through its bottom edge, which is marked as a collision boundary.) If it did, it'd apply forces to correct the inversion by pushing the vertices opposite to a collision edge through to the correct side. Otherwise, it'd re-mesh the region around the inversion. (I think it continuously improves mesh quality by performing greedy edge flips, excluding edges that involve a collision boundary, or if it'd cause a false negative.) This also prevents falling through, since the inverted triangle will not get remeshed if it is collision-related, and the only way to fix the inversion is to push the particle back through the collision boundary.
I'm guessing this could be generalized to "thick" collisions by biasing edges of the triangle towards an inversion. It could also be sped up by selectively including elements in the mesh based on AABB overlap and using the beginning-of-frame state to construct the mesh of newly added elements.
(On second thought, I think I might like this approach better because it doesn't require remembering projected states or passing collision knowledge between connected simplices.)
|
|
|
Obiparticleattachment |
Posted by: mayaeraky - 02-06-2021, 07:26 PM - Forum: Obi Cloth
- Replies (5)
|
 |
Hi there, I am trying to grab my obi cloth in VR using steamVR. I tried attaching the cloth to the hand after any contact between the hand and any particle of the cloth using contact event handler and obi particle attachment but there is a huge gap between the hand and the particles attached. They’re attached correctly movement wise but they are not overlapping which makes it look weird.
Thank you
|
|
|
Obi Fluid + Trail Renderer |
Posted by: ary1111 - 01-06-2021, 03:34 PM - Forum: Obi Fluid
- Replies (1)
|
 |
I was wondering if there was a way to show a trail renderer attached to the particles, either using Unity's built-in system or using something like Ara Trails?
|
|
|
Basic Rope Grabbing |
Posted by: eddy_vr - 31-05-2021, 11:05 AM - Forum: Obi Rope
- Replies (4)
|
 |
Hello,
I am trying to set up a basic rope grabbing with a simple box collider. I added ObiContactGrabber to the box collider and a script RopeGrabber.cs which calls Grab() function. When the box collider is in contact with the particles it seems not working. What am I doing wrong ?
Here is the full sample project https://www.dropbox.com/s/a358ydt1gy2qk2...n.rar?dl=0
Thanks
Eddy
|
|
|
Runtime repin rope to new controll point |
Posted by: yeronimovr - 30-05-2021, 02:39 PM - Forum: Obi Rope
- Replies (1)
|
 |
Hello, let`s say there are A and B points between which i`m generating a rope. Then i want to add a 3rd C point and then move/repin constraint rope to new C point. Below steps:
1. spawn rope between A-B: two controll points and 2 pin constraints
2. spawn new game object and adding on his transform new controll point using InsertControlPoint
Code: Vector3 pointPos = GetSolverLocalPos(hooks[GetLastHookIndex].transform.position);
rope.path.InsertControlPoint(rope.path.ControlPointCount - 1 ,pointPos, -startHook.position.normalized, pointPos.normalized, Vector3.up, .1f, 0.1f, colliderThickness, 0, Color.red, "Hook");
3. unsap (remove constraint) rope from B: getting rope consraint, getting first batch, removing from batch. set batch to solver, setDirtyConstraints
Code: var pinConstraints = rope.GetConstraintsByType(Oni.ConstraintType.Pin) as ObiConstraints<ObiPinConstraintsBatch>;
var batch = pinConstraints.GetFirstBatch();
int index = batch.constraintCount - 1;
pinConstraints.RemoveFromSolver();
batch.RemoveConstraint(index);
pinConstraints.AddToSolver(solver);
rope.SetConstraintsDirty(Oni.ConstraintType.Pin);
and now where im stuck:
4. i want to move rope (all particles to new C point position) forward C - it works
Code: for (int i = 0; i < blueprint.activeParticleCount; i++)
{
rope.TeleportParticle(rope.solverIndices[i], GetSolverLocalPos(hooks[GetLastHookIndex].transform.position));
rope.solver.velocities[i] = Vector4.zero;
rope.solver.angularVelocities[i] = Vector4.zero;
}
rope.UpdateParticleProperties();
rope.RecalculateRestPositions();
rope.RecalculateRestLength();
5. when i want to pin last particle to C rope the constraint doesnt work and rope is going back with all forces working on particles - stuck here.
Code: var pinConstraints = rope.GetConstraintsByType(Oni.ConstraintType.Pin) as ObiConstraints<ObiPinConstraintsBatch>;
var batch = pinConstraints.GetFirstBatch();
pinConstraints.RemoveFromSolver();
batch.AddConstraint(rope.solverIndices[blueprint.activeParticleCount - 1], lastHook.AttachCollider, Vector3.zero, Quaternion.identity, 0, 0, float.PositiveInfinity);
batch.activeConstraintCount = 2;
pinConstraints.AddBatch(batch);
pinConstraints.AddToSolver(solver);
rope.SetConstraintsDirty(Oni.ConstraintType.Pin);
My target is to attach rope to new C point, set there cursor, change rope length that i can again attach rope to B point getting: A-C-B connections.
Which steps i`m missing (some update on some component) or what im doing wrong ? Thanks for any help in advance
|
|
|
What Asset to Buy (if any) for Fishing Net style effect? |
Posted by: mpbeau - 30-05-2021, 10:19 AM - Forum: General
- Replies (1)
|
 |
Hi everyone,
I am trying to create a mobile game that involves having a net in which objects are placed inside. The net grows over the course of the game. The net also doesn't need to look super realistic or have a lot of density, but should sway a little bit and behave/look relatively satisfying/interesting.
I have been looking at Obi Cloth or Obi Rope to potentially implement this, as I am not getting far with the basic Unity toolset.
Is there any recommendations on what I should look at? Is what I am doing even possible with the current state of Unity and mobile hardware (especially in a way that it is performant on most devices)?
Appreciate any information - thanks!
|
|
|
Setting instances of rope mesh renderer at runtime |
Posted by: luvjungle - 28-05-2021, 11:07 PM - Forum: Obi Rope
- Replies (1)
|
 |
Hi!
I want to constantly changle length with cursor and adjust instances amount at runtime. But every time when I change instances amount, my rope teleports to some point and becomes straight, then cursor updates it and rope teleports back and becomes normal.
Is it a bug or setup issue or anything else?
|
|
|
|