code cleanup

This commit is contained in:
druiz17 2017-08-31 22:30:30 -07:00
parent 7cf27c18d3
commit 2948061904
7 changed files with 15 additions and 23 deletions

View file

@ -1891,7 +1891,6 @@ QString Application::getUserAgent() {
void Application::toggleTabletUI(bool shouldOpen) const {
auto tabletScriptingInterface = DependencyManager::get<TabletScriptingInterface>();
auto hmd = DependencyManager::get<HMDScriptingInterface>();
qDebug() << "Application::toggleTabletUI" << shouldOpen << hmd->getShouldShowTablet();
if (!(shouldOpen && hmd->getShouldShowTablet())) {
auto HMD = DependencyManager::get<HMDScriptingInterface>();
HMD->toggleShouldShowTablet();

View file

@ -10,7 +10,7 @@
getControllerJointIndex, NULL_UUID, enableDispatcherModule, disableDispatcherModule,
Messages, makeDispatcherModuleParameters, makeRunningValues, Settings, entityHasActions,
Vec3, Overlays, flatten, Xform, getControllerWorldLocation, ensureDynamic, entityIsCloneable,
cloneEntity
cloneEntity, DISPATCHER_PROPERTIES
*/
Script.include("/~/system/libraries/Xform.js");

View file

@ -10,7 +10,7 @@
getControllerJointIndex, NULL_UUID, enableDispatcherModule, disableDispatcherModule,
propsArePhysical, Messages, HAPTIC_PULSE_STRENGTH, HAPTIC_PULSE_DURATION, TRIGGER_OFF_VALUE,
makeDispatcherModuleParameters, entityIsGrabbable, makeRunningValues, NEAR_GRAB_RADIUS,
findGroupParent, Vec3
findGroupParent, Vec3, cloneEntity, entityIsCloneable
*/
Script.include("/~/system/controllers/controllerDispatcherUtils.js");
@ -46,19 +46,20 @@ Script.include("/~/system/libraries/cloneEntityUtils.js");
}
var handJointIndex = MyAvatar.getJointIndex(this.hand === RIGHT_HAND ? "RightHand" : "LeftHand");
if (props.parentJointIndex == handJointIndex) {
if (props.parentJointIndex === handJointIndex) {
return true;
}
var controllerJointIndex = this.controllerJointIndex;
if (props.parentJointIndex == controllerJointIndex) {
if (props.parentJointIndex === controllerJointIndex) {
return true;
}
var controllerCRJointIndex = MyAvatar.getJointIndex(this.hand === RIGHT_HAND ?
"_CAMERA_RELATIVE_CONTROLLER_RIGHTHAND" :
"_CAMERA_RELATIVE_CONTROLLER_LEFTHAND");
if (props.parentJointIndex == controllerCRJointIndex) {
"_CAMERA_RELATIVE_CONTROLLER_RIGHTHAND" :
"_CAMERA_RELATIVE_CONTROLLER_LEFTHAND");
if (props.parentJointIndex === controllerCRJointIndex) {
return true;
}
@ -172,7 +173,7 @@ Script.include("/~/system/libraries/cloneEntityUtils.js");
this.run = function (controllerData, deltaTime) {
if (this.grabbing) {
if (controllerData.triggerClicks[this.hand] == 0) {
if (controllerData.triggerClicks[this.hand] === 0) {
this.endNearParentingGrabEntity();
return makeRunningValues(false, [], []);
}
@ -185,7 +186,7 @@ Script.include("/~/system/libraries/cloneEntityUtils.js");
if (!readiness.active) {
return readiness;
}
if (controllerData.triggerClicks[this.hand] == 1) {
if (controllerData.triggerClicks[this.hand] === 1) {
// switch to grab
var targetProps = this.getTargetProps(controllerData);
var targetCloneable = entityIsCloneable(targetProps);
@ -196,9 +197,9 @@ Script.include("/~/system/libraries/cloneEntityUtils.js");
var cloneProps = Entities.getEntityProperties(cloneID);
this.grabbing = true;
this.targetEntityID = cloneID
this.targetEntityID = cloneID;
this.startNearParentingGrabEntity(controllerData, cloneProps);
} else if (targetProps) {
this.grabbing = true;
this.startNearParentingGrabEntity(controllerData, targetProps);

View file

@ -84,7 +84,7 @@ Script.include("/~/system/controllers/controllerDispatcherUtils.js");
};
this.run = function (controllerData) {
if (controllerData.triggerClicks[this.hand] == 0) {
if (controllerData.triggerClicks[this.hand] === 0) {
this.endNearTrigger(controllerData);
return makeRunningValues(false, [], []);
}

View file

@ -10,7 +10,8 @@
Messages, Quat, Vec3, getControllerWorldLocation, makeDispatcherModuleParameters, Overlays, ZERO_VEC,
AVATAR_SELF_ID, HMD, INCHES_TO_METERS, DEFAULT_REGISTRATION_POINT, Settings, getGrabPointSphereOffset,
COLORS_GRAB_SEARCHING_HALF_SQUEEZE, COLORS_GRAB_SEARCHING_FULL_SQUEEZE, COLORS_GRAB_DISTANCE_HOLD,
DEFAULT_SEARCH_SPHERE_DISTANCE, TRIGGER_ON_VALUE, TRIGGER_OFF_VALUE, getEnabledModuleByName, PICK_MAX_DISTANCE
DEFAULT_SEARCH_SPHERE_DISTANCE, TRIGGER_ON_VALUE, TRIGGER_OFF_VALUE, getEnabledModuleByName, PICK_MAX_DISTANCE,
DISPATCHER_PROPERTIES
*/
Script.include("/~/system/controllers/controllerDispatcherUtils.js");

View file

@ -21,8 +21,6 @@
(function() { // BEGIN LOCAL_SCOPE
Script.include("/~/system/libraries/utils.js");
Script.include("/~/system/controllers/controllerDispatcherUtils.js");
Script.include("/~/system/libraries/controllers.js");
var MAX_SOLID_ANGLE = 0.01; // objects that appear smaller than this can't be grabbed
var DELAY_FOR_30HZ = 33; // milliseconds
@ -253,12 +251,6 @@ function Grabber() {
z: 0
};
this.paramters = makeDispatcherModuleParameters(
300,
"mouse",
[],
100);
this.targetPosition = null;
this.targetRotation = null;

View file

@ -639,7 +639,6 @@ function update() {
// If there's a HUD element at the (newly moved) reticle, just make it visible and bail.
if (isPointingAtOverlay(hudPoint2d) && isPointerEnabled) {
//print("--------> pointing at HUD <--------");
if (HMD.active) {
Reticle.depth = hudReticleDistance();