I’m trying to make a CAD/3d model style camera. To rotate around the point the mouse is on, I need to raycast from the mouse to the object to get the center of rotation. The raycast is having trouble detecting the curved part of the model that has smaller sections of the trimesh.
The model was imported from onshape as gtlf, and I added collision using a staticbody trimesh on the import settings. Here’s how I cast the ray if you need it:
var from: Vector3 = camera.project_ray_origin(get_viewport().get_mouse_position())
var to: Vector3 = from + camera.project_ray_normal(get_viewport().get_mouse_position()) * RAY_LENGTH
var query := PhysicsRayQueryParameters3D.create(from, to)
raycast_result = get_world_3d().direct_space_state.intersect_ray(query)
And the whole project if you want to check it out for yourself:
I assume you mean the collision shape for the object. Setting margin to 0 did nothing with and without backface_collision. backface_collision made it seem like the curve wasnt event there. When I rotated so the main part of the object behind the curve, it would hit the object behind the curve
Scale the mesh up in your 3d modelling app and use that. This size of triangles may be sufficiently small for floating point accuracy and numerical tolerance of the physics engine to come into play.
You’ll notice that your original small mesh cannot even be selected in the Godot 3d viewport if you click on the curved part.