Merge pull request #11764 from luiscuenca/case7587

7587 Lasers resize with avatar
This commit is contained in:
John Conklin II 2017-11-15 09:31:45 -08:00 committed by GitHub
commit 8592f3fd4d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 58 additions and 89 deletions

View file

@ -15,7 +15,7 @@
#include "RayPickScriptingInterface.h" #include "RayPickScriptingInterface.h"
LaserPointer::LaserPointer(const QVariant& rayProps, const RenderStateMap& renderStates, const DefaultRenderStateMap& defaultRenderStates, LaserPointer::LaserPointer(const QVariant& rayProps, const RenderStateMap& renderStates, const DefaultRenderStateMap& defaultRenderStates,
const bool faceAvatar, const bool centerEndY, const bool lockEnd, const bool distanceScaleEnd, const bool enabled) : const bool faceAvatar, const bool centerEndY, const bool lockEnd, const bool distanceScaleEnd, const bool scaleWithAvatar, const bool enabled) :
_renderingEnabled(enabled), _renderingEnabled(enabled),
_renderStates(renderStates), _renderStates(renderStates),
_defaultRenderStates(defaultRenderStates), _defaultRenderStates(defaultRenderStates),
@ -23,6 +23,7 @@ LaserPointer::LaserPointer(const QVariant& rayProps, const RenderStateMap& rende
_centerEndY(centerEndY), _centerEndY(centerEndY),
_lockEnd(lockEnd), _lockEnd(lockEnd),
_distanceScaleEnd(distanceScaleEnd), _distanceScaleEnd(distanceScaleEnd),
_scaleWithAvatar(scaleWithAvatar),
_rayPickUID(DependencyManager::get<RayPickScriptingInterface>()->createRayPick(rayProps)) _rayPickUID(DependencyManager::get<RayPickScriptingInterface>()->createRayPick(rayProps))
{ {
@ -94,6 +95,10 @@ void LaserPointer::editRenderState(const std::string& state, const QVariant& sta
if (endDim.isValid()) { if (endDim.isValid()) {
_renderStates[state].setEndDim(vec3FromVariant(endDim)); _renderStates[state].setEndDim(vec3FromVariant(endDim));
} }
QVariant lineWidth = pathProps.toMap()["lineWidth"];
if (lineWidth.isValid()) {
_renderStates[state].setLineWidth(lineWidth.toFloat());
}
}); });
} }
@ -152,6 +157,7 @@ void LaserPointer::updateRenderState(const RenderState& renderState, const Inter
} }
} }
} }
QVariant end = vec3toVariant(endVec); QVariant end = vec3toVariant(endVec);
if (!renderState.getPathID().isNull()) { if (!renderState.getPathID().isNull()) {
QVariantMap pathProps; QVariantMap pathProps;
@ -159,6 +165,9 @@ void LaserPointer::updateRenderState(const RenderState& renderState, const Inter
pathProps.insert("end", end); pathProps.insert("end", end);
pathProps.insert("visible", true); pathProps.insert("visible", true);
pathProps.insert("ignoreRayIntersection", renderState.doesPathIgnoreRays()); pathProps.insert("ignoreRayIntersection", renderState.doesPathIgnoreRays());
if (_scaleWithAvatar) {
pathProps.insert("lineWidth", renderState.getLineWidth() * DependencyManager::get<AvatarManager>()->getMyAvatar()->getSensorToWorldScale());
}
qApp->getOverlays().editOverlay(renderState.getPathID(), pathProps); qApp->getOverlays().editOverlay(renderState.getPathID(), pathProps);
} }
if (!renderState.getEndID().isNull()) { if (!renderState.getEndID().isNull()) {
@ -166,7 +175,7 @@ void LaserPointer::updateRenderState(const RenderState& renderState, const Inter
glm::quat faceAvatarRotation = DependencyManager::get<AvatarManager>()->getMyAvatar()->getOrientation() * glm::quat(glm::radians(glm::vec3(0.0f, 180.0f, 0.0f))); glm::quat faceAvatarRotation = DependencyManager::get<AvatarManager>()->getMyAvatar()->getOrientation() * glm::quat(glm::radians(glm::vec3(0.0f, 180.0f, 0.0f)));
glm::vec3 dim = vec3FromVariant(qApp->getOverlays().getProperty(renderState.getEndID(), "dimensions").value); glm::vec3 dim = vec3FromVariant(qApp->getOverlays().getProperty(renderState.getEndID(), "dimensions").value);
if (_distanceScaleEnd) { if (_distanceScaleEnd) {
dim = renderState.getEndDim() * glm::distance(pickRay.origin, endVec) * DependencyManager::get<AvatarManager>()->getMyAvatar()->getSensorToWorldScale(); dim = renderState.getEndDim() * glm::distance(pickRay.origin, endVec);
endProps.insert("dimensions", vec3toVariant(dim)); endProps.insert("dimensions", vec3toVariant(dim));
} }
if (_centerEndY) { if (_centerEndY) {
@ -258,6 +267,7 @@ RenderState::RenderState(const OverlayID& startID, const OverlayID& pathID, cons
} }
if (!_pathID.isNull()) { if (!_pathID.isNull()) {
_pathIgnoreRays = qApp->getOverlays().getProperty(_pathID, "ignoreRayIntersection").value.toBool(); _pathIgnoreRays = qApp->getOverlays().getProperty(_pathID, "ignoreRayIntersection").value.toBool();
_lineWidth = qApp->getOverlays().getProperty(_pathID, "lineWidth").value.toFloat();
} }
if (!_endID.isNull()) { if (!_endID.isNull()) {
_endDim = vec3FromVariant(qApp->getOverlays().getProperty(_endID, "dimensions").value); _endDim = vec3FromVariant(qApp->getOverlays().getProperty(_endID, "dimensions").value);

View file

@ -43,6 +43,9 @@ public:
void setEndDim(const glm::vec3& endDim) { _endDim = endDim; } void setEndDim(const glm::vec3& endDim) { _endDim = endDim; }
const glm::vec3& getEndDim() const { return _endDim; } const glm::vec3& getEndDim() const { return _endDim; }
void setLineWidth(const float& lineWidth) { _lineWidth = lineWidth; }
const float& getLineWidth() const { return _lineWidth; }
void deleteOverlays(); void deleteOverlays();
private: private:
@ -54,6 +57,7 @@ private:
bool _endIgnoreRays; bool _endIgnoreRays;
glm::vec3 _endDim; glm::vec3 _endDim;
float _lineWidth;
}; };
@ -66,7 +70,7 @@ public:
typedef std::unordered_map<std::string, std::pair<float, RenderState>> DefaultRenderStateMap; typedef std::unordered_map<std::string, std::pair<float, RenderState>> DefaultRenderStateMap;
LaserPointer(const QVariant& rayProps, const RenderStateMap& renderStates, const DefaultRenderStateMap& defaultRenderStates, LaserPointer(const QVariant& rayProps, const RenderStateMap& renderStates, const DefaultRenderStateMap& defaultRenderStates,
const bool faceAvatar, const bool centerEndY, const bool lockEnd, const bool distanceScaleEnd, const bool enabled); const bool faceAvatar, const bool centerEndY, const bool lockEnd, const bool distanceScaleEnd, const bool scaleWithAvatar, const bool enabled);
~LaserPointer(); ~LaserPointer();
QUuid getRayUID() { return _rayPickUID; } QUuid getRayUID() { return _rayPickUID; }
@ -97,6 +101,7 @@ private:
bool _centerEndY; bool _centerEndY;
bool _lockEnd; bool _lockEnd;
bool _distanceScaleEnd; bool _distanceScaleEnd;
bool _scaleWithAvatar;
LockEndObject _lockEndObject; LockEndObject _lockEndObject;
const QUuid _rayPickUID; const QUuid _rayPickUID;

View file

@ -11,9 +11,9 @@
#include "LaserPointerManager.h" #include "LaserPointerManager.h"
QUuid LaserPointerManager::createLaserPointer(const QVariant& rayProps, const LaserPointer::RenderStateMap& renderStates, const LaserPointer::DefaultRenderStateMap& defaultRenderStates, QUuid LaserPointerManager::createLaserPointer(const QVariant& rayProps, const LaserPointer::RenderStateMap& renderStates, const LaserPointer::DefaultRenderStateMap& defaultRenderStates,
const bool faceAvatar, const bool centerEndY, const bool lockEnd, const bool distanceScaleEnd, const bool enabled) { const bool faceAvatar, const bool centerEndY, const bool lockEnd, const bool distanceScaleEnd, const bool scaleWithAvatar, const bool enabled) {
QUuid result; QUuid result;
std::shared_ptr<LaserPointer> laserPointer = std::make_shared<LaserPointer>(rayProps, renderStates, defaultRenderStates, faceAvatar, centerEndY, lockEnd, distanceScaleEnd, enabled); std::shared_ptr<LaserPointer> laserPointer = std::make_shared<LaserPointer>(rayProps, renderStates, defaultRenderStates, faceAvatar, centerEndY, lockEnd, distanceScaleEnd, scaleWithAvatar, enabled);
if (!laserPointer->getRayUID().isNull()) { if (!laserPointer->getRayUID().isNull()) {
result = QUuid::createUuid(); result = QUuid::createUuid();
withWriteLock([&] { _laserPointers[result] = laserPointer; }); withWriteLock([&] { _laserPointers[result] = laserPointer; });

View file

@ -25,7 +25,7 @@ class LaserPointerManager : protected ReadWriteLockable {
public: public:
QUuid createLaserPointer(const QVariant& rayProps, const LaserPointer::RenderStateMap& renderStates, const LaserPointer::DefaultRenderStateMap& defaultRenderStates, QUuid createLaserPointer(const QVariant& rayProps, const LaserPointer::RenderStateMap& renderStates, const LaserPointer::DefaultRenderStateMap& defaultRenderStates,
const bool faceAvatar, const bool centerEndY, const bool lockEnd, const bool distanceScaleEnd, const bool enabled); const bool faceAvatar, const bool centerEndY, const bool lockEnd, const bool distanceScaleEnd, const bool scaleWithAvatar, const bool enabled);
void removeLaserPointer(const QUuid& uid); void removeLaserPointer(const QUuid& uid);
void enableLaserPointer(const QUuid& uid) const; void enableLaserPointer(const QUuid& uid) const;

View file

@ -51,6 +51,11 @@ QUuid LaserPointerScriptingInterface::createLaserPointer(const QVariant& propert
enabled = propertyMap["enabled"].toBool(); enabled = propertyMap["enabled"].toBool();
} }
bool scaleWithAvatar = false;
if (propertyMap["scaleWithAvatar"].isValid()) {
scaleWithAvatar = propertyMap["scaleWithAvatar"].toBool();
}
LaserPointer::RenderStateMap renderStates; LaserPointer::RenderStateMap renderStates;
if (propertyMap["renderStates"].isValid()) { if (propertyMap["renderStates"].isValid()) {
QList<QVariant> renderStateVariants = propertyMap["renderStates"].toList(); QList<QVariant> renderStateVariants = propertyMap["renderStates"].toList();
@ -80,7 +85,7 @@ QUuid LaserPointerScriptingInterface::createLaserPointer(const QVariant& propert
} }
} }
return qApp->getLaserPointerManager().createLaserPointer(properties, renderStates, defaultRenderStates, faceAvatar, centerEndY, lockEnd, distanceScaleEnd, enabled); return qApp->getLaserPointerManager().createLaserPointer(properties, renderStates, defaultRenderStates, faceAvatar, centerEndY, lockEnd, distanceScaleEnd, scaleWithAvatar, enabled);
} }
void LaserPointerScriptingInterface::editRenderState(const QUuid& uid, const QString& renderState, const QVariant& properties) const { void LaserPointerScriptingInterface::editRenderState(const QUuid& uid, const QString& renderState, const QVariant& properties) const {

View file

@ -16,13 +16,11 @@
#include "Application.h" #include "Application.h"
const float DEFAULT_LINE_WIDTH = 1.0f;
const bool DEFAULT_IS_SOLID = false; const bool DEFAULT_IS_SOLID = false;
const bool DEFAULT_IS_DASHED_LINE = false; const bool DEFAULT_IS_DASHED_LINE = false;
Base3DOverlay::Base3DOverlay() : Base3DOverlay::Base3DOverlay() :
SpatiallyNestable(NestableType::Overlay, QUuid::createUuid()), SpatiallyNestable(NestableType::Overlay, QUuid::createUuid()),
_lineWidth(DEFAULT_LINE_WIDTH),
_isSolid(DEFAULT_IS_SOLID), _isSolid(DEFAULT_IS_SOLID),
_isDashedLine(DEFAULT_IS_DASHED_LINE), _isDashedLine(DEFAULT_IS_DASHED_LINE),
_ignoreRayIntersection(false), _ignoreRayIntersection(false),
@ -34,7 +32,6 @@ Base3DOverlay::Base3DOverlay() :
Base3DOverlay::Base3DOverlay(const Base3DOverlay* base3DOverlay) : Base3DOverlay::Base3DOverlay(const Base3DOverlay* base3DOverlay) :
Overlay(base3DOverlay), Overlay(base3DOverlay),
SpatiallyNestable(NestableType::Overlay, QUuid::createUuid()), SpatiallyNestable(NestableType::Overlay, QUuid::createUuid()),
_lineWidth(base3DOverlay->_lineWidth),
_isSolid(base3DOverlay->_isSolid), _isSolid(base3DOverlay->_isSolid),
_isDashedLine(base3DOverlay->_isDashedLine), _isDashedLine(base3DOverlay->_isDashedLine),
_ignoreRayIntersection(base3DOverlay->_ignoreRayIntersection), _ignoreRayIntersection(base3DOverlay->_ignoreRayIntersection),
@ -153,12 +150,6 @@ void Base3DOverlay::setProperties(const QVariantMap& originalProperties) {
setLocalOrientation(quatFromVariant(properties["orientation"])); setLocalOrientation(quatFromVariant(properties["orientation"]));
needRenderItemUpdate = true; needRenderItemUpdate = true;
} }
if (properties["lineWidth"].isValid()) {
setLineWidth(properties["lineWidth"].toFloat());
needRenderItemUpdate = true;
}
if (properties["isSolid"].isValid()) { if (properties["isSolid"].isValid()) {
setIsSolid(properties["isSolid"].toBool()); setIsSolid(properties["isSolid"].toBool());
} }
@ -225,9 +216,6 @@ QVariant Base3DOverlay::getProperty(const QString& property) {
if (property == "localRotation" || property == "localOrientation") { if (property == "localRotation" || property == "localOrientation") {
return quatToVariant(getLocalOrientation()); return quatToVariant(getLocalOrientation());
} }
if (property == "lineWidth") {
return _lineWidth;
}
if (property == "isSolid" || property == "isFilled" || property == "solid" || property == "filed") { if (property == "isSolid" || property == "isFilled" || property == "solid" || property == "filed") {
return _isSolid; return _isSolid;
} }

View file

@ -38,7 +38,6 @@ public:
// TODO: consider implementing registration points in this class // TODO: consider implementing registration points in this class
glm::vec3 getCenter() const { return getPosition(); } glm::vec3 getCenter() const { return getPosition(); }
float getLineWidth() const { return _lineWidth; }
bool getIsSolid() const { return _isSolid; } bool getIsSolid() const { return _isSolid; }
bool getIsDashedLine() const { return _isDashedLine; } bool getIsDashedLine() const { return _isDashedLine; }
bool getIsSolidLine() const { return !_isDashedLine; } bool getIsSolidLine() const { return !_isDashedLine; }
@ -47,7 +46,6 @@ public:
bool getDrawHUDLayer() const { return _drawHUDLayer; } bool getDrawHUDLayer() const { return _drawHUDLayer; }
bool getIsGrabbable() const { return _isGrabbable; } bool getIsGrabbable() const { return _isGrabbable; }
void setLineWidth(float lineWidth) { _lineWidth = lineWidth; }
void setIsSolid(bool isSolid) { _isSolid = isSolid; } void setIsSolid(bool isSolid) { _isSolid = isSolid; }
void setIsDashedLine(bool isDashedLine) { _isDashedLine = isDashedLine; } void setIsDashedLine(bool isDashedLine) { _isDashedLine = isDashedLine; }
void setIgnoreRayIntersection(bool value) { _ignoreRayIntersection = value; } void setIgnoreRayIntersection(bool value) { _ignoreRayIntersection = value; }
@ -85,7 +83,6 @@ protected:
void setRenderVisible(bool visible); void setRenderVisible(bool visible);
const Transform& getRenderTransform() const { return _renderTransform; } const Transform& getRenderTransform() const { return _renderTransform; }
float _lineWidth;
bool _isSolid; bool _isSolid;
bool _isDashedLine; bool _isDashedLine;
bool _ignoreRayIntersection; bool _ignoreRayIntersection;

View file

@ -33,8 +33,8 @@ Line3DOverlay::Line3DOverlay(const Line3DOverlay* line3DOverlay) :
_length = line3DOverlay->getLength(); _length = line3DOverlay->getLength();
_endParentID = line3DOverlay->getEndParentID(); _endParentID = line3DOverlay->getEndParentID();
_endParentJointIndex = line3DOverlay->getEndJointIndex(); _endParentJointIndex = line3DOverlay->getEndJointIndex();
_lineWidth = line3DOverlay->getLineWidth();
_glow = line3DOverlay->getGlow(); _glow = line3DOverlay->getGlow();
_glowWidth = line3DOverlay->getGlowWidth();
} }
Line3DOverlay::~Line3DOverlay() { Line3DOverlay::~Line3DOverlay() {
@ -145,7 +145,7 @@ void Line3DOverlay::render(RenderArgs* args) {
geometryCache->renderDashedLine(*batch, start, end, colorv4, _geometryCacheID); geometryCache->renderDashedLine(*batch, start, end, colorv4, _geometryCacheID);
} else { } else {
// renderGlowLine handles both glow = 0 and glow > 0 cases // renderGlowLine handles both glow = 0 and glow > 0 cases
geometryCache->renderGlowLine(*batch, start, end, colorv4, _glow, _glowWidth, _geometryCacheID); geometryCache->renderGlowLine(*batch, start, end, colorv4, _glow, _lineWidth, _geometryCacheID);
} }
} }
} }
@ -239,11 +239,10 @@ void Line3DOverlay::setProperties(const QVariantMap& originalProperties) {
} }
} }
auto glowWidth = properties["glowWidth"]; auto lineWidth = properties["lineWidth"];
if (glowWidth.isValid()) { if (lineWidth.isValid()) {
setGlowWidth(glowWidth.toFloat()); setLineWidth(lineWidth.toFloat());
} }
} }
QVariant Line3DOverlay::getProperty(const QString& property) { QVariant Line3DOverlay::getProperty(const QString& property) {
@ -262,6 +261,9 @@ QVariant Line3DOverlay::getProperty(const QString& property) {
if (property == "length") { if (property == "length") {
return QVariant(getLength()); return QVariant(getLength());
} }
if (property == "lineWidth") {
return _lineWidth;
}
return Base3DOverlay::getProperty(property); return Base3DOverlay::getProperty(property);
} }

View file

@ -31,8 +31,8 @@ public:
// getters // getters
glm::vec3 getStart() const; glm::vec3 getStart() const;
glm::vec3 getEnd() const; glm::vec3 getEnd() const;
const float& getLineWidth() const { return _lineWidth; }
const float& getGlow() const { return _glow; } const float& getGlow() const { return _glow; }
const float& getGlowWidth() const { return _glowWidth; }
// setters // setters
void setStart(const glm::vec3& start); void setStart(const glm::vec3& start);
@ -41,8 +41,8 @@ public:
void setLocalStart(const glm::vec3& localStart) { setLocalPosition(localStart); } void setLocalStart(const glm::vec3& localStart) { setLocalPosition(localStart); }
void setLocalEnd(const glm::vec3& localEnd); void setLocalEnd(const glm::vec3& localEnd);
void setLineWidth(const float& lineWidth) { _lineWidth = lineWidth; }
void setGlow(const float& glow) { _glow = glow; } void setGlow(const float& glow) { _glow = glow; }
void setGlowWidth(const float& glowWidth) { _glowWidth = glowWidth; }
void setProperties(const QVariantMap& properties) override; void setProperties(const QVariantMap& properties) override;
QVariant getProperty(const QString& property) override; QVariant getProperty(const QString& property) override;
@ -70,8 +70,9 @@ private:
glm::vec3 _direction; // in parent frame glm::vec3 _direction; // in parent frame
float _length { 1.0 }; // in parent frame float _length { 1.0 }; // in parent frame
const float DEFAULT_LINE_WIDTH = 0.02f;
float _lineWidth { DEFAULT_LINE_WIDTH };
float _glow { 0.0 }; float _glow { 0.0 };
float _glowWidth { 0.0 };
int _geometryCacheID; int _geometryCacheID;
}; };

