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
|
|
|
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));
}
|
|
|
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é
|
|
|
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.
|
|
|
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:
- On a fresh unity start after closing it down completely, I run the scene.
- Initially everything works correctly.
- 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.
- 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.
- 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.
- 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.
- 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.
- Removing the ObiRigidbody (and ObiCollider) components prevents this.
- 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.
|
|
|
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!
|
|
|
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? 
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);
}
}
}
}
|
|
|
|