mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 20:23:06 +02:00
back to ray teleport
This commit is contained in:
parent
f5364f752f
commit
1ef54b2fe6
3 changed files with 28 additions and 20 deletions
|
@ -34,7 +34,7 @@ PickParabola JointParabolaPick::getMathematicalPick() const {
|
||||||
|
|
||||||
// Apply offset
|
// Apply offset
|
||||||
pos = pos + (rot * (myAvatar->getSensorToWorldScale() * _posOffset));
|
pos = pos + (rot * (myAvatar->getSensorToWorldScale() * _posOffset));
|
||||||
glm::vec3 dir = rot * glm::normalize(_dirOffset);
|
glm::vec3 dir = glm::normalize(rot * glm::normalize(_dirOffset));
|
||||||
|
|
||||||
return PickParabola(pos, getSpeed() * dir, getAcceleration());
|
return PickParabola(pos, getSpeed() * dir, getAcceleration());
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ PickRay JointRayPick::getMathematicalPick() const {
|
||||||
|
|
||||||
// Apply offset
|
// Apply offset
|
||||||
pos = pos + (rot * (myAvatar->getSensorToWorldScale() * _posOffset));
|
pos = pos + (rot * (myAvatar->getSensorToWorldScale() * _posOffset));
|
||||||
glm::vec3 dir = rot * glm::normalize(_dirOffset);
|
glm::vec3 dir = glm::normalize(rot * glm::normalize(_dirOffset));
|
||||||
|
|
||||||
return PickRay(pos, dir);
|
return PickRay(pos, dir);
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,19 +61,31 @@ Script.include("/~/system/libraries/controllers.js");
|
||||||
};
|
};
|
||||||
|
|
||||||
var cancelPath = {
|
var cancelPath = {
|
||||||
|
type: "line3d",
|
||||||
color: COLORS_TELEPORT_CANCEL,
|
color: COLORS_TELEPORT_CANCEL,
|
||||||
|
ignorePickIntersection: true,
|
||||||
alpha: 1,
|
alpha: 1,
|
||||||
width: 0.025
|
solid: true,
|
||||||
|
drawInFront: true,
|
||||||
|
glow: 1.0
|
||||||
};
|
};
|
||||||
var teleportPath = {
|
var teleportPath = {
|
||||||
|
type: "line3d",
|
||||||
color: COLORS_TELEPORT_CAN_TELEPORT,
|
color: COLORS_TELEPORT_CAN_TELEPORT,
|
||||||
|
ignorePickIntersection: true,
|
||||||
alpha: 1,
|
alpha: 1,
|
||||||
width: 0.025
|
solid: true,
|
||||||
|
drawInFront: true,
|
||||||
|
glow: 1.0
|
||||||
};
|
};
|
||||||
var seatPath = {
|
var seatPath = {
|
||||||
|
type: "line3d",
|
||||||
color: COLORS_TELEPORT_SEAT,
|
color: COLORS_TELEPORT_SEAT,
|
||||||
|
ignorePickIntersection: true,
|
||||||
alpha: 1,
|
alpha: 1,
|
||||||
width: 0.025
|
solid: true,
|
||||||
|
drawInFront: true,
|
||||||
|
glow: 1.0
|
||||||
};
|
};
|
||||||
var cancelEnd = {
|
var cancelEnd = {
|
||||||
type: "model",
|
type: "model",
|
||||||
|
@ -99,7 +111,7 @@ Script.include("/~/system/libraries/controllers.js");
|
||||||
{name: "teleport", path: teleportPath, end: teleportEnd},
|
{name: "teleport", path: teleportPath, end: teleportEnd},
|
||||||
{name: "seat", path: seatPath, end: seatEnd}];
|
{name: "seat", path: seatPath, end: seatEnd}];
|
||||||
|
|
||||||
var DEFAULT_DISTANCE = 4.0;
|
var DEFAULT_DISTANCE = 50;
|
||||||
var teleportDefaultRenderStates = [{name: "cancel", distance: DEFAULT_DISTANCE, path: cancelPath}];
|
var teleportDefaultRenderStates = [{name: "cancel", distance: DEFAULT_DISTANCE, path: cancelPath}];
|
||||||
|
|
||||||
var coolInTimeout = null;
|
var coolInTimeout = null;
|
||||||
|
@ -139,8 +151,8 @@ Script.include("/~/system/libraries/controllers.js");
|
||||||
return otherModule;
|
return otherModule;
|
||||||
};
|
};
|
||||||
|
|
||||||
this.teleportParabolaHandVisible = Pointers.createPointer(PickType.Parabola, {
|
this.teleportParabolaHandVisible = Pointers.createPointer(PickType.Ray, {
|
||||||
joint: (_this.hand === RIGHT_HAND) ? "RightHand" : "LeftHand",
|
joint: (_this.hand === RIGHT_HAND) ? "_CAMERA_RELATIVE_CONTROLLER_RIGHTHAND" : "_CAMERA_RELATIVE_CONTROLLER_LEFTHAND",
|
||||||
filter: Picks.PICK_ENTITIES,
|
filter: Picks.PICK_ENTITIES,
|
||||||
faceAvatar: true,
|
faceAvatar: true,
|
||||||
scaleWithAvatar: true,
|
scaleWithAvatar: true,
|
||||||
|
@ -149,11 +161,10 @@ Script.include("/~/system/libraries/controllers.js");
|
||||||
accelerationAxis: accelerationAxis,
|
accelerationAxis: accelerationAxis,
|
||||||
rotateAccelerationWithAvatar: true,
|
rotateAccelerationWithAvatar: true,
|
||||||
renderStates: teleportRenderStates,
|
renderStates: teleportRenderStates,
|
||||||
defaultRenderStates: teleportDefaultRenderStates,
|
defaultRenderStates: teleportDefaultRenderStates
|
||||||
maxDistance: 4.0
|
|
||||||
});
|
});
|
||||||
this.teleportParabolaHandInvisible = Pointers.createPointer(PickType.Parabola, {
|
this.teleportParabolaHandInvisible = Pointers.createPointer(PickType.Ray, {
|
||||||
joint: (_this.hand === RIGHT_HAND) ? "RightHand" : "LeftHand",
|
joint: (_this.hand === RIGHT_HAND) ? "_CAMERA_RELATIVE_CONTROLLER_RIGHTHAND" : "_CAMERA_RELATIVE_CONTROLLER_LEFTHAND",
|
||||||
filter: Picks.PICK_ENTITIES | Picks.PICK_INCLUDE_INVISIBLE,
|
filter: Picks.PICK_ENTITIES | Picks.PICK_INCLUDE_INVISIBLE,
|
||||||
faceAvatar: true,
|
faceAvatar: true,
|
||||||
scaleWithAvatar: true,
|
scaleWithAvatar: true,
|
||||||
|
@ -161,10 +172,9 @@ Script.include("/~/system/libraries/controllers.js");
|
||||||
speed: speed,
|
speed: speed,
|
||||||
accelerationAxis: accelerationAxis,
|
accelerationAxis: accelerationAxis,
|
||||||
rotateAccelerationWithAvatar: true,
|
rotateAccelerationWithAvatar: true,
|
||||||
renderStates: teleportRenderStates,
|
renderStates: teleportRenderStates
|
||||||
maxDistance: 4.0
|
|
||||||
});
|
});
|
||||||
this.teleportParabolaHeadVisible = Pointers.createPointer(PickType.Parabola, {
|
this.teleportParabolaHeadVisible = Pointers.createPointer(PickType.Ray, {
|
||||||
joint: "Avatar",
|
joint: "Avatar",
|
||||||
filter: Picks.PICK_ENTITIES,
|
filter: Picks.PICK_ENTITIES,
|
||||||
faceAvatar: true,
|
faceAvatar: true,
|
||||||
|
@ -174,10 +184,9 @@ Script.include("/~/system/libraries/controllers.js");
|
||||||
accelerationAxis: accelerationAxis,
|
accelerationAxis: accelerationAxis,
|
||||||
rotateAccelerationWithAvatar: true,
|
rotateAccelerationWithAvatar: true,
|
||||||
renderStates: teleportRenderStates,
|
renderStates: teleportRenderStates,
|
||||||
defaultRenderStates: teleportDefaultRenderStates,
|
defaultRenderStates: teleportDefaultRenderStates
|
||||||
maxDistance: 4.0
|
|
||||||
});
|
});
|
||||||
this.teleportParabolaHeadInvisible = Pointers.createPointer(PickType.Parabola, {
|
this.teleportParabolaHeadInvisible = Pointers.createPointer(PickType.Ray, {
|
||||||
joint: "Avatar",
|
joint: "Avatar",
|
||||||
filter: Picks.PICK_ENTITIES | Picks.PICK_INCLUDE_INVISIBLE,
|
filter: Picks.PICK_ENTITIES | Picks.PICK_INCLUDE_INVISIBLE,
|
||||||
faceAvatar: true,
|
faceAvatar: true,
|
||||||
|
@ -186,8 +195,7 @@ Script.include("/~/system/libraries/controllers.js");
|
||||||
speed: speed,
|
speed: speed,
|
||||||
accelerationAxis: accelerationAxis,
|
accelerationAxis: accelerationAxis,
|
||||||
rotateAccelerationWithAvatar: true,
|
rotateAccelerationWithAvatar: true,
|
||||||
renderStates: teleportRenderStates,
|
renderStates: teleportRenderStates
|
||||||
maxDistance: 4.0
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.cleanup = function() {
|
this.cleanup = function() {
|
||||||
|
|
Loading…
Reference in a new issue