Continue block collisions
This commit is contained in:
parent
011cd891c1
commit
fa66324833
4 changed files with 100 additions and 36 deletions
25
renderer.h
25
renderer.h
|
@ -16,7 +16,8 @@
|
|||
|
||||
/// Renderer specific unit, length of one map square.
|
||||
#define LCR_RENDERER_UNIT (S3L_F / 2)
|
||||
// ^ just S3L_F leaves some tris bugging
|
||||
// NOTE: ^ S3L_F sometimes makes some triangles bug, S3L_F/2 seems to fix it
|
||||
// but it's more jerky, maybe try to apply anti-overflow in S3L?
|
||||
|
||||
#define LCR_RENDERER_CHUNK_RESOLUTION 4 // do not change
|
||||
#define LCR_RENDERER_LOD_BLOCKS 64 // do not change
|
||||
|
@ -30,6 +31,10 @@
|
|||
#define LCR_RENDERER_MODEL_COUNT 10
|
||||
#define LCR_RENDERER_CAR_SCALE (LCR_RENDERER_UNIT / 4)
|
||||
|
||||
/** For some reason the map model is a bit misaligned with physics world, this
|
||||
kinda hotfixes it -- later try to discover source of this bug. TODO */
|
||||
#define _LCR_MAP_MODEL_SCALE 1034
|
||||
|
||||
struct
|
||||
{
|
||||
S3L_Scene scene;
|
||||
|
@ -615,15 +620,12 @@ uint8_t _LCR_buildMapModel(void)
|
|||
S3L_model3DInit(LCR_renderer.mapVerts,0,LCR_renderer.mapTris,0,
|
||||
&LCR_renderer.mapModel);
|
||||
|
||||
// TEMPORARY FIX: this scales the map so that it better aligns with the
|
||||
// physics world -- dunno why it's not aligned by default, investigate (if it's
|
||||
// numerical errors then at least make this a const)
|
||||
LCR_renderer.mapModel.transform.scale.x =
|
||||
(S3L_F * 1009) / 1000;
|
||||
LCR_renderer.mapModel.transform.scale.y =
|
||||
LCR_renderer.mapModel.transform.scale.x;
|
||||
LCR_renderer.mapModel.transform.scale.z =
|
||||
LCR_renderer.mapModel.transform.scale.x;
|
||||
LCR_renderer.mapModel.transform.scale.x =
|
||||
(_LCR_MAP_MODEL_SCALE * S3L_F) / 1024;
|
||||
LCR_renderer.mapModel.transform.scale.y
|
||||
= LCR_renderer.mapModel.transform.scale.x;
|
||||
LCR_renderer.mapModel.transform.scale.z
|
||||
= LCR_renderer.mapModel.transform.scale.x;
|
||||
|
||||
for (int j = 0; j < LCR_currentMap.blockCount; ++j)
|
||||
{
|
||||
|
@ -724,7 +726,8 @@ LCR_renderer.mapModel.transform.scale.z =
|
|||
}
|
||||
}
|
||||
|
||||
_LCR_rendererAddMapTri(triIndices[0],triIndices[1],triIndices[2],triData);
|
||||
_LCR_rendererAddMapTri(triIndices[0],triIndices[1],triIndices[2],
|
||||
triData);
|
||||
}
|
||||
|
||||
vi = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue