Fix gravity for dynamic entities

This commit is contained in:
Zander Otavka 2016-07-25 14:01:57 -07:00
parent c25b87c33f
commit 344ec25bcd

View file

@ -207,7 +207,14 @@ ScrollingWindow {
} else if (url) {
var name = assetProxyModel.data(treeView.selection.currentIndex);
var addPosition = Vec3.sum(MyAvatar.position, Vec3.multiply(2, Quat.getFront(MyAvatar.orientation)));
var gravity = dynamic ? { x: 0, y: -10, z: 0 } : { x: 0, y: 0, z: 0 };
var gravity;
if (dynamic) {
// Create a vector <0, -10, 0>. { x: 0, y: -10, z: 0 } won't work because Qt is dumb and this is a
// different scripting engine from QTScript.
gravity = Vec3.multiply(Vec3.fromPolar(Math.PI / 2, 0), 10);
} else {
gravity = { x: 0, y: 0, z: 0 };
}
print("Asset browser - adding asset " + url + " (" + name + ") to world.");