mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 11:48:09 +02:00
Merge pull request #4887 from PhilipRosedale/hockeygame
remove line pointers from grab and hockey grab
This commit is contained in:
commit
de8d06acf6
2 changed files with 2 additions and 33 deletions
|
@ -13,7 +13,6 @@
|
||||||
|
|
||||||
var isGrabbing = false;
|
var isGrabbing = false;
|
||||||
var grabbedEntity = null;
|
var grabbedEntity = null;
|
||||||
var lineEntityID = null;
|
|
||||||
var prevMouse = {};
|
var prevMouse = {};
|
||||||
var deltaMouse = {
|
var deltaMouse = {
|
||||||
z: 0
|
z: 0
|
||||||
|
@ -39,9 +38,9 @@ var angularVelocity = {
|
||||||
|
|
||||||
var grabSound = SoundCache.getSound("https://hifi-public.s3.amazonaws.com/eric/sounds/CloseClamp.wav");
|
var grabSound = SoundCache.getSound("https://hifi-public.s3.amazonaws.com/eric/sounds/CloseClamp.wav");
|
||||||
var releaseSound = SoundCache.getSound("https://hifi-public.s3.amazonaws.com/eric/sounds/ReleaseClamp.wav");
|
var releaseSound = SoundCache.getSound("https://hifi-public.s3.amazonaws.com/eric/sounds/ReleaseClamp.wav");
|
||||||
var VOLUME = 0.10;
|
var VOLUME = 0.0;
|
||||||
|
|
||||||
var DROP_DISTANCE = 5.0;
|
var DROP_DISTANCE = 0.10;
|
||||||
var DROP_COLOR = {
|
var DROP_COLOR = {
|
||||||
red: 200,
|
red: 200,
|
||||||
green: 200,
|
green: 200,
|
||||||
|
@ -92,14 +91,6 @@ function mousePressEvent(event) {
|
||||||
gravity: {x: 0, y: 0, z: 0}
|
gravity: {x: 0, y: 0, z: 0}
|
||||||
});
|
});
|
||||||
|
|
||||||
lineEntityID = Entities.addEntity({
|
|
||||||
type: "Line",
|
|
||||||
position: nearLinePoint(targetPosition),
|
|
||||||
dimensions: Vec3.subtract(targetPosition, nearLinePoint(targetPosition)),
|
|
||||||
color: { red: 255, green: 255, blue: 255 },
|
|
||||||
lifetime: 300 // if someone crashes while moving something, don't leave the line there forever.
|
|
||||||
});
|
|
||||||
|
|
||||||
Audio.playSound(grabSound, {
|
Audio.playSound(grabSound, {
|
||||||
position: props.position,
|
position: props.position,
|
||||||
volume: VOLUME
|
volume: VOLUME
|
||||||
|
@ -145,8 +136,6 @@ function mouseReleaseEvent() {
|
||||||
});
|
});
|
||||||
targetPosition = null;
|
targetPosition = null;
|
||||||
|
|
||||||
Entities.deleteEntity(lineEntityID);
|
|
||||||
|
|
||||||
Audio.playSound(releaseSound, {
|
Audio.playSound(releaseSound, {
|
||||||
position: entityProps.position,
|
position: entityProps.position,
|
||||||
volume: VOLUME
|
volume: VOLUME
|
||||||
|
@ -193,10 +182,6 @@ function mouseMoveEvent(event) {
|
||||||
angularVelocity = Vec3.multiply((theta / dT), axisAngle);
|
angularVelocity = Vec3.multiply((theta / dT), axisAngle);
|
||||||
}
|
}
|
||||||
|
|
||||||
Entities.editEntity(lineEntityID, {
|
|
||||||
position: nearLinePoint(targetPosition),
|
|
||||||
dimensions: Vec3.subtract(targetPosition, nearLinePoint(targetPosition))
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
prevMouse.x = event.x;
|
prevMouse.x = event.x;
|
||||||
prevMouse.y = event.y;
|
prevMouse.y = event.y;
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
|
|
||||||
var isGrabbing = false;
|
var isGrabbing = false;
|
||||||
var grabbedEntity = null;
|
var grabbedEntity = null;
|
||||||
var lineEntityID = null;
|
|
||||||
var prevMouse = {};
|
var prevMouse = {};
|
||||||
var deltaMouse = {
|
var deltaMouse = {
|
||||||
z: 0
|
z: 0
|
||||||
|
@ -91,14 +90,6 @@ function mousePressEvent(event) {
|
||||||
gravity: {x: 0, y: 0, z: 0}
|
gravity: {x: 0, y: 0, z: 0}
|
||||||
});
|
});
|
||||||
|
|
||||||
lineEntityID = Entities.addEntity({
|
|
||||||
type: "Line",
|
|
||||||
position: nearLinePoint(targetPosition),
|
|
||||||
dimensions: Vec3.subtract(targetPosition, nearLinePoint(targetPosition)),
|
|
||||||
color: { red: 255, green: 255, blue: 255 },
|
|
||||||
lifetime: 300 // if someone crashes while moving something, don't leave the line there forever.
|
|
||||||
});
|
|
||||||
|
|
||||||
Audio.playSound(grabSound, {
|
Audio.playSound(grabSound, {
|
||||||
position: props.position,
|
position: props.position,
|
||||||
volume: 0.4
|
volume: 0.4
|
||||||
|
@ -144,8 +135,6 @@ function mouseReleaseEvent() {
|
||||||
});
|
});
|
||||||
targetPosition = null;
|
targetPosition = null;
|
||||||
|
|
||||||
Entities.deleteEntity(lineEntityID);
|
|
||||||
|
|
||||||
Audio.playSound(grabSound, {
|
Audio.playSound(grabSound, {
|
||||||
position: entityProps.position,
|
position: entityProps.position,
|
||||||
volume: 0.25
|
volume: 0.25
|
||||||
|
@ -191,11 +180,6 @@ function mouseMoveEvent(event) {
|
||||||
axisAngle = Quat.axis(dQ);
|
axisAngle = Quat.axis(dQ);
|
||||||
angularVelocity = Vec3.multiply((theta / dT), axisAngle);
|
angularVelocity = Vec3.multiply((theta / dT), axisAngle);
|
||||||
}
|
}
|
||||||
|
|
||||||
Entities.editEntity(lineEntityID, {
|
|
||||||
position: nearLinePoint(targetPosition),
|
|
||||||
dimensions: Vec3.subtract(targetPosition, nearLinePoint(targetPosition))
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
prevMouse.x = event.x;
|
prevMouse.x = event.x;
|
||||||
prevMouse.y = event.y;
|
prevMouse.y = event.y;
|
||||||
|
|
Loading…
Reference in a new issue