Search Forums

(Advanced Search)

Latest Threads
Rope stretch problem
Forum: Obi Rope
Last Post: josemendez
1 hour ago
» Replies: 5
» Views: 49
Rope resolution inconsist...
Forum: Obi Rope
Last Post: josemendez
1 hour ago
» Replies: 7
» Views: 71
Are there any examples of...
Forum: Obi Rope
Last Post: josemendez
2 hours ago
» Replies: 1
» Views: 16
Performance with Burst on...
Forum: General
Last Post: josemendez
3 hours ago
» Replies: 4
» Views: 77
Problem with movement of ...
Forum: Obi Rope
Last Post: josemendez
Yesterday, 07:37 AM
» Replies: 1
» Views: 37
Android (Pico) Virtual Re...
Forum: Obi Fluid
Last Post: josemendez
17-03-2024, 09:20 PM
» Replies: 1
» Views: 39
License
Forum: Obi Rope
Last Post: josemendez
17-03-2024, 10:39 AM
» Replies: 5
» Views: 6,666
Using Fluid for cooking s...
Forum: Obi Fluid
Last Post: stepkka
13-03-2024, 07:49 PM
» Replies: 4
» Views: 96
Console Support
Forum: Obi Fluid
Last Post: josemendez
12-03-2024, 12:02 PM
» Replies: 2
» Views: 1,756
ObiCloth local space docu...
Forum: Obi Cloth
Last Post: josemendez
11-03-2024, 11:05 AM
» Replies: 3
» Views: 206

 
  Rope stretch problem
Posted by: Agony - 3 hours ago - Forum: Obi Rope - Replies (5)

Hello, I am making a rope length real-time update project, encountered some problems, I hope I can get help
Below is the method to dynamically change the length of the rope, which is performed in the Update, which cannot be changed。

Code:
public void ChangeRopeLength()
{
    restLength = Rope.restLength;
    currentLength = Rope.CalculateLength();
    diff = currentLength - restLength;

    if (diff > m_StretchThre)
        restLength += diff * Time.deltaTime * m_StretchSpeed;

    if (diff < m_ShortenThre)
        if (restLength > startLength)
            restLength += diff * Time.deltaTime * m_ShortenSpeed;

    m_RopeCursor.ChangeLength(restLength);

    ropeLength = Rope.restLength;

    //m StretchThre is 0.1,m_ShortenThre is -0.1,m_StretchSpeed and m_ShortenSpeed is 50.
}
This method only works if I set the value of Distance Constraints to 0.5 or less. If I set it to 1, the rope will stretch indefinitely. Even if I changed the m StretchThre in the top code to be large enough, it wouldn't work as well as I wanted.
I wonder what method I can use to change the rope length in Update when I change the Distance Constraints to 1,So that the length of the rope can be normal variation, rather than infinite elongation

Print this item

  Are there any examples of a rigidbody climbing an ObiRope?
Posted by: gnovos - 17-03-2024, 07:48 AM - Forum: Obi Rope - Replies (1)

I went through the ExtendableGrapplingHook example, but that is "climbing" by changing the length or the rope, which isn't quite what I'm looking for.  I'm looking more for something that just moves a rigidbody steadily up a rope while maintaining the two-way forces between the two.  I have a few ideas how I could accomplish this, but if there's already an example somewhere to save me a lot of trial and error, I would be very grateful.

Print this item

  Rope resolution inconsistency resulting in larger forces required
Posted by: inbilla - 17-03-2024, 05:25 AM - Forum: Obi Rope - Replies (7)

I have two ropes defined.
Each has a different starting shape. Because they have a different initial shape, they must have different blueprints. 
They both have the same settings in the blueprint though, in particular, they both have a resolution = 0.206
(See attached initial state image)
   

During runtime, I use a RopeCursor to increase the length of both ropes to ~20.0.
I use a character to drag the ends around and stretch them out.

The issue is... 
The character can successfully drag one of the ropes, but not the other.
This leads to an inconsistent gameplay experience based upon the starting state of the rope.

