Add logs and checks
This commit is contained in:
parent
28a1256a88
commit
e9f919052c
5 changed files with 104 additions and 10 deletions
18
racing.h
18
racing.h
|
@ -246,7 +246,8 @@ TPE_Vec3 _LCR_racingEnvironmentFunction(TPE_Vec3 point, TPE_Unit maxDist)
|
|||
}
|
||||
else
|
||||
{
|
||||
printf("oof\n");
|
||||
LCR_LOG1("collision checking all blocks (shouldn't happen often!)");
|
||||
|
||||
const uint8_t *block = LCR_currentMap.blocks;
|
||||
|
||||
/* Full check of all map blocks, slow, shouldn't happen often! */
|
||||
|
@ -299,6 +300,8 @@ LCR_GameUnit _LCR_racingSmoothRot(LCR_GameUnit angleNew, LCR_GameUnit angleOld)
|
|||
*/
|
||||
void LCR_racingRestart(void)
|
||||
{
|
||||
LCR_LOG0("restarting race");
|
||||
|
||||
LCR_racing.tick = 0;
|
||||
|
||||
TPE_bodyActivate(&(LCR_racing.carBody));
|
||||
|
@ -320,7 +323,7 @@ void LCR_racingRestart(void)
|
|||
*/
|
||||
void LCR_racingInit(void)
|
||||
{
|
||||
LCR_log("initializing racing engine");
|
||||
LCR_LOG0("initializing racing engine");
|
||||
|
||||
// make the car body:
|
||||
TPE_makeCenterRectFull(LCR_racing.carJoints,
|
||||
|
@ -361,6 +364,8 @@ void LCR_racingInit(void)
|
|||
void LCR_racingGetCarTransform(LCR_GameUnit position[3],
|
||||
LCR_GameUnit rotation[3], LCR_GameUnit interpolationParam)
|
||||
{
|
||||
LCR_LOG2("getting car transform");
|
||||
|
||||
TPE_Vec3 v;
|
||||
|
||||
#if LCR_SETTING_SMOOTH_ANIMATIONS
|
||||
|
@ -435,6 +440,8 @@ void _LCR_racingWheelAccelerate(unsigned int wheel, TPE_Vec3 dir)
|
|||
*/
|
||||
void LCR_racingStep(unsigned int input)
|
||||
{
|
||||
LCR_LOG2("racing step start");
|
||||
|
||||
TPE_Vec3 carForw, carRight, carUp;
|
||||
|
||||
carForw = TPE_vec3Normalized(TPE_vec3Plus(
|
||||
|
@ -546,7 +553,10 @@ void LCR_racingStep(unsigned int input)
|
|||
TPE_bodyApplyGravity(&(LCR_racing.carBody),LCR_GRAVITY);
|
||||
|
||||
LCR_racing.wheelCollisions <<= 4;
|
||||
|
||||
LCR_LOG2("gonna step physics engine");
|
||||
TPE_worldStep(&(LCR_racing.physicsWorld));
|
||||
LCR_LOG2("stepping physics engine done");
|
||||
|
||||
if (TPE_vec3Dot(carUp,TPE_vec3Minus(LCR_racing.carBody.joints[4].position,
|
||||
LCR_racing.carBody.joints[0].position)) < 0)
|
||||
|
@ -588,11 +598,15 @@ void LCR_racingStep(unsigned int input)
|
|||
LCR_racing.carRotations[0] = tmpVec;
|
||||
|
||||
LCR_racing.tick++;
|
||||
|
||||
LCR_LOG2("racing step end");
|
||||
}
|
||||
|
||||
void LCR_physicsDebugDraw(LCR_GameUnit camPos[3], LCR_GameUnit camRot[2],
|
||||
LCR_GameUnit camFov)
|
||||
{
|
||||
LCR_LOG2("drawing physics debug overlay");
|
||||
|
||||
TPE_Vec3 cPos, cRot, cView;
|
||||
|
||||
cPos.x = (camPos[0] * LCR_PHYSICS_UNIT) / LCR_GAME_UNIT;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue