Skip to content

Commit 2d5bd7f

Browse files
committed
Player properties: Set correct default collisionbox
Recent commit b6f4a9c removed a hardcoded player collisionbox which resulted on falling back to an incorrect default. This stopped players walking through 2-node high spaces and made the player slightly wider. Improve docs for custom player collisionbox feature and reformat nearby lines.
1 parent d067894 commit 2d5bd7f

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

doc/lua_api.txt

+14-10
Original file line numberDiff line numberDiff line change
@@ -3700,25 +3700,29 @@ Definition tables
37003700
{
37013701
hp_max = 1,
37023702
physical = true,
3703-
collide_with_objects = true, -- collide with other objects if physical=true
3703+
collide_with_objects = true, -- collide with other objects if physical = true
37043704
weight = 5,
3705-
collisionbox = {-0.5,-0.5,-0.5, 0.5,0.5,0.5},
3706-
visual = "cube"/"sprite"/"upright_sprite"/"mesh"/"wielditem",
3707-
visual_size = {x=1, y=1},
3708-
mesh = "model", -- for players (0, -1, 0) is ground level,
3709-
-- for all other entities (0, 0, 0) is ground level.
3705+
collisionbox = {-0.5, 0.0, -0.5, 0.5, 1.0, 0.5},
3706+
-- ^ For players (0, -1, 0) is at object base level,
3707+
-- for all other objects (0, 0, 0) is at object base level.
3708+
-- For example, Minetest Game player box is (-0.3, -1.0, -0.3, 0.3, 0.75, 0.3).
3709+
visual = "cube" / "sprite" / "upright_sprite" / "mesh" / "wielditem",
3710+
visual_size = {x = 1, y = 1},
3711+
mesh = "model",
37103712
textures = {}, -- number of required textures depends on visual
37113713
colors = {}, -- number of required colors depends on visual
3712-
spritediv = {x=1, y=1},
3713-
initial_sprite_basepos = {x=0, y=0},
3714+
spritediv = {x = 1, y = 1},
3715+
initial_sprite_basepos = {x = 0, y = 0},
37143716
is_visible = true,
37153717
makes_footstep_sound = false,
37163718
automatic_rotate = false,
37173719
stepheight = 0,
37183720
automatic_face_movement_dir = 0.0,
3719-
-- ^ automatically set yaw to movement direction; offset in degrees; false to disable
3721+
-- ^ Automatically set yaw to movement direction, offset in degrees,
3722+
-- 'false' to disable.
37203723
automatic_face_movement_max_rotation_per_sec = -1,
3721-
-- ^ limit automatic rotation to this value in degrees per second. values < 0 no limit
3724+
-- ^ Limit automatic rotation to this value in degrees per second,
3725+
-- value < 0 no limit.
37223726
backface_culling = true, -- false to disable backface_culling for model
37233727
nametag = "", -- by default empty, for players their name is shown if empty
37243728
nametag_color = <color>, -- sets color of nametag as ColorSpec

src/content_sao.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,7 @@ PlayerSAO::PlayerSAO(ServerEnvironment *env_, RemotePlayer *player_, u16 peer_id
798798
m_prop.hp_max = PLAYER_MAX_HP;
799799
m_prop.physical = false;
800800
m_prop.weight = PLAYER_DEFAULT_WEIGHT;
801-
m_prop.collisionbox = aabb3f(-1/3.,-1.0,-1/3., 1/3.,1.0,1/3.);
801+
m_prop.collisionbox = aabb3f(-0.3f, -1.0f, -0.3f, 0.3f, 0.75f, 0.3f);
802802
// start of default appearance, this should be overwritten by LUA
803803
m_prop.visual = "upright_sprite";
804804
m_prop.visual_size = v2f(1, 2);

0 commit comments

Comments
 (0)