Bigger
This commit is contained in:
@@ -27,6 +27,8 @@ function actor_player:on_init()
|
||||
local ent = engine.create_entity("weapon_ump")
|
||||
engine.add_entity_to_world(ent)
|
||||
self.m_weapon_entity_id = ent:get_id()
|
||||
|
||||
--engine.play_sound_3d("data/sounds/test/test_music_64Kbps.mp3", 0.0, 0.0, 0.0)
|
||||
end
|
||||
|
||||
function actor_player:on_shutdown()
|
||||
@@ -88,7 +90,10 @@ function actor_player:update_player_movement(dt)
|
||||
|
||||
local up_x, up_y, up_z = camera.get_up()
|
||||
local front_x, front_y, front_z = camera.get_front()
|
||||
front_y = 0.0
|
||||
|
||||
if not self:is_noclip() then
|
||||
front_y = 0.0
|
||||
end
|
||||
|
||||
local final_front_x, final_front_y, final_front_z = vec3_normalize(front_x, front_y, front_z)
|
||||
local cross_x, cross_y, cross_z = vec3_cross(final_front_x, final_front_y, final_front_z,
|
||||
@@ -128,6 +133,15 @@ function actor_player:update_player_movement(dt)
|
||||
local vel_y = dir_y * speed
|
||||
local vel_z = dir_z * speed
|
||||
|
||||
if self:is_noclip() then
|
||||
if (movement & EMovementDir_None) ~= 0 then
|
||||
self:set_velocity(vel_x, vel_y, vel_z)
|
||||
else
|
||||
self:set_velocity(0, 0, 0)
|
||||
end
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
if self:on_ground() then
|
||||
self:set_velocity(vel_x, current_vel_y, vel_z)
|
||||
@@ -142,6 +156,8 @@ function actor_player:update_player_movement(dt)
|
||||
local air_vel_z = current_vel_z + dir_z * speed * AIR_CONTROL * dt
|
||||
self:set_velocity(air_vel_x, current_vel_y, air_vel_z)
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
local g_yaw = 0.0
|
||||
|
||||
@@ -4,7 +4,7 @@ local BLUE_COLOR = { 0.0, 0.0, 1.0, 1.0 }
|
||||
local BLACK_COLOR = { 0.0, 0.0, 0.0, 1.0 }
|
||||
local WHITE_COLOR = { 1.0, 1.0, 1.0, 1.0 }
|
||||
|
||||
local draw_test_hud = true
|
||||
local draw_test_hud = false
|
||||
local draw_debug_string = false
|
||||
local debug_string_text = ""
|
||||
local debug_string_time = 0.0
|
||||
|
||||
Reference in New Issue
Block a user