mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Disable ray picking against invisible objects in far grab and teleport
This commit is contained in:
parent
17c63eb722
commit
b0c7e91737
3 changed files with 7 additions and 7 deletions
|
@ -572,7 +572,7 @@ bool EntityTree::findRayIntersection(const glm::vec3& origin, const glm::vec3& d
|
|||
OctreeElementPointer& element, float& distance,
|
||||
BoxFace& face, glm::vec3& surfaceNormal, const QVector<EntityItemID>& entityIdsToInclude, const QVector<EntityItemID>& entityIdsToDiscard, bool visibleOnly, void** intersectedObject,
|
||||
Octree::lockType lockType, bool* accurateResult, bool precisionPicking) {
|
||||
RayArgs args = { origin, direction, element, distance, face, surfaceNormal, entityIdsToInclude, entityIdsToDiscard, intersectedObject, false, precisionPicking };
|
||||
RayArgs args = { origin, direction, element, distance, face, surfaceNormal, entityIdsToInclude, entityIdsToDiscard, visibleOnly, intersectedObject, false, precisionPicking };
|
||||
distance = FLT_MAX;
|
||||
|
||||
bool requireLock = lockType == Octree::Lock;
|
||||
|
|
|
@ -344,7 +344,7 @@ function entityHasActions(entityID) {
|
|||
}
|
||||
|
||||
function findRayIntersection(pickRay, precise, include, exclude) {
|
||||
var entities = Entities.findRayIntersection(pickRay, precise, include, exclude);
|
||||
var entities = Entities.findRayIntersection(pickRay, precise, include, exclude, true);
|
||||
var overlays = Overlays.findRayIntersection(pickRay);
|
||||
if (!overlays.intersects || (entities.intersects && (entities.distance <= overlays.distance))) {
|
||||
return entities;
|
||||
|
@ -1155,9 +1155,9 @@ function MyController(hand) {
|
|||
|
||||
var intersection;
|
||||
if (USE_BLACKLIST === true && blacklist.length !== 0) {
|
||||
intersection = findRayIntersection(pickRay, true, [], blacklist);
|
||||
intersection = findRayIntersection(pickRay, true, [], blacklist, true);
|
||||
} else {
|
||||
intersection = findRayIntersection(pickRay, true);
|
||||
intersection = findRayIntersection(pickRay, true, [], [], true);
|
||||
}
|
||||
|
||||
if (intersection.intersects) {
|
||||
|
@ -2211,7 +2211,7 @@ function MyController(hand) {
|
|||
|
||||
var now = Date.now();
|
||||
if (now - this.lastPickTime > MSECS_PER_SEC / PICKS_PER_SECOND_PER_HAND) {
|
||||
var intersection = findRayIntersection(pickRay, true);
|
||||
var intersection = findRayIntersection(pickRay, true, [], [], true);
|
||||
if (intersection.accurate || intersection.overlayID) {
|
||||
this.lastPickTime = now;
|
||||
if (intersection.entityID != this.grabbedEntity) {
|
||||
|
|
|
@ -279,7 +279,7 @@ function Teleporter() {
|
|||
var location = Vec3.sum(rightPickRay.origin, Vec3.multiply(rightPickRay.direction, 50));
|
||||
|
||||
|
||||
var rightIntersection = Entities.findRayIntersection(teleporter.rightPickRay, true, [], [this.targetEntity]);
|
||||
var rightIntersection = Entities.findRayIntersection(teleporter.rightPickRay, true, [], [this.targetEntity], true);
|
||||
|
||||
if (rightIntersection.intersects) {
|
||||
if (this.tooClose === true) {
|
||||
|
@ -342,7 +342,7 @@ function Teleporter() {
|
|||
var location = Vec3.sum(MyAvatar.position, Vec3.multiply(leftPickRay.direction, 50));
|
||||
|
||||
|
||||
var leftIntersection = Entities.findRayIntersection(teleporter.leftPickRay, true, [], [this.targetEntity]);
|
||||
var leftIntersection = Entities.findRayIntersection(teleporter.leftPickRay, true, [], [this.targetEntity], true);
|
||||
|
||||
if (leftIntersection.intersects) {
|
||||
|
||||
|
|
Loading…
Reference in a new issue