Search Forums

(Advanced Search)

Latest Threads
Unstable chain attachment
Forum: Obi Rope
Last Post: quent_1982
5 hours ago
» Replies: 9
» Views: 196
ObiCloth going through co...
Forum: Obi Cloth
Last Post: Andreia Mendes
Yesterday, 05:39 PM
» Replies: 0
» Views: 24
Why does setting InverseM...
Forum: Obi Fluid
Last Post: nonnamed
13-05-2025, 12:41 PM
» Replies: 8
» Views: 11,717
Shaking problem when coll...
Forum: Obi Softbody
Last Post: webmagic
13-05-2025, 12:11 PM
» Replies: 6
» Views: 169
Obi Softbody IndexOutOfRa...
Forum: Obi Softbody
Last Post: Aroosh
11-05-2025, 11:37 AM
» Replies: 2
» Views: 157
Rope pinned to two dynami...
Forum: Obi Rope
Last Post: Crimson1462
09-05-2025, 07:51 PM
» Replies: 2
» Views: 234
Unity 6 Console Spam abou...
Forum: Obi Fluid
Last Post: josemendez
09-05-2025, 08:03 AM
» Replies: 3
» Views: 1,167
the Obi cloth has some co...
Forum: Obi Cloth
Last Post: josemendez
09-05-2025, 08:00 AM
» Replies: 2
» Views: 141
Hard crash in build after...
Forum: Obi Rope
Last Post: goldfire
04-05-2025, 10:10 PM
» Replies: 2
» Views: 272
Particle collision with s...
Forum: Obi Softbody
Last Post: Duncano
03-05-2025, 02:07 PM
» Replies: 2
» Views: 306

 
  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

  Strange errors after import (clear project) and questions about perfomance
Posted by: NightFox - 12-04-2018, 04:16 PM - Forum: Obi Cloth - Replies (6)

Hello. I'm using Unity3d 2017.3.0f3 (a9f86dcd79df)

After importing, I get such warnings and errors:

Code:
Assets/Obi/Editor/ObiParticleActorEditor.cs(161,22): warning CS0618: `UnityEditor.EditorApplication.playmodeStateChanged' is obsolete: `Use EditorApplication.playModeStateChanged and/or EditorApplication.pauseStateChanged'
Assets/Obi/Editor/ObiTetherConstraintsEditor.cs(18,23): warning CS0649: Field `Obi.ObiTetherConstraintsEditor.tetherType' is never assigned to, and will always have its default value `0'
DllNotFoundException: libOni
Obi.ObiCollisionMaterial.OnValidate () (at Assets/Obi/Scripts/Collisions/ObiCollisionMaterial.cs:44)
DllNotFoundException: libOni
Obi.ObiCollisionMaterial.OnEnable () (at Assets/Obi/Scripts/Collisions/ObiCollisionMaterial.cs:27)
DllNotFoundException: libOni
Obi.ObiMeshTopology.OnEnable () (at Assets/Obi/Scripts/DataStructures/ObiMeshTopology.cs:122)
DllNotFoundException: libOni
Obi.ObiTriangleSkinMap.OnEnable () (at Assets/Obi/Scripts/DataStructures/ObiTriangleSkinMap.cs:121)
DllNotFoundException: libOni
Obi.ObiDistanceField.OnEnable () (at Assets/Obi/Scripts/Collisions/ObiDistanceField.cs:54)
This is okay?
These "DllNotFoundException: libOni" there are 256.


Physics works but not as efficiently as we would like.
I checked on intel i3, Clothstaticmeshcollider demo gives out 400-500ms for CPU.
What processor do you use?
Is the loss of performance related to the errors above?
At the same time, the Benchmark demo gives ~12ms.
Are there any best practices for better performance?

Thanks.

Print this item

  Compiler Error: Invalid Subscript _ShadowCoord
Posted by: PrismicStudios - 10-04-2018, 05:02 PM - Forum: Obi Cloth - Replies (4)

Hi there!
I bought your asset yesterday and It's wonderful if not a bit complex to figure out! I'm on Unity 2017.3.1f1.

I'm having the same error as this chap: http://obi.virtualmethodstudio.com/forum...d-293.html

But for me it's in the cloth, not the rope, and my Shaders already have the lines you instructed them to add.

Here's the complete error:


Shader error in 'Obi/Particles': invalid subscript '_ShadowCoord' at line 92 (on d3d11)

Compiling Vertex program with DIRECTIONAL SHADOWS_SHADOWMASK LIGHTPROBE_SH
Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_COLORSPACE_GAMMA UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_RGBM_ENCODING


So what should I do?
Thanks!
Dano @ Prismic Studios

Print this item