Search Forums

(Advanced Search)

Latest Threads
How to implement/sync Obi...
Forum: Obi Rope
Last Post: quent_1982
Yesterday, 01:48 PM
» Replies: 2
» Views: 108
Collisions don't work con...
Forum: Obi Rope
Last Post: chenji
27-06-2025, 03:05 AM
» Replies: 3
» Views: 203
Force Zone apply differen...
Forum: Obi Rope
Last Post: chenji
26-06-2025, 11:41 AM
» Replies: 11
» Views: 632
Can I blend in and out of...
Forum: Obi Cloth
Last Post: josemendez
24-06-2025, 04:42 PM
» Replies: 3
» Views: 210
Using a rigidbody/collide...
Forum: Obi Cloth
Last Post: josemendez
24-06-2025, 09:29 AM
» Replies: 1
» Views: 119
Solver is too performance...
Forum: Obi Rope
Last Post: quent_1982
20-06-2025, 08:09 AM
» Replies: 40
» Views: 3,886
Obi 7 Model Scaling
Forum: Obi Cloth
Last Post: alkis
19-06-2025, 02:37 PM
» Replies: 2
» Views: 231
Obi Softbody instability?
Forum: Obi Softbody
Last Post: Aroosh
18-06-2025, 06:35 PM
» Replies: 0
» Views: 123
Tear Rod
Forum: Obi Rope
Last Post: chenji
18-06-2025, 08:34 AM
» Replies: 2
» Views: 222
Pipeline that bends
Forum: Obi Softbody
Last Post: josemendez
17-06-2025, 02:07 PM
» Replies: 11
» Views: 672

 
  Chain Scale Issue
Posted by: darkcser - 19-04-2018, 02:10 AM - Forum: Obi Rope - Replies (2)

I'm trying to create a chain with fairly small links so that it is in scale with other objects in my VR scene. My Obi Rope resolution is already set to the max of 1 but when I reduce the link scale on the default chain link prefabs to 1, the links no longer touch one another. 

I can change the link scale so that the chain links touch each other but when I scale the  Obi Rope object itself so the chain is in scale with the rest of my scene, the rope simulation becomes very odd in that it becomes very elastic with the links being very far from one another.

Am I missing something obvious? 

Thanks.

Print this item

  Play swinging sound?
Posted by: zhuchun - 18-04-2018, 08:54 AM - Forum: Obi Rope - Replies (1)

Hi, I have a steel chain attached to an iron ball and want to play a swinging sound when it's moving. Is there anything like HingeJoint.Velocity to handle this?

Print this item

  Questions about Obi Rope
Posted by: Hypeviper - 17-04-2018, 05:38 PM - Forum: Obi Rope - Replies (2)

Hi Obi,

I have 2 questions about Obi Rope.

In the following thread http://obi.virtualmethodstudio.com/forum...hp?tid=378

You say that next platform support will be UWP and Linux, is UWP supported yet?
Because i am building something for the Hololens.


Second question:

Does the rope automaticly account for objects between the 2 points if you add them in runtime?
So it will path around those objects?


Thanks!

Print this item

  Issues with handles and scripted particles
Posted by: khalvr - 17-04-2018, 02:18 PM - Forum: Obi Rope - Replies (2)

I'm trying to make a script which snaps rope particles within a radius to their initial position on the spline, so that it places itself nicely when plugs are attached. I'm exposing the curve variable separately so that you can have two separate (identical) cords fitting to the same spot. The script works as expected when snapping to the ropes initial position, but when using the replacement cord with an overriding curve (which has a different starting position), it works well enough except with one small kink - some particles which are attached to handles will move to an area close to their starting location for the duration of the coroutine. What's even weirder is that snapping one plug into place can cause the cord on a completely different rope object (which is still a part of same cord) to exhibit this behavior with its particle handles. Once the coroutine finishes, the particles with handles will return to their expected position. 

Before you say anything - yes, this script will not work properly if you call SnapNearbyParticles twice with overlapping radii. But other than that, what am i doing wrong?



