summaryrefslogtreecommitdiff
path: root/src/mapnode.cpp
diff options
context:
space:
mode:
authorRealBadAngel <maciej.kasatkin@o2.pl>2014-10-18 18:46:16 +0200
committerRealBadAngel <maciej.kasatkin@o2.pl>2014-10-19 20:48:21 +0200
commite5652cb75cd891895fab50ce46eb34ab9734d160 (patch)
treef3a58632b605ad4df441dbada879a8ec4170cf0f /src/mapnode.cpp
parentb11e1db809aebc22f26887fffd50bd37f1fb6c3a (diff)
downloadminetest-e5652cb75cd891895fab50ce46eb34ab9734d160.tar.gz
minetest-e5652cb75cd891895fab50ce46eb34ab9734d160.tar.bz2
minetest-e5652cb75cd891895fab50ce46eb34ab9734d160.zip
Custom collision boxes node property.
Diffstat (limited to 'src/mapnode.cpp')
-rw-r--r--src/mapnode.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mapnode.cpp b/src/mapnode.cpp
index d52677be0..786224240 100644
--- a/src/mapnode.cpp
+++ b/src/mapnode.cpp
@@ -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);