Search Forums

(Advanced Search)

Latest Threads
In SolidifyOnContact exsa...
Forum: Obi Fluid
Last Post: asimofu_ok
3 minutes ago
» Replies: 5
» Views: 106
Rope going through wall
Forum: Obi Rope
Last Post: Paul1
12 minutes ago
» Replies: 3
» Views: 39
Change rod section at run...
Forum: Obi Rope
Last Post: matty337s
02-08-2025, 06:07 AM
» Replies: 0
» Views: 55
Sliding along a rope
Forum: Obi Rope
Last Post: vrt0r
01-08-2025, 07:43 PM
» Replies: 0
» Views: 46
Is it possible to render ...
Forum: Obi Fluid
Last Post: asimofu_ok
01-08-2025, 10:07 AM
» Replies: 2
» Views: 105
Cloth has stretchy behavi...
Forum: Obi Cloth
Last Post: Andreia Mendes
31-07-2025, 02:38 PM
» Replies: 22
» Views: 900
Get separate particles pa...
Forum: Obi Fluid
Last Post: slimedev
29-07-2025, 06:51 PM
» Replies: 6
» Views: 3,237
Solver outside of hierarc...
Forum: General
Last Post: Jawsarn
29-07-2025, 06:19 PM
» Replies: 4
» Views: 198
Rope ignoring colliders o...
Forum: Obi Rope
Last Post: josemendez
24-07-2025, 07:03 AM
» Replies: 1
» Views: 140
Ladder made by Ropes (Rat...
Forum: Obi Rope
Last Post: josemendez
23-07-2025, 01:43 PM
» Replies: 5
» Views: 330

 
  How to Code Thickness?
Posted by: Renman3000 - 19-08-2023, 01:08 PM - Forum: Obi Rope - Replies (1)

Hi, 
I was looking in Docs but I see no reference to ScaleThickness. 

I do see something in the ObiRopeBlueprintBase called thickness, but attmepts to access are not going well. 


How can i code the thickness?

Thanks

Print this item

  Cloth jitter on a flat surface
Posted by: sebjf - 18-08-2023, 07:24 PM - Forum: Obi Cloth - Replies (2)

Hi,

I have a simple ObiCloth, that jitters when it is sitting on a box collider as soon as the scene starts.

https://www.dropbox.com/scl/fi/r90647zj7...i7w5z&dl=0

The collider has no collision material set. I have attached images of the configurations in Unity. Obviously if I turn up damping way up, it goes away, but then nothing happens in the simulation at all!

What should I tweak to fix this?



Attached Files Thumbnail(s)
           
Print this item

  Softbody basics
Posted by: PlatonSk - 18-08-2023, 12:14 PM - Forum: Obi Softbody - Replies (1)

Hi there!

Playing around with Obi softbody, trying to figure out how to get a proper behavior. Some help needed here.

1. I'm loading a BallPool scene, limiting its borders so that a ball is limited from all sides. 
2. Adding a cube with a default OBI collider, setting its scale to 0.2,1,0.2 so it looks like a vertical bar.
3. Trying to press a ball with the cube. The ball starts to deform and then after just a little pressure my bar simply gets into the centre of the ball.

   

I don't want it behave like that at all, the ball should not let it pass inside at all but now it happens almost effordless. Tried numerous combinations of parameters, but could not find a solution. Please help me solve it.

Thanks in advance!

Print this item

  Creating and Removing Pin Constraints from ObiPinConstraintsBatch
Posted by: sebjf - 15-08-2023, 09:59 PM - Forum: Obi Cloth - Replies (6)

Hi, 

I am trying to use ObiCloth to make an adhesive pad in VR, which the user can place on a surface, and pull away.

The way I am approaching this, is to use the collision callback to detect when particles are within a given distance of the target surface, and at the end of the frame create new Pin Constraints for all those that are not already adhered. At the end of each step, the breaking threshold is used to remove the constraints based on ObiParticleAttachment::BreakDynamicAttachment().

To avoid adding particles multiple times, I keep a list of particles that have been added to the ObiPinConstraintsBatch, and remove them from this list when they are removed in my version of BreakDynamicAttachment. However, this step often attempts to remove particles that don't exist in the list, and it appears others remain in the list even though there don't appear to be any active attachments affecting the cloth.

I have tried approaches using RemoveConstraint and DeactivateConstraint. I have successfully used a procedural ObiPinConstraintsBatch to facilitate grasping of the cloth, but in this case I can clear the ObiPinConstraintsBatch each time I need to update it.

I suspect therefore my approach to adding and removing particles from the ObiPinConstraintsBatch is wrong.

What is the best way to handle creating and destroying a small number of Pin Constraints for this purpose?

Would it be better, for example, to create an ObiPinConstraintsBatch with a single constraint for each particle at startup, then update/Activate/Deactivate these as they come into and out of contact?


Or perhaps I am getting the index for a broken constraint the wrong way - is this code correct?

Code:
// The particlesToStick is populated in the collision callback, with solver indices

private void UpdateAdhesionConstraintsBatch()
{
    if (particlesToStick.Count > 0)
    {
        var bindMatrix = Dummy.transform.worldToLocalMatrix * actor.solver.transform.localToWorldMatrix;

        if(adhesionBatch == null)
        {
            adhesionBatch = new ObiPinConstraintsBatch();
        }

        foreach (var solverIndex in particlesToStick)
        {
            var positionOffset = bindMatrix.MultiplyPoint3x4(actor.solver.positions[solverIndex]);
            var orientationOffset = bindMatrix.rotation * actor.solver.orientations[solverIndex];

            adhesionBatch.AddConstraint(
                solverIndex,
                Dummy,
                positionOffset,
                orientationOffset,
                0,
                0,
                0.1f
            );

            //q: why is this needed?
            adhesionBatch.activeConstraintCount++;

            stuck.Add(solverIndex);

            actor.SetConstraintsDirty(Oni.ConstraintType.Pin);
        }

        particlesToStick.Clear();

        UpdateAdhesion(); [color=#333333][size=small][font=Monaco, Consolas, Courier, monospace]// This adds or removes the batch depending on whether there are any active constraints, and tells the solver to rebuild the pins[/font][/size][/color]
    }
}

// And to break the constraints, at the end of each step

private void BreakDynamicAttachment(float stepTime)
{
    if (actor.isLoaded)
    {
        var actorConstraints = actor.GetConstraintsByType(Oni.ConstraintType.Pin) as ObiConstraints<ObiPinConstraintsBatch>;
        var solverConstraints = actor.solver.GetConstraintsByType(Oni.ConstraintType.Pin) as ObiConstraints<ObiPinConstraintsBatch>;

        if (actorConstraints != null && adhesionBatch != null)
        {
            int batchIndex = actorConstraints.batches.IndexOf(adhesionBatch);
            if (batchIndex >= 0 && batchIndex < actor.solverBatchOffsets[(int)Oni.ConstraintType.Pin].Count)
            {
                int offset = actor.solverBatchOffsets[(int)Oni.ConstraintType.Pin][batchIndex];
                var solverBatch = solverConstraints.batches[batchIndex];

                float sqrTime = stepTime * stepTime;
                for (int i = 0; i < adhesionBatch.constraintCount; i++)
                {
                    // in case the constraint has been broken:

                    var b = -solverBatch.lambdas[(offset + i) * 4 + 3] / sqrTime;
                    if (b > adhesionBatch.breakThresholds[i])
                    {
                        var solverIndex = adhesionBatch.particleIndices[i];
                        if (!stuck.Remove(solverIndex))
                        {
                            Debug.Log("Error");
                        }
                        adhesionBatch.RemoveConstraint(i);
                    }
                }
            }

            UpdateAdhesion(); // This adds or removes the batch depending on whether there are any active constraints, and tells the solver to rebuild the pins
        }
    }
}

Print this item

  Save and restore the state of the rops in the scene.
Posted by: murathan - 15-08-2023, 05:56 PM - Forum: Obi Rope - Replies (1)

In the same scene, there are multiple Obi Ropes. After moving them differently within the game, is it possible to save their current positions to a text file or something similar, and then, at a different time, load them back to the same positions and shapes?

Print this item

  Problem with detecting collisions between different ropes
Posted by: murathan - 14-08-2023, 09:23 PM - Forum: Obi Rope - Replies (2)

I'm trying to detect collisions between multiple ropes with the code below. However, even if the colliding ropes are different, both pa.actor.gameObject and po.actor.gameObject point to the same object. Both bodyA and bodyB show the same rope. I want to detect different colliding ropes. I looked into the forum and believe that detection should be done with this method. However, I wonder if I'm making a mistake when creating the Rope or Solver.
solver.OnParticleCollision += Solver_OnCollision;

void Solver_OnCollision(object sender, Obi.ObiSolver.ObiCollisionEventArgs e)
{

foreach (Oni.Contact contact in e.contacts)
{
// this one is an actual collision:
if (contact.distance < 0.01)
{
ObiSolver.ParticleInActor pa = solver.particleToActor[solver.simplices[contact.bodyA]];
ObiSolver.ParticleInActor po = solver.particleToActor[solver.simplices[contact.bodyB]];
if (pa.actor.gameObject != po.actor.gameObject)
{
Debug.Log("rope collides: " + pa.actor.blueprint.name + " " + po.actor.blueprint.name, pa.actor.gameObject);
}
}

}
}

Print this item

  issues with blueprint generation
Posted by: bs-techart - 14-08-2023, 02:11 PM - Forum: Obi Softbody - Replies (1)

Hi,

I'm having issues with blueprint regeneration. I'm playing around with DeformationGradient sample. Whenever I change prism blueprint settings to generate a new one, the resulting Blueprint seems to make mesh wild in runtime. is there a fix for this, as I can't seem to find anything in documentation. Please check attachment.

Also, if I regenerate new blueprint with original prism blueprint settings, the resulting particle looks totally different. It almost looks like the values that were used to generate prism blueprint do not resemble the values that are shown on the asset. I have imported the package multiple times, just to revert back to original state. 

Thanks!

Print this item

  Beta invite
Posted by: 7Dev.io - 13-08-2023, 01:44 AM - Forum: General - No Replies

Are you guys still inviting for the betas? I sent an email a while ago with my invoices but never got a reply.

Print this item

  old version obiFluid for unity2018.1.9f2
Posted by: slimy - 09-08-2023, 06:38 PM - Forum: Obi Fluid - Replies (1)

I'm sorry I bought it without reading it carefully. However, I saw an old article saying that there is an older version that can be used in 2018. Is it still available? I am very interested.

Print this item

Pregunta Problem with rods in moving objects
Posted by: 1234567398 - 08-08-2023, 09:41 PM - Forum: Obi Rope - Replies (1)

Hi,
I've recently encountered a problem while working with Obi Rope rods. I created a rod with attachments on both ends, and everything seemed to be working fine. However, when the parent object containing this entire setup (the rod and both attachment transforms) started moving, the rod became very unstable and jagged, it was bouncing back and forth very quickly. This parent object was inside object with Obi Solver component, which was stationairy all the time, and this object was moving relatively to it. I've also checked and the same issue appears when a rope instead of rod was used.
Is there a way for a rod to somehow ignore the movement of parent objects and use local position for calculations, instead of world position? This would be really helpful, because I need to create many objects with rods, where the objects are moving, but the rods inside them are stationairy in relation to their parent.
Thank you for your help

Print this item