[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)
throw new SpineException("skeleton cannot be null.");
_data = data;
mix = data.mix;
softness = data.softness;
bendDirection = data.bendDirection;
compress = data.compress;
stretch = data.stretch;
bones = new Array<Bone>();
for (boneData in data.bones) {
bones.push(skeleton.findBone(boneData.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 {

View File

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

View File

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

View File

@ -51,17 +51,19 @@ class TransformConstraint implements Updatable {
if (skeleton == null)
throw new SpineException("skeleton cannot be null.");
_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;
mixX = data.mixX;
mixY = data.mixY;
mixScaleX = data.mixScaleX;
mixScaleY = data.mixScaleY;
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 {