Latest Threads |
Stretching verts uniforml...
Forum: Obi Softbody
Last Post: Aroosh
Yesterday, 05:32 AM
» Replies: 0
» Views: 68
|
Scripting rod forces
Forum: Obi Rope
Last Post: chenji
11-09-2025, 01:15 PM
» Replies: 25
» Views: 2,767
|
Burst error causing crash...
Forum: Obi Rope
Last Post: josemendez
10-09-2025, 07:03 AM
» Replies: 1
» Views: 185
|
Controlling speed of emit...
Forum: Obi Fluid
Last Post: josemendez
06-09-2025, 06:29 AM
» Replies: 1
» Views: 436
|
Looks nice on editor but ...
Forum: Obi Fluid
Last Post: josemendez
04-09-2025, 07:20 AM
» Replies: 3
» Views: 688
|
How to Shorten or Scale t...
Forum: Obi Rope
Last Post: josemendez
02-09-2025, 09:53 AM
» Replies: 5
» Views: 777
|
The Limitation of Using O...
Forum: Obi Rope
Last Post: josemendez
01-09-2025, 10:30 PM
» Replies: 1
» Views: 518
|
Bug Where a Straight Segm...
Forum: Obi Rope
Last Post: josemendez
01-09-2025, 08:46 PM
» Replies: 1
» Views: 491
|
Having an issue with obi ...
Forum: Obi Rope
Last Post: Ben_bionic
29-08-2025, 04:23 PM
» Replies: 4
» Views: 986
|
Non-uniform particle dist...
Forum: Obi Rope
Last Post: chenji
29-08-2025, 09:05 AM
» Replies: 4
» Views: 834
|
|
|
Creating rope between two points at Runtime |
Posted by: greenisfun100 - 17-06-2021, 03:41 PM - Forum: Obi Rope
- Replies (3)
|
 |
Hello, I've been working on a bridge-building project similar to Polybridge. I stumbled upon your asset when I wanted to figure out how to implement cables for the bridges. This means they need to be created in runtime with a custom length and span between two given points.
I have been able to create particle attachments, I've made sure the connected objects have obiColliders and rigidBodies on them but my main problem is getting the ropes to visually span the distance between the points. I don't know if it's a obiRopeCursor problem where I just need to adjust the length, or if I need to insert control points into the rope's path.
Here's my code for instantiating the rope and creating the attachment points. GameManager.AllConnections is a dictionary that takes a Vector3 as a key with an object as the value.
Code: ObiRope newRope = Instantiate(lightCablePrefab, (StartPosition + EndPosition) / 2, Quaternion.FromToRotation(new Vector3(1, 0, 0), EndPosition - StartPosition)).GetComponent<ObiRope>();
ObiParticleAttachment attachment1 = newRope.gameObject.AddComponent(typeof(ObiParticleAttachment)) as ObiParticleAttachment;
ObiParticleAttachment attachment2 = newRope.gameObject.AddComponent(typeof(Obi.ObiParticleAttachment)) as ObiParticleAttachment;
newRope.path.InsertControlPoint(newRope.path.ControlPointCount - 1, StartPosition, (StartPosition - EndPosition).normalized, (EndPosition - StartPosition).normalized, Vector3.up, 0.1f, 0.1f, 0.2f, 0, Color.red, "New Start");
newRope.path.InsertControlPoint(newRope.path.ControlPointCount - 1, EndPosition, (EndPosition - StartPosition).normalized, (StartPosition - EndPosition).normalized, Vector3.up, 0.1f, 0.1f, 0.2f, 0, Color.red, "New End");
attachment1.target = GameManager.AllConnections[StartPosition].transform;
attachment1.attachmentType = Obi.ObiParticleAttachment.AttachmentType.Dynamic;
attachment1.particleGroup = newRope.blueprint.groups[1];
attachment2.target = GameManager.AllConnections[EndPosition].transform;
attachment2.attachmentType = Obi.ObiParticleAttachment.AttachmentType.Dynamic;
attachment2.particleGroup = newRope.blueprint.groups[2];
ObiRopeCursor cursor = newRope.GetComponent<ObiRopeCursor>();
cursor.ChangeLength(Vector3.Magnitude(StartPosition - EndPosition));
newRope.transform.parent = StaticVars.vars.ObiSolver;
And here is a video of what it looks like in-game: Video
|
|
|
Obi 6.2 is live |
Posted by: josemendez - 17-06-2021, 09:01 AM - Forum: Announcements
- Replies (4)
|
 |
