mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 02:36:54 +02:00
update scripts to use ignoreItems, fix caching bug
This commit is contained in:
parent
671eb09bf3
commit
429905de51
11 changed files with 76 additions and 46 deletions
|
@ -58,8 +58,8 @@ void LaserPointer::enable() {
|
||||||
|
|
||||||
void LaserPointer::disable() {
|
void LaserPointer::disable() {
|
||||||
qApp->getRayPickManager().disableRayPick(_rayPickUID);
|
qApp->getRayPickManager().disableRayPick(_rayPickUID);
|
||||||
_renderingEnabled = false;
|
|
||||||
withWriteLock([&] {
|
withWriteLock([&] {
|
||||||
|
_renderingEnabled = false;
|
||||||
if (!_currentRenderState.empty()) {
|
if (!_currentRenderState.empty()) {
|
||||||
if (_renderStates.find(_currentRenderState) != _renderStates.end()) {
|
if (_renderStates.find(_currentRenderState) != _renderStates.end()) {
|
||||||
disableRenderState(_renderStates[_currentRenderState]);
|
disableRenderState(_renderStates[_currentRenderState]);
|
||||||
|
@ -219,11 +219,15 @@ void LaserPointer::setPrecisionPicking(const bool precisionPicking) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaserPointer::setLaserLength(const float laserLength) {
|
void LaserPointer::setLaserLength(const float laserLength) {
|
||||||
_laserLength = laserLength;
|
withWriteLock([&] {
|
||||||
|
_laserLength = laserLength;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaserPointer::setLockEndUUID(QUuid objectID, const bool isOverlay) {
|
void LaserPointer::setLockEndUUID(QUuid objectID, const bool isOverlay) {
|
||||||
_objectLockEnd = std::pair<QUuid, bool>(objectID, isOverlay);
|
withWriteLock([&] {
|
||||||
|
_objectLockEnd = std::pair<QUuid, bool>(objectID, isOverlay);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void LaserPointer::setIgnoreItems(const QVector<QUuid>& ignoreItems) const {
|
void LaserPointer::setIgnoreItems(const QVector<QUuid>& ignoreItems) const {
|
||||||
|
|
|
@ -22,24 +22,24 @@
|
||||||
#include "JointRayPick.h"
|
#include "JointRayPick.h"
|
||||||
#include "MouseRayPick.h"
|
#include "MouseRayPick.h"
|
||||||
|
|
||||||
bool RayPickManager::checkAndCompareCachedResults(QPair<glm::vec3, glm::vec3>& ray, RayPickCache& cache, RayPickResult& res, const RayPickFilter::Flags& mask) {
|
bool RayPickManager::checkAndCompareCachedResults(QPair<glm::vec3, glm::vec3>& ray, RayPickCache& cache, RayPickResult& res, const RayCacheKey& key) {
|
||||||
if (cache.contains(ray) && cache[ray].find(mask) != cache[ray].end()) {
|
if (cache.contains(ray) && cache[ray].find(key) != cache[ray].end()) {
|
||||||
if (cache[ray][mask].distance < res.distance) {
|
if (cache[ray][key].distance < res.distance) {
|
||||||
res = cache[ray][mask];
|
res = cache[ray][key];
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RayPickManager::cacheResult(const bool intersects, const RayPickResult& resTemp, const RayPickFilter::Flags& mask, RayPickResult& res, QPair<glm::vec3, glm::vec3>& ray, RayPickCache& cache) {
|
void RayPickManager::cacheResult(const bool intersects, const RayPickResult& resTemp, const RayCacheKey& key, RayPickResult& res, QPair<glm::vec3, glm::vec3>& ray, RayPickCache& cache) {
|
||||||
if (intersects) {
|
if (intersects) {
|
||||||
cache[ray][mask] = resTemp;
|
cache[ray][key] = resTemp;
|
||||||
if (resTemp.distance < res.distance) {
|
if (resTemp.distance < res.distance) {
|
||||||
res = resTemp;
|
res = resTemp;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
cache[ray][mask] = RayPickResult(res.searchRay);
|
cache[ray][key] = RayPickResult(res.searchRay);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,8 +74,8 @@ void RayPickManager::update() {
|
||||||
bool fromCache = true;
|
bool fromCache = true;
|
||||||
bool invisible = rayPick->getFilter().doesPickInvisible();
|
bool invisible = rayPick->getFilter().doesPickInvisible();
|
||||||
bool nonCollidable = rayPick->getFilter().doesPickNonCollidable();
|
bool nonCollidable = rayPick->getFilter().doesPickNonCollidable();
|
||||||
RayPickFilter::Flags entityMask = rayPick->getFilter().getEntityFlags();
|
RayCacheKey entityKey = { rayPick->getFilter().getEntityFlags(), rayPick->getIncludeItems(), rayPick->getIgnoreItems() };
|
||||||
if (!checkAndCompareCachedResults(rayKey, results, res, entityMask)) {
|
if (!checkAndCompareCachedResults(rayKey, results, res, entityKey)) {
|
||||||
entityRes = DependencyManager::get<EntityScriptingInterface>()->findRayIntersectionVector(ray, !rayPick->getFilter().doesPickCoarse(),
|
entityRes = DependencyManager::get<EntityScriptingInterface>()->findRayIntersectionVector(ray, !rayPick->getFilter().doesPickCoarse(),
|
||||||
rayPick->getIncludeItemsAs<EntityItemID>(), rayPick->getIgnoreItemsAs<EntityItemID>(), !invisible, !nonCollidable);
|
rayPick->getIncludeItemsAs<EntityItemID>(), rayPick->getIgnoreItemsAs<EntityItemID>(), !invisible, !nonCollidable);
|
||||||
fromCache = false;
|
fromCache = false;
|
||||||
|
@ -83,7 +83,7 @@ void RayPickManager::update() {
|
||||||
|
|
||||||
if (!fromCache) {
|
if (!fromCache) {
|
||||||
cacheResult(entityRes.intersects, RayPickResult(IntersectionType::ENTITY, entityRes.entityID, entityRes.distance, entityRes.intersection, ray, entityRes.surfaceNormal),
|
cacheResult(entityRes.intersects, RayPickResult(IntersectionType::ENTITY, entityRes.entityID, entityRes.distance, entityRes.intersection, ray, entityRes.surfaceNormal),
|
||||||
entityMask, res, rayKey, results);
|
entityKey, res, rayKey, results);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,8 +92,8 @@ void RayPickManager::update() {
|
||||||
bool fromCache = true;
|
bool fromCache = true;
|
||||||
bool invisible = rayPick->getFilter().doesPickInvisible();
|
bool invisible = rayPick->getFilter().doesPickInvisible();
|
||||||
bool nonCollidable = rayPick->getFilter().doesPickNonCollidable();
|
bool nonCollidable = rayPick->getFilter().doesPickNonCollidable();
|
||||||
RayPickFilter::Flags overlayMask = rayPick->getFilter().getOverlayFlags();
|
RayCacheKey overlayKey = { rayPick->getFilter().getOverlayFlags(), rayPick->getIncludeItems(), rayPick->getIgnoreItems() };
|
||||||
if (!checkAndCompareCachedResults(rayKey, results, res, overlayMask)) {
|
if (!checkAndCompareCachedResults(rayKey, results, res, overlayKey)) {
|
||||||
overlayRes = qApp->getOverlays().findRayIntersectionVector(ray, !rayPick->getFilter().doesPickCoarse(),
|
overlayRes = qApp->getOverlays().findRayIntersectionVector(ray, !rayPick->getFilter().doesPickCoarse(),
|
||||||
rayPick->getIncludeItemsAs<OverlayID>(), rayPick->getIgnoreItemsAs<OverlayID>(), !invisible, !nonCollidable);
|
rayPick->getIncludeItemsAs<OverlayID>(), rayPick->getIgnoreItemsAs<OverlayID>(), !invisible, !nonCollidable);
|
||||||
fromCache = false;
|
fromCache = false;
|
||||||
|
@ -101,25 +101,26 @@ void RayPickManager::update() {
|
||||||
|
|
||||||
if (!fromCache) {
|
if (!fromCache) {
|
||||||
cacheResult(overlayRes.intersects, RayPickResult(IntersectionType::OVERLAY, overlayRes.overlayID, overlayRes.distance, overlayRes.intersection, ray, overlayRes.surfaceNormal),
|
cacheResult(overlayRes.intersects, RayPickResult(IntersectionType::OVERLAY, overlayRes.overlayID, overlayRes.distance, overlayRes.intersection, ray, overlayRes.surfaceNormal),
|
||||||
overlayMask, res, rayKey, results);
|
overlayKey, res, rayKey, results);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rayPick->getFilter().doesPickAvatars()) {
|
if (rayPick->getFilter().doesPickAvatars()) {
|
||||||
RayPickFilter::Flags avatarMask = rayPick->getFilter().getAvatarFlags();
|
RayCacheKey avatarKey = { rayPick->getFilter().getAvatarFlags(), rayPick->getIncludeItems(), rayPick->getIgnoreItems() };
|
||||||
if (!checkAndCompareCachedResults(rayKey, results, res, avatarMask)) {
|
if (!checkAndCompareCachedResults(rayKey, results, res, avatarKey)) {
|
||||||
RayToAvatarIntersectionResult avatarRes = DependencyManager::get<AvatarManager>()->findRayIntersectionVector(ray,
|
RayToAvatarIntersectionResult avatarRes = DependencyManager::get<AvatarManager>()->findRayIntersectionVector(ray,
|
||||||
rayPick->getIncludeItemsAs<EntityItemID>(), rayPick->getIgnoreItemsAs<EntityItemID>());
|
rayPick->getIncludeItemsAs<EntityItemID>(), rayPick->getIgnoreItemsAs<EntityItemID>());
|
||||||
cacheResult(avatarRes.intersects, RayPickResult(IntersectionType::AVATAR, avatarRes.avatarID, avatarRes.distance, avatarRes.intersection, ray), avatarMask, res, rayKey, results);
|
cacheResult(avatarRes.intersects, RayPickResult(IntersectionType::AVATAR, avatarRes.avatarID, avatarRes.distance, avatarRes.intersection, ray), avatarKey, res, rayKey, results);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Can't intersect with HUD in desktop mode
|
// Can't intersect with HUD in desktop mode
|
||||||
if (rayPick->getFilter().doesPickHUD() && DependencyManager::get<HMDScriptingInterface>()->isHMDMode()) {
|
if (rayPick->getFilter().doesPickHUD() && DependencyManager::get<HMDScriptingInterface>()->isHMDMode()) {
|
||||||
RayPickFilter::Flags hudMask = rayPick->getFilter().getHUDFlags();
|
RayPickFilter::Flags hudMask = rayPick->getFilter().getHUDFlags();
|
||||||
if (!checkAndCompareCachedResults(rayKey, results, res, hudMask)) {
|
RayCacheKey hudKey = { rayPick->getFilter().getHUDFlags() };
|
||||||
|
if (!checkAndCompareCachedResults(rayKey, results, res, hudKey)) {
|
||||||
glm::vec3 hudRes = DependencyManager::get<HMDScriptingInterface>()->calculateRayUICollisionPoint(ray.origin, ray.direction);
|
glm::vec3 hudRes = DependencyManager::get<HMDScriptingInterface>()->calculateRayUICollisionPoint(ray.origin, ray.direction);
|
||||||
cacheResult(true, RayPickResult(IntersectionType::HUD, 0, glm::distance(ray.origin, hudRes), hudRes, ray), hudMask, res, rayKey, results);
|
cacheResult(true, RayPickResult(IntersectionType::HUD, 0, glm::distance(ray.origin, hudRes), hudRes, ray), hudKey, res, rayKey, results);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,25 @@
|
||||||
|
|
||||||
class RayPickResult;
|
class RayPickResult;
|
||||||
|
|
||||||
|
typedef struct RayCacheKey {
|
||||||
|
RayPickFilter::Flags mask;
|
||||||
|
QVector<QUuid> include;
|
||||||
|
QVector<QUuid> ignore;
|
||||||
|
|
||||||
|
bool operator==(const RayCacheKey& other) const {
|
||||||
|
return (mask == other.mask && include == other.include && ignore == other.ignore);
|
||||||
|
}
|
||||||
|
} RayCacheKey;
|
||||||
|
|
||||||
|
namespace std {
|
||||||
|
template <>
|
||||||
|
struct hash<RayCacheKey> {
|
||||||
|
size_t operator()(const RayCacheKey& k) const {
|
||||||
|
return ((hash<RayPickFilter::Flags>()(k.mask) ^ (qHash(k.include) << 1)) >> 1) ^ (qHash(k.ignore) << 1);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
class RayPickManager : protected ReadWriteLockable {
|
class RayPickManager : protected ReadWriteLockable {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -45,11 +64,11 @@ private:
|
||||||
RayPick::Pointer findRayPick(const QUuid& uid) const;
|
RayPick::Pointer findRayPick(const QUuid& uid) const;
|
||||||
QHash<QUuid, RayPick::Pointer> _rayPicks;
|
QHash<QUuid, RayPick::Pointer> _rayPicks;
|
||||||
|
|
||||||
typedef QHash<QPair<glm::vec3, glm::vec3>, std::unordered_map<RayPickFilter::Flags, RayPickResult>> RayPickCache;
|
typedef QHash<QPair<glm::vec3, glm::vec3>, std::unordered_map<RayCacheKey, RayPickResult>> RayPickCache;
|
||||||
|
|
||||||
// Returns true if this ray exists in the cache, and if it does, update res if the cached result is closer
|
// Returns true if this ray exists in the cache, and if it does, update res if the cached result is closer
|
||||||
bool checkAndCompareCachedResults(QPair<glm::vec3, glm::vec3>& ray, RayPickCache& cache, RayPickResult& res, const RayPickFilter::Flags& mask);
|
bool checkAndCompareCachedResults(QPair<glm::vec3, glm::vec3>& ray, RayPickCache& cache, RayPickResult& res, const RayCacheKey& key);
|
||||||
void cacheResult(const bool intersects, const RayPickResult& resTemp, const RayPickFilter::Flags& mask, RayPickResult& res, QPair<glm::vec3, glm::vec3>& ray, RayPickCache& cache);
|
void cacheResult(const bool intersects, const RayPickResult& resTemp, const RayCacheKey& key, RayPickResult& res, QPair<glm::vec3, glm::vec3>& ray, RayPickCache& cache);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_RayPickManager_h
|
#endif // hifi_RayPickManager_h
|
|
@ -24,7 +24,7 @@ class RayPickScriptingInterface : public QObject, public Dependency {
|
||||||
Q_PROPERTY(unsigned int PICK_OVERLAYS READ PICK_OVERLAYS CONSTANT)
|
Q_PROPERTY(unsigned int PICK_OVERLAYS READ PICK_OVERLAYS CONSTANT)
|
||||||
Q_PROPERTY(unsigned int PICK_AVATARS READ PICK_AVATARS CONSTANT)
|
Q_PROPERTY(unsigned int PICK_AVATARS READ PICK_AVATARS CONSTANT)
|
||||||
Q_PROPERTY(unsigned int PICK_HUD READ PICK_HUD CONSTANT)
|
Q_PROPERTY(unsigned int PICK_HUD READ PICK_HUD CONSTANT)
|
||||||
Q_PROPERTY(unsigned int PICK_COURSE READ PICK_COURSE CONSTANT)
|
Q_PROPERTY(unsigned int PICK_COARSE READ PICK_COARSE CONSTANT)
|
||||||
Q_PROPERTY(unsigned int PICK_INCLUDE_INVISIBLE READ PICK_INCLUDE_INVISIBLE CONSTANT)
|
Q_PROPERTY(unsigned int PICK_INCLUDE_INVISIBLE READ PICK_INCLUDE_INVISIBLE CONSTANT)
|
||||||
Q_PROPERTY(unsigned int PICK_INCLUDE_NONCOLLIDABLE READ PICK_INCLUDE_NONCOLLIDABLE CONSTANT)
|
Q_PROPERTY(unsigned int PICK_INCLUDE_NONCOLLIDABLE READ PICK_INCLUDE_NONCOLLIDABLE CONSTANT)
|
||||||
Q_PROPERTY(unsigned int PICK_ALL_INTERSECTIONS READ PICK_ALL_INTERSECTIONS CONSTANT)
|
Q_PROPERTY(unsigned int PICK_ALL_INTERSECTIONS READ PICK_ALL_INTERSECTIONS CONSTANT)
|
||||||
|
|
|
@ -26,4 +26,4 @@ signals:
|
||||||
void hoverLeave(const QUuid& id, const PointerEvent& pointerEvent);
|
void hoverLeave(const QUuid& id, const PointerEvent& pointerEvent);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_RayPick_h
|
#endif // hifi_pointers_PointerManager_h
|
||||||
|
|
|
@ -142,14 +142,6 @@ public:
|
||||||
|
|
||||||
void setIgnoreItems(const QVector<QUuid>& items);
|
void setIgnoreItems(const QVector<QUuid>& items);
|
||||||
void setIncludeItems(const QVector<QUuid>& items);
|
void setIncludeItems(const QVector<QUuid>& items);
|
||||||
#if 0
|
|
||||||
void setIgnoreEntities(const QScriptValue& ignoreEntities);
|
|
||||||
void setIncludeEntities(const QScriptValue& includeEntities);
|
|
||||||
void setIgnoreOverlays(const QScriptValue& ignoreOverlays);
|
|
||||||
void setIncludeOverlays(const QScriptValue& includeOverlays);
|
|
||||||
void setIgnoreAvatars(const QScriptValue& ignoreAvatars);
|
|
||||||
void setIncludeAvatars(const QScriptValue& includeAvatars);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
RayPickFilter _filter;
|
RayPickFilter _filter;
|
||||||
|
|
|
@ -141,8 +141,11 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js");
|
||||||
};
|
};
|
||||||
|
|
||||||
this.setIgnoreTablet = function() {
|
this.setIgnoreTablet = function() {
|
||||||
RayPick.setIgnoreOverlays(_this.leftControllerRayPick, [HMD.tabletID]);
|
if (HMD.tabletID !== this.tabletID) {
|
||||||
RayPick.setIgnoreOverlays(_this.rightControllerRayPick, [HMD.tabletID]);
|
this.tabletID = HMD.tabletID;
|
||||||
|
RayPick.setIgnoreItems(_this.leftControllerRayPick, _this.blacklist.concat([HMD.tabletID]));
|
||||||
|
RayPick.setIgnoreItems(_this.rightControllerRayPick, _this.blacklist.concat([HMD.tabletID]));
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this.update = function () {
|
this.update = function () {
|
||||||
|
@ -367,9 +370,8 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js");
|
||||||
};
|
};
|
||||||
|
|
||||||
this.setBlacklist = function() {
|
this.setBlacklist = function() {
|
||||||
RayPick.setIgnoreEntities(_this.leftControllerRayPick, this.blacklist);
|
RayPick.setIgnoreItems(_this.leftControllerRayPick, this.blacklist.concat(HMD.tabletID));
|
||||||
RayPick.setIgnoreEntities(_this.rightControllerRayPick, this.blacklist);
|
RayPick.setIgnoreItems(_this.rightControllerRayPick, this.blacklist.concat(HMD.tabletID));
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var MAPPING_NAME = "com.highfidelity.controllerDispatcher";
|
var MAPPING_NAME = "com.highfidelity.controllerDispatcher";
|
||||||
|
|
|
@ -134,6 +134,13 @@ Script.include("/~/system/libraries/utils.js");
|
||||||
|
|
||||||
LaserPointers.enableLaserPointer(this.laserPointer);
|
LaserPointers.enableLaserPointer(this.laserPointer);
|
||||||
LaserPointers.setRenderState(this.laserPointer, this.mode);
|
LaserPointers.setRenderState(this.laserPointer, this.mode);
|
||||||
|
|
||||||
|
if (HMD.tabletID !== this.tabletID || HMD.tabletButtonID !== this.tabletButtonID || HMD.tabletScreenID !== this.tabletScreenID) {
|
||||||
|
this.tabletID = HMD.tabletID;
|
||||||
|
this.tabletButtonID = HMD.tabletButtonID;
|
||||||
|
this.tabletScreenID = HMD.tabletScreenID;
|
||||||
|
LaserPointers.setIgnoreItems(this.laserPointer, [HMD.tabletID, HMD.tabletButtonID, HMD.tabletScreenID]);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this.pointingAtTablet = function(objectID) {
|
this.pointingAtTablet = function(objectID) {
|
||||||
|
@ -244,7 +251,7 @@ Script.include("/~/system/libraries/utils.js");
|
||||||
defaultRenderStates: defaultRenderStates
|
defaultRenderStates: defaultRenderStates
|
||||||
});
|
});
|
||||||
|
|
||||||
LaserPointers.setIgnoreOverlays(this.laserPointer, [HMD.tabletID, HMD.tabletButtonID, HMD.tabletScreenID]);
|
LaserPointers.setIgnoreItems(this.laserPointer, [HMD.tabletID, HMD.tabletButtonID, HMD.tabletScreenID]);
|
||||||
}
|
}
|
||||||
|
|
||||||
var leftHandInEditMode = new InEditMode(LEFT_HAND);
|
var leftHandInEditMode = new InEditMode(LEFT_HAND);
|
||||||
|
|
|
@ -184,6 +184,11 @@ Script.include("/~/system/libraries/controllers.js");
|
||||||
|
|
||||||
LaserPointers.enableLaserPointer(this.laserPointer);
|
LaserPointers.enableLaserPointer(this.laserPointer);
|
||||||
LaserPointers.setRenderState(this.laserPointer, this.mode);
|
LaserPointers.setRenderState(this.laserPointer, this.mode);
|
||||||
|
|
||||||
|
if (HMD.tabletID !== this.tabletID) {
|
||||||
|
this.tabletID = HMD.tabletID;
|
||||||
|
LaserPointers.setIgnoreItems(this.laserPointer, [HMD.tabletID]);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this.processControllerTriggers = function(controllerData) {
|
this.processControllerTriggers = function(controllerData) {
|
||||||
|
@ -378,7 +383,7 @@ Script.include("/~/system/libraries/controllers.js");
|
||||||
defaultRenderStates: defaultRenderStates
|
defaultRenderStates: defaultRenderStates
|
||||||
});
|
});
|
||||||
|
|
||||||
LaserPointers.setIgnoreOverlays(this.laserPointer, [HMD.tabletID]);
|
LaserPointers.setIgnoreItems(this.laserPointer, [HMD.tabletID]);
|
||||||
}
|
}
|
||||||
|
|
||||||
var leftOverlayLaserInput = new OverlayLaserInput(LEFT_HAND);
|
var leftOverlayLaserInput = new OverlayLaserInput(LEFT_HAND);
|
||||||
|
|
|
@ -347,10 +347,10 @@ Script.include("/~/system/libraries/controllers.js");
|
||||||
};
|
};
|
||||||
|
|
||||||
this.setIgnoreEntities = function(entitiesToIgnore) {
|
this.setIgnoreEntities = function(entitiesToIgnore) {
|
||||||
LaserPointers.setIgnoreEntities(this.teleportRayHandVisible, entitiesToIgnore);
|
LaserPointers.setIgnoreItems(this.teleportRayHandVisible, entitiesToIgnore);
|
||||||
LaserPointers.setIgnoreEntities(this.teleportRayHandInvisible, entitiesToIgnore);
|
LaserPointers.setIgnoreItems(this.teleportRayHandInvisible, entitiesToIgnore);
|
||||||
LaserPointers.setIgnoreEntities(this.teleportRayHeadVisible, entitiesToIgnore);
|
LaserPointers.setIgnoreItems(this.teleportRayHeadVisible, entitiesToIgnore);
|
||||||
LaserPointers.setIgnoreEntities(this.teleportRayHeadInvisible, entitiesToIgnore);
|
LaserPointers.setIgnoreItems(this.teleportRayHeadInvisible, entitiesToIgnore);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -263,7 +263,7 @@ function Grabber() {
|
||||||
filter: RayPick.PICK_OVERLAYS,
|
filter: RayPick.PICK_OVERLAYS,
|
||||||
enabled: true
|
enabled: true
|
||||||
});
|
});
|
||||||
RayPick.setIncludeOverlays(this.mouseRayOverlays, [HMD.tabletID, HMD.tabletScreenID, HMD.homeButtonID]);
|
RayPick.setIncludeItems(this.mouseRayOverlays, [HMD.tabletID, HMD.tabletScreenID, HMD.homeButtonID]);
|
||||||
var renderStates = [{name: "grabbed", end: beacon}];
|
var renderStates = [{name: "grabbed", end: beacon}];
|
||||||
this.mouseRayEntities = LaserPointers.createLaserPointer({
|
this.mouseRayEntities = LaserPointers.createLaserPointer({
|
||||||
joint: "Mouse",
|
joint: "Mouse",
|
||||||
|
|
Loading…
Reference in a new issue