mirror of
https://github.com/liabru/matter-js.git
synced 2025-02-07 19:06:26 -05:00
remove unused render shadow function
This commit is contained in:
parent
ec3eeccd18
commit
e49834d1e0
1 changed files with 0 additions and 50 deletions
|
@ -67,7 +67,6 @@ var Mouse = require('../core/Mouse');
|
||||||
showPositions: false,
|
showPositions: false,
|
||||||
showAngleIndicator: false,
|
showAngleIndicator: false,
|
||||||
showIds: false,
|
showIds: false,
|
||||||
showShadows: false,
|
|
||||||
showVertexNumbers: false,
|
showVertexNumbers: false,
|
||||||
showConvexHulls: false,
|
showConvexHulls: false,
|
||||||
showInternalEdges: false,
|
showInternalEdges: false,
|
||||||
|
@ -532,55 +531,6 @@ var Mouse = require('../core/Mouse');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Description
|
|
||||||
* @private
|
|
||||||
* @method bodyShadows
|
|
||||||
* @param {render} render
|
|
||||||
* @param {body[]} bodies
|
|
||||||
* @param {RenderingContext} context
|
|
||||||
*/
|
|
||||||
Render.bodyShadows = function(render, bodies, context) {
|
|
||||||
var c = context,
|
|
||||||
engine = render.engine;
|
|
||||||
|
|
||||||
for (var i = 0; i < bodies.length; i++) {
|
|
||||||
var body = bodies[i];
|
|
||||||
|
|
||||||
if (!body.render.visible)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (body.circleRadius) {
|
|
||||||
c.beginPath();
|
|
||||||
c.arc(body.position.x, body.position.y, body.circleRadius, 0, 2 * Math.PI);
|
|
||||||
c.closePath();
|
|
||||||
} else {
|
|
||||||
c.beginPath();
|
|
||||||
c.moveTo(body.vertices[0].x, body.vertices[0].y);
|
|
||||||
for (var j = 1; j < body.vertices.length; j++) {
|
|
||||||
c.lineTo(body.vertices[j].x, body.vertices[j].y);
|
|
||||||
}
|
|
||||||
c.closePath();
|
|
||||||
}
|
|
||||||
|
|
||||||
var distanceX = body.position.x - render.options.width * 0.5,
|
|
||||||
distanceY = body.position.y - render.options.height * 0.2,
|
|
||||||
distance = Math.abs(distanceX) + Math.abs(distanceY);
|
|
||||||
|
|
||||||
c.shadowColor = 'rgba(0,0,0,0.15)';
|
|
||||||
c.shadowOffsetX = 0.05 * distanceX;
|
|
||||||
c.shadowOffsetY = 0.05 * distanceY;
|
|
||||||
c.shadowBlur = 1 + 12 * Math.min(1, distance / 1000);
|
|
||||||
|
|
||||||
c.fill();
|
|
||||||
|
|
||||||
c.shadowColor = null;
|
|
||||||
c.shadowOffsetX = null;
|
|
||||||
c.shadowOffsetY = null;
|
|
||||||
c.shadowBlur = null;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Description
|
* Description
|
||||||
* @private
|
* @private
|
||||||
|
|
Loading…
Add table
Reference in a new issue