View file

@ -1931,9 +1931,10 @@ void GeometryCache::renderGlowLine(gpu::Batch& batch, const glm::vec3& p1, const
vec4 p1; vec4 p1;
vec4 p2; vec4 p2;
vec4 color; vec4 color;
float width;
}; };
LineData lineData { vec4(p1, 1.0f), vec4(p2, 1.0f), color }; LineData lineData { vec4(p1, 1.0f), vec4(p2, 1.0f), color, glowWidth };
details.uniformBuffer->resize(sizeof(LineData)); details.uniformBuffer->resize(sizeof(LineData));
details.uniformBuffer->setSubData(0, lineData); details.uniformBuffer->setSubData(0, lineData);
} }

View file

@ -10,8 +10,8 @@
// //
in vec4 _color; in vec4 _color;
in float distanceFromCenter;
in float distanceFromCenter;
out vec4 _fragColor; out vec4 _fragColor;
void main(void) { void main(void) {

View file

@ -16,6 +16,7 @@ layout(std140) uniform lineData {
vec4 p1; vec4 p1;
vec4 p2; vec4 p2;
vec4 color; vec4 color;
float width;
}; };
out vec4 _color; out vec4 _color;
@ -39,7 +40,7 @@ void main(void) {
// Find the vector from the eye to one of the points // Find the vector from the eye to one of the points
vec3 v2 = normalize(p1eye.xyz); vec3 v2 = normalize(p1eye.xyz);
// The orthogonal vector is the cross product of these two // The orthogonal vector is the cross product of these two
vec3 orthogonal = cross(v1, v2) * 0.02; vec3 orthogonal = cross(v1, v2) * width;
// Deteremine which end to emit based on the vertex id (even / odd) // Deteremine which end to emit based on the vertex id (even / odd)
vec4 eye = (0 == gl_VertexID % 2) ? p1eye : p2eye; vec4 eye = (0 == gl_VertexID % 2) ? p1eye : p2eye;

View file

@ -96,7 +96,6 @@ function rayCastTest() {
color: color, color: color,
alpha: 1, alpha: 1,
visible: visible, visible: visible,
lineWidth: 2,
start: origin, start: origin,
end: Vec3.sum(origin,Vec3.multiply(5,direction)) end: Vec3.sum(origin,Vec3.multiply(5,direction))
}); });

