summaryrefslogtreecommitdiff
path: root/src/nodedef.h
diff options
context:
space:
mode:
authorKahrl <kahrl@gmx.net>2012-03-19 04:25:09 +0100
committerPerttu Ahola <celeron55@gmail.com>2012-06-17 16:34:39 +0300
commit1575448b1a71dd029a8d135d2aff9096483a9953 (patch)
tree3e4c7a68abbcf630484615e6ee202f2f0d83ade2 /src/nodedef.h
parent9f031a67594162a53b07acbfbc65faf8c4938e99 (diff)
downloadminetest-1575448b1a71dd029a8d135d2aff9096483a9953.tar.gz
minetest-1575448b1a71dd029a8d135d2aff9096483a9953.tar.bz2
minetest-1575448b1a71dd029a8d135d2aff9096483a9953.zip
Custom boxy nodes (stairs, slabs) and collision changes
Diffstat (limited to 'src/nodedef.h')
-rw-r--r--src/nodedef.h26
1 files changed, 11 insertions, 15 deletions
diff --git a/src/nodedef.h b/src/nodedef.h
index fcd06be71..7c6931834 100644
--- a/src/nodedef.h
+++ b/src/nodedef.h
@@ -65,7 +65,7 @@ enum LiquidType
enum NodeBoxType
{
NODEBOX_REGULAR, // Regular block; allows buildable_to
- NODEBOX_FIXED, // Static separately defined box
+ NODEBOX_FIXED, // Static separately defined box(es)
NODEBOX_WALLMOUNTED, // Box for wall mounted nodes; (top, bottom, side)
};
@@ -74,22 +74,16 @@ struct NodeBox
enum NodeBoxType type;
// NODEBOX_REGULAR (no parameters)
// NODEBOX_FIXED
- core::aabbox3d<f32> fixed;
+ std::vector<aabb3f> 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)
- {}
+ aabb3f wall_top;
+ aabb3f wall_bottom;
+ aabb3f wall_side; // being at the -X side
+ NodeBox()
+ { reset(); }
+
+ void reset();
void serialize(std::ostream &os) const;
void deSerialize(std::istream &is);
};
@@ -143,6 +137,7 @@ enum NodeDrawType
NDT_PLANTLIKE,
NDT_FENCELIKE,
NDT_RAILLIKE,
+ NDT_NODEBOX,
};
#define CF_SPECIAL_COUNT 2
@@ -217,6 +212,7 @@ struct ContentFeatures
// Amount of light the node emits
u8 light_source;
u32 damage_per_second;
+ NodeBox node_box;
NodeBox selection_box;
// Compatibility with old maps
// Set to true if paramtype used to be 'facedir_simple'