Skip to content

Commit

Permalink
build v1.0.0-beta.17
Browse files Browse the repository at this point in the history
  • Loading branch information
shakiba committed Dec 25, 2023
1 parent 1bbdadc commit 4de71d9
Show file tree
Hide file tree
Showing 18 changed files with 383 additions and 243 deletions.
142 changes: 84 additions & 58 deletions dist/planck-with-testbed.d.ts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/planck-with-testbed.d.ts.map

Large diffs are not rendered by default.

78 changes: 50 additions & 28 deletions dist/planck-with-testbed.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Planck.js v1.0.0-beta.16
* Planck.js v1.0.0-beta.17
* @license The MIT license
* @copyright Copyright (c) 2021 Erin Catto, Ali Shakiba
*
Expand Down Expand Up @@ -2311,6 +2311,11 @@
out.y = am * a.y + bm * b.y;
return out;
}
function combine3Vec2(out, am, a, bm, b, cm, c) {
out.x = am * a.x + bm * b.x + cm * c.x;
out.y = am * a.y + bm * b.y + cm * c.y;
return out;
}
function normalizeVec2Length(out) {
var length = math_sqrt$5(out.x * out.x + out.y * out.y);
if (length !== 0) {
Expand Down Expand Up @@ -3004,6 +3009,8 @@
*/
var Shape = /** @class */ (function () {
function Shape() {
/** Styling for dev-tools. */
this.style = {};
}
Shape.isValid = function (obj) {
if (obj === null || typeof obj === 'undefined') {
Expand Down Expand Up @@ -3072,6 +3079,8 @@
var Fixture = /** @class */ (function () {
/** @internal */
function Fixture(body, shape, def) {
/** Styling for dev-tools. */
this.style = {};
if (shape.shape) {
def = shape;
shape = shape.shape;
Expand Down Expand Up @@ -3439,6 +3448,8 @@
var Body = /** @class */ (function () {
/** @internal */
function Body(world, def) {
/** Styling for dev-tools. */
this.style = {};
def = options(def, BodyDefDefault);
this.m_world = world;
this.m_awakeFlag = def.awake;
Expand Down Expand Up @@ -4311,6 +4322,8 @@
/** @internal */ this.m_edgeA = new JointEdge();
/** @internal */ this.m_edgeB = new JointEdge();
/** @internal */ this.m_islandFlag = false;
/** Styling for dev-tools. */
this.style = {};
bodyA = 'bodyA' in def ? def.bodyA : bodyA;
bodyB = 'bodyB' in def ? def.bodyB : bodyB;
this.m_bodyA = bodyA;
Expand Down Expand Up @@ -4850,8 +4863,8 @@
combineVec2(pB, v1.a, v1.wB, v2.a, v2.wB);
break;
case 3:
pB.x = pA.x = v1.a * v1.wA.x + v2.a * v2.wA.x + v3.a * v3.wA.x;
pB.y = pA.y = v1.a * v1.wA.y + v2.a * v2.wA.y + v3.a * v3.wA.y;
combine3Vec2(pA, v1.a, v1.wA, v2.a, v2.wA, v3.a, v3.wA);
copyVec2(pB, pA);
break;
}
};
Expand Down Expand Up @@ -7854,12 +7867,10 @@
setMulVec2(P1, d.x, normal$2);
setMulVec2(P2, d.y, normal$2);
// vA.subCombine(mA, P1, mA, P2);
subMulVec2(vA, mA, P1);
subMulVec2(vA, mA, P2);
combine3Vec2(vA, -mA, P1, -mA, P2, 1, vA);
wA -= iA * (crossVec2Vec2(vcp1.rA, P1) + crossVec2Vec2(vcp2.rA, P2));
// vB.addCombine(mB, P1, mB, P2);
addMulVec2(vB, mB, P1);
addMulVec2(vB, mB, P2);
combine3Vec2(vB, mB, P1, mB, P2, 1, vB);
wB += iB * (crossVec2Vec2(vcp1.rB, P1) + crossVec2Vec2(vcp2.rB, P2));
// Accumulate
vcp1.normalImpulse = x.x;
Expand All @@ -7883,12 +7894,10 @@
setMulVec2(P1, d.x, normal$2);
setMulVec2(P2, d.y, normal$2);
// vA.subCombine(mA, P1, mA, P2);
subMulVec2(vA, mA, P1);
subMulVec2(vA, mA, P2);
combine3Vec2(vA, -mA, P1, -mA, P2, 1, vA);
wA -= iA * (crossVec2Vec2(vcp1.rA, P1) + crossVec2Vec2(vcp2.rA, P2));
// vB.addCombine(mB, P1, mB, P2);
addMulVec2(vB, mB, P1);
addMulVec2(vB, mB, P2);
combine3Vec2(vB, mB, P1, mB, P2, 1, vB);
wB += iB * (crossVec2Vec2(vcp1.rB, P1) + crossVec2Vec2(vcp2.rB, P2));
// Accumulate
vcp1.normalImpulse = x.x;
Expand All @@ -7912,12 +7921,10 @@
setMulVec2(P1, d.x, normal$2);
setMulVec2(P2, d.y, normal$2);
// vA.subCombine(mA, P1, mA, P2);
subMulVec2(vA, mA, P1);
subMulVec2(vA, mA, P2);
combine3Vec2(vA, -mA, P1, -mA, P2, 1, vA);
wA -= iA * (crossVec2Vec2(vcp1.rA, P1) + crossVec2Vec2(vcp2.rA, P2));
// vB.addCombine(mB, P1, mB, P2);
addMulVec2(vB, mB, P1);
addMulVec2(vB, mB, P2);
combine3Vec2(vB, mB, P1, mB, P2, 1, vB);
wB += iB * (crossVec2Vec2(vcp1.rB, P1) + crossVec2Vec2(vcp2.rB, P2));
// Accumulate
vcp1.normalImpulse = x.x;
Expand All @@ -7941,12 +7948,10 @@
setMulVec2(P1, d.x, normal$2);
setMulVec2(P2, d.y, normal$2);
// vA.subCombine(mA, P1, mA, P2);
subMulVec2(vA, mA, P1);
subMulVec2(vA, mA, P2);
combine3Vec2(vA, -mA, P1, -mA, P2, 1, vA);
wA -= iA * (crossVec2Vec2(vcp1.rA, P1) + crossVec2Vec2(vcp2.rA, P2));
// vB.addCombine(mB, P1, mB, P2);
addMulVec2(vB, mB, P1);
addMulVec2(vB, mB, P2);
combine3Vec2(vB, mB, P1, mB, P2, 1, vB);
wB += iB * (crossVec2Vec2(vcp1.rB, P1) + crossVec2Vec2(vcp2.rB, P2));
// Accumulate
vcp1.normalImpulse = x.x;
Expand Down Expand Up @@ -8086,7 +8091,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
/** @internal */ var WorldDefDefault = {
/** @internal */ var DEFAULTS$b = {
gravity: Vec2.zero(),
allowSleep: true,
warmStarting: true,
Expand All @@ -8105,10 +8110,13 @@
return new World(def);
}
this.s_step = new TimeStep();
if (def && Vec2.isValid(def)) {
if (!def) {
def = {};
}
else if (Vec2.isValid(def)) {
def = { gravity: def };
}
def = options(def, WorldDefDefault);
def = options(def, DEFAULTS$b);
this.m_solver = new Solver(this);
this.m_broadPhase = new BroadPhase();
this.m_contactList = null;
Expand Down Expand Up @@ -8216,7 +8224,7 @@
* Change the global gravity vector.
*/
World.prototype.setGravity = function (gravity) {
this.m_gravity = gravity;
this.m_gravity.set(gravity);
};
/**
* Get the global gravity vector.
Expand Down Expand Up @@ -9955,8 +9963,8 @@
var triangleArea = 0.5 * D;
area += triangleArea;
// Area weighted centroid
combineVec2(center, 1, center, triangleArea * k_inv3, e1$1);
combineVec2(center, 1, center, triangleArea * k_inv3, e2$1);
combineVec2(temp$1, triangleArea * k_inv3, e1$1, triangleArea * k_inv3, e2$1);
addVec2(center, temp$1);
var ex1 = e1$1.x;
var ey1 = e1$1.y;
var ex2 = e2$1.x;
Expand Down Expand Up @@ -10026,9 +10034,8 @@
var triangleArea = 0.5 * D;
area += triangleArea;
// Area weighted centroid
c.addMul(triangleArea * inv3, p1);
c.addMul(triangleArea * inv3, p2);
c.addMul(triangleArea * inv3, p3);
combine3Vec2(temp$1, 1, p1, 1, p2, 1, p3);
addMulVec2(c, triangleArea * inv3, temp$1);
}
c.mul(1.0 / area);
return c;
Expand Down Expand Up @@ -14864,9 +14871,24 @@
this.statusText = '';
this.statusMap = {};
}
/**
* Mount testbed.
*
* If you need to customize testbed before starting, use `Testbed.mount()` and `Testbed.start()` separately.
*/
Testbed.mount = function (options) {
throw new Error('Not implemented');
};
/**
* Start simulation, and mount testbed if needed.
*
* If you need to customize testbed before starting, use `Testbed.mount().start()` separately.
*/
Testbed.start = function (world) {
var testbed = Testbed.mount();
testbed.start(world);
return testbed;
};
Testbed.prototype.status = function (a, b) {
if (typeof b !== 'undefined') {
var key_1 = a;
Expand Down
2 changes: 1 addition & 1 deletion dist/planck-with-testbed.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/planck-with-testbed.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/planck-with-testbed.min.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit 4de71d9

Please sign in to comment.