Hi all,
Obi 6.2: Cloth, Rope, Fluid and Softbody are now available in the Asset Store. There's two big changes in 6.2:
1) The collision filtering system has been completely revamped. Phases are no longer used. Categories and Masks have replaced them, allowing you to specify much more complex behavior that was not possible before. This is the same system used by lots other engines (Box2D, Unity Physics, Bullet, etc) so it should be familiar to many of you. See the manual page on collisions for details:
http://obi.virtualmethodstudio.com/manua...#filtering
A word of warning: if you're updating from older versions, you will most likely have to re-setup your collision filtering. This means you'll have to specify categories and masks for your actors/colliders.
2) A new spatial queries API has been added. This lets you perform fully parallel & efficient overlap, distance and raycast tests against solvers. See:
http://obi.virtualmethodstudio.com/manua...eries.html
A video I recorded while developing this feature:
I've also refactored the manual and included a version dropdown in every page. This lets you select a different version for the current manual page, moving horizontally across versions just like Unity's own online documentation.
Also, wanted to thank fellow Obi user and forum member Hatchling for his valuable input on both collision filtering and the queries API.
As always, any feedback is most welcome. Hope you find 6.2 useful.
kind regards,
|
|
|
Screen Resolution |
Posted by: ReaperQc - 12-06-2021, 05:10 PM - Forum: Obi Softbody
- Replies (3)
|
 |
It may be a weird question but, has anybody ever have a problem with the forces applied to a soft body that end up being different in different resolution?
in free aspect, the behaviour is just as i want it, but after trying to create a build, i realise that only my softbody act differently,
in 1920x1080, the force is already less and so forth until in 4k, the force is so small, it doen't jump off the ground at all
|
|
|
ParticleAttachment freezes softbody |
Posted by: Smrdis - 11-06-2021, 01:59 PM - Forum: Obi Softbody
- Replies (5)
|
 |
Hey,
Seems like ParticleAttachment not working in some cases. It depends on the mesh from which we are generating blueprint. Some softbodies works well, but other just freezes. The softbody does not respond to PaticleAttachment target object movement. If we remove ParticleAttachment component softbody starts to work as usual.
Update: I added particle renderer and seems like the problem is due to the fact that the mesh is simply not drawn.
|
|
|
How to attach a GameObject to a rope from script? |
Posted by: wakin001 - 08-06-2021, 03:56 PM - Forum: Obi Rope
- Replies (9)
|
 |
Hi,
There is a rope and some objects in a table. I drag the rope and move, when the rope collide with an object, the object should be attached to the rope.
How should I implement this?
My idea is in the collision event of the rope and objects, I create a ControlPoint in the path of the rope, and a ObiParticleAttachment, and set the control point to the ObiParticleAttachment.
Code: particlePos = solver.particleToActor[contact.bodyA].actor.transform.position;
int particleIndex = blueprint.path.ControlPointCount;
Vector3 localHit = rope.transform.InverseTransformPoint(particlePos);
blueprint.path.AddControlPoint(localHit, -localHit.normalized, localHit.normalized, Vector3.up, 0.1f, 0.1f, 1, 1, Color.white, "Control point");
blueprint.path.FlushEvents();
yield return blueprint.Generate();
Code: ObiParticleAttachment attachment = rope.gameObject.AddComponent<ObiParticleAttachment>();
attachment.target = targetGrain;
attachment.particleGroup = blueprint.groups[particleIndex];
attachment.attachmentType = ObiParticleAttachment.AttachmentType.Dynamic;
attachment.compliance = 0;
But there are something wrong:
1. particlePos is the position of the rope not the collided point.
2. Got error "The particle group 'Control point' references a particle that does not exist in the actor 'Obi Rope'."
How do I implement this functionality?
Thanks in advance.
|
|
|
Spawning Particles on cloth sim |
Posted by: reuko - 08-06-2021, 02:53 PM - Forum: Obi Cloth
- Replies (6)
|
 |
