Search Forums

(Advanced Search)

Latest Threads
Change size of spheres us...
Forum: Obi Softbody
Last Post: josemendez
3 hours ago
» Replies: 3
» Views: 40
Request a different way t...
Forum: Obi Fluid
Last Post: spikebor
Yesterday, 07:55 AM
» Replies: 2
» Views: 31
Obi7 | Ropes make fluid s...
Forum: Obi Fluid
Last Post: josemendez
14-05-2024, 07:21 PM
» Replies: 3
» Views: 47
Unable to load DLL 'Oni'.
Forum: General
Last Post: josemendez
14-05-2024, 05:52 PM
» Replies: 3
» Views: 48
I contact with softbody b...
Forum: Obi Rope
Last Post: spikebor
14-05-2024, 02:34 PM
» Replies: 2
» Views: 49
Need the positions to dri...
Forum: Obi Fluid
Last Post: spikebor
14-05-2024, 02:19 PM
» Replies: 2
» Views: 46
Frequent crash after assi...
Forum: Obi Fluid
Last Post: spikebor
14-05-2024, 02:15 PM
» Replies: 9
» Views: 248
Problems deleting obi col...
Forum: Obi Rope
Last Post: josemendez
14-05-2024, 08:05 AM
» Replies: 7
» Views: 146
When I use ObiBone with m...
Forum: Obi Rope
Last Post: josemendez
14-05-2024, 07:58 AM
» Replies: 3
» Views: 57
Changing solver gravity v...
Forum: Obi Fluid
Last Post: T-1000
13-05-2024, 10:08 PM
» Replies: 2
» Views: 34

 
Pregunta "Rest Length" returns unexpected values
Posted by: Hatchling - 20-05-2021, 03:10 PM - Forum: Obi Rope - Replies (7)

I've set up a rope that is completely linear - the start point, end point and tangents are all in a straight line.

I've temporarily removed the [HideInInspector] tags on the field "ObiRopeBlueprintBase.m_RestLength" so I could see its value. Looking at the code, it appears to represent the total length of all the segments in the rope as measured from the distances between connected particles. However, the rest length value displayed was very off.

The start and end points were exactly 2m apart, but the rope's reported rest length was reported to be 42!
On top of that, changing the resolution will cause the rest length to change anywhere between 202 (at a resolution of 0) and 6.878044 (at a resolution of 1).

I looked through the code can't make sense of why it'd come up with wildly unexpected values on a linear rope. Even if the rope was curved, the length should increase with resolution, not decrease.

Is it measuring the length of the rope relative to something else?

Print this item

  Pulling object problem
Posted by: cruzjunior - 19-05-2021, 06:50 PM - Forum: Obi Rope - Replies (2)

I'm completely new to this asset and I have a problem that I cant seem to find a way to solve it. 

I want to have a hook at the end of the rope and when that hook comes in contact with an object it attaches to that object and when the player pulls on the rope, the object comes wit it. 
My first instinct was just to make the object a child of the hook but that doesn't seem to work, the object either does not move or glitches out. 

Then I tried tying the object's transform to the hooks transform in script, so it moves when the hook moves without needing to parent, but then the problem with that was that the object would then would then go through other objects, completely ignoring the collider at some points, or launching other objects or itself into the stratosphere, and there was also the problem of the movement was not looking natural.  

Is there an obvious way to do this that I am missing? 

Thanks in advance!

Print this item

  Pull particles in a given direction
Posted by: xkalibrx - 19-05-2021, 05:09 PM - Forum: Obi Rope - Replies (11)

Hello!
We would like to move a “liquild” bulge along the rope but with a few nuances.


First I’ll describe what we tried. We tried putting a ring-like collider on a rope and moving it along the rope with force. But the ring would get stuck where the rope bends and at places where a particle is attached with ObiParticleAttachment.


We also tried building a level with two ropes and a ball going between them. But it negatively impacted performance and the ball would still get stuck at ParticleAttachments.


