Skip to content

Commit

Permalink
build v1.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
shakiba committed Dec 18, 2024
1 parent a7a62dd commit a1753d5
Show file tree
Hide file tree
Showing 16 changed files with 114 additions and 72 deletions.
6 changes: 6 additions & 0 deletions dist/planck-with-testbed.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,8 @@ export interface JointOpt {
* should collide.
*/
collideConnected?: boolean;
/** @hidden Styling for dev-tools. */
style?: Style;
}
/**
* Joint definitions are used to construct joints.
Expand Down Expand Up @@ -984,6 +986,8 @@ export interface FixtureOpt {
* Collision category bit or bits that this fixture accept for collision.
*/
filterMaskBits?: number;
/** @hidden Styling for dev-tools. */
style?: Style;
}
export interface FixtureDef extends FixtureOpt {
shape: Shape;
Expand Down Expand Up @@ -1528,6 +1532,8 @@ export interface BodyDef {
*/
active?: boolean;
userData?: any;
/** @hidden Styling for dev-tools. */
style?: Style;
}
/**
* MassData This holds the mass data computed for a shape.
Expand Down
62 changes: 34 additions & 28 deletions dist/planck-with-testbed.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
typeof exports === "object" && typeof module !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.planck = {}));
})(this, function(exports2) {
"use strict";/**
* Planck.js v1.1.3
* Planck.js v1.1.4
* @license The MIT license
* @copyright Copyright (c) 2024 Erin Catto, Ali Shakiba
*
Expand Down Expand Up @@ -2219,6 +2219,9 @@
this.m_proxies[i] = new FixtureProxy(this, i);
}
this.m_userData = def.userData;
if (typeof def.style === "object" && def.style !== null) {
this.style = def.style;
}
}
Fixture2.prototype._reset = function() {
var body = this.getBody();
Expand Down Expand Up @@ -2467,6 +2470,9 @@
this.m_prev = null;
this.m_next = null;
this.m_destroyed = false;
if (typeof def.style === "object" && def.style !== null) {
this.style = def.style;
}
}
Body2.prototype._serialize = function() {
var fixtures = [];
Expand Down Expand Up @@ -3020,6 +3026,9 @@
this.m_bodyB = bodyB;
this.m_collideConnected = !!def.collideConnected;
this.m_userData = def.userData;
if (typeof def.style === "object" && def.style !== null) {
this.style = def.style;
}
}
Joint2.prototype.isActive = function() {
return this.m_bodyA.isActive() && this.m_bodyB.isActive();
Expand Down Expand Up @@ -15233,10 +15242,13 @@
};
return mounted;
};
var getStyle = function(obj) {
var _a2, _b;
return (_b = (_a2 = obj["render"]) !== null && _a2 !== void 0 ? _a2 : obj["style"]) !== null && _b !== void 0 ? _b : {};
};
function getStyle(obj) {
if (typeof obj["render"] === "object" && ("stroke" in obj["render"] || "fill" in obj["render"])) {
return obj["render"];
} else if (typeof obj["style"] === "object") {
return obj["style"];
}
}
function findBody(world, point2) {
var body = null;
var aabb = {
Expand Down Expand Up @@ -15612,40 +15624,34 @@
for (var b2 = world.getBodyList(); b2; b2 = b2.getNext()) {
for (var f = b2.getFixtureList(); f; f = f.getNext()) {
var node = this.nodes.get(f);
var fstyle = getStyle(f);
var bstyle = getStyle(b2);
if (!node) {
if (fstyle && fstyle.stroke) {
options2.stroke = fstyle.stroke;
} else if (bstyle && bstyle.stroke) {
options2.stroke = bstyle.stroke;
} else if (b2.isDynamic()) {
options2.stroke = "rgba(255,255,255,0.9)";
var type = f.getType();
var shape = f.getShape();
var opts = Object.assign({
stroke: options2.stroke,
fill: options2.fill,
scaleY: options2.scaleY,
lineWidth: options2.lineWidth
}, getStyle(b2), getStyle(f), getStyle(shape));
if (opts.stroke) ;
else if (b2.isDynamic()) {
opts.stroke = "rgba(255,255,255,0.9)";
} else if (b2.isKinematic()) {
options2.stroke = "rgba(255,255,255,0.7)";
opts.stroke = "rgba(255,255,255,0.7)";
} else if (b2.isStatic()) {
options2.stroke = "rgba(255,255,255,0.5)";
}
if (fstyle && fstyle.fill) {
options2.fill = fstyle.fill;
} else if (bstyle && bstyle.fill) {
options2.fill = bstyle.fill;
} else {
options2.fill = "";
opts.stroke = "rgba(255,255,255,0.5)";
}
var type = f.getType();
var shape = f.getShape();
if (type == "circle") {
node = viewer.drawCircle(shape, options2);
node = viewer.drawCircle(shape, opts);
}
if (type == "edge") {
node = viewer.drawEdge(shape, options2);
node = viewer.drawEdge(shape, opts);
}
if (type == "polygon") {
node = viewer.drawPolygon(shape, options2);
node = viewer.drawPolygon(shape, opts);
}
if (type == "chain") {
node = viewer.drawChain(shape, options2);
node = viewer.drawChain(shape, opts);
}
if (node) {
node.appendTo(viewer);
Expand Down
2 changes: 1 addition & 1 deletion dist/planck-with-testbed.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 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.

62 changes: 34 additions & 28 deletions dist/planck-with-testbed.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Planck.js v1.1.3
* Planck.js v1.1.4
* @license The MIT license
* @copyright Copyright (c) 2024 Erin Catto, Ali Shakiba
*
Expand Down Expand Up @@ -2215,6 +2215,9 @@ var Fixture = (
this.m_proxies[i] = new FixtureProxy(this, i);
}
this.m_userData = def.userData;
if (typeof def.style === "object" && def.style !== null) {
this.style = def.style;
}
}
Fixture2.prototype._reset = function() {
var body = this.getBody();
Expand Down Expand Up @@ -2463,6 +2466,9 @@ var Body = (
this.m_prev = null;
this.m_next = null;
this.m_destroyed = false;
if (typeof def.style === "object" && def.style !== null) {
this.style = def.style;
}
}
Body2.prototype._serialize = function() {
var fixtures = [];
Expand Down Expand Up @@ -3016,6 +3022,9 @@ var Joint = (
this.m_bodyB = bodyB;
this.m_collideConnected = !!def.collideConnected;
this.m_userData = def.userData;
if (typeof def.style === "object" && def.style !== null) {
this.style = def.style;
}
}
Joint2.prototype.isActive = function() {
return this.m_bodyA.isActive() && this.m_bodyB.isActive();
Expand Down Expand Up @@ -15229,10 +15238,13 @@ Testbed.mount = function() {
};
return mounted;
};
var getStyle = function(obj) {
var _a2, _b;
return (_b = (_a2 = obj["render"]) !== null && _a2 !== void 0 ? _a2 : obj["style"]) !== null && _b !== void 0 ? _b : {};
};
function getStyle(obj) {
if (typeof obj["render"] === "object" && ("stroke" in obj["render"] || "fill" in obj["render"])) {
return obj["render"];
} else if (typeof obj["style"] === "object") {
return obj["style"];
}
}
function findBody(world, point2) {
var body = null;
var aabb = {
Expand Down Expand Up @@ -15608,40 +15620,34 @@ var WorldStageNode = (
for (var b2 = world.getBodyList(); b2; b2 = b2.getNext()) {
for (var f = b2.getFixtureList(); f; f = f.getNext()) {
var node = this.nodes.get(f);
var fstyle = getStyle(f);
var bstyle = getStyle(b2);
if (!node) {
if (fstyle && fstyle.stroke) {
options2.stroke = fstyle.stroke;
} else if (bstyle && bstyle.stroke) {
options2.stroke = bstyle.stroke;
} else if (b2.isDynamic()) {
options2.stroke = "rgba(255,255,255,0.9)";
var type = f.getType();
var shape = f.getShape();
var opts = Object.assign({
stroke: options2.stroke,
fill: options2.fill,
scaleY: options2.scaleY,
lineWidth: options2.lineWidth
}, getStyle(b2), getStyle(f), getStyle(shape));
if (opts.stroke) ;
else if (b2.isDynamic()) {
opts.stroke = "rgba(255,255,255,0.9)";
} else if (b2.isKinematic()) {
options2.stroke = "rgba(255,255,255,0.7)";
opts.stroke = "rgba(255,255,255,0.7)";
} else if (b2.isStatic()) {
options2.stroke = "rgba(255,255,255,0.5)";
}
if (fstyle && fstyle.fill) {
options2.fill = fstyle.fill;
} else if (bstyle && bstyle.fill) {
options2.fill = bstyle.fill;
} else {
options2.fill = "";
opts.stroke = "rgba(255,255,255,0.5)";
}
var type = f.getType();
var shape = f.getShape();
if (type == "circle") {
node = viewer.drawCircle(shape, options2);
node = viewer.drawCircle(shape, opts);
}
if (type == "edge") {
node = viewer.drawEdge(shape, options2);
node = viewer.drawEdge(shape, opts);
}
if (type == "polygon") {
node = viewer.drawPolygon(shape, options2);
node = viewer.drawPolygon(shape, opts);
}
if (type == "chain") {
node = viewer.drawChain(shape, options2);
node = viewer.drawChain(shape, opts);
}
if (node) {
node.appendTo(viewer);
Expand Down
2 changes: 1 addition & 1 deletion dist/planck-with-testbed.mjs.map

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions dist/planck.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,8 @@ export interface JointOpt {
* should collide.
*/
collideConnected?: boolean;
/** @hidden Styling for dev-tools. */
style?: Style;
}
/**
* Joint definitions are used to construct joints.
Expand Down Expand Up @@ -984,6 +986,8 @@ export interface FixtureOpt {
* Collision category bit or bits that this fixture accept for collision.
*/
filterMaskBits?: number;
/** @hidden Styling for dev-tools. */
style?: Style;
}
export interface FixtureDef extends FixtureOpt {
shape: Shape;
Expand Down Expand Up @@ -1528,6 +1532,8 @@ export interface BodyDef {
*/
active?: boolean;
userData?: any;
/** @hidden Styling for dev-tools. */
style?: Style;
}
/**
* MassData This holds the mass data computed for a shape.
Expand Down
11 changes: 10 additions & 1 deletion dist/planck.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/planck.js.map

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion dist/planck.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Planck.js v1.1.3
* Planck.js v1.1.4
* @license The MIT license
* @copyright Copyright (c) 2024 Erin Catto, Ali Shakiba
*
Expand Down Expand Up @@ -2215,6 +2215,9 @@ var Fixture = (
this.m_proxies[i] = new FixtureProxy(this, i);
}
this.m_userData = def.userData;
if (typeof def.style === "object" && def.style !== null) {
this.style = def.style;
}
}
Fixture2.prototype._reset = function() {
var body = this.getBody();
Expand Down Expand Up @@ -2463,6 +2466,9 @@ var Body = (
this.m_prev = null;
this.m_next = null;
this.m_destroyed = false;
if (typeof def.style === "object" && def.style !== null) {
this.style = def.style;
}
}
Body2.prototype._serialize = function() {
var fixtures = [];
Expand Down Expand Up @@ -3016,6 +3022,9 @@ var Joint = (
this.m_bodyB = bodyB;
this.m_collideConnected = !!def.collideConnected;
this.m_userData = def.userData;
if (typeof def.style === "object" && def.style !== null) {
this.style = def.style;
}
}
Joint2.prototype.isActive = function() {
return this.m_bodyA.isActive() && this.m_bodyB.isActive();
Expand Down
2 changes: 1 addition & 1 deletion dist/planck.mjs.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "planck",
"version": "1.1.3",
"version": "1.1.4",
"description": "2D JavaScript/TypeScript physics engine for cross-platform HTML5 game development",
"homepage": "https://github.com/piqnt/planck.js",
"keywords": [
Expand Down

0 comments on commit a1753d5

Please sign in to comment.