View file

@ -284,8 +284,7 @@
endParentJointIndex: yourJointIndex, endParentJointIndex: yourJointIndex,
end: yourJointPosition, end: yourJointPosition,
color: identifyAvatarLineColor, color: identifyAvatarLineColor,
alpha: 1, alpha: 1
lineWidth: 1
}; };
avatarIdentifiers[yourAvatarID] = identifierParams; avatarIdentifiers[yourAvatarID] = identifierParams;

View file

@ -33,7 +33,6 @@ Script.include("/~/system/libraries/Xform.js");
alpha: 1, alpha: 1,
solid: true, solid: true,
glow: 1.0, glow: 1.0,
lineWidth: 5,
ignoreRayIntersection: true, // always ignore this ignoreRayIntersection: true, // always ignore this
drawInFront: true, // Even when burried inside of something, show it. drawInFront: true, // Even when burried inside of something, show it.
parentID: MyAvatar.SELF_ID parentID: MyAvatar.SELF_ID
@ -55,7 +54,6 @@ Script.include("/~/system/libraries/Xform.js");
alpha: 1, alpha: 1,
solid: true, solid: true,
glow: 1.0, glow: 1.0,
lineWidth: 5,
ignoreRayIntersection: true, // always ignore this ignoreRayIntersection: true, // always ignore this
drawInFront: true, // Even when burried inside of something, show it. drawInFront: true, // Even when burried inside of something, show it.
parentID: MyAvatar.SELF_ID parentID: MyAvatar.SELF_ID
@ -77,7 +75,6 @@ Script.include("/~/system/libraries/Xform.js");
alpha: 1, alpha: 1,
solid: true, solid: true,
glow: 1.0, glow: 1.0,
lineWidth: 5,
ignoreRayIntersection: true, // always ignore this ignoreRayIntersection: true, // always ignore this
drawInFront: true, // Even when burried inside of something, show it. drawInFront: true, // Even when burried inside of something, show it.
parentID: MyAvatar.SELF_ID parentID: MyAvatar.SELF_ID
@ -649,6 +646,7 @@ Script.include("/~/system/libraries/Xform.js");
renderStates: renderStates, renderStates: renderStates,
faceAvatar: true, faceAvatar: true,
distanceScaleEnd: true, distanceScaleEnd: true,
scaleWithAvatar: true,
defaultRenderStates: defaultRenderStates defaultRenderStates: defaultRenderStates
}); });
} }

