Fix culling bug

This commit is contained in:
Miloslav Ciz 2025-02-20 15:57:34 +01:00
parent ff3830cb02
commit dab40e47bc
5 changed files with 29 additions and 9 deletions

View file

@ -1,5 +1,8 @@
=========== GENERAL ============== =========== GENERAL ==============
- culling is very slow now, it showed that distance bailout can accelerate it
a lot, try to make a more accurate bailaout and see if it's faster (watch
out for bugs due to false positives)
- improve the car unstucking? maybe we can just keep the position of the car - improve the car unstucking? maybe we can just keep the position of the car
and ONE wheel (other joint positions can be computed) and ONE wheel (other joint positions can be computed)
- some kind of special map block that would say where 3D triangles don't have - some kind of special map block that would say where 3D triangles don't have

29
data
View file

@ -4,9 +4,28 @@
#Btestmap; #Btestmap;
#Maaaaa;4321 0 #Maaaaa;4321 0
:*B1vJ :!wct :!wcA :*B2vJ
:=n0s :fiba
:xo1t :fgb8
:]o1tI :fg11 :|o2tI :fg11 box
:]o1A :fg11 :|o2A :fg11 :=n0s :fida
:=n6s2 :fi1a
:xo2t :fgm8
:^ocs2 :fg11 :vncs2L
:^ocB2I :fg11 :vEcs2I
:^nct2J :f118 :vncB2
:^Ect2L :f118 :vEcB2J
:xo1w :fg12
ramps
:]o2tI :fg11 :|o3tI :fg11
:'o1uI :fg11
:<o1vI :fg11
:]o2A :fg11 :|o3A :fg11
:'o1z :fg11
:<o1y :fg11
finish
:!vdt :!vdA

2
map.h
View file

@ -800,9 +800,7 @@ void LCR_mapGetBlockShape(uint8_t blockType, uint8_t transform,
case LCR_BLOCK_LEFT: case LCR_BLOCK_LEFT:
case LCR_BLOCK_BOTTOM_LEFT: case LCR_BLOCK_BOTTOM_LEFT:
case LCR_BLOCK_BOTTOM_LEFT_FRONT: case LCR_BLOCK_BOTTOM_LEFT_FRONT:
case LCR_BLOCK_LEFT_FRONT: case LCR_BLOCK_LEFT_FRONT:
case LCR_BLOCK_FULL_ACCEL: case LCR_BLOCK_FULL_ACCEL:
case LCR_BLOCK_FULL_FAN: case LCR_BLOCK_FULL_FAN:
case LCR_BLOCK_BOTTOM_ACCEL: case LCR_BLOCK_BOTTOM_ACCEL:

View file

@ -54,7 +54,7 @@ typedef int32_t LCR_GameUnit; ///< abstract game unit
#include "tinyphysicsengine.h" #include "tinyphysicsengine.h"
#define LCR_GRAVITY (LCR_PHYSICS_UNIT / 160) #define LCR_GRAVITY (LCR_PHYSICS_UNIT / 160)
#define LCR_FAN_FORCE 3 #define LCR_FAN_FORCE 4
#define LCR_FAN_FORCE_DECREASE 6 #define LCR_FAN_FORCE_DECREASE 6
#define LCR_CAR_FORWARD_FRICTION (TPE_F / 180) #define LCR_CAR_FORWARD_FRICTION (TPE_F / 180)

View file

@ -594,7 +594,7 @@ uint8_t _LCR_rendererCheckMapTriCover(const S3L_Index *t1, const S3L_Index *t2)
S3L_abs(vertices[0][0] - vertices[3][0]) + S3L_abs(vertices[0][0] - vertices[3][0]) +
S3L_abs(vertices[0][1] - vertices[3][1]) + S3L_abs(vertices[0][1] - vertices[3][1]) +
S3L_abs(vertices[0][2] - vertices[3][2]) > S3L_abs(vertices[0][2] - vertices[3][2]) >
(3 * LCR_RENDERER_UNIT / 2)) (3 * LCR_RENDERER_UNIT))
return 0; return 0;
vertices[1] = LCR_renderer.mapVerts + 3 * t1[1]; vertices[1] = LCR_renderer.mapVerts + 3 * t1[1];