mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 14:24:22 +02:00
Merge pull request #792 from Atlante45/turn_off_collisions
Add option to turn collisions on and off
This commit is contained in:
commit
abf64f3e7f
4 changed files with 16 additions and 4 deletions
|
@ -1944,6 +1944,7 @@ void Application::initMenu() {
|
|||
(_fullScreenMode = optionsMenu->addAction("Fullscreen", this, SLOT(setFullscreen(bool)), Qt::Key_F))->setCheckable(true);
|
||||
optionsMenu->addAction("Webcam", &_webcam, SLOT(setEnabled(bool)))->setCheckable(true);
|
||||
optionsMenu->addAction("Toggle Skeleton Tracking", &_webcam, SLOT(setSkeletonTrackingOn(bool)))->setCheckable(true);
|
||||
(_wantCollisionsOn = optionsMenu->addAction("Turn collisions On", this, SLOT(toggleWantCollisionsOn())))->setCheckable(true);
|
||||
optionsMenu->addAction("Cycle Webcam Send Mode", _webcam.getGrabber(), SLOT(cycleVideoSendMode()));
|
||||
optionsMenu->addAction("Go Home", this, SLOT(goHome()), Qt::CTRL | Qt::Key_G);
|
||||
|
||||
|
@ -2137,6 +2138,10 @@ void Application::toggleMixedSong() {
|
|||
}
|
||||
}
|
||||
|
||||
void Application::toggleWantCollisionsOn() {
|
||||
_myAvatar.setWantCollisionsOn(_wantCollisionsOn->isChecked());
|
||||
}
|
||||
|
||||
void Application::resetSongMixMenuItem() {
|
||||
if (_audio.getSongFileBytes() == 0) {
|
||||
_rawAudioMicrophoneMix->setText("Mix RAW Song");
|
||||
|
|
|
@ -179,6 +179,7 @@ private slots:
|
|||
void setListenModePoint();
|
||||
void setListenModeSingleSource();
|
||||
void toggleMixedSong();
|
||||
void toggleWantCollisionsOn();
|
||||
|
||||
|
||||
void renderCoverageMap();
|
||||
|
@ -294,6 +295,7 @@ private:
|
|||
QAction* _rawAudioMicrophoneMix; // Mixing of a RAW audio file with microphone stream for rave gloves
|
||||
QAction* _noise;
|
||||
QAction* _occlusionCulling;
|
||||
QAction* _wantCollisionsOn;
|
||||
|
||||
QAction* _renderCoverageMapV2;
|
||||
QAction* _renderCoverageMap;
|
||||
|
|
|
@ -622,9 +622,12 @@ void Avatar::simulate(float deltaTime, Transmitter* transmitter) {
|
|||
_velocity += _scale * _gravity * (GRAVITY_EARTH * deltaTime);
|
||||
}
|
||||
}
|
||||
updateCollisionWithEnvironment(deltaTime);
|
||||
updateCollisionWithVoxels(deltaTime);
|
||||
updateAvatarCollisions(deltaTime);
|
||||
|
||||
if (_isCollisionsOn) {
|
||||
updateCollisionWithEnvironment(deltaTime);
|
||||
updateCollisionWithVoxels(deltaTime);
|
||||
updateAvatarCollisions(deltaTime);
|
||||
}
|
||||
}
|
||||
|
||||
// update body balls
|
||||
|
@ -632,7 +635,7 @@ void Avatar::simulate(float deltaTime, Transmitter* transmitter) {
|
|||
|
||||
|
||||
// test for avatar collision response with the big sphere
|
||||
if (usingBigSphereCollisionTest) {
|
||||
if (usingBigSphereCollisionTest && _isCollisionsOn) {
|
||||
updateCollisionWithSphere(_TEST_bigSpherePosition, _TEST_bigSphereRadius, deltaTime);
|
||||
}
|
||||
|
||||
|
|
|
@ -141,6 +141,7 @@ public:
|
|||
void setMouseRay (const glm::vec3 &origin, const glm::vec3 &direction);
|
||||
void setOrientation (const glm::quat& orientation);
|
||||
void setNewScale (const float scale);
|
||||
void setWantCollisionsOn (bool wantCollisionsOn ) { _isCollisionsOn = wantCollisionsOn; }
|
||||
|
||||
//getters
|
||||
bool isInitialized () const { return _initialized;}
|
||||
|
@ -262,6 +263,7 @@ private:
|
|||
glm::vec3 _lastCollisionPosition;
|
||||
bool _speedBrakes;
|
||||
bool _isThrustOn;
|
||||
bool _isCollisionsOn;
|
||||
|
||||
Avatar* _leadingAvatar;
|
||||
float _stringLength;
|
||||
|
|
Loading…
Reference in a new issue