airhockey -- drop from slightly lower so paddle doesn't flip over. update grab script with new table name

This commit is contained in:
Seth Alves 2015-05-18 12:18:27 -07:00
parent 6d9db21d88
commit e2a39b4597
2 changed files with 4 additions and 3 deletions

View file

@ -17,7 +17,7 @@ var FIELD_LENGTH = 1.92;
var FLOOR_THICKNESS = 0.20;
var EDGE_THICKESS = 0.10;
var EDGE_HEIGHT = 0.10;
var DROP_HEIGHT = 0.3;
var DROP_HEIGHT = 0.25;
var PUCK_SIZE = 0.15;
var PUCK_THICKNESS = 0.05;
var PADDLE_SIZE = 0.15;
@ -72,7 +72,7 @@ var floorFriction = 0.01;
var paddle1Pos, paddle2Pos;
// use some names that wont collide with other content
var names = ["air-hockey-table-23j4h1jh82jsjfw91jf232n2k",
var names = ["air-hockey-table-23j4h1jh82jsjfw91jf232n2k", // keep this synchronized with what's in grabHockey.js
"air-hockey-paddle-23j4h1jh82jsjfw91jf232n2k",
"air-hockey-puck-23j4h1jh82jsjfw91jf232n2k",
"air-hockey-light-23j4h1jh82jsjfw91jf232n2k"];

View file

@ -144,7 +144,8 @@ function mousePressEvent(event) {
var potentialTables = Entities.findEntities(MyAvatar.position, TABLE_SEARCH_RANGE);
potentialTables.forEach(function(table) {
var props = Entities.getEntityProperties(table);
if (props.name === "table") {
// keep this name synchronized with what's in airHockey.js
if (props.name === "air-hockey-table-23j4h1jh82jsjfw91jf232n2k") {
var tablePosition = props.position;
// when we know the table's position we can compute the X-Z bounds of its field
fieldMax = Vec3.sum(tablePosition, fieldMaxOffset);