@needle-tools/engine 4.12.0-beta → 4.12.0-beta.1
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/CHANGELOG.md +1 -1
- package/components.needle.json +1 -1
- package/dist/{needle-engine.bundle-DhdNodjw.min.js → needle-engine.bundle-BeTUOBiO.min.js} +1 -1
- package/dist/{needle-engine.bundle-DBdgyYGK.js → needle-engine.bundle-BxG30KEV.js} +3 -3
- package/dist/{needle-engine.bundle-DmY4g6s0.umd.cjs → needle-engine.bundle-C08Ag6_H.umd.cjs} +3 -3
- package/dist/needle-engine.d.ts +51 -17
- package/dist/needle-engine.js +2 -2
- package/dist/needle-engine.min.js +1 -1
- package/dist/needle-engine.umd.cjs +1 -1
- package/lib/engine-components/AlignmentConstraint.d.ts +0 -1
- package/lib/engine-components/AlignmentConstraint.js +0 -1
- package/lib/engine-components/AlignmentConstraint.js.map +1 -1
- package/lib/engine-components/Animation.d.ts +2 -0
- package/lib/engine-components/Animation.js +2 -0
- package/lib/engine-components/Animation.js.map +1 -1
- package/lib/engine-components/Animator.d.ts +1 -0
- package/lib/engine-components/Animator.js +1 -0
- package/lib/engine-components/Animator.js.map +1 -1
- package/lib/engine-components/BasicIKConstraint.d.ts +8 -0
- package/lib/engine-components/BasicIKConstraint.js +8 -0
- package/lib/engine-components/BasicIKConstraint.js.map +1 -1
- package/lib/engine-components/BoxHelperComponent.d.ts +1 -0
- package/lib/engine-components/BoxHelperComponent.js +1 -0
- package/lib/engine-components/BoxHelperComponent.js.map +1 -1
- package/lib/engine-components/Camera.d.ts +1 -1
- package/lib/engine-components/Camera.js +1 -1
- package/lib/engine-components/Collider.d.ts +1 -1
- package/lib/engine-components/Collider.js +1 -1
- package/lib/engine-components/ContactShadows.d.ts +1 -1
- package/lib/engine-components/ContactShadows.js +1 -1
- package/lib/engine-components/DragControls.js +3 -0
- package/lib/engine-components/DragControls.js.map +1 -1
- package/lib/engine-components/Gizmos.d.ts +2 -0
- package/lib/engine-components/Gizmos.js +2 -0
- package/lib/engine-components/Gizmos.js.map +1 -1
- package/lib/engine-components/Joints.d.ts +6 -0
- package/lib/engine-components/Joints.js +6 -0
- package/lib/engine-components/Joints.js.map +1 -1
- package/lib/engine-components/LODGroup.d.ts +1 -1
- package/lib/engine-components/LODGroup.js +1 -1
- package/lib/engine-components/Networking.d.ts +1 -1
- package/lib/engine-components/Networking.js +1 -1
- package/lib/engine-components/ShadowCatcher.d.ts +1 -1
- package/lib/engine-components/ShadowCatcher.js +1 -1
- package/lib/engine-components/SpectatorCamera.d.ts +1 -1
- package/lib/engine-components/SpectatorCamera.js +1 -1
- package/lib/engine-components/Voip.d.ts +1 -1
- package/lib/engine-components/Voip.js +1 -1
- package/lib/engine-components/export/gltf/GltfExport.d.ts +5 -0
- package/lib/engine-components/export/gltf/GltfExport.js +5 -0
- package/lib/engine-components/export/gltf/GltfExport.js.map +1 -1
- package/lib/engine-components/export/usdz/USDZExporter.d.ts +1 -0
- package/lib/engine-components/export/usdz/USDZExporter.js +1 -0
- package/lib/engine-components/export/usdz/USDZExporter.js.map +1 -1
- package/lib/engine-components/particlesystem/ParticleSystem.d.ts +1 -1
- package/lib/engine-components/particlesystem/ParticleSystem.js +1 -1
- package/lib/engine-components/ui/Button.d.ts +1 -1
- package/lib/engine-components/ui/Button.js +1 -1
- package/lib/engine-components/ui/Canvas.d.ts +1 -1
- package/lib/engine-components/ui/Canvas.js +1 -1
- package/lib/engine-components/ui/CanvasGroup.d.ts +1 -1
- package/lib/engine-components/ui/CanvasGroup.js +1 -1
- package/lib/engine-components/ui/EventSystem.d.ts +1 -1
- package/lib/engine-components/ui/EventSystem.js +1 -1
- package/lib/engine-components/ui/Image.d.ts +1 -1
- package/lib/engine-components/ui/Image.js +1 -1
- package/lib/engine-components/ui/InputField.d.ts +1 -1
- package/lib/engine-components/ui/InputField.js +1 -1
- package/lib/engine-components/ui/Outline.d.ts +1 -1
- package/lib/engine-components/ui/Outline.js +1 -1
- package/lib/engine-components/ui/SpatialHtml.d.ts +7 -0
- package/lib/engine-components/ui/SpatialHtml.js +7 -0
- package/lib/engine-components/ui/SpatialHtml.js.map +1 -1
- package/lib/engine-components/ui/Text.d.ts +2 -0
- package/lib/engine-components/ui/Text.js +2 -0
- package/lib/engine-components/ui/Text.js.map +1 -1
- package/package.json +3 -3
- package/src/engine-components/AlignmentConstraint.ts +0 -1
- package/src/engine-components/Animation.ts +2 -0
- package/src/engine-components/Animator.ts +1 -0
- package/src/engine-components/BasicIKConstraint.ts +8 -0
- package/src/engine-components/BoxHelperComponent.ts +1 -0
- package/src/engine-components/Camera.ts +1 -1
- package/src/engine-components/Collider.ts +1 -1
- package/src/engine-components/ContactShadows.ts +1 -1
- package/src/engine-components/DragControls.ts +4 -0
- package/src/engine-components/Gizmos.ts +2 -0
- package/src/engine-components/Joints.ts +6 -0
- package/src/engine-components/LODGroup.ts +1 -1
- package/src/engine-components/Networking.ts +1 -1
- package/src/engine-components/ShadowCatcher.ts +1 -1
- package/src/engine-components/SpectatorCamera.ts +1 -1
- package/src/engine-components/Voip.ts +1 -1
- package/src/engine-components/export/gltf/GltfExport.ts +5 -0
- package/src/engine-components/export/usdz/USDZExporter.ts +1 -0
- package/src/engine-components/particlesystem/ParticleSystem.ts +1 -1
- package/src/engine-components/ui/Button.ts +1 -1
- package/src/engine-components/ui/Canvas.ts +1 -1
- package/src/engine-components/ui/CanvasGroup.ts +1 -1
- package/src/engine-components/ui/EventSystem.ts +1 -1
- package/src/engine-components/ui/Image.ts +1 -1
- package/src/engine-components/ui/InputField.ts +1 -1
- package/src/engine-components/ui/Outline.ts +1 -1
- package/src/engine-components/ui/SpatialHtml.ts +7 -0
- package/src/engine-components/ui/Text.ts +2 -0
|
@@ -3,6 +3,14 @@ import { Vector3 } from "three";
|
|
|
3
3
|
import * as utils from "./../engine/engine_three_utils.js";
|
|
4
4
|
import { Behaviour, GameObject } from "./Component.js";
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* BasicIKConstraint positions the GameObject between two target GameObjects (`from` and `to`) with an optional `hint` GameObject to guide the bending direction.
|
|
8
|
+
* This is useful for simple inverse kinematics setups, such as positioning a joint in a limb.
|
|
9
|
+
*
|
|
10
|
+
* @summary Simple Inverse Kinematics Constraint
|
|
11
|
+
* @category Animation
|
|
12
|
+
* @group Components
|
|
13
|
+
*/
|
|
6
14
|
export class BasicIKConstraint extends Behaviour {
|
|
7
15
|
|
|
8
16
|
private from!: GameObject;
|
|
@@ -14,6 +14,7 @@ const debug = getParam("debugboxhelper");
|
|
|
14
14
|
* Debug mode can be enabled with the URL parameter `?debugboxhelper`, which will visualize intersection tests.
|
|
15
15
|
* Helper visualization can be enabled with the URL parameter `?gizmos`.
|
|
16
16
|
*
|
|
17
|
+
* @summary Bounding box helper with intersection tests
|
|
17
18
|
* @category Helpers
|
|
18
19
|
* @group Components
|
|
19
20
|
*/
|
|
@@ -36,7 +36,7 @@ const debugscreenpointtoray = getParam("debugscreenpointtoray");
|
|
|
36
36
|
* Supports both perspective and orthographic cameras with various rendering options.
|
|
37
37
|
* Internally, this component uses {@link PerspectiveCamera} and {@link OrthographicCamera} three.js objects.
|
|
38
38
|
*
|
|
39
|
-
* @summary
|
|
39
|
+
* @summary Rendering scenes from a specific viewpoint
|
|
40
40
|
* @category Camera
|
|
41
41
|
* @group Components
|
|
42
42
|
*/
|
|
@@ -22,7 +22,7 @@ import { Rigidbody } from "./RigidBody.js";
|
|
|
22
22
|
* - Example: https://samples.needle.tools/physics-playground
|
|
23
23
|
* - Example: https://samples.needle.tools/physics-&-animation
|
|
24
24
|
*
|
|
25
|
-
*
|
|
25
|
+
* @summary Physics collider
|
|
26
26
|
* @category Physics
|
|
27
27
|
* @group Components
|
|
28
28
|
*/
|
|
@@ -53,7 +53,7 @@ type FitParameters = {
|
|
|
53
53
|
*
|
|
54
54
|
* ContactShadows can also be enabled on the `<needle-engine>` web component directly by adding the `contactshadows` attribute. The value of the attribute will be used as opacity and darkness of the shadows: `<needle-engine contactshadows="0.7">`.
|
|
55
55
|
*
|
|
56
|
-
*
|
|
56
|
+
* @summary Display contact shadows on the ground
|
|
57
57
|
* @category Rendering
|
|
58
58
|
* @group Components
|
|
59
59
|
*/
|
|
@@ -485,6 +485,8 @@ interface IDragHandler {
|
|
|
485
485
|
onDragUpdate?(numberOfPointers: number): void;
|
|
486
486
|
}
|
|
487
487
|
|
|
488
|
+
|
|
489
|
+
// #region MultiTouchDragHandler
|
|
488
490
|
/**
|
|
489
491
|
* Handles two touch points affecting one object.
|
|
490
492
|
* Enables multi-touch interactions that allow movement, scaling, and rotation of objects.
|
|
@@ -734,6 +736,7 @@ class MultiTouchDragHandler implements IDragHandler {
|
|
|
734
736
|
}
|
|
735
737
|
|
|
736
738
|
|
|
739
|
+
// #region DragPointerHandler
|
|
737
740
|
/**
|
|
738
741
|
* Handles a single pointer on an object.
|
|
739
742
|
* DragPointerHandlers manage determining if a drag operation has started, tracking pointer movement,
|
|
@@ -1335,6 +1338,7 @@ class DragPointerHandler implements IDragHandler {
|
|
|
1335
1338
|
}
|
|
1336
1339
|
}
|
|
1337
1340
|
|
|
1341
|
+
// #region LegacyDragVisualsHelper
|
|
1338
1342
|
/**
|
|
1339
1343
|
* Provides visual helper elements for DragControls.
|
|
1340
1344
|
* Shows where objects will be placed and their relation to surfaces below them.
|
|
@@ -8,6 +8,8 @@ import { Behaviour } from "./Component.js";
|
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* BoxGizmo is a component that displays a box around the object in the scene. It can optionally expand to the object's bounds.
|
|
11
|
+
*
|
|
12
|
+
* @summary Display a box around the object
|
|
11
13
|
* @category Helpers
|
|
12
14
|
* @group Components
|
|
13
15
|
*/
|
|
@@ -4,6 +4,12 @@ import { serializable } from "../engine/engine_serialization.js";
|
|
|
4
4
|
import { Behaviour } from "./Component.js";
|
|
5
5
|
import { Rigidbody } from "./RigidBody.js";
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Base class for physics joints connecting two rigid bodies.
|
|
9
|
+
* @summary Connect two Rigidbodies
|
|
10
|
+
* @category Physics
|
|
11
|
+
* @group Components
|
|
12
|
+
*/
|
|
7
13
|
export abstract class Joint extends Behaviour {
|
|
8
14
|
@serializable(Rigidbody)
|
|
9
15
|
connectedBody?: Rigidbody;
|
|
@@ -41,7 +41,7 @@ declare class LODSetting {
|
|
|
41
41
|
/**
|
|
42
42
|
* LODGroup allows to create a group of LOD levels for an object.
|
|
43
43
|
*
|
|
44
|
-
* @summary Level of Detail
|
|
44
|
+
* @summary Level of Detail Group for optimizing rendering
|
|
45
45
|
* @category Rendering
|
|
46
46
|
* @group Components
|
|
47
47
|
*/
|
|
@@ -11,7 +11,7 @@ const debug = getParam("debugnet");
|
|
|
11
11
|
* This component supplies websocket URLs for establishing connections.
|
|
12
12
|
* It implements the {@link INetworkingWebsocketUrlProvider} interface.
|
|
13
13
|
*
|
|
14
|
-
* @summary Networking configuration
|
|
14
|
+
* @summary Networking configuration
|
|
15
15
|
* @category Networking
|
|
16
16
|
* @group Components
|
|
17
17
|
*/
|
|
@@ -23,7 +23,7 @@ enum ShadowMode {
|
|
|
23
23
|
*
|
|
24
24
|
* Note that ShadowCatcher meshes are not raycastable by default; if you want them to be raycastable, change the layers in `onEnable()`.
|
|
25
25
|
*
|
|
26
|
-
* @summary
|
|
26
|
+
* @summary Creates a shadow mask or a light occluder
|
|
27
27
|
* @category Rendering
|
|
28
28
|
* @group Components
|
|
29
29
|
*/
|
|
@@ -35,7 +35,7 @@ const debug = getParam("debugspectator");
|
|
|
35
35
|
*
|
|
36
36
|
* Debug mode can be enabled with the URL parameter `?debugspectator`, which provides additional console output.
|
|
37
37
|
*
|
|
38
|
-
* @summary
|
|
38
|
+
* @summary Spectator camera for following other users
|
|
39
39
|
* @category Networking
|
|
40
40
|
* @group Components
|
|
41
41
|
*/
|
|
@@ -14,7 +14,7 @@ const debugParam = getParam("debugvoip");
|
|
|
14
14
|
/**
|
|
15
15
|
* The Voice over IP component (VoIP) allows you to send and receive audio streams to other users in the same networked room.
|
|
16
16
|
* It requires a networking connection to be working (e.g. by having an active SyncedRoom component in the scene or by connecting to a room manually).
|
|
17
|
-
* @summary Voice over IP
|
|
17
|
+
* @summary Voice over IP for networked audio communication
|
|
18
18
|
* @category Networking
|
|
19
19
|
* @group Components
|
|
20
20
|
*/
|
|
@@ -30,6 +30,11 @@ export class GltfExportBox extends BoxHelperComponent {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
|
+
* GltfExport is a component that enables exporting selected 3D objects from the scene to the glTF format.
|
|
34
|
+
* You can specify whether to export in binary format (.glb) or JSON format (.gltf), and select specific objects to include in the export.
|
|
35
|
+
* The exported glTF file can be used in various 3D applications and engines that support the glTF standard.
|
|
36
|
+
*
|
|
37
|
+
* @summary Export selected 3D objects to glTF format
|
|
33
38
|
* @category Asset Management
|
|
34
39
|
* @group Components
|
|
35
40
|
*/
|
|
@@ -692,7 +692,7 @@ class ParticlesEmissionState implements EmissionState {
|
|
|
692
692
|
*
|
|
693
693
|
* Needle Engine uses [three.quarks](https://github.com/Alchemist0823/three.quarks) under the hood to handle particles.
|
|
694
694
|
*
|
|
695
|
-
* @summary
|
|
695
|
+
* @summary Handles the motion and rendering of many individual particles
|
|
696
696
|
* @category Rendering
|
|
697
697
|
* @group Components
|
|
698
698
|
*/
|
|
@@ -64,7 +64,7 @@ class AnimationTriggers {
|
|
|
64
64
|
* Button is a UI component that can be clicked by the user to perform an action.
|
|
65
65
|
* It supports different visual states such as normal, highlighted, pressed, and disabled.
|
|
66
66
|
* You can customize the button's appearance using colors or animations for each state.
|
|
67
|
-
* @summary Button
|
|
67
|
+
* @summary UI Button that can be clicked to perform actions
|
|
68
68
|
* @category User Interface
|
|
69
69
|
* @group Components
|
|
70
70
|
*/
|
|
@@ -29,7 +29,7 @@ const debugLayout = getParam("debuguilayout");
|
|
|
29
29
|
* It defines the area where UI elements are rendered and manages their layout and rendering settings.
|
|
30
30
|
* Canvases can be set to render in world space or screen space (overlay or camera).
|
|
31
31
|
* Multiple canvases can exist in a scene, each with its own settings and hierarchy of UI elements.
|
|
32
|
-
* @summary
|
|
32
|
+
* @summary Root component for UI elements, managing layout and rendering settings
|
|
33
33
|
* @category User Interface
|
|
34
34
|
* @group Components
|
|
35
35
|
*/
|
|
@@ -10,7 +10,7 @@ import { type ICanvasGroup, type IHasAlphaFactor } from "./Interfaces.js";
|
|
|
10
10
|
* CanvasGroup is a UI component that allows you to control the transparency and interactivity of a group of UI elements.
|
|
11
11
|
* By adjusting the alpha property, you can fade in or out all child UI elements simultaneously.
|
|
12
12
|
* The interactable and blocksRaycasts properties let you enable or disable user interaction for the entire group.
|
|
13
|
-
* @summary
|
|
13
|
+
* @summary Group UI elements to control transparency and interactivity
|
|
14
14
|
* @category User Interface
|
|
15
15
|
* @group Components
|
|
16
16
|
*/
|
|
@@ -37,7 +37,7 @@ onInitialized((ctx) => {
|
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
39
|
* The EventSystem is responsible for managing and dispatching input events to UI components within the scene.
|
|
40
|
-
* @summary
|
|
40
|
+
* @summary Manages and dispatches input events to UI components
|
|
41
41
|
* @category User Interface
|
|
42
42
|
* @group Components
|
|
43
43
|
*/
|
|
@@ -15,7 +15,7 @@ class Sprite {
|
|
|
15
15
|
* Image is a UI component that displays a sprite (2D image) in the user interface.
|
|
16
16
|
* You can set the image property to assign a texture to be displayed.
|
|
17
17
|
* The sprite can be customized with various properties such as color tinting and pixel density.
|
|
18
|
-
* @summary
|
|
18
|
+
* @summary Display a 2D image in the UI
|
|
19
19
|
* @category User Interface
|
|
20
20
|
* @group Components
|
|
21
21
|
*/
|
|
@@ -13,7 +13,7 @@ const debug = getParam("debuginputfield");
|
|
|
13
13
|
* InputField is a UI component that allows users to enter and edit text.
|
|
14
14
|
* It provides a text input area where users can type, delete, and modify text.
|
|
15
15
|
* The InputField supports placeholder text, events for value changes, and end edit actions.
|
|
16
|
-
* @summary Text
|
|
16
|
+
* @summary Text field for user input
|
|
17
17
|
* @category User Interface
|
|
18
18
|
* @group Components
|
|
19
19
|
*/
|
|
@@ -7,7 +7,7 @@ import { Behaviour } from "../Component.js";
|
|
|
7
7
|
/**
|
|
8
8
|
* Outline is a UI component that adds an outline effect to UI elements.
|
|
9
9
|
* You can customize the outline color and distance to create a visual border around the UI element.
|
|
10
|
-
* @summary
|
|
10
|
+
* @summary Add an outline effect to UI elements
|
|
11
11
|
* @category User Interface
|
|
12
12
|
* @group Components
|
|
13
13
|
*/
|
|
@@ -6,6 +6,13 @@ import { serializable } from '../../engine/engine_serialization.js';
|
|
|
6
6
|
import { getWorldRotation, setWorldRotationXYZ } from '../../engine/engine_three_utils.js';
|
|
7
7
|
import { Behaviour } from '../Component.js';
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* SpatialHtml is a component that allows you to integrate HTML elements into a 3D scene.
|
|
11
|
+
* By specifying the ID of an existing HTML element, you can render it as a 3D object within the scene.
|
|
12
|
+
* @summary Render HTML elements as 3D objects in the scene
|
|
13
|
+
* @category User Interface
|
|
14
|
+
* @group Components
|
|
15
|
+
*/
|
|
9
16
|
export class SpatialHtml extends Behaviour {
|
|
10
17
|
|
|
11
18
|
@serializable()
|