This commit is contained in:
badlogic 2016-09-05 11:36:27 +02:00
commit ec7510b0b5
5 changed files with 16 additions and 16 deletions

View File

@ -88,7 +88,7 @@ var ikConstraintDemo = function(loadingComplete, bgColor) {
for (var i = 0; i < controlBones.length; i++) {
var bone = skeleton.findBone(controlBones[i]);
renderer.camera.screenToWorld(coords.set(x, y, 0), canvas.width, canvas.height);
if (temp.set(skeleton.x + bone.worldX, skeleton.y + bone.worldY, 0).distance(coords) < 20) {
if (temp.set(skeleton.x + bone.worldX, skeleton.y + bone.worldY, 0).distance(coords) < 30) {
target = bone;
}
}
@ -113,7 +113,7 @@ var ikConstraintDemo = function(loadingComplete, bgColor) {
for (var i = 0; i < controlBones.length; i++) {
var bone = skeleton.findBone(controlBones[i]);
renderer.camera.screenToWorld(coords.set(x, y, 0), canvas.width, canvas.height);
if (temp.set(skeleton.x + bone.worldX, skeleton.y + bone.worldY, 0).distance(coords) < 20) {
if (temp.set(skeleton.x + bone.worldX, skeleton.y + bone.worldY, 0).distance(coords) < 30) {
hoverTargets[i] = bone;
} else {
hoverTargets[i] = null;

View File

@ -114,7 +114,7 @@ var pathConstraintDemo = function(loadingComplete, bgColor) {
for (var i = 0; i < controlBones.length; i++) {
var bone = skeleton.findBone(controlBones[i]);
renderer.camera.screenToWorld(coords.set(x, y, 0), canvas.width, canvas.height);
if (temp.set(skeleton.x + bone.worldX, skeleton.y + bone.worldY, 0).distance(coords) < 20) {
if (temp.set(skeleton.x + bone.worldX, skeleton.y + bone.worldY, 0).distance(coords) < 30) {
target = bone;
}
}
@ -139,7 +139,7 @@ var pathConstraintDemo = function(loadingComplete, bgColor) {
for (var i = 0; i < controlBones.length; i++) {
var bone = skeleton.findBone(controlBones[i]);
renderer.camera.screenToWorld(coords.set(x, y, 0), canvas.width, canvas.height);
if (temp.set(skeleton.x + bone.worldX, skeleton.y + bone.worldY, 0).distance(coords) < 20) {
if (temp.set(skeleton.x + bone.worldX, skeleton.y + bone.worldY, 0).distance(coords) < 30) {
hoverTargets[i] = bone;
} else {
hoverTargets[i] = null;

View File

@ -94,7 +94,7 @@ var stretchyDemo = function(loadingComplete, bgColor) {
for (var i = 0; i < controlBones.length; i++) {
var bone = skeleton.findBone(controlBones[i]);
renderer.camera.screenToWorld(coords.set(x, y, 0), canvas.width, canvas.height);
if (temp.set(skeleton.x + bone.worldX, skeleton.y + bone.worldY, 0).distance(coords) < 20) {
if (temp.set(skeleton.x + bone.worldX, skeleton.y + bone.worldY, 0).distance(coords) < 30) {
target = bone;
}
}
@ -124,7 +124,7 @@ var stretchyDemo = function(loadingComplete, bgColor) {
for (var i = 0; i < controlBones.length; i++) {
var bone = skeleton.findBone(controlBones[i]);
renderer.camera.screenToWorld(coords.set(x, y, 0), canvas.width, canvas.height);
if (temp.set(skeleton.x + bone.worldX, skeleton.y + bone.worldY, 0).distance(coords) < 20) {
if (temp.set(skeleton.x + bone.worldX, skeleton.y + bone.worldY, 0).distance(coords) < 30) {
hoverTargets[i] = bone;
} else {
hoverTargets[i] = null;

View File

@ -112,7 +112,7 @@ var transformConstraintDemo = function(loadingComplete, bgColor) {
renderer.camera.screenToWorld(coords.set(x, y, 0), canvas.width, canvas.height);
for (var i = 0; i < controlBones.length; i++) {
var bone = skeleton.findBone(controlBones[i]);
if (temp.set(skeleton.x + bone.worldX, skeleton.y + bone.worldY, 0).distance(coords) < 20) {
if (temp.set(skeleton.x + bone.worldX, skeleton.y + bone.worldY, 0).distance(coords) < 30) {
target = bone;
if (target === rotateHandle) lastRotation = getRotation(x, y);
}
@ -145,7 +145,7 @@ var transformConstraintDemo = function(loadingComplete, bgColor) {
renderer.camera.screenToWorld(coords.set(x, y, 0), canvas.width, canvas.height);
for (var i = 0; i < controlBones.length; i++) {
var bone = skeleton.findBone(controlBones[i]);
if (temp.set(skeleton.x + bone.worldX, skeleton.y + bone.worldY, 0).distance(coords) < 20) {
if (temp.set(skeleton.x + bone.worldX, skeleton.y + bone.worldY, 0).distance(coords) < 30) {
hoverTargets[i] = bone;
} else {
hoverTargets[i] = null;

View File

@ -81,11 +81,11 @@ var transitionsDemo = function(loadingComplete, bgColor) {
state.addAnimation(0, "idle", true, 0.8);
state.addAnimation(0, "run", true, 0.7);
state.addAnimation(0, "idle", true, 0.8);
state.addAnimation(0, "walk", true, 0.7);
state.addAnimation(0, "run", true, 0.7);
state.addAnimation(0, "jump", false, 0.7);
state.addAnimation(0, "walk", true, 0.6);
state.addAnimation(0, "run", true, 0.6);
state.addAnimation(0, "jump", false, 0.6);
state.addAnimation(0, "run", true, mix);
state.addAnimation(0, "jump", true, 0.7);
state.addAnimation(0, "jump", true, 0.5);
state.addAnimation(0, "run", true, mix).listener = {
event: function (trackIndex, event) {},
complete: function (trackIndex, loopCount) {},