Showing the changes to scripts/developer (1 of 1 file). Show all
Unified · Split
| @@ -102,16 +102,16 @@ · 101 unmodified lines | ||
| 102 | 102 | var success = Clipboard.importEntities(PHOTOBOOTH_SETUP_JSON_URL); |
| 103 | 103 | var frontFactor = 10; |
| 104 | 104 | // getForward is preffered as getFront function is deprecated |
| 105 | − var frontUnitVec = (typeof Quat.getForward === "undefined") ? Vec3.normalize(Quat.getFront(MyAvatar.orientation)) : Vec3.normalize(Quat.getForward(MyAvatar.orientation)); | |
| 105 | + var frontUnitVec = Vec3.normalize(Quat.getFront(MyAvatar.orientation)); | |
| 106 | 106 | var frontOffset = Vec3.multiply(frontUnitVec,frontFactor); |
| 107 | − var rightFactor = 3; | |
| 108 | − var rightUnitVec = Vec3.normalize(Quat.getRight(MyAvatar.orientation)); | |
| 109 | − var rightOffset = Vec3.multiply(rightUnitVec,rightFactor); | |
| 110 | − var spawnLocation = Vec3.sum(Vec3.sum(MyAvatar.position,frontOffset),rightOffset); | |
| 107 | + var upFactor = 3; | |
| 108 | + var upUnitVec = Vec3.normalize(Quat.getUp(MyAvatar.orientation)); | |
| 109 | + var upOffset = Vec3.multiply(upUnitVec, upFactor); | |
| 110 | + var spawnLocation = Vec3.sum(MyAvatar.position,frontOffset); | |
| 111 | + spawnLocation = Vec3.sum(spawnLocation, upOffset); | |
| 111 | 112 | if (success) { |
| 112 | 113 | this.pastedEntityIDs = Clipboard.pasteEntities(spawnLocation); |
| 113 | 114 | this.processPastedEntities(); |
| 114 | − | |
| 115 | 115 | } |
| 116 | 116 | }; |
| 117 | 117 | |