#include "entity.h"
#include "ent_miniworld.h"
#include "world_render.h"
+#include "input.h"
static void ent_miniworld_call( world_instance *world, ent_call *call ){
ent_miniworld *miniworld = mdl_arritm( &world->ent_miniworld,
//render_world_routes( , &skaterift.cam, 1 );
}
+
+static void ent_miniworld_preupdate(void){
+ if( !global_miniworld.active_id )
+ return;
+
+ if( button_down( k_srbind_use ) ){
+
+ }
+}
world_static.focused_entity = 0;
world_static.active_trigger_volume_count = 0;
world_static.last_use = 0.0;
- global_miniworld.active_id = 0;
world_entity_unfocus();
localplayer.boundary_hash ^= NETMSG_BOUNDARY_BIT;
world_entity_focus_preupdate();
skaterift_replay_pre_update();
remote_sfx_pre_update();
+ ent_miniworld_preupdate();
world_update( world_current_instance(), localplayer.rb.co );
audio_ambient_sprites_update( world_current_instance(), localplayer.rb.co );
return;
}
+ world_instance *current =
+ &world_static.instances[ world_static.active_instance ];
+
if( index != world_static.active_instance ){
- world_instance *current =
- &world_static.instances[ world_static.active_instance ];
v3_copy( localplayer.rb.co, current->player_co );
v3_copy( localplayer.angles, current->player_angles );
+ v3_copy( localplayer.cam.pos, current->cam_co );
current->player_angles[3] = player_get_heading_yaw();
}
v3_copy( new->player_co, localplayer.rb.co );
v3_copy( new->player_angles, localplayer.angles );
+ v3_copy( new->cam_co, localplayer.cam.pos );
q_axis_angle( localplayer.rb.q, (v3f){0,1,0}, new->player_angles[3] );
+ /* run exit events on triggers */
+ for( u32 i=0; i<world_static.active_trigger_volume_count; i++ ){
+ i32 idx = world_static.active_trigger_volumes[i];
+ ent_volume *volume = mdl_arritm( ¤t->ent_volume, idx );
+
+ ent_call basecall;
+ basecall.function = k_ent_function_trigger_leave;
+ basecall.id = mdl_entity_id( k_ent_volume, idx );
+ basecall.data = NULL;
+ entity_call( current, &basecall );
+ }
+
world_static.active_instance = index;
player__reset();