feedback re magic numbers and variable name.

This commit is contained in:
howard-stearns 2016-06-22 16:40:10 -07:00
parent 67f76db7e4
commit 581d87d653
3 changed files with 10 additions and 8 deletions

View file

@ -420,8 +420,9 @@ bool HmdDisplayPlugin::setHandLaser(uint32_t hands, HandLaserMode mode, const ve
}
void HmdDisplayPlugin::compositeExtra() {
std::array<HandLaserInfo, 2> handLasers;
std::array<mat4, 2> renderHandPoses;
const int NUMBER_OF_HANDS = 2;
std::array<HandLaserInfo, NUMBER_OF_HANDS> handLasers;
std::array<mat4, NUMBER_OF_HANDS> renderHandPoses;
Transform uiModelTransform;
withPresentThreadLock([&] {
handLasers = _handLasers;
@ -443,9 +444,9 @@ void HmdDisplayPlugin::compositeExtra() {
using namespace oglplus;
useProgram(_laserProgram);
_laserGeometry->Use();
std::array<mat4, 2> handLaserModelMatrices;
std::array<mat4, NUMBER_OF_HANDS> handLaserModelMatrices;
for (int i = 0; i < 2; ++i) {
for (int i = 0; i < NUMBER_OF_HANDS; ++i) {
if (renderHandPoses[i] == identity) {
continue;
}
@ -485,7 +486,7 @@ void HmdDisplayPlugin::compositeExtra() {
auto eyePose = _currentPresentFrameInfo.presentPose * getEyeToHeadTransform(eye);
auto view = glm::inverse(eyePose);
const auto& projection = _eyeProjections[eye];
for (int i = 0; i < 2; ++i) {
for (int i = 0; i < NUMBER_OF_HANDS; ++i) {
if (handLaserModelMatrices[i] == identity) {
continue;
}

View file

@ -194,7 +194,8 @@ void enableOpenVrKeyboard(PluginContainer* container) {
_overlayMenuConnection = QObject::connect(action, &QAction::triggered, [action] {
if (action->isChecked()) {
_overlayRevealed = true;
QTimer::singleShot(100, [&] { _overlayRevealed = false; });
const int KEYBOARD_DELAY_MS = 100;
QTimer::singleShot(KEYBOARD_DELAY_MS, [&] { _overlayRevealed = false; });
}
});

View file

@ -877,8 +877,8 @@ function MyController(hand) {
// find entities near the avatar that might be equipable.
var entities = Entities.findEntities(MyAvatar.position, HOTSPOT_DRAW_DISTANCE);
var i, l = entities.length;
for (i = 0; i < l; i++) {
var i, length = entities.length;
for (i = 0; i < length; i++) {
var grabProps = Entities.getEntityProperties(entities[i], GRABBABLE_PROPERTIES);
// does this entity have an attach point?
var wearableData = getEntityCustomData("wearable", entities[i], undefined);