-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
[Bullet] RayCast collision noise near edge of static body #49163
Comments
AFAIK physics bodies should NOT be scaled EVER. |
Scaling collision shapes uniformly should be fine, but scaling non-uniformly is not. So yes, you need to adjust the shape's extents instead of scaling it. |
@goatchurchprime Can you reproduce this on 3.4.2, with Bullet and GodotPhysics as the 3D physics engine? |
I had to ask elsewhere about how to change the physics engine (it's in the editor settings). The ray cast problem seems to be gone when I tested in my game. (I have not tested with the minimal reproduction project). As I said above, the issue is probably caused by scaling the margin when scaling the cuboid body. (This should be allowed since a scaled cuboid body is still a cuboid body, and it's a quick way of changing its dimensions at the same time as the visible mesh object it represents.) However, I encountered other dithering issues to do with my KineticBody that I will have to investigate when I switch engine. tunnelvr_v0.7.DEBUG.2022-01-26.13-44-18.mp4I also tried out my standard test of throwing out 50 boulder shaped objects and letting them fall as PhysicBodies and found that GodotPhysics reduced to a frame rate down to 1 per second (there is no frame rate drop with BulletPhysics). I am hoping this is because GodotPhysics has not been (prematurely) optimized. |
The physics engine is configured in the project settings, not the editor settings 🙂 PS: You need to add a line break before and after video URLs to enable inline previews. I edited your comment accordingly, but remember to do this in the future. |
Collision noise near edges is still here on Bullet engine, but not on GodotPhysics engine. 2022-04-16.21-03-41.mp4RayCast is being cast from the middle of the head, behind the player to make 3rd person camera collisions with terrain and objects. 2022-04-16.21-10-05.mp4I thought that Bullet engine might account player movements to 'predict' future collision. Unfortunately, collision noise appears even when player is neither moving (seen in first video at 0:30 - 0:32) nor rotating camera. |
Godot version:
Godot 3.3.2-stable
OS/device including version:
Linux
Issue description:
A RayCast cursor from the player's hand is used to select and draw onto different surfaces flashes in and out of contact as they move the ray off the edge of the surface.
The minimal reproduction project makes 0.1mm steps through a series of origin points for the RayCast and shows how the collider goes in and out of existence.
Steps to reproduce:
The CollisionShape in the StaticBody is a (1,1,0.01) Box.
I scale the StaticBody by (25,25,1) to set it to the size I want it to be, because this is more convenient than having to set the Box size and the scale on the visible Mesh object individually. The StaticBody is where I can do both at once.
I suspect (but am not sure) my
margin
is somehow getting scaled by 25 up from 0.01 to 0.25 in the X and Y planes, and that the RayCast algorithm treats this as a tolerance value and considers it optional whether or not a RayCast passing outside the object but within the margin reports a collision.To avoid this noise I would like to set this margin to 0.0, but this is not allowed. However, I could hack values below the minimum allowed by creating a large surface and scaling everything proportionally down -- if margins are being scaled.
But why would the CollisionShape margin being scaled at all, since its effects and use (for performance) take place in the global space?
Minimal reproduction project:
raycast_dither.zip
The text was updated successfully, but these errors were encountered: