Latest Threads |
ObiRope Mesh Renderer
Forum: Obi Rope
Last Post: quent_1982
Yesterday, 11:27 AM
» Replies: 4
» Views: 76
|
How to dynamically change...
Forum: Obi Rope
Last Post: quent_1982
Yesterday, 06:34 AM
» Replies: 6
» Views: 190
|
Pipeline that bends
Forum: Obi Softbody
Last Post: josemendez
04-07-2025, 09:52 AM
» Replies: 13
» Views: 855
|
How to implement/sync Obi...
Forum: Obi Rope
Last Post: quent_1982
01-07-2025, 01:48 PM
» Replies: 2
» Views: 208
|
Collisions don't work con...
Forum: Obi Rope
Last Post: chenji
27-06-2025, 03:05 AM
» Replies: 3
» Views: 272
|
Force Zone apply differen...
Forum: Obi Rope
Last Post: chenji
26-06-2025, 11:41 AM
» Replies: 11
» Views: 793
|
Can I blend in and out of...
Forum: Obi Cloth
Last Post: josemendez
24-06-2025, 04:42 PM
» Replies: 3
» Views: 263
|
Using a rigidbody/collide...
Forum: Obi Cloth
Last Post: josemendez
24-06-2025, 09:29 AM
» Replies: 1
» Views: 160
|
Solver is too performance...
Forum: Obi Rope
Last Post: quent_1982
20-06-2025, 08:09 AM
» Replies: 40
» Views: 4,306
|
Obi 7 Model Scaling
Forum: Obi Cloth
Last Post: alkis
19-06-2025, 02:37 PM
» Replies: 2
» Views: 271
|
|
|
Problem with Final IK |
Posted by: Deschanna - 29-12-2017, 08:35 AM - Forum: Obi Cloth
- Replies (15)
|
 |
Hi!
I read 'somewhere' earlier, before buying Obi Cloth, that it should work with Final IK. However, I cannot get it to work.
I am running the solver in LateUpdate.
I have a character, wearing a sash, which I'm trying to animate with Obi Cloth. It works, but problematically. With no Final IK enabled, it works as should.
However, when Final IK is enabled, the part of the sash that is tied around the character's waist and should stay under his armour, constantly jumps (shows) above the armour in parts. Sometimes more, sometimes less. And when the character is going down a hill, for example, the part that should stay in place shows above armour and noticeably jumps up and down.
Umm... some idea? Thanks.
Best regards, Laura
|
|
|
scripting ropes with pin constraints & tethers |
Posted by: phoberman - 26-12-2017, 07:43 PM - Forum: Obi Rope
- Replies (6)
|
 |
Hi –
I’m working on a scene made up of hanging chains of objects, each connected by a short rope: the first particle of each rope is pinned to an object at the top, and the last particle is pinned to an object at the bottom. The first object of the first rope is set to kinematic (to anchor the whole chain at the top). It’s all working pretty well, but I have a few questions.
The final scene will have lots of ropes; each chain contains about 6 ropes, and there will be more than 20 chains in total, so that means more than 100 ropes. Putting all of this together in the editor was impractical, so I’ve written a script (based on ObiRopeHelper.cs) to help automate the process. Script included below.
When the simulation starts, the rope springs like a rubber band that’s just been let go and then settles down. I'd like to have everything begin in a resting state (unmoving). In this thread: http://obi.virtualmethodstudio.com/forum...hp?tid=175 the solution suggested is disable the rope and wait for the next FixedUpdate before reenabling. I’ve tried to implement that in my script, but it doesn’t seem to be having any effect.
Next, I would like the ropes to be as non-elastic as possible. I realize that the recommended way of doing this is via tethers, but because my ropes aren’t fixed, tethers wouldn’t seem to be an option. However, in this thread: http://obi.virtualmethodstudio.com/forum....php?tid=6 there’s a method described in which the rope is fixed, tethers are generated, then the rope is unfixed. Once again, I’ve tried to implement this in my script, but it doesn’t seem to be having any effect.
I’ve therefore tried to set the rope length by using reduced values for stretchingScale (in ObiDistanceConstraints). I’m sure this isn’t ideal, but it basically seems to work (but maybe this is causing the initial rubber band behavior?)
Finally, I’ve found that each individual rope has to have its own dedicated solver; if I try to share a single solver across multiple ropes, Unity immediately crashes. I’m guessing this has something to do with removing and adding multiple pin constraints from the solver simultaneously/asynchronously? (Just a guess). Anyway, my question is whether there will be any problems (like a performance hit) by having upwards of 100 solvers in a single scene.
Code: using UnityEngine;
using System.Collections;
namespace Obi {
[RequireComponent(typeof(ObiRope))]
[RequireComponent(typeof(ObiCatmullRomCurve))]
[RequireComponent(typeof(ObiPinConstraints))]
[RequireComponent(typeof(ObiDistanceConstraints))]
[RequireComponent(typeof(ObiTetherConstraints))]
public class ObiConnectorRope : MonoBehaviour {
public ObiSolver solver;
public ObiActor actor;
public ObiRopeSection section;
public Material material;
public float ropeLength = 1.0f; // desired rope length
public float uvYMult = 2.5f; // keep UVScale Y consistent across rope lengths
public ObiCollider upperPinObject;
public ObiCollider lowerPinObject;
private Transform point1; // offset at top of object
private Transform point2; // offset at bottom of object
private ObiRope rope;
private ObiCatmullRomCurve path;
private ObiPinConstraints pinConstraints;
private ObiPinConstraintBatch constraintsBatch;
private ObiDistanceConstraints distanceConstraints;
void Start () {
actor.enabled = false;
// move rope position to match upper pinned object
transform.position = upperPinObject.transform.position;
// Get all needed components and interconnect them:
rope = GetComponent<ObiRope>();
path = GetComponent<ObiCatmullRomCurve>();
rope.Solver = solver;
rope.ropePath = path;
rope.Section = section;
GetComponent<MeshRenderer>().material = material;
// use stretching scale to set approximate rope length & UVScale Y
distanceConstraints = rope.GetComponent<ObiDistanceConstraints>();
distanceConstraints.stretchingScale = (ropeLength * 0.14f) - 0.05f; // ad hoc formula
rope.UVScale = new Vector2(1.0f, ropeLength * uvYMult);
// register offsets
point1 = upperPinObject.transform.Find("pinPointB").gameObject.transform;
point2 = lowerPinObject.transform.Find("pinPointA").gameObject.transform;
// Calculate rope start/end and direction in local space:
Vector3 localStart = transform.InverseTransformPoint(upperPinObject.transform.position);
Vector3 localEnd = transform.InverseTransformPoint(lowerPinObject.transform.position);
Vector3 direction = (localEnd-localStart).normalized;
// Add control points
path.controlPoints.Add(localStart-direction);
path.controlPoints.Add(localStart);
path.controlPoints.Add(localEnd);
path.controlPoints.Add(localEnd+direction);
// Setup the simulation:
StartCoroutine(Setup());
// Wait for next FixedUpdate
StartCoroutine(WaitOne());
actor.enabled = true;
}
IEnumerator Setup(){
// Generate particles and add them to solver:
yield return StartCoroutine(rope.GeneratePhysicRepresentationForMesh());
rope.AddToSolver(null);
// Generate tethers
// Fix first particle:
float tempMass = rope.invMasses[0];
rope.invMasses[0] = 0;
Oni.SetParticleInverseMasses(solver.OniSolver,new float[]{0},1,rope.particleIndices[0]);
rope.GenerateTethers(ObiActor.TetherType.AnchorToFixed);
// Unfix first particle:
rope.invMasses[0] = tempMass;
Oni.SetParticleInverseMasses(solver.OniSolver,new float[]{0},1,rope.particleIndices[0]);
actor.PushDataToSolver(ParticleData.INV_MASSES);
// Set pin constraints
pinConstraints = rope.GetComponent<ObiPinConstraints> ();
constraintsBatch = (ObiPinConstraintBatch)pinConstraints.GetBatches() [0];
pinConstraints.RemoveFromSolver(null);
// Add top pin constraint
constraintsBatch.AddConstraint(rope.particleIndices[rope.particleIndices[0]], upperPinObject.GetComponent<ObiCollider>(), point1.localPosition, 0f);
// Add bottom pin constraint
constraintsBatch.AddConstraint(rope.particleIndices[rope.UsedParticles-1], lowerPinObject.GetComponent<ObiCollider>(), point2.localPosition, 0f);
pinConstraints.AddToSolver(null);
pinConstraints.PushDataToSolver();
}
IEnumerator WaitOne(){
yield return new WaitForFixedUpdate();
}
}
}
|
|
|
Help with Grappling Hook Implementation |
Posted by: Cyric - 25-12-2017, 06:25 AM - Forum: Obi Rope
- Replies (1)
|
 |