To debug the issue, I attached a particle renderer and discovered that the rope that cannot be dragged has significantly more particles than the other.
(See attached runtime image)
   
The rope with red particles cannot be dragged by my character (the force required is too great).
The green particle rope behaves well.

I suspect that the fact the red rope has more particles is why they require more force to move?

Some questions arise:
 - Why does the red particle rope have more particles? (I suspect because I required more control points in the initial shape to create the starting coil shape)
 - Is there a way that I can make sure both ropes have the same inter-particle distance regardless of the starting shape?
 - Alternatively, is there a way to make sure the force required to move each rope is consistent? (lower the friction on the red particles somehow?)

Thanks for your assistance

Print this item

  Android (Pico) Virtual Reality and OBI Fluid
Posted by: ugurcamoglu35 - 15-03-2024, 01:38 PM - Forum: Obi Fluid - Replies (1)

Hi,

I encounter an error when I operate the obi in the container with the Pico hand controller. I put xr grab objects into the cup object. As soon as I hold the glass via the controller, the liquid disappears. When I release the controller, the fluid comes back.

Is there something I missed somewhere?

Print this item

  Problem with movement of ObiRopeAttachment
Posted by: Alnik - 13-03-2024, 02:42 PM - Forum: Obi Rope - Replies (1)

Hello everyone!

I have the following problem: I am trying to control the same crane with two clients that connect to a server via FishNet. As long as no player connects to the crane, the ObiSolver remains disabled and the spreader is simply dragged along as a child of the crane.

As soon as a player connects to the crane, the parenting of the spreader is changed and the ObiSolver is enabled so that the spreader is now only attached to the crane by the ropes. It should be noted that the ropes themselves are attached to a SpreaderAttachmentGO in a cabin GO that can be moved.

If you now move the cabin, the spreader also moves with it, as the SpreaderAttachment, just like the VCam, is attached to the cabin. If the first client now disconnects from the crane, the ObiSolver is disabled again. If the second client then connects to the crane, the VCam is packed to the position left by the first client, but the ropes spawn at the original position in the centre of the crane, i.e. as if the cabin movement had not taken place before. You can see this in the attached video.

What confuses me now is that in the SceneView (also in the video) you can see that the object on which the ropes are actually hanging is in the correct position, but for some reason the ropes themselves are hanging down vertically from the centre.

I was previously able to reproduce this behaviour independently of the network, i.e. in single player, but this was not always successful. The same behaviour can also be observed when the crane is moving. The ropes also spawn at the crane's point of origin.

Does anyone know what could be the reason for this? Does the position of the SpreaderAttachment have to be updated somehow in the ObiSolver? Could the alternating enable/disable of the ObiSolver lead to such behaviour? Originally I installed these changes because the performance was severely affected by the rendering of 60 different ObiSolvers for all cranes at once.

In the video, I also included the settings for the ObiSolver and for one ObiRope as an example.

Many thanks in advance!

Best regards,
Alexej


Print this item

  Performance with Burst on is very bad
Posted by: ShawnF - 13-03-2024, 11:19 AM - Forum: General - Replies (4)

I'm getting a major performance hit from my obi ropes, and it's significantly worse when using the Burst as the backend rather than Oni. FPS is ~75 with all ropes disabled, 30 with Burst, and 40 with Oni. 

Using Unity 2022.3.13f1

I've got 11 ropes in the scene - each has its own solver. 

So the story is...
After looking into some performance issues today, I noticed that our obi ropes were the biggest offender. I googled around and realized that I didn't have all the packages installed that I needed for it to use Burst, which should theoretically improve performance a lot. I installed what I needed and I no longer got the package dependency warning, but performance tanked badly. At that point, I was getting an error similar to the one here:
http://obi.virtualmethodstudio.com/forum...-3492.html

I do have the Jobs debugger, safety checks, and leak detection all disabled.

I've tried a few different things to improve performance. It helped a bit, but still isn't good enough. Specifically what I've done is:
- Reduced solver steps from 4->3
- Reduced rope resolution
- Increased decimation

Also tried switching to the line renderer instead of extruded mesh, but that didn't make a difference, presumably because the performance issues are coming from the simulation rather than the rendering.

