#include "skeleton.h"
#include "player_model.h"
-VG_STATIC float
- k_walkspeed = 10.0f,
- k_airspeed = 2.0f,
- k_stopspeed = 4.0f,
- k_walk_accel = 10.0f,
- k_walk_air_accel = 7.0f,
- k_walk_friction = 10.0f,
- k_walk_step_height = 0.2f;
-
struct player_device_walk
{
rb_capsule collider;
}
activity;
}
- state;
+ state,
+ state_gate_storage;
enum mdl_surface_prop surface;
cam->fov = 90.0f;
}
+VG_STATIC void player_walk_transport( player_interface *player,
+ player_attachment *at,
+ teleport_gate *gate )
+{
+ struct player_device_walk *w = at->storage;
+
+ m4x3_mulv( gate->transport, player->rb.co, player->rb.co );
+ m3x3_mulv( gate->transport, player->rb.v, player->rb.v );
+
+ /* analytical rotation of yaw */
+ v3f fwd_dir = { cosf(w->state.angles[0]),
+ 0.0f,
+ sinf(w->state.angles[0])};
+ m3x3_mulv( gate->transport, fwd_dir, fwd_dir );
+ w->state.angles[0] = atan2f( fwd_dir[2], fwd_dir[0] );
+
+ w->state_gate_storage = w->state;
+ player_apply_transport_to_cam( gate->transport );
+}
+
VG_STATIC player_device player_device_walk =
{
.pre_update = player_walk_pre_update,
.get_camera = player_walk_get_camera,
.debug_ui = player_walk_ui,
.bind = player_walk_bind,
- .pose = player_walk_pose
+ .pose = player_walk_pose,
+ .gate_transport= player_walk_transport
};
#endif /* PLAYER_DEVICE_WALK_H */