View file

@ -25,7 +25,6 @@ Script.include("/~/system/libraries/controllers.js");
alpha: 1, alpha: 1,
solid: true, solid: true,
glow: 1.0, glow: 1.0,
lineWidth: 5,
ignoreRayIntersection: true, // always ignore this ignoreRayIntersection: true, // always ignore this
drawInFront: true, // Even when burried inside of something, show it. drawInFront: true, // Even when burried inside of something, show it.
parentID: MyAvatar.SELF_ID parentID: MyAvatar.SELF_ID
@ -47,7 +46,6 @@ Script.include("/~/system/libraries/controllers.js");
alpha: 1, alpha: 1,
solid: true, solid: true,
glow: 1.0, glow: 1.0,
lineWidth: 5,
ignoreRayIntersection: true, // always ignore this ignoreRayIntersection: true, // always ignore this
drawInFront: true, // Even when burried inside of something, show it. drawInFront: true, // Even when burried inside of something, show it.
parentID: MyAvatar.SELF_ID parentID: MyAvatar.SELF_ID
@ -69,7 +67,6 @@ Script.include("/~/system/libraries/controllers.js");
alpha: 1, alpha: 1,
solid: true, solid: true,
glow: 1.0, glow: 1.0,
lineWidth: 5,
ignoreRayIntersection: true, // always ignore this ignoreRayIntersection: true, // always ignore this
drawInFront: true, // Even when burried inside of something, show it. drawInFront: true, // Even when burried inside of something, show it.
parentID: MyAvatar.SELF_ID parentID: MyAvatar.SELF_ID
@ -190,6 +187,7 @@ Script.include("/~/system/libraries/controllers.js");
renderStates: renderStates, renderStates: renderStates,
faceAvatar: true, faceAvatar: true,
distanceScaleEnd: true, distanceScaleEnd: true,
scaleWithAvatar: true,
defaultRenderStates: defaultRenderStates defaultRenderStates: defaultRenderStates
}); });

