Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Obi 7.0 ParticleAPI
#6
(10-06-2025, 06:23 AM)josemendez Wrote: Hi!

The only situation in which the content of renderablePositions and positions arrays will differ is when your ObiSolver component has interpolation/extrapolation enabled, and no physics update has taken place in the current frame. As explained in the manual:


This behavior is the same as Unity's transform.position (which is the GameObject equivalent to renderablePosition) and rigidbody.position (which is the GameObject equivalent to Obi's position).

Now, if the position returned is the same for all particles, that either means you're calling this code from the wrong place, or there's some other issue causing this. Would help us to know the context in which this code is being used.

kind regards,
Hello,
thank you for the answer. I want to correct myself, i don'g get the same position for all the partciles, but each particle keeps the same position as output. so if particle 1 is in 0,0,0 and 2 is in 0,0,1 they keep otuputting this for all the game duration.

tha context is that in the Update() i am calling a method that checks if any of the particle positions falls in a certain area
 
 bool IsRopeInsideCrossArea()
    {
        bool inBound = false;
        if (rope.isLoaded)
        {
            for (int i = 0; i < rope.solverIndices.count; ++i)
            {
                int solverIndex = rope.solverIndices[i];
                Vector3 particlePos = rope.solver.positions[solverIndex]; // GetParticlePosition(solverIndex);
                Debug.Log($"particle {solverIndex} position {particlePos}");
           
                if (crossArea.bounds.Contains(particlePos))
                {
                        inBound = true;
                }
                else
                {
                    inBound = false;
                }
            }
           
        }
        return inBound;
    }

and this is always false, even when visually i can see it happens. Morevoer, I used the same code structure that i used to check if the particle were near enoguh to a grasping point to be grasped. and i don't understand why in that case the output was right while now it isn't. I am sure I am missing something but I can't wrap my head around it.
Reply


Messages In This Thread
Obi 7.0 ParticleAPI - by PlatonSk - 29-08-2024, 11:37 AM
RE: Obi 7.0 ParticleAPI - by goosejordan - 29-08-2024, 12:01 PM
RE: Obi 7.0 ParticleAPI - by josemendez - 29-08-2024, 12:02 PM
RE: Obi 7.0 ParticleAPI - by alicecatalano - 09-06-2025, 04:33 PM
RE: Obi 7.0 ParticleAPI - by josemendez - 10-06-2025, 06:23 AM
RE: Obi 7.0 ParticleAPI - by alicecatalano - 10-06-2025, 08:31 AM
RE: Obi 7.0 ParticleAPI - by josemendez - 10-06-2025, 08:47 AM
RE: Obi 7.0 ParticleAPI - by chenji - 10-06-2025, 09:40 AM
RE: Obi 7.0 ParticleAPI - by josemendez - 10-06-2025, 10:16 AM
RE: Obi 7.0 ParticleAPI - by alicecatalano - 10-06-2025, 10:18 AM
RE: Obi 7.0 ParticleAPI - by josemendez - 10-06-2025, 10:26 AM
RE: Obi 7.0 ParticleAPI - by alicecatalano - 12-06-2025, 09:19 AM
RE: Obi 7.0 ParticleAPI - by josemendez - 10-06-2025, 10:21 AM