mirror of
https://github.com/Relintai/mesh_data_resource.git
synced 2024-11-22 10:57:56 +01:00
Implement PropDataMeshData's get_node_for.
This commit is contained in:
parent
1746de7130
commit
ac6e09939d
@ -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);
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user