Hello!
I'm trying to see if it's possible to spawn particles (shuriken or vfx graph) on the surface/verts of an active simulating obi cloth/skinned cloth object. The reason for this is to have a lingering dust cloud/particle trail from the movement of the cloth sim. I'm able to get the particles to spawn in editor, but when entering play mode they disappear. Is there a way to do this with any particle system setup in unity + obicloth?
Thanks for your time!
|
|
|
On trigger |
Posted by: ReaperQc - 05-06-2021, 04:36 PM - Forum: Obi Softbody
- Replies (1)
|
 |
Hi, I am trying to activate some effect with OntriggerEnter for exemple, but i can't seem to find how to let my trigger know my actor entered in the space of the trigger.
|
|
|
Burst*Batch job optimisations |
Posted by: ThoughtMango - 04-06-2021, 04:09 PM - Forum: Obi Cloth
- Replies (4)
|
 |
Hello,
I think I found a 2nd potential perf boost for the Burst backend, mearused using a profiler sample BurstConstraintsImpl.Project() call like so:
Code: public JobHandle Project(JobHandle inputDeps, float deltaTime)
{
UnityEngine.Profiling.Profiler.BeginSample("Project");
var parameters = m_Solver.abstraction.GetConstraintParameters(m_ConstraintType);
switch(parameters.evaluationOrder)
{
case Oni.ConstraintParameters.EvaluationOrder.Sequential:
inputDeps = EvaluateSequential(inputDeps, deltaTime);
break;
case Oni.ConstraintParameters.EvaluationOrder.Parallel:
inputDeps = EvaluateParallel(inputDeps, deltaTime);
break;
}
UnityEngine.Profiling.Profiler.EndSample();
return inputDeps;
}
I've replaced BurstDistanceConstraintsBatch's job generation code to:
Code: public void SetDistanceConstraints(ObiNativeIntList particleIndices, ObiNativeFloatList restLengths, ObiNativeVector2List stiffnesses, ObiNativeFloatList lambdas, int count)
{
this.particleIndices = particleIndices.AsNativeArray<int>();
this.restLengths = restLengths.AsNativeArray<float>();
this.stiffnesses = stiffnesses.AsNativeArray<float2>();
this.lambdas = lambdas.AsNativeArray<float>();
projectConstraints.particleIndices = this.particleIndices;
projectConstraints.restLengths = this.restLengths;
projectConstraints.stiffnesses = this.stiffnesses;
projectConstraints.lambdas = this.lambdas;
applyConstraints.particleIndices = this.particleIndices;
}
DistanceConstraintsBatchJob projectConstraints = new DistanceConstraintsBatchJob();
public override JobHandle Evaluate(JobHandle inputDeps, float deltaTime)
{
projectConstraints.positions = solverImplementation.positions;
projectConstraints.invMasses = solverImplementation.invMasses;
projectConstraints.deltas = solverImplementation.positionDeltas;
projectConstraints.counts = solverImplementation.positionConstraintCounts;
projectConstraints.deltaTime = deltaTime;
return projectConstraints.Schedule(m_ActiveConstraintCount, 32, inputDeps);
}
ApplyDistanceConstraintsBatchJob applyConstraints = new ApplyDistanceConstraintsBatchJob();
public override JobHandle Apply(JobHandle inputDeps, float deltaTime)
{
var parameters = solverAbstraction.GetConstraintParameters(m_ConstraintType);
applyConstraints.positions = solverImplementation.positions;
applyConstraints.deltas = solverImplementation.positionDeltas;
applyConstraints.counts = solverImplementation.positionConstraintCounts;
applyConstraints.sorFactor = parameters.SORFactor;
return applyConstraints.Schedule(m_ActiveConstraintCount, 64, inputDeps);
}
which returned the following result (Ignore total time, the number of simulations in each case is randomised in my test scene, simulation type is one of 2 types in each case, the 0.05ms/cloth is consistent across multiple tests)
![[Image: project-cost.png]](https://i.ibb.co/xLXHX9x/project-cost.png)
EDIT:
I assume this can be applied across all batch job types to improve the performance further
|
|
|
|