diff --git a/scripts/vr-edit/modules/selection.js b/scripts/vr-edit/modules/selection.js index 935841698f..1682ce0bbc 100644 --- a/scripts/vr-edit/modules/selection.js +++ b/scripts/vr-edit/modules/selection.js @@ -415,6 +415,15 @@ Selection = function (side) { } function applyPhysics(physicsProperties) { + // TODO: For development testing, apply physics to the currently intersected entity. + var properties; + + properties = Object.clone(physicsProperties); + properties.userData = updatePhysicsUserData(selection[intersectedEntityIndex].userData, physicsProperties.userData); + Entities.editEntity(selection[intersectedEntityIndex].id, properties); + + // TODO: Original functionality applied physics to all entities in the selection. + /* // Applies physics to the current selection (i.e., the selection made when entity was trigger-clicked to apply physics). var properties, i, @@ -434,6 +443,7 @@ Selection = function (side) { Entities.editEntity(selection[0].id, { velocity: DYNAMIC_VELOCITY_KICK }); } } + */ } function clear() { diff --git a/scripts/vr-edit/vr-edit.js b/scripts/vr-edit/vr-edit.js index ca2d429ab5..c10bb748f7 100644 --- a/scripts/vr-edit/vr-edit.js +++ b/scripts/vr-edit/vr-edit.js @@ -851,7 +851,6 @@ function update() { var previousState = editorState, doUpdateState, - doRefreshSelection, color; intersection = getIntersection(); @@ -953,6 +952,12 @@ intersectedEntityID = intersection.entityID; doUpdateState = true; } + // TODO: For development testing, update intersectedEntityID so that physics can be applied to it. + if ((toolSelected === TOOL_COLOR || toolSelected === TOOL_PHYSICS) + && intersection.entityID !== intersectedEntityID) { + intersectedEntityID = intersection.entityID; + doUpdateState = true; + } if (doUpdateState) { updateState(); }