Latest Threads |
Collisions do not happens...
Forum: Obi Rope
Last Post: josemendez
Yesterday, 06:50 AM
» Replies: 1
» Views: 105
|
Unstable chain attachment
Forum: Obi Rope
Last Post: quent_1982
17-05-2025, 10:31 AM
» Replies: 13
» Views: 595
|
Memory leak warning with ...
Forum: Obi Fluid
Last Post: josemendez
16-05-2025, 02:07 PM
» Replies: 4
» Views: 479
|
the Obi cloth has some co...
Forum: Obi Cloth
Last Post: MakeLifeEasier
16-05-2025, 08:59 AM
» Replies: 3
» Views: 280
|
ObiCloth going through co...
Forum: Obi Cloth
Last Post: josemendez
16-05-2025, 08:10 AM
» Replies: 1
» Views: 117
|
Why does setting InverseM...
Forum: Obi Fluid
Last Post: nonnamed
13-05-2025, 12:41 PM
» Replies: 8
» Views: 11,846
|
Shaking problem when coll...
Forum: Obi Softbody
Last Post: webmagic
13-05-2025, 12:11 PM
» Replies: 6
» Views: 398
|
Obi Softbody IndexOutOfRa...
Forum: Obi Softbody
Last Post: Aroosh
11-05-2025, 11:37 AM
» Replies: 2
» Views: 244
|
Rope pinned to two dynami...
Forum: Obi Rope
Last Post: Crimson1462
09-05-2025, 07:51 PM
» Replies: 2
» Views: 333
|
Unity 6 Console Spam abou...
Forum: Obi Fluid
Last Post: josemendez
09-05-2025, 08:03 AM
» Replies: 3
» Views: 1,252
|
|
|
Cloth/solver is running faster then intended |
Posted by: drorlazar - 12-03-2019, 01:28 PM - Forum: Obi Cloth
- Replies (1)
|
 |
Hi
I've assigned obi cloth to both pants and shirt of my character, once i've add the 2nd cloth the solver is running too fast (twice as fast as it intended).
i've tried assigning each to a seperate solver, but this cancel one of the cloths (pants, that was created 1st)
any ideas?
|
|
|
How to fasten trousers |
Posted by: Richard - 09-03-2019, 11:33 PM - Forum: Obi Cloth
- No Replies
|
 |
Hello.
I would like to fasten trousers to fit human body. I thought using direction vector. Is there another better way?
|
|
|
How to destroy particle from it's position |
Posted by: anonymous - 09-03-2019, 03:48 PM - Forum: Obi Fluid
- Replies (3)
|
 |
Hi.
I need particles to be killed once they are below a given position.y
In my situation, the particles should live as long as they don't fall below some position. Once enough are killed, new ones would be emitted.
Here's my code for now but something is not right. It finds the particle pos but the kill part does not seem to work because my active particle number (in the emitter inspector) stays the same when running. If possible, I would like also something less demanding than having to regularly loop through the array to do the pos check.
Code: IEnumerator PurgeParticlesTooLow()
{
while(true)
{
yield return new WaitForSeconds(5);
Vector4 v4;
for (int i = 0; i < obiSolver.positions.Length; ++i)
{
v4 = obiSolver.positions[i];
print("pos particle: " + v4);
if (v4.y <= GlobalVars.cstBallBreakPointY)
{
obiEmitter.life[obiSolver.particleToActor[i].indexInActor] = 0;
print("killed particle at pos: " + v4);
}
}
}
}
|
|
|
Flickering - solvers effect each other |
Posted by: shayk - 09-03-2019, 11:11 AM - Forum: Obi Fluid
- Replies (2)
|
 |
