path_constraint.dart 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. //
  2. // Spine Runtimes License Agreement
  3. // Last updated April 5, 2025. Replaces all prior versions.
  4. //
  5. // Copyright (c) 2013-2025, Esoteric Software LLC
  6. //
  7. // Integration of the Spine Runtimes into software or otherwise creating
  8. // derivative works of the Spine Runtimes is permitted under the terms and
  9. // conditions of Section 2 of the Spine Editor License Agreement:
  10. // http://esotericsoftware.com/spine-editor-license
  11. //
  12. // Otherwise, it is permitted to integrate the Spine Runtimes into software
  13. // or otherwise create derivative works of the Spine Runtimes (collectively,
  14. // "Products"), provided that each user of the Products must obtain their own
  15. // Spine Editor license and redistribution of the Products in any form must
  16. // include this license and copyright notice.
  17. //
  18. // THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
  19. // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  20. // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  21. // DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
  22. // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  23. // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
  24. // BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
  25. // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  26. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  27. // THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  28. //
  29. // AUTO GENERATED FILE, DO NOT EDIT.
  30. import 'dart:ffi';
  31. import 'spine_dart_bindings_generated.dart';
  32. import '../spine_bindings.dart';
  33. import 'rtti.dart';
  34. import 'arrays.dart';
  35. import 'constraint.dart';
  36. import 'path_constraint_data.dart';
  37. import 'path_constraint_pose.dart';
  38. import 'physics.dart';
  39. import 'posed.dart';
  40. import 'posed_active.dart';
  41. import 'skeleton.dart';
  42. import 'slot.dart';
  43. /// PathConstraint wrapper
  44. class PathConstraint extends PosedActive implements Posed, Constraint {
  45. final Pointer<spine_path_constraint_wrapper> _ptr;
  46. PathConstraint.fromPointer(this._ptr) : super.fromPointer(_ptr.cast());
  47. /// Get the native pointer for FFI calls
  48. @override
  49. Pointer get nativePtr => _ptr;
  50. factory PathConstraint(PathConstraintData data, Skeleton skeleton) {
  51. final ptr = SpineBindings.bindings.spine_path_constraint_create(data.nativePtr.cast(), skeleton.nativePtr.cast());
  52. return PathConstraint.fromPointer(ptr);
  53. }
  54. @override
  55. void dispose() {
  56. SpineBindings.bindings.spine_path_constraint_dispose(_ptr);
  57. }
  58. @override
  59. Rtti get rtti {
  60. final result = SpineBindings.bindings.spine_path_constraint_get_rtti(_ptr);
  61. return Rtti.fromPointer(result);
  62. }
  63. PathConstraint copy(Skeleton skeleton) {
  64. final result = SpineBindings.bindings.spine_path_constraint_copy(_ptr, skeleton.nativePtr.cast());
  65. return PathConstraint.fromPointer(result);
  66. }
  67. @override
  68. void update(Skeleton skeleton, Physics physics) {
  69. SpineBindings.bindings.spine_path_constraint_update(_ptr, skeleton.nativePtr.cast(), physics.value);
  70. }
  71. @override
  72. void sort(Skeleton skeleton) {
  73. SpineBindings.bindings.spine_path_constraint_sort(_ptr, skeleton.nativePtr.cast());
  74. }
  75. @override
  76. bool get isSourceActive {
  77. final result = SpineBindings.bindings.spine_path_constraint_is_source_active(_ptr);
  78. return result;
  79. }
  80. ArrayBonePose get bones {
  81. final result = SpineBindings.bindings.spine_path_constraint_get_bones(_ptr);
  82. return ArrayBonePose.fromPointer(result);
  83. }
  84. Slot get slot {
  85. final result = SpineBindings.bindings.spine_path_constraint_get_slot(_ptr);
  86. return Slot.fromPointer(result);
  87. }
  88. set slot(Slot value) {
  89. SpineBindings.bindings.spine_path_constraint_set_slot(_ptr, value.nativePtr.cast());
  90. }
  91. @override
  92. PathConstraintData get data {
  93. final result = SpineBindings.bindings.spine_path_constraint_get_data(_ptr);
  94. return PathConstraintData.fromPointer(result);
  95. }
  96. PathConstraintPose get pose {
  97. final result = SpineBindings.bindings.spine_path_constraint_get_pose(_ptr);
  98. return PathConstraintPose.fromPointer(result);
  99. }
  100. PathConstraintPose get appliedPose {
  101. final result = SpineBindings.bindings.spine_path_constraint_get_applied_pose(_ptr);
  102. return PathConstraintPose.fromPointer(result);
  103. }
  104. @override
  105. void resetConstrained() {
  106. SpineBindings.bindings.spine_path_constraint_reset_constrained(_ptr);
  107. }
  108. @override
  109. void constrained() {
  110. SpineBindings.bindings.spine_path_constraint_constrained(_ptr);
  111. }
  112. @override
  113. bool get isPoseEqualToApplied {
  114. final result = SpineBindings.bindings.spine_path_constraint_is_pose_equal_to_applied(_ptr);
  115. return result;
  116. }
  117. static Rtti rttiStatic() {
  118. final result = SpineBindings.bindings.spine_path_constraint_rtti();
  119. return Rtti.fromPointer(result);
  120. }
  121. }