fixes per code review

This commit is contained in:
Philip Rosedale 2016-04-11 10:46:22 -07:00
parent 61f4009b22
commit aab93d8a26

View file

@ -1,7 +1,7 @@
// //
// golfClub.js // golfClub.js
// //
// Created by Philip Rosedale on 11/11/15. // Created by Philip Rosedale on April 11, 2016.
// Copyright 2015 High Fidelity, Inc. // Copyright 2015 High Fidelity, Inc.
// //
// //
@ -46,7 +46,7 @@ function triggerPulled(hand) {
function ballPosition(ball) { function ballPosition(ball) {
// return the position of this entity // return the position of this entity
var properties = Entities.getEntityProperties(ball); var properties = Entities.getEntityProperties(ball, ['position']);
if (!properties) { if (!properties) {
return null; return null;
} else { } else {
@ -82,7 +82,7 @@ function avatarHalfHeight() {
function brakeBall(ball) { function brakeBall(ball) {
// Check the ball's velocity and slow it down if beyond a threshold // Check the ball's velocity and slow it down if beyond a threshold
var properties = Entities.getEntityProperties(ball); var properties = Entities.getEntityProperties(ball, ['velocity']);
if (properties) { if (properties) {
var velocity = Vec3.length(properties.velocity); var velocity = Vec3.length(properties.velocity);
if ((velocity > 0) && (velocity < MAX_BRAKING_SPEED)) { if ((velocity > 0) && (velocity < MAX_BRAKING_SPEED)) {