mirror of
https://github.com/overte-org/overte.git
synced 2025-07-13 16:59:38 +02:00
For development testing, apply physics to the entity intersected
This commit is contained in:
parent
a5407398e7
commit
bc00bcd02c
2 changed files with 16 additions and 1 deletions
|
@ -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() {
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue