diff --git a/props/prop_data.cpp b/props/prop_data.cpp index 151efa3..74fb979 100644 --- a/props/prop_data.cpp +++ b/props/prop_data.cpp @@ -112,6 +112,20 @@ void PropData::add_textures_into(Ref texture_packer) { } #endif +bool PropData::get_is_room() const { + return _is_room; +} +void PropData::set_is_room(const bool value) { + _is_room = value; +} + +PoolVector3Array PropData::get_room_bounds() { + return _room_bounds; +} +void PropData::set_room_bounds(const PoolVector3Array &bounds) { + _room_bounds = bounds; +} + void PropData::copy_from(const Ref &prop_data) { _id = prop_data->_id; _snap_to_mesh = prop_data->_snap_to_mesh; @@ -129,6 +143,7 @@ void PropData::copy_from(const Ref &prop_data) { PropData::PropData() { _id = 0; _snap_to_mesh = false; + _is_room = false; _snap_axis = Vector3(0, -1, 0); } PropData::~PropData() { @@ -159,5 +174,13 @@ void PropData::_bind_methods() { ClassDB::bind_method(D_METHOD("add_textures_into", "texture_packer"), &PropData::add_textures_into); #endif + ClassDB::bind_method(D_METHOD("get_is_room"), &PropData::get_is_room); + ClassDB::bind_method(D_METHOD("set_is_room", "value"), &PropData::set_is_room); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "is_room"), "set_is_room", "get_is_room"); + + ClassDB::bind_method(D_METHOD("get_room_bounds"), &PropData::get_room_bounds); + ClassDB::bind_method(D_METHOD("set_room_bounds", "value"), &PropData::set_room_bounds); + ADD_PROPERTY(PropertyInfo(Variant::POOL_VECTOR3_ARRAY, "room_bounds"), "set_room_bounds", "get_room_bounds"); + ClassDB::bind_method(D_METHOD("copy_from", "prop_data"), &PropData::copy_from); } diff --git a/props/prop_data.h b/props/prop_data.h index b0dd9bb..0d1beb2 100644 --- a/props/prop_data.h +++ b/props/prop_data.h @@ -73,6 +73,12 @@ public: void add_textures_into(Ref texture_packer); #endif + bool get_is_room() const; + void set_is_room(const bool value); + + PoolVector3Array get_room_bounds(); + void set_room_bounds(const PoolVector3Array &bounds); + void copy_from(const Ref &prop_data); PropData(); @@ -87,6 +93,9 @@ private: Vector3 _snap_axis; Vector> _props; + + bool _is_room; + PoolVector3Array _room_bounds; }; #endif