Hi All,
First of all - I have to say that i really like this product, simulations are very realistic, fast, configurable - well done! (documentation could be improved
using unity 2018.2.1f1
using Obi 4.0.2
My real scene is a little complex with many moving solvers/emitters, so I built a simple demo scene to demonstrate the problem.
In general: fluid stream collide with a sphere, collided particles are being killed, and for every killed particle a new particle is emitted from a local emitter on the sphere
The demo scene includes the following GameObjects/Components:
1)MainSolver - Empty with a solver (global space) and a script MainCollisionDetection(described bellow)
(solver constraints copied from Obi sample scene "FluidViscosity")
2)MainEmitter - Empty with an ObiEmitter (that uses MainSolver as its solver) and particle renderer
emitter properties: speed: 5, emitter material: Honey, collision material :very sticky
3)Sphere - unity sphere with ObiCollider ,RB, and ObiRB
a)SphereSolver - child of Sphere - Empty with a solver (local space)
(solver constraints copied from Obi sample scene "FluidViscosity")
1. SphereEmitter - child of SphereSolver - empty with an ObiEmitter (that uses SphereSolver as its solver) and particle renderer
emitter properties: speed: controlled by script SphereEmitionControl (described bellow), emitter material: Honey, collision material :very sticky
4)MainCollisionDetection script detects collisions (on MainSolver), kills the hitting particle, and adds the particle collision data to a queue in the SphereEmitionControl script
Code: using System.Collections.Generic;
using UnityEngine;
using Obi;
public class MainCollisionDetection : MonoBehaviour {
public ObiEmitter mainEmitter;
ObiSolver solver;
Obi.ObiSolver.ObiCollisionEventArgs frame;
List<int> allreadyEmittedParticles;
void Awake()
{
solver = GetComponent<Obi.ObiSolver>();
}
void OnEnable()
{
solver.OnCollision += Solver_OnCollision;
}
void OnDisable()
{
solver.OnCollision -= Solver_OnCollision;
}
void Solver_OnCollision(object sender, Obi.ObiSolver.ObiCollisionEventArgs e)
{
frame = e;
if (solver == null || frame == null || frame.contacts == null) return;
allreadyEmittedParticles = new List<int>();
int closeContacts = 0;
for (int i = 0; i < frame.contacts.Count; ++i)
{
if (frame.contacts[i].distance < 0.001f)
{
Component contactColl;
ObiCollider.idToCollider.TryGetValue(frame.contacts[i].other, out contactColl);
if (contactColl != null)
{
ObiSolver.ParticleInActor pa = solver.particleToActor[frame.contacts[i].particle];
ObiEmitter emtr = pa.actor as ObiEmitter;
int particleIndexInEmitter = pa.indexInActor;
if (!allreadyEmittedParticles.Contains(particleIndexInEmitter))
{
allreadyEmittedParticles.Add(particleIndexInEmitter);
closeContacts++;
Vector3 point = frame.contacts[i].point;
Vector3 normal = frame.contacts[i].normal;
//kill hit particle in the main emitter
emtr.life[particleIndexInEmitter] = 0;
//look for the hitted collider emitter
ObiEmitter colliderEmitter = contactColl.GetComponentInChildren<ObiEmitter>();
if (colliderEmitter != null)
{
SphereEmitionControl sphereEmitionControl = colliderEmitter.GetComponent<SphereEmitionControl>();
//add particle to collider emitter queue
sphereEmitionControl.AddParticleToEmit(point, Quaternion.Euler(normal));
}
}
}
}
}
}
}
5)SphereEmitionControl script has a queue of particles positions/normals, it is filled only by data from MainCollisionDetection script. The script repeatedly checks if the queue is not empty, it dequeues the data, move its transform to the stored position/normal and emit for a short while (i didn't know how to emit one particle so i timed the emittion with a coroutine)
Code: using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Obi;
public class ParticleToEmit
{
public Vector3 pos;
public Quaternion localRot;
}
public class SphereEmitionControl : MonoBehaviour {
ObiEmitter m_emitter;
bool emitting;
Queue<ParticleToEmit> particlesToEmit;
void Start()
{
m_emitter = GetComponent<ObiEmitter>();
m_emitter.speed = 0f;
particlesToEmit = new Queue<ParticleToEmit>();
}
void LateUpdate()
{
if (particlesToEmit.Count > 0 && !emitting)
{
ParticleToEmit par = particlesToEmit.Dequeue();
transform.position = par.pos;
transform.localRotation = par.localRot;
StartCoroutine(ColliderEmitterEmit());
}
}
//add a particle data to queue
public void AddParticleToEmit(Vector3 pos, Quaternion localRot)
{
ParticleToEmit newParticle = new ParticleToEmit();
newParticle.pos = pos;
newParticle.localRot = localRot;
particlesToEmit.Enqueue(newParticle);
}
//emit particle
public IEnumerator ColliderEmitterEmit()
{
emitting = true;
m_emitter.speed = 1f;
m_emitter.EmitParticle(0);
yield return null;
m_emitter.speed = 0f;
emitting = false;
}
}
Regarding the collisions the scripts run OK , the problem is : the particles (emitted from SphereEmitter) are flickering.
I did some testing and found that:
case a: while running - if i disable the MainSolver (in the editor) the flickering stops (strange, it should not effect the scene because the particles belong to the SphereSolver)
case b: while running - if the MainSolver is enabled, and i disable and than enable the SphereSolver - flickering stops, and everything works well as expected, but now if i disable and than enable the MainSolver, flickering starts again
why does the flickering happen?
how to prevent it?
thanks,
shayk
|
|
|
liboni can't be found in linux editor [solved] |
Posted by: captainboothat - 09-03-2019, 02:37 AM - Forum: Obi Rope
- No Replies
|
 |
I'm using the linux version of unity and it keeps having problems finding liboni. The .dll and .so are in obi->plugins->x86_64
[Solved]
Seems unity is expecting to find this lib in /home/$user/Unity/Hub/Editor/2018.3.5f1/Editor/Data/Mono/lib/. Once liboni.so was placed in there it stopped complaining and obi now works. You'll also have to remove obi/plugin/x86_64/liboni.so or it bitches there's two versions of the lib. Not sure yet if this effects building the game or not.
Plopping this thread so future users can find it.
|
|
|
Extending rope in a particular way |
Posted by: TaliaKuznetsova - 07-03-2019, 06:22 PM - Forum: Obi Rope
- No Replies
|
 |
Ao I recently got obi-rope and so far like what I see but I'm not sure how to use it for what I want. One vehicle is going to have a winch and i need to have it so the player can pull the cable out via hook and carry it with them with the cable extending as they pull out and not auto feed out. My first plan was to physically wrap the cable around the drum like real life and set motor to free spool so when the player tugs the rope it unspools but that seems intensive unless obi rope can handle that no problem.
My second solution was to attach the rope to the end of the winch body and have it extend when it's being tugged on and the player has the hook in their hand.
Any ideas on the matter? The first option would be ideal as maximum realism is my goal if there is a good way to do that without high cpu useage.
|
|
|
|