Code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Obi;

public class RopeParticleSnapping : MonoBehaviour {

    protected ObiRope rope;
    public ObiCurve targetCurve;
    protected Dictionary<int, float> particleMasses = new Dictionary<int, float>();


    // Use this for initialization
    void Start()
    {
        rope = GetComponent<ObiRope>();

        if (rope != null && targetCurve == null)
            targetCurve = rope.ropePath;

        //float mu = rope.ropePath.GetMuAtLenght(interParticleDistance * i);
        //positions[i] = transform.InverseTransformPoint(rope.ropePath.transform.TransformPoint(rope.ropePath.GetPositionAt(mu)));

        /*
         * int numSegments = rope.UsedParticles - (closed ? 0:1);
if (numSegments > 0)
interParticleDistance = rope.RestLength/(rope.UsedParticles-1);
else 
interParticleDistance = 0;
         * 
         * 
         * */
    }

    public IEnumerator MoveParticles(Vector3 target, float radius)
    {
        rope.Solver.RequireRenderablePositions();
        yield return null;

        Dictionary<int, Vector3> affectedParticles = new Dictionary<int, Vector3>();

        Debug.DrawRay(target, Vector3.up*0.1f, Color.red, 10.0f);

        for (int i = 0; i < rope.positions.Length; i++)
        {
            float mu = targetCurve.GetMuAtLenght(rope.InterparticleDistance * i);
            Vector3 startPosition = targetCurve.transform.TransformPoint(targetCurve.GetPositionAt(mu));
            Debug.DrawRay(startPosition, Vector3.up*0.1f, Color.green, 10.0f);
            if (Vector3.Distance(startPosition, target) < radius)
            {
                Debug.Log("Particle " + i + " inside distance!");

                affectedParticles[i] = startPosition;
                rope.velocities[i] = Vector3.zero;
                if (!particleMasses.ContainsKey(i)) // We don't want to risk overwriting the stored mass with 0, in case of overlap!
                    particleMasses[i] = rope.invMasses[i];
                rope.invMasses[i] = 0.0f;
            }
        }
        rope.PushDataToSolver(ParticleData.INV_MASSES | ParticleData.VELOCITIES);

        while (affectedParticles.Count > 0)
        {
            List<int> remove = new List<int>();
            foreach(KeyValuePair<int, Vector3> particle in affectedParticles)
            {
                if (Vector3.Distance(rope.GetParticlePosition(particle.Key), particle.Value) < 0.001f)
                {
                    remove.Add(particle.Key);
                } else
                {
                    rope.positions[particle.Key] = rope.transform.InverseTransformPoint(Vector3.Lerp(rope.GetParticlePosition(particle.Key), particle.Value, Time.deltaTime*10.0f));
                }
            }
            foreach (int i in remove)
                affectedParticles.Remove(i);

            rope.PushDataToSolver(ParticleData.POSITIONS);
            yield return null;
        }
        rope.Solver.RelinquishRenderablePositions();
    }

    public IEnumerator UnsnapParticles(Vector3 target, float radius)
    {
        rope.Solver.RequireRenderablePositions();
        yield return null;

        for (int i = 0; i < rope.positions.Length; i++)
        {
            float mu = targetCurve.GetMuAtLenght(rope.InterparticleDistance * i);
            Vector3 startPosition = targetCurve.transform.TransformPoint(targetCurve.GetPositionAt(mu));

            if (Vector3.Distance(startPosition, target) < radius)
            {
                Debug.Log("Releasing particle!");
                particleMasses.TryGetValue(i, out rope.invMasses[i]);
                rope.velocities[i] = Vector3.zero;
            }
        }
        rope.PushDataToSolver(ParticleData.VELOCITIES | ParticleData.INV_MASSES);
        rope.Solver.RelinquishRenderablePositions();
    }

    public void SnapNearbyParticles(Vector3 target, float radius)
    {
        StartCoroutine(MoveParticles(target, radius));
    }

