mirror of
https://github.com/overte-org/overte.git
synced 2025-04-22 19:13:38 +02:00
Adding option to disable hand collisions against their own avatar.
This commit is contained in:
parent
f177a4fe23
commit
fa3c3448f4
3 changed files with 12 additions and 8 deletions
|
@ -352,6 +352,7 @@ Menu::Menu() :
|
|||
addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::DisplayHandTargets, 0, false);
|
||||
addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::VoxelDrumming, 0, false);
|
||||
addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::PlaySlaps, 0, false);
|
||||
addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::HandsCollideWithSelf, 0, false);
|
||||
|
||||
addDisabledActionAndSeparator(developerMenu, "Testing");
|
||||
|
||||
|
|
|
@ -188,6 +188,7 @@ namespace MenuOption {
|
|||
const QString ExportVoxels = "Export Voxels";
|
||||
const QString DontFadeOnVoxelServerChanges = "Don't Fade In/Out on Voxel Server Changes";
|
||||
const QString HeadMouse = "Head Mouse";
|
||||
const QString HandsCollideWithSelf = "Collide With Self";
|
||||
const QString FaceshiftTCP = "Faceshift (TCP)";
|
||||
const QString FalseColorByDistance = "FALSE Color By Distance";
|
||||
const QString FalseColorBySource = "FALSE Color By Source";
|
||||
|
|
|
@ -231,14 +231,16 @@ void Hand::updateCollisions() {
|
|||
}
|
||||
}
|
||||
|
||||
// and the current avatar (ignoring everything below the parent of the parent of the last free joint)
|
||||
glm::vec3 owningPenetration;
|
||||
const Model& skeletonModel = _owningAvatar->getSkeletonModel();
|
||||
int skipIndex = skeletonModel.getParentJointIndex(skeletonModel.getParentJointIndex(
|
||||
skeletonModel.getLastFreeJointIndex((i == leftPalmIndex) ? skeletonModel.getLeftHandJointIndex() :
|
||||
(i == rightPalmIndex) ? skeletonModel.getRightHandJointIndex() : -1)));
|
||||
if (_owningAvatar->findSpherePenetration(palm.getPosition(), scaledPalmRadius, owningPenetration, skipIndex)) {
|
||||
totalPenetration = addPenetrations(totalPenetration, owningPenetration);
|
||||
if (Menu::getInstance()->isOptionChecked(MenuOption::HandsCollideWithSelf)) {
|
||||
// and the current avatar (ignoring everything below the parent of the parent of the last free joint)
|
||||
glm::vec3 owningPenetration;
|
||||
const Model& skeletonModel = _owningAvatar->getSkeletonModel();
|
||||
int skipIndex = skeletonModel.getParentJointIndex(skeletonModel.getParentJointIndex(
|
||||
skeletonModel.getLastFreeJointIndex((i == leftPalmIndex) ? skeletonModel.getLeftHandJointIndex() :
|
||||
(i == rightPalmIndex) ? skeletonModel.getRightHandJointIndex() : -1)));
|
||||
if (_owningAvatar->findSpherePenetration(palm.getPosition(), scaledPalmRadius, owningPenetration, skipIndex)) {
|
||||
totalPenetration = addPenetrations(totalPenetration, owningPenetration);
|
||||
}
|
||||
}
|
||||
|
||||
// un-penetrate
|
||||
|
|
Loading…
Reference in a new issue