mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-25 22:23:42 +08:00
[ios] Update to latest spine-c, fix swift-writer.cpp to cast on the C++ side if necesary.
This commit is contained in:
parent
59c1593aec
commit
3d5d64885b
@ -613,18 +613,24 @@ public class ArrayAttachment: NSObject {
|
||||
let rtti = spine_attachment_get_rtti(ptr)
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_bounding_box_attachment":
|
||||
return BoundingBoxAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
|
||||
case "spine_clipping_attachment":
|
||||
return ClippingAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_clipping_attachment_wrapper.self))
|
||||
case "spine_mesh_attachment":
|
||||
return MeshAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
|
||||
case "spine_path_attachment":
|
||||
return PathAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_path_attachment_wrapper.self))
|
||||
case "spine_point_attachment":
|
||||
return PointAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_point_attachment_wrapper.self))
|
||||
case "spine_region_attachment":
|
||||
return RegionAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_region_attachment_wrapper.self))
|
||||
case "BoundingBoxAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_bounding_box_attachment(ptr)
|
||||
return BoundingBoxAttachment(fromPointer: castedPtr!)
|
||||
case "ClippingAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_clipping_attachment(ptr)
|
||||
return ClippingAttachment(fromPointer: castedPtr!)
|
||||
case "MeshAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_mesh_attachment(ptr)
|
||||
return MeshAttachment(fromPointer: castedPtr!)
|
||||
case "PathAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_path_attachment(ptr)
|
||||
return PathAttachment(fromPointer: castedPtr!)
|
||||
case "PointAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_point_attachment(ptr)
|
||||
return PointAttachment(fromPointer: castedPtr!)
|
||||
case "RegionAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_region_attachment(ptr)
|
||||
return RegionAttachment(fromPointer: castedPtr!)
|
||||
default:
|
||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Attachment")
|
||||
}
|
||||
@ -1021,16 +1027,21 @@ public class ArrayConstraint: NSObject {
|
||||
let rtti = spine_constraint_get_rtti(ptr)
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_ik_constraint":
|
||||
return IkConstraint(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_ik_constraint_wrapper.self))
|
||||
case "spine_path_constraint":
|
||||
return PathConstraint(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_path_constraint_wrapper.self))
|
||||
case "spine_physics_constraint":
|
||||
return PhysicsConstraint(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_wrapper.self))
|
||||
case "spine_slider":
|
||||
return Slider(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_slider_wrapper.self))
|
||||
case "spine_transform_constraint":
|
||||
return TransformConstraint(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_transform_constraint_wrapper.self))
|
||||
case "IkConstraint":
|
||||
let castedPtr = spine_constraint_cast_to_ik_constraint(ptr)
|
||||
return IkConstraint(fromPointer: castedPtr!)
|
||||
case "PathConstraint":
|
||||
let castedPtr = spine_constraint_cast_to_path_constraint(ptr)
|
||||
return PathConstraint(fromPointer: castedPtr!)
|
||||
case "PhysicsConstraint":
|
||||
let castedPtr = spine_constraint_cast_to_physics_constraint(ptr)
|
||||
return PhysicsConstraint(fromPointer: castedPtr!)
|
||||
case "Slider":
|
||||
let castedPtr = spine_constraint_cast_to_slider(ptr)
|
||||
return Slider(fromPointer: castedPtr!)
|
||||
case "TransformConstraint":
|
||||
let castedPtr = spine_constraint_cast_to_transform_constraint(ptr)
|
||||
return TransformConstraint(fromPointer: castedPtr!)
|
||||
default:
|
||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Constraint")
|
||||
}
|
||||
@ -1115,16 +1126,21 @@ public class ArrayConstraintData: NSObject {
|
||||
let rtti = spine_constraint_data_get_rtti(ptr)
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_ik_constraint_data":
|
||||
return IkConstraintData(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_ik_constraint_data_wrapper.self))
|
||||
case "spine_path_constraint_data":
|
||||
return PathConstraintData(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_path_constraint_data_wrapper.self))
|
||||
case "spine_physics_constraint_data":
|
||||
return PhysicsConstraintData(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_data_wrapper.self))
|
||||
case "spine_slider_data":
|
||||
return SliderData(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_slider_data_wrapper.self))
|
||||
case "spine_transform_constraint_data":
|
||||
return TransformConstraintData(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_transform_constraint_data_wrapper.self))
|
||||
case "IkConstraintData":
|
||||
let castedPtr = spine_constraint_data_cast_to_ik_constraint_data(ptr)
|
||||
return IkConstraintData(fromPointer: castedPtr!)
|
||||
case "PathConstraintData":
|
||||
let castedPtr = spine_constraint_data_cast_to_path_constraint_data(ptr)
|
||||
return PathConstraintData(fromPointer: castedPtr!)
|
||||
case "PhysicsConstraintData":
|
||||
let castedPtr = spine_constraint_data_cast_to_physics_constraint_data(ptr)
|
||||
return PhysicsConstraintData(fromPointer: castedPtr!)
|
||||
case "SliderData":
|
||||
let castedPtr = spine_constraint_data_cast_to_slider_data(ptr)
|
||||
return SliderData(fromPointer: castedPtr!)
|
||||
case "TransformConstraintData":
|
||||
let castedPtr = spine_constraint_data_cast_to_transform_constraint_data(ptr)
|
||||
return TransformConstraintData(fromPointer: castedPtr!)
|
||||
default:
|
||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class ConstraintData")
|
||||
}
|
||||
@ -1365,18 +1381,24 @@ public class ArrayFromProperty: NSObject {
|
||||
let rtti = spine_from_property_get_rtti(ptr)
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_from_rotate":
|
||||
return FromRotate(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_from_rotate_wrapper.self))
|
||||
case "spine_from_scale_x":
|
||||
return FromScaleX(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_from_scale_x_wrapper.self))
|
||||
case "spine_from_scale_y":
|
||||
return FromScaleY(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_from_scale_y_wrapper.self))
|
||||
case "spine_from_shear_y":
|
||||
return FromShearY(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_from_shear_y_wrapper.self))
|
||||
case "spine_from_x":
|
||||
return FromX(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_from_x_wrapper.self))
|
||||
case "spine_from_y":
|
||||
return FromY(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_from_y_wrapper.self))
|
||||
case "FromRotate":
|
||||
let castedPtr = spine_from_property_cast_to_from_rotate(ptr)
|
||||
return FromRotate(fromPointer: castedPtr!)
|
||||
case "FromScaleX":
|
||||
let castedPtr = spine_from_property_cast_to_from_scale_x(ptr)
|
||||
return FromScaleX(fromPointer: castedPtr!)
|
||||
case "FromScaleY":
|
||||
let castedPtr = spine_from_property_cast_to_from_scale_y(ptr)
|
||||
return FromScaleY(fromPointer: castedPtr!)
|
||||
case "FromShearY":
|
||||
let castedPtr = spine_from_property_cast_to_from_shear_y(ptr)
|
||||
return FromShearY(fromPointer: castedPtr!)
|
||||
case "FromX":
|
||||
let castedPtr = spine_from_property_cast_to_from_x(ptr)
|
||||
return FromX(fromPointer: castedPtr!)
|
||||
case "FromY":
|
||||
let castedPtr = spine_from_property_cast_to_from_y(ptr)
|
||||
return FromY(fromPointer: castedPtr!)
|
||||
default:
|
||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class FromProperty")
|
||||
}
|
||||
@ -1929,78 +1951,114 @@ public class ArrayTimeline: NSObject {
|
||||
let rtti = spine_timeline_get_rtti(ptr)
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_alpha_timeline":
|
||||
return AlphaTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_alpha_timeline_wrapper.self))
|
||||
case "spine_attachment_timeline":
|
||||
return AttachmentTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_attachment_timeline_wrapper.self))
|
||||
case "spine_deform_timeline":
|
||||
return DeformTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_deform_timeline_wrapper.self))
|
||||
case "spine_draw_order_timeline":
|
||||
return DrawOrderTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_draw_order_timeline_wrapper.self))
|
||||
case "spine_event_timeline":
|
||||
return EventTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_event_timeline_wrapper.self))
|
||||
case "spine_ik_constraint_timeline":
|
||||
return IkConstraintTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_ik_constraint_timeline_wrapper.self))
|
||||
case "spine_inherit_timeline":
|
||||
return InheritTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_inherit_timeline_wrapper.self))
|
||||
case "spine_path_constraint_mix_timeline":
|
||||
return PathConstraintMixTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_path_constraint_mix_timeline_wrapper.self))
|
||||
case "spine_path_constraint_position_timeline":
|
||||
return PathConstraintPositionTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_path_constraint_position_timeline_wrapper.self))
|
||||
case "spine_path_constraint_spacing_timeline":
|
||||
return PathConstraintSpacingTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_path_constraint_spacing_timeline_wrapper.self))
|
||||
case "spine_physics_constraint_damping_timeline":
|
||||
return PhysicsConstraintDampingTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_damping_timeline_wrapper.self))
|
||||
case "spine_physics_constraint_gravity_timeline":
|
||||
return PhysicsConstraintGravityTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_gravity_timeline_wrapper.self))
|
||||
case "spine_physics_constraint_inertia_timeline":
|
||||
return PhysicsConstraintInertiaTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_inertia_timeline_wrapper.self))
|
||||
case "spine_physics_constraint_mass_timeline":
|
||||
return PhysicsConstraintMassTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_mass_timeline_wrapper.self))
|
||||
case "spine_physics_constraint_mix_timeline":
|
||||
return PhysicsConstraintMixTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_mix_timeline_wrapper.self))
|
||||
case "spine_physics_constraint_reset_timeline":
|
||||
return PhysicsConstraintResetTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_reset_timeline_wrapper.self))
|
||||
case "spine_physics_constraint_strength_timeline":
|
||||
return PhysicsConstraintStrengthTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_strength_timeline_wrapper.self))
|
||||
case "spine_physics_constraint_wind_timeline":
|
||||
return PhysicsConstraintWindTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_wind_timeline_wrapper.self))
|
||||
case "spine_rgb2_timeline":
|
||||
return Rgb2Timeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_rgb2_timeline_wrapper.self))
|
||||
case "spine_rgba2_timeline":
|
||||
return Rgba2Timeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_rgba2_timeline_wrapper.self))
|
||||
case "spine_rgba_timeline":
|
||||
return RgbaTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_rgba_timeline_wrapper.self))
|
||||
case "spine_rgb_timeline":
|
||||
return RgbTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_rgb_timeline_wrapper.self))
|
||||
case "spine_rotate_timeline":
|
||||
return RotateTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_rotate_timeline_wrapper.self))
|
||||
case "spine_scale_timeline":
|
||||
return ScaleTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_scale_timeline_wrapper.self))
|
||||
case "spine_scale_x_timeline":
|
||||
return ScaleXTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_scale_x_timeline_wrapper.self))
|
||||
case "spine_scale_y_timeline":
|
||||
return ScaleYTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_scale_y_timeline_wrapper.self))
|
||||
case "spine_sequence_timeline":
|
||||
return SequenceTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_sequence_timeline_wrapper.self))
|
||||
case "spine_shear_timeline":
|
||||
return ShearTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_shear_timeline_wrapper.self))
|
||||
case "spine_shear_x_timeline":
|
||||
return ShearXTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_shear_x_timeline_wrapper.self))
|
||||
case "spine_shear_y_timeline":
|
||||
return ShearYTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_shear_y_timeline_wrapper.self))
|
||||
case "spine_slider_mix_timeline":
|
||||
return SliderMixTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_slider_mix_timeline_wrapper.self))
|
||||
case "spine_slider_timeline":
|
||||
return SliderTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_slider_timeline_wrapper.self))
|
||||
case "spine_transform_constraint_timeline":
|
||||
return TransformConstraintTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_transform_constraint_timeline_wrapper.self))
|
||||
case "spine_translate_timeline":
|
||||
return TranslateTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_translate_timeline_wrapper.self))
|
||||
case "spine_translate_x_timeline":
|
||||
return TranslateXTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_translate_x_timeline_wrapper.self))
|
||||
case "spine_translate_y_timeline":
|
||||
return TranslateYTimeline(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_translate_y_timeline_wrapper.self))
|
||||
case "AlphaTimeline":
|
||||
let castedPtr = spine_timeline_cast_to_alpha_timeline(ptr)
|
||||
return AlphaTimeline(fromPointer: castedPtr!)
|
||||
case "AttachmentTimeline":
|
||||
let castedPtr = spine_timeline_cast_to_attachment_timeline(ptr)
|
||||
return AttachmentTimeline(fromPointer: castedPtr!)
|
||||
case "DeformTimeline":
|
||||
let castedPtr = spine_timeline_cast_to_deform_timeline(ptr)
|
||||
return DeformTimeline(fromPointer: castedPtr!)
|
||||
case "DrawOrderTimeline":
|
||||
let castedPtr = spine_timeline_cast_to_draw_order_timeline(ptr)
|
||||
return DrawOrderTimeline(fromPointer: castedPtr!)
|
||||
case "EventTimeline":
|
||||
let castedPtr = spine_timeline_cast_to_event_timeline(ptr)
|
||||
return EventTimeline(fromPointer: castedPtr!)
|
||||
case "IkConstraintTimeline":
|
||||
let castedPtr = spine_timeline_cast_to_ik_constraint_timeline(ptr)
|
||||
return IkConstraintTimeline(fromPointer: castedPtr!)
|
||||
case "InheritTimeline":
|
||||
let castedPtr = spine_timeline_cast_to_inherit_timeline(ptr)
|
||||
return InheritTimeline(fromPointer: castedPtr!)
|
||||
case "PathConstraintMixTimeline":
|
||||
let castedPtr = spine_timeline_cast_to_path_constraint_mix_timeline(ptr)
|
||||
return PathConstraintMixTimeline(fromPointer: castedPtr!)
|
||||
case "PathConstraintPositionTimeline":
|
||||
let castedPtr = spine_timeline_cast_to_path_constraint_position_timeline(ptr)
|
||||
return PathConstraintPositionTimeline(fromPointer: castedPtr!)
|
||||
case "PathConstraintSpacingTimeline":
|
||||
let castedPtr = spine_timeline_cast_to_path_constraint_spacing_timeline(ptr)
|
||||
return PathConstraintSpacingTimeline(fromPointer: castedPtr!)
|
||||
case "PhysicsConstraintDampingTimeline":
|
||||
let castedPtr = spine_timeline_cast_to_physics_constraint_damping_timeline(ptr)
|
||||
return PhysicsConstraintDampingTimeline(fromPointer: castedPtr!)
|
||||
case "PhysicsConstraintGravityTimeline":
|
||||
let castedPtr = spine_timeline_cast_to_physics_constraint_gravity_timeline(ptr)
|
||||
return PhysicsConstraintGravityTimeline(fromPointer: castedPtr!)
|
||||
case "PhysicsConstraintInertiaTimeline":
|
||||
let castedPtr = spine_timeline_cast_to_physics_constraint_inertia_timeline(ptr)
|
||||
return PhysicsConstraintInertiaTimeline(fromPointer: castedPtr!)
|
||||
case "PhysicsConstraintMassTimeline":
|
||||
let castedPtr = spine_timeline_cast_to_physics_constraint_mass_timeline(ptr)
|
||||
return PhysicsConstraintMassTimeline(fromPointer: castedPtr!)
|
||||
case "PhysicsConstraintMixTimeline":
|
||||
let castedPtr = spine_timeline_cast_to_physics_constraint_mix_timeline(ptr)
|
||||
return PhysicsConstraintMixTimeline(fromPointer: castedPtr!)
|
||||
case "PhysicsConstraintResetTimeline":
|
||||
let castedPtr = spine_timeline_cast_to_physics_constraint_reset_timeline(ptr)
|
||||
return PhysicsConstraintResetTimeline(fromPointer: castedPtr!)
|
||||
case "PhysicsConstraintStrengthTimeline":
|
||||
let castedPtr = spine_timeline_cast_to_physics_constraint_strength_timeline(ptr)
|
||||
return PhysicsConstraintStrengthTimeline(fromPointer: castedPtr!)
|
||||
case "PhysicsConstraintWindTimeline":
|
||||
let castedPtr = spine_timeline_cast_to_physics_constraint_wind_timeline(ptr)
|
||||
return PhysicsConstraintWindTimeline(fromPointer: castedPtr!)
|
||||
case "Rgb2Timeline":
|
||||
let castedPtr = spine_timeline_cast_to_rgb2_timeline(ptr)
|
||||
return Rgb2Timeline(fromPointer: castedPtr!)
|
||||
case "Rgba2Timeline":
|
||||
let castedPtr = spine_timeline_cast_to_rgba2_timeline(ptr)
|
||||
return Rgba2Timeline(fromPointer: castedPtr!)
|
||||
case "RgbaTimeline":
|
||||
let castedPtr = spine_timeline_cast_to_rgba_timeline(ptr)
|
||||
return RgbaTimeline(fromPointer: castedPtr!)
|
||||
case "RgbTimeline":
|
||||
let castedPtr = spine_timeline_cast_to_rgb_timeline(ptr)
|
||||
return RgbTimeline(fromPointer: castedPtr!)
|
||||
case "RotateTimeline":
|
||||
let castedPtr = spine_timeline_cast_to_rotate_timeline(ptr)
|
||||
return RotateTimeline(fromPointer: castedPtr!)
|
||||
case "ScaleTimeline":
|
||||
let castedPtr = spine_timeline_cast_to_scale_timeline(ptr)
|
||||
return ScaleTimeline(fromPointer: castedPtr!)
|
||||
case "ScaleXTimeline":
|
||||
let castedPtr = spine_timeline_cast_to_scale_x_timeline(ptr)
|
||||
return ScaleXTimeline(fromPointer: castedPtr!)
|
||||
case "ScaleYTimeline":
|
||||
let castedPtr = spine_timeline_cast_to_scale_y_timeline(ptr)
|
||||
return ScaleYTimeline(fromPointer: castedPtr!)
|
||||
case "SequenceTimeline":
|
||||
let castedPtr = spine_timeline_cast_to_sequence_timeline(ptr)
|
||||
return SequenceTimeline(fromPointer: castedPtr!)
|
||||
case "ShearTimeline":
|
||||
let castedPtr = spine_timeline_cast_to_shear_timeline(ptr)
|
||||
return ShearTimeline(fromPointer: castedPtr!)
|
||||
case "ShearXTimeline":
|
||||
let castedPtr = spine_timeline_cast_to_shear_x_timeline(ptr)
|
||||
return ShearXTimeline(fromPointer: castedPtr!)
|
||||
case "ShearYTimeline":
|
||||
let castedPtr = spine_timeline_cast_to_shear_y_timeline(ptr)
|
||||
return ShearYTimeline(fromPointer: castedPtr!)
|
||||
case "SliderMixTimeline":
|
||||
let castedPtr = spine_timeline_cast_to_slider_mix_timeline(ptr)
|
||||
return SliderMixTimeline(fromPointer: castedPtr!)
|
||||
case "SliderTimeline":
|
||||
let castedPtr = spine_timeline_cast_to_slider_timeline(ptr)
|
||||
return SliderTimeline(fromPointer: castedPtr!)
|
||||
case "TransformConstraintTimeline":
|
||||
let castedPtr = spine_timeline_cast_to_transform_constraint_timeline(ptr)
|
||||
return TransformConstraintTimeline(fromPointer: castedPtr!)
|
||||
case "TranslateTimeline":
|
||||
let castedPtr = spine_timeline_cast_to_translate_timeline(ptr)
|
||||
return TranslateTimeline(fromPointer: castedPtr!)
|
||||
case "TranslateXTimeline":
|
||||
let castedPtr = spine_timeline_cast_to_translate_x_timeline(ptr)
|
||||
return TranslateXTimeline(fromPointer: castedPtr!)
|
||||
case "TranslateYTimeline":
|
||||
let castedPtr = spine_timeline_cast_to_translate_y_timeline(ptr)
|
||||
return TranslateYTimeline(fromPointer: castedPtr!)
|
||||
default:
|
||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Timeline")
|
||||
}
|
||||
@ -2085,18 +2143,24 @@ public class ArrayToProperty: NSObject {
|
||||
let rtti = spine_to_property_get_rtti(ptr)
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_to_rotate":
|
||||
return ToRotate(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_to_rotate_wrapper.self))
|
||||
case "spine_to_scale_x":
|
||||
return ToScaleX(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_to_scale_x_wrapper.self))
|
||||
case "spine_to_scale_y":
|
||||
return ToScaleY(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_to_scale_y_wrapper.self))
|
||||
case "spine_to_shear_y":
|
||||
return ToShearY(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_to_shear_y_wrapper.self))
|
||||
case "spine_to_x":
|
||||
return ToX(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_to_x_wrapper.self))
|
||||
case "spine_to_y":
|
||||
return ToY(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_to_y_wrapper.self))
|
||||
case "ToRotate":
|
||||
let castedPtr = spine_to_property_cast_to_to_rotate(ptr)
|
||||
return ToRotate(fromPointer: castedPtr!)
|
||||
case "ToScaleX":
|
||||
let castedPtr = spine_to_property_cast_to_to_scale_x(ptr)
|
||||
return ToScaleX(fromPointer: castedPtr!)
|
||||
case "ToScaleY":
|
||||
let castedPtr = spine_to_property_cast_to_to_scale_y(ptr)
|
||||
return ToScaleY(fromPointer: castedPtr!)
|
||||
case "ToShearY":
|
||||
let castedPtr = spine_to_property_cast_to_to_shear_y(ptr)
|
||||
return ToShearY(fromPointer: castedPtr!)
|
||||
case "ToX":
|
||||
let castedPtr = spine_to_property_cast_to_to_x(ptr)
|
||||
return ToX(fromPointer: castedPtr!)
|
||||
case "ToY":
|
||||
let castedPtr = spine_to_property_cast_to_to_y(ptr)
|
||||
return ToY(fromPointer: castedPtr!)
|
||||
default:
|
||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class ToProperty")
|
||||
}
|
||||
@ -2259,20 +2323,27 @@ public class ArrayUpdate: NSObject {
|
||||
let rtti = spine_update_get_rtti(ptr)
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_bone":
|
||||
return Bone(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_bone_wrapper.self))
|
||||
case "spine_bone_pose":
|
||||
return BonePose(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_bone_pose_wrapper.self))
|
||||
case "spine_ik_constraint":
|
||||
return IkConstraint(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_ik_constraint_wrapper.self))
|
||||
case "spine_path_constraint":
|
||||
return PathConstraint(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_path_constraint_wrapper.self))
|
||||
case "spine_physics_constraint":
|
||||
return PhysicsConstraint(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_wrapper.self))
|
||||
case "spine_slider":
|
||||
return Slider(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_slider_wrapper.self))
|
||||
case "spine_transform_constraint":
|
||||
return TransformConstraint(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_transform_constraint_wrapper.self))
|
||||
case "Bone":
|
||||
let castedPtr = spine_update_cast_to_bone(ptr)
|
||||
return Bone(fromPointer: castedPtr!)
|
||||
case "BonePose":
|
||||
let castedPtr = spine_update_cast_to_bone_pose(ptr)
|
||||
return BonePose(fromPointer: castedPtr!)
|
||||
case "IkConstraint":
|
||||
let castedPtr = spine_update_cast_to_ik_constraint(ptr)
|
||||
return IkConstraint(fromPointer: castedPtr!)
|
||||
case "PathConstraint":
|
||||
let castedPtr = spine_update_cast_to_path_constraint(ptr)
|
||||
return PathConstraint(fromPointer: castedPtr!)
|
||||
case "PhysicsConstraint":
|
||||
let castedPtr = spine_update_cast_to_physics_constraint(ptr)
|
||||
return PhysicsConstraint(fromPointer: castedPtr!)
|
||||
case "Slider":
|
||||
let castedPtr = spine_update_cast_to_slider(ptr)
|
||||
return Slider(fromPointer: castedPtr!)
|
||||
case "TransformConstraint":
|
||||
let castedPtr = spine_update_cast_to_transform_constraint(ptr)
|
||||
return TransformConstraint(fromPointer: castedPtr!)
|
||||
default:
|
||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Update")
|
||||
}
|
||||
|
||||
@ -63,18 +63,24 @@ open class Attachment: NSObject {
|
||||
let rtti = spine_attachment_get_rtti(result!)
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_bounding_box_attachment":
|
||||
return BoundingBoxAttachment(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
|
||||
case "spine_clipping_attachment":
|
||||
return ClippingAttachment(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_clipping_attachment_wrapper.self))
|
||||
case "spine_mesh_attachment":
|
||||
return MeshAttachment(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
|
||||
case "spine_path_attachment":
|
||||
return PathAttachment(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_path_attachment_wrapper.self))
|
||||
case "spine_point_attachment":
|
||||
return PointAttachment(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_point_attachment_wrapper.self))
|
||||
case "spine_region_attachment":
|
||||
return RegionAttachment(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_region_attachment_wrapper.self))
|
||||
case "BoundingBoxAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_bounding_box_attachment(result!)
|
||||
return BoundingBoxAttachment(fromPointer: castedPtr!)
|
||||
case "ClippingAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_clipping_attachment(result!)
|
||||
return ClippingAttachment(fromPointer: castedPtr!)
|
||||
case "MeshAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_mesh_attachment(result!)
|
||||
return MeshAttachment(fromPointer: castedPtr!)
|
||||
case "PathAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_path_attachment(result!)
|
||||
return PathAttachment(fromPointer: castedPtr!)
|
||||
case "PointAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_point_attachment(result!)
|
||||
return PointAttachment(fromPointer: castedPtr!)
|
||||
case "RegionAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_region_attachment(result!)
|
||||
return RegionAttachment(fromPointer: castedPtr!)
|
||||
default:
|
||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Attachment")
|
||||
}
|
||||
|
||||
@ -279,18 +279,24 @@ public class Skeleton: NSObject {
|
||||
let rtti = spine_attachment_get_rtti(ptr)
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_bounding_box_attachment":
|
||||
return BoundingBoxAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
|
||||
case "spine_clipping_attachment":
|
||||
return ClippingAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_clipping_attachment_wrapper.self))
|
||||
case "spine_mesh_attachment":
|
||||
return MeshAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
|
||||
case "spine_path_attachment":
|
||||
return PathAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_path_attachment_wrapper.self))
|
||||
case "spine_point_attachment":
|
||||
return PointAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_point_attachment_wrapper.self))
|
||||
case "spine_region_attachment":
|
||||
return RegionAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_region_attachment_wrapper.self))
|
||||
case "BoundingBoxAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_bounding_box_attachment(ptr)
|
||||
return BoundingBoxAttachment(fromPointer: castedPtr!)
|
||||
case "ClippingAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_clipping_attachment(ptr)
|
||||
return ClippingAttachment(fromPointer: castedPtr!)
|
||||
case "MeshAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_mesh_attachment(ptr)
|
||||
return MeshAttachment(fromPointer: castedPtr!)
|
||||
case "PathAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_path_attachment(ptr)
|
||||
return PathAttachment(fromPointer: castedPtr!)
|
||||
case "PointAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_point_attachment(ptr)
|
||||
return PointAttachment(fromPointer: castedPtr!)
|
||||
case "RegionAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_region_attachment(ptr)
|
||||
return RegionAttachment(fromPointer: castedPtr!)
|
||||
default:
|
||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Attachment")
|
||||
}
|
||||
@ -302,18 +308,24 @@ public class Skeleton: NSObject {
|
||||
let rtti = spine_attachment_get_rtti(ptr)
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_bounding_box_attachment":
|
||||
return BoundingBoxAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
|
||||
case "spine_clipping_attachment":
|
||||
return ClippingAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_clipping_attachment_wrapper.self))
|
||||
case "spine_mesh_attachment":
|
||||
return MeshAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
|
||||
case "spine_path_attachment":
|
||||
return PathAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_path_attachment_wrapper.self))
|
||||
case "spine_point_attachment":
|
||||
return PointAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_point_attachment_wrapper.self))
|
||||
case "spine_region_attachment":
|
||||
return RegionAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_region_attachment_wrapper.self))
|
||||
case "BoundingBoxAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_bounding_box_attachment(ptr)
|
||||
return BoundingBoxAttachment(fromPointer: castedPtr!)
|
||||
case "ClippingAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_clipping_attachment(ptr)
|
||||
return ClippingAttachment(fromPointer: castedPtr!)
|
||||
case "MeshAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_mesh_attachment(ptr)
|
||||
return MeshAttachment(fromPointer: castedPtr!)
|
||||
case "PathAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_path_attachment(ptr)
|
||||
return PathAttachment(fromPointer: castedPtr!)
|
||||
case "PointAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_point_attachment(ptr)
|
||||
return PointAttachment(fromPointer: castedPtr!)
|
||||
case "RegionAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_region_attachment(ptr)
|
||||
return RegionAttachment(fromPointer: castedPtr!)
|
||||
default:
|
||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Attachment")
|
||||
}
|
||||
|
||||
@ -78,18 +78,24 @@ public class Skin: NSObject {
|
||||
let rtti = spine_attachment_get_rtti(ptr)
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_bounding_box_attachment":
|
||||
return BoundingBoxAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
|
||||
case "spine_clipping_attachment":
|
||||
return ClippingAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_clipping_attachment_wrapper.self))
|
||||
case "spine_mesh_attachment":
|
||||
return MeshAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
|
||||
case "spine_path_attachment":
|
||||
return PathAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_path_attachment_wrapper.self))
|
||||
case "spine_point_attachment":
|
||||
return PointAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_point_attachment_wrapper.self))
|
||||
case "spine_region_attachment":
|
||||
return RegionAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_region_attachment_wrapper.self))
|
||||
case "BoundingBoxAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_bounding_box_attachment(ptr)
|
||||
return BoundingBoxAttachment(fromPointer: castedPtr!)
|
||||
case "ClippingAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_clipping_attachment(ptr)
|
||||
return ClippingAttachment(fromPointer: castedPtr!)
|
||||
case "MeshAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_mesh_attachment(ptr)
|
||||
return MeshAttachment(fromPointer: castedPtr!)
|
||||
case "PathAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_path_attachment(ptr)
|
||||
return PathAttachment(fromPointer: castedPtr!)
|
||||
case "PointAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_point_attachment(ptr)
|
||||
return PointAttachment(fromPointer: castedPtr!)
|
||||
case "RegionAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_region_attachment(ptr)
|
||||
return RegionAttachment(fromPointer: castedPtr!)
|
||||
default:
|
||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Attachment")
|
||||
}
|
||||
|
||||
@ -35,10 +35,10 @@ import SpineC
|
||||
/// Slider wrapper
|
||||
@objc(SpineSlider)
|
||||
@objcMembers
|
||||
public class Slider: PosedActive, Posed, Constraint {
|
||||
public class Slider: SliderBase {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_slider) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_posed_active_wrapper.self))
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_slider_base_wrapper.self))
|
||||
}
|
||||
|
||||
public convenience init(_ data: SliderData, _ skeleton: Skeleton) {
|
||||
@ -46,16 +46,6 @@ public class Slider: PosedActive, Posed, Constraint {
|
||||
self.init(fromPointer: ptr!)
|
||||
}
|
||||
|
||||
public var rtti: Rtti {
|
||||
let result = spine_slider_get_rtti(_ptr.assumingMemoryBound(to: spine_slider_wrapper.self))
|
||||
return Rtti(fromPointer: result!)
|
||||
}
|
||||
|
||||
public var isSourceActive: Bool {
|
||||
let result = spine_slider_is_source_active(_ptr.assumingMemoryBound(to: spine_slider_wrapper.self))
|
||||
return result
|
||||
}
|
||||
|
||||
public var bone: Bone {
|
||||
get {
|
||||
let result = spine_slider_get_bone(_ptr.assumingMemoryBound(to: spine_slider_wrapper.self))
|
||||
@ -66,52 +56,11 @@ public class Slider: PosedActive, Posed, Constraint {
|
||||
}
|
||||
}
|
||||
|
||||
public var data: ConstraintData {
|
||||
let result = spine_slider_get_data(_ptr.assumingMemoryBound(to: spine_slider_wrapper.self))
|
||||
return SliderData(fromPointer: result!)
|
||||
}
|
||||
|
||||
public var pose: SliderPose {
|
||||
let result = spine_slider_get_pose(_ptr.assumingMemoryBound(to: spine_slider_wrapper.self))
|
||||
return SliderPose(fromPointer: result!)
|
||||
}
|
||||
|
||||
public var appliedPose: SliderPose {
|
||||
let result = spine_slider_get_applied_pose(_ptr.assumingMemoryBound(to: spine_slider_wrapper.self))
|
||||
return SliderPose(fromPointer: result!)
|
||||
}
|
||||
|
||||
public var isPoseEqualToApplied: Bool {
|
||||
let result = spine_slider_is_pose_equal_to_applied(_ptr.assumingMemoryBound(to: spine_slider_wrapper.self))
|
||||
return result
|
||||
}
|
||||
|
||||
public func copyAttachment(_ skeleton: Skeleton) -> Slider {
|
||||
let result = spine_slider_copy(_ptr.assumingMemoryBound(to: spine_slider_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
return Slider(fromPointer: result!)
|
||||
}
|
||||
|
||||
public func update(_ skeleton: Skeleton, _ physics: Physics) {
|
||||
spine_slider_update(_ptr.assumingMemoryBound(to: spine_slider_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), spine_physics(rawValue: UInt32(physics.rawValue)))
|
||||
}
|
||||
|
||||
public func sort(_ skeleton: Skeleton) {
|
||||
spine_slider_sort(_ptr.assumingMemoryBound(to: spine_slider_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
}
|
||||
|
||||
public func resetConstrained() {
|
||||
spine_slider_reset_constrained(_ptr.assumingMemoryBound(to: spine_slider_wrapper.self))
|
||||
}
|
||||
|
||||
public func constrained() {
|
||||
spine_slider_constrained(_ptr.assumingMemoryBound(to: spine_slider_wrapper.self))
|
||||
}
|
||||
|
||||
public static func rttiStatic() -> Rtti {
|
||||
let result = spine_slider_rtti()
|
||||
return Rtti(fromPointer: result!)
|
||||
}
|
||||
|
||||
public override func dispose() {
|
||||
spine_slider_dispose(_ptr.assumingMemoryBound(to: spine_slider_wrapper.self))
|
||||
}
|
||||
|
||||
@ -52,14 +52,18 @@ public class DeformTimeline: SlotCurveTimeline {
|
||||
let rtti = spine_vertex_attachment_get_rtti(result!)
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_bounding_box_attachment":
|
||||
return BoundingBoxAttachment(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
|
||||
case "spine_clipping_attachment":
|
||||
return ClippingAttachment(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_clipping_attachment_wrapper.self))
|
||||
case "spine_mesh_attachment":
|
||||
return MeshAttachment(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
|
||||
case "spine_path_attachment":
|
||||
return PathAttachment(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_path_attachment_wrapper.self))
|
||||
case "BoundingBoxAttachment":
|
||||
let castedPtr = spine_vertex_attachment_cast_to_bounding_box_attachment(result!)
|
||||
return BoundingBoxAttachment(fromPointer: castedPtr!)
|
||||
case "ClippingAttachment":
|
||||
let castedPtr = spine_vertex_attachment_cast_to_clipping_attachment(result!)
|
||||
return ClippingAttachment(fromPointer: castedPtr!)
|
||||
case "MeshAttachment":
|
||||
let castedPtr = spine_vertex_attachment_cast_to_mesh_attachment(result!)
|
||||
return MeshAttachment(fromPointer: castedPtr!)
|
||||
case "PathAttachment":
|
||||
let castedPtr = spine_vertex_attachment_cast_to_path_attachment(result!)
|
||||
return PathAttachment(fromPointer: castedPtr!)
|
||||
default:
|
||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class VertexAttachment")
|
||||
}
|
||||
|
||||
@ -35,10 +35,10 @@ import SpineC
|
||||
/// IkConstraint wrapper
|
||||
@objc(SpineIkConstraint)
|
||||
@objcMembers
|
||||
public class IkConstraint: PosedActive, Posed, Constraint {
|
||||
public class IkConstraint: IkConstraintBase {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_ik_constraint) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_posed_active_wrapper.self))
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_ik_constraint_base_wrapper.self))
|
||||
}
|
||||
|
||||
public convenience init(_ data: IkConstraintData, _ skeleton: Skeleton) {
|
||||
@ -46,21 +46,6 @@ public class IkConstraint: PosedActive, Posed, Constraint {
|
||||
self.init(fromPointer: ptr!)
|
||||
}
|
||||
|
||||
public var rtti: Rtti {
|
||||
let result = spine_ik_constraint_get_rtti(_ptr.assumingMemoryBound(to: spine_ik_constraint_wrapper.self))
|
||||
return Rtti(fromPointer: result!)
|
||||
}
|
||||
|
||||
public var isSourceActive: Bool {
|
||||
let result = spine_ik_constraint_is_source_active(_ptr.assumingMemoryBound(to: spine_ik_constraint_wrapper.self))
|
||||
return result
|
||||
}
|
||||
|
||||
public var data: ConstraintData {
|
||||
let result = spine_ik_constraint_get_data(_ptr.assumingMemoryBound(to: spine_ik_constraint_wrapper.self))
|
||||
return IkConstraintData(fromPointer: result!)
|
||||
}
|
||||
|
||||
public var bones: ArrayBonePose {
|
||||
let result = spine_ik_constraint_get_bones(_ptr.assumingMemoryBound(to: spine_ik_constraint_wrapper.self))
|
||||
return ArrayBonePose(fromPointer: result!)
|
||||
@ -76,47 +61,11 @@ public class IkConstraint: PosedActive, Posed, Constraint {
|
||||
}
|
||||
}
|
||||
|
||||
public var pose: IkConstraintPose {
|
||||
let result = spine_ik_constraint_get_pose(_ptr.assumingMemoryBound(to: spine_ik_constraint_wrapper.self))
|
||||
return IkConstraintPose(fromPointer: result!)
|
||||
}
|
||||
|
||||
public var appliedPose: IkConstraintPose {
|
||||
let result = spine_ik_constraint_get_applied_pose(_ptr.assumingMemoryBound(to: spine_ik_constraint_wrapper.self))
|
||||
return IkConstraintPose(fromPointer: result!)
|
||||
}
|
||||
|
||||
public var isPoseEqualToApplied: Bool {
|
||||
let result = spine_ik_constraint_is_pose_equal_to_applied(_ptr.assumingMemoryBound(to: spine_ik_constraint_wrapper.self))
|
||||
return result
|
||||
}
|
||||
|
||||
public func copyAttachment(_ skeleton: Skeleton) -> IkConstraint {
|
||||
let result = spine_ik_constraint_copy(_ptr.assumingMemoryBound(to: spine_ik_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
return IkConstraint(fromPointer: result!)
|
||||
}
|
||||
|
||||
public func update(_ skeleton: Skeleton, _ physics: Physics) {
|
||||
spine_ik_constraint_update(_ptr.assumingMemoryBound(to: spine_ik_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), spine_physics(rawValue: UInt32(physics.rawValue)))
|
||||
}
|
||||
|
||||
public func sort(_ skeleton: Skeleton) {
|
||||
spine_ik_constraint_sort(_ptr.assumingMemoryBound(to: spine_ik_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
}
|
||||
|
||||
public func resetConstrained() {
|
||||
spine_ik_constraint_reset_constrained(_ptr.assumingMemoryBound(to: spine_ik_constraint_wrapper.self))
|
||||
}
|
||||
|
||||
public func constrained() {
|
||||
spine_ik_constraint_constrained(_ptr.assumingMemoryBound(to: spine_ik_constraint_wrapper.self))
|
||||
}
|
||||
|
||||
public static func rttiStatic() -> Rtti {
|
||||
let result = spine_ik_constraint_rtti()
|
||||
return Rtti(fromPointer: result!)
|
||||
}
|
||||
|
||||
public static func apply(_ skeleton: Skeleton, _ bone: BonePose, _ targetX: Float, _ targetY: Float, _ compress: Bool, _ stretch: Bool, _ uniform: Bool, _ mix: Float) {
|
||||
spine_ik_constraint_apply_1(skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), bone._ptr.assumingMemoryBound(to: spine_bone_pose_wrapper.self), targetX, targetY, compress, stretch, uniform, mix)
|
||||
}
|
||||
|
||||
@ -0,0 +1,95 @@
|
||||
//
|
||||
// Spine Runtimes License Agreement
|
||||
// Last updated April 5, 2025. Replaces all prior versions.
|
||||
//
|
||||
// Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
//
|
||||
// Integration of the Spine Runtimes into software or otherwise creating
|
||||
// derivative works of the Spine Runtimes is permitted under the terms and
|
||||
// conditions of Section 2 of the Spine Editor License Agreement:
|
||||
// http://esotericsoftware.com/spine-editor-license
|
||||
//
|
||||
// Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
// or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
// "Products"), provided that each user of the Products must obtain their own
|
||||
// Spine Editor license and redistribution of the Products in any form must
|
||||
// include this license and copyright notice.
|
||||
//
|
||||
// THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
// DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
// BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
// THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
|
||||
// AUTO GENERATED FILE, DO NOT EDIT.
|
||||
|
||||
import Foundation
|
||||
import SpineC
|
||||
|
||||
/// IkConstraintBase wrapper
|
||||
@objc(SpineIkConstraintBase)
|
||||
@objcMembers
|
||||
open class IkConstraintBase: PosedActive, Posed, Constraint {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_ik_constraint_base) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_posed_active_wrapper.self))
|
||||
}
|
||||
|
||||
public var data: ConstraintData {
|
||||
let result = spine_ik_constraint_base_get_data(_ptr.assumingMemoryBound(to: spine_ik_constraint_base_wrapper.self))
|
||||
return IkConstraintData(fromPointer: result!)
|
||||
}
|
||||
|
||||
public var pose: IkConstraintPose {
|
||||
let result = spine_ik_constraint_base_get_pose(_ptr.assumingMemoryBound(to: spine_ik_constraint_base_wrapper.self))
|
||||
return IkConstraintPose(fromPointer: result!)
|
||||
}
|
||||
|
||||
public var appliedPose: IkConstraintPose {
|
||||
let result = spine_ik_constraint_base_get_applied_pose(_ptr.assumingMemoryBound(to: spine_ik_constraint_base_wrapper.self))
|
||||
return IkConstraintPose(fromPointer: result!)
|
||||
}
|
||||
|
||||
public var isPoseEqualToApplied: Bool {
|
||||
let result = spine_ik_constraint_base_is_pose_equal_to_applied(_ptr.assumingMemoryBound(to: spine_ik_constraint_base_wrapper.self))
|
||||
return result
|
||||
}
|
||||
|
||||
public var rtti: Rtti {
|
||||
let result = spine_ik_constraint_base_get_rtti(_ptr.assumingMemoryBound(to: spine_ik_constraint_base_wrapper.self))
|
||||
return Rtti(fromPointer: result!)
|
||||
}
|
||||
|
||||
public var isSourceActive: Bool {
|
||||
let result = spine_ik_constraint_base_is_source_active(_ptr.assumingMemoryBound(to: spine_ik_constraint_base_wrapper.self))
|
||||
return result
|
||||
}
|
||||
|
||||
public func resetConstrained() {
|
||||
spine_ik_constraint_base_reset_constrained(_ptr.assumingMemoryBound(to: spine_ik_constraint_base_wrapper.self))
|
||||
}
|
||||
|
||||
public func constrained() {
|
||||
spine_ik_constraint_base_constrained(_ptr.assumingMemoryBound(to: spine_ik_constraint_base_wrapper.self))
|
||||
}
|
||||
|
||||
public func sort(_ skeleton: Skeleton) {
|
||||
spine_ik_constraint_base_sort(_ptr.assumingMemoryBound(to: spine_ik_constraint_base_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
}
|
||||
|
||||
public func update(_ skeleton: Skeleton, _ physics: Physics) {
|
||||
spine_ik_constraint_base_update(_ptr.assumingMemoryBound(to: spine_ik_constraint_base_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), spine_physics(rawValue: UInt32(physics.rawValue)))
|
||||
}
|
||||
|
||||
public static func rttiStatic() -> Rtti {
|
||||
let result = spine_ik_constraint_base_rtti()
|
||||
return Rtti(fromPointer: result!)
|
||||
}
|
||||
|
||||
}
|
||||
@ -86,16 +86,21 @@ public class IkConstraintData: PosedData, ConstraintData {
|
||||
let rtti = spine_constraint_get_rtti(result!)
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_ik_constraint":
|
||||
return IkConstraint(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_ik_constraint_wrapper.self))
|
||||
case "spine_path_constraint":
|
||||
return PathConstraint(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_path_constraint_wrapper.self))
|
||||
case "spine_physics_constraint":
|
||||
return PhysicsConstraint(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_physics_constraint_wrapper.self))
|
||||
case "spine_slider":
|
||||
return Slider(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_slider_wrapper.self))
|
||||
case "spine_transform_constraint":
|
||||
return TransformConstraint(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_transform_constraint_wrapper.self))
|
||||
case "IkConstraint":
|
||||
let castedPtr = spine_constraint_cast_to_ik_constraint(result!)
|
||||
return IkConstraint(fromPointer: castedPtr!)
|
||||
case "PathConstraint":
|
||||
let castedPtr = spine_constraint_cast_to_path_constraint(result!)
|
||||
return PathConstraint(fromPointer: castedPtr!)
|
||||
case "PhysicsConstraint":
|
||||
let castedPtr = spine_constraint_cast_to_physics_constraint(result!)
|
||||
return PhysicsConstraint(fromPointer: castedPtr!)
|
||||
case "Slider":
|
||||
let castedPtr = spine_constraint_cast_to_slider(result!)
|
||||
return Slider(fromPointer: castedPtr!)
|
||||
case "TransformConstraint":
|
||||
let castedPtr = spine_constraint_cast_to_transform_constraint(result!)
|
||||
return TransformConstraint(fromPointer: castedPtr!)
|
||||
default:
|
||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Constraint")
|
||||
}
|
||||
|
||||
@ -35,10 +35,10 @@ import SpineC
|
||||
/// PathConstraint wrapper
|
||||
@objc(SpinePathConstraint)
|
||||
@objcMembers
|
||||
public class PathConstraint: PosedActive, Posed, Constraint {
|
||||
public class PathConstraint: PathConstraintBase {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_path_constraint) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_posed_active_wrapper.self))
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_path_constraint_base_wrapper.self))
|
||||
}
|
||||
|
||||
public convenience init(_ data: PathConstraintData, _ skeleton: Skeleton) {
|
||||
@ -46,16 +46,6 @@ public class PathConstraint: PosedActive, Posed, Constraint {
|
||||
self.init(fromPointer: ptr!)
|
||||
}
|
||||
|
||||
public var rtti: Rtti {
|
||||
let result = spine_path_constraint_get_rtti(_ptr.assumingMemoryBound(to: spine_path_constraint_wrapper.self))
|
||||
return Rtti(fromPointer: result!)
|
||||
}
|
||||
|
||||
public var isSourceActive: Bool {
|
||||
let result = spine_path_constraint_is_source_active(_ptr.assumingMemoryBound(to: spine_path_constraint_wrapper.self))
|
||||
return result
|
||||
}
|
||||
|
||||
public var bones: ArrayBonePose {
|
||||
let result = spine_path_constraint_get_bones(_ptr.assumingMemoryBound(to: spine_path_constraint_wrapper.self))
|
||||
return ArrayBonePose(fromPointer: result!)
|
||||
@ -71,52 +61,11 @@ public class PathConstraint: PosedActive, Posed, Constraint {
|
||||
}
|
||||
}
|
||||
|
||||
public var data: ConstraintData {
|
||||
let result = spine_path_constraint_get_data(_ptr.assumingMemoryBound(to: spine_path_constraint_wrapper.self))
|
||||
return PathConstraintData(fromPointer: result!)
|
||||
}
|
||||
|
||||
public var pose: PathConstraintPose {
|
||||
let result = spine_path_constraint_get_pose(_ptr.assumingMemoryBound(to: spine_path_constraint_wrapper.self))
|
||||
return PathConstraintPose(fromPointer: result!)
|
||||
}
|
||||
|
||||
public var appliedPose: PathConstraintPose {
|
||||
let result = spine_path_constraint_get_applied_pose(_ptr.assumingMemoryBound(to: spine_path_constraint_wrapper.self))
|
||||
return PathConstraintPose(fromPointer: result!)
|
||||
}
|
||||
|
||||
public var isPoseEqualToApplied: Bool {
|
||||
let result = spine_path_constraint_is_pose_equal_to_applied(_ptr.assumingMemoryBound(to: spine_path_constraint_wrapper.self))
|
||||
return result
|
||||
}
|
||||
|
||||
public func copyAttachment(_ skeleton: Skeleton) -> PathConstraint {
|
||||
let result = spine_path_constraint_copy(_ptr.assumingMemoryBound(to: spine_path_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
return PathConstraint(fromPointer: result!)
|
||||
}
|
||||
|
||||
public func update(_ skeleton: Skeleton, _ physics: Physics) {
|
||||
spine_path_constraint_update(_ptr.assumingMemoryBound(to: spine_path_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), spine_physics(rawValue: UInt32(physics.rawValue)))
|
||||
}
|
||||
|
||||
public func sort(_ skeleton: Skeleton) {
|
||||
spine_path_constraint_sort(_ptr.assumingMemoryBound(to: spine_path_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
}
|
||||
|
||||
public func resetConstrained() {
|
||||
spine_path_constraint_reset_constrained(_ptr.assumingMemoryBound(to: spine_path_constraint_wrapper.self))
|
||||
}
|
||||
|
||||
public func constrained() {
|
||||
spine_path_constraint_constrained(_ptr.assumingMemoryBound(to: spine_path_constraint_wrapper.self))
|
||||
}
|
||||
|
||||
public static func rttiStatic() -> Rtti {
|
||||
let result = spine_path_constraint_rtti()
|
||||
return Rtti(fromPointer: result!)
|
||||
}
|
||||
|
||||
public override func dispose() {
|
||||
spine_path_constraint_dispose(_ptr.assumingMemoryBound(to: spine_path_constraint_wrapper.self))
|
||||
}
|
||||
|
||||
@ -0,0 +1,95 @@
|
||||
//
|
||||
// Spine Runtimes License Agreement
|
||||
// Last updated April 5, 2025. Replaces all prior versions.
|
||||
//
|
||||
// Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
//
|
||||
// Integration of the Spine Runtimes into software or otherwise creating
|
||||
// derivative works of the Spine Runtimes is permitted under the terms and
|
||||
// conditions of Section 2 of the Spine Editor License Agreement:
|
||||
// http://esotericsoftware.com/spine-editor-license
|
||||
//
|
||||
// Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
// or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
// "Products"), provided that each user of the Products must obtain their own
|
||||
// Spine Editor license and redistribution of the Products in any form must
|
||||
// include this license and copyright notice.
|
||||
//
|
||||
// THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
// DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
// BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
// THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
|
||||
// AUTO GENERATED FILE, DO NOT EDIT.
|
||||
|
||||
import Foundation
|
||||
import SpineC
|
||||
|
||||
/// PathConstraintBase wrapper
|
||||
@objc(SpinePathConstraintBase)
|
||||
@objcMembers
|
||||
open class PathConstraintBase: PosedActive, Posed, Constraint {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_path_constraint_base) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_posed_active_wrapper.self))
|
||||
}
|
||||
|
||||
public var data: ConstraintData {
|
||||
let result = spine_path_constraint_base_get_data(_ptr.assumingMemoryBound(to: spine_path_constraint_base_wrapper.self))
|
||||
return PathConstraintData(fromPointer: result!)
|
||||
}
|
||||
|
||||
public var pose: PathConstraintPose {
|
||||
let result = spine_path_constraint_base_get_pose(_ptr.assumingMemoryBound(to: spine_path_constraint_base_wrapper.self))
|
||||
return PathConstraintPose(fromPointer: result!)
|
||||
}
|
||||
|
||||
public var appliedPose: PathConstraintPose {
|
||||
let result = spine_path_constraint_base_get_applied_pose(_ptr.assumingMemoryBound(to: spine_path_constraint_base_wrapper.self))
|
||||
return PathConstraintPose(fromPointer: result!)
|
||||
}
|
||||
|
||||
public var isPoseEqualToApplied: Bool {
|
||||
let result = spine_path_constraint_base_is_pose_equal_to_applied(_ptr.assumingMemoryBound(to: spine_path_constraint_base_wrapper.self))
|
||||
return result
|
||||
}
|
||||
|
||||
public var rtti: Rtti {
|
||||
let result = spine_path_constraint_base_get_rtti(_ptr.assumingMemoryBound(to: spine_path_constraint_base_wrapper.self))
|
||||
return Rtti(fromPointer: result!)
|
||||
}
|
||||
|
||||
public var isSourceActive: Bool {
|
||||
let result = spine_path_constraint_base_is_source_active(_ptr.assumingMemoryBound(to: spine_path_constraint_base_wrapper.self))
|
||||
return result
|
||||
}
|
||||
|
||||
public func resetConstrained() {
|
||||
spine_path_constraint_base_reset_constrained(_ptr.assumingMemoryBound(to: spine_path_constraint_base_wrapper.self))
|
||||
}
|
||||
|
||||
public func constrained() {
|
||||
spine_path_constraint_base_constrained(_ptr.assumingMemoryBound(to: spine_path_constraint_base_wrapper.self))
|
||||
}
|
||||
|
||||
public func sort(_ skeleton: Skeleton) {
|
||||
spine_path_constraint_base_sort(_ptr.assumingMemoryBound(to: spine_path_constraint_base_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
}
|
||||
|
||||
public func update(_ skeleton: Skeleton, _ physics: Physics) {
|
||||
spine_path_constraint_base_update(_ptr.assumingMemoryBound(to: spine_path_constraint_base_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), spine_physics(rawValue: UInt32(physics.rawValue)))
|
||||
}
|
||||
|
||||
public static func rttiStatic() -> Rtti {
|
||||
let result = spine_path_constraint_base_rtti()
|
||||
return Rtti(fromPointer: result!)
|
||||
}
|
||||
|
||||
}
|
||||
@ -116,16 +116,21 @@ public class PathConstraintData: PosedData, ConstraintData {
|
||||
let rtti = spine_constraint_get_rtti(result!)
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_ik_constraint":
|
||||
return IkConstraint(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_ik_constraint_wrapper.self))
|
||||
case "spine_path_constraint":
|
||||
return PathConstraint(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_path_constraint_wrapper.self))
|
||||
case "spine_physics_constraint":
|
||||
return PhysicsConstraint(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_physics_constraint_wrapper.self))
|
||||
case "spine_slider":
|
||||
return Slider(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_slider_wrapper.self))
|
||||
case "spine_transform_constraint":
|
||||
return TransformConstraint(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_transform_constraint_wrapper.self))
|
||||
case "IkConstraint":
|
||||
let castedPtr = spine_constraint_cast_to_ik_constraint(result!)
|
||||
return IkConstraint(fromPointer: castedPtr!)
|
||||
case "PathConstraint":
|
||||
let castedPtr = spine_constraint_cast_to_path_constraint(result!)
|
||||
return PathConstraint(fromPointer: castedPtr!)
|
||||
case "PhysicsConstraint":
|
||||
let castedPtr = spine_constraint_cast_to_physics_constraint(result!)
|
||||
return PhysicsConstraint(fromPointer: castedPtr!)
|
||||
case "Slider":
|
||||
let castedPtr = spine_constraint_cast_to_slider(result!)
|
||||
return Slider(fromPointer: castedPtr!)
|
||||
case "TransformConstraint":
|
||||
let castedPtr = spine_constraint_cast_to_transform_constraint(result!)
|
||||
return TransformConstraint(fromPointer: castedPtr!)
|
||||
default:
|
||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Constraint")
|
||||
}
|
||||
|
||||
@ -35,10 +35,10 @@ import SpineC
|
||||
/// PhysicsConstraint wrapper
|
||||
@objc(SpinePhysicsConstraint)
|
||||
@objcMembers
|
||||
public class PhysicsConstraint: PosedActive, Posed, Constraint {
|
||||
public class PhysicsConstraint: PhysicsConstraintBase {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_physics_constraint) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_posed_active_wrapper.self))
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_physics_constraint_base_wrapper.self))
|
||||
}
|
||||
|
||||
public convenience init(_ data: PhysicsConstraintData, _ skeleton: Skeleton) {
|
||||
@ -46,16 +46,6 @@ public class PhysicsConstraint: PosedActive, Posed, Constraint {
|
||||
self.init(fromPointer: ptr!)
|
||||
}
|
||||
|
||||
public var rtti: Rtti {
|
||||
let result = spine_physics_constraint_get_rtti(_ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self))
|
||||
return Rtti(fromPointer: result!)
|
||||
}
|
||||
|
||||
public var isSourceActive: Bool {
|
||||
let result = spine_physics_constraint_is_source_active(_ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self))
|
||||
return result
|
||||
}
|
||||
|
||||
public var bone: BonePose {
|
||||
get {
|
||||
let result = spine_physics_constraint_get_bone(_ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self))
|
||||
@ -66,34 +56,6 @@ public class PhysicsConstraint: PosedActive, Posed, Constraint {
|
||||
}
|
||||
}
|
||||
|
||||
public var data: ConstraintData {
|
||||
let result = spine_physics_constraint_get_data(_ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self))
|
||||
return PhysicsConstraintData(fromPointer: result!)
|
||||
}
|
||||
|
||||
public var pose: PhysicsConstraintPose {
|
||||
let result = spine_physics_constraint_get_pose(_ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self))
|
||||
return PhysicsConstraintPose(fromPointer: result!)
|
||||
}
|
||||
|
||||
public var appliedPose: PhysicsConstraintPose {
|
||||
let result = spine_physics_constraint_get_applied_pose(_ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self))
|
||||
return PhysicsConstraintPose(fromPointer: result!)
|
||||
}
|
||||
|
||||
public var isPoseEqualToApplied: Bool {
|
||||
let result = spine_physics_constraint_is_pose_equal_to_applied(_ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self))
|
||||
return result
|
||||
}
|
||||
|
||||
public func update(_ skeleton: Skeleton, _ physics: Physics) {
|
||||
spine_physics_constraint_update(_ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), spine_physics(rawValue: UInt32(physics.rawValue)))
|
||||
}
|
||||
|
||||
public func sort(_ skeleton: Skeleton) {
|
||||
spine_physics_constraint_sort(_ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
}
|
||||
|
||||
public func copyAttachment(_ skeleton: Skeleton) -> PhysicsConstraint {
|
||||
let result = spine_physics_constraint_copy(_ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
return PhysicsConstraint(fromPointer: result!)
|
||||
@ -111,19 +73,6 @@ public class PhysicsConstraint: PosedActive, Posed, Constraint {
|
||||
spine_physics_constraint_rotate(_ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self), x, y, degrees)
|
||||
}
|
||||
|
||||
public func resetConstrained() {
|
||||
spine_physics_constraint_reset_constrained(_ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self))
|
||||
}
|
||||
|
||||
public func constrained() {
|
||||
spine_physics_constraint_constrained(_ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self))
|
||||
}
|
||||
|
||||
public static func rttiStatic() -> Rtti {
|
||||
let result = spine_physics_constraint_rtti()
|
||||
return Rtti(fromPointer: result!)
|
||||
}
|
||||
|
||||
public override func dispose() {
|
||||
spine_physics_constraint_dispose(_ptr.assumingMemoryBound(to: spine_physics_constraint_wrapper.self))
|
||||
}
|
||||
|
||||
@ -0,0 +1,95 @@
|
||||
//
|
||||
// Spine Runtimes License Agreement
|
||||
// Last updated April 5, 2025. Replaces all prior versions.
|
||||
//
|
||||
// Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
//
|
||||
// Integration of the Spine Runtimes into software or otherwise creating
|
||||
// derivative works of the Spine Runtimes is permitted under the terms and
|
||||
// conditions of Section 2 of the Spine Editor License Agreement:
|
||||
// http://esotericsoftware.com/spine-editor-license
|
||||
//
|
||||
// Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
// or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
// "Products"), provided that each user of the Products must obtain their own
|
||||
// Spine Editor license and redistribution of the Products in any form must
|
||||
// include this license and copyright notice.
|
||||
//
|
||||
// THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
// DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
// BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
// THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
|
||||
// AUTO GENERATED FILE, DO NOT EDIT.
|
||||
|
||||
import Foundation
|
||||
import SpineC
|
||||
|
||||
/// PhysicsConstraintBase wrapper
|
||||
@objc(SpinePhysicsConstraintBase)
|
||||
@objcMembers
|
||||
open class PhysicsConstraintBase: PosedActive, Posed, Constraint {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_physics_constraint_base) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_posed_active_wrapper.self))
|
||||
}
|
||||
|
||||
public var data: ConstraintData {
|
||||
let result = spine_physics_constraint_base_get_data(_ptr.assumingMemoryBound(to: spine_physics_constraint_base_wrapper.self))
|
||||
return PhysicsConstraintData(fromPointer: result!)
|
||||
}
|
||||
|
||||
public var pose: PhysicsConstraintPose {
|
||||
let result = spine_physics_constraint_base_get_pose(_ptr.assumingMemoryBound(to: spine_physics_constraint_base_wrapper.self))
|
||||
return PhysicsConstraintPose(fromPointer: result!)
|
||||
}
|
||||
|
||||
public var appliedPose: PhysicsConstraintPose {
|
||||
let result = spine_physics_constraint_base_get_applied_pose(_ptr.assumingMemoryBound(to: spine_physics_constraint_base_wrapper.self))
|
||||
return PhysicsConstraintPose(fromPointer: result!)
|
||||
}
|
||||
|
||||
public var isPoseEqualToApplied: Bool {
|
||||
let result = spine_physics_constraint_base_is_pose_equal_to_applied(_ptr.assumingMemoryBound(to: spine_physics_constraint_base_wrapper.self))
|
||||
return result
|
||||
}
|
||||
|
||||
public var rtti: Rtti {
|
||||
let result = spine_physics_constraint_base_get_rtti(_ptr.assumingMemoryBound(to: spine_physics_constraint_base_wrapper.self))
|
||||
return Rtti(fromPointer: result!)
|
||||
}
|
||||
|
||||
public var isSourceActive: Bool {
|
||||
let result = spine_physics_constraint_base_is_source_active(_ptr.assumingMemoryBound(to: spine_physics_constraint_base_wrapper.self))
|
||||
return result
|
||||
}
|
||||
|
||||
public func resetConstrained() {
|
||||
spine_physics_constraint_base_reset_constrained(_ptr.assumingMemoryBound(to: spine_physics_constraint_base_wrapper.self))
|
||||
}
|
||||
|
||||
public func constrained() {
|
||||
spine_physics_constraint_base_constrained(_ptr.assumingMemoryBound(to: spine_physics_constraint_base_wrapper.self))
|
||||
}
|
||||
|
||||
public func sort(_ skeleton: Skeleton) {
|
||||
spine_physics_constraint_base_sort(_ptr.assumingMemoryBound(to: spine_physics_constraint_base_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
}
|
||||
|
||||
public func update(_ skeleton: Skeleton, _ physics: Physics) {
|
||||
spine_physics_constraint_base_update(_ptr.assumingMemoryBound(to: spine_physics_constraint_base_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), spine_physics(rawValue: UInt32(physics.rawValue)))
|
||||
}
|
||||
|
||||
public static func rttiStatic() -> Rtti {
|
||||
let result = spine_physics_constraint_base_rtti()
|
||||
return Rtti(fromPointer: result!)
|
||||
}
|
||||
|
||||
}
|
||||
@ -211,16 +211,21 @@ public class PhysicsConstraintData: PosedData, ConstraintData {
|
||||
let rtti = spine_constraint_get_rtti(result!)
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_ik_constraint":
|
||||
return IkConstraint(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_ik_constraint_wrapper.self))
|
||||
case "spine_path_constraint":
|
||||
return PathConstraint(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_path_constraint_wrapper.self))
|
||||
case "spine_physics_constraint":
|
||||
return PhysicsConstraint(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_physics_constraint_wrapper.self))
|
||||
case "spine_slider":
|
||||
return Slider(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_slider_wrapper.self))
|
||||
case "spine_transform_constraint":
|
||||
return TransformConstraint(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_transform_constraint_wrapper.self))
|
||||
case "IkConstraint":
|
||||
let castedPtr = spine_constraint_cast_to_ik_constraint(result!)
|
||||
return IkConstraint(fromPointer: castedPtr!)
|
||||
case "PathConstraint":
|
||||
let castedPtr = spine_constraint_cast_to_path_constraint(result!)
|
||||
return PathConstraint(fromPointer: castedPtr!)
|
||||
case "PhysicsConstraint":
|
||||
let castedPtr = spine_constraint_cast_to_physics_constraint(result!)
|
||||
return PhysicsConstraint(fromPointer: castedPtr!)
|
||||
case "Slider":
|
||||
let castedPtr = spine_constraint_cast_to_slider(result!)
|
||||
return Slider(fromPointer: castedPtr!)
|
||||
case "TransformConstraint":
|
||||
let castedPtr = spine_constraint_cast_to_transform_constraint(result!)
|
||||
return TransformConstraint(fromPointer: castedPtr!)
|
||||
default:
|
||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Constraint")
|
||||
}
|
||||
|
||||
@ -35,7 +35,7 @@ import SpineC
|
||||
/// PosedActive wrapper
|
||||
@objc(SpinePosedActive)
|
||||
@objcMembers
|
||||
public class PosedActive: NSObject {
|
||||
open class PosedActive: NSObject {
|
||||
public let _ptr: UnsafeMutableRawPointer
|
||||
|
||||
public init(fromPointer ptr: spine_posed_active) {
|
||||
|
||||
@ -51,18 +51,24 @@ public class SequenceTimeline: Timeline, SlotTimeline {
|
||||
let rtti = spine_attachment_get_rtti(result!)
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_bounding_box_attachment":
|
||||
return BoundingBoxAttachment(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
|
||||
case "spine_clipping_attachment":
|
||||
return ClippingAttachment(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_clipping_attachment_wrapper.self))
|
||||
case "spine_mesh_attachment":
|
||||
return MeshAttachment(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
|
||||
case "spine_path_attachment":
|
||||
return PathAttachment(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_path_attachment_wrapper.self))
|
||||
case "spine_point_attachment":
|
||||
return PointAttachment(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_point_attachment_wrapper.self))
|
||||
case "spine_region_attachment":
|
||||
return RegionAttachment(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_region_attachment_wrapper.self))
|
||||
case "BoundingBoxAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_bounding_box_attachment(result!)
|
||||
return BoundingBoxAttachment(fromPointer: castedPtr!)
|
||||
case "ClippingAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_clipping_attachment(result!)
|
||||
return ClippingAttachment(fromPointer: castedPtr!)
|
||||
case "MeshAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_mesh_attachment(result!)
|
||||
return MeshAttachment(fromPointer: castedPtr!)
|
||||
case "PathAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_path_attachment(result!)
|
||||
return PathAttachment(fromPointer: castedPtr!)
|
||||
case "PointAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_point_attachment(result!)
|
||||
return PointAttachment(fromPointer: castedPtr!)
|
||||
case "RegionAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_region_attachment(result!)
|
||||
return RegionAttachment(fromPointer: castedPtr!)
|
||||
default:
|
||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Attachment")
|
||||
}
|
||||
|
||||
95
spine-ios/Sources/SpineSwift/Generated/slider_base.swift
Normal file
95
spine-ios/Sources/SpineSwift/Generated/slider_base.swift
Normal file
@ -0,0 +1,95 @@
|
||||
//
|
||||
// Spine Runtimes License Agreement
|
||||
// Last updated April 5, 2025. Replaces all prior versions.
|
||||
//
|
||||
// Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
//
|
||||
// Integration of the Spine Runtimes into software or otherwise creating
|
||||
// derivative works of the Spine Runtimes is permitted under the terms and
|
||||
// conditions of Section 2 of the Spine Editor License Agreement:
|
||||
// http://esotericsoftware.com/spine-editor-license
|
||||
//
|
||||
// Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
// or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
// "Products"), provided that each user of the Products must obtain their own
|
||||
// Spine Editor license and redistribution of the Products in any form must
|
||||
// include this license and copyright notice.
|
||||
//
|
||||
// THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
// DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
// BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
// THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
|
||||
// AUTO GENERATED FILE, DO NOT EDIT.
|
||||
|
||||
import Foundation
|
||||
import SpineC
|
||||
|
||||
/// SliderBase wrapper
|
||||
@objc(SpineSliderBase)
|
||||
@objcMembers
|
||||
open class SliderBase: PosedActive, Posed, Constraint {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_slider_base) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_posed_active_wrapper.self))
|
||||
}
|
||||
|
||||
public var data: ConstraintData {
|
||||
let result = spine_slider_base_get_data(_ptr.assumingMemoryBound(to: spine_slider_base_wrapper.self))
|
||||
return SliderData(fromPointer: result!)
|
||||
}
|
||||
|
||||
public var pose: SliderPose {
|
||||
let result = spine_slider_base_get_pose(_ptr.assumingMemoryBound(to: spine_slider_base_wrapper.self))
|
||||
return SliderPose(fromPointer: result!)
|
||||
}
|
||||
|
||||
public var appliedPose: SliderPose {
|
||||
let result = spine_slider_base_get_applied_pose(_ptr.assumingMemoryBound(to: spine_slider_base_wrapper.self))
|
||||
return SliderPose(fromPointer: result!)
|
||||
}
|
||||
|
||||
public var isPoseEqualToApplied: Bool {
|
||||
let result = spine_slider_base_is_pose_equal_to_applied(_ptr.assumingMemoryBound(to: spine_slider_base_wrapper.self))
|
||||
return result
|
||||
}
|
||||
|
||||
public var rtti: Rtti {
|
||||
let result = spine_slider_base_get_rtti(_ptr.assumingMemoryBound(to: spine_slider_base_wrapper.self))
|
||||
return Rtti(fromPointer: result!)
|
||||
}
|
||||
|
||||
public var isSourceActive: Bool {
|
||||
let result = spine_slider_base_is_source_active(_ptr.assumingMemoryBound(to: spine_slider_base_wrapper.self))
|
||||
return result
|
||||
}
|
||||
|
||||
public func resetConstrained() {
|
||||
spine_slider_base_reset_constrained(_ptr.assumingMemoryBound(to: spine_slider_base_wrapper.self))
|
||||
}
|
||||
|
||||
public func constrained() {
|
||||
spine_slider_base_constrained(_ptr.assumingMemoryBound(to: spine_slider_base_wrapper.self))
|
||||
}
|
||||
|
||||
public func sort(_ skeleton: Skeleton) {
|
||||
spine_slider_base_sort(_ptr.assumingMemoryBound(to: spine_slider_base_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
}
|
||||
|
||||
public func update(_ skeleton: Skeleton, _ physics: Physics) {
|
||||
spine_slider_base_update(_ptr.assumingMemoryBound(to: spine_slider_base_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), spine_physics(rawValue: UInt32(physics.rawValue)))
|
||||
}
|
||||
|
||||
public static func rttiStatic() -> Rtti {
|
||||
let result = spine_slider_base_rtti()
|
||||
return Rtti(fromPointer: result!)
|
||||
}
|
||||
|
||||
}
|
||||
@ -98,18 +98,24 @@ public class SliderData: PosedData, ConstraintData {
|
||||
let rtti = spine_from_property_get_rtti(ptr)
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_from_rotate":
|
||||
return FromRotate(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_from_rotate_wrapper.self))
|
||||
case "spine_from_scale_x":
|
||||
return FromScaleX(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_from_scale_x_wrapper.self))
|
||||
case "spine_from_scale_y":
|
||||
return FromScaleY(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_from_scale_y_wrapper.self))
|
||||
case "spine_from_shear_y":
|
||||
return FromShearY(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_from_shear_y_wrapper.self))
|
||||
case "spine_from_x":
|
||||
return FromX(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_from_x_wrapper.self))
|
||||
case "spine_from_y":
|
||||
return FromY(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_from_y_wrapper.self))
|
||||
case "FromRotate":
|
||||
let castedPtr = spine_from_property_cast_to_from_rotate(ptr)
|
||||
return FromRotate(fromPointer: castedPtr!)
|
||||
case "FromScaleX":
|
||||
let castedPtr = spine_from_property_cast_to_from_scale_x(ptr)
|
||||
return FromScaleX(fromPointer: castedPtr!)
|
||||
case "FromScaleY":
|
||||
let castedPtr = spine_from_property_cast_to_from_scale_y(ptr)
|
||||
return FromScaleY(fromPointer: castedPtr!)
|
||||
case "FromShearY":
|
||||
let castedPtr = spine_from_property_cast_to_from_shear_y(ptr)
|
||||
return FromShearY(fromPointer: castedPtr!)
|
||||
case "FromX":
|
||||
let castedPtr = spine_from_property_cast_to_from_x(ptr)
|
||||
return FromX(fromPointer: castedPtr!)
|
||||
case "FromY":
|
||||
let castedPtr = spine_from_property_cast_to_from_y(ptr)
|
||||
return FromY(fromPointer: castedPtr!)
|
||||
default:
|
||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class FromProperty")
|
||||
}
|
||||
@ -159,16 +165,21 @@ public class SliderData: PosedData, ConstraintData {
|
||||
let rtti = spine_constraint_get_rtti(result!)
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_ik_constraint":
|
||||
return IkConstraint(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_ik_constraint_wrapper.self))
|
||||
case "spine_path_constraint":
|
||||
return PathConstraint(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_path_constraint_wrapper.self))
|
||||
case "spine_physics_constraint":
|
||||
return PhysicsConstraint(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_physics_constraint_wrapper.self))
|
||||
case "spine_slider":
|
||||
return Slider(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_slider_wrapper.self))
|
||||
case "spine_transform_constraint":
|
||||
return TransformConstraint(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_transform_constraint_wrapper.self))
|
||||
case "IkConstraint":
|
||||
let castedPtr = spine_constraint_cast_to_ik_constraint(result!)
|
||||
return IkConstraint(fromPointer: castedPtr!)
|
||||
case "PathConstraint":
|
||||
let castedPtr = spine_constraint_cast_to_path_constraint(result!)
|
||||
return PathConstraint(fromPointer: castedPtr!)
|
||||
case "PhysicsConstraint":
|
||||
let castedPtr = spine_constraint_cast_to_physics_constraint(result!)
|
||||
return PhysicsConstraint(fromPointer: castedPtr!)
|
||||
case "Slider":
|
||||
let castedPtr = spine_constraint_cast_to_slider(result!)
|
||||
return Slider(fromPointer: castedPtr!)
|
||||
case "TransformConstraint":
|
||||
let castedPtr = spine_constraint_cast_to_transform_constraint(result!)
|
||||
return TransformConstraint(fromPointer: castedPtr!)
|
||||
default:
|
||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Constraint")
|
||||
}
|
||||
|
||||
@ -75,18 +75,24 @@ public class SlotPose: NSObject {
|
||||
let rtti = spine_attachment_get_rtti(ptr)
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_bounding_box_attachment":
|
||||
return BoundingBoxAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
|
||||
case "spine_clipping_attachment":
|
||||
return ClippingAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_clipping_attachment_wrapper.self))
|
||||
case "spine_mesh_attachment":
|
||||
return MeshAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
|
||||
case "spine_path_attachment":
|
||||
return PathAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_path_attachment_wrapper.self))
|
||||
case "spine_point_attachment":
|
||||
return PointAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_point_attachment_wrapper.self))
|
||||
case "spine_region_attachment":
|
||||
return RegionAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_region_attachment_wrapper.self))
|
||||
case "BoundingBoxAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_bounding_box_attachment(ptr)
|
||||
return BoundingBoxAttachment(fromPointer: castedPtr!)
|
||||
case "ClippingAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_clipping_attachment(ptr)
|
||||
return ClippingAttachment(fromPointer: castedPtr!)
|
||||
case "MeshAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_mesh_attachment(ptr)
|
||||
return MeshAttachment(fromPointer: castedPtr!)
|
||||
case "PathAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_path_attachment(ptr)
|
||||
return PathAttachment(fromPointer: castedPtr!)
|
||||
case "PointAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_point_attachment(ptr)
|
||||
return PointAttachment(fromPointer: castedPtr!)
|
||||
case "RegionAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_region_attachment(ptr)
|
||||
return RegionAttachment(fromPointer: castedPtr!)
|
||||
default:
|
||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Attachment")
|
||||
}
|
||||
|
||||
@ -35,10 +35,10 @@ import SpineC
|
||||
/// TransformConstraint wrapper
|
||||
@objc(SpineTransformConstraint)
|
||||
@objcMembers
|
||||
public class TransformConstraint: PosedActive, Posed, Constraint {
|
||||
public class TransformConstraint: TransformConstraintBase {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_transform_constraint) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_posed_active_wrapper.self))
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_transform_constraint_base_wrapper.self))
|
||||
}
|
||||
|
||||
public convenience init(_ data: TransformConstraintData, _ skeleton: Skeleton) {
|
||||
@ -46,16 +46,6 @@ public class TransformConstraint: PosedActive, Posed, Constraint {
|
||||
self.init(fromPointer: ptr!)
|
||||
}
|
||||
|
||||
public var rtti: Rtti {
|
||||
let result = spine_transform_constraint_get_rtti(_ptr.assumingMemoryBound(to: spine_transform_constraint_wrapper.self))
|
||||
return Rtti(fromPointer: result!)
|
||||
}
|
||||
|
||||
public var isSourceActive: Bool {
|
||||
let result = spine_transform_constraint_is_source_active(_ptr.assumingMemoryBound(to: spine_transform_constraint_wrapper.self))
|
||||
return result
|
||||
}
|
||||
|
||||
public var bones: ArrayBonePose {
|
||||
let result = spine_transform_constraint_get_bones(_ptr.assumingMemoryBound(to: spine_transform_constraint_wrapper.self))
|
||||
return ArrayBonePose(fromPointer: result!)
|
||||
@ -71,52 +61,11 @@ public class TransformConstraint: PosedActive, Posed, Constraint {
|
||||
}
|
||||
}
|
||||
|
||||
public var data: ConstraintData {
|
||||
let result = spine_transform_constraint_get_data(_ptr.assumingMemoryBound(to: spine_transform_constraint_wrapper.self))
|
||||
return TransformConstraintData(fromPointer: result!)
|
||||
}
|
||||
|
||||
public var pose: TransformConstraintPose {
|
||||
let result = spine_transform_constraint_get_pose(_ptr.assumingMemoryBound(to: spine_transform_constraint_wrapper.self))
|
||||
return TransformConstraintPose(fromPointer: result!)
|
||||
}
|
||||
|
||||
public var appliedPose: TransformConstraintPose {
|
||||
let result = spine_transform_constraint_get_applied_pose(_ptr.assumingMemoryBound(to: spine_transform_constraint_wrapper.self))
|
||||
return TransformConstraintPose(fromPointer: result!)
|
||||
}
|
||||
|
||||
public var isPoseEqualToApplied: Bool {
|
||||
let result = spine_transform_constraint_is_pose_equal_to_applied(_ptr.assumingMemoryBound(to: spine_transform_constraint_wrapper.self))
|
||||
return result
|
||||
}
|
||||
|
||||
public func copyAttachment(_ skeleton: Skeleton) -> TransformConstraint {
|
||||
let result = spine_transform_constraint_copy(_ptr.assumingMemoryBound(to: spine_transform_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
return TransformConstraint(fromPointer: result!)
|
||||
}
|
||||
|
||||
public func update(_ skeleton: Skeleton, _ physics: Physics) {
|
||||
spine_transform_constraint_update(_ptr.assumingMemoryBound(to: spine_transform_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), spine_physics(rawValue: UInt32(physics.rawValue)))
|
||||
}
|
||||
|
||||
public func sort(_ skeleton: Skeleton) {
|
||||
spine_transform_constraint_sort(_ptr.assumingMemoryBound(to: spine_transform_constraint_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
}
|
||||
|
||||
public func resetConstrained() {
|
||||
spine_transform_constraint_reset_constrained(_ptr.assumingMemoryBound(to: spine_transform_constraint_wrapper.self))
|
||||
}
|
||||
|
||||
public func constrained() {
|
||||
spine_transform_constraint_constrained(_ptr.assumingMemoryBound(to: spine_transform_constraint_wrapper.self))
|
||||
}
|
||||
|
||||
public static func rttiStatic() -> Rtti {
|
||||
let result = spine_transform_constraint_rtti()
|
||||
return Rtti(fromPointer: result!)
|
||||
}
|
||||
|
||||
public override func dispose() {
|
||||
spine_transform_constraint_dispose(_ptr.assumingMemoryBound(to: spine_transform_constraint_wrapper.self))
|
||||
}
|
||||
|
||||
@ -0,0 +1,95 @@
|
||||
//
|
||||
// Spine Runtimes License Agreement
|
||||
// Last updated April 5, 2025. Replaces all prior versions.
|
||||
//
|
||||
// Copyright (c) 2013-2025, Esoteric Software LLC
|
||||
//
|
||||
// Integration of the Spine Runtimes into software or otherwise creating
|
||||
// derivative works of the Spine Runtimes is permitted under the terms and
|
||||
// conditions of Section 2 of the Spine Editor License Agreement:
|
||||
// http://esotericsoftware.com/spine-editor-license
|
||||
//
|
||||
// Otherwise, it is permitted to integrate the Spine Runtimes into software
|
||||
// or otherwise create derivative works of the Spine Runtimes (collectively,
|
||||
// "Products"), provided that each user of the Products must obtain their own
|
||||
// Spine Editor license and redistribution of the Products in any form must
|
||||
// include this license and copyright notice.
|
||||
//
|
||||
// THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
|
||||
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
// DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
|
||||
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
|
||||
// BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
|
||||
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
// THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
|
||||
// AUTO GENERATED FILE, DO NOT EDIT.
|
||||
|
||||
import Foundation
|
||||
import SpineC
|
||||
|
||||
/// TransformConstraintBase wrapper
|
||||
@objc(SpineTransformConstraintBase)
|
||||
@objcMembers
|
||||
open class TransformConstraintBase: PosedActive, Posed, Constraint {
|
||||
@nonobjc
|
||||
public init(fromPointer ptr: spine_transform_constraint_base) {
|
||||
super.init(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_posed_active_wrapper.self))
|
||||
}
|
||||
|
||||
public var data: ConstraintData {
|
||||
let result = spine_transform_constraint_base_get_data(_ptr.assumingMemoryBound(to: spine_transform_constraint_base_wrapper.self))
|
||||
return TransformConstraintData(fromPointer: result!)
|
||||
}
|
||||
|
||||
public var pose: TransformConstraintPose {
|
||||
let result = spine_transform_constraint_base_get_pose(_ptr.assumingMemoryBound(to: spine_transform_constraint_base_wrapper.self))
|
||||
return TransformConstraintPose(fromPointer: result!)
|
||||
}
|
||||
|
||||
public var appliedPose: TransformConstraintPose {
|
||||
let result = spine_transform_constraint_base_get_applied_pose(_ptr.assumingMemoryBound(to: spine_transform_constraint_base_wrapper.self))
|
||||
return TransformConstraintPose(fromPointer: result!)
|
||||
}
|
||||
|
||||
public var isPoseEqualToApplied: Bool {
|
||||
let result = spine_transform_constraint_base_is_pose_equal_to_applied(_ptr.assumingMemoryBound(to: spine_transform_constraint_base_wrapper.self))
|
||||
return result
|
||||
}
|
||||
|
||||
public var rtti: Rtti {
|
||||
let result = spine_transform_constraint_base_get_rtti(_ptr.assumingMemoryBound(to: spine_transform_constraint_base_wrapper.self))
|
||||
return Rtti(fromPointer: result!)
|
||||
}
|
||||
|
||||
public var isSourceActive: Bool {
|
||||
let result = spine_transform_constraint_base_is_source_active(_ptr.assumingMemoryBound(to: spine_transform_constraint_base_wrapper.self))
|
||||
return result
|
||||
}
|
||||
|
||||
public func resetConstrained() {
|
||||
spine_transform_constraint_base_reset_constrained(_ptr.assumingMemoryBound(to: spine_transform_constraint_base_wrapper.self))
|
||||
}
|
||||
|
||||
public func constrained() {
|
||||
spine_transform_constraint_base_constrained(_ptr.assumingMemoryBound(to: spine_transform_constraint_base_wrapper.self))
|
||||
}
|
||||
|
||||
public func sort(_ skeleton: Skeleton) {
|
||||
spine_transform_constraint_base_sort(_ptr.assumingMemoryBound(to: spine_transform_constraint_base_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self))
|
||||
}
|
||||
|
||||
public func update(_ skeleton: Skeleton, _ physics: Physics) {
|
||||
spine_transform_constraint_base_update(_ptr.assumingMemoryBound(to: spine_transform_constraint_base_wrapper.self), skeleton._ptr.assumingMemoryBound(to: spine_skeleton_wrapper.self), spine_physics(rawValue: UInt32(physics.rawValue)))
|
||||
}
|
||||
|
||||
public static func rttiStatic() -> Rtti {
|
||||
let result = spine_transform_constraint_base_rtti()
|
||||
return Rtti(fromPointer: result!)
|
||||
}
|
||||
|
||||
}
|
||||
@ -181,16 +181,21 @@ public class TransformConstraintData: PosedData, ConstraintData {
|
||||
let rtti = spine_constraint_get_rtti(result!)
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_ik_constraint":
|
||||
return IkConstraint(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_ik_constraint_wrapper.self))
|
||||
case "spine_path_constraint":
|
||||
return PathConstraint(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_path_constraint_wrapper.self))
|
||||
case "spine_physics_constraint":
|
||||
return PhysicsConstraint(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_physics_constraint_wrapper.self))
|
||||
case "spine_slider":
|
||||
return Slider(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_slider_wrapper.self))
|
||||
case "spine_transform_constraint":
|
||||
return TransformConstraint(fromPointer: UnsafeMutableRawPointer(result!).assumingMemoryBound(to: spine_transform_constraint_wrapper.self))
|
||||
case "IkConstraint":
|
||||
let castedPtr = spine_constraint_cast_to_ik_constraint(result!)
|
||||
return IkConstraint(fromPointer: castedPtr!)
|
||||
case "PathConstraint":
|
||||
let castedPtr = spine_constraint_cast_to_path_constraint(result!)
|
||||
return PathConstraint(fromPointer: castedPtr!)
|
||||
case "PhysicsConstraint":
|
||||
let castedPtr = spine_constraint_cast_to_physics_constraint(result!)
|
||||
return PhysicsConstraint(fromPointer: castedPtr!)
|
||||
case "Slider":
|
||||
let castedPtr = spine_constraint_cast_to_slider(result!)
|
||||
return Slider(fromPointer: castedPtr!)
|
||||
case "TransformConstraint":
|
||||
let castedPtr = spine_constraint_cast_to_transform_constraint(result!)
|
||||
return TransformConstraint(fromPointer: castedPtr!)
|
||||
default:
|
||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Constraint")
|
||||
}
|
||||
|
||||
@ -83,18 +83,24 @@ open class VertexAttachment: Attachment {
|
||||
let rtti = spine_attachment_get_rtti(ptr)
|
||||
let rttiClassName = String(cString: spine_rtti_get_class_name(rtti)!)
|
||||
switch rttiClassName {
|
||||
case "spine_bounding_box_attachment":
|
||||
return BoundingBoxAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_bounding_box_attachment_wrapper.self))
|
||||
case "spine_clipping_attachment":
|
||||
return ClippingAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_clipping_attachment_wrapper.self))
|
||||
case "spine_mesh_attachment":
|
||||
return MeshAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_mesh_attachment_wrapper.self))
|
||||
case "spine_path_attachment":
|
||||
return PathAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_path_attachment_wrapper.self))
|
||||
case "spine_point_attachment":
|
||||
return PointAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_point_attachment_wrapper.self))
|
||||
case "spine_region_attachment":
|
||||
return RegionAttachment(fromPointer: UnsafeMutableRawPointer(ptr).assumingMemoryBound(to: spine_region_attachment_wrapper.self))
|
||||
case "BoundingBoxAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_bounding_box_attachment(ptr)
|
||||
return BoundingBoxAttachment(fromPointer: castedPtr!)
|
||||
case "ClippingAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_clipping_attachment(ptr)
|
||||
return ClippingAttachment(fromPointer: castedPtr!)
|
||||
case "MeshAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_mesh_attachment(ptr)
|
||||
return MeshAttachment(fromPointer: castedPtr!)
|
||||
case "PathAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_path_attachment(ptr)
|
||||
return PathAttachment(fromPointer: castedPtr!)
|
||||
case "PointAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_point_attachment(ptr)
|
||||
return PointAttachment(fromPointer: castedPtr!)
|
||||
case "RegionAttachment":
|
||||
let castedPtr = spine_attachment_cast_to_region_attachment(ptr)
|
||||
return RegionAttachment(fromPointer: castedPtr!)
|
||||
default:
|
||||
fatalError("Unknown concrete type: \(rttiClassName) for abstract class Attachment")
|
||||
}
|
||||
|
||||
@ -641,7 +641,26 @@ export class SwiftWriter {
|
||||
if (swiftClass.type === 'abstract') {
|
||||
declaration = `${objcAnnotations}open class ${swiftClass.name}`;
|
||||
} else {
|
||||
declaration = `${objcAnnotations}public class ${swiftClass.name}`;
|
||||
// Check if any abstract class extends from this class
|
||||
// If so, this class needs to be open as well
|
||||
let needsOpen = false;
|
||||
// Find the C type name for this Swift class
|
||||
const cTypeName = this.fromSwiftTypeName(swiftClass.name);
|
||||
for (const [childName, inheritanceInfo] of Object.entries(this.inheritance)) {
|
||||
if (inheritanceInfo.extends === cTypeName) {
|
||||
const childClass = this.classMap.get(childName);
|
||||
if (childClass && this.isAbstract(childClass)) {
|
||||
needsOpen = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (needsOpen) {
|
||||
declaration = `${objcAnnotations}open class ${swiftClass.name}`;
|
||||
} else {
|
||||
declaration = `${objcAnnotations}public class ${swiftClass.name}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -713,7 +732,8 @@ ${declaration} {`;
|
||||
if (hasDispose) {
|
||||
const disposeMethod = swiftClass.members.find(m => m.name === '__dispose__');
|
||||
if (disposeMethod) {
|
||||
// Add override if this class extends another CONCRETE class (abstract classes don't have dispose)
|
||||
// Only add override if a parent class has a destructor that we generated dispose() for
|
||||
// Abstract classes don't get dispose() generated, only concrete classes do
|
||||
let override = '';
|
||||
if (swiftClass.inheritance.extends) {
|
||||
// Find the C++ name for this Swift class
|
||||
@ -726,13 +746,17 @@ ${declaration} {`;
|
||||
}
|
||||
|
||||
if (cppName) {
|
||||
const parentCName = this.inheritance[cppName]?.extends;
|
||||
if (parentCName) {
|
||||
// Check all parents in the hierarchy to see if any has a destructor AND is concrete
|
||||
let parentCName = this.inheritance[cppName]?.extends;
|
||||
while (parentCName) {
|
||||
const parentClass = this.classMap.get(parentCName);
|
||||
// Only override if parent is concrete and has destructor
|
||||
if (parentClass && !parentClass.cppType.isAbstract && parentClass.destructor) {
|
||||
// Only concrete classes get dispose() generated
|
||||
if (parentClass && parentClass.destructor && !this.isAbstract(parentClass)) {
|
||||
override = 'override ';
|
||||
break;
|
||||
}
|
||||
// Check next parent in hierarchy
|
||||
parentCName = this.inheritance[parentCName]?.extends;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1422,10 +1446,15 @@ ${declaration} {`;
|
||||
|
||||
for (const subclass of concreteSubclasses) {
|
||||
const swiftSubclass = this.toSwiftTypeName(subclass);
|
||||
lines.push(`case "${subclass}":`);
|
||||
// Cast the pointer to the specific subclass type
|
||||
const cSubclassTypeName = this.toCTypeName(swiftSubclass);
|
||||
lines.push(` return ${swiftSubclass}(fromPointer: UnsafeMutableRawPointer(${resultVar}).assumingMemoryBound(to: ${cSubclassTypeName}_wrapper.self))`);
|
||||
// RTTI returns the C++ class name in PascalCase (e.g., "TransformConstraint")
|
||||
// We need to convert spine_transform_constraint -> TransformConstraint
|
||||
const cppClassName = this.toPascalCase(subclass.replace('spine_', ''));
|
||||
lines.push(`case "${cppClassName}":`);
|
||||
// Use C cast function to handle pointer adjustment
|
||||
const toType = subclass.replace('spine_', '');
|
||||
const castFunctionName = `${abstractClass.name}_cast_to_${toType}`;
|
||||
lines.push(` let castedPtr = ${castFunctionName}(${resultVar})`);
|
||||
lines.push(` return ${swiftSubclass}(fromPointer: castedPtr!)`);
|
||||
}
|
||||
|
||||
lines.push(`default:`);
|
||||
|
||||
@ -238,6 +238,71 @@ func runSkeletonDrawableTestSwift() {
|
||||
print(" Render command received successfully")
|
||||
}
|
||||
|
||||
// Test constraint RTTI (similar to Dart test)
|
||||
print("\nTesting constraint RTTI:")
|
||||
let constraints = drawable.skeleton.constraints
|
||||
print(" Total constraints: \(constraints.count)")
|
||||
for i in 0..<constraints.count {
|
||||
if let constraint = constraints[i] {
|
||||
let rttiClassName = constraint.rtti.rttiClassName ?? "unknown"
|
||||
print(" Constraint \(i) type: \(rttiClassName)")
|
||||
|
||||
let data = constraint.data
|
||||
let dataRttiClassName = data.rtti.rttiClassName ?? "unknown"
|
||||
print(" Data type: \(dataRttiClassName)")
|
||||
print(" Name: \(data.name)")
|
||||
}
|
||||
}
|
||||
|
||||
// Test calling PosedActive methods on Bone instance
|
||||
print("\nTesting PosedActive methods on Bone:")
|
||||
if let bone = drawable.skeleton.findBone("rear-shin") {
|
||||
print(" Found bone: \(bone.data.name)")
|
||||
|
||||
// Cast Bone to PosedActive and try to call PosedActive methods
|
||||
let posedActive = bone as PosedActive
|
||||
print(" Successfully cast Bone to PosedActive")
|
||||
|
||||
// Try to access PosedActive properties/methods
|
||||
// This should work if the pointer is correct, or crash if there's an offset issue
|
||||
|
||||
// Get the isActive property (this is a PosedActive method)
|
||||
let isActiveFromPosed = posedActive.isActive
|
||||
print(" isActive from PosedActive: \(isActiveFromPosed)")
|
||||
|
||||
// Set active property through PosedActive
|
||||
print(" Setting active to false through PosedActive...")
|
||||
posedActive.active = false
|
||||
print(" ✓ Set active property succeeded")
|
||||
|
||||
// Check if it's actually false
|
||||
let isStillActive = posedActive.isActive
|
||||
print(" isActive after setting to false: \(isStillActive)")
|
||||
|
||||
// Restore it
|
||||
posedActive.active = true
|
||||
print(" Restored active to true")
|
||||
|
||||
// Now test the Update protocol
|
||||
let updateProtocol = bone as Update
|
||||
print(" Successfully cast Bone to Update protocol")
|
||||
|
||||
// Call update with required parameters
|
||||
print(" Calling update() through Update protocol...")
|
||||
updateProtocol.update(drawable.skeleton, Physics.none)
|
||||
print(" ✓ update() call succeeded through Update protocol")
|
||||
|
||||
// Test that we can still use Bone methods after casting
|
||||
let appliedPose = bone.appliedPose
|
||||
print(" Bone appliedPose still accessible: x=\(appliedPose.x), y=\(appliedPose.y)")
|
||||
|
||||
// The fact that this all works suggests the pointer is being handled correctly
|
||||
// even though we're not using cast functions in the constructor chain
|
||||
print(" ✓ All PosedActive and Update methods work correctly on Bone instance")
|
||||
} else {
|
||||
print(" Could not find bone 'rear-shin'")
|
||||
}
|
||||
|
||||
// Clear listener before cleanup
|
||||
// drawable.animationState.setListener(nil)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user