Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
minetest_game
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Illuna-Minetest
minetest_game
Commits
b4abb075
Commit
b4abb075
authored
7 years ago
by
paramat
Committed by
paramat
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Player_api: Integrate settable player collisionbox
parent
271b2bef
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
game_api.txt
+1
-0
1 addition, 0 deletions
game_api.txt
mods/player_api/api.lua
+2
-0
2 additions, 0 deletions
mods/player_api/api.lua
mods/player_api/init.lua
+1
-0
1 addition, 0 deletions
mods/player_api/init.lua
with
4 additions
and
0 deletions
game_api.txt
+
1
−
0
View file @
b4abb075
...
...
@@ -331,6 +331,7 @@ The player API can register player models and update the player's appearence
bar = {x = 20, y = 39},
-- ...
},
collisionbox = {-0.3, 0.0, -0.3, 0.3, 1.77, 0.3}, -- In nodes from centre of feet
}
...
...
This diff is collapsed.
Click to expand it.
mods/player_api/api.lua
+
2
−
0
View file @
b4abb075
...
...
@@ -45,12 +45,14 @@ function player_api.set_model(player, model_name)
textures
=
player_textures
[
name
]
or
model
.
textures
,
visual
=
"mesh"
,
visual_size
=
model
.
visual_size
or
{
x
=
1
,
y
=
1
},
collisionbox
=
model
.
collisionbox
or
{
-
0
.
3
,
0
.
0
,
-
0
.
3
,
0
.
3
,
1
.
77
,
0
.
3
},
})
player_api
.
set_animation
(
player
,
"stand"
)
else
player
:
set_properties
({
textures
=
{
"player.png"
,
"player_back.png"
,
},
visual
=
"upright_sprite"
,
collisionbox
=
{
-
0
.
3
,
0
.
0
,
-
0
.
3
,
0
.
3
,
1
.
75
,
0
.
3
},
})
end
player_model
[
name
]
=
model_name
...
...
This diff is collapsed.
Click to expand it.
mods/player_api/init.lua
+
1
−
0
View file @
b4abb075
...
...
@@ -13,6 +13,7 @@ player_api.register_model("character.b3d", {
walk_mine
=
{
x
=
200
,
y
=
219
,
},
sit
=
{
x
=
81
,
y
=
160
,
},
},
collisionbox
=
{
-
0
.
3
,
0
.
0
,
-
0
.
3
,
0
.
3
,
1
.
77
,
0
.
3
},
})
-- Update appearance when the player joins
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment