Obi Official Forum
are custom forces supported? - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Fluid (https://obi.virtualmethodstudio.com/forum/forum-3.html)
+--- Thread: are custom forces supported? (/thread-202.html)



are custom forces supported? - alex_ilin - 21-10-2017

Hi guys,

I want to buy your plugin, to port existent fluid-based game to Unity.
I have several questions:
- can I apply a force to a particle (for ex. i will have a sensor collider and all particles inside it should be accelerated by the force)
- is it possible to implement a friction like behaviour when particles slows down when touching some collider
- is it possible to directly change position/velocity of the particle (for ex. to implement teleport functionality)
- is it possible to add my own collisions solver with complex geometry object (i think it will be faster than your mesh collider), it will be an addition to your current collisions solver
- do you use your own rigid bodies physics or you use Unity rigid bodies?


RE: are custom forces supported? - josemendez - 21-10-2017

(21-10-2017, 02:51 PM)alex_ilin Wrote: Hi guys,

I want to buy your plugin, to port existent fluid-based game to Unity.
I have several questions:
- can I apply a force to a particle (for ex. i will have a sensor collider and all particles inside it should be accelerated by the force)
- is it possible to implement a friction like behaviour when particles slows down when touching some collider
- is it possible to directly change position/velocity of the particle (for ex. to implement teleport functionality)
- is it possible to add my own collisions solver with complex geometry object (i think it will be faster than your mesh collider), it will be an addition to your current collisions solver
- do you use your own rigid bodies physics or you use Unity rigid bodies?

Hi Alex!

- Yes you can apply forces to particles, and you can detect when a particle touches a collider / trigger.
- Friction/stickiness are supported by default. You can specify collision materials, which determine the behavior of particles upon collision. No need to roll your own.
- Yes, you can modify all particle properties directly.
- Nothing stops you from doing so since you can get/set particle positions and velocities, however our collision implementation is highly optimized (multithreaded c++ w/SSE intrinsics). Rolling your own might not be worth the effort (specially if you plan on doing so in C#), but you can still do it if you want to. In the next update we're going to include ADFs (adaptive distance fields), which achieve extremely fast and robust contact generation against arbitrary concave/convex meshes.
- We use Unity's standard rigidbodies. There's a thin wrapper component on top of them that applies impulses to/from particles, but that's all. 

Some interesting reading material:
http://obi.virtualmethodstudio.com/tutorials/collisions.html
http://obi.virtualmethodstudio.com/tutorials/scriptingcollisions.html
http://obi.virtualmethodstudio.com/tutorials/scriptingparticles.html

cheers,


RE: are custom forces supported? - alex_ilin - 25-10-2017

Thank you, bought it, 2 more questions:
- do you plan to support PolygonCollider2D?
- when you plan to release ADFs?


RE: are custom forces supported? - josemendez - 25-10-2017

(25-10-2017, 12:01 PM)alex_ilin Wrote: Thank you, bought it, 2 more questions:
- do you plan to support PolygonCollider2D?
- when you plan to release ADFs?

 The issue with PolygonCollider2D is that Unity does not currently have a way to retrieve the actual polygons that make it, so that we can feed that info to our lib. So we are pretty much screwed Triste

We are currently working on the ADFs user workflow (the core stuff is already implemented and working), they should be out late November.