@onerjs/core 8.55.8 → 8.55.9
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/Animations/animation.pure.js +2 -2
- package/Animations/animation.pure.js.map +1 -1
- package/Animations/runtimeAnimation.js +4 -0
- package/Animations/runtimeAnimation.js.map +1 -1
- package/Behaviors/Cameras/autoRotationBehavior.js +1 -1
- package/Behaviors/Cameras/autoRotationBehavior.js.map +1 -1
- package/Behaviors/Meshes/followBehavior.js +1 -0
- package/Behaviors/Meshes/followBehavior.js.map +1 -1
- package/Behaviors/Meshes/surfaceMagnetismBehavior.js +1 -0
- package/Behaviors/Meshes/surfaceMagnetismBehavior.js.map +1 -1
- package/Cameras/Inputs/followCameraMouseWheelInput.js +2 -2
- package/Cameras/Inputs/followCameraMouseWheelInput.js.map +1 -1
- package/Cameras/Inputs/followCameraPointersInput.d.ts +15 -0
- package/Cameras/Inputs/followCameraPointersInput.js +18 -3
- package/Cameras/Inputs/followCameraPointersInput.js.map +1 -1
- package/Cameras/Stereoscopic/stereoscopicScreenUniversalCamera.js +1 -1
- package/Cameras/Stereoscopic/stereoscopicScreenUniversalCamera.js.map +1 -1
- package/Cameras/Stereoscopic/stereoscopicUniversalCamera.pure.js +1 -1
- package/Cameras/Stereoscopic/stereoscopicUniversalCamera.pure.js.map +1 -1
- package/Cameras/arcRotateCamera.pure.js +1 -1
- package/Cameras/arcRotateCamera.pure.js.map +1 -1
- package/Collisions/gpuPicker.d.ts +1 -0
- package/Collisions/gpuPicker.js +5 -4
- package/Collisions/gpuPicker.js.map +1 -1
- package/Culling/Helper/boundingInfoHelper.js +1 -1
- package/Culling/Helper/boundingInfoHelper.js.map +1 -1
- package/Culling/boundingSphere.js +7 -4
- package/Culling/boundingSphere.js.map +1 -1
- package/Engines/Extensions/engine.prefilteredCubeTexture.pure.js +1 -1
- package/Engines/Extensions/engine.prefilteredCubeTexture.pure.js.map +1 -1
- package/Engines/Native/Extensions/nativeEngine.cubeTexture.pure.js +48 -6
- package/Engines/Native/Extensions/nativeEngine.cubeTexture.pure.js.map +1 -1
- package/Engines/Native/nativeInterfaces.d.ts +1 -1
- package/Engines/Native/nativeInterfaces.js.map +1 -1
- package/Engines/abstractEngine.pure.js +2 -2
- package/Engines/abstractEngine.pure.js.map +1 -1
- package/Engines/engine.d.ts +10 -1
- package/Engines/thinNativeEngine.pure.d.ts +6 -1
- package/Engines/thinNativeEngine.pure.js +29 -2
- package/Engines/thinNativeEngine.pure.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphIsKeyPressedBlock.d.ts +3 -63
- package/FlowGraph/Blocks/Data/flowGraphIsKeyPressedBlock.js +5 -71
- package/FlowGraph/Blocks/Data/flowGraphIsKeyPressedBlock.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphIsKeyPressedBlock.pure.d.ts +71 -0
- package/FlowGraph/Blocks/Data/flowGraphIsKeyPressedBlock.pure.js +86 -0
- package/FlowGraph/Blocks/Data/flowGraphIsKeyPressedBlock.pure.js.map +1 -0
- package/FlowGraph/Blocks/Data/pure.d.ts +1 -0
- package/FlowGraph/Blocks/Data/pure.js +1 -0
- package/FlowGraph/Blocks/Data/pure.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphKeyDownEventBlock.d.ts +3 -37
- package/FlowGraph/Blocks/Event/flowGraphKeyDownEventBlock.js +5 -39
- package/FlowGraph/Blocks/Event/flowGraphKeyDownEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphKeyDownEventBlock.pure.d.ts +45 -0
- package/FlowGraph/Blocks/Event/flowGraphKeyDownEventBlock.pure.js +54 -0
- package/FlowGraph/Blocks/Event/flowGraphKeyDownEventBlock.pure.js.map +1 -0
- package/FlowGraph/Blocks/Event/flowGraphKeyUpEventBlock.d.ts +3 -17
- package/FlowGraph/Blocks/Event/flowGraphKeyUpEventBlock.js +5 -22
- package/FlowGraph/Blocks/Event/flowGraphKeyUpEventBlock.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphKeyUpEventBlock.pure.d.ts +25 -0
- package/FlowGraph/Blocks/Event/flowGraphKeyUpEventBlock.pure.js +37 -0
- package/FlowGraph/Blocks/Event/flowGraphKeyUpEventBlock.pure.js.map +1 -0
- package/FlowGraph/Blocks/Event/pure.d.ts +2 -0
- package/FlowGraph/Blocks/Event/pure.js +2 -0
- package/FlowGraph/Blocks/Event/pure.js.map +1 -1
- package/FlowGraph/Blocks/flowGraphBlockFactory.d.ts +1 -1
- package/FlowGraph/Blocks/flowGraphBlockFactory.js +198 -172
- package/FlowGraph/Blocks/flowGraphBlockFactory.js.map +1 -1
- package/FrameGraph/frameGraph.js +10 -1
- package/FrameGraph/frameGraph.js.map +1 -1
- package/Gamepads/gamepadManager.d.ts +1 -0
- package/Gamepads/gamepadManager.js +5 -2
- package/Gamepads/gamepadManager.js.map +1 -1
- package/Gizmos/scaleGizmo.js +1 -0
- package/Gizmos/scaleGizmo.js.map +1 -1
- package/Lights/IES/iesLoader.js +6 -8
- package/Lights/IES/iesLoader.js.map +1 -1
- package/Lights/Shadows/cascadedShadowGenerator.pure.js +4 -6
- package/Lights/Shadows/cascadedShadowGenerator.pure.js.map +1 -1
- package/Lights/Shadows/shadowGenerator.js +2 -2
- package/Lights/Shadows/shadowGenerator.js.map +1 -1
- package/Lights/light.js +3 -5
- package/Lights/light.js.map +1 -1
- package/Lights/spotLight.pure.js +1 -1
- package/Lights/spotLight.pure.js.map +1 -1
- package/Materials/Background/backgroundMaterial.pure.d.ts +1 -1
- package/Materials/Background/backgroundMaterial.pure.js +3 -12
- package/Materials/Background/backgroundMaterial.pure.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js +2 -0
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/TBNBlock.pure.js +1 -1
- package/Materials/Node/Blocks/Fragment/TBNBlock.pure.js.map +1 -1
- package/Materials/PBR/openpbrMaterial.pure.d.ts +1 -1
- package/Materials/PBR/openpbrMaterial.pure.js +3 -12
- package/Materials/PBR/openpbrMaterial.pure.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.pure.d.ts +1 -1
- package/Materials/PBR/pbrBaseMaterial.pure.js +3 -12
- package/Materials/PBR/pbrBaseMaterial.pure.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.pure.js +1 -1
- package/Materials/Textures/renderTargetTexture.pure.js.map +1 -1
- package/Materials/material.pure.js +2 -2
- package/Materials/material.pure.js.map +1 -1
- package/Materials/standardMaterial.pure.d.ts +1 -1
- package/Materials/standardMaterial.pure.js +4 -13
- package/Materials/standardMaterial.pure.js.map +1 -1
- package/Maths/math.path.js +1 -1
- package/Maths/math.path.js.map +1 -1
- package/Maths/math.polar.js +1 -1
- package/Maths/math.polar.js.map +1 -1
- package/Maths/math.vector.pure.js +4 -3
- package/Maths/math.vector.pure.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.d.ts +72 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js +164 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.d.ts +2 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js +36 -18
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingPartProxyMesh.pure.d.ts +5 -4
- package/Meshes/GaussianSplatting/gaussianSplattingPartProxyMesh.pure.js +25 -8
- package/Meshes/GaussianSplatting/gaussianSplattingPartProxyMesh.pure.js.map +1 -1
- package/Meshes/GreasedLine/greasedLineRibbonMesh.pure.js +3 -3
- package/Meshes/GreasedLine/greasedLineRibbonMesh.pure.js.map +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.pure.js +1 -1
- package/Meshes/Node/Blocks/Instances/instantiateOnVolumeBlock.pure.js.map +1 -1
- package/Meshes/Node/Blocks/geometryOptimizeBlock.pure.js +2 -2
- package/Meshes/Node/Blocks/geometryOptimizeBlock.pure.js.map +1 -1
- package/Meshes/Node/Blocks/mappingBlock.pure.js +2 -2
- package/Meshes/Node/Blocks/mappingBlock.pure.js.map +1 -1
- package/Meshes/csg.js +5 -5
- package/Meshes/csg.js.map +1 -1
- package/Meshes/groundMesh.pure.js +1 -1
- package/Meshes/groundMesh.pure.js.map +1 -1
- package/Meshes/mesh.pure.js +2 -2
- package/Meshes/mesh.pure.js.map +1 -1
- package/Misc/deepMerger.js +1 -1
- package/Misc/deepMerger.js.map +1 -1
- package/Misc/dumpTools.pure.js +1 -1
- package/Misc/dumpTools.pure.js.map +1 -1
- package/Misc/index.d.ts +1 -0
- package/Misc/index.js +1 -0
- package/Misc/index.js.map +1 -1
- package/Misc/pure.d.ts +1 -0
- package/Misc/pure.js +1 -0
- package/Misc/pure.js.map +1 -1
- package/Misc/shaderImportLoader.d.ts +25 -0
- package/Misc/shaderImportLoader.js +54 -0
- package/Misc/shaderImportLoader.js.map +1 -0
- package/Misc/tools.pure.js +1 -1
- package/Misc/tools.pure.js.map +1 -1
- package/Particles/Node/Blocks/particleClampBlock.pure.d.ts +0 -1
- package/Particles/Node/Blocks/particleClampBlock.pure.js +1 -6
- package/Particles/Node/Blocks/particleClampBlock.pure.js.map +1 -1
- package/Particles/Node/Blocks/particleMathBlock.pure.js +1 -1
- package/Particles/Node/Blocks/particleMathBlock.pure.js.map +1 -1
- package/Particles/Node/Blocks/particleNLerpBlock.pure.js +8 -3
- package/Particles/Node/Blocks/particleNLerpBlock.pure.js.map +1 -1
- package/Particles/Node/Blocks/particleSmoothStepBlock.pure.js +3 -2
- package/Particles/Node/Blocks/particleSmoothStepBlock.pure.js.map +1 -1
- package/Particles/Node/Blocks/particleStepBlock.pure.js +3 -2
- package/Particles/Node/Blocks/particleStepBlock.pure.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.pure.js +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.pure.js.map +1 -1
- package/PostProcesses/depthOfFieldEffect.js +1 -1
- package/PostProcesses/depthOfFieldEffect.js.map +1 -1
- package/PostProcesses/screenSpaceCurvaturePostProcess.pure.js +1 -1
- package/PostProcesses/screenSpaceCurvaturePostProcess.pure.js.map +1 -1
- package/PostProcesses/sharpenPostProcess.pure.js +1 -1
- package/PostProcesses/sharpenPostProcess.pure.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.pure.d.ts +12 -0
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.pure.js +15 -1
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.pure.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.d.ts +14 -0
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.js +122 -6
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsVoxelTracingPass.d.ts +7 -0
- package/Rendering/IBLShadows/iblShadowsVoxelTracingPass.js +17 -0
- package/Rendering/IBLShadows/iblShadowsVoxelTracingPass.js.map +1 -1
- package/Rendering/boundingBoxRenderer.pure.js +3 -3
- package/Rendering/boundingBoxRenderer.pure.js.map +1 -1
- package/Rendering/outlineRenderer.pure.js +1 -0
- package/Rendering/outlineRenderer.pure.js.map +1 -1
- package/Rendering/subSurfaceConfiguration.js +1 -1
- package/Rendering/subSurfaceConfiguration.js.map +1 -1
- package/Rendering/subSurfaceSceneComponent.pure.d.ts +1 -1
- package/Rendering/subSurfaceSceneComponent.pure.js +1 -1
- package/Rendering/subSurfaceSceneComponent.pure.js.map +1 -1
- package/Rendering/utilityLayerRenderer.js +1 -1
- package/Rendering/utilityLayerRenderer.js.map +1 -1
- package/Shaders/gaussianSplattingVoxel.fragment.js +4 -10
- package/Shaders/gaussianSplattingVoxel.fragment.js.map +1 -1
- package/Shaders/iblCombineVoxelGrids.fragment.js +1 -1
- package/Shaders/iblCombineVoxelGrids.fragment.js.map +1 -1
- package/Shaders/iblShadowVoxelTracing.fragment.js +24 -7
- package/Shaders/iblShadowVoxelTracing.fragment.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/iblVoxelOpacityAtomicMax.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/iblVoxelOpacityAtomicMax.js +13 -0
- package/ShadersWGSL/ShadersInclude/iblVoxelOpacityAtomicMax.js.map +1 -0
- package/ShadersWGSL/gaussianSplattingVoxel.fragment.js +15 -9
- package/ShadersWGSL/gaussianSplattingVoxel.fragment.js.map +1 -1
- package/ShadersWGSL/iblCombineVoxelGrids.fragment.js +1 -1
- package/ShadersWGSL/iblCombineVoxelGrids.fragment.js.map +1 -1
- package/ShadersWGSL/iblCopyVoxelBufferToGrid.compute.d.ts +5 -0
- package/ShadersWGSL/iblCopyVoxelBufferToGrid.compute.js +14 -0
- package/ShadersWGSL/iblCopyVoxelBufferToGrid.compute.js.map +1 -0
- package/ShadersWGSL/iblShadowVoxelTracing.fragment.js +24 -7
- package/ShadersWGSL/iblShadowVoxelTracing.fragment.js.map +1 -1
- package/ShadersWGSL/iblVoxelGrid.fragment.js +26 -6
- package/ShadersWGSL/iblVoxelGrid.fragment.js.map +1 -1
- package/SmartAssets/smartAssetManager.pure.js +1 -1
- package/SmartAssets/smartAssetManager.pure.js.map +1 -1
- package/Sprites/thinSprite.js +1 -1
- package/Sprites/thinSprite.js.map +1 -1
- package/XR/features/Layers/WebXRCompositionLayer.d.ts +130 -12
- package/XR/features/Layers/WebXRCompositionLayer.js +192 -3
- package/XR/features/Layers/WebXRCompositionLayer.js.map +1 -1
- package/XR/features/Layers/WebXRFallbackLayer.d.ts +84 -0
- package/XR/features/Layers/WebXRFallbackLayer.js +137 -0
- package/XR/features/Layers/WebXRFallbackLayer.js.map +1 -0
- package/XR/features/Layers/WebXRWebGPUCompositionLayer.d.ts +4 -4
- package/XR/features/Layers/WebXRWebGPUCompositionLayer.js.map +1 -1
- package/XR/features/WebXRAnchorSystem.pure.d.ts +45 -0
- package/XR/features/WebXRAnchorSystem.pure.js +153 -13
- package/XR/features/WebXRAnchorSystem.pure.js.map +1 -1
- package/XR/features/WebXRLayers.pure.d.ts +171 -8
- package/XR/features/WebXRLayers.pure.js +500 -98
- package/XR/features/WebXRLayers.pure.js.map +1 -1
- package/XR/features/WebXRLayersFallback.d.ts +5 -0
- package/XR/features/WebXRLayersFallback.js +8 -0
- package/XR/features/WebXRLayersFallback.js.map +1 -0
- package/XR/features/WebXRLayersFallback.pure.d.ts +6 -0
- package/XR/features/WebXRLayersFallback.pure.js +44 -0
- package/XR/features/WebXRLayersFallback.pure.js.map +1 -0
- package/XR/features/WebXRLightEstimation.pure.d.ts +3 -4
- package/XR/features/WebXRLightEstimation.pure.js +22 -21
- package/XR/features/WebXRLightEstimation.pure.js.map +1 -1
- package/XR/features/WebXRMeshDetector.pure.d.ts +5 -0
- package/XR/features/WebXRMeshDetector.pure.js +1 -0
- package/XR/features/WebXRMeshDetector.pure.js.map +1 -1
- package/XR/features/WebXRNearInteraction.pure.js +3 -3
- package/XR/features/WebXRNearInteraction.pure.js.map +1 -1
- package/XR/features/WebXRPlaneDetector.pure.d.ts +9 -5
- package/XR/features/WebXRPlaneDetector.pure.js +12 -8
- package/XR/features/WebXRPlaneDetector.pure.js.map +1 -1
- package/XR/features/pure.d.ts +1 -0
- package/XR/features/pure.js +1 -0
- package/XR/features/pure.js.map +1 -1
- package/XR/webXRCamera.d.ts +2 -0
- package/XR/webXRCamera.js +8 -2
- package/XR/webXRCamera.js.map +1 -1
- package/XR/webXRLayerWrapper.d.ts +19 -5
- package/XR/webXRLayerWrapper.js +9 -0
- package/XR/webXRLayerWrapper.js.map +1 -1
- package/XR/webXRRenderTargetTextureProvider.d.ts +4 -4
- package/XR/webXRRenderTargetTextureProvider.js.map +1 -1
- package/XR/webXRWebGLRenderTargetTextureProvider.d.ts +2 -1
- package/XR/webXRWebGLRenderTargetTextureProvider.js.map +1 -1
- package/XR/webXRWebGPURenderTargetTextureProvider.d.ts +3 -3
- package/XR/webXRWebGPURenderTargetTextureProvider.js.map +1 -1
- package/package.json +1 -1
- package/scene.pure.d.ts +5 -0
- package/scene.pure.js +25 -0
- package/scene.pure.js.map +1 -1
package/Engines/engine.d.ts
CHANGED
|
@@ -753,11 +753,18 @@ type XRAnchorSet = Set<XRAnchor>;
|
|
|
753
753
|
|
|
754
754
|
interface XRAnchor {
|
|
755
755
|
anchorSpace: XRSpace;
|
|
756
|
+
requestPersistentHandle?: () => Promise<string>;
|
|
756
757
|
delete(): void;
|
|
757
758
|
}
|
|
758
759
|
|
|
759
760
|
abstract class XRAnchor implements XRAnchor {}
|
|
760
761
|
|
|
762
|
+
interface XRSession {
|
|
763
|
+
readonly persistentAnchors?: ReadonlyArray<string>;
|
|
764
|
+
restorePersistentAnchor?: (uuid: string) => Promise<XRAnchor>;
|
|
765
|
+
deletePersistentAnchor?: (uuid: string) => Promise<void>;
|
|
766
|
+
}
|
|
767
|
+
|
|
761
768
|
interface XRFrame {
|
|
762
769
|
trackedAnchors?: XRAnchorSet | undefined;
|
|
763
770
|
createAnchor?: (pose: XRRigidTransform, space: XRSpace) => Promise<XRAnchor>;
|
|
@@ -843,6 +850,7 @@ interface XRPlane {
|
|
|
843
850
|
planeSpace: XRSpace;
|
|
844
851
|
polygon: DOMPointReadOnly[];
|
|
845
852
|
lastChangedTime: number;
|
|
853
|
+
semanticLabel?: string | null;
|
|
846
854
|
}
|
|
847
855
|
|
|
848
856
|
abstract class XRPlane implements XRPlane {}
|
|
@@ -1064,7 +1072,7 @@ interface XRMediaLayerInit {
|
|
|
1064
1072
|
|
|
1065
1073
|
interface XRCylinderLayerInit extends XRLayerInit {
|
|
1066
1074
|
textureType?: XRTextureType | undefined;
|
|
1067
|
-
transform
|
|
1075
|
+
transform?: XRRigidTransform | undefined;
|
|
1068
1076
|
radius?: number | undefined;
|
|
1069
1077
|
centralAngle?: number | undefined;
|
|
1070
1078
|
aspectRatio?: number | undefined;
|
|
@@ -1451,6 +1459,7 @@ interface XRMesh {
|
|
|
1451
1459
|
vertices: Float32Array;
|
|
1452
1460
|
indices: Uint32Array;
|
|
1453
1461
|
lastChangedTime: DOMHighResTimeStamp;
|
|
1462
|
+
semanticLabel?: string | null;
|
|
1454
1463
|
}
|
|
1455
1464
|
|
|
1456
1465
|
type XRMeshSet = Set<XRMesh>;
|
|
@@ -78,6 +78,11 @@ export declare class ThinNativeEngine extends ThinEngine {
|
|
|
78
78
|
private _stencilOpStencilDepthPass;
|
|
79
79
|
private _zOffset;
|
|
80
80
|
private _zOffsetUnits;
|
|
81
|
+
private _cachedCulling;
|
|
82
|
+
private _cachedReverseSide;
|
|
83
|
+
private _cachedCullBackFaces;
|
|
84
|
+
private _cachedZOffset;
|
|
85
|
+
private _cachedZOffsetUnits;
|
|
81
86
|
private _depthWrite;
|
|
82
87
|
private _fillModeWarningDisplayed;
|
|
83
88
|
constructor(options?: ThinNativeEngineOptions);
|
|
@@ -191,7 +196,7 @@ export declare class ThinNativeEngine extends ThinEngine {
|
|
|
191
196
|
getRenderWidth(useScreen?: boolean): number;
|
|
192
197
|
getRenderHeight(useScreen?: boolean): number;
|
|
193
198
|
setViewport(viewport: IViewportLike, requiredWidth?: number, requiredHeight?: number): void;
|
|
194
|
-
setStateCullFaceType(
|
|
199
|
+
setStateCullFaceType(cullBackFaces?: boolean, force?: boolean): void;
|
|
195
200
|
setState(culling: boolean, zOffset?: number, force?: boolean, reverseSide?: boolean, cullBackFaces?: boolean, stencil?: IStencilState, zOffsetUnits?: number): void;
|
|
196
201
|
/**
|
|
197
202
|
* Gets the client rect of native canvas. Needed for InputManager.
|
|
@@ -159,6 +159,11 @@ export class ThinNativeEngine extends ThinEngine {
|
|
|
159
159
|
this._stencilOpStencilDepthPass = 7681;
|
|
160
160
|
this._zOffset = 0;
|
|
161
161
|
this._zOffsetUnits = 0;
|
|
162
|
+
this._cachedCulling = true;
|
|
163
|
+
this._cachedReverseSide = false;
|
|
164
|
+
this._cachedCullBackFaces = true;
|
|
165
|
+
this._cachedZOffset = 0;
|
|
166
|
+
this._cachedZOffsetUnits = 0;
|
|
162
167
|
this._depthWrite = true;
|
|
163
168
|
// warning for non supported fill mode has already been displayed
|
|
164
169
|
this._fillModeWarningDisplayed = false;
|
|
@@ -783,8 +788,24 @@ export class ThinNativeEngine extends ThinEngine {
|
|
|
783
788
|
this._commandBufferEncoder.encodeCommandArgAsFloat32(viewport.height);
|
|
784
789
|
this._commandBufferEncoder.finishEncodingCommand();
|
|
785
790
|
}
|
|
786
|
-
setStateCullFaceType(
|
|
787
|
-
|
|
791
|
+
setStateCullFaceType(cullBackFaces, force) {
|
|
792
|
+
const cullBack = this.cullBackFaces ?? cullBackFaces ?? true;
|
|
793
|
+
if (this._cachedCullBackFaces === cullBack && !force) {
|
|
794
|
+
return;
|
|
795
|
+
}
|
|
796
|
+
this._cachedCullBackFaces = cullBack;
|
|
797
|
+
// Native uses an immediate command-buffer state model (no lazy _depthCullingState), so
|
|
798
|
+
// re-issue the last COMMAND_SETSTATE payload with only the cull face changed. The zOffset
|
|
799
|
+
// values are the ones that command actually encoded rather than the live _zOffset fields,
|
|
800
|
+
// which setZOffset()/setZOffsetUnits() can update independently (and encode with the
|
|
801
|
+
// opposite sign under a reverse depth buffer).
|
|
802
|
+
this._commandBufferEncoder.startEncodingCommand(_native.Engine.COMMAND_SETSTATE);
|
|
803
|
+
this._commandBufferEncoder.encodeCommandArgAsUInt32(this._cachedCulling ? 1 : 0);
|
|
804
|
+
this._commandBufferEncoder.encodeCommandArgAsFloat32(this._cachedZOffset);
|
|
805
|
+
this._commandBufferEncoder.encodeCommandArgAsFloat32(this._cachedZOffsetUnits);
|
|
806
|
+
this._commandBufferEncoder.encodeCommandArgAsUInt32(cullBack ? 1 : 0);
|
|
807
|
+
this._commandBufferEncoder.encodeCommandArgAsUInt32(this._cachedReverseSide ? 1 : 0);
|
|
808
|
+
this._commandBufferEncoder.finishEncodingCommand();
|
|
788
809
|
}
|
|
789
810
|
setState(culling, zOffset = 0, force, reverseSide = false, cullBackFaces, stencil, zOffsetUnits = 0) {
|
|
790
811
|
this._zOffset = zOffset;
|
|
@@ -799,6 +820,12 @@ export class ThinNativeEngine extends ThinEngine {
|
|
|
799
820
|
this._commandBufferEncoder.encodeCommandArgAsUInt32((this.cullBackFaces ?? cullBackFaces ?? true) ? 1 : 0);
|
|
800
821
|
this._commandBufferEncoder.encodeCommandArgAsUInt32(reverseSide ? 1 : 0);
|
|
801
822
|
this._commandBufferEncoder.finishEncodingCommand();
|
|
823
|
+
// Cache the resolved state so setStateCullFaceType() can re-issue it with a new cull face.
|
|
824
|
+
this._cachedCulling = culling;
|
|
825
|
+
this._cachedReverseSide = reverseSide;
|
|
826
|
+
this._cachedCullBackFaces = this.cullBackFaces ?? cullBackFaces ?? true;
|
|
827
|
+
this._cachedZOffset = zOffset;
|
|
828
|
+
this._cachedZOffsetUnits = zOffsetUnits;
|
|
802
829
|
}
|
|
803
830
|
/**
|
|
804
831
|
* Gets the client rect of native canvas. Needed for InputManager.
|