History

Adjusting the regulators and moving task to use chrono nad interesting tests

Sam Gateau committed 8 years ago

Commit 97934fe1 parent 99a0e426 files · +62 −33Browse files

Showing the changes to scripts/developer (1 of 6 files). Show all

Unified · Split

scripts/developer/utilities/workload/test_physics_scene.js+45−24
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 var GRID_WORLD_SIZE = 100.0;
44 var GRID_WORLD_MARGIN = 5.0;
55 var GRID_WORLD_RESOLUTION = 30.0;
6− var GRID_WORLD_DROP_HEIGHT = 5.0;
6+ var GRID_WORLD_DROP_HEIGHT = 4.0;
77
88 var GRID_SIZE = GRID_WORLD_RESOLUTION;
99 var GRID_HALFSIZE = GRID_SIZE *0.5;
@@ -34,6 +34,7 @@ · 24 unmodified lines
3434 }
3535
3636 var OBJECT_DIM = { x: 0.5, y: 0.5, z: 0.5};
37+ var CONE_DIM = { x: 0.3104, y: 0.3336, z: 0.3104};
3738 var OBJECT_SPIN = { x: 0.5, y: 0.5, z: 0.5};
3839
3940 var shapeTypes = [
@@ -53,29 +54,49 @@ function getTileColor(a, b, c) { · 13 unmodified lines
5354 }
5455
5556 function addObject(a, b, c, lifetime) {
56− var center = getStagePosOriAt(a, b, c).pos;
57−
58−
59−
60− return (Entities.addEntity({
61− type: "Shape",
62− shape: "Sphere",
63− name: "Backdrop",
64− color: getTileColor(a, b, c),
65− position: center,
66− rotation: stageOrientation,
67− dimensions: OBJECT_DIM,
68− lifetime: (lifetime === undefined) ? DEFAULT_LIFETIME : lifetime,
69− shapeType:shapeTypes[2],
70− dynamic: true,
71− gravity:{"x":0,"y":-9.8,"z":0},
72− velocity:{"x":0,"y":0.02,"z":0},
73− angularVelocity:OBJECT_SPIN,
74− restitution:0.70,
75− friction:0.01,
76− damping:0.001,
77−
78− }));
57+ var center = getStagePosOriAt(a, b, c).pos;
58+ var offset = (Math.abs(a) + (Math.abs(b) % 2)) % 2;
59+ var makePrim = (offset > 0 ? true : false) ;
60+ if (makePrim) {
61+ return (Entities.addEntity({
62+ type: "Shape",
63+ shape: "Sphere",
64+ name: "object-" + a + b + c,
65+ color: getTileColor(a, b, c),
66+ position: center,
67+ rotation: stageOrientation,
68+ dimensions: OBJECT_DIM,
69+ lifetime: (lifetime === undefined) ? DEFAULT_LIFETIME : lifetime,
70+ shapeType:shapeTypes[2],
71+ dynamic: true,
72+ gravity:{"x":0,"y":-9.8,"z":0},
73+ velocity:{"x":0,"y":0.02,"z":0},
74+ angularVelocity:OBJECT_SPIN,
75+ restitution:0.70,
76+ friction:0.01,
77+ damping:0.001,
78+
79+ }));
80+ } else {
81+ return (Entities.addEntity({
82+ type: "Model",
83+ name: "object-" + a + b + c,
84+ position: center,
85+ rotation: stageOrientation,
86+ dimensions: OBJECT_DIM,
87+ lifetime: (lifetime === undefined) ? DEFAULT_LIFETIME : lifetime,
88+ modelURL: "https://hifi-content.s3.amazonaws.com/jimi/props/cones/trafficCone.fbx",
89+ shapeType:shapeTypes[4],
90+ dynamic: true,
91+ gravity:{"x":0,"y":-9.8,"z":0},
92+ velocity:{"x":0,"y":0.02,"z":0},
93+ angularVelocity:OBJECT_SPIN,
94+ restitution:0.70,
95+ friction:0.01,
96+ damping:0.01,
97+
98+ }));
99+ }
79100 }
80101
81102 function addObjectGrid(backdrop, lifetime) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t