Closed Silentor closed 5 years ago
Write Barycentric2DCoords() and LineTriangleIntersection() optimized for grid triangles
Implemented unit triangles barycentric 2d optimized calculation
Ok, next step - take into account block material and block surface inclination to modify speed. And make steering along unpassable blocks. Steering leads to simplest contact resolution.
There are some ways to calculate normals: 1) Per block - normal of block based on height of 4 adjacent blocks 2) Per block - normal of 8 adjacent blocks 3) Per block - average of normals of 4 height vertices (based on height of their adjacent vertices) 4) Per block - average of two normals based on normals of each triangle of quad 5) Per triangle - basically two normals per block based on each triangle (useful for very curved blocks) Need testing
It looks like I don't need Block height to generate and store, because simulation mostly use a vertex mesh. So I can skip GenerateHeightmap step in Micromap and generate heightmap directly with the blocks. But it means two iterations on zone area :(
Ok, next step - prevent actor to move on very steep and vertical blocks. Implement steering along impassable blocks
Ok, simplest first person navigation works. Time to implement pathfinding
Based on #96. Actor height interpolated from heightmap vertices. Actor speed based on block material and block inclination. Prevent climb on very steep blocks. Take into account: combined blocks can have vertical side. Should I collapse vertical sides for overlapped blocks? Vertical sides can enrich map, but make raycasting/colliding/visualization far more complex (where should I store vertical part texture?)