summaryrefslogtreecommitdiff
path: root/src/mapnode_contentfeatures.h
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-11-13 12:31:05 +0200
committerPerttu Ahola <celeron55@gmail.com>2011-11-29 19:13:41 +0200
commit79c9f14aec52c0fa1b3c2b1850ab3c6a9124a313 (patch)
tree7d156fda616c189df7231301f6d954b6cd4d5f88 /src/mapnode_contentfeatures.h
parent2ef414d05fdfea7b0ced6dbfde254e3421f36162 (diff)
downloadminetest-79c9f14aec52c0fa1b3c2b1850ab3c6a9124a313.tar.gz
minetest-79c9f14aec52c0fa1b3c2b1850ab3c6a9124a313.tar.bz2
minetest-79c9f14aec52c0fa1b3c2b1850ab3c6a9124a313.zip
Generalize selection boxes
Diffstat (limited to 'src/mapnode_contentfeatures.h')
-rw-r--r--src/mapnode_contentfeatures.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/mapnode_contentfeatures.h b/src/mapnode_contentfeatures.h
index b60fc8d8b..7dd9df13b 100644
--- a/src/mapnode_contentfeatures.h
+++ b/src/mapnode_contentfeatures.h
@@ -57,6 +57,35 @@ enum LiquidType
LIQUID_SOURCE
};
+enum NodeBoxType
+{
+ NODEBOX_REGULAR, // Regular block; allows buildable_to
+ NODEBOX_FIXED, // Static separately defined box
+ NODEBOX_WALLMOUNTED, // Box for wall_mounted nodes; (top, bottom, side)
+};
+
+struct NodeBox
+{
+ enum NodeBoxType type;
+ // NODEBOX_REGULAR (no parameters)
+ // NODEBOX_FIXED
+ core::aabbox3d<f32> fixed;
+ // NODEBOX_WALLMOUNTED
+ core::aabbox3d<f32> wall_top;
+ core::aabbox3d<f32> wall_bottom;
+ core::aabbox3d<f32> wall_side; // being at the -X side
+
+ NodeBox():
+ type(NODEBOX_REGULAR),
+ // default is rail-like
+ fixed(-BS/2, -BS/2, -BS/2, BS/2, -BS/2+BS/16., BS/2),
+ // default is sign/ladder-like
+ wall_top(-BS/2, BS/2-BS/16., -BS/2, BS/2, BS/2, BS/2),
+ wall_bottom(-BS/2, -BS/2, -BS/2, BS/2, -BS/2+BS/16., BS/2),
+ wall_side(-BS/2, -BS/2, -BS/2, -BS/2+BS/16., BS/2, BS/2)
+ {}
+};
+
struct MapNode;
class NodeMetadata;
@@ -149,6 +178,8 @@ struct ContentFeatures
DiggingPropertiesList digging_properties;
u32 damage_per_second;
+
+ NodeBox selection_box;
// NOTE: Move relevant properties to here from elsewhere
@@ -186,6 +217,7 @@ struct ContentFeatures
light_source = 0;
digging_properties.clear();
damage_per_second = 0;
+ selection_box = NodeBox();
}
ContentFeatures()