View file

@ -31,7 +31,6 @@
alpha: 1, alpha: 1,
solid: true, solid: true,
glow: 1.0, glow: 1.0,
lineWidth: 5,
ignoreRayIntersection: true, // always ignore this ignoreRayIntersection: true, // always ignore this
drawHUDLayer: true, drawHUDLayer: true,
parentID: MyAvatar.SELF_ID parentID: MyAvatar.SELF_ID
@ -53,7 +52,6 @@
alpha: 1, alpha: 1,
solid: true, solid: true,
glow: 1.0, glow: 1.0,
lineWidth: 5,
ignoreRayIntersection: true, // always ignore this ignoreRayIntersection: true, // always ignore this
drawHUDLayer: true, drawHUDLayer: true,
parentID: MyAvatar.SELF_ID parentID: MyAvatar.SELF_ID
@ -75,7 +73,6 @@
alpha: 1, alpha: 1,
solid: true, solid: true,
glow: 1.0, glow: 1.0,
lineWidth: 5,
ignoreRayIntersection: true, // always ignore this ignoreRayIntersection: true, // always ignore this
drawHUDLayer: true, drawHUDLayer: true,
parentID: MyAvatar.SELF_ID parentID: MyAvatar.SELF_ID

View file

@ -27,7 +27,6 @@ Script.include("/~/system/libraries/utils.js");
alpha: 1, alpha: 1,
solid: true, solid: true,
glow: 1.0, glow: 1.0,
lineWidth: 5,
ignoreRayIntersection: true, // always ignore this ignoreRayIntersection: true, // always ignore this
drawInFront: true, // Even when burried inside of something, show it. drawInFront: true, // Even when burried inside of something, show it.
parentID: MyAvatar.SELF_ID parentID: MyAvatar.SELF_ID
@ -49,7 +48,6 @@ Script.include("/~/system/libraries/utils.js");
alpha: 1, alpha: 1,
solid: true, solid: true,
glow: 1.0, glow: 1.0,
lineWidth: 5,
ignoreRayIntersection: true, // always ignore this ignoreRayIntersection: true, // always ignore this
drawInFront: true, // Even when burried inside of something, show it. drawInFront: true, // Even when burried inside of something, show it.
parentID: MyAvatar.SELF_ID parentID: MyAvatar.SELF_ID
@ -71,7 +69,6 @@ Script.include("/~/system/libraries/utils.js");
alpha: 1, alpha: 1,
solid: true, solid: true,
glow: 1.0, glow: 1.0,
lineWidth: 5,
ignoreRayIntersection: true, // always ignore this ignoreRayIntersection: true, // always ignore this
drawInFront: true, // Even when burried inside of something, show it. drawInFront: true, // Even when burried inside of something, show it.
parentID: MyAvatar.SELF_ID parentID: MyAvatar.SELF_ID
@ -237,6 +234,7 @@ Script.include("/~/system/libraries/utils.js");
posOffset: getGrabPointSphereOffset(this.handToController(), true), posOffset: getGrabPointSphereOffset(this.handToController(), true),
renderStates: renderStates, renderStates: renderStates,
faceAvatar: true, faceAvatar: true,
scaleWithAvatar: true,
defaultRenderStates: defaultRenderStates defaultRenderStates: defaultRenderStates
}); });

View file

