mirror of
https://github.com/overte-org/overte.git
synced 2025-07-23 07:04:00 +02:00
use correct capsule dimensions in teleport.js
This commit is contained in:
parent
6ecf850159
commit
b38c263e60
1 changed files with 9 additions and 9 deletions
|
@ -358,9 +358,9 @@ Script.include("/~/system/libraries/controllers.js");
|
||||||
|
|
||||||
var sensorToWorldScale = MyAvatar.getSensorToWorldScale();
|
var sensorToWorldScale = MyAvatar.getSensorToWorldScale();
|
||||||
|
|
||||||
var radius = capsuleData.radius / sensorToWorldScale;
|
var diameter = 2.0 * capsuleData.radius / sensorToWorldScale;
|
||||||
var height = (Vec3.distance(capsuleData.start, capsuleData.end) + (capsuleData.radius * 2.0)) / sensorToWorldScale;
|
var height = (Vec3.distance(capsuleData.start, capsuleData.end) + diameter) / sensorToWorldScale;
|
||||||
var capsuleRatio = 10.0 * radius / height;
|
var capsuleRatio = 5.0 * diameter / height;
|
||||||
var offset = _this.pickHeightOffset * capsuleRatio;
|
var offset = _this.pickHeightOffset * capsuleRatio;
|
||||||
|
|
||||||
_this.teleportHandCollisionPick = Picks.createPick(PickType.Collision, {
|
_this.teleportHandCollisionPick = Picks.createPick(PickType.Collision, {
|
||||||
|
@ -370,9 +370,9 @@ Script.include("/~/system/libraries/controllers.js");
|
||||||
shape: {
|
shape: {
|
||||||
shapeType: "capsule-y",
|
shapeType: "capsule-y",
|
||||||
dimensions: {
|
dimensions: {
|
||||||
x: radius * 2.0,
|
x: diameter,
|
||||||
y: height - (radius * 2.0),
|
y: height,
|
||||||
z: radius * 2.0
|
z: diameter
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
position: { x: 0, y: offset + height * 0.5, z: 0 },
|
position: { x: 0, y: offset + height * 0.5, z: 0 },
|
||||||
|
@ -386,9 +386,9 @@ Script.include("/~/system/libraries/controllers.js");
|
||||||
shape: {
|
shape: {
|
||||||
shapeType: "capsule-y",
|
shapeType: "capsule-y",
|
||||||
dimensions: {
|
dimensions: {
|
||||||
x: radius * 2.0,
|
x: diameter,
|
||||||
y: height - (radius * 2.0),
|
y: height,
|
||||||
z: radius * 2.0
|
z: diameter
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
position: { x: 0, y: offset + height * 0.5, z: 0 },
|
position: { x: 0, y: offset + height * 0.5, z: 0 },
|
||||||
|
|
Loading…
Reference in a new issue