#include "player_render.h"
#include "camera.h"
#include "player_model.h"
+#include "ent_skateshop.h"
+#include "audio.h"
#include "shaders/model_character_view.h"
#include "shaders/model_board_view.h"
mdl_close( &ctx );
}
+/* TODO: allow error handling */
VG_STATIC void player_board_load( struct player_board *mdl, const char *path )
{
vg_linear_clear( vg_mem.scratch );
_player_post_animate[ player->subsystem ]( player );
struct player_avatar *av = player->playeravatar;
-
- struct player_board *board = player->board;
+ struct player_board *board = player_get_player_board( player );
v3f vp0, vp1;
v3_zero( vp1 );
}
- struct ub_world_lighting *ubo = &get_active_world()->ub_lighting;
+ struct ub_world_lighting *ubo = &world_current_instance()->ub_lighting;
m4x3_mulv( av->sk.final_mtx[ av->id_board ], vp0, ubo->g_board_0 );
m4x3_mulv( av->sk.final_mtx[ av->id_board ], vp1, ubo->g_board_1 );
+ if( player->immobile ){
+ player__cam_iterate( player );
+ return;
+ }
+
if( player->rewinding ){
if( player->rewind_time <= 0.0f ){
double taken = vg.time - player->rewind_start;
player->rewind_length = 1;
player->rewind_total_length = 0.0f;
player->rewind_accum = 0.0f;
- world_global.sky_target_rate = 1.0;
- world_global.time = world_global.last_use;
+ world_render.sky_target_rate = 1.0;
+ world_static.time = world_static.last_use;
}
else{
- world_global.sky_target_rate = -100.0;
+ world_render.sky_target_rate = -100.0;
float budget = vg.time_delta,
overall_length = player->rewind_length;
vg_alerpf( fr->ang[0], fr1->ang[0], sub );
player->cam_override_angles[1] =
vg_lerpf ( fr->ang[1], fr1->ang[1], sub );
+ player->cam_override_fov = player->cam.fov;
float blend = player->rewind_time * 0.25f;
player->cam_override_strength = vg_clampf( blend, 0.0f, 1.0f );
player__cam_iterate( player );
}
-enum board_shader{
- k_board_shader_player,
- k_board_shader_entity
-};
-
VG_STATIC void render_board( camera *cam, world_instance *world,
struct player_board *board, m4x3f root,
enum board_shader shader )
shader_model_board_view_uTexSceneDepth( 1 );
render_fb_inverse_ratio( gpipeline.fb_main, inverse );
+
inverse[2] = main_camera.farz-main_camera.nearz;
shader_model_board_view_uInverseRatioDepth( inverse );
inverse[2] = cam->farz-cam->nearz;
shader_model_character_view_uInverseRatioMain( inverse );
- world_instance *world = get_active_world();
+ world_instance *world = world_current_instance();
world_link_lighting_ub( world, _shader_model_character_view.id );
world_bind_position_texture( world, _shader_model_character_view.id,
_uniform_model_character_view_g_world_depth, 2 );
mesh_bind( &player->playermodel->mesh );
mesh_draw( &player->playermodel->mesh );
- struct player_board *board = player->board;
+ struct player_board *board = player_get_player_board( player );
render_board( cam, world, board, player->playeravatar->sk.final_mtx[
player->playeravatar->id_board],