Latest Threads |
Fluid ignores colliders o...
Forum: Obi Fluid
Last Post: josemendez
Yesterday, 09:03 AM
» Replies: 2
» Views: 38
|
Particle attachments dont...
Forum: Obi Rope
Last Post: josemendez
13-02-2025, 03:09 PM
» Replies: 1
» Views: 102
|
Dynamic attachment to fix...
Forum: Obi Rope
Last Post: josemendez
12-02-2025, 02:52 PM
» Replies: 9
» Views: 339
|
Changing rope lenth creat...
Forum: Obi Rope
Last Post: josemendez
11-02-2025, 08:35 PM
» Replies: 3
» Views: 180
|
Preventing fabric from vi...
Forum: Obi Cloth
Last Post: josemendez
10-02-2025, 12:36 PM
» Replies: 1
» Views: 128
|
Trouble with Attachments
Forum: Obi Softbody
Last Post: beegon
07-02-2025, 08:29 PM
» Replies: 3
» Views: 229
|
Mesh creating
Forum: Obi Rope
Last Post: alicecatalano
07-02-2025, 11:28 AM
» Replies: 13
» Views: 22,503
|
Collider interactions
Forum: Obi Softbody
Last Post: josemendez
07-02-2025, 09:42 AM
» Replies: 1
» Views: 159
|
RuntimeRopeGenerator basi...
Forum: Obi Rope
Last Post: ayoci
04-02-2025, 04:30 PM
» Replies: 0
» Views: 1,545
|
static 2nd attachment cau...
Forum: Obi Rope
Last Post: josemendez
04-02-2025, 07:53 AM
» Replies: 1
» Views: 197
|
|
|
Obi7Beta | Fluid can not work with paused game and UI |
Posted by: spikebor - 06-05-2024, 06:12 PM - Forum: Obi Fluid
- Replies (2)
|
![](https://obi.virtualmethodstudio.com/forum/uploads/avatars/avatar_3684.jpg?dateline=1640157424) |
Hi, happy to have my first bug report for Obi 7 . The problem:
In my UI code, when menu opened, game is paused by setting
Code: Time.timeScale = Mathf.Epsilon;
Game is paused, but my UI can still work, I can click button and that button clicked will do some action.
This UI document can work with any scene, but when I open a Fluid scene (sample: ComputeFluids), when play the game and open UI menu, I can move the focus, but cannot click any button. Essentially, the "consume click" event of the UI Document is somehow stopped working?
So, my conclusion is Compute Fluid has some bug with Time.timeScale = Mathf.Epsilon; that will mess up my UI. It is not frozen, just not consume clicks.
Also, I suggest for a feature to pause ObiSolver from updating. Currently I can only disable ObiSolver when I do not want it to update, but by doing so, for example the Fluid, it will disappear. If the Fluid stop updating but still render, it can be neat for a stop time gameplay feature.
|
|
|
Setting angular velocity of a kinematic body is not supported |
Posted by: vrtraining - 06-05-2024, 02:38 PM - Forum: Obi Rope
- Replies (1)
|
![](https://obi.virtualmethodstudio.com/forum/images/default_avatar.png) |
Im getting this error
Code: Setting linear velocity of a kinematic body is not supported.
If I manually set my Game Object Rigidbody to Kinematic during runtime, I keep getting this error. Its coming from ObiRigidBody.cs
Code: private void UpdateKinematicVelocities(float stepTime)
{
// differentiate positions/orientations to get our own velocites for kinematic objects.
// when calling Physics.Simulate, MovePosition/Rotation do not work correctly. Also useful for animations.
if (unityRigidbody.isKinematic)
{
// differentiate positions to obtain linear velocity:
unityRigidbody.velocity = (transform.position - prevPosition) / stepTime;
// differentiate rotations to obtain angular velocity:
Quaternion delta = transform.rotation * Quaternion.Inverse(prevRotation);
unityRigidbody.angularVelocity = new Vector3(delta.x, delta.y, delta.z) * 2.0f / stepTime;
}
prevPosition = transform.position;
prevRotation = transform.rotation;
}
Any idea that I could suppress or get rid of this warning? Im using latest 6.5 version with Unity 2023.2.19f
|
|
|
Is there a way to query collisions with Obi Bone? |
Posted by: spikebor - 06-05-2024, 12:00 PM - Forum: Obi Rope
- Replies (5)
|
![](https://obi.virtualmethodstudio.com/forum/uploads/avatars/avatar_3684.jpg?dateline=1640157424) |
I want to detect collisions with this character (which has nothing on him other than Obi bone)
Can it be done, or he should have Collider? I think Obi Bone or not, it has particles under it as all Obi things, so I can query its collisions with my character (my character has Obi Collider)
I want to debug the impulse.
![[Image: AfR6o6v.png]](https://i.imgur.com/AfR6o6v.png)
The Golem can contact and push my character back, but this code (subscribed to character's solver.OnCollision event) returns no collisions.
Code: void Solver_OnCollision(object sender, ObiSolver.ObiCollisionEventArgs e)
{
foreach (Oni.Contact contact in e.contacts)
{
collisionsImpulse += contact.normalImpulse;
}
}
Even though I enable Collision and Particle Collision collision / Queries on my character.
|
|
|
Advection but for a mesh. |
Posted by: spikebor - 03-05-2024, 09:28 AM - Forum: Obi Fluid
- Replies (2)
|
![](https://obi.virtualmethodstudio.com/forum/uploads/avatars/avatar_3684.jpg?dateline=1640157424) |
I'm thinking about this idea for a while.
We got:
-Obi Fluid which is limited in particle count, making something like a pool will be hard on the GPU.
-Obi fluid can advect things near it, like shuriken particles.
So why can't we apply the same advection idea, but instead of shurikens, we apply it to the nearby mesh vertex?
So the idea is we have a pool of Obi fluid particles, which having very large particle scale, and not rendered.
With this we can have any object that jump into the pool will be physics collide and have buoyancy force to pull it up but with low particle count.
And on top we have a plane mesh for the surface, which advected by the Obi Fluid. This way the mesh can have deformation, this mesh can be Fluxy mesh which have 2.5D sim on top to give us detailed waves simulation, while the Obi Fuild give it bigger wave advection.
Isn't this a best of both world? You can make a bridge asset that have 2 requirements that are Fluxy and Obi Fluid. If you can add underwater rendering for it, it will sell like hot cakes.
|
|
|
Obi Fluid 6 not render on Window build |
Posted by: spikebor - 02-05-2024, 05:07 PM - Forum: Obi Fluid
- Replies (3)
|
![](https://obi.virtualmethodstudio.com/forum/uploads/avatars/avatar_3684.jpg?dateline=1640157424) |
Hi, I have this bug when test build on PC Window the Obi Fluid
Obi Fluid 6.5.4, works well on Editor using the Obi/URP/Particles.shader, but not work on PC build (x64 window).
Unity URP 2022.3.16f1
Do I miss any setup step?
Log:
Code: Particle rendering shader not suported.
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:LogWarning(Object)
Obi.ObiParticleRenderer:CreateMaterialIfNeeded()
Obi.ObiParticleRenderer:DrawParticles(ObiActor)
Obi.ObiActor:Interpolate()
Obi.ObiSolver:Interpolate(Single, Single)
Obi.ObiUpdater:Interpolate(Single, Single)
Obi.ObiFixedUpdater:Update()
--Stack Trace--
Obi Fluid Renderer not supported in this platform.
UnityEngine.Debug:LogWarning(Object)
Obi.ObiFluidRendererFeature:AddRenderPasses(ScriptableRenderer, RenderingData&)
UnityEngine.Rendering.RenderPipelineManager:DoRenderLoop_Internal(RenderPipelineAsset, IntPtr, Object)
|
|
|
I've made a bounce script, but don't know how to optimize |
Posted by: spikebor - 01-05-2024, 12:35 PM - Forum: Obi Softbody
- Replies (3)
|
![](https://obi.virtualmethodstudio.com/forum/uploads/avatars/avatar_3684.jpg?dateline=1640157424) |
Hi, the idea is simple, to improve the game feel when character make contact with the softbody.
I would like to have softbody handle OnContact by iterate the contacts and add the incoming contact impulse with a mult value,
so that we can have a squashed feel when character step on a slime.
When it works, it is very cool to look at !
But eventually it can be very easy to spiral into a dead performance degradation, since each time you got contact, you have to iterate the contacts, and then iterate the particles to detect which particle is near to add the bounce force.
For example: 10 contact, 1000 particles, that is 10000 iterations each time we got contact. Wow!
How can I optimize this?
Code: using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Obi;
using Unity.Mathematics;
namespace SPIKE.kIntegration
{
//when got some contact, be squashed by that contact in normal direction
[RequireComponent(typeof(ObiActor))]
public class ObiBouncer : MonoBehaviour
{
[SerializeField] ObiSolver _solver;
[SerializeField] float _propagate = 0.5f, _bounceForceMult = 10,_clampBounceForce=10;
[SerializeField] bool _debug;
ObiActor actor;
void Awake()
{
actor = GetComponent<ObiActor>();
}
void OnEnable()
{
_solver.OnCollision += Solver_OnCollision;
}
void OnDisable()
{
_solver.OnCollision -= Solver_OnCollision;
}
void Solver_OnCollision(object sender, ObiSolver.ObiCollisionEventArgs e)
{
var world = ObiColliderWorld.GetInstance();
// just iterate over all contacts in the current frame:
foreach (Oni.Contact contact in e.contacts)
{
// if this one is an actual collision:
if (contact.distance < 0.01)
{
Vector3 contactOnCollider = contact.pointB;
contactOnCollider = _solver.transform.TransformPoint(contactOnCollider);
Vector3 contactNm = contact.normal;
#if UNITY_EDITOR
if (_debug)
{
Debug.DrawLine(contactOnCollider, contactOnCollider + contactNm, Color.yellow, 2f);
}
#endif
//iterate the particles
for (int i = 0; i < actor.solverIndices.Length; ++i)
{
int solverIndex = actor.solverIndices[i];
//add bounce force based on the propagate distance
if (Vector3.Distance(actor.GetParticlePosition(solverIndex), contactOnCollider)
< _propagate)
{
var squashForce = contact.normal * math.min( contact.normalImpulse * _bounceForceMult,_clampBounceForce);
actor.solver.velocities[solverIndex] += squashForce;
}
}
}
}
}
}
}
|
|
|
|