mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-07-10 20:58:37 +02:00
cleanups
This commit is contained in:
parent
1f92b57bf2
commit
a8038ce64e
1 changed files with 2 additions and 54 deletions
|
@ -948,7 +948,7 @@ function MyController(hand) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this.showModelStylus = function() {
|
this.showStylus = function() {
|
||||||
if (this.stylus) {
|
if (this.stylus) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -957,15 +957,13 @@ function MyController(hand) {
|
||||||
}
|
}
|
||||||
|
|
||||||
var stylusProperties = {
|
var stylusProperties = {
|
||||||
// url: Script.resourcesPath() + "meshes/tablet-stylus-skinny.fbx",
|
|
||||||
url: Script.resourcesPath() + "meshes/tablet-stylus-fat.fbx",
|
url: Script.resourcesPath() + "meshes/tablet-stylus-fat.fbx",
|
||||||
localPosition: Vec3.sum({ x: 0.0,
|
localPosition: Vec3.sum({ x: 0.0,
|
||||||
y: WEB_TOUCH_Y_OFFSET,
|
y: WEB_TOUCH_Y_OFFSET,
|
||||||
z: 0.0 },
|
z: 0.0 },
|
||||||
getGrabPointSphereOffset(this.handToController())),
|
getGrabPointSphereOffset(this.handToController())),
|
||||||
// localRotation: { x: 0, y: 0, z: 0, w: 1 },
|
|
||||||
localRotation: Quat.fromVec3Degrees({ x: -90, y: 0, z: 0 }),
|
localRotation: Quat.fromVec3Degrees({ x: -90, y: 0, z: 0 }),
|
||||||
dimensions: { x: 0.01, y: 0.01, z: WEB_STYLUS_LENGTH },
|
dimensions: { x: 0.01, y: 0.01, z: WEB_STYLUS_LENGTH },
|
||||||
solid: true,
|
solid: true,
|
||||||
visible: true,
|
visible: true,
|
||||||
ignoreRayIntersection: true,
|
ignoreRayIntersection: true,
|
||||||
|
@ -978,56 +976,6 @@ function MyController(hand) {
|
||||||
this.stylus = Overlays.addOverlay("model", stylusProperties);
|
this.stylus = Overlays.addOverlay("model", stylusProperties);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
this.showPrimStylus = function() {
|
|
||||||
if (this.stylus) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!MyAvatar.sessionUUID) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var stylusTipProperties = {
|
|
||||||
localPosition: Vec3.sum({ x: 0, y: WEB_STYLUS_LENGTH - (WEB_TOUCH_SPHERE_RADIUS / 2.0), z: 0 },
|
|
||||||
getGrabPointSphereOffset(this.handToController())),
|
|
||||||
localRotation: { x: 0, y: 0, z: 0, w: 1 },
|
|
||||||
dimensions: WEB_TOUCH_SPHERE_RADIUS,
|
|
||||||
color: WEB_STYLUS_TIP_COLOR,
|
|
||||||
alpha: WEB_STYLUS_ALPHA,
|
|
||||||
solid: true,
|
|
||||||
visible: true,
|
|
||||||
ignoreRayIntersection: true,
|
|
||||||
drawInFront: false,
|
|
||||||
parentID: MyAvatar.sessionUUID,
|
|
||||||
parentJointIndex: MyAvatar.getJointIndex(this.hand === RIGHT_HAND ?
|
|
||||||
"_CAMERA_RELATIVE_CONTROLLER_RIGHTHAND" :
|
|
||||||
"_CAMERA_RELATIVE_CONTROLLER_LEFTHAND")
|
|
||||||
};
|
|
||||||
this.stylusTip = Overlays.addOverlay("sphere", stylusTipProperties);
|
|
||||||
|
|
||||||
var stylusProperties = {
|
|
||||||
localPosition: Vec3.sum({ x: 0.0, y: WEB_STYLUS_LENGTH / 2.0, z: 0.0 },
|
|
||||||
getGrabPointSphereOffset(this.handToController())),
|
|
||||||
localRotation: { x: 0, y: 0, z: 0, w: 1 },
|
|
||||||
dimensions: { x: 0.01, y: WEB_STYLUS_LENGTH + WEB_TOUCH_SPHERE_RADIUS, z: 0.01 },
|
|
||||||
color: WEB_STYLUS_COLOR,
|
|
||||||
alpha: WEB_STYLUS_ALPHA,
|
|
||||||
solid: true,
|
|
||||||
visible: true,
|
|
||||||
ignoreRayIntersection: true,
|
|
||||||
drawInFront: false,
|
|
||||||
parentID: MyAvatar.sessionUUID,
|
|
||||||
parentJointIndex: MyAvatar.getJointIndex(this.hand === RIGHT_HAND ?
|
|
||||||
"_CAMERA_RELATIVE_CONTROLLER_RIGHTHAND" :
|
|
||||||
"_CAMERA_RELATIVE_CONTROLLER_LEFTHAND")
|
|
||||||
};
|
|
||||||
this.stylus = Overlays.addOverlay("cube", stylusProperties);
|
|
||||||
};
|
|
||||||
|
|
||||||
this.showStylus = function() {
|
|
||||||
// return this.showPrimStylus();
|
|
||||||
return this.showModelStylus();
|
|
||||||
};
|
|
||||||
|
|
||||||
this.hideStylus = function() {
|
this.hideStylus = function() {
|
||||||
if (!this.stylus) {
|
if (!this.stylus) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue