Skip to content
This repository was archived by the owner on Jan 7, 2023. It is now read-only.

Commit a87c8de

Browse files
committed
Sync gesture: index.html -> indexaframe.html
1 parent 0f65f51 commit a87c8de

File tree

2 files changed

+151
-110
lines changed

2 files changed

+151
-110
lines changed

gesture/index.html

+10-9
Original file line numberDiff line numberDiff line change
@@ -509,11 +509,11 @@
509509
(boxes[3].constraints.length & 1) != 0)
510510
console.error("expected even number of constraints");
511511
physics.stepSimulation(time_delta, 10);
512-
addConnectionsForContacts();
513512
for (let i = 1; i < boxes.length; i++)
514513
btToScene(boxes[i]);
515514
for (let i = 0; i < SPOOL_OFFSET; i++)
516515
btToScene(spheres[i]);
516+
addConnectionsForContacts();
517517
}
518518

519519
const tip = new glMatrix.ARRAY_TYPE(3);
@@ -659,7 +659,7 @@
659659
sp.contact = force || (((segment.far_left.distance2D | 0) +
660660
(segment.far_right.distance2D | 0) > 4) &&
661661
(segment.count_left + segment.count_right > 8));
662-
sp.segment_id = segment.index;
662+
sp.segment_id = segment.index; // debugging purpose only.
663663
sp.frameid = frameid;
664664
sp.buffer = buffer;
665665
}
@@ -866,6 +866,7 @@
866866
return false;
867867
return buffer[key + "_square"] < 0.01;
868868
}
869+
869870
for (let k = 0; k < keys.length; k++) {
870871
const buffer = getSegBuffer(k);
871872
// We need another sub-step here: check the distances and accept
@@ -875,11 +876,11 @@
875876
// assign the sphere.
876877
if (buffer.endpoint_tip && buffer.sp1 &&
877878
bothHoldsValidAssignment("sp1", buffer)) {
878-
assignContactSphereToSegmentEndPoint(buffer, "sp1", buffer.sp1.segment);
879+
assignContactSphereToSegmentEndPoint(buffer, "sp1", buffer.sp1.segment, true);
879880
}
880881
if (buffer.endpoint_base && buffer.sp2 &&
881882
bothHoldsValidAssignment("sp2", buffer)) {
882-
assignContactSphereToSegmentEndPoint(buffer, "sp2", buffer.sp2.segment);
883+
assignContactSphereToSegmentEndPoint(buffer, "sp2", buffer.sp2.segment, true);
883884
}
884885
}
885886

@@ -1007,8 +1008,8 @@
10071008
// object, but different finger balls.
10081009
function canManifoldsHoldTheObject(con1, m2, ob, joint, finger) {
10091010
const m1 = con1.manifold;
1010-
let p1 = m1.getContactPoint(0);
1011-
let p2 = m2.getContactPoint(0);
1011+
const p1 = m1.getContactPoint(0);
1012+
const p2 = m2.getContactPoint(0);
10121013

10131014
// First, let's not allow picking objects from the lower side - to
10141015
// prevent this happening when carrying objects.
@@ -1026,9 +1027,9 @@
10261027
// As these are the boxes, holding if pBs are in the same.
10271028
// object to hold is a box, so simplify this so that we hold it on
10281029
// opposite sides of the box.
1029-
let xdiff = Math.abs(pA1.x() - pA2.x());
1030-
let ydiff = Math.abs(pA1.y() - pA2.y());
1031-
let zdiff = Math.abs(pA1.z() - pA2.z());
1030+
const xdiff = Math.abs(pA1.x() - pA2.x());
1031+
const ydiff = Math.abs(pA1.y() - pA2.y());
1032+
const zdiff = Math.abs(pA1.z() - pA2.z());
10321033
if (!(xdiff > 0.9 * ob.scale[0] || ydiff > 0.9 * ob.scale[1] ||
10331034
zdiff > 0.9 * ob.scale[2]))
10341035
return false;

0 commit comments

Comments
 (0)