We then saw your post where you referenced the hose example (http://obi.virtualmethodstudio.com/forum/thread-2539.html). It could work for us but we can not quite figure out how to hook it up with player input.
Simply put, the bulge should follow the mouse position, but if the player tries to pull the bulge “outside” the rope, doing so should pull the rope (see picture for a graphic explanation).


I assume it could be implemented similar to ObiRopeAttach.cs example. But the question is, is it possible to pull particles in a given direction? Any other advice on the matter would be appreciated too.


Thank you!



Attached Files Thumbnail(s)
   
Print this item

Exclamación Obi adding huge forces to rigidbodies when you delete ropes... (Repro project)
Posted by: Hatchling - 19-05-2021, 04:49 PM - Forum: Obi Rope - Replies (8)

So, this time I found that when you delete ropes, it can cause NaNs and absurd velocity assignments to rigidbodies when you destroy a rope's GameObject.

The repro package can be found here: (Expires in 30 days)
https://ufile.io/45i4log9

To reproduce:

  1. Start a new Unity project (I'm using 2020.2.0f1).
  2. Add Burst (version 1.4.8) and Jobs (version 0.8.0-preview.23) through the Package Manager.
  3. Import the package linked above.
  4. Open SampleScene.unity and press Play.
  5. Click and drag to attach a rope. The point where you click (mouse down) will be the first point where a rope gets attached. The point where you let go (mouse up) will be the second point where a rope gets attached. Add several ropes.
  6. Press [R] to delete all of the ropes you created.
  7. Repeat 4 and 5 until the bug is reproduced.
You'll see this when you reproduce the bug:
  • The rigidbodies in the scene may start behaving abnormally, with ghost forces pushing them around even though all of the ropes have been removed.
  • You'll see errors spamming the console regarding invalid forces being applied to one or more of the rigidbodies. For example: rigidbody.velocity assign attempt for 'Floating Platform' is not valid. Input velocity is { 2.468001, NaN, 55.692116 }.
  • Some of the rigidbodies may explode into outer space from the absurd forces.
Seems related to the previous bug I posted, with very similar symptoms.

Other symptoms I've noticed in fighting with this bug:
  • When I start SampleScene with a rope in the scene already, (drag ObiPrefabs/Rope into the scene and activate the GameObject before pressing play) any ropes you add to the scene will be frozen and will not simulate.
  • After reproducing the above bug: When switching to the scene "RopeNet" (which uses a modified example script to use the global solver), pressing play, and then unpressing play, the console will spam about some phantom Obi.ObiLateFixedUpdater trying to poke at various destroyed Obi components. When this occurs, you'll find that there are no ObiLateFixedUpdater instances visible in the hierarchy.
Code modifications to note:
  • ObiStatic.cs added, which enables a global solver.
  • ObiStaticSettings.cs added, which allows you to define the global solver using a prefab reference.
  • When an ObiRope is created, it will check for a solver in one of its ancestors. If one isn't found, it'll use ObiStatic.WorldSolver, which will get instantiated if needed.
  • RopeNet.cs will use ObiStatic.WorldSolver instead of creating its own solver.

Print this item

  Obi Fluid's Buildup Substance, can we hide it?
Posted by: LiegeOfAnima - 17-05-2021, 05:10 AM - Forum: Obi Fluid - Replies (3)

I built a Honey substance feature using Obi Fluid, however I was being bothered by this buildup substance on the top of the sphere I was emitting the honey on it and have it dripping off at the bottom. is there a way to have the buildup hidden?



Attached Files Thumbnail(s)
   
Print this item

Pregunta How to query Obi geometry with raycasts?
Posted by: Hatchling - 15-05-2021, 06:57 AM - Forum: Obi Rope - Replies (15)

Does Obi provide the ability to query the geometry of Obi Actors, like how Physics.Raycast, .Spherecast, etc. allows you to query colliders?

I'm assuming that most of the math involved for this has already been done somewhere in there in order to support collision detection.


I see there is ObiParticlePicker, but it seems like this approach isn't optimal:
  • Only allows picking particles directly, instead of by their collision geometry (simplexes)
  • Doesn't return a point on the surface that the ray first made contact
  • Doesn't query the particle grid to filter out most of the tests
  • Isn't written in efficient threaded code in the same way that other collision checks are
  • Only considers one solver
  • Cannot be invoked in a static way (like Physics.Raycast)
If I were more familiar with how to interface with the internal stuff of Obi, I'd be willing to write these queries myself. An interesting idea might be to provide some sort of base query class where you can implement custom queries (for example, getting the closest point on a simplex to the query point, within a certain radius (or infinite radius)). If I wrote something like this, I'd be willing to share the code with the hope that it'd be maintained as Obi is developed.

A global query would probably follow this procedure:
  1. Test the query condition against the oriented bounding box of each solver. If a given solver passes, then...
  2. Test the query condition against all occupied cells, OR, in cases where it is possible to determine which cells pass the query condition without enumerating through each cell, get a list of cells that pass the query condition. If a given cell passes, then...
  3. Test the query condition against all simplexes occupying the cell.
  4. For each simplex that passes the query condition, modify the query result.
    • In the case of a Raycast, replace the current hit point if its distance from the ray is closer. 
    • In the case of a RaycastAll, add the hit point to the list of hit points.
    • In the case of a Checksphere (which returns true if any object occupies a spherical volume, otherwise false), terminate the query and return "true" as the query result if and when a simplex passes the query condition, otherwise false. (A similar test could be done on the cell/solver bounding box itself if it is fully contained within the Checksphere volume.)
A solver specific query would be similar, sans step 1.

I'm guessing that it'd be wasteful to redo all of the work involved in calculating queries like these, given that collision tests between line simplexes and other types are already possible. (A line simplex can be treated like a raycast or a spherecast, with minor modifications.)

Print this item

  mix two fluids
Posted by: GinHuang - 15-05-2021, 06:11 AM - Forum: Obi Fluid - Replies (4)

When I tried to mix two fluids,The particles will explode and fly around. Is it currently impossible to mix liquids in this way?


   

Print this item

Pregunta How does one disable "phase" based collision masking?
Posted by: Hatchling - 15-05-2021, 01:57 AM - Forum: Obi Rope - Replies (6)

I'd like to ensure that, in my project, everything is able to collide with everything else. However, each time I instantiate a rope, it has the same phase as the last rope I instantiated.

I'd like to disable this feature, as going in and editing each rope I instantiate to have a unique phase seems like it'd be a real pain.

Is there a way to do this? Or would I need to modify source code I don't have access to (e.g. in the DLL)?

EDIT: It appears that using self-collision doesn't just allow collision with the self, but also allows collision between *everything else* of the same phase, *except* rigidbodies, which mostly solves the problem: Just make sure everything has "Self Collision" enabled and that every particle actor uses phase 1, and every rigidbody uses phase 0.
The description is a bit misleading. (Also, as a side note, the term "phase" doesn't evoke the concept of collision. Usually phase is used to describe something's progress through a cycle, like rotation. Perhaps "layer" would be a better term.)

Print this item

  Dynamic Grappling hook rope length?
Posted by: MikaleM - 14-05-2021, 04:29 AM - Forum: Obi Rope - Replies (1)

Currently in my game i have a character who uses momentum to throw a grappling hook object. As soon as the character throws the hook i enable the obirope mesh and set pin constraints on the hand and the bottom of the hook. I would like for the rope to dynamically change length in relation to the velocity of the hook. But the rope restrains the grappling hook from flying flying in a normal arc. I have been using pin constraints akin to the grappling hook sample scene instead of particle attachments. I have tried to use both static and dynamic particle attachments but this causes the rope to not attach properly to the hand and grappling hook. how can i change the length of the rope as the grappling travels without  affecting the path, (but without static attachments because i'd like for the rope and grappling hook to interact eventually)                                                                                                                            also loving obirope so far. just wish i could figure this out. Interesante



Attached Files
.cs   ObiRopeSpawn.cs (Size: 4.31 KB / Downloads: 7)
.gif   gancho.gif (Size: 79.34 KB / Downloads: 18)
Print this item

  softBody velocity
Posted by: ReaperQc - 14-05-2021, 02:17 AM - Forum: Obi Softbody - Replies (5)

Hi, I am trying to get access to the velocity of my softbody because i can switch between multiple character with different controls. some use rigidbody and one use the softbody, when i switch from the rigidbody to the softbody, i can apply a force to the softbody that is the same as the last velocity of my rigidbody before switching, but when i try to switch from the softbody to a rigidbody, i would like to get the last velocity of my softbody and apply it to the rigidbody's velocity,  but unfortunately,I am unsure where to access the softbody's velocity, i was able to find the solver's velocities but it return an unusable vector4 that is only usable with obi element.

Print this item