Search Forums

(Advanced Search)

Latest Threads
Stretching verts uniforml...
Forum: Obi Softbody
Last Post: Aroosh
Yesterday, 05:32 AM
» Replies: 0
» Views: 76
Scripting rod forces
Forum: Obi Rope
Last Post: chenji
11-09-2025, 01:15 PM
» Replies: 25
» Views: 2,785
Burst error causing crash...
Forum: Obi Rope
Last Post: josemendez
10-09-2025, 07:03 AM
» Replies: 1
» Views: 194
Controlling speed of emit...
Forum: Obi Fluid
Last Post: josemendez
06-09-2025, 06:29 AM
» Replies: 1
» Views: 446
Looks nice on editor but ...
Forum: Obi Fluid
Last Post: josemendez
04-09-2025, 07:20 AM
» Replies: 3
» Views: 696
How to Shorten or Scale t...
Forum: Obi Rope
Last Post: josemendez
02-09-2025, 09:53 AM
» Replies: 5
» Views: 785
The Limitation of Using O...
Forum: Obi Rope
Last Post: josemendez
01-09-2025, 10:30 PM
» Replies: 1
» Views: 523
Bug Where a Straight Segm...
Forum: Obi Rope
Last Post: josemendez
01-09-2025, 08:46 PM
» Replies: 1
» Views: 496
Having an issue with obi ...
Forum: Obi Rope
Last Post: Ben_bionic
29-08-2025, 04:23 PM
» Replies: 4
» Views: 994
Non-uniform particle dist...
Forum: Obi Rope
Last Post: chenji
29-08-2025, 09:05 AM
» Replies: 4
» Views: 841

 
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

Triste Obi fluid + Quest 2 | Rendering in editor but not when making a build
Posted by: alpaib - 10-05-2021, 03:08 PM - Forum: Obi Fluid - Replies (10)

Hello again,

I am still testing the asset with the Oculus Quest 2 and I got new mistakes that I am not able to fix.

First of all, I got it to render with Quest 2 using the Unity editor (with oculus link) and it works fine. I am using URP (7.5.3 version) and 2019.4.14f1 version of Unity. I am also using HPTK asset (https://github.com/jorgejgnz/HPTK) in the scene for making the interaction with objects and hand tracking easier and better.

So, as I said, I got it to work with he unity editor when using my Quest, but when I make a build and try it, some materials appear pink and the obi fluid isn't rendering.

I got three shader error on the console when making the build, and I think that maybe it is because of that. The shader and the error are:

Shader error in 'Obi/URP/Particles': failed to open source file: 'Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl' at Assets/Obi/Resources/ObiMaterials/URP/ObiLightingURP.cginc(4) (on d3d11)

Compiling Vertex program
Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_COLORSPACE_GAMMA UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR



Shader error in 'Obi/URP/Fluid/FluidShading': failed to open source file: 'Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl' at Assets/Obi/Resources/ObiMaterials/URP/ObiLightingURP.cginc(4) (on d3d11)

Compiling Vertex program
Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_COLORSPACE_GAMMA UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR


Shader error in 'Hidden/ScreenSpaceCurvatureFlow': undeclared identifier 'sampler_MainTex' at line 57 (on d3d11)

Compiling Vertex program with STEREO_INSTANCING_ON
Platform defines: UNITY_NO_DXT5nm UNITY_ENABLE_REFLECTION_BUFFERS UNITY_NO_CUBEMAP_ARRAY UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 SHADER_API_DESKTOP UNITY_COLORSPACE_GAMMA UNITY_LIGHTMAP_DLDR_ENCODING

Print this item