mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 14:47:51 +02:00
Real max velocity stuff.
This commit is contained in:
parent
c79bd71fe7
commit
82db388552
1 changed files with 6 additions and 5 deletions
|
@ -695,7 +695,6 @@ void Application::mouseMoveEvent(QMouseEvent* event) {
|
||||||
_mouseY = event->y();
|
_mouseY = event->y();
|
||||||
|
|
||||||
// detect drag
|
// detect drag
|
||||||
printLog("Avatar velocity x, y, z: %f, %f, %f\n", _myAvatar.getVelocity().x, _myAvatar.getVelocity().y, _myAvatar.getVelocity().z);
|
|
||||||
glm::vec3 mouseVoxelPos(_mouseVoxel.x, _mouseVoxel.y, _mouseVoxel.z);
|
glm::vec3 mouseVoxelPos(_mouseVoxel.x, _mouseVoxel.y, _mouseVoxel.z);
|
||||||
if (!_justEditedVoxel && mouseVoxelPos != _lastMouseVoxelPos) {
|
if (!_justEditedVoxel && mouseVoxelPos != _lastMouseVoxelPos) {
|
||||||
if (event->buttons().testFlag(Qt::LeftButton)) {
|
if (event->buttons().testFlag(Qt::LeftButton)) {
|
||||||
|
@ -786,6 +785,8 @@ static glm::vec3 getFaceVector(BoxFace face) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const float MAX_AVATAR_EDIT_VELOCITY = 1.0f;
|
||||||
|
|
||||||
void Application::idle() {
|
void Application::idle() {
|
||||||
timeval check;
|
timeval check;
|
||||||
gettimeofday(&check, NULL);
|
gettimeofday(&check, NULL);
|
||||||
|
@ -821,7 +822,10 @@ void Application::idle() {
|
||||||
_myAvatar.setMouseRay(mouseRayOrigin, mouseRayDirection);
|
_myAvatar.setMouseRay(mouseRayOrigin, mouseRayDirection);
|
||||||
|
|
||||||
_mouseVoxel.s = 0.0f;
|
_mouseVoxel.s = 0.0f;
|
||||||
if (checkedVoxelModeAction() != 0) {
|
if (checkedVoxelModeAction() != 0 &&
|
||||||
|
_myAvatar.getVelocity().x < MAX_AVATAR_EDIT_VELOCITY &&
|
||||||
|
_myAvatar.getVelocity().y < MAX_AVATAR_EDIT_VELOCITY &&
|
||||||
|
_myAvatar.getVelocity().z < MAX_AVATAR_EDIT_VELOCITY) {
|
||||||
float distance;
|
float distance;
|
||||||
BoxFace face;
|
BoxFace face;
|
||||||
if (_voxels.findRayIntersection(mouseRayOrigin, mouseRayDirection, _mouseVoxel, distance, face)) {
|
if (_voxels.findRayIntersection(mouseRayOrigin, mouseRayDirection, _mouseVoxel, distance, face)) {
|
||||||
|
@ -2276,9 +2280,6 @@ void Application::shiftPaintingColor() {
|
||||||
|
|
||||||
|
|
||||||
void Application::maybeEditVoxelUnderCursor() {
|
void Application::maybeEditVoxelUnderCursor() {
|
||||||
if (_myAvatar.getVelocity().x > 0.5) {
|
|
||||||
printLog("We're going faster than 1 m/s!\n");
|
|
||||||
}
|
|
||||||
if (_addVoxelMode->isChecked() || _colorVoxelMode->isChecked()) {
|
if (_addVoxelMode->isChecked() || _colorVoxelMode->isChecked()) {
|
||||||
if (_mouseVoxel.s != 0) {
|
if (_mouseVoxel.s != 0) {
|
||||||
PACKET_HEADER message = (_destructiveAddVoxel->isChecked() ?
|
PACKET_HEADER message = (_destructiveAddVoxel->isChecked() ?
|
||||||
|
|
Loading…
Reference in a new issue