@ -26,7 +26,6 @@ Script.include("/~/system/libraries/controllers.js");
alpha: 1, alpha: 1,
solid: true, solid: true,
glow: 1.0, glow: 1.0,
lineWidth: 5,
ignoreRayIntersection: true, // always ignore this ignoreRayIntersection: true, // always ignore this
drawInFront: true, // Even when burried inside of something, show it. drawInFront: true, // Even when burried inside of something, show it.
parentID: MyAvatar.SELF_ID parentID: MyAvatar.SELF_ID
@ -48,7 +47,6 @@ Script.include("/~/system/libraries/controllers.js");
alpha: 1, alpha: 1,
solid: true, solid: true,
glow: 1.0, glow: 1.0,
lineWidth: 5,
ignoreRayIntersection: true, // always ignore this ignoreRayIntersection: true, // always ignore this
drawInFront: true, // Even when burried inside of something, show it. drawInFront: true, // Even when burried inside of something, show it.
parentID: MyAvatar.SELF_ID parentID: MyAvatar.SELF_ID
@ -70,7 +68,6 @@ Script.include("/~/system/libraries/controllers.js");
alpha: 1, alpha: 1,
solid: true, solid: true,
glow: 1.0, glow: 1.0,
lineWidth: 5,
ignoreRayIntersection: true, // always ignore this ignoreRayIntersection: true, // always ignore this
drawInFront: true, // Even when burried inside of something, show it. drawInFront: true, // Even when burried inside of something, show it.
parentID: MyAvatar.SELF_ID parentID: MyAvatar.SELF_ID
@ -371,6 +368,7 @@ Script.include("/~/system/libraries/controllers.js");
posOffset: getGrabPointSphereOffset(this.handToController(), true), posOffset: getGrabPointSphereOffset(this.handToController(), true),
renderStates: renderStates, renderStates: renderStates,
faceAvatar: true, faceAvatar: true,
scaleWithAvatar: true,
defaultRenderStates: defaultRenderStates defaultRenderStates: defaultRenderStates
}); });

View file

@ -153,6 +153,7 @@ Script.include("/~/system/libraries/controllers.js");
joint: (_this.hand === RIGHT_HAND) ? "RightHand" : "LeftHand", joint: (_this.hand === RIGHT_HAND) ? "RightHand" : "LeftHand",
filter: RayPick.PICK_ENTITIES, filter: RayPick.PICK_ENTITIES,
faceAvatar: true, faceAvatar: true,
scaleWithAvatar: true,
centerEndY: false, centerEndY: false,
renderStates: teleportRenderStates, renderStates: teleportRenderStates,
defaultRenderStates: teleportDefaultRenderStates defaultRenderStates: teleportDefaultRenderStates
@ -161,6 +162,7 @@ Script.include("/~/system/libraries/controllers.js");
joint: (_this.hand === RIGHT_HAND) ? "RightHand" : "LeftHand", joint: (_this.hand === RIGHT_HAND) ? "RightHand" : "LeftHand",
filter: RayPick.PICK_ENTITIES | RayPick.PICK_INCLUDE_INVISIBLE, filter: RayPick.PICK_ENTITIES | RayPick.PICK_INCLUDE_INVISIBLE,
faceAvatar: true, faceAvatar: true,
scaleWithAvatar: true,
centerEndY: false, centerEndY: false,
renderStates: teleportRenderStates renderStates: teleportRenderStates
}); });
@ -168,6 +170,7 @@ Script.include("/~/system/libraries/controllers.js");
joint: "Avatar", joint: "Avatar",
filter: RayPick.PICK_ENTITIES, filter: RayPick.PICK_ENTITIES,
faceAvatar: true, faceAvatar: true,
scaleWithAvatar: true,
centerEndY: false, centerEndY: false,
renderStates: teleportRenderStates, renderStates: teleportRenderStates,
defaultRenderStates: teleportDefaultRenderStates defaultRenderStates: teleportDefaultRenderStates
@ -176,6 +179,7 @@ Script.include("/~/system/libraries/controllers.js");
joint: "Avatar", joint: "Avatar",
filter: RayPick.PICK_ENTITIES | RayPick.PICK_INCLUDE_INVISIBLE, filter: RayPick.PICK_ENTITIES | RayPick.PICK_INCLUDE_INVISIBLE,
faceAvatar: true, faceAvatar: true,
scaleWithAvatar: true,
centerEndY: false, centerEndY: false,
renderStates: teleportRenderStates renderStates: teleportRenderStates
}); });

View file

@ -26,7 +26,6 @@ Script.include("/~/system/libraries/controllers.js");
alpha: 1, alpha: 1,
solid: true, solid: true,
glow: 1.0, glow: 1.0,
lineWidth: 5,
ignoreRayIntersection: true, // always ignore this ignoreRayIntersection: true, // always ignore this
drawInFront: true, // Even when burried inside of something, show it. drawInFront: true, // Even when burried inside of something, show it.
parentID: MyAvatar.SELF_ID parentID: MyAvatar.SELF_ID
@ -48,7 +47,6 @@ Script.include("/~/system/libraries/controllers.js");
alpha: 1, alpha: 1,
solid: true, solid: true,
glow: 1.0, glow: 1.0,
lineWidth: 5,
ignoreRayIntersection: true, // always ignore this ignoreRayIntersection: true, // always ignore this
drawInFront: true, // Even when burried inside of something, show it. drawInFront: true, // Even when burried inside of something, show it.
parentID: MyAvatar.SELF_ID parentID: MyAvatar.SELF_ID
@ -70,7 +68,6 @@ Script.include("/~/system/libraries/controllers.js");
alpha: 1, alpha: 1,
solid: true, solid: true,
glow: 1.0, glow: 1.0,
lineWidth: 5,
ignoreRayIntersection: true, // always ignore this ignoreRayIntersection: true, // always ignore this
drawInFront: true, // Even when burried inside of something, show it. drawInFront: true, // Even when burried inside of something, show it.
parentID: MyAvatar.SELF_ID parentID: MyAvatar.SELF_ID
@ -88,7 +85,6 @@ Script.include("/~/system/libraries/controllers.js");
{name: "hold", distance: DEFAULT_SEARCH_SPHERE_DISTANCE, path: holdPath} {name: "hold", distance: DEFAULT_SEARCH_SPHERE_DISTANCE, path: holdPath}
]; ];
// triggered when stylus presses a web overlay/entity // triggered when stylus presses a web overlay/entity
var HAPTIC_STYLUS_STRENGTH = 1.0; var HAPTIC_STYLUS_STRENGTH = 1.0;
var HAPTIC_STYLUS_DURATION = 20.0; var HAPTIC_STYLUS_DURATION = 20.0;
@ -452,6 +448,7 @@ Script.include("/~/system/libraries/controllers.js");
posOffset: getGrabPointSphereOffset(this.handToController(), true), posOffset: getGrabPointSphereOffset(this.handToController(), true),
renderStates: renderStates, renderStates: renderStates,
faceAvatar: true, faceAvatar: true,
scaleWithAvatar: true,
defaultRenderStates: defaultRenderStates defaultRenderStates: defaultRenderStates
}); });
} }

