Skip to content

Commit 3c1c8af

Browse files
committed
Build 1.0.0
1 parent 40f330d commit 3c1c8af

10 files changed

Lines changed: 1497 additions & 6 deletions

build/ikthree.module.js

Lines changed: 1404 additions & 0 deletions
Large diffs are not rendered by default.

build/ikthree.module.min.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# ik-three changelog
2+
3+
## 1.0.0 (master)

js/Core.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
3+
const IKTHREE = {
4+
version: "1.0.0",
5+
};
6+
7+
export{ IKTHREE };

js/IKHelper.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import * as THREE from "three";
2+
import { IKTHREE } from "./Core.js";
23

34
class IKHelper {
45

@@ -365,6 +366,8 @@ IKHelper.VISIBILITYFLAGS = {
365366
CONSTRAINTS : 0X04,
366367
}
367368

369+
IKTHREE.IKHelper = IKHelper;
370+
368371
const ShaderChunk = {
369372

370373
Point: {

js/IKHelperExtended.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import {IKHelper} from "./IKHelper.js";
21
import * as THREE from "three";
2+
import { IKTHREE } from "./Core.js";
3+
import { IKHelper } from "./IKHelper.js";
34

45
class IKHelperExtended extends IKHelper {
56

@@ -120,4 +121,6 @@ class IKHelperExtended extends IKHelper {
120121

121122
IKHelperExtended.VISIBILITYFLAGS = IKHelper.VISIBILITYFLAGS;
122123

124+
IKTHREE.IKHelperExtended = IKHelperExtended;
125+
123126
export { IKHelperExtended };

js/IKSolver.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import * as THREE from 'three';
2+
import { IKTHREE } from './Core.js';
23

34
let _quat = new THREE.Quaternion(); // on update
45

@@ -45,10 +46,10 @@ function _constraintAngle ( angle, minConstraint = 0, maxConstraint = 360 ){
4546
/* -------------- threejs skeleton info
4647
4748
Skeleton class holds all the information (see pose() and update() for more visual info)
48-
- this.boneInverses: holds the inverse world matrices of the BIND pose
49+
- this.boneInverses: holds the inverse world matrices of the BIND pose
4950
inv( [ParentParentParent]*[ParentParent] * [Parent] *[MyBone] )
5051
51-
- this.boneMatrices: holds the current world matrices of the bones in a single array (probably for streaming it directly to the gpu). Modifying it directly does not change gpu skinning (but changes skeletonHelper...)
52+
- this.boneMatrices: holds the current world matrices of the bones in a single array (probably for streaming it directly to the gpu). Modifying it directly does not change gpu skinning (but changes skeletonHelper...)
5253
WARNING: probably they are really world matrices, as in not in local space of the model, but really scene world matrices. i.e. the object models are also applied
5354
5455
- bone.matrixWorld: current world matrix. Modifying it directly does not change gpu skinning (but changes skeletonHelper...) Also, subsequent bones do not see the changes
@@ -59,7 +60,7 @@ Skeleton class holds all the information (see pose() and update() for more visua
5960
*/
6061

6162

62-
// RIGHT HANDED COORDS
63+
// RIGHT HANDED COORDS
6364
class BaseSolver {
6465

6566
constructor ( skeleton ){
@@ -379,6 +380,7 @@ class BaseSolver {
379380
}
380381
BaseSolver.JOINTTYPES = { OMNI: 0, HINGE: 1, BALLSOCKET: 2 }; // omni is just the default not constrained joint
381382

383+
IKTHREE.BaseSolver = BaseSolver;
382384

383385
class FABRIKSolver extends BaseSolver {
384386
update ( ){
@@ -503,10 +505,9 @@ class FABRIKSolver extends BaseSolver {
503505

504506
}
505507
}
506-
507508
FABRIKSolver.JOINTTYPES = BaseSolver.JOINTTYPES; // omni is just the default no constrained joint
508509

509-
510+
IKTHREE.FABRIKSolver = FABRIKSolver;
510511

511512
class CCDIKSolver extends BaseSolver {
512513
update ( ){
@@ -583,6 +584,7 @@ class CCDIKSolver extends BaseSolver {
583584
}
584585
CCDIKSolver.JOINTTYPES = BaseSolver.JOINTTYPES; // omni is just the default no constrained joint
585586

587+
IKTHREE.CCDIKSolver = CCDIKSolver;
586588

587589
// ---------------- JOINTS ----------------
588590
/**
@@ -721,6 +723,8 @@ class JointConstraint{
721723
}
722724
}
723725

726+
IKTHREE.JointConstraint = JointConstraint;
727+
724728

725729
/**
726730
* Uses spherical coordinates to handle swing constraint
@@ -798,6 +802,8 @@ class JCBallSocket extends JointConstraint {
798802
}
799803
}
800804

805+
IKTHREE.JCBallSocket = JCBallSocket;
806+
801807
/**
802808
* Simple hinge constraint
803809
*/
@@ -856,5 +862,7 @@ class JCHinge extends JointConstraint {
856862
}
857863
}
858864

865+
IKTHREE.JCHinge = JCHinge;
866+
859867

860868
export{ FABRIKSolver, CCDIKSolver };

package.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"name": "@upf-gti/ikthree",
3+
"version": "1.0.0",
4+
"description": "Inverse Kinematics for Three.js",
5+
"type": "module",
6+
"main": "./build/ikthree.module.min.js",
7+
"module": "./build/ikthree.module.js",
8+
"repository": {
9+
"type": "git",
10+
"url": "https://github.com/upf-gti/IK-threejs"
11+
},
12+
"files": [
13+
"build",
14+
"LICENSE",
15+
"package.json",
16+
"README.md"
17+
],
18+
"keywords": [
19+
"inverse kinematics",
20+
"ik",
21+
"fabrik",
22+
"ccdik",
23+
"three.js"
24+
],
25+
"author": "@upf-gti",
26+
"license": "Apache-2.0",
27+
"bugs": {
28+
"url": "https://github.com/upf-gti/IK-threejs/issues"
29+
},
30+
"scripts": {
31+
"rollup-js": "rollup -c rollup.build.config.js",
32+
"build": "npm run rollup-js"
33+
},
34+
"dependencies": {
35+
"@rollup/plugin-terser": "^0.4.4",
36+
"rollup": "^4.54.0"
37+
}
38+
}

rollup.build.config.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import terser from '@rollup/plugin-terser';
2+
3+
export default [
4+
{
5+
input: "rollup.build.index.js",
6+
output: [
7+
{
8+
file: 'build/ikthree.module.js',
9+
format: 'esm',
10+
banner: '// This is a generated file. Do not edit. \n // Developers: @japopra @evallsg'
11+
},
12+
{
13+
file: 'build/ikthree.module.min.js',
14+
format: 'esm',
15+
banner: '// This is a generated file. Do not edit. \n // Developers: @japopra @evallsg',
16+
plugins: [terser()]
17+
}
18+
]
19+
}
20+
];

rollup.build.index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export * from "./js/Core.js";
2+
export * from "./js/IKSolver.js";
3+
export * from "./js/IKHelper.js";
4+
export * from "./js/IKHelperExtended.js";

0 commit comments

Comments
 (0)