I want my player to not be able to stand inside the walls. Each game tick my player moves a short distance and / or rotates.
TL DR, please provide a version of the classical triangle intersection triangle โ triangle, which also returns near misses or solves the problem in another way. . within a given distance from the triangle. There are many subtleties of the problem, for example, the angles of the locus of a triangle are rounded, and if the segment of the line is tangent to the triangle.
I have a regular ray / triangle intersection code.
However, the beam is a very poor approximation of a moving player! I have problems with missing edges in the center of the player, but a grid of players passes through them.
How do you effectively determine when and where a player is faced with walls and obstacles in a 3D environment?
One general approach would be to have a triangle with a gap, where the beam is a cylinder with balls.
The general decision I tried to make was to imagine that the player is a sphere; turning it inside out, I tried to make a grid whose radius is larger than the actual walls, and collisions overlap on it. I want to calculate a grid that is a fixed distance in front of that grid, i.e. The cube will expand to be a slightly larger cube with rounded edges and corners. (My grids are quite rare than the cube. Imagine the grid view inside the boiler room and imagine that you are trying to calculate a grid that is 20 cm from all walls, boilers and door frames, etc. In this room.) Here's a simple net around the trunk:

For each face, I can calculate the surface normal; so I know which way is "out".
My brainstorming makes me imagine that each person multiplied by a normal distance over a fixed distance and then emitted a triangle with a corresponding offset.
Would this, however, leave holes at the edges and possibly (?) Cause some ribs to pass through very dense sharp corners?
I can also imagine how to connect to each rib like ball cylinders, etc.
The approach I used for the trunk above is to calculate the average normal of all the faces dividing the vertex, and then multiply them by the radius of collision. He doesnโt do very well with sharp corners, and what if the top is falsely divided between faces that are on opposite sides?
I will compute this grid and then do ray intersections in Javacsript. Therefore, performance is also considered. Too thin a detailed grid will be expensive for collision detection.
How can you efficiently calculate a sufficient locus grid? Or the intersection of points with a fuzzy triangle? Or is there a better way to make a collision, and can it somehow simulate that things move in arcs rather than straight?