-
-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Debug Renderer #89
Comments
Hello, Thanks! |
Cool. Are the types exposed on the C API or does it require a PR there as well? |
They are not exposed on the C API layer |
Debug Renderer (WIP) just landed in joltc, amerkoleci/joltc@0ab6b36 will add C# stuff soon. |
Debug Renderer just landed in commit 6236bfc: Cheers |
OMG! Thank you! I'll give it a try :D |
I had a Quick Look here on the
We are using Jolt on the server side. So my goal is to achieve something like PVD on PhysX. We'll create a tool which is listening on a given port like PVD. Then, the server at startup will connect to it. Every call on our I don't see any way we are signaled that a frame was completed on the current DebugRenderer API since we don't have the Again, thanks for our efforts and for quick reply! This |
tacking onto this, would it be possible to have sorted drawing somehow? For example in the draw settings specify that only bodies with objectlayer.moving should be drawn, for example? |
Take look here: https://github.com/amerkoleci/JoltPhysicsSharp/blob/main/src/JoltPhysicsSharp/DrawSettings.cs#L8 |
So I'm not entirely sure how filtering works, I see that for example that DrawSettings has "DrawShape" which is of type Bool8. Is this a flag thing? For example, how would I specify that I only want to draw shapes in ObjectLayers.Moving from DrawSettings? |
Not sure if this is supported by JoltPhysics, @jrouwe? |
There's the |
This is exactly what the |
@amerkoleci would it be possible to create bindings for this? |
Just added BodyDrawFilter support, https://github.com/amerkoleci/JoltPhysicsSharp/blob/main/src/JoltPhysicsSharp/BodyDrawFilter.cs |
Hey guys! Any suggestions about the questions above? |
The author answered |
Ah ok, sorry, I miss understood the Recorder part. In PVD recording means the writes to a static file which will later have to played back, got it. Will try it and report back. Thanks! |
got it thank you. Is there a way to retrieve the ObjectLayer from a specific body? I don't see any way to retrieve it from the body itself, or from the body interface. Should I be associating that data on my own with the userdata? |
Need to expose this to joltc and C# Meanwhile you can use: Passing the Body.ID |
Oh I see I guess I overlooked that in BodyInterface. Thanks!!! |
So it looks like both my program, as well as the newest release freeze when attempting to read the object layer both during the physics.update contact callbacks, as well as the draw filter as discussed above. This can be reproduced by using the Sample.cs and attempting to read the layer:
it does not appear to freeze when reading the layer outside of the physics.update loop. Edit - This is using .Net 8 |
PhysicsSystem::Update is heavily multi threaded. In callbacks you can only access the parameters that are passed to the function. Calling into the BodyInterface will attempt to lock a mutex that is already locked and will cause a deadlock. There is PhysicsSystem::GetBodyInterfaceNoLock to get a non locking version but you need to be extremely careful when using it or you will have race conditions. |
^ Is this still applicable to the Body.ObjectLayer property?
As in, exposing the property on Body is a workaround? |
I will add it Monday, not working on spare projects during weekend, patience! 😃 |
Just added missing methods in e6ec0fe |
DebugRenderer is working pretty damn well now. I got it rendering in One extra thing that would be cool is having the body ID also passed through as a parameter so you can be more selective of which bodies to show the debug lines. But I see its not even in the core library 🤔 so I'm not sure how only show some debug info, its all or nothing by the looks. It gets pretty expensive, especially once you get hundreds of thousands of vertex positions. |
If you want to draw parts of the world then use |
it is support Deterministic |
Is it intentional that bodies which are sensors are not drawn? |
not sure if this was a question, but as per the joltphysics repo:
I assume? this probably means the C# bindings version is too |
Not sure, will investigate |
Yes! |
Sensors are drawn in wireframe, perhaps wire frame rendering is not supported yet? |
Hello!
Is there bindings for the Debug Renderer from Jolt?
If yes, can you point me where is it as I couldn't find the types and overloads for it.
Thank you!
The text was updated successfully, but these errors were encountered: