limit ear range

This commit is contained in:
Jeffrey Sun 2016-12-15 14:23:00 -08:00
parent 4448a59dd0
commit 52637bf2e3

View file

@ -11,7 +11,7 @@ var Fox = function (IMG_WIDTH, IMG_HEIGHT) {
var headHeight = IMG_HEIGHT / 2;
var ears = (function () {
var offsetX = chance.floating({min: 0, max: headWidth/2});
var offsetX = chance.floating({min: 0.1 * headWidth, max: 0.4 * headWidth});
var angle = chance.floating({min: 0, max: Math.PI / 6});
// TODO: size, angle?
return {
@ -20,14 +20,14 @@ var Fox = function (IMG_WIDTH, IMG_HEIGHT) {
y: origin.y + (0.15 * headHeight),
angle: angle,
width: 0.4 * headWidth,
height: 0.6 * headHeight
height: 0.6 * headHeight
},
right: {
x: origin.x + (headWidth/2) + offsetX,
y: origin.y + (0.15 * headHeight),
angle: -angle,
width: 0.4 * headWidth,
height: 0.6 * headHeight
height: 0.6 * headHeight
}
};
}());