godot_transform.cpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #include "godot_transform.h"
  2. #include "math/transform.h"
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. void _transform_api_anchor() {
  7. }
  8. void GDAPI godot_transform_new(godot_transform *p_trans) {
  9. Transform *trans = (Transform *)p_trans;
  10. *trans = Transform();
  11. }
  12. void GDAPI godot_transform_new_with_basis(godot_transform *p_trans, const godot_basis *p_basis) {
  13. Transform *trans = (Transform *)p_trans;
  14. const Basis *basis = (const Basis *)p_basis;
  15. *trans = Transform(*basis);
  16. }
  17. void GDAPI godot_transform_new_with_basis_origin(godot_transform *p_trans, const godot_basis *p_basis, const godot_vector3 *p_origin) {
  18. Transform *trans = (Transform *)p_trans;
  19. const Basis *basis = (const Basis *)p_basis;
  20. const Vector3 *origin = (const Vector3 *)p_origin;
  21. *trans = Transform(*basis, *origin);
  22. }
  23. godot_basis GDAPI *godot_transform_get_basis(godot_transform *p_trans) {
  24. Transform *trans = (Transform *)p_trans;
  25. return (godot_basis *)&trans->basis;
  26. }
  27. godot_vector3 GDAPI *godot_transform_get_origin(godot_transform *p_trans) {
  28. Transform *trans = (Transform *)p_trans;
  29. return (godot_vector3 *)&trans->origin;
  30. }
  31. #ifdef __cplusplus
  32. }
  33. #endif