mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 07:14:55 +08:00
[haxe] Port of commit cb48737 (partially - no copy constructor)
This commit is contained in:
parent
25acb4caf1
commit
511dd0c1da
@ -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 {
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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 {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user