@hology/core 0.0.226 → 0.0.227
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +14 -14
- package/README.md +2 -2
- package/dist/effects/vfx/trail-renderer.d.ts +1 -1
- package/dist/gameplay/animation/root-motion.d.ts +3 -2
- package/dist/gameplay/animation/root-motion.js +1 -1
- package/dist/shader/builtin/decal-standard-shader.d.ts +1 -1
- package/dist/shader-nodes/depth.d.ts +1 -1
- package/dist/shader-nodes/effects.d.ts +1 -1
- package/dist/shader-nodes/math.d.ts +2 -2
- package/dist/test/root-motion.test.d.ts +2 -0
- package/dist/test/root-motion.test.js +4 -0
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
package/LICENSE.md
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
# Hology Interactive AB Limited License
|
|
2
|
-
|
|
3
|
-
This software package, including all associated files and documentation (the "Software"), is licensed to you (the "Licensee") by Hology Interactive AB for use exclusively with the product "Hology Engine."
|
|
4
|
-
|
|
5
|
-
By using, copying, modifying, or distributing the Software, Licensee agrees to be bound by the terms of this license.
|
|
6
|
-
|
|
7
|
-
1. License Grant: Hology Interactive AB grants Licensee a limited, non-exclusive, non-transferable license to use the Software solely for the purpose of developing and running software developed with "Hology Engine."
|
|
8
|
-
|
|
9
|
-
2. Restrictions: Licensee may not use, copy, modify, or distribute the Software for any other purpose, including but not limited to the creation of derivative works, standalone applications, or any products not directly associated with "Hology Engine."
|
|
10
|
-
|
|
11
|
-
3. Ownership: Hology Interactive AB retains all intellectual property rights to the Software. This license does not transfer ownership of the Software to Licensee.
|
|
12
|
-
|
|
13
|
-
4. Warranty Disclaimer: THE SOFTWARE IS PROVIDED "AS IS," WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE CREATOR OF THIS PACKAGE BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE.
|
|
14
|
-
|
|
1
|
+
# Hology Interactive AB Limited License
|
|
2
|
+
|
|
3
|
+
This software package, including all associated files and documentation (the "Software"), is licensed to you (the "Licensee") by Hology Interactive AB for use exclusively with the product "Hology Engine."
|
|
4
|
+
|
|
5
|
+
By using, copying, modifying, or distributing the Software, Licensee agrees to be bound by the terms of this license.
|
|
6
|
+
|
|
7
|
+
1. License Grant: Hology Interactive AB grants Licensee a limited, non-exclusive, non-transferable license to use the Software solely for the purpose of developing and running software developed with "Hology Engine."
|
|
8
|
+
|
|
9
|
+
2. Restrictions: Licensee may not use, copy, modify, or distribute the Software for any other purpose, including but not limited to the creation of derivative works, standalone applications, or any products not directly associated with "Hology Engine."
|
|
10
|
+
|
|
11
|
+
3. Ownership: Hology Interactive AB retains all intellectual property rights to the Software. This license does not transfer ownership of the Software to Licensee.
|
|
12
|
+
|
|
13
|
+
4. Warranty Disclaimer: THE SOFTWARE IS PROVIDED "AS IS," WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE CREATOR OF THIS PACKAGE BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE.
|
|
14
|
+
|
|
15
15
|
6. Contact: For any inquiries regarding this license, please email hello@hology.app
|
package/README.md
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
# Hology Engine Core
|
|
2
|
-
|
|
1
|
+
# Hology Engine Core
|
|
2
|
+
|
|
3
3
|
For the development with Hology Engine (https://hology.app/)
|
|
@@ -78,7 +78,7 @@ export declare class Trail extends THREE.Object3D {
|
|
|
78
78
|
static getTrailShaderNodes(billboard: boolean): {
|
|
79
79
|
position: import("three-shader-graph").Vec4Node;
|
|
80
80
|
color: import("three-shader-graph").Vec4Node;
|
|
81
|
-
fraction: import("three-shader-graph").
|
|
81
|
+
fraction: import("three-shader-graph").FloatNode;
|
|
82
82
|
};
|
|
83
83
|
static applyTrailShaderParameters(nodeShader: THREE.ShaderMaterial): void;
|
|
84
84
|
static createBaseMaterial(texture?: THREE.Texture, scrollSpeed?: number, opacityChannel?: OutputTextureSetting['opacityChannel'], billboard?: boolean): NodeShaderMaterial;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { AnimationClip, VectorKeyframeTrack, Bone } from "three";
|
|
1
|
+
import { AnimationClip, VectorKeyframeTrack, Bone, Object3D } from "three";
|
|
2
2
|
export declare class RootMotionClip extends AnimationClip {
|
|
3
3
|
motionTrack: VectorKeyframeTrack;
|
|
4
4
|
displacement: number;
|
|
5
5
|
fixedInPlace: boolean;
|
|
6
6
|
private rootBone?;
|
|
7
|
+
private animationRoot?;
|
|
7
8
|
private source;
|
|
8
|
-
static fromClip(source: AnimationClip, fixedInPlace?: boolean, rootBone?: Bone): RootMotionClip;
|
|
9
|
+
static fromClip(source: AnimationClip, fixedInPlace?: boolean, rootBone?: Bone, animationRoot?: Object3D): RootMotionClip;
|
|
9
10
|
/**
|
|
10
11
|
* If the animation is in place or does not have a root bone,
|
|
11
12
|
* you can create a root motion clip using this function with a specific distance
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{AnimationClip as
|
|
1
|
+
import{AnimationClip as t,Vector3 as o,Quaternion as e,Matrix3 as n,Matrix4 as r}from"three";import{getAnimationClipRigId as i,setAnimationClipRigId as a}from"./retarget.js";export class RootMotionClip extends t{constructor(){super(...arguments),this.displacement=0,this.fixedInPlace=!1}static fromClip(t,s=!1,l,c){const u=new RootMotionClip(t.name,t.duration,t.tracks.slice(),t.blendMode);if(u.fixedInPlace=s,u.rootBone=l,u.animationRoot=c,u.source=t,u.uuid=t.uuid,a(u,i(t)),u.motionTrack=null!=l?t.tracks.find(t=>t.name===`${l.name}.position`):t.tracks.find(t=>t.name.endsWith(".position")),u.motionTrack){u.tracks.splice(u.tracks.indexOf(u.motionTrack),1);const t=(new o).fromArray(u.motionTrack.values,0),i=(new o).fromArray(u.motionTrack.values,u.motionTrack.values.length-3),a=new o(0,1,0);if(null!=l?.parent){l.parent.updateWorldMatrix(!0,!1);const t=l.parent.getWorldQuaternion(new e);a.applyQuaternion(t.invert()).normalize()}const s=u.motionTrack.clone(),d=new o;for(let t=0;t<u.motionTrack.values.length;t+=3){d.fromArray(u.motionTrack.values,t);const o=d.dot(a);d.copy(a).multiplyScalar(o),s.values[t+0]=d.x,s.values[t+1]=d.y,s.values[t+2]=d.z}u.tracks.push(s);const m=i.sub(t);if(m.addScaledVector(a,-m.dot(a)),null!=l?.parent&&null!=c){c.updateWorldMatrix(!0,!1),l.parent.updateWorldMatrix(!0,!1);const t=(new r).copy(c.matrixWorld).invert().multiply(l.parent.matrixWorld);m.applyMatrix3((new n).setFromMatrix4(t))}u.displacement=m.length()}else console.error("Could not find root motion track",t,l);return u}static fromClipWithDistance(t,o){const e=new RootMotionClip(t.name,t.duration,t.tracks.slice(),t.blendMode);return e.fixedInPlace=!0,e.source=t,e.uuid=t.uuid,a(e,i(t)),e.displacement=o,e}clone(){const t=RootMotionClip.fromClip(this.source.clone(),this.fixedInPlace,this.rootBone,this.animationRoot);return t.displacement=this.displacement,t}}let s=53912381;export class BoneLayer{constructor(){this.uuid=s++,this.order=0,this.boneMask=[]}}/*
|
|
2
2
|
* Copyright (©) 2026 Hology Interactive AB. All rights reserved.
|
|
3
3
|
* See the LICENSE.md file for details.
|
|
4
4
|
*/
|
|
@@ -20,7 +20,7 @@ export declare class DecalStandardShader extends DecalNodeShader {
|
|
|
20
20
|
atlasSize: Vector2;
|
|
21
21
|
atlasTile: number;
|
|
22
22
|
output(): {
|
|
23
|
-
color: import("three-shader-graph
|
|
23
|
+
color: import("three-shader-graph").RgbaNode;
|
|
24
24
|
normal: Vec3Node;
|
|
25
25
|
roughness: FloatNode;
|
|
26
26
|
};
|
|
@@ -9,7 +9,7 @@ export declare const sceneNormalUniformName = "hology_scene_normal_map";
|
|
|
9
9
|
export declare const depthSampler: import("three-shader-graph").UniformSampler2d;
|
|
10
10
|
export declare function sampleSceneDepth(uv: Vec2Node): FloatNode;
|
|
11
11
|
export declare function sampleSceneLinearEyeDepth(uv: Vec2Node): FloatNode;
|
|
12
|
-
export declare const highPrecisionEyeDepth:
|
|
12
|
+
export declare const highPrecisionEyeDepth: FloatNode;
|
|
13
13
|
export declare const fragmentLinearEyeDepth: FloatNode;
|
|
14
14
|
export declare const resolution: import("three-shader-graph").UniformVec2Node;
|
|
15
15
|
export declare const screenUV: Vec2Node;
|
|
@@ -10,5 +10,5 @@ export declare function edgeDepthEffect(power?: number | FloatNode): FloatNode;
|
|
|
10
10
|
* Creates a fade effect based on the distance between the scene geometry and the current fragment.
|
|
11
11
|
* This is useful for softening the intersections of meshes with the environment (e.g., water shorelines or force fields).
|
|
12
12
|
*/
|
|
13
|
-
export declare function depthFadeEffect(distance: FloatNode):
|
|
13
|
+
export declare function depthFadeEffect(distance: FloatNode): FloatNode;
|
|
14
14
|
//# sourceMappingURL=effects.d.ts.map
|
|
@@ -16,8 +16,8 @@ export declare function oneMinus<T extends FloatNode | Vec2Node | Vec3Node | Vec
|
|
|
16
16
|
*/
|
|
17
17
|
export declare function vectorToRadial(vec: Vec2Node): {
|
|
18
18
|
coords: Vec2Node;
|
|
19
|
-
radius:
|
|
20
|
-
angle:
|
|
19
|
+
radius: FloatNode;
|
|
20
|
+
angle: FloatNode;
|
|
21
21
|
};
|
|
22
22
|
export declare function remap(value: FloatNode, inMin: FloatNode, inMax: FloatNode, outMin: FloatNode, outMax: FloatNode): FloatNode;
|
|
23
23
|
export declare function hueShift(color: Vec3Node, shift: FloatNode): Vec3Node;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{expect as o,test as e}from"vitest";import{AnimationClip as t,Bone as n,Group as i,VectorKeyframeTrack as a}from"three";import{RootMotionClip as r}from"../gameplay/animation/root-motion.js";function s(o,e,s=1){const m=new i,l=new i;l.rotation.x=o,l.scale.setScalar(s),m.add(l);const c=new n;c.name="mixamorigHips",l.add(c);const p=new a("mixamorigHips.position",[0,1],e);return r.fromClip(new t("run",1,[p]),!0,c,m)}e("removes horizontal root motion while preserving Y-up hip movement",()=>{const e=s(0,[1,10,2,4,12,6]);o(Array.from(e.tracks[0].values)).toEqual([0,10,0,0,12,0]),o(e.displacement).toBeCloseTo(5)}),e("includes scale between the animation root and the animated hip parent",()=>{const e=s(-Math.PI/2,[0,0,1,0,3,1],100);o(e.displacement).toBeCloseTo(300)}),e("uses the root parent orientation to identify vertical motion",()=>{const e=s(-Math.PI/2,[1,2,10,4,6,12]),t=Array.from(e.tracks[0].values);o(t[0]).toBeCloseTo(0),o(t[1]).toBeCloseTo(0),o(t[2]).toBeCloseTo(10),o(t[3]).toBeCloseTo(0),o(t[4]).toBeCloseTo(0),o(t[5]).toBeCloseTo(12),o(e.displacement).toBeCloseTo(5)});/*
|
|
2
|
+
* Copyright (©) 2026 Hology Interactive AB. All rights reserved.
|
|
3
|
+
* See the LICENSE.md file for details.
|
|
4
|
+
*/
|