phys->grind = 1;
v3f up = { 0.0f, 1.0f, 0.0f };
float angle = v3_dot( phys->rb.up, up );
- v3f axis;
- v3_cross( phys->rb.up, up, axis );
if( fabsf(angle) < 0.99f )
{
+ v3f axis;
+ v3_cross( phys->rb.up, up, axis );
+
v4f correction;
q_axis_angle( correction, axis,
VG_TIMESTEP_FIXED * 10.0f * acosf(angle) );
v3f lookdir = { 0.0f, 0.0f, -1.0f },
sidedir = { 1.0f, 0.0f, 0.0f };
- m3x3_mulv( camera_mtx, lookdir, lookdir );
- m3x3_mulv( camera_mtx, sidedir, sidedir );
+ m3x3_mulv( main_camera.transform, lookdir, lookdir );
+ m3x3_mulv( main_camera.transform, sidedir, sidedir );
static v3f move_vel = { 0.0f, 0.0f, 0.0f };
if( !rp )
{
vg_error( "No spawn found\n" );
+ vg_info( "Player position: %f %f %f\n", player.phys.rb.co[0],
+ player.phys.rb.co[1],
+ player.phys.rb.co[2] );
+ vg_info( "Player velocity: %f %f %f\n", player.phys.rb.v[0],
+ player.phys.rb.v[1],
+ player.phys.rb.v[2] );
+
if( !world.spawn_count )
return 0;