@babylonjs-toolkit/next 9.0.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/README.md +319 -0
- package/lib/blendtreeposition.d.ts +5 -0
- package/lib/blendtreeposition.d.ts.map +1 -0
- package/lib/blendtreeposition.js +5 -0
- package/lib/channelmixerplugin.d.ts +11 -0
- package/lib/channelmixerplugin.d.ts.map +1 -0
- package/lib/channelmixerplugin.js +34 -0
- package/lib/collisioncontact.d.ts +7 -0
- package/lib/collisioncontact.d.ts.map +1 -0
- package/lib/collisioncontact.js +7 -0
- package/lib/collisionfilters.d.ts +10 -0
- package/lib/collisionfilters.d.ts.map +1 -0
- package/lib/collisionfilters.js +10 -0
- package/lib/collisionflags.d.ts +14 -0
- package/lib/collisionflags.d.ts.map +1 -0
- package/lib/collisionflags.js +14 -0
- package/lib/collisionstate.d.ts +8 -0
- package/lib/collisionstate.d.ts.map +1 -0
- package/lib/collisionstate.js +8 -0
- package/lib/customloadingscreen.d.ts +16 -0
- package/lib/customloadingscreen.d.ts.map +1 -0
- package/lib/customloadingscreen.js +48 -0
- package/lib/entitycontroller.d.ts +11 -0
- package/lib/entitycontroller.d.ts.map +1 -0
- package/lib/entitycontroller.js +41 -0
- package/lib/fontmanifestentry.d.ts +8 -0
- package/lib/fontmanifestentry.d.ts.map +1 -0
- package/lib/fontmanifestentry.js +1 -0
- package/lib/handedness.d.ts +6 -0
- package/lib/handedness.d.ts.map +1 -0
- package/lib/handedness.js +6 -0
- package/lib/ianimationcurve.d.ts +14 -0
- package/lib/ianimationcurve.d.ts.map +1 -0
- package/lib/ianimationcurve.js +1 -0
- package/lib/index.d.ts +43 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +42 -0
- package/lib/intersectionprecision.d.ts +5 -0
- package/lib/intersectionprecision.d.ts.map +1 -0
- package/lib/intersectionprecision.js +5 -0
- package/lib/iparticlesystemtransform.d.ts +9 -0
- package/lib/iparticlesystemtransform.d.ts.map +1 -0
- package/lib/iparticlesystemtransform.js +1 -0
- package/lib/irecastnavigationplugin.d.ts +92 -0
- package/lib/irecastnavigationplugin.d.ts.map +1 -0
- package/lib/irecastnavigationplugin.js +1 -0
- package/lib/linesmeshrenderer.d.ts +22 -0
- package/lib/linesmeshrenderer.d.ts.map +1 -0
- package/lib/linesmeshrenderer.js +79 -0
- package/lib/localmessagebus.d.ts +9 -0
- package/lib/localmessagebus.d.ts.map +1 -0
- package/lib/localmessagebus.js +44 -0
- package/lib/lutblendplugin.d.ts +13 -0
- package/lib/lutblendplugin.d.ts.map +1 -0
- package/lib/lutblendplugin.js +153 -0
- package/lib/mousebuttonmode.d.ts +6 -0
- package/lib/mousebuttonmode.d.ts.map +1 -0
- package/lib/mousebuttonmode.js +6 -0
- package/lib/movementtype.d.ts +5 -0
- package/lib/movementtype.d.ts.map +1 -0
- package/lib/movementtype.js +5 -0
- package/lib/noisefunction2d.d.ts +2 -0
- package/lib/noisefunction2d.d.ts.map +1 -0
- package/lib/noisefunction2d.js +1 -0
- package/lib/noisefunction3d.d.ts +2 -0
- package/lib/noisefunction3d.d.ts.map +1 -0
- package/lib/noisefunction3d.js +1 -0
- package/lib/noisefunction4d.d.ts +2 -0
- package/lib/noisefunction4d.d.ts.map +1 -0
- package/lib/noisefunction4d.js +1 -0
- package/lib/perlin2d.d.ts +9 -0
- package/lib/perlin2d.d.ts.map +1 -0
- package/lib/perlin2d.js +45 -0
- package/lib/playercontrol.d.ts +5 -0
- package/lib/playercontrol.d.ts.map +1 -0
- package/lib/playercontrol.js +5 -0
- package/lib/prefabobjectpool.d.ts +20 -0
- package/lib/prefabobjectpool.d.ts.map +1 -0
- package/lib/prefabobjectpool.js +96 -0
- package/lib/randomfn.d.ts +2 -0
- package/lib/randomfn.d.ts.map +1 -0
- package/lib/randomfn.js +1 -0
- package/lib/raycasthitresult.d.ts +21 -0
- package/lib/raycasthitresult.d.ts.map +1 -0
- package/lib/raycasthitresult.js +36 -0
- package/lib/recastclassctor.d.ts +2 -0
- package/lib/recastclassctor.d.ts.map +1 -0
- package/lib/recastclassctor.js +1 -0
- package/lib/roomerrormessage.d.ts +5 -0
- package/lib/roomerrormessage.d.ts.map +1 -0
- package/lib/roomerrormessage.js +2 -0
- package/lib/scenemanager.d.ts +4141 -0
- package/lib/scenemanager.d.ts.map +1 -0
- package/lib/scenemanager.js +29628 -0
- package/lib/simplexnoise.d.ts +21 -0
- package/lib/simplexnoise.d.ts.map +1 -0
- package/lib/simplexnoise.js +362 -0
- package/lib/touchjoystickhandler.d.ts +39 -0
- package/lib/touchjoystickhandler.d.ts.map +1 -0
- package/lib/touchjoystickhandler.js +175 -0
- package/lib/touchmousebutton.d.ts +6 -0
- package/lib/touchmousebutton.d.ts.map +1 -0
- package/lib/touchmousebutton.js +6 -0
- package/lib/treebranchmaterial.d.ts +31 -0
- package/lib/treebranchmaterial.d.ts.map +1 -0
- package/lib/treebranchmaterial.js +369 -0
- package/lib/triggervolume.d.ts +6 -0
- package/lib/triggervolume.d.ts.map +1 -0
- package/lib/triggervolume.js +6 -0
- package/lib/unitydropdownmenu.d.ts +20 -0
- package/lib/unitydropdownmenu.d.ts.map +1 -0
- package/lib/unitydropdownmenu.js +144 -0
- package/lib/unityscrollbar.d.ts +11 -0
- package/lib/unityscrollbar.d.ts.map +1 -0
- package/lib/unityscrollbar.js +38 -0
- package/lib/unityslider.d.ts +4 -0
- package/lib/unityslider.d.ts.map +1 -0
- package/lib/unityslider.js +3 -0
- package/lib/universalcharactercontroller.d.ts +3 -0
- package/lib/universalcharactercontroller.d.ts.map +1 -0
- package/lib/universalcharactercontroller.js +1 -0
- package/lib/universalterrainmaterial.d.ts +48 -0
- package/lib/universalterrainmaterial.d.ts.map +1 -0
- package/lib/universalterrainmaterial.js +639 -0
- package/lib/userinputpointer.d.ts +6 -0
- package/lib/userinputpointer.d.ts.map +1 -0
- package/lib/userinputpointer.js +6 -0
- package/lib/xbox360trigger.d.ts +5 -0
- package/lib/xbox360trigger.d.ts.map +1 -0
- package/lib/xbox360trigger.js +5 -0
- package/package.json +211 -0
package/README.md
ADDED
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
# ESNext Edition
|
|
2
|
+
The <a href="https://www.babylontoolkit.com">Babylon Toolkit</a> is a runtime library extension for BabylonJS development that provides modern programming mechanics with a familiar Unity like scripting model to fast track native web game development.
|
|
3
|
+
|
|
4
|
+
<a href="https://www.npmjs.com/package/babylonjs-toolkit">Classic Edition (UMD)</a>
|
|
5
|
+
<br/>
|
|
6
|
+
<a href="https://github.com/BabylonJS/BabylonToolkit/tree/master/Runtime">Browser Library (CDN)</a>
|
|
7
|
+
<br/>
|
|
8
|
+
<a href="https://github.com/MackeyK24/ES6-StarterAssets">Demo React Project (TSX)</a>
|
|
9
|
+
<br/>
|
|
10
|
+
<a href="https://github.com/MackeyK24/NJS-StarterAssets">Next.js React Project (TSX)</a>
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## Basic Installation
|
|
14
|
+
```bash
|
|
15
|
+
npm install @babylonjs-toolkit/next
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Default Installation (ES6)
|
|
19
|
+
```bash
|
|
20
|
+
npm install @babylonjs/core @babylonjs/gui @babylonjs/loaders @babylonjs/materials @babylonjs/havok @babylonjs-toolkit/next
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
* Default Module Import Libraries
|
|
24
|
+
```javascript
|
|
25
|
+
import { Engine, Scene } from "@babylonjs/core";
|
|
26
|
+
import { HavokPlugin } from "@babylonjs/core/Physics/v2/Plugins/havokPlugin";
|
|
27
|
+
import HavokPhysics from "@babylonjs/havok";
|
|
28
|
+
import { SceneManager, ScriptComponent } from "@babylonjs-toolkit/next";
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
* Granular File Level Import Libraries
|
|
32
|
+
```javascript
|
|
33
|
+
import { Engine } from "@babylonjs/core/Engines/engine";
|
|
34
|
+
import { Scene } from "@babylonjs/core/scene";
|
|
35
|
+
import { HavokPlugin } from "@babylonjs/core/Physics/v2/Plugins/havokPlugin";
|
|
36
|
+
import HavokPhysics from "@babylonjs/havok";
|
|
37
|
+
import { SceneManager } from "@babylonjs-toolkit/next/scenemanager";
|
|
38
|
+
import { ScriptComponent } from "@babylonjs-toolkit/next/scenemanager";
|
|
39
|
+
import { LocalMessageBus } from "@babylonjs-toolkit/next/localmessagebus";
|
|
40
|
+
import { CharacterController } from "@babylonjs-toolkit/next/charactercontroller";
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
* Legacy Global Namespace Import Libraries
|
|
44
|
+
```javascript
|
|
45
|
+
import * as BABYLON from "@babylonjs/core/Legacy/legacy";
|
|
46
|
+
import { HavokPlugin } from "@babylonjs/core/Physics/v2/Plugins/havokPlugin";
|
|
47
|
+
import HavokPhysics from "@babylonjs/havok";
|
|
48
|
+
import * as TOOLKIT from "@babylonjs-toolkit/next";
|
|
49
|
+
TOOLKIT.SceneManager.AutoStripNamespacePrefix = false;
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Navigation Mesh And Pathfinding ([Navigation](https://github.com/MackeyK24/babylon-navigation-mesh))
|
|
53
|
+
|
|
54
|
+
Import Navigation from the babylon-toolkit library:
|
|
55
|
+
```
|
|
56
|
+
import { Navigation } from '@babylonjs-toolkit/next';
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Vite Configuration (ES6)
|
|
60
|
+
|
|
61
|
+
The Vite bundle services behave differently in devmode than production. To preserve some required classes during devmode, these `exclude` and `include` settings are strongly recommended in your vite.config.js settings file.
|
|
62
|
+
|
|
63
|
+
```json
|
|
64
|
+
optimizeDeps: {
|
|
65
|
+
exclude: mode === 'development' ? [
|
|
66
|
+
"@babylonjs/havok",
|
|
67
|
+
"@babylonjs/core",
|
|
68
|
+
"@babylonjs/loaders",
|
|
69
|
+
"@babylonjs/loaders/glTF",
|
|
70
|
+
] : ["@babylonjs/havok"],
|
|
71
|
+
include: mode === 'development' ? [
|
|
72
|
+
"@babylonjs/gui",
|
|
73
|
+
"@babylonjs/materials",
|
|
74
|
+
"@babylonjs/inspector",
|
|
75
|
+
"@babylonjs-toolkit/dlc",
|
|
76
|
+
"@babylonjs-toolkit/next"
|
|
77
|
+
] : [],
|
|
78
|
+
},
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
# 🌳 Tree Shaking
|
|
82
|
+
|
|
83
|
+
The Babylon Toolkit ES6 library is optimized for maximum tree-shaking with **39 separate module files** containing **114 total declarations**. The build system intelligently groups related classes to handle circular dependencies while maintaining optimal bundle sizes.
|
|
84
|
+
|
|
85
|
+
### Key Benefits:
|
|
86
|
+
- ✅ **Smart dependency grouping** - Related classes are bundled together
|
|
87
|
+
- ✅ **Zero unused code** - Only imported classes are included
|
|
88
|
+
- ✅ **Circular dependency handling** - Complex relationships are managed automatically
|
|
89
|
+
- ✅ **Multiple import styles** - Choose the approach that fits your needs
|
|
90
|
+
|
|
91
|
+
## 🚀 Import Methods
|
|
92
|
+
|
|
93
|
+
### Method 1: Main Index Import (Recommended)
|
|
94
|
+
```typescript
|
|
95
|
+
import { SceneManager, ScriptComponent, InputController } from "@babylonjs-toolkit/next";
|
|
96
|
+
```
|
|
97
|
+
- **Pros**: Simple, clean, easy to refactor
|
|
98
|
+
- **Cons**: Bundler must analyze index.js
|
|
99
|
+
- **Use Case**: Most applications, rapid development
|
|
100
|
+
|
|
101
|
+
### Method 2: File-Level Import (Maximum Control)
|
|
102
|
+
```typescript
|
|
103
|
+
import { SceneManager } from "@babylonjs-toolkit/next/scenemanager";
|
|
104
|
+
import { LocalMessageBus } from "@babylonjs-toolkit/next/localmessagebus";
|
|
105
|
+
```
|
|
106
|
+
- **Pros**: Explicit dependencies, maximum bundler hints
|
|
107
|
+
- **Cons**: More verbose, requires knowledge of file structure
|
|
108
|
+
- **Use Case**: Library authors, performance-critical applications
|
|
109
|
+
|
|
110
|
+
## 📦 Module Groups
|
|
111
|
+
|
|
112
|
+
The toolkit is organized into logical groups based on dependency analysis. The main entry point uses file level imports automatically
|
|
113
|
+
|
|
114
|
+
### Core Group (scenemanager.ts)
|
|
115
|
+
The largest group containing the main runtime and interconnected components:
|
|
116
|
+
|
|
117
|
+
**Classes:**
|
|
118
|
+
- `SceneManager` - Main toolkit framework manager
|
|
119
|
+
- `ScriptComponent` - Base class for all script components
|
|
120
|
+
- `PreloadAssetsManager` - Asset preloading management
|
|
121
|
+
- `GlobalMessageBus` - Global messaging system
|
|
122
|
+
- `RequestHeader` - HTTP request utilities
|
|
123
|
+
- `CubeTextureLoader` - Cube texture loading utilities
|
|
124
|
+
- `MetadataParser` - Scene metadata parsing
|
|
125
|
+
- `Utilities` - General utility functions
|
|
126
|
+
- `InputController` - User input management
|
|
127
|
+
- `WindowManager` - Window and screen management
|
|
128
|
+
- `AnimationState` - Animation state machine component
|
|
129
|
+
- `BlendTreeValue` - Animation blend tree values
|
|
130
|
+
- `BlendTreeUtils` - Animation blend tree utilities
|
|
131
|
+
- `BlendTreeSystem` - Animation blend tree system
|
|
132
|
+
- `MachineState` - State machine implementation
|
|
133
|
+
- `TransitionCheck` - Animation transition logic
|
|
134
|
+
- `AnimationMixer` - Animation mixing utilities
|
|
135
|
+
- `BlendingWeights` - Animation blending weights
|
|
136
|
+
- `AudioSource` - Audio playback component
|
|
137
|
+
- `HavokRaycastVehicle` - Havok physics vehicle
|
|
138
|
+
- `HavokWheelInfo` - Vehicle wheel information
|
|
139
|
+
- `HavokVehicleUtilities` - Vehicle utility functions
|
|
140
|
+
- `RaycastVehicle` - Generic raycast vehicle
|
|
141
|
+
- `RigidbodyPhysics` - Physics rigidbody component
|
|
142
|
+
- `PhyscisContainerData` - Physics container data
|
|
143
|
+
|
|
144
|
+
**Interfaces:**
|
|
145
|
+
- `IAssetPreloader` - Asset preloading interface
|
|
146
|
+
- `IWindowMessage` - Window messaging interface
|
|
147
|
+
- `IRuntimeOptions` - Runtime configuration
|
|
148
|
+
- `IUnityTransform` - Unity transform compatibility
|
|
149
|
+
- `IUnityCurve` - Unity animation curve compatibility
|
|
150
|
+
- `IUnityMaterial` - Unity material compatibility
|
|
151
|
+
- `IUnityTexture` - Unity texture compatibility
|
|
152
|
+
- `IUnityCubemap` - Unity cubemap compatibility
|
|
153
|
+
- `IUnityAudioClip` - Unity audio clip compatibility
|
|
154
|
+
- `IUnityVideoClip` - Unity video clip compatibility
|
|
155
|
+
- `IUnityFontAsset` - Unity font asset compatibility
|
|
156
|
+
- `IUnityTextAsset` - Unity text asset compatibility
|
|
157
|
+
- `IUnityDefaultAsset` - Unity default asset compatibility
|
|
158
|
+
- `IUnityVector2` - Unity Vector2 compatibility
|
|
159
|
+
- `IUnityVector3` - Unity Vector3 compatibility
|
|
160
|
+
- `IUnityVector4` - Unity Vector4 compatibility
|
|
161
|
+
- `IUnityColor` - Unity Color compatibility
|
|
162
|
+
- `UserInputPress` - User input press interface
|
|
163
|
+
- `KeymapState` - Input keymap state
|
|
164
|
+
- `IAnimatorEvent` - Animation event interface
|
|
165
|
+
- `IAvatarMask` - Animation avatar mask
|
|
166
|
+
- `IAnimationLayer` - Animation layer interface
|
|
167
|
+
- `IBehaviour` - Animation behavior interface
|
|
168
|
+
- `ITransition` - Animation transition interface
|
|
169
|
+
- `ICondition` - Animation condition interface
|
|
170
|
+
- `IBlendTree` - Animation blend tree interface
|
|
171
|
+
- `IBlendTreeChild` - Blend tree child interface
|
|
172
|
+
- `IPhysicsShapeCastResult` - Physics shape cast result
|
|
173
|
+
- `IPhysicsShapeCastQuery` - Physics shape cast query
|
|
174
|
+
|
|
175
|
+
**Types:**
|
|
176
|
+
- `UserInputAction` - User input action callback type
|
|
177
|
+
|
|
178
|
+
**Enums:**
|
|
179
|
+
- `System` - System type enumeration
|
|
180
|
+
- `SearchType` - Search functionality types
|
|
181
|
+
- `PlayerNumber` - Player identification
|
|
182
|
+
- `RenderQuality` - Graphics quality settings
|
|
183
|
+
- `GamepadType` - Controller types
|
|
184
|
+
- `UserInputAxis` - Input axis enumeration
|
|
185
|
+
- `UserInputKey` - Input key enumeration
|
|
186
|
+
- `MaterialAlphaMode` - Material alpha blending modes
|
|
187
|
+
- `DragDirection` - Touch drag directions
|
|
188
|
+
- `PinchZoomState` - Pinch zoom states
|
|
189
|
+
- `MotionType` - Animation motion types
|
|
190
|
+
- `ConditionMode` - Animation condition modes
|
|
191
|
+
- `InterruptionSource` - Animation interruption sources
|
|
192
|
+
- `BlendTreeType` - Animation blend tree types
|
|
193
|
+
- `AnimatorParameterType` - Animation parameter types
|
|
194
|
+
|
|
195
|
+
### Standalone Component Groups
|
|
196
|
+
|
|
197
|
+
The remaining components are organized into standalone modules for optimal tree-shaking:
|
|
198
|
+
|
|
199
|
+
#### Animation & Media Components
|
|
200
|
+
- `ShurikenParticles` - Particle system component
|
|
201
|
+
- `WebVideoPlayer` - Video playback component
|
|
202
|
+
|
|
203
|
+
#### Character Controllers
|
|
204
|
+
- `CharacterController` - Physics-based character controller
|
|
205
|
+
- `SimpleCharacterController` - Basic character movement
|
|
206
|
+
- `RecastCharacterController` - Navigation mesh character controller
|
|
207
|
+
- `NavigationAgent` - Navigation mesh agent
|
|
208
|
+
- `UniversalCharacterController` - Universal character controller type
|
|
209
|
+
|
|
210
|
+
#### Terrain & Environment
|
|
211
|
+
- `TerrainGenerator` - Procedural terrain generation
|
|
212
|
+
- `UniversalTerrainMaterial` - Advanced terrain material
|
|
213
|
+
- `UniversalTerrainMaterialPlugin` - Terrain material plugin
|
|
214
|
+
|
|
215
|
+
#### Material & Rendering Systems
|
|
216
|
+
- `CustomShaderMaterial` - Custom shader material system
|
|
217
|
+
- `CustomShaderMaterialPlugin` - Custom shader material plugin
|
|
218
|
+
- `CustomLoadingScreen` - Custom loading screen implementation
|
|
219
|
+
- `LinesMeshRenderer` - Line rendering utilities
|
|
220
|
+
|
|
221
|
+
#### Input & Control Enums
|
|
222
|
+
- `Handedness` - Hand preference enumeration
|
|
223
|
+
- `PlayerControl` - Player control types
|
|
224
|
+
- `Xbox360Trigger` - Xbox controller trigger enumeration
|
|
225
|
+
- `MovementType` - Character movement types
|
|
226
|
+
- `MouseButtonMode` - Mouse button interaction modes
|
|
227
|
+
- `TouchMouseButton` - Touch to mouse button mapping
|
|
228
|
+
- `UserInputPointer` - Input pointer types
|
|
229
|
+
|
|
230
|
+
#### Physics & Collision Systems
|
|
231
|
+
- `CollisionContact` - Collision contact types
|
|
232
|
+
- `CollisionState` - Collision state enumeration
|
|
233
|
+
- `CollisionFlags` - Physics collision flags
|
|
234
|
+
- `CollisionFilters` - Collision filtering system
|
|
235
|
+
- `IntersectionPrecision` - Ray intersection precision
|
|
236
|
+
|
|
237
|
+
#### Animation & UI Types
|
|
238
|
+
- `BlendTreePosition` - Animation blend tree positioning
|
|
239
|
+
- `IAnimationCurve` - Animation curve interface
|
|
240
|
+
- `IAnimationKeyframe` - Animation keyframe interface
|
|
241
|
+
- `TouchJoystickHandler` - Touch joystick input handler
|
|
242
|
+
|
|
243
|
+
#### Data Structures & Results
|
|
244
|
+
- `RaycastHitResult` - Ray casting result data
|
|
245
|
+
- `TriggerVolume` - Physics trigger volume
|
|
246
|
+
- `RoomErrorMessage` - Network room error messaging
|
|
247
|
+
- `PrefabObjectPool` - Object pooling system
|
|
248
|
+
- `LocalMessageBus` - Local messaging system
|
|
249
|
+
- `EntityController` - Entity management controller
|
|
250
|
+
|
|
251
|
+
## 🎯 Best Practices
|
|
252
|
+
|
|
253
|
+
### 1. Start Small
|
|
254
|
+
Begin with minimal imports and add components as needed:
|
|
255
|
+
```typescript
|
|
256
|
+
// Start with this
|
|
257
|
+
import { SceneManager } from "@babylonjs-toolkit/next";
|
|
258
|
+
|
|
259
|
+
// Add components incrementally
|
|
260
|
+
import { SceneManager, InputController } from "@babylonjs-toolkit/next";
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
### 2. Group Related Imports
|
|
264
|
+
Import related functionality together:
|
|
265
|
+
```typescript
|
|
266
|
+
// Good - related physics components
|
|
267
|
+
import {
|
|
268
|
+
CharacterController,
|
|
269
|
+
RigidbodyPhysics,
|
|
270
|
+
CollisionState
|
|
271
|
+
} from "@babylonjs-toolkit/next";
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
### 3. Use File-Level Imports For Maximum Control
|
|
275
|
+
When bundle size is critical:
|
|
276
|
+
```typescript
|
|
277
|
+
// Maximum tree-shaking for production
|
|
278
|
+
import { SceneManager } from "@babylonjs-toolkit/next/scenemanager";
|
|
279
|
+
|
|
280
|
+
// Character Controllers
|
|
281
|
+
import { CharacterController } from "@babylonjs-toolkit/next/scenemanager";
|
|
282
|
+
import { SimpleCharacterController } from "@babylonjs-toolkit/next/scenemanager";
|
|
283
|
+
import { RecastCharacterController } from "@babylonjs-toolkit/next/scenemanager";
|
|
284
|
+
|
|
285
|
+
// Animation & Media Components
|
|
286
|
+
import { ShurikenParticles } from "@babylonjs-toolkit/next/shurikenparticles";
|
|
287
|
+
import { WebVideoPlayer } from "@babylonjs-toolkit/next/webvideoplayer";
|
|
288
|
+
|
|
289
|
+
// Terrain & Environment
|
|
290
|
+
import { TerrainGenerator } from "@babylonjs-toolkit/next/terraingenerator";
|
|
291
|
+
import { UniversalTerrainMaterial } from "@babylonjs-toolkit/next/universalterrainmaterial";
|
|
292
|
+
|
|
293
|
+
// Material Systems
|
|
294
|
+
import { CustomShaderMaterial } from "@babylonjs-toolkit/next/customshadermaterial";
|
|
295
|
+
import { CustomShaderMaterialPlugin } from "@babylonjs-toolkit/next/customshadermaterialplugin";
|
|
296
|
+
|
|
297
|
+
// Utility Classes
|
|
298
|
+
import { CustomLoadingScreen } from "@babylonjs-toolkit/next/customloadingscreen";
|
|
299
|
+
import { PrefabObjectPool } from "@babylonjs-toolkit/next/prefabobjectpool";
|
|
300
|
+
import { LocalMessageBus } from "@babylonjs-toolkit/next/localmessagebus";
|
|
301
|
+
import { LinesMeshRenderer } from "@babylonjs-toolkit/next/linesmeshrenderer";
|
|
302
|
+
|
|
303
|
+
// Enums & Types (Smallest Imports)
|
|
304
|
+
import { Handedness } from "@babylonjs-toolkit/next/handedness";
|
|
305
|
+
import { PlayerControl } from "@babylonjs-toolkit/next/playercontrol";
|
|
306
|
+
import { MovementType } from "@babylonjs-toolkit/next/movementtype";
|
|
307
|
+
import { CollisionContact } from "@babylonjs-toolkit/next/collisioncontact";
|
|
308
|
+
import { BlendTreePosition } from "@babylonjs-toolkit/next/blendtreeposition";
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
### 4. Analyze Your Bundle
|
|
312
|
+
Use your bundler's analysis tools to verify tree-shaking:
|
|
313
|
+
```bash
|
|
314
|
+
# Vite bundle analysis
|
|
315
|
+
npm run build -- --mode production
|
|
316
|
+
|
|
317
|
+
# Webpack bundle analyzer
|
|
318
|
+
npm install --save-dev webpack-bundle-analyzer
|
|
319
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blendtreeposition.d.ts","sourceRoot":"","sources":["../src/blendtreeposition.ts"],"names":[],"mappings":"AACA,oBAAY,iBAAiB;IACrB,KAAK,IAAI;IACT,KAAK,IAAI;CACZ"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Scene } from '@babylonjs/core/scene';
|
|
2
|
+
import { Camera } from '@babylonjs/core/Cameras/camera';
|
|
3
|
+
import { PostProcess } from '@babylonjs/core';
|
|
4
|
+
export declare class ChannelMixerPlugin {
|
|
5
|
+
static CreatePostProcess(scene: Scene, camera: Camera, options?: {
|
|
6
|
+
red?: number[];
|
|
7
|
+
green?: number[];
|
|
8
|
+
blue?: number[];
|
|
9
|
+
}): PostProcess;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=channelmixerplugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channelmixerplugin.d.ts","sourceRoot":"","sources":["../src/channelmixerplugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAExD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG9C,qBAAa,kBAAkB;WAKT,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QACpE,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;QACjB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;KAClB;CAiCJ"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Texture } from '@babylonjs/core/Materials/Textures/texture';
|
|
2
|
+
import { PostProcess } from '@babylonjs/core';
|
|
3
|
+
export class ChannelMixerPlugin {
|
|
4
|
+
static CreatePostProcess(scene, camera, options) {
|
|
5
|
+
const opts = options || {};
|
|
6
|
+
const red = opts.red || [1, 0, 0];
|
|
7
|
+
const green = opts.green || [0, 1, 0];
|
|
8
|
+
const blue = opts.blue || [0, 0, 1];
|
|
9
|
+
const fragment = `
|
|
10
|
+
precision highp float;
|
|
11
|
+
varying vec2 vUV;
|
|
12
|
+
uniform sampler2D textureSampler;
|
|
13
|
+
uniform vec3 redMix;
|
|
14
|
+
uniform vec3 greenMix;
|
|
15
|
+
uniform vec3 blueMix;
|
|
16
|
+
|
|
17
|
+
void main(void) {
|
|
18
|
+
vec4 sceneColor = texture2D(textureSampler, vUV);
|
|
19
|
+
vec3 rgb = sceneColor.rgb;
|
|
20
|
+
float newR = dot(rgb, redMix);
|
|
21
|
+
float newG = dot(rgb, greenMix);
|
|
22
|
+
float newB = dot(rgb, blueMix);
|
|
23
|
+
gl_FragColor = vec4(newR, newG, newB, sceneColor.a);
|
|
24
|
+
}
|
|
25
|
+
`;
|
|
26
|
+
const post = new PostProcess("channelMixer", fragment, ["redMix", "greenMix", "blueMix"], [], 1.0, camera, Texture.BILINEAR_SAMPLINGMODE, scene.getEngine(), false);
|
|
27
|
+
post.onApply = (effect) => {
|
|
28
|
+
effect.setFloat3('redMix', red[0] || 1, red[1] || 0, red[2] || 0);
|
|
29
|
+
effect.setFloat3('greenMix', green[0] || 0, green[1] || 1, green[2] || 0);
|
|
30
|
+
effect.setFloat3('blueMix', blue[0] || 0, blue[1] || 0, blue[2] || 1);
|
|
31
|
+
};
|
|
32
|
+
return post;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collisioncontact.d.ts","sourceRoot":"","sources":["../src/collisioncontact.ts"],"names":[],"mappings":"AACA,oBAAY,gBAAgB;IACpB,GAAG,IAAI;IACP,IAAI,IAAI;IACR,KAAK,IAAI;IACT,MAAM,IAAI;CACb"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export var CollisionContact;
|
|
2
|
+
(function (CollisionContact) {
|
|
3
|
+
CollisionContact[CollisionContact["Top"] = 0] = "Top";
|
|
4
|
+
CollisionContact[CollisionContact["Left"] = 1] = "Left";
|
|
5
|
+
CollisionContact[CollisionContact["Right"] = 2] = "Right";
|
|
6
|
+
CollisionContact[CollisionContact["Bottom"] = 3] = "Bottom";
|
|
7
|
+
})(CollisionContact || (CollisionContact = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collisionfilters.d.ts","sourceRoot":"","sources":["../src/collisionfilters.ts"],"names":[],"mappings":"AACA,oBAAY,gBAAgB;IACpB,aAAa,IAAI;IACjB,YAAY,IAAI;IAChB,eAAe,IAAI;IACnB,YAAY,IAAI;IAChB,aAAa,KAAK;IAClB,eAAe,KAAK;IACpB,SAAS,KAAK;CACjB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export var CollisionFilters;
|
|
2
|
+
(function (CollisionFilters) {
|
|
3
|
+
CollisionFilters[CollisionFilters["DefaultFilter"] = 1] = "DefaultFilter";
|
|
4
|
+
CollisionFilters[CollisionFilters["StaticFilter"] = 2] = "StaticFilter";
|
|
5
|
+
CollisionFilters[CollisionFilters["KinematicFilter"] = 4] = "KinematicFilter";
|
|
6
|
+
CollisionFilters[CollisionFilters["DebrisFilter"] = 8] = "DebrisFilter";
|
|
7
|
+
CollisionFilters[CollisionFilters["SensorTrigger"] = 16] = "SensorTrigger";
|
|
8
|
+
CollisionFilters[CollisionFilters["CharacterFilter"] = 32] = "CharacterFilter";
|
|
9
|
+
CollisionFilters[CollisionFilters["AllFilter"] = -1] = "AllFilter";
|
|
10
|
+
})(CollisionFilters || (CollisionFilters = {}));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare enum CollisionFlags {
|
|
2
|
+
CF_STATIC_OBJECT = 1,
|
|
3
|
+
CF_KINEMATIC_OBJECT = 2,
|
|
4
|
+
CF_NO_CONTACT_RESPONSE = 4,
|
|
5
|
+
CF_CUSTOM_MATERIAL_CALLBACK = 8,
|
|
6
|
+
CF_CHARACTER_OBJECT = 16,
|
|
7
|
+
CF_DISABLE_VISUALIZE_OBJECT = 32,
|
|
8
|
+
CF_DISABLE_SPU_COLLISION_PROCESSING = 64,
|
|
9
|
+
CF_HAS_CONTACT_STIFFNESS_DAMPING = 128,
|
|
10
|
+
CF_HAS_CUSTOM_DEBUG_RENDERING_COLOR = 256,
|
|
11
|
+
CF_HAS_FRICTION_ANCHOR = 512,
|
|
12
|
+
CF_HAS_COLLISION_SOUND_TRIGGER = 1024
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=collisionflags.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collisionflags.d.ts","sourceRoot":"","sources":["../src/collisionflags.ts"],"names":[],"mappings":"AACA,oBAAY,cAAc;IAClB,gBAAgB,IAAI;IACpB,mBAAmB,IAAI;IACvB,sBAAsB,IAAI;IAC1B,2BAA2B,IAAI;IAC/B,mBAAmB,KAAK;IACxB,2BAA2B,KAAK;IAChC,mCAAmC,KAAK;IACxC,gCAAgC,MAAM;IACtC,mCAAmC,MAAM;IACzC,sBAAsB,MAAM;IAC5B,8BAA8B,OAAO;CACxC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export var CollisionFlags;
|
|
2
|
+
(function (CollisionFlags) {
|
|
3
|
+
CollisionFlags[CollisionFlags["CF_STATIC_OBJECT"] = 1] = "CF_STATIC_OBJECT";
|
|
4
|
+
CollisionFlags[CollisionFlags["CF_KINEMATIC_OBJECT"] = 2] = "CF_KINEMATIC_OBJECT";
|
|
5
|
+
CollisionFlags[CollisionFlags["CF_NO_CONTACT_RESPONSE"] = 4] = "CF_NO_CONTACT_RESPONSE";
|
|
6
|
+
CollisionFlags[CollisionFlags["CF_CUSTOM_MATERIAL_CALLBACK"] = 8] = "CF_CUSTOM_MATERIAL_CALLBACK";
|
|
7
|
+
CollisionFlags[CollisionFlags["CF_CHARACTER_OBJECT"] = 16] = "CF_CHARACTER_OBJECT";
|
|
8
|
+
CollisionFlags[CollisionFlags["CF_DISABLE_VISUALIZE_OBJECT"] = 32] = "CF_DISABLE_VISUALIZE_OBJECT";
|
|
9
|
+
CollisionFlags[CollisionFlags["CF_DISABLE_SPU_COLLISION_PROCESSING"] = 64] = "CF_DISABLE_SPU_COLLISION_PROCESSING";
|
|
10
|
+
CollisionFlags[CollisionFlags["CF_HAS_CONTACT_STIFFNESS_DAMPING"] = 128] = "CF_HAS_CONTACT_STIFFNESS_DAMPING";
|
|
11
|
+
CollisionFlags[CollisionFlags["CF_HAS_CUSTOM_DEBUG_RENDERING_COLOR"] = 256] = "CF_HAS_CUSTOM_DEBUG_RENDERING_COLOR";
|
|
12
|
+
CollisionFlags[CollisionFlags["CF_HAS_FRICTION_ANCHOR"] = 512] = "CF_HAS_FRICTION_ANCHOR";
|
|
13
|
+
CollisionFlags[CollisionFlags["CF_HAS_COLLISION_SOUND_TRIGGER"] = 1024] = "CF_HAS_COLLISION_SOUND_TRIGGER";
|
|
14
|
+
})(CollisionFlags || (CollisionFlags = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collisionstate.d.ts","sourceRoot":"","sources":["../src/collisionstate.ts"],"names":[],"mappings":"AACA,oBAAY,cAAc;IAClB,UAAU,IAAI;IACd,eAAe,IAAI;IACnB,kBAAkB,IAAI;IACtB,oBAAoB,IAAI;IACxB,kBAAkB,IAAI;CACzB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export var CollisionState;
|
|
2
|
+
(function (CollisionState) {
|
|
3
|
+
CollisionState[CollisionState["ACTIVE_TAG"] = 1] = "ACTIVE_TAG";
|
|
4
|
+
CollisionState[CollisionState["ISLAND_SLEEPING"] = 2] = "ISLAND_SLEEPING";
|
|
5
|
+
CollisionState[CollisionState["WANTS_DEACTIVATION"] = 3] = "WANTS_DEACTIVATION";
|
|
6
|
+
CollisionState[CollisionState["DISABLE_DEACTIVATION"] = 4] = "DISABLE_DEACTIVATION";
|
|
7
|
+
CollisionState[CollisionState["DISABLE_SIMULATION"] = 5] = "DISABLE_SIMULATION";
|
|
8
|
+
})(CollisionState || (CollisionState = {}));
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ILoadingScreen } from '@babylonjs/core/Loading/loadingScreen';
|
|
2
|
+
export declare class CustomLoadingScreen implements ILoadingScreen {
|
|
3
|
+
loadingDivId: string;
|
|
4
|
+
loadingUIText: string;
|
|
5
|
+
hideLoadingUIWithEngine: boolean;
|
|
6
|
+
customInnerHtml: string;
|
|
7
|
+
customInnerCss: string;
|
|
8
|
+
loadingUIBackgroundColor: string;
|
|
9
|
+
constructor(loadingDivId: string, loadingUIText: string, hideLoadingUIWithEngine?: boolean, customInnerHtml?: string, customInnerCss?: string);
|
|
10
|
+
displayLoadingUI(): void;
|
|
11
|
+
hideLoadingUI(): void;
|
|
12
|
+
showLoadingDiv(show: boolean): void;
|
|
13
|
+
getLoadingDiv(): HTMLDivElement;
|
|
14
|
+
hasLoadingDiv(): boolean;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=customloadingscreen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customloadingscreen.d.ts","sourceRoot":"","sources":["../src/customloadingscreen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAGvE,qBAAa,mBAAoB,YAAW,cAAc;IAE/B,YAAY,EAAE,MAAM;IAAS,aAAa,EAAE,MAAM;IAAS,uBAAuB,EAAE,OAAO;IAAgB,eAAe,EAAE,MAAM;IAAgB,cAAc,EAAE,MAAM;IADpL,wBAAwB,EAAE,MAAM,CAAa;gBACjC,YAAY,EAAE,MAAM,EAAS,aAAa,EAAE,MAAM,EAAS,uBAAuB,GAAE,OAAc,EAAS,eAAe,GAAE,MAAa,EAAS,cAAc,GAAE,MAAa;IAQ3L,gBAAgB,IAAI,IAAI;IAkBxB,aAAa,IAAI,IAAI;IAKrB,cAAc,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI;IAInC,aAAa,IAAI,cAAc;IAG/B,aAAa,IAAI,OAAO;CAGlC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export class CustomLoadingScreen {
|
|
2
|
+
constructor(loadingDivId, loadingUIText, hideLoadingUIWithEngine = true, customInnerHtml = null, customInnerCss = null) {
|
|
3
|
+
this.loadingDivId = loadingDivId;
|
|
4
|
+
this.loadingUIText = loadingUIText;
|
|
5
|
+
this.hideLoadingUIWithEngine = hideLoadingUIWithEngine;
|
|
6
|
+
this.customInnerHtml = customInnerHtml;
|
|
7
|
+
this.customInnerCss = customInnerCss;
|
|
8
|
+
this.loadingUIBackgroundColor = "#000000";
|
|
9
|
+
if (this.loadingDivId == null || this.loadingDivId === "") {
|
|
10
|
+
this.loadingDivId = "customLoadingScreen";
|
|
11
|
+
}
|
|
12
|
+
if (this.loadingUIText == null || this.loadingUIText === "") {
|
|
13
|
+
this.loadingUIText = "Please Wait";
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
displayLoadingUI() {
|
|
17
|
+
if (this.hasLoadingDiv()) {
|
|
18
|
+
this.showLoadingDiv(true);
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const defaultLoadingScreenCss = "";
|
|
22
|
+
const customLoadingScreenCss = document.createElement("style");
|
|
23
|
+
customLoadingScreenCss.type = "text/css";
|
|
24
|
+
customLoadingScreenCss.innerHTML = (this.customInnerCss || defaultLoadingScreenCss);
|
|
25
|
+
document.getElementsByTagName("head")[0].appendChild(customLoadingScreenCss);
|
|
26
|
+
const defaultLoadingScreenDiv = this.loadingUIText;
|
|
27
|
+
const customLoadingScreenDiv = document.createElement("div");
|
|
28
|
+
customLoadingScreenDiv.id = this.loadingDivId;
|
|
29
|
+
customLoadingScreenDiv.innerHTML = (this.customInnerHtml || defaultLoadingScreenDiv);
|
|
30
|
+
document.body.appendChild(customLoadingScreenDiv);
|
|
31
|
+
}
|
|
32
|
+
hideLoadingUI() {
|
|
33
|
+
if (this.hideLoadingUIWithEngine === true) {
|
|
34
|
+
this.showLoadingDiv(false);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
showLoadingDiv(show) {
|
|
38
|
+
const loadingDiv = this.getLoadingDiv();
|
|
39
|
+
if (loadingDiv != null)
|
|
40
|
+
loadingDiv.style.display = (show) ? "initial" : "none";
|
|
41
|
+
}
|
|
42
|
+
getLoadingDiv() {
|
|
43
|
+
return document.getElementById(this.loadingDivId);
|
|
44
|
+
}
|
|
45
|
+
hasLoadingDiv() {
|
|
46
|
+
return (document.getElementById(this.loadingDivId) != null);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TransformNode } from '@babylonjs/core/Meshes/transformNode';
|
|
2
|
+
export declare class EntityController {
|
|
3
|
+
static HasNetworkEntity(transform: TransformNode): boolean;
|
|
4
|
+
static GetNetworkEntityId(transform: TransformNode): string;
|
|
5
|
+
static GetNetworkEntityType(transform: TransformNode): number;
|
|
6
|
+
static GetNetworkEntitySessionId(transform: TransformNode): string;
|
|
7
|
+
static QueryNetworkAttribute(transform: TransformNode, key: string): string;
|
|
8
|
+
static QueryBufferedAttribute(transform: TransformNode, index: number): number;
|
|
9
|
+
static PostBufferedAttribute(transform: TransformNode, index: number, value: number): void;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=entitycontroller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entitycontroller.d.ts","sourceRoot":"","sources":["../src/entitycontroller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAErE,qBAAa,gBAAgB;WAEP,gBAAgB,CAAC,SAAS,EAAE,aAAa,GAAG,OAAO;WAKnD,kBAAkB,CAAC,SAAS,EAAE,aAAa,GAAG,MAAM;WAKpD,oBAAoB,CAAC,SAAS,EAAE,aAAa,GAAG,MAAM;WAKtD,yBAAyB,CAAC,SAAS,EAAE,aAAa,GAAG,MAAM;WAK3D,qBAAqB,CAAC,SAAS,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM;WAQpE,sBAAsB,CAAC,SAAS,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM;WAQvE,qBAAqB,CAAC,SAAS,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;CAIpG"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export class EntityController {
|
|
2
|
+
static HasNetworkEntity(transform) {
|
|
3
|
+
if (transform == null)
|
|
4
|
+
return false;
|
|
5
|
+
return (transform.networkEntity != null);
|
|
6
|
+
}
|
|
7
|
+
static GetNetworkEntityId(transform) {
|
|
8
|
+
if (transform == null)
|
|
9
|
+
return null;
|
|
10
|
+
return (transform.networkEntity != null) ? transform.networkEntity.id : null;
|
|
11
|
+
}
|
|
12
|
+
static GetNetworkEntityType(transform) {
|
|
13
|
+
if (transform == null)
|
|
14
|
+
return 0;
|
|
15
|
+
return (transform.networkEntityType != null) ? transform.networkEntityType : 0;
|
|
16
|
+
}
|
|
17
|
+
static GetNetworkEntitySessionId(transform) {
|
|
18
|
+
if (transform == null)
|
|
19
|
+
return null;
|
|
20
|
+
return (transform.networkEntity != null) ? transform.networkEntity.ownerId : null;
|
|
21
|
+
}
|
|
22
|
+
static QueryNetworkAttribute(transform, key) {
|
|
23
|
+
let result = null;
|
|
24
|
+
if (transform != null && transform.networkEntity != null && transform.networkEntity.attributes != null) {
|
|
25
|
+
result = transform.networkEntity.attributes.get(key);
|
|
26
|
+
}
|
|
27
|
+
return result;
|
|
28
|
+
}
|
|
29
|
+
static QueryBufferedAttribute(transform, index) {
|
|
30
|
+
let result = 0;
|
|
31
|
+
if (transform != null && transform.networkEntityAttributeBuffer != null) {
|
|
32
|
+
result = transform.networkEntityAttributeBuffer[index.toFixed(0)];
|
|
33
|
+
}
|
|
34
|
+
return result;
|
|
35
|
+
}
|
|
36
|
+
static PostBufferedAttribute(transform, index, value) {
|
|
37
|
+
if (transform.networkEntityBatch == null)
|
|
38
|
+
transform.networkEntityBatch = {};
|
|
39
|
+
transform.networkEntityBatch[index.toFixed(0)] = value;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fontmanifestentry.d.ts","sourceRoot":"","sources":["../src/fontmanifestentry.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,iBAAiB;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handedness.d.ts","sourceRoot":"","sources":["../src/handedness.ts"],"names":[],"mappings":"AACA,oBAAY,UAAU;IACd,OAAO,KAAK;IACZ,KAAK,IAAI;IACT,IAAI,IAAI;CACX"}
|