Search Forums

(Advanced Search)

Latest Threads
can you remove particles ...
Forum: Obi Softbody
Last Post: aardworm
09-07-2025, 07:09 AM
» Replies: 0
» Views: 31
ObiRope Mesh Renderer
Forum: Obi Rope
Last Post: quent_1982
08-07-2025, 11:27 AM
» Replies: 4
» Views: 156
How to dynamically change...
Forum: Obi Rope
Last Post: quent_1982
08-07-2025, 06:34 AM
» Replies: 6
» Views: 304
Pipeline that bends
Forum: Obi Softbody
Last Post: josemendez
04-07-2025, 09:52 AM
» Replies: 13
» Views: 1,034
How to implement/sync Obi...
Forum: Obi Rope
Last Post: quent_1982
01-07-2025, 01:48 PM
» Replies: 2
» Views: 250
Collisions don't work con...
Forum: Obi Rope
Last Post: chenji
27-06-2025, 03:05 AM
» Replies: 3
» Views: 332
Force Zone apply differen...
Forum: Obi Rope
Last Post: chenji
26-06-2025, 11:41 AM
» Replies: 11
» Views: 957
Can I blend in and out of...
Forum: Obi Cloth
Last Post: josemendez
24-06-2025, 04:42 PM
» Replies: 3
» Views: 311
Using a rigidbody/collide...
Forum: Obi Cloth
Last Post: josemendez
24-06-2025, 09:29 AM
» Replies: 1
» Views: 187
Solver is too performance...
Forum: Obi Rope
Last Post: quent_1982
20-06-2025, 08:09 AM
» Replies: 40
» Views: 4,821

 
  Deactivating the obi solver when not needed ?
Posted by: VincentAbert - 13-05-2021, 01:07 PM - Forum: Obi Rope - Replies (12)

Hello,

Let's say I have a level which only features ropes in one or two rooms. Trying to mitigate all my performance overhead, I would like to disable simulation when not needed, what is the best way to do that ?
I tried disabling the updater and solver, and activating them when the player enters a trigger, but it causes a lag spike, probably because of some initialization. What would be the best way to go about this ?

Thank you,

Vincent.

Print this item

Triste Get current batch index and a constraint index in oby tear cloth
Posted by: DenisBlack - 12-05-2021, 04:39 PM - Forum: Obi Cloth - Replies (1)

Hi, mb anybody can help me.
I try to make tearing cloth by some collision (like scissors).

I get Particle id from collision detect : 900 id; But dont understand how to correctly get current batch and constaint index.
In ObiTearableCloth.cs i saw ApplyTearing method with calculate by force and get some code from there.

Code:
  List<StructuralConstraint> tornEdges = new List<StructuralConstraint>();
            var distanceConstraints = Cloth.GetConstraintsByType(Oni.ConstraintType.Distance) as ObiConstraints<ObiDistanceConstraintsBatch>;
            var solverConstraints = Solver.GetConstraintsByType(Oni.ConstraintType.Distance) as ObiConstraints<ObiDistanceConstraintsBatch>;
       
            if (distanceConstraints != null && solverConstraints != null)
            {
                Debug.LogError("distanceConstraints.batches.Count "+ distanceConstraints.batches.Count());
               
                for (int j = 0; j < distanceConstraints.batches.Count; ++j)
                {
                    var batch = distanceConstraints.batches[j] as ObiDistanceConstraintsBatch;
                    var solverBatch = solverConstraints.batches[j] as ObiDistanceConstraintsBatch;
                   
                    Debug.LogError("batch.activeConstraintCount "+ batch.activeConstraintCount.ToString());
                   
                    for (int i = 0; i < batch.activeConstraintCount; i++)
                    {
                     
                    }
                   
                   
                }
            }

How to i can iterating check current active constreint wich collect my particle id?


UPD:
Ok, next time first need to write on note my task - that help to collect thoughts ))

Code:
for (int i = 0; i < batch.activeConstraintCount; i++)
                {
                    if(batch.GetParticleIndices(i).first.Equals(particleIndex) || batch.GetParticleIndices(i).second.Equals(particleIndex))
                        tornEdges.Add(new StructuralConstraint(batch, i, 0));
                }

Print this item

  Mobile performance
Posted by: DryGinStudios - 12-05-2021, 04:05 PM - Forum: Obi Fluid - Replies (18)

So... created a new project, 2020.3.7f1 in URP. Added the obi fluid and tested on android the SimpleFluid scene. I got a galaxy s20 (very performant) and I had 15 fps. I added all the latest burst, job, mathematic.

I get to 30 fps when reducing the max dpi of the screen to 300.

I've built multiple games for android with physics (Dots Physics too) and I've never seen such bad performance so I'm sure something is wrong.

I read that the SimpleFluid was mobile optimized so how come I have 15 fps out of the box on one of the best cellphones on the market.

Is it normal? Is there something I don't understand?

Regards,

Paul-André

Print this item

  2 way Particle Attachments
Posted by: tpaslou - 12-05-2021, 02:53 PM - Forum: Obi Rope - Replies (2)

Hi

I want to achieve something similar to the chain example. 

I have created a small rope with 2 particle attachments. The one is static ,  and the other one is dynamic. The dynamic attachment is the red ball bellow which has a rigidbody. When I run it , the problem is that the ball with the rope doesn't follow the rest of the gameobject and the length of the rope extends.

       

Print this item

  Can't seem to make rope collide with Mesh Collider
Posted by: edenalon - 12-05-2021, 12:17 PM - Forum: Obi Rope - Replies (1)

Hello!
I'm browsing the docs and I must get something wrong while implementing collision of ObiRope.
What are the correct ways to do so?
I manage to get it working with box colliders. I want it to collide with a mesh collider that isn't convex. is it possible?
thanks for the help,
Eden.

