mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 22:34:53 +08:00
[haxe] 4.3 porting WIP.
This commit is contained in:
parent
1ec1d23b7f
commit
09bf8a52cf
@ -69,8 +69,7 @@ class VineExample extends Scene {
|
||||
public function onTouch(e:TouchEvent) {
|
||||
var touch = e.getTouch(this);
|
||||
if (touch != null && touch.phase == TouchPhase.ENDED) {
|
||||
SceneManager.getInstance().switchScene(new CelestialCircusExample());
|
||||
// SceneManager.getInstance().switchScene(new SackExample());
|
||||
SceneManager.getInstance().switchScene(new SackExample());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -59,8 +59,8 @@ class PhysicsConstraint extends Constraint<PhysicsConstraint, PhysicsConstraintD
|
||||
public var scaleOffset = 0.;
|
||||
public var scaleLag = 0.;
|
||||
public var scaleVelocity = 0.;
|
||||
public var remaining:Float = 0;
|
||||
public var lastTime:Float = 0;
|
||||
public var remaining = 0.;
|
||||
public var lastTime = 0.;
|
||||
|
||||
public function new(data: PhysicsConstraintData, skeleton: Skeleton) {
|
||||
super(data, new PhysicsConstraintPose(), new PhysicsConstraintPose());
|
||||
@ -105,8 +105,8 @@ class PhysicsConstraint extends Constraint<PhysicsConstraint, PhysicsConstraintD
|
||||
/** Rotates the physics constraint so next update(Physics) forces are applied as if the bone rotated around the
|
||||
* specified point in world space. */
|
||||
public function rotate (x:Float, y:Float, degrees:Float):Void {
|
||||
var r:Float = degrees * MathUtils.degRad, cos:Float = Math.cos(r), sin:Float = Math.sin(r);
|
||||
var dx:Float = cx - x, dy:Float = cy - y;
|
||||
var r = degrees * MathUtils.degRad, cos = Math.cos(r), sin = Math.sin(r);
|
||||
var dx = cx - x, dy = cy - y;
|
||||
translate(dx * cos - dy * sin - dx, dx * sin + dy * cos - dy);
|
||||
}
|
||||
|
||||
|
||||
@ -111,7 +111,7 @@ class SkeletonJson {
|
||||
skeletonData.y = getFloat(skeletonMap, "y");
|
||||
skeletonData.width = getFloat(skeletonMap, "width");
|
||||
skeletonData.height = getFloat(skeletonMap, "height");
|
||||
skeletonData.referenceScale = getFloat(skeletonMap, "referenceScale", 100);
|
||||
skeletonData.referenceScale = getFloat(skeletonMap, "referenceScale", 100) * scale;
|
||||
skeletonData.fps = getFloat(skeletonMap, "fps");
|
||||
skeletonData.imagesPath = getString(skeletonMap, "images", "");
|
||||
skeletonData.audioPath = getString(skeletonMap, "audio", "");
|
||||
|
||||
@ -36,11 +36,11 @@ class PhysicsConstraintMassTimeline extends PhysicsConstraintTimeline {
|
||||
}
|
||||
|
||||
public function get (pose: PhysicsConstraintPose):Float {
|
||||
return pose.massInverse;
|
||||
return 1 / pose.massInverse;
|
||||
}
|
||||
|
||||
public function set (pose: PhysicsConstraintPose, value:Float):Void {
|
||||
pose.massInverse = value;
|
||||
pose.massInverse = 1 / value;
|
||||
}
|
||||
|
||||
public function global (constraint: PhysicsConstraintData):Bool {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user