mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-22 10:16:01 +08:00
[ts] Fix field initializers of PhysicsConstraintData
This commit is contained in:
parent
53adcbe076
commit
dfc05e075e
@ -46,8 +46,8 @@ export class PhysicsConstraintData extends ConstraintData {
|
|||||||
x = 0;
|
x = 0;
|
||||||
y = 0;
|
y = 0;
|
||||||
rotate = 0;
|
rotate = 0;
|
||||||
scaleX = 1;
|
scaleX = 0;
|
||||||
shearX = 1;
|
shearX = 0;
|
||||||
step = 0;
|
step = 0;
|
||||||
inertia = 0;
|
inertia = 0;
|
||||||
strength = 0;
|
strength = 0;
|
||||||
|
|||||||
@ -36,7 +36,7 @@
|
|||||||
var skeletonBinary = new spine.SkeletonBinary(atlasLoader);
|
var skeletonBinary = new spine.SkeletonBinary(atlasLoader);
|
||||||
|
|
||||||
// Set the scale to apply during parsing, parse the file, and create a new skeleton.
|
// Set the scale to apply during parsing, parse the file, and create a new skeleton.
|
||||||
skeletonBinary.scale = 1;
|
skeletonBinary.scale = 0.2;
|
||||||
var skeletonData = skeletonBinary.readSkeletonData(assetManager.require("assets/sack-pro.skel"));
|
var skeletonData = skeletonBinary.readSkeletonData(assetManager.require("assets/sack-pro.skel"));
|
||||||
this.skeleton = new spine.Skeleton(skeletonData);
|
this.skeleton = new spine.Skeleton(skeletonData);
|
||||||
|
|
||||||
@ -51,9 +51,9 @@
|
|||||||
this.animationState.update(delta);
|
this.animationState.update(delta);
|
||||||
// Apply the animation state to the skeleton.
|
// Apply the animation state to the skeleton.
|
||||||
this.animationState.apply(this.skeleton);
|
this.animationState.apply(this.skeleton);
|
||||||
// Let the skeleton update the transforms of its bones.
|
// Let the skeleton update the transforms of its bones and apply physics
|
||||||
this.skeleton.updateWorldTransform(spine.Physics.update);
|
|
||||||
this.skeleton.update(delta);
|
this.skeleton.update(delta);
|
||||||
|
this.skeleton.updateWorldTransform(spine.Physics.update);
|
||||||
}
|
}
|
||||||
|
|
||||||
render(canvas) {
|
render(canvas) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user