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
3 var GRID_WORLD_SIZE = 100.0;3 var GRID_WORLD_SIZE = 100.0;
4 var GRID_WORLD_MARGIN = 5.0;4 var GRID_WORLD_MARGIN = 5.0;
5 var GRID_WORLD_RESOLUTION = 30.0;5 var GRID_WORLD_RESOLUTION = 30.0;
6 var GRID_WORLD_DROP_HEIGHT = 5.0;6 var GRID_WORLD_DROP_HEIGHT = 4.0;
7 7
8 var GRID_SIZE = GRID_WORLD_RESOLUTION;8 var GRID_SIZE = GRID_WORLD_RESOLUTION;
9 var GRID_HALFSIZE = GRID_SIZE *0.5;9 var GRID_HALFSIZE = GRID_SIZE *0.5;
@@ -34,6 +34,7 @@ · 24 unmodified lines
34 }34 }
35 35
36 var OBJECT_DIM = { x: 0.5, y: 0.5, z: 0.5};36 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};
37 var OBJECT_SPIN = { x: 0.5, y: 0.5, z: 0.5};38 var OBJECT_SPIN = { x: 0.5, y: 0.5, z: 0.5};
38 39
39var shapeTypes = [40var shapeTypes = [
@@ -53,29 +54,49 @@ function getTileColor(a, b, c) { · 13 unmodified lines
53}54}
54 55
55function addObject(a, b, c, lifetime) {56function addObject(a, b, c, lifetime) {
56 var center = getStagePosOriAt(a, b, c).pos; 57 var center = getStagePosOriAt(a, b, c).pos;
57 58 var offset = (Math.abs(a) + (Math.abs(b) % 2)) % 2;
58 59 var makePrim = (offset > 0 ? true : false) ;
59 60 if (makePrim) {
60 return (Entities.addEntity({61 return (Entities.addEntity({
61 type: "Shape",62 type: "Shape",
62 shape: "Sphere",63 shape: "Sphere",
63 name: "Backdrop",64 name: "object-" + a + b + c,
64 color: getTileColor(a, b, c),65 color: getTileColor(a, b, c),
65 position: center, 66 position: center,
66 rotation: stageOrientation, 67 rotation: stageOrientation,
67 dimensions: OBJECT_DIM,68 dimensions: OBJECT_DIM,
68 lifetime: (lifetime === undefined) ? DEFAULT_LIFETIME : lifetime,69 lifetime: (lifetime === undefined) ? DEFAULT_LIFETIME : lifetime,
69 shapeType:shapeTypes[2],70 shapeType:shapeTypes[2],
70 dynamic: true,71 dynamic: true,
71 gravity:{"x":0,"y":-9.8,"z":0},72 gravity:{"x":0,"y":-9.8,"z":0},
72 velocity:{"x":0,"y":0.02,"z":0},73 velocity:{"x":0,"y":0.02,"z":0},
73 angularVelocity:OBJECT_SPIN,74 angularVelocity:OBJECT_SPIN,
74 restitution:0.70,75 restitution:0.70,
75 friction:0.01,76 friction:0.01,
76 damping:0.001,77 damping:0.001,
77 78
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 }
79}100}
80 101
81function addObjectGrid(backdrop, lifetime) {102function 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