Change the velocity filter to 5

This commit is contained in:
Zach Fox 2017-01-24 12:11:33 -08:00
parent 3a17a64c99
commit 0e16686fb8

View file

@ -13,18 +13,18 @@ function filter(p) {
/* Reject if modifications made to Model properties */
if (p.modelURL || p.compoundShapeURL || p.shape || p.shapeType || p.url || p.fps || p.currentFrame || p.running || p.loop || p.firstFrame || p.lastFrame || p.hold || p.textures || p.xTextureURL || p.yTextureURL || p.zTextureURL) { return false; }
/* Clamp velocity to 10 units/second. Zeroing each component of acceleration keeps us from slamming.*/
/* Clamp velocity to 5 units/second. Zeroing each component of acceleration keeps us from slamming.*/
if (p.velocity) {
if (p.velocity.x > 10) {
p.velocity.x = 10;
if (p.velocity.x > 5) {
p.velocity.x = 5;
p.acceleration.x = 0;
}
if (p.velocity.y > 10) {
p.velocity.y = 10;
if (p.velocity.y > 5) {
p.velocity.y = 5;
p.acceleration.y = 0;
}
if (p.velocity.z > 10) {
p.velocity.z = 10;
if (p.velocity.z > 5) {
p.velocity.z = 5;
p.acceleration.z = 0;
}
}