    public void UnsnapNearbyParticles(Vector3 target, float radius)
    {
        StartCoroutine(UnsnapParticles(target, radius));
    }
}

Print this item

  ethan soft deformation by flag
Posted by: onlyconscripted - 17-04-2018, 04:49 AM - Forum: Obi Cloth - Replies (2)

Hello

This is a brillant asset, but Im stuck trying to build something.

Im trying to duplicate the cloth asset video showing ethan from the standard assets being deformed by a flag instead of his own mesh.
I have a complex mesh and I want to use a simple hull to drive its deformation.
Ive tried building a normal cloth sim and changing the 'shared topology' but it simply overwrites the mesh filter. I haven't been able to get 2 separate objects to share or use a third cloth mesh topology object but the asset builder has demonstrated this is possible, I just can't figure out how.

Any suggestions?

Print this item

Pregunta how to move solver with local space simulation
Posted by: phields - 16-04-2018, 05:54 PM - Forum: Obi Fluid - Replies (2)

Hello, I want change solver's position in runtime to simulation a small water pool.
Is there any way to do that?

Print this item

  Applying custom forces - AddWind or AddParticleExternalForces?
Posted by: jabza - 16-04-2018, 01:39 PM - Forum: Obi Cloth - Replies (4)

Hi,

I'm generating Drag and Lift force vectors that I would like to apply directly, ideally avoiding AerodynamicConstraints.

As far as I can tell, there are two ways to apply external forces to particles: Oni.AddWind and Oni.AddParticleExternalForces.

I was wondering how these APIs differ, and when each should be used?

Finally, for this situation, should I be applying forces differently if UsesCustomExternalForces is set, what exactly does this mean?


Much appreciated.

Print this item

  iOS shader error
Posted by: rectalogic - 15-04-2018, 07:59 PM - Forum: Obi Cloth - Replies (1)

In Unity 2017.3.1f1 ObiCloth 3.4, when I build for iOS the build fails with:

Error building Player: Shader error in 'Obi/Particles': '' :  non-square matrices not supported (3x1) at Assets/Obi/Resources/ObiMaterials/ObiEllipsoids.cginc(83) (on gles)

Compiling Vertex program with DIRECTIONAL LIGHTPROBE_SH
Platform defines: UNITY_NO_DXT5nm UNITY_NO_RGBM UNITY_ENABLE_REFLECTION_BUFFERS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS UNITY_NO_CUBEMAP_ARRAY UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 SHADER_API_MOBILE UNITY_HARDWARE_TIER3 UNITY_COLORSPACE_GAMMA UNITY_LIGHTMAP_DLDR_ENCODING

Print this item

  Is there a way to make the cloth work with High-Mass objets?
Posted by: unitydroid - 15-04-2018, 05:58 PM - Forum: Obi Cloth - Replies (1)

Hi to the Obi-Team, we are trying to build a trampoline and have choosen Obi-Cloth cause of its "Trampline Demo" in the Rigidbody-Example-Scene.

However, the Collision seems not to work if the Mass of the sphere is higher then 0.2 - 1, and it also does not work with high velocitys.

Even with alot tweaking we face the same problem on and on.

Are we missing something special or does the cloth do not work with high masses and velocitys?

Greets and keep up the good work.

Print this item

  Tearing in local space
Posted by: jabza - 14-04-2018, 09:38 PM - Forum: Obi Cloth - Replies (4)

Hello,

So far ObiCloth has been a breeze to integrate into my project, very happy!

However, the current issue I'm facing is with ObiTearableCloth. My solvers are setup to simulate in local space, but as a result projectiles seem to pass straight through my cloth.
Switching the solver to world space does fix the issue (cloth tears on impact), but I require local space for my project.

For reference, I use the projectiles that are included with the tearable cloth example scene. I spawn the projectiles as a child of the solver, but this appears to make no difference.
Please see my ObiSolver below.

[Image: txxX3j9.png]

I've also noticed that substeps seem to reduce, or completely prevent tearing?

Any help on this matter would be greatly appreciated.

Thanks in advance.

Print this item