Print this item

  move the ring along the rope
Posted by: xkalibrx - 12-05-2021, 05:40 AM - Forum: Obi Rope - Replies (1)

Please help to determine the rotation of the ring, which is worn on the rope, based on the current point. I want to make sure that when you put the ring on the rope, it smoothly slides along it. A simple physical ring often gets stuck because the rope is constantly in motion.

I want to try setting the exact Z rotation of the ring at its current location so that it just glides along the rope to give it strength.



Attached Files Thumbnail(s)
   
Print this item

Bug Obi Solvers are adding HUGE forces to rigidbodies in scenes without any ropes!
Posted by: Hatchling - 12-05-2021, 02:05 AM - Forum: Obi Rope - Replies (9)

I've encountered a consistently reproducible bug that is so critical it renders ObiRope virtually unusable.

I have a scene:

  • A scene with spherical rigidbodies with X, Y and Z rotations locked (which produces an inertia tensor of 0 along locked axes.)
  • The spherical rigidbodies are manipulated via script.
  • The spherical rigidbodies have an ObiRigidbody and ObiCollider attached initially.
  • Initially, no ropes, cloth, or any other Obi objects (aside from the aforementioned) are present in the scene.

Reproduction:
  1. On a fresh unity start after closing it down completely, I run the scene.
  2. Initially everything works correctly.
  3. So long as I do not place a rope in the scene, I can stop and play the scene as many times as I like.
  4. I place the rope in the scene - which I do while playing; it isn't initially in the scene - it works correctly at first. I use a script to attach a rope to two surfaces selected by the player. Also worth nothing that no ObiSolvers are present in the scene until a rope is added.
  5. Then after stopping and starting a new play session - WITHOUT placing any ropes in the new play session - the spherical rigidbodies are given such extreme forces that they are often sent straight into NaN-land. It doesn't appear to matter where the ropes are attached in the previous session.
  6. Running a debugger and inspecting the values provided to ObiRigidbody.UpdateVelocities, they are often insane values with a magnitude greater than 1.0e+20, if not outright NaN.
  7. Even if I add a condition that the provided velocities are only added if their magnitudes are < 1000, the sphere rigidbodies will be accelerated with a huge amount of force along either the X, Y or Z axis in either direction.
  8. Removing the ObiRigidbody (and ObiCollider) components prevents this.
  9. The only way to bring ObiRigidbody into a usable state is to re-start the editor.
I previously had 5.1 installed, and immediately after upgrading the bug started to occur.

Print this item

Triste Obi Rope - cannot download version with surface-based collisions
Posted by: Hatchling - 11-05-2021, 03:56 AM - Forum: Obi Rope - Replies (2)

I've been trying to upgrade Obi Rope to the latest version so I can use surface-based collisions, as advertised in the documentation: http://obi.virtualmethodstudio.com/tutor...sions.html

In the Unity package manager, it shows that the version I have currently downloaded is 6.0.1.

However:

  1. None of the ropes in the sample scenes included contain the ability to use surface-based collisions.
  2. A text search for "surface" through the entire asset after importing it into an empty project contained nothing notable relating to the new feature.
  3. The changelog only contains "[5.1]" as the latest version.
I would like to install the latest version but it appears that it hasn't actually been released yet.

Any help would be appreciated,
-Steve

Print this item

  Cant change rope position on instantiate
Posted by: boulder - 11-05-2021, 01:48 AM - Forum: Obi Rope - Replies (2)

Hi,
I instantiate ropes in game but can't change position of them on instantiate and they appear on where they are supposed to be and then stuck. I change start and end particle attachment positions plus rope transform position
I am using the code below

Code:
    Rope newRope = Instantiate(ropeSet.ropeObject, ropeSet.transform);
    newRope.transform.position = newRopePoint.transform.position;
    newRope.ropeStartPoint.SetParent(transform);
    newRope.ropeEndPoint.SetParent(newRopePoint.transform);
    newRope.ropeStartPoint.localPosition = Vector3.zero;
    newRope.ropeEndPoint.localPosition = Vector3.zero;

Here is a video : Video
Can anyone show me the direction where I do the mistake?
Thanks!

Print this item

  Collision works buggy
Posted by: boulder - 11-05-2021, 01:33 AM - Forum: Obi Rope - Replies (3)

Hi,
I have some problems with collisions. I am using the code below for each collision to get the touching each other rope but it gives wrong/inconsistent data.
Here each rope touching each other should be having darker tone. I tried different settings and it did not change. Ropes are in the same z-axis and they definitely touch as I checked from different angles. Surface collision is open, all works as expected, I am using the latest 6.0.1 version.
Here is a video : Video
Do anyone having the same issue who can help me?  Ángel
Thanks!

Code:
using UnityEngine;
using Obi;

public class RopeCollision : MonoBehaviour
{

    ObiSolver solver;

    void Start()
    {
        solver = GetComponent<ObiSolver>();
        solver.OnParticleCollision += Solver_OnCollision;
    }

    void OnDisable()
    {
        solver.OnParticleCollision -= Solver_OnCollision;
    }

    void Solver_OnCollision(object sender, ObiSolver.ObiCollisionEventArgs e)
    {
        var world = ObiColliderWorld.GetInstance();

        foreach (Oni.Contact contact in e.contacts)
        {
            var pa = solver.particleToActor[contact.bodyA];
            var po = solver.particleToActor[contact.bodyB];
            if (pa == null || po == null)
                return;
            if (pa.actor.gameObject.name != po.actor.gameObject.name)
            {
                //print(pa.actor.gameObject+" , "+ po.actor.gameObject);
                GameManager.Instance.Colliding(pa.actor.gameObject, po.actor.gameObject);
            }
        }
       
    }

}

Print this item