summaryrefslogtreecommitdiff
path: root/scene/resources
diff options
context:
space:
mode:
authorclayjohn <claynjohn@gmail.com>2019-02-08 20:59:09 -0800
committerclayjohn <claynjohn@gmail.com>2019-02-08 20:59:09 -0800
commit20ff01b8e4e2c6b94463f15d69b7bf51e5b13ba1 (patch)
treeee597150932dc5e5a56a1a4eb837d3dcd51131ea /scene/resources
parent4fd579b271e1b5274266843b9b19ed60f4c8a9a1 (diff)
added ability to set instance_transform_2d in multimesh
Diffstat (limited to 'scene/resources')
-rw-r--r--scene/resources/multimesh.cpp13
-rw-r--r--scene/resources/multimesh.h2
2 files changed, 15 insertions, 0 deletions
diff --git a/scene/resources/multimesh.cpp b/scene/resources/multimesh.cpp
index 7084c3b4e1..1b406551ab 100644
--- a/scene/resources/multimesh.cpp
+++ b/scene/resources/multimesh.cpp
@@ -166,11 +166,22 @@ void MultiMesh::set_instance_transform(int p_instance, const Transform &p_transf
VisualServer::get_singleton()->multimesh_instance_set_transform(multimesh, p_instance, p_transform);
}
+
+void MultiMesh::set_instance_transform_2d(int p_instance, const Transform2D &p_transform) {
+
+ VisualServer::get_singleton()->multimesh_instance_set_transform_2d(multimesh, p_instance, p_transform);
+}
+
Transform MultiMesh::get_instance_transform(int p_instance) const {
return VisualServer::get_singleton()->multimesh_instance_get_transform(multimesh, p_instance);
}
+Transform2D MultiMesh::get_instance_transform_2d(int p_instance) const {
+
+ return VisualServer::get_singleton()->multimesh_instance_get_transform_2d(multimesh, p_instance);
+}
+
void MultiMesh::set_instance_color(int p_instance, const Color &p_color) {
VisualServer::get_singleton()->multimesh_instance_set_color(multimesh, p_instance, p_color);
@@ -245,7 +256,9 @@ void MultiMesh::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_instance_count", "count"), &MultiMesh::set_instance_count);
ClassDB::bind_method(D_METHOD("get_instance_count"), &MultiMesh::get_instance_count);
ClassDB::bind_method(D_METHOD("set_instance_transform", "instance", "transform"), &MultiMesh::set_instance_transform);
+ ClassDB::bind_method(D_METHOD("set_instance_transform_2d", "instance", "transform"), &MultiMesh::set_instance_transform_2d);
ClassDB::bind_method(D_METHOD("get_instance_transform", "instance"), &MultiMesh::get_instance_transform);
+ ClassDB::bind_method(D_METHOD("get_instance_transform_2d", "instance"), &MultiMesh::get_instance_transform_2d);
ClassDB::bind_method(D_METHOD("set_instance_color", "instance", "color"), &MultiMesh::set_instance_color);
ClassDB::bind_method(D_METHOD("get_instance_color", "instance"), &MultiMesh::get_instance_color);
ClassDB::bind_method(D_METHOD("set_instance_custom_data", "instance", "custom_data"), &MultiMesh::set_instance_custom_data);
diff --git a/scene/resources/multimesh.h b/scene/resources/multimesh.h
index 4e70907399..ac2c69e022 100644
--- a/scene/resources/multimesh.h
+++ b/scene/resources/multimesh.h
@@ -94,7 +94,9 @@ public:
int get_instance_count() const;
void set_instance_transform(int p_instance, const Transform &p_transform);
+ void set_instance_transform_2d(int p_instance, const Transform2D &p_transform);
Transform get_instance_transform(int p_instance) const;
+ Transform2D get_instance_transform_2d(int p_instance) const;
void set_instance_color(int p_instance, const Color &p_color);
Color get_instance_color(int p_instance) const;