ecsy-babylon
Advanced tools
Comparing version 0.6.4 to 0.6.5
@@ -0,1 +1,10 @@ | ||
## v0.6.5 (2021-04-20) | ||
#### :rocket: Enhancement | ||
* [#479](https://github.com/kaliber5/ecsy-babylon/pull/479) Add `pivot-point` component ([@simonihmig](https://github.com/simonihmig)) | ||
#### Committers: 2 | ||
- Simon Ihmig ([@simonihmig](https://github.com/simonihmig)) | ||
- [@dependabot-preview[bot]](https://github.com/apps/dependabot-preview) | ||
## v0.6.4 (2021-03-22) | ||
@@ -2,0 +11,0 @@ |
@@ -25,2 +25,3 @@ import BabylonCore from './babylon-core'; | ||
import Scale from './scale'; | ||
import PivotPoint from './pivot-point'; | ||
import Action from './action'; | ||
@@ -37,2 +38,2 @@ import Parent from './parent'; | ||
import WebXrDefaultExperience from './xr/default'; | ||
export { BabylonCore, TargetCamera, ArcRotateCamera, Mesh, Plane, Box, Camera, Sphere, Lines, Material, StandardMaterial, PbrMaterial, BackgroundMaterial, ShadowOnlyMaterial, Light, HemisphericLight, DirectionalLight, SpotLight, PointLight, ShadowGenerator, TransformNode, Position, Rotation, Scale, Action, Parent, PostProcess, BlackAndWhitePostProcess, BlurPostProcess, MotionBlurPostProcess, PostProcessRenderPipeline, SsaoRenderingPipeline, DefaultRenderingPipeline, Transitions, WebXrDefaultExperience, }; | ||
export { BabylonCore, TargetCamera, ArcRotateCamera, Mesh, Plane, Box, Camera, Sphere, Lines, Material, StandardMaterial, PbrMaterial, BackgroundMaterial, ShadowOnlyMaterial, Light, HemisphericLight, DirectionalLight, SpotLight, PointLight, ShadowGenerator, TransformNode, Position, Rotation, Scale, PivotPoint, Action, Parent, PostProcess, BlackAndWhitePostProcess, BlurPostProcess, MotionBlurPostProcess, PostProcessRenderPipeline, SsaoRenderingPipeline, DefaultRenderingPipeline, Transitions, WebXrDefaultExperience, }; |
@@ -25,2 +25,3 @@ import BabylonCore from './babylon-core'; | ||
import Scale from './scale'; | ||
import PivotPoint from './pivot-point'; | ||
import Action from './action'; | ||
@@ -37,3 +38,3 @@ import Parent from './parent'; | ||
import WebXrDefaultExperience from './xr/default'; | ||
export { BabylonCore, TargetCamera, ArcRotateCamera, Mesh, Plane, Box, Camera, Sphere, Lines, Material, StandardMaterial, PbrMaterial, BackgroundMaterial, ShadowOnlyMaterial, Light, HemisphericLight, DirectionalLight, SpotLight, PointLight, ShadowGenerator, TransformNode, Position, Rotation, Scale, Action, Parent, PostProcess, BlackAndWhitePostProcess, BlurPostProcess, MotionBlurPostProcess, PostProcessRenderPipeline, SsaoRenderingPipeline, DefaultRenderingPipeline, Transitions, WebXrDefaultExperience, }; | ||
export { BabylonCore, TargetCamera, ArcRotateCamera, Mesh, Plane, Box, Camera, Sphere, Lines, Material, StandardMaterial, PbrMaterial, BackgroundMaterial, ShadowOnlyMaterial, Light, HemisphericLight, DirectionalLight, SpotLight, PointLight, ShadowGenerator, TransformNode, Position, Rotation, Scale, PivotPoint, Action, Parent, PostProcess, BlackAndWhitePostProcess, BlurPostProcess, MotionBlurPostProcess, PostProcessRenderPipeline, SsaoRenderingPipeline, DefaultRenderingPipeline, Transitions, WebXrDefaultExperience, }; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "ecsy-babylon", | ||
"version": "0.6.4", | ||
"version": "0.6.5", | ||
"description": "", | ||
@@ -56,10 +56,10 @@ "keywords": [], | ||
"devDependencies": { | ||
"@babel/core": "^7.13.10", | ||
"@babel/preset-env": "^7.13.10", | ||
"@rollup/plugin-node-resolve": "^11.2.0", | ||
"@rollup/plugin-replace": "^2.4.1", | ||
"@rollup/plugin-typescript": "^8.2.0", | ||
"@types/jest": "^26.0.21", | ||
"@babel/core": "^7.13.15", | ||
"@babel/preset-env": "^7.13.15", | ||
"@rollup/plugin-node-resolve": "^11.2.1", | ||
"@rollup/plugin-replace": "^2.4.2", | ||
"@rollup/plugin-typescript": "^8.2.1", | ||
"@types/jest": "^26.0.22", | ||
"@types/lodash-es": "^4.17.4", | ||
"@types/node": "^14.14.35", | ||
"@types/node": "^14.14.37", | ||
"@types/rollup-plugin-sourcemaps": "^0.4.2", | ||
@@ -77,3 +77,3 @@ "@typescript-eslint/eslint-plugin": "^2.34.0", | ||
"eslint-plugin-import": "^2.22.1", | ||
"eslint-plugin-jest": "^24.3.2", | ||
"eslint-plugin-jest": "^24.3.5", | ||
"eslint-plugin-node": "^11.1.0", | ||
@@ -89,6 +89,6 @@ "eslint-plugin-prettier": "^3.3.1", | ||
"prettier": "^2.2.1", | ||
"release-it": "^14.5.0", | ||
"release-it": "^14.6.1", | ||
"release-it-lerna-changelog": "^3.1.0", | ||
"rimraf": "^3.0.2", | ||
"rollup": "^2.42.2", | ||
"rollup": "^2.45.1", | ||
"rollup-plugin-commonjs": "^10.1.0", | ||
@@ -98,4 +98,4 @@ "rollup-plugin-sourcemaps": "^0.6.3", | ||
"ts-node": "^9.1.1", | ||
"typedoc": "^0.20.33", | ||
"typescript": "^4.0.7" | ||
"typedoc": "^0.20.35", | ||
"typescript": "^4.2.4" | ||
}, | ||
@@ -102,0 +102,0 @@ "engines": { |
import { Entity, System } from 'ecsy'; | ||
import { Parent, Position, Rotation, Scale, TransformNode } from '../components'; | ||
import { Parent, PivotPoint, Position, Rotation, Scale, TransformNode } from '../components'; | ||
import { TransformNode as BabylonTransformNode } from '@babylonjs/core/Meshes/transformNode'; | ||
@@ -22,2 +22,5 @@ import { World } from '../index'; | ||
removeScale(entity: Entity): void; | ||
setPivot(entity: Entity): void; | ||
updatePivot(entity: Entity): void; | ||
removePivot(entity: Entity): void; | ||
static queries: { | ||
@@ -62,3 +65,11 @@ parent: { | ||
}; | ||
pivot: { | ||
components: (typeof PivotPoint)[]; | ||
listen: { | ||
added: boolean; | ||
changed: boolean; | ||
removed: boolean; | ||
}; | ||
}; | ||
}; | ||
} |
import { System } from 'ecsy'; | ||
import { Parent, Position, Rotation, Scale, TransformNode } from '../components'; | ||
import { Parent, PivotPoint, Position, Rotation, Scale, TransformNode } from '../components'; | ||
import guidFor from '../-private/utils/guid'; | ||
import { assert } from '../-private/utils/debug'; | ||
import { TransformNode as BabylonTransformNode } from '@babylonjs/core/Meshes/transformNode'; | ||
import { Vector3 } from '@babylonjs/core/Maths/math.vector'; | ||
export default class TransformSystem extends System { | ||
execute() { | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o; | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r; | ||
(_a = this.queries.parent.added) === null || _a === void 0 ? void 0 : _a.forEach((e) => this.setup(e)); | ||
@@ -20,5 +21,8 @@ (_b = this.queries.transformNode.added) === null || _b === void 0 ? void 0 : _b.forEach((e) => this.setupTransformNode(e)); | ||
(_l = this.queries.scale.removed) === null || _l === void 0 ? void 0 : _l.forEach((e) => this.removeScale(e)); | ||
(_m = this.queries.pivot.added) === null || _m === void 0 ? void 0 : _m.forEach((e) => this.setPivot(e)); | ||
(_o = this.queries.pivot.changed) === null || _o === void 0 ? void 0 : _o.forEach((e) => this.updatePivot(e)); | ||
(_p = this.queries.pivot.removed) === null || _p === void 0 ? void 0 : _p.forEach((e) => this.removePivot(e)); | ||
// entity might remove TransformNode, so it needs to run before | ||
(_m = this.queries.parent.removed) === null || _m === void 0 ? void 0 : _m.forEach((e) => this.remove(e)); | ||
(_o = this.queries.transformNode.removed) === null || _o === void 0 ? void 0 : _o.forEach((e) => this.removeTransformNode(e)); | ||
(_q = this.queries.parent.removed) === null || _q === void 0 ? void 0 : _q.forEach((e) => this.remove(e)); | ||
(_r = this.queries.transformNode.removed) === null || _r === void 0 ? void 0 : _r.forEach((e) => this.removeTransformNode(e)); | ||
} | ||
@@ -99,2 +103,12 @@ setup(entity) { | ||
} | ||
setPivot(entity) { | ||
this.world.babylonManager.setProperty(entity, this.getTransformNode(entity), 'pivotPoint', entity.getComponent(PivotPoint).value); | ||
} | ||
updatePivot(entity) { | ||
this.world.babylonManager.updateProperty(entity, this.getTransformNode(entity), 'transform', 'pivotPoint', entity.getComponent(PivotPoint).value); | ||
} | ||
removePivot(entity) { | ||
const tn = this.getTransformNode(entity, true); | ||
tn.setPivotPoint(Vector3.Zero()); | ||
} | ||
} | ||
@@ -140,3 +154,11 @@ TransformSystem.queries = { | ||
}, | ||
pivot: { | ||
components: [PivotPoint], | ||
listen: { | ||
added: true, | ||
changed: true, | ||
removed: true, | ||
}, | ||
}, | ||
}; | ||
//# sourceMappingURL=transform.js.map |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
482186
255
6413