mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Custom collision boxes node property.
This commit is contained in:
parent
b11e1db809
commit
e5652cb75c
7 changed files with 35 additions and 5 deletions
|
@ -354,6 +354,15 @@ std::vector<aabb3f> MapNode::getNodeBoxes(INodeDefManager *nodemgr) const
|
|||
return transformNodeBox(*this, f.node_box, nodemgr);
|
||||
}
|
||||
|
||||
std::vector<aabb3f> MapNode::getCollisionBoxes(INodeDefManager *nodemgr) const
|
||||
{
|
||||
const ContentFeatures &f = nodemgr->get(*this);
|
||||
if (f.collision_box.fixed.empty())
|
||||
return transformNodeBox(*this, f.node_box, nodemgr);
|
||||
else
|
||||
return transformNodeBox(*this, f.collision_box, nodemgr);
|
||||
}
|
||||
|
||||
std::vector<aabb3f> MapNode::getSelectionBoxes(INodeDefManager *nodemgr) const
|
||||
{
|
||||
const ContentFeatures &f = nodemgr->get(*this);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue