diff --git a/modules/gdnative/gdnative/basis.cpp b/modules/gdnative/gdnative/basis.cpp index 1f829e6f84..a040143aec 100644 --- a/modules/gdnative/gdnative/basis.cpp +++ b/modules/gdnative/gdnative/basis.cpp @@ -691,12 +691,21 @@ pandemonium_vector3 GDAPI pandemonium_basis_xform_normal(const pandemonium_basis return dest; } -pandemonium_basis GDAPI pandemonium_basis_looking_at(const pandemonium_vector3 *p_target) { +pandemonium_basis GDAPI pandemonium_basis_looking_at(const pandemonium_vector3 *p_target, const pandemonium_vector3 *p_up, const pandemonium_bool p_use_model_front) { pandemonium_basis dest; const Vector3 *target = (const Vector3 *)p_target; - *((Basis *)&dest) = Basis::create_looking_at(*target); + const Vector3 *up = (const Vector3 *)p_up; + *((Basis *)&dest) = Basis::create_looking_at(*target, *up, p_use_model_front); return dest; } + +void GDAPI pandemonium_basis_set_look_at(pandemonium_basis *p_self, const pandemonium_vector3 *p_target, const pandemonium_vector3 *p_up, const pandemonium_bool p_use_model_front) { + Basis *self = (Basis *)p_self; + const Vector3 *target = (const Vector3 *)p_target; + const Vector3 *up = (const Vector3 *)p_up; + self->set_look_at(*target, *up, p_use_model_front); +} + pandemonium_basis GDAPI pandemonium_basis_looking_at_up(const pandemonium_vector3 *p_target, const pandemonium_vector3 *p_up) { pandemonium_basis dest; const Vector3 *target = (const Vector3 *)p_target; diff --git a/modules/gdnative/gdnative/transform.cpp b/modules/gdnative/gdnative/transform.cpp index 59cd5bd5ae..5210244979 100644 --- a/modules/gdnative/gdnative/transform.cpp +++ b/modules/gdnative/gdnative/transform.cpp @@ -94,20 +94,20 @@ void GDAPI pandemonium_transform_rotate_basis(pandemonium_transform *p_self, con self->rotate_basis(*axis, p_phi); } -void GDAPI pandemonium_transform_set_look_at(pandemonium_transform *p_self, const pandemonium_vector3 *p_eye, const pandemonium_vector3 *p_target, const pandemonium_vector3 *p_up) { +void GDAPI pandemonium_transform_set_look_at(pandemonium_transform *p_self, const pandemonium_vector3 *p_eye, const pandemonium_vector3 *p_target, const pandemonium_vector3 *p_up, const pandemonium_bool p_use_model_front) { Transform *self = (Transform *)p_self; const Vector3 *eye = (const Vector3 *)p_eye; const Vector3 *target = (const Vector3 *)p_target; const Vector3 *up = (const Vector3 *)p_up; - self->set_look_at(*eye, *target, *up); + self->set_look_at(*eye, *target, *up, p_use_model_front); } -pandemonium_transform GDAPI pandemonium_transform_looking_at(const pandemonium_transform *p_self, const pandemonium_vector3 *p_target, const pandemonium_vector3 *p_up) { +pandemonium_transform GDAPI pandemonium_transform_looking_at(const pandemonium_transform *p_self, const pandemonium_vector3 *p_target, const pandemonium_vector3 *p_up, const pandemonium_bool p_use_model_front) { pandemonium_transform dest; const Transform *self = (const Transform *)p_self; const Vector3 *target = (const Vector3 *)p_target; const Vector3 *up = (const Vector3 *)p_up; - *((Transform *)&dest) = self->looking_at(*target, *up); + *((Transform *)&dest) = self->looking_at(*target, *up, p_use_model_front); return dest; } diff --git a/modules/gdnative/gdnative_api.json b/modules/gdnative/gdnative_api.json index 2d77d2b060..49046b9029 100644 --- a/modules/gdnative/gdnative_api.json +++ b/modules/gdnative/gdnative_api.json @@ -1699,7 +1699,19 @@ "name": "pandemonium_basis_looking_at", "return_type": "pandemonium_basis", "arguments": [ - ["const pandemonium_vector3 *", "p_target"] + ["const pandemonium_vector3 *", "p_target"], + ["const pandemonium_vector3 *", "p_up"], + ["const pandemonium_bool", "p_use_model_front"] + ] + }, + { + "name": "pandemonium_basis_set_look_at", + "return_type": "void", + "arguments": [ + ["pandemonium_basis *", "p_self"], + ["const pandemonium_vector3 *", "p_target"], + ["const pandemonium_vector3 *", "p_up"], + ["const pandemonium_bool", "p_use_model_front"] ] }, { @@ -6733,7 +6745,8 @@ ["pandemonium_transform *", "p_self"], ["const pandemonium_vector3 *", "p_eye"], ["const pandemonium_vector3 *", "p_target"], - ["const pandemonium_vector3 *", "p_up"] + ["const pandemonium_vector3 *", "p_up"], + ["const pandemonium_bool", "p_use_model_front"] ] }, { @@ -6742,7 +6755,8 @@ "arguments": [ ["const pandemonium_transform *", "p_self"], ["const pandemonium_vector3 *", "p_target"], - ["const pandemonium_vector3 *", "p_up"] + ["const pandemonium_vector3 *", "p_up"], + ["const pandemonium_bool", "p_use_model_front"] ] }, { diff --git a/modules/gdnative/include/gdn/basis.h b/modules/gdnative/include/gdn/basis.h index 7658d76112..d690321073 100644 --- a/modules/gdnative/include/gdn/basis.h +++ b/modules/gdnative/include/gdn/basis.h @@ -213,7 +213,8 @@ pandemonium_basis GDAPI pandemonium_basis_get_normal_xform_basis(const pandemoni pandemonium_vector3 GDAPI pandemonium_basis_xform_normal_fast(const pandemonium_basis *p_self, const pandemonium_vector3 *p_vector); pandemonium_vector3 GDAPI pandemonium_basis_xform_normal(const pandemonium_basis *p_self, const pandemonium_vector3 *p_vector); -pandemonium_basis GDAPI pandemonium_basis_looking_at(const pandemonium_vector3 *p_target); +pandemonium_basis GDAPI pandemonium_basis_looking_at(const pandemonium_vector3 *p_target, const pandemonium_vector3 *p_up, const pandemonium_bool p_use_model_front); +void GDAPI pandemonium_basis_set_look_at(pandemonium_basis *p_self, const pandemonium_vector3 *p_target, const pandemonium_vector3 *p_up, const pandemonium_bool p_use_model_front); pandemonium_basis GDAPI pandemonium_basis_looking_at_up(const pandemonium_vector3 *p_target, const pandemonium_vector3 *p_up); pandemonium_basis GDAPI pandemonium_basis_from_scale(const pandemonium_vector3 *p_scale); diff --git a/modules/gdnative/include/gdn/transform.h b/modules/gdnative/include/gdn/transform.h index e31f397bdd..e3ee8cc94d 100644 --- a/modules/gdnative/include/gdn/transform.h +++ b/modules/gdnative/include/gdn/transform.h @@ -76,9 +76,9 @@ void GDAPI pandemonium_transform_rotate(pandemonium_transform *p_self, const pan void GDAPI pandemonium_transform_rotate_local(pandemonium_transform *p_self, const pandemonium_vector3 *p_axis, pandemonium_real p_phi); void GDAPI pandemonium_transform_rotate_basis(pandemonium_transform *p_self, const pandemonium_vector3 *p_axis, pandemonium_real p_phi); -void GDAPI pandemonium_transform_set_look_at(pandemonium_transform *p_self, const pandemonium_vector3 *p_eye, const pandemonium_vector3 *p_target, const pandemonium_vector3 *p_up); +void GDAPI pandemonium_transform_set_look_at(pandemonium_transform *p_self, const pandemonium_vector3 *p_eye, const pandemonium_vector3 *p_target, const pandemonium_vector3 *p_up, const pandemonium_bool p_use_model_front); -pandemonium_transform GDAPI pandemonium_transform_looking_at(const pandemonium_transform *p_self, const pandemonium_vector3 *p_target, const pandemonium_vector3 *p_up); +pandemonium_transform GDAPI pandemonium_transform_looking_at(const pandemonium_transform *p_self, const pandemonium_vector3 *p_target, const pandemonium_vector3 *p_up, const pandemonium_bool p_use_model_front); void GDAPI pandemonium_transform_scale(pandemonium_transform *p_self, const pandemonium_vector3 *p_scale); pandemonium_transform GDAPI pandemonium_transform_scaled(const pandemonium_transform *p_self, const pandemonium_vector3 *p_scale);