View file

@ -339,7 +339,6 @@ SelectionDisplay = (function() {
solid: grabberSolid, solid: grabberSolid,
visible: false, visible: false,
dashed: false, dashed: false,
lineWidth: grabberLineWidth,
drawInFront: true, drawInFront: true,
borderSize: 1.4 borderSize: 1.4
}; };
@ -352,7 +351,6 @@ SelectionDisplay = (function() {
solid: grabberSolid, solid: grabberSolid,
visible: false, visible: false,
dashed: false, dashed: false,
lineWidth: grabberLineWidth,
drawInFront: true, drawInFront: true,
borderSize: 1.4 borderSize: 1.4
}; };
@ -365,7 +363,6 @@ SelectionDisplay = (function() {
solid: grabberSolid, solid: grabberSolid,
visible: false, visible: false,
dashed: false, dashed: false,
lineWidth: grabberLineWidth,
drawInFront: true, drawInFront: true,
borderSize: 1.4 borderSize: 1.4
}; };
@ -378,14 +375,12 @@ SelectionDisplay = (function() {
solid: grabberSolid, solid: grabberSolid,
visible: false, visible: false,
dashed: false, dashed: false,
lineWidth: grabberLineWidth,
drawInFront: true, drawInFront: true,
borderSize: 1.4 borderSize: 1.4
}; };
var spotLightLineProperties = { var spotLightLineProperties = {
color: lightOverlayColor, color: lightOverlayColor
lineWidth: 1.5
}; };
var highlightBox = Overlays.addOverlay("cube", { var highlightBox = Overlays.addOverlay("cube", {
@ -400,7 +395,6 @@ SelectionDisplay = (function() {
solid: false, solid: false,
visible: false, visible: false,
dashed: true, dashed: true,
lineWidth: 2.0,
ignoreRayIntersection: true, // this never ray intersects ignoreRayIntersection: true, // this never ray intersects
drawInFront: true drawInFront: true
}); });
@ -416,8 +410,7 @@ SelectionDisplay = (function() {
alpha: 1, alpha: 1,
solid: false, solid: false,
visible: false, visible: false,
dashed: false, dashed: false
lineWidth: 1.0
}); });
var selectionBoxes = []; var selectionBoxes = [];
@ -466,7 +459,6 @@ SelectionDisplay = (function() {
// var normalLine = Overlays.addOverlay("line3d", { // var normalLine = Overlays.addOverlay("line3d", {
// visible: true, // visible: true,
// lineWidth: 2.0,
// start: { x: 0, y: 0, z: 0 }, // start: { x: 0, y: 0, z: 0 },
// end: { x: 0, y: 0, z: 0 }, // end: { x: 0, y: 0, z: 0 },
// color: { red: 255, green: 255, blue: 0 }, // color: { red: 255, green: 255, blue: 0 },
@ -656,7 +648,6 @@ SelectionDisplay = (function() {
var xRailOverlay = Overlays.addOverlay("line3d", { var xRailOverlay = Overlays.addOverlay("line3d", {
visible: false, visible: false,
lineWidth: 1.0,
start: Vec3.ZERO, start: Vec3.ZERO,
end: Vec3.ZERO, end: Vec3.ZERO,
color: { color: {
@ -668,7 +659,6 @@ SelectionDisplay = (function() {
}); });
var yRailOverlay = Overlays.addOverlay("line3d", { var yRailOverlay = Overlays.addOverlay("line3d", {
visible: false, visible: false,
lineWidth: 1.0,
start: Vec3.ZERO, start: Vec3.ZERO,
end: Vec3.ZERO, end: Vec3.ZERO,
color: { color: {
@ -680,7 +670,6 @@ SelectionDisplay = (function() {
}); });
var zRailOverlay = Overlays.addOverlay("line3d", { var zRailOverlay = Overlays.addOverlay("line3d", {
visible: false, visible: false,
lineWidth: 1.0,
start: Vec3.ZERO, start: Vec3.ZERO,
end: Vec3.ZERO, end: Vec3.ZERO,
color: { color: {
@ -693,7 +682,6 @@ SelectionDisplay = (function() {
var rotateZeroOverlay = Overlays.addOverlay("line3d", { var rotateZeroOverlay = Overlays.addOverlay("line3d", {
visible: false, visible: false,
lineWidth: 2.0,
start: Vec3.ZERO, start: Vec3.ZERO,
end: Vec3.ZERO, end: Vec3.ZERO,
color: { color: {
@ -706,7 +694,6 @@ SelectionDisplay = (function() {
var rotateCurrentOverlay = Overlays.addOverlay("line3d", { var rotateCurrentOverlay = Overlays.addOverlay("line3d", {
visible: false, visible: false,
lineWidth: 2.0,
start: Vec3.ZERO, start: Vec3.ZERO,
end: Vec3.ZERO, end: Vec3.ZERO,
color: { color: {
@ -1788,7 +1775,6 @@ SelectionDisplay = (function() {
y: distance, y: distance,
z: 1 z: 1
}, },
lineWidth: 1.5,
rotation: rotation, rotation: rotation,
visible: true visible: true
}); });
@ -1994,7 +1980,6 @@ SelectionDisplay = (function() {
solid: false, solid: false,
visible: false, visible: false,
dashed: false, dashed: false,
lineWidth: 1.0,
ignoreRayIntersection: true ignoreRayIntersection: true
})); }));
} }

View file

@ -189,7 +189,6 @@ function HighlightedEntity(id, entityProperties) {
green: 0x91, green: 0x91,
blue: 0x29 blue: 0x29
}, },
lineWidth: 1.0,
ignoreRayIntersection: true, ignoreRayIntersection: true,
drawInFront: false // Arguable. For now, let's not distract with mysterious wires around the scene. drawInFront: false // Arguable. For now, let's not distract with mysterious wires around the scene.
}); });

View file

@ -350,8 +350,7 @@
end: ZERO_VECTOR, end: ZERO_VECTOR,
color: { red: 255, green: 0, blue: 0}, color: { red: 255, green: 0, blue: 0},
alpha: 1, alpha: 1,
visible: true, visible: true
lineWidth: 2
}); });
}, },
}; };

View file

@ -329,7 +329,6 @@
y: 0, y: 0,
z: 0 z: 0
}, lineVectors[0]], }, lineVectors[0]],
lineWidth: 5,
color: this.stringData.currentColor color: this.stringData.currentColor
}); });
@ -339,7 +338,6 @@
y: 0, y: 0,
z: 0 z: 0
}, lineVectors[1]], }, lineVectors[1]],
lineWidth: 5,
color: this.stringData.currentColor color: this.stringData.currentColor
}); });

