[haxe] Port of commit cb48737 (partially - no copy constructor)

This commit is contained in:
Davide Tantillo 2024-04-30 09:34:50 +02:00
parent 25acb4caf1
commit 511dd0c1da
4 changed files with 17 additions and 10 deletions

View File

@ -47,17 +47,18 @@ class IkConstraint implements Updatable {
if (skeleton == null) if (skeleton == null)
throw new SpineException("skeleton cannot be null."); throw new SpineException("skeleton cannot be null.");
_data = data; _data = data;
mix = data.mix;
softness = data.softness;
bendDirection = data.bendDirection;
compress = data.compress;
stretch = data.stretch;
bones = new Array<Bone>(); bones = new Array<Bone>();
for (boneData in data.bones) { for (boneData in data.bones) {
bones.push(skeleton.findBone(boneData.name)); bones.push(skeleton.findBone(boneData.name));
} }
target = skeleton.findBone(data.target.name); target = skeleton.findBone(data.target.name);
mix = data.mix;
softness = data.softness;
bendDirection = data.bendDirection;
compress = data.compress;
stretch = data.stretch;
} }
public function isActive():Bool { public function isActive():Bool {

View File

@ -62,11 +62,13 @@ class PathConstraint implements Updatable {
if (skeleton == null) if (skeleton == null)
throw new SpineException("skeleton cannot be null."); throw new SpineException("skeleton cannot be null.");
_data = data; _data = data;
_bones = new Array<Bone>(); _bones = new Array<Bone>();
for (boneData in data.bones) { for (boneData in data.bones) {
_bones.push(skeleton.findBone(boneData.name)); _bones.push(skeleton.findBone(boneData.name));
} }
target = skeleton.findSlot(data.target.name); target = skeleton.findSlot(data.target.name);
position = data.position; position = data.position;
spacing = data.spacing; spacing = data.spacing;
mixRotate = data.mixRotate; mixRotate = data.mixRotate;

View File

@ -67,7 +67,9 @@ class PhysicsConstraint implements Updatable {
public function new(data: PhysicsConstraintData, skeleton: Skeleton) { public function new(data: PhysicsConstraintData, skeleton: Skeleton) {
_data = data; _data = data;
_skeleton = skeleton; _skeleton = skeleton;
_bone = skeleton.bones[data.bone.index]; _bone = skeleton.bones[data.bone.index];
inertia = data.inertia; inertia = data.inertia;
strength = data.strength; strength = data.strength;
damping = data.damping; damping = data.damping;

View File

@ -51,17 +51,19 @@ class TransformConstraint implements Updatable {
if (skeleton == null) if (skeleton == null)
throw new SpineException("skeleton cannot be null."); throw new SpineException("skeleton cannot be null.");
_data = data; _data = data;
_bones = new Array<Bone>();
for (boneData in data.bones) {
_bones.push(skeleton.findBone(boneData.name));
}
target = skeleton.findBone(data.target.name);
mixRotate = data.mixRotate; mixRotate = data.mixRotate;
mixX = data.mixX; mixX = data.mixX;
mixY = data.mixY; mixY = data.mixY;
mixScaleX = data.mixScaleX; mixScaleX = data.mixScaleX;
mixScaleY = data.mixScaleY; mixScaleY = data.mixScaleY;
mixShearY = data.mixShearY; mixShearY = data.mixShearY;
_bones = new Array<Bone>();
for (boneData in data.bones) {
_bones.push(skeleton.findBone(boneData.name));
}
target = skeleton.findBone(data.target.name);
} }
public function isActive():Bool { public function isActive():Bool {