Implement PropDataMeshData's get_node_for.

This commit is contained in:
Relintai 2020-07-05 22:16:38 +02:00
parent 1746de7130
commit ac6e09939d
2 changed files with 11 additions and 0 deletions

View File

@ -81,6 +81,16 @@ void PropDataMeshData::_processor_process(Ref<PropData> prop_data, Node *node, c
prop_data->add_prop(m);
}
Node *PropDataMeshData::_processor_get_node_for(const Transform &transform) {
MeshDataInstance *i = memnew(MeshDataInstance);
i->set_mesh_data(get_mesh());
i->set_texture(get_texture());
i->set_transform(transform * get_transform());
return i;
}
PropDataMeshData::PropDataMeshData() {
_snap_to_mesh = false;
_snap_axis = Vector3(0, 1, 0);

View File

@ -60,6 +60,7 @@ public:
bool _processor_handles(Node *node);
void _processor_process(Ref<PropData> prop_data, Node *node, const Transform &transform);
Node *_processor_get_node_for(const Transform &transform);
PropDataMeshData();
~PropDataMeshData();