View file

@ -125,7 +125,6 @@ function createPreNotchString() {
y: 0, y: 0,
z: 0 z: 0
}, downOffset)], }, downOffset)],
lineWidth: 5,
color: { color: {
red: 255, red: 255,
green: 255, green: 255,

View file

@ -450,7 +450,6 @@
y: 0, y: 0,
z: 0 z: 0
}, downOffset)], }, downOffset)],
lineWidth: 5,
color: { color: {
red: 255, red: 255,
green: 255, green: 255,

View file

@ -427,7 +427,6 @@ MasterReset = function() {
y: 0, y: 0,
z: 0 z: 0
}, downOffset)], }, downOffset)],
lineWidth: 5,
color: { color: {
red: 255, red: 255,
green: 255, green: 255,

View file

@ -346,8 +346,7 @@
end: { x: 0, y: 0, z: 0 }, end: { x: 0, y: 0, z: 0 },
color: COLORS.RED, color: COLORS.RED,
alpha: 1, alpha: 1,
visible: true, visible: true
lineWidth: 2
}); });
}, },
}; };

View file

@ -266,7 +266,6 @@
dimensions: { "x": 5, "y": 5, "z": 5 }, dimensions: { "x": 5, "y": 5, "z": 5 },
ignoreForCollisions: 1, ignoreForCollisions: 1,
linePoints: [ { "x": 0, "y": 0, "z": 0 }, { "x": 0, "y": -1.2, "z": 0 } ], linePoints: [ { "x": 0, "y": 0, "z": 0 }, { "x": 0, "y": -1.2, "z": 0 } ],
lineWidth: 5,
name: STRING_NAME, name: STRING_NAME,
parentID: this.entityID, parentID: this.entityID,
localPosition: { "x": 0, "y": 0.6, "z": 0.1 }, localPosition: { "x": 0, "y": 0.6, "z": 0.1 },
@ -287,7 +286,6 @@
resetStringToIdlePosition: function() { resetStringToIdlePosition: function() {
Entities.editEntity(this.stringID, { Entities.editEntity(this.stringID, {
linePoints: [ { "x": 0, "y": 0, "z": 0 }, { "x": 0, "y": -1.2, "z": 0 } ], linePoints: [ { "x": 0, "y": 0, "z": 0 }, { "x": 0, "y": -1.2, "z": 0 } ],
lineWidth: 5,
localPosition: { "x": 0, "y": 0.6, "z": 0.1 }, localPosition: { "x": 0, "y": 0.6, "z": 0.1 },
localRotation: { "w": 1, "x": 0, "y": 0, "z": 0 }, localRotation: { "w": 1, "x": 0, "y": 0, "z": 0 },
}); });

View file

@ -99,7 +99,6 @@
lifetime: 360, lifetime: 360,
type: 'Line', type: 'Line',
glow: 1.0, glow: 1.0,
lineWidth: 5,
alpha: 0.5, alpha: 0.5,
ignoreRayIntersection: true, ignoreRayIntersection: true,
drawInFront: true, drawInFront: true,

View file

@ -72,7 +72,6 @@ Laser = function (side) {
} }
laserLine = Overlays.addOverlay("line3d", { laserLine = Overlays.addOverlay("line3d", {
lineWidth: 5,
alpha: 1.0, alpha: 1.0,
glow: 1.0, glow: 1.0,
ignoreRayIntersection: true, ignoreRayIntersection: true,

View file

@ -408,7 +408,6 @@ function getControllerLocation(controllerHand) {
dimensions: { "x": 5, "y": 5, "z": 5 }, dimensions: { "x": 5, "y": 5, "z": 5 },
ignoreForCollisions: 1, ignoreForCollisions: 1,
linePoints: [ { "x": 0, "y": 0, "z": 0 }, { "x": 0, "y": -1.2, "z": 0 } ], linePoints: [ { "x": 0, "y": 0, "z": 0 }, { "x": 0, "y": -1.2, "z": 0 } ],
lineWidth: 5,
color: { red: 153, green: 102, blue: 51 }, color: { red: 153, green: 102, blue: 51 },
name: STRING_NAME, name: STRING_NAME,
parentID: this.entityID, parentID: this.entityID,
@ -430,7 +429,6 @@ function getControllerLocation(controllerHand) {
resetStringToIdlePosition: function() { resetStringToIdlePosition: function() {
Entities.editEntity(this.stringID, { Entities.editEntity(this.stringID, {
linePoints: [ { "x": 0, "y": 0, "z": 0 }, { "x": 0, "y": -1.2, "z": 0 } ], linePoints: [ { "x": 0, "y": 0, "z": 0 }, { "x": 0, "y": -1.2, "z": 0 } ],
lineWidth: 5,
localPosition: { "x": 0, "y": 0.6, "z": 0.1 }, localPosition: { "x": 0, "y": 0.6, "z": 0.1 },
localRotation: { "w": 1, "x": 0, "y": 0, "z": 0 }, localRotation: { "w": 1, "x": 0, "y": 0, "z": 0 },
}); });