Hello, first off, I want to say how impressed I am with Obi Rope's performance, stability, and looks. You're doing a great job!
So I'm *attempting* to use it in a less traditional fashion to create something similar to a Grappling Hook Gun. The player fires a projectile which attaches to other objects in the scene, and the player then swings around (in 3D) using Obi Rope rigid body physics.
I'm currently stuck at even getting the projectile to fire from the "gun" with the rope attached to behave properly. I've pinned the ends of the rope to the projectile (rigidbody) and the player (rigidbody) and added a cursor to the players side.
I've done basically what's in the code below and was hoping it would do the trick, but the projectile seems to just spring back and act unpredictably. Not to mention the cursor length extension doesn't seem to keep up when used this way.
Code: bool fired = false;
void Fire()
{
fired = true;
// Add force to projectile's rigidbody
}
void FixedUpdate()
{
if(fired)
cursor.ChangeLength((gunBarrel.position - projectile.position).magnitude);
}
Before using a fired projectile, I had used similar code to create a dynamic length rope between two objects that I moved by hand in the editor and it seemed to work well enough.
Any tips on how I should go about implementing this?
|
|
|
Fluid Performance: Primitive Colliders vs Mesh Colliders |
Posted by: writer51 - 24-12-2017, 03:55 AM - Forum: Obi Fluid
- Replies (4)
|
 |
I was wondering if there is documentation anywhere regarding the performance of obi on primitive vs mesh colliders. I seem to be getting a very noticeable performance drop in editor from subscribing to collisions on a mesh collider vs primitive colliders (tested boxes, capsules - all seem fine). Is this just a natural consequence of using mesh colliders- just seem strange, I go from 135 fps with primitives down to 40 fps with mesh collider, everything else being the same.
|
|
|
Metaball Effects ? |
Posted by: Ca935 - 24-12-2017, 12:01 AM - Forum: Obi Fluid
- Replies (1)
|
 |
Hello
I am using unity to create a 360 spherical VR movie (rendered frames). I need a metaball / blobmesh like effect where spheres of fluid emerge from a wall of fluid. The spheres that have emerged are captured by animated characters and hauled away. Does this sound like a job for Obi fluid ? I am imagining constraining the fluid particles to an object that I can animate to guide the motion of the blobs so I can then link to the characters. I have only a few hours in with Obi so far and see some very nice results. If some one could suggest a workflow or tell me that this isn't the right tool. That would be incredibly helpful. Also can the fluid renderer cast shadows?
Cheers
Ca935
|
|
|
I have a problem of the Obi tearable cloth Plugin. |
Posted by: james3302 - 22-12-2017, 08:08 AM - Forum: Obi Cloth
- Replies (1)
|
 |
Hey guys, I have a problem of Obi tearable cloth. Version is Unity 2017.2.0f3 (64bit).
I wish to modify the subordination mesh at Runtime, but when I modify GetComponent<Mesh Filter>(). mesh on Runtime, can't apply cloth Rigidbody.
Where should I find the modifiable Mesh on Runtime?
Thanks.
|
|
|
Sample Scene Errors - Unity Version 2017.3.0f3 |
Posted by: dgooding - 21-12-2017, 12:03 AM - Forum: Obi Rope
- No Replies
|
 |
Heyo
Just picked up Obi Rope today.
there were some errors with the sample scenes, so I tried just throwing the asset on an isolated project by itself, and am still getting the error.
line 408
ObiSolver.cs
the particleIndices array length is longer than the CurrentActor.active length, so it is getting Array index is out of range.
I tried just breaking the loop if was beyond the actor length, but that produces some strange results.
Daniel
|
|
|
|