I also tried installing the old Jobs package individually, but that didn't seem to make any difference either.

Let me know if you want any specific profiling info - I wasn't sure what would be useful and didn't want to flood this post with unnecessary info.

I suspect that my best bet for a big improvement is getting the Burst backend to work properly, but something is definitely wrong there. Any ideas what might be the issue and how I can solve it?

Print this item

  Using Fluid for cooking simulation?
Posted by: stepkka - 11-03-2024, 10:06 PM - Forum: Obi Fluid - Replies (4)

Thinking about purchasing Obi Fluid. I assume some soup in pot would be easy to do. But I also have an idea of making eggs. When you crack an egg the insides are liquid (though somewhat viscous). When you pour an egg into a flat surface it should behave like a normal egg, i.e. stay as a clump and not disappear. After cooking it should become more rigid (ideally increase viscosity smoothly over time). Is it possible to do using Obi Fluid?

Print this item

  Configuring a T-Shirt for Robotics Task
Posted by: thisjustin123 - 08-03-2024, 05:03 PM - Forum: Obi Cloth - Replies (1)

Hi,

I'm an undergraduate student working with a robot-assisted dressing task and am interested in using Obi to simulate the dynamics of a T-shirt. Currently, I'm aiming just to get a t-shirt cloth set up to see if Obi will give good performance/results in terms of realistic cloth simulation.

I've imported this into Unity and set up a scene with Obi. Currently, I just have the shirt falling onto itself on a hospital bed.

Some important specifications for my problem in particular are that I need to use self collisions and surface collisions simultaneously enabled, or else the cloth may phase through itself in unexpected ways. I ran previously into a problem with this causing INTENSE lag, but followed the steps in this forum post (https://obi.virtualmethodstudio.com/foru...-3994.html) to resolve this. I suppose I have one tiny question regarding that solution: 

When I limit the timestep to 0.06, which seems to give workable results, the simulation actually seems to slow down. That is, it's as if I reduced the timescale because the physics compared to real time seems to actually be slower than if I have the timestep unlimited. I assume this is because the physics timestep is limited below the timestep suggested by the FPS, meaning the physics simulates slower than expected. Is this intentional and is there any workaround I can do regarding this? It's certainly not the biggest deal and still simulates at a reasonable speed.

Secondly, more pertinently, I'm running into an issue when the cloth lays on top of itself; when the cloth should be simply at rest laying on top of itself, it seems to jitter violently due to collisions constantly happening between its particles. I attached a video of this on my Google Drive: https://drive.google.com/file/d/16GJlybl...sp=sharing

Is there any way to prevent this jitter and make the cloth behave better when at rest?

Thanks in advance for any tips and apologies if answers are already somewhere out there. I haven't seen much use of Obi Cloth (or any particle-based simulations out there) in the context of actual entire clothing meshes, so it's been hard to configure things specifically for this purpose. I suppose in that case if there are any particular resources I could consult to find more about the use of Obi for my specific purpose I would really appreciate any direction towards those resources. Sonrisa

Print this item

  Problem with RigitBody
Posted by: Alexander34 - 06-03-2024, 11:21 AM - Forum: Obi Rope - Replies (4)

[Image: 2024-03-06-111633.png]
[Image: 2024-03-06-112345.png]
The problem is as follows: I have a code that creates a control point in the middle of the rope, then I create an attachment on the rope and attach it to the attraction point inside the object that I want to move with this rope. Since the attraction point itself is attached to the main RigidBody (box) through a fixedJoint, it starts to press it into other colliders, ignoring collisions, because the weight of the ControlPoint presses from above so strongly that it ignores the mass of the main object (box). However, I need to achieve an effect where pulling the attraction object would be difficult depending on its weight, and the lighter it is, the easier it is to pull it by moving the control point on the other end of the rope.

Code:
        public void AttachRopeAtCurrentCenter(AttractionObject attractionObject)
        {
            _blueprint = ScriptableObject.CreateInstance<ObiRopeBlueprint>();

            var fatherConnectionPoint = _playersContainer[PlayerCharacter.Father].ConnectionPoint;
            var sonConnectionPoint = _playersContainer[PlayerCharacter.Son].ConnectionPoint;
            Vector3 father = ObiRope.transform.InverseTransformPoint(fatherConnectionPoint.position);
            Vector3 center = ObiRope.transform.InverseTransformPoint(attractionObject.AttractionPoint.position);
            Vector3 son = ObiRope.transform.InverseTransformPoint(sonConnectionPoint.position);
            int allLayers = (1 << 16) - 1;
            int excludeLayer15 = ~(1 << 15);
            int finalMask = allLayers & excludeLayer15;

            int filter = ObiUtils.MakeFilter(finalMask,
                1);

            _blueprint.path.Clear();

            _blueprint.path.AddControlPoint(father,
                -father.normalized,
                father.normalized,
                Vector3.zero,
                _controlPointsMass,
                _controlPointsMass,
                1,
                filter,
                Color.white,
                "start");

            _blueprint.path.AddControlPoint(center,
                -center.normalized,
                center.normalized,
                Vector3.zero,
                _controlPointsMass,
                _controlPointsMass,
                1,
                filter,
                Color.white,
                "center");

            _blueprint.path.AddControlPoint(son,
                -son.normalized,
                son.normalized,
                Vector3.zero,
                0.1f,
                0.1f,
                1,
                filter,
                Color.white,
                "end");

            _blueprint.path.FlushEvents();
            _blueprint.Generate();
            ObiRope.ropeBlueprint = _blueprint;


            var pinConstraints = ObiRope.GetConstraintsByType(Oni.ConstraintType.Pin) as ObiConstraints<ObiPinConstraintsBatch>;
            pinConstraints.Clear();
            var batch = new ObiPinConstraintsBatch();
            _centerOfRopePointCollider.transform.position = attractionObject.AttractionPoint.position;

            if (attractionObject.Type == AttractionObject.AttractionPointType.Kinematic)
                _centerOfRopePointObiRigidbody.kinematicForParticles = true;


            batch.AddConstraint(ObiRope.solverIndices[0],
                _fatherConnectionPointObiCollider,
                Vector3.zero,
                Quaternion.identity,
                0,
                0,
                float.PositiveInfinity);

            batch.AddConstraint(ObiRope.solverIndices[_blueprint.activeParticleCount - 1],
                _sonConnectionPointObiCollider,
                Vector3.zero,
                Quaternion.identity,
                0,
                0,
                float.PositiveInfinity);

            var attachment = ObiRope.GetComponent<ObiParticleAttachment>();
            attachment.particleGroup = ObiRope.ropeBlueprint.groups[1];

            if (attractionObject.Type == AttractionObject.AttractionPointType.Kinematic)
            {
                attachment.target = attractionObject.transform;
                attachment.attachmentType = ObiParticleAttachment.AttachmentType.Static;
            }
            else
            {
                attachment.target = attractionObject.AttractionPoint;
                attachment.attachmentType = ObiParticleAttachment.AttachmentType.Dynamic;
            }
            batch.activeConstraintCount = 2;
            pinConstraints.AddBatch(batch);
            ObiRope.SetConstraintsDirty(Oni.ConstraintType.Pin);
        }

Print this item

  Raycasting rope behind an object
Posted by: Apoll0 - 05-03-2024, 10:06 AM - Forum: Obi Rope - Replies (2)

I have a rope hanging behind some objects. Objects are between the camera and the rope. 
The objects have an ObiCollider with category 0. 
The rope has category 1. 

I make a raycast from the camera towards the rope. I need the result to be returned only if it is not behind the object. 
So I am creating filter as 
int filter = ObiUtils.MakeFilter(ObiUtils.CollideWithEverything, 1);
var ray = _camera.ScreenPointToRay(Input.mousePosition);
solver.Raycast(ray, out QueryResult result, filter, 100f, 0.1f));

And unfortunately, every time I hit the rope, the result returns me the simplex of that rope. Even if she is behind an obstacle with ObiCollider. Is there a way for an obstacle to stop the raycast?

Print this item