From 1c8d4f7717adaf4c39f0e74babb9239a2334f908 Mon Sep 17 00:00:00 2001 From: Geenz Date: Fri, 7 Jun 2013 16:20:51 -0400 Subject: [PATCH] Get the average velocity of the avatar. --- interface/src/Application.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index d8a9d8f7a0..95b2d3824e 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -820,12 +820,13 @@ void Application::idle() { // tell my avatar the posiion and direction of the ray projected ino the world based on the mouse position _myAvatar.setMouseRay(mouseRayOrigin, mouseRayDirection); - + _mouseVoxel.s = 0.0f; if (checkedVoxelModeAction() != 0 && - _myAvatar.getVelocity().x < MAX_AVATAR_EDIT_VELOCITY && - _myAvatar.getVelocity().y < MAX_AVATAR_EDIT_VELOCITY && - _myAvatar.getVelocity().z < MAX_AVATAR_EDIT_VELOCITY) { + (fabs(_myAvatar.getVelocity().x) + + fabs(_myAvatar.getVelocity().y) + + fabs(_myAvatar.getVelocity().z)) / 3 < MAX_AVATAR_EDIT_VELOCITY) { + float distance; BoxFace face; if (_voxels.findRayIntersection(mouseRayOrigin, mouseRayDirection, _mouseVoxel, distance, face)) {