Skip to content

Commit

Permalink
build v1.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
shakiba committed Dec 23, 2024
1 parent 922ff97 commit 0b31620
Show file tree
Hide file tree
Showing 21 changed files with 106 additions and 29 deletions.
5 changes: 0 additions & 5 deletions .changeset/clever-pants-carry.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/five-balloons-bake.md

This file was deleted.

7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# planck

## 1.1.6

### Patch Changes

- f31114b: Add static Vec2.normalize
- bee0e16: Change clampVec2 arg to Vec2Value

## 1.1.5

### Patch Changes
Expand Down
8 changes: 7 additions & 1 deletion dist/planck-with-testbed.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ export declare class Vec2 {
* @returns old length
*/
normalize(): number;
/**
* Returns a new unit vector from the provided vector.
*
* @returns new unit vector
*/
static normalize(v: Vec2Value): Vec2;
/**
* Get the length of this vector (the norm).
*
Expand Down Expand Up @@ -164,7 +170,7 @@ export declare class Vec2 {
clamp(max: number): Vec2;
static clamp(v: Vec2Value, max: number): Vec2;
/** @hidden */
static clampVec2(v: Vec2Value, min?: Vec2, max?: Vec2): Vec2Value;
static clampVec2(v: Vec2Value, min?: Vec2Value, max?: Vec2Value): Vec2Value;
/** @hidden @deprecated */
static scaleFn(x: number, y: number): (v: Vec2Value) => Vec2;
/** @hidden @deprecated */
Expand Down
10 changes: 9 additions & 1 deletion 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.5
* Planck.js v1.1.6
* @license The MIT license
* @copyright Copyright (c) 2024 Erin Catto, Ali Shakiba
*
Expand Down Expand Up @@ -326,6 +326,14 @@
this.y *= invLength;
return length2;
};
Vec22.normalize = function(v3) {
var length2 = Vec22.lengthOf(v3);
if (length2 < EPSILON) {
return Vec22.zero();
}
var invLength = 1 / length2;
return Vec22.neo(v3.x * invLength, v3.y * invLength);
};
Vec22.lengthOf = function(v3) {
return math_sqrt$7(v3.x * v3.x + v3.y * v3.y);
};
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.

10 changes: 9 additions & 1 deletion dist/planck-with-testbed.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Planck.js v1.1.5
* Planck.js v1.1.6
* @license The MIT license
* @copyright Copyright (c) 2024 Erin Catto, Ali Shakiba
*
Expand Down Expand Up @@ -322,6 +322,14 @@ var Vec2 = (
this.y *= invLength;
return length2;
};
Vec22.normalize = function(v3) {
var length2 = Vec22.lengthOf(v3);
if (length2 < EPSILON) {
return Vec22.zero();
}
var invLength = 1 / length2;
return Vec22.neo(v3.x * invLength, v3.y * invLength);
};
Vec22.lengthOf = function(v3) {
return math_sqrt$7(v3.x * v3.x + v3.y * v3.y);
};
Expand Down
2 changes: 1 addition & 1 deletion dist/planck-with-testbed.mjs.map

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion dist/planck.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ export declare class Vec2 {
* @returns old length
*/
normalize(): number;
/**
* Returns a new unit vector from the provided vector.
*
* @returns new unit vector
*/
static normalize(v: Vec2Value): Vec2;
/**
* Get the length of this vector (the norm).
*
Expand Down Expand Up @@ -164,7 +170,7 @@ export declare class Vec2 {
clamp(max: number): Vec2;
static clamp(v: Vec2Value, max: number): Vec2;
/** @hidden */
static clampVec2(v: Vec2Value, min?: Vec2, max?: Vec2): Vec2Value;
static clampVec2(v: Vec2Value, min?: Vec2Value, max?: Vec2Value): Vec2Value;
/** @hidden @deprecated */
static scaleFn(x: number, y: number): (v: Vec2Value) => Vec2;
/** @hidden @deprecated */
Expand Down
10 changes: 9 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.

10 changes: 9 additions & 1 deletion dist/planck.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Planck.js v1.1.5
* Planck.js v1.1.6
* @license The MIT license
* @copyright Copyright (c) 2024 Erin Catto, Ali Shakiba
*
Expand Down Expand Up @@ -322,6 +322,14 @@ var Vec2 = (
this.y *= invLength;
return length;
};
Vec22.normalize = function(v3) {
var length = Vec22.lengthOf(v3);
if (length < EPSILON) {
return Vec22.zero();
}
var invLength = 1 / length;
return Vec22.neo(v3.x * invLength, v3.y * invLength);
};
Vec22.lengthOf = function(v3) {
return math_sqrt$5(v3.x * v3.x + v3.y * v3.y);
};
Expand Down
2 changes: 1 addition & 1 deletion dist/planck.mjs.map

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions docs/pages/api/classes/Vec2.md
Original file line number Diff line number Diff line change
Expand Up @@ -912,6 +912,24 @@ Get the length squared.

***

### normalize()

> `static` **normalize**(`v`): [`Vec2`](/api/classes/Vec2)
Returns a new unit vector from the provided vector.

#### Parameters

**v**: [`Vec2Value`](/api/interfaces/Vec2Value)

#### Returns

[`Vec2`](/api/classes/Vec2)

new unit vector

***

### skew()

> `static` **skew**(`v`): [`Vec2`](/api/classes/Vec2)
Expand Down
18 changes: 18 additions & 0 deletions docs/pages/api/classes/vec2.md
Original file line number Diff line number Diff line change
Expand Up @@ -912,6 +912,24 @@ Get the length squared.

***

### normalize()

> `static` **normalize**(`v`): [`Vec2`](/api/classes/Vec2)
Returns a new unit vector from the provided vector.

#### Parameters

**v**: [`Vec2Value`](/api/interfaces/Vec2Value)

#### Returns

[`Vec2`](/api/classes/Vec2)

new unit vector

***

### skew()

> `static` **skew**(`v`): [`Vec2`](/api/classes/Vec2)
Expand Down
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.5",
"version": "1.1.6",
"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 0b31620

Please sign in to comment.