@carbonenginejs/runtime-trinity 0.4.3 → 0.5.0
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/dist/curves/CjsGrannyCurves.js +12 -13
- package/dist/curves/CjsGrannyCurves.js.map +1 -1
- package/dist/eve/EveBannerSet.js +20 -1
- package/dist/eve/EveBannerSet.js.map +1 -1
- package/dist/eve/EveBoosterSet2.js +19 -1
- package/dist/eve/EveBoosterSet2.js.map +1 -1
- package/dist/eve/EveComponentTypes.js +116 -0
- package/dist/eve/EveComponentTypes.js.map +1 -0
- package/dist/eve/EveHazeSet.js +18 -1
- package/dist/eve/EveHazeSet.js.map +1 -1
- package/dist/eve/EvePlaneSet.js +19 -1
- package/dist/eve/EvePlaneSet.js.map +1 -1
- package/dist/eve/EveSpotlightSet.js +18 -1
- package/dist/eve/EveSpotlightSet.js.map +1 -1
- package/dist/eve/EveSpriteLineSet.js +18 -1
- package/dist/eve/EveSpriteLineSet.js.map +1 -1
- package/dist/eve/EveSpriteSet.js +18 -1
- package/dist/eve/EveSpriteSet.js.map +1 -1
- package/dist/eve/EveUpdateContext.js +195 -31
- package/dist/eve/EveUpdateContext.js.map +1 -1
- package/dist/eve/attachment/turrets/EveTurretFiringFX.js +23 -1
- package/dist/eve/attachment/turrets/EveTurretFiringFX.js.map +1 -1
- package/dist/eve/attachment/turrets/EveTurretSet.js +43 -1
- package/dist/eve/attachment/turrets/EveTurretSet.js.map +1 -1
- package/dist/eve/child/EveChildContainer.js +95 -60
- package/dist/eve/child/EveChildContainer.js.map +1 -1
- package/dist/eve/child/EveChildFogVolume.js +14 -1
- package/dist/eve/child/EveChildFogVolume.js.map +1 -1
- package/dist/eve/child/EveChildInstancedMeshes.js +43 -1
- package/dist/eve/child/EveChildInstancedMeshes.js.map +1 -1
- package/dist/eve/child/EveChildLightingOverride.js +14 -1
- package/dist/eve/child/EveChildLightingOverride.js.map +1 -1
- package/dist/eve/child/EveChildMesh.js +121 -80
- package/dist/eve/child/EveChildMesh.js.map +1 -1
- package/dist/eve/child/EveChildTransform.js +27 -17
- package/dist/eve/child/EveChildTransform.js.map +1 -1
- package/dist/eve/index.js +2 -0
- package/dist/eve/index.js.map +1 -1
- package/dist/eve/renderable/stretch/EveFiringEffectElementContainer.js +14 -1
- package/dist/eve/renderable/stretch/EveFiringEffectElementContainer.js.map +1 -1
- package/dist/eve/renderable/stretch/EveStretch.js +11 -1
- package/dist/eve/renderable/stretch/EveStretch.js.map +1 -1
- package/dist/eve/renderable/stretch/EveStretch2.js +14 -1
- package/dist/eve/renderable/stretch/EveStretch2.js.map +1 -1
- package/dist/eve/renderable/stretch/EveStretch3.js +24 -1
- package/dist/eve/renderable/stretch/EveStretch3.js.map +1 -1
- package/dist/eve/scene/EveSpaceScene.js +443 -16
- package/dist/eve/scene/EveSpaceScene.js.map +1 -1
- package/dist/eve/spaceObject/EveEffectRoot2.js +28 -1
- package/dist/eve/spaceObject/EveEffectRoot2.js.map +1 -1
- package/dist/eve/spaceObject/EveMobile.js +25 -1
- package/dist/eve/spaceObject/EveMobile.js.map +1 -1
- package/dist/eve/spaceObject/EveSpaceObject2.js +59 -1
- package/dist/eve/spaceObject/EveSpaceObject2.js.map +1 -1
- package/dist/generated/eve/child/EveChildCloud2.js +88 -5
- package/dist/generated/eve/child/EveChildCloud2.js.map +1 -1
- package/dist/generated/eve/child/EveChildExplosion.js +17 -1
- package/dist/generated/eve/child/EveChildExplosion.js.map +1 -1
- package/dist/generated/eve/child/EveChildInstanceContainer.js +29 -1
- package/dist/generated/eve/child/EveChildInstanceContainer.js.map +1 -1
- package/dist/generated/eve/child/EveChildParticleSystem.js +32 -24
- package/dist/generated/eve/child/EveChildParticleSystem.js.map +1 -1
- package/dist/generated/eve/child/EveChildPlug.js +23 -1
- package/dist/generated/eve/child/EveChildPlug.js.map +1 -1
- package/dist/generated/eve/child/EveChildPostProcessVolume.js +27 -14
- package/dist/generated/eve/child/EveChildPostProcessVolume.js.map +1 -1
- package/dist/generated/eve/child/EveChildRef.js +17 -1
- package/dist/generated/eve/child/EveChildRef.js.map +1 -1
- package/dist/generated/eve/child/EveChildSocket.js +17 -1
- package/dist/generated/eve/child/EveChildSocket.js.map +1 -1
- package/dist/generated/eve/child/behaviors/BehaviorGroup.js +43 -40
- package/dist/generated/eve/child/behaviors/BehaviorGroup.js.map +1 -1
- package/dist/generated/eve/child/procedural/EveChildProceduralContainer.js +53 -49
- package/dist/generated/eve/child/procedural/EveChildProceduralContainer.js.map +1 -1
- package/dist/generated/eve/scene/EveComponentRegistry.js +11 -0
- package/dist/generated/eve/scene/EveComponentRegistry.js.map +1 -1
- package/dist/generated/eve/scene/TriShadowFrustum.js +74 -22
- package/dist/generated/eve/scene/TriShadowFrustum.js.map +1 -1
- package/dist/generated/eve/scene/TriShadowOrthoFrustum.js +128 -26
- package/dist/generated/eve/scene/TriShadowOrthoFrustum.js.map +1 -1
- package/dist/generated/eve/smartLights/EveChildSmartLightSet.js +37 -24
- package/dist/generated/eve/smartLights/EveChildSmartLightSet.js.map +1 -1
- package/dist/generated/eve/smartLights/EveSmartLightPointLight.js +29 -28
- package/dist/generated/eve/smartLights/EveSmartLightPointLight.js.map +1 -1
- package/dist/generated/eve/spaceObject/EveShip2.js +39 -19
- package/dist/generated/eve/spaceObject/EveShip2.js.map +1 -1
- package/dist/generated/eve/spaceObject/swarm/EveSwarm.js +28 -1
- package/dist/generated/eve/spaceObject/swarm/EveSwarm.js.map +1 -1
- package/dist/generated/eve/spaceObject/swarm/EveSwarmRenderable.js +28 -1
- package/dist/generated/eve/spaceObject/swarm/EveSwarmRenderable.js.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/trinityCore/TriFrustum.js +374 -0
- package/dist/trinityCore/TriFrustum.js.map +1 -0
- package/dist/trinityCore/TriFrustumOrtho.js +158 -0
- package/dist/trinityCore/TriFrustumOrtho.js.map +1 -0
- package/dist/trinityCore/index.js +2 -0
- package/dist/trinityCore/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -9,6 +9,7 @@ import { TriBatchType } from '@carbonenginejs/runtime-const/graphics';
|
|
|
9
9
|
import { EveChildTransform as _EveChildTransform, applyTransformModifiers } from './EveChildTransform.js';
|
|
10
10
|
import { Origin } from '../../generated/eve/child/enums.js';
|
|
11
11
|
import { ReflectionMode } from '../../generated/eve/enums.js';
|
|
12
|
+
import { ShouldReflect, EveComponentType } from '../EveComponentTypes.js';
|
|
12
13
|
import { Tr2RenderReason } from '../../generated/trinityCore/enums.js';
|
|
13
14
|
import { Tr2Lod } from '../EveLODHelper.js';
|
|
14
15
|
import { Tr2PerObjectData } from '../../trinityCore/Tr2PerObjectData.js';
|
|
@@ -38,7 +39,7 @@ new class extends _identity {
|
|
|
38
39
|
} = _applyDecs2311(this, [type.define({
|
|
39
40
|
className: "EveChildMesh",
|
|
40
41
|
family: "eve/child"
|
|
41
|
-
})], [[[io, io.notify, io, io.persist, type, type.int32, void 0, schema.enum("ReflectionMode")], 16, "reflectionMode"], [[io, io.persist, void 0, type.list("IEveChildTransformModifier")], 16, "transformModifiers"], [[io, io.read, type, type.mat4], 16, "worldTransform"], [[io, io.notify, io, io.persist, type, type.boolean], 16, "display"], [[io, io.notify, io, io.persist, type, type.boolean], 16, "castShadow"], [[io, io.notify, io, io.persist, void 0, type.objectRef("Tr2MeshBase")], 16, "mesh"], [[io, io.persist, type, type.string], 16, "name"], [[io, io.persist, type, type.quat], 16, "rotation"], [[io, io.persist, type, type.vec3], 16, "translation"], [[io, io.persist, type, type.vec3], 16, "scaling"], [[io, io.persist, type, type.mat4], 16, "localTransform"], [[io, io.persist, void 0, type.list("EveSpaceObjectDecal")], 16, "decals"], [[io, io.persist, type, type.boolean], 16, "staticTransform"], [[io, io.notify, io, io.persist, void 0, type.objectRef("Tr2GrannyAnimation")], 16, "animationUpdater"], [[io, io.persist, void 0, type.list("IEveSpaceObjectAttachment")], 16, "attachments"], [[io, io.persist, void 0, type.list("Tr2Light")], 16, "lights"], [[io, io.persist, type, type.int32, void 0, schema.enum("Tr2Lod")], 16, "lowestLodVisible"], [[io, io.persist, type, type.float32], 16, "minScreenSize"], [[io, io.persist, type, type.float32], 16, "sortValueOffset"], [[io, io.persist, type, type.float32], 16, "sortValueScale"], [[io, io.read, type, type.float32], 16, "currentScreenSize"], [[io, io.read, type, type.float32], 16, "currentInstanceScreenSize"], [[io, io.persist, type, type.boolean], 16, "useSRT"], [[io, io.persist, type, type.boolean], 16, "updateAnimation"], [[io, io.persist, type, type.int32, void 0, schema.enum("Origin")], 16, "origin"], [[void 0, io.rebuild("instanceBuffer"), io, io.persist, void 0, type.array("mat4")], 16, "instanceTransforms"], [[io, io.persist, type, type.string], 16, "sofDna"], [[io, io.persist, type, type.string], 16, "sofParentHullName"], [[io, io.persist, type, type.string], 16, "sofLocatorSetName"], [[io, io.persist, type, type.string], 16, "sofLocatorIndex"], [[carbon, carbon.method, impl, impl.adapted], 18, "Initialize"], [[carbon, carbon.method, impl, impl.implemented], 18, "Setup"], [[carbon, carbon.method, impl, impl.implemented], 18, "SetInstanceTransforms"], [[carbon, carbon.method, impl, impl.adapted], 18, "GetInstanceTransforms"], [[carbon, carbon.method, impl, impl.implemented], 18, "SetMesh"], [[carbon, carbon.method, impl, impl.implemented], 18, "SetOrigin"], [[carbon, carbon.method, impl, impl.implemented], 18, "SetScale"], [[carbon, carbon.method, impl, impl.implemented], 18, "SetReflectionMode"], [[carbon, carbon.method, impl, impl.implemented], 18, "SetCastShadow"], [[carbon, carbon.method, impl, impl.implemented], 18, "SetMinScreenSize"], [[carbon, carbon.method, impl, impl.implemented], 18, "GetLocalToWorldTransform"], [[carbon, carbon.method, impl, impl.implemented], 18, "GetName"], [[carbon, carbon.method, impl, impl.implemented], 18, "SetName"], [[carbon, carbon.method, impl, impl.implemented], 18, "AddTransformModifier"], [[carbon, carbon.method, impl, impl.implemented], 18, "AddDecal"], [[carbon, carbon.method, impl, impl.implemented], 18, "AddAttachment"], [[carbon, carbon.method, impl, impl.implemented], 18, "ClearAttachments"], [[carbon, carbon.method, impl, impl.implemented], 18, "AddLight"], [[carbon, carbon.method, impl, impl.implemented], 18, "ClearLights"], [[carbon, carbon.method, impl, impl.implemented], 18, "IsAlwaysOn"], [[carbon, carbon.method, impl, impl.implemented], 18, "SetShaderOption"], [[carbon, carbon.method, impl, impl.adapted], 18, "GetMorphTargetNames"], [[carbon, carbon.method, impl, impl.adapted], 18, "SetMorphTargetWeight"], [[carbon, carbon.method, impl, impl.adapted], 18, "GetMorphTargetWeight"], [[impl, impl.adapted], 18, "UpdateMorphAnimationBuffer"], [[impl, impl.adapted], 18, "GetMorphTargets"], [[carbon, carbon.method, impl, impl.adapted], 18, "GetSofSourceLocator"], [[carbon, carbon.method, impl, impl.adapted, void 0, impl.reason("Audio-geometry registration is engine-owned and the animationUpdater branches await the JS animation seam; nothing else remains in Carbon's body.")], 18, "UpdateSyncronous"], [[carbon, carbon.method, void 0, carbon.contextual(["camera"]), impl, impl.adapted], 18, "UpdateAsyncronous"], [[carbon, carbon.method, impl, impl.adapted, void 0, impl.reason("Bone-fed decal/attachment bounds await the animation seam and the raytracing refresh is engine-owned; the LOD/screen-size math is ported.")], 18, "UpdateVisibility"], [[carbon, carbon.method, impl, impl.adapted, void 0, impl.reason("The decal mesh cache is engine-owned (null placeholder); collection structure is ported.")], 18, "GetRenderables"], [[carbon, carbon.method, impl, impl.implemented], 18, "GetBoundingSphere"], [[carbon, carbon.method, impl, impl.implemented], 18, "HasTransparentBatches"], [[carbon, carbon.method, impl, impl.adapted, void 0, impl.reason("Frustum and threshold arrive via the duck-typed update context instead of renderer state.")], 18, "IsVisible"], [[carbon, carbon.method, impl, impl.adapted, void 0, impl.reason("Screen-size LOD selection and winding reversal are engine-resolved at realization; delegation structure is ported.")], 18, "GetBatches"], [[carbon, carbon.method, impl, impl.adapted, void 0, impl.reason("shadowPixelSize LOD selection and winding reversal are engine-resolved at realization; delegation structure is ported.")], 18, "GetShadowBatches"], [[carbon, carbon.method, impl, impl.adapted, void 0, impl.reason("Carbon reads the Tr2Renderer view-position global; the relocated camera state arrives via the threaded render context.")], 18, "GetSortValue"], [[carbon, carbon.method, impl, impl.implemented], 18, "GetShadowPerObjectData"], [[carbon, carbon.method, impl, impl.adapted, void 0, impl.reason("Persistent VS/PS device buffers and bone/morph ring offsets are engine-owned; the record carries the object reference the engine serializer consumes.")], 18, "GetPerObjectData"], [[carbon, carbon.method, impl, impl.adapted, void 0, impl.reason("Overload dispatch by argument shape and a length-1 out array replace C++ overloading and the float& out-param; the shadow math is ported.")], 18, "IsCastingShadow"], [[carbon, carbon.method, impl, impl.implemented], 18, "ChangeLOD"], [[carbon, carbon.method, impl, impl.notImplemented], 18, "GetPickingBatches"], [[carbon, carbon.method, impl, impl.notImplemented], 18, "InitializeAnimation"], [[carbon, carbon.method, impl, impl.notImplemented], 18, "BakeMorphs"], [[carbon, carbon.method, impl, impl.notImplemented], 18, "UnbakeMorphs"], [[carbon, carbon.method, impl, impl.notImplemented], 18, "IsMeshBaked"]], 0, void 0, _EveChildTransform));
|
|
42
|
+
})], [[[io, io.notify, io, io.persist, type, type.int32, void 0, schema.enum("ReflectionMode")], 16, "reflectionMode"], [[io, io.persist, void 0, type.list("IEveChildTransformModifier")], 16, "transformModifiers"], [[io, io.read, type, type.mat4], 16, "worldTransform"], [[io, io.notify, io, io.persist, type, type.boolean], 16, "display"], [[io, io.notify, io, io.persist, type, type.boolean], 16, "castShadow"], [[io, io.notify, io, io.persist, void 0, type.objectRef("Tr2MeshBase")], 16, "mesh"], [[io, io.persist, type, type.string], 16, "name"], [[io, io.persist, type, type.quat], 16, "rotation"], [[io, io.persist, type, type.vec3], 16, "translation"], [[io, io.persist, type, type.vec3], 16, "scaling"], [[io, io.persist, type, type.mat4], 16, "localTransform"], [[io, io.persist, void 0, type.list("EveSpaceObjectDecal")], 16, "decals"], [[io, io.persist, type, type.boolean], 16, "staticTransform"], [[io, io.notify, io, io.persist, void 0, type.objectRef("Tr2GrannyAnimation")], 16, "animationUpdater"], [[io, io.persist, void 0, type.list("IEveSpaceObjectAttachment")], 16, "attachments"], [[io, io.persist, void 0, type.list("Tr2Light")], 16, "lights"], [[io, io.persist, type, type.int32, void 0, schema.enum("Tr2Lod")], 16, "lowestLodVisible"], [[io, io.persist, type, type.float32], 16, "minScreenSize"], [[io, io.persist, type, type.float32], 16, "sortValueOffset"], [[io, io.persist, type, type.float32], 16, "sortValueScale"], [[io, io.read, type, type.float32], 16, "currentScreenSize"], [[io, io.read, type, type.float32], 16, "currentInstanceScreenSize"], [[io, io.persist, type, type.boolean], 16, "useSRT"], [[io, io.persist, type, type.boolean], 16, "updateAnimation"], [[io, io.persist, type, type.int32, void 0, schema.enum("Origin")], 16, "origin"], [[void 0, io.rebuild("instanceBuffer"), io, io.persist, void 0, type.array("mat4")], 16, "instanceTransforms"], [[io, io.persist, type, type.string], 16, "sofDna"], [[io, io.persist, type, type.string], 16, "sofParentHullName"], [[io, io.persist, type, type.string], 16, "sofLocatorSetName"], [[io, io.persist, type, type.string], 16, "sofLocatorIndex"], [[carbon, carbon.method, impl, impl.adapted], 18, "Initialize"], [[carbon, carbon.method, impl, impl.implemented], 18, "Setup"], [[carbon, carbon.method, impl, impl.implemented], 18, "SetInstanceTransforms"], [[carbon, carbon.method, impl, impl.adapted], 18, "GetInstanceTransforms"], [[carbon, carbon.method, impl, impl.implemented], 18, "SetMesh"], [[carbon, carbon.method, impl, impl.implemented], 18, "SetOrigin"], [[carbon, carbon.method, impl, impl.implemented], 18, "SetScale"], [[carbon, carbon.method, impl, impl.implemented], 18, "SetReflectionMode"], [[carbon, carbon.method, impl, impl.implemented], 18, "SetCastShadow"], [[carbon, carbon.method, impl, impl.implemented], 18, "SetMinScreenSize"], [[carbon, carbon.method, impl, impl.implemented], 18, "GetLocalToWorldTransform"], [[carbon, carbon.method, impl, impl.implemented], 18, "GetName"], [[carbon, carbon.method, impl, impl.implemented], 18, "SetName"], [[carbon, carbon.method, impl, impl.implemented], 18, "AddTransformModifier"], [[carbon, carbon.method, impl, impl.implemented], 18, "AddDecal"], [[carbon, carbon.method, impl, impl.implemented], 18, "AddAttachment"], [[carbon, carbon.method, impl, impl.implemented], 18, "ClearAttachments"], [[carbon, carbon.method, impl, impl.implemented], 18, "AddLight"], [[carbon, carbon.method, impl, impl.implemented], 18, "ClearLights"], [[carbon, carbon.method, impl, impl.implemented], 18, "IsAlwaysOn"], [[carbon, carbon.method, impl, impl.implemented], 18, "SetShaderOption"], [[carbon, carbon.method, impl, impl.adapted], 18, "GetMorphTargetNames"], [[carbon, carbon.method, impl, impl.adapted], 18, "SetMorphTargetWeight"], [[carbon, carbon.method, impl, impl.adapted], 18, "GetMorphTargetWeight"], [[impl, impl.adapted], 18, "UpdateMorphAnimationBuffer"], [[impl, impl.adapted], 18, "GetMorphTargets"], [[carbon, carbon.method, impl, impl.adapted], 18, "GetSofSourceLocator"], [[carbon, carbon.method, impl, impl.adapted, void 0, impl.reason("Audio-geometry registration is engine-owned and the animationUpdater branches await the JS animation seam; nothing else remains in Carbon's body.")], 18, "UpdateSyncronous"], [[carbon, carbon.method, void 0, carbon.contextual(["camera"]), impl, impl.adapted], 18, "UpdateAsyncronous"], [[carbon, carbon.method, impl, impl.adapted, void 0, impl.reason("Bone-fed decal/attachment bounds await the animation seam and the raytracing refresh is engine-owned; the LOD/screen-size math is ported.")], 18, "UpdateVisibility"], [[carbon, carbon.method, impl, impl.adapted, void 0, impl.reason("The decal mesh cache is engine-owned (null placeholder); collection structure is ported.")], 18, "GetRenderables"], [[carbon, carbon.method, impl, impl.implemented], 18, "GetBoundingSphere"], [[carbon, carbon.method, impl, impl.implemented], 18, "HasTransparentBatches"], [[carbon, carbon.method, impl, impl.adapted, void 0, impl.reason("Frustum and threshold arrive via the duck-typed update context instead of renderer state.")], 18, "IsVisible"], [[carbon, carbon.method, impl, impl.adapted, void 0, impl.reason("Screen-size LOD selection and winding reversal are engine-resolved at realization; delegation structure is ported.")], 18, "GetBatches"], [[carbon, carbon.method, impl, impl.adapted, void 0, impl.reason("shadowPixelSize LOD selection and winding reversal are engine-resolved at realization; delegation structure is ported.")], 18, "GetShadowBatches"], [[carbon, carbon.method, impl, impl.adapted, void 0, impl.reason("Carbon reads the Tr2Renderer view-position global; the relocated camera state arrives via the threaded render context.")], 18, "GetSortValue"], [[carbon, carbon.method, impl, impl.implemented], 18, "GetShadowPerObjectData"], [[carbon, carbon.method, impl, impl.adapted, void 0, impl.reason("Persistent VS/PS device buffers and bone/morph ring offsets are engine-owned; the record carries the object reference the engine serializer consumes.")], 18, "GetPerObjectData"], [[carbon, carbon.method, impl, impl.adapted, void 0, impl.reason("Overload dispatch by argument shape and a length-1 out array replace C++ overloading and the float& out-param; the shadow math is ported.")], 18, "IsCastingShadow"], [[carbon, carbon.method, impl, impl.implemented], 18, "ChangeLOD"], [[carbon, carbon.method, impl, impl.implemented], 18, "RegisterComponents"], [[carbon, carbon.method, impl, impl.implemented], 18, "UnRegisterComponents"], [[carbon, carbon.method, impl, impl.notImplemented], 18, "GetLights"], [[carbon, carbon.method, impl, impl.notImplemented], 18, "GetPickingBatches"], [[carbon, carbon.method, impl, impl.notImplemented], 18, "InitializeAnimation"], [[carbon, carbon.method, impl, impl.notImplemented], 18, "BakeMorphs"], [[carbon, carbon.method, impl, impl.notImplemented], 18, "UnbakeMorphs"], [[carbon, carbon.method, impl, impl.notImplemented], 18, "IsMeshBaked"]], 0, void 0, _EveChildTransform));
|
|
42
43
|
}
|
|
43
44
|
constructor(...args) {
|
|
44
45
|
super(...args);
|
|
@@ -147,7 +148,7 @@ new class extends _identity {
|
|
|
147
148
|
this.minScreenSize = Number(minScreenSize);
|
|
148
149
|
}
|
|
149
150
|
|
|
150
|
-
/** Carbon EveChildMesh::GetLocalToWorldTransform (cpp:1047-1050); the
|
|
151
|
+
/** Carbon EveChildMesh::GetLocalToWorldTransform (cpp:1047-1050); the
|
|
151
152
|
* optional out follows the EveChildInstancedMeshes copy-out shape. */
|
|
152
153
|
GetLocalToWorldTransform(out = null) {
|
|
153
154
|
if (out) {
|
|
@@ -272,27 +273,27 @@ new class extends _identity {
|
|
|
272
273
|
return null;
|
|
273
274
|
}
|
|
274
275
|
|
|
275
|
-
/**
|
|
276
|
-
* Sync-side frame update (Carbon EveChildMesh::UpdateSyncronous,
|
|
277
|
-
* cpp:1002-1045). Carbon's body is entirely audio-geometry registration
|
|
278
|
-
* (cpp:1004-1010, 1044 - engine/audio-owned, omitted) plus animationUpdater
|
|
279
|
-
* re-binding and PrePhysicsAnimation stepping (cpp:1011-1042 - skipped: the
|
|
280
|
-
* JS animation seam is absent, there is no Tr2GrannyAnimation runtime), so
|
|
281
|
-
* the port is a documented frame-contract no-op.
|
|
276
|
+
/**
|
|
277
|
+
* Sync-side frame update (Carbon EveChildMesh::UpdateSyncronous,
|
|
278
|
+
* cpp:1002-1045). Carbon's body is entirely audio-geometry registration
|
|
279
|
+
* (cpp:1004-1010, 1044 - engine/audio-owned, omitted) plus animationUpdater
|
|
280
|
+
* re-binding and PrePhysicsAnimation stepping (cpp:1011-1042 - skipped: the
|
|
281
|
+
* JS animation seam is absent, there is no Tr2GrannyAnimation runtime), so
|
|
282
|
+
* the port is a documented frame-contract no-op.
|
|
282
283
|
*/
|
|
283
284
|
UpdateSyncronous(_updateContext, _params) {}
|
|
284
285
|
|
|
285
|
-
/**
|
|
286
|
-
* Per-frame async update (Carbon EveChildMesh::UpdateAsyncronous,
|
|
287
|
-
* cpp:903-1000): rebuild the world transform from the parent, fold the
|
|
288
|
-
* transform modifiers over it, store the activation strength, refresh the
|
|
289
|
-
* attachment lights, the morph buffer, and the world bounds. The GPU ring
|
|
290
|
-
* buffer advance/per-object-data invalidation (cpp:905-909), audio geometry
|
|
291
|
-
* (cpp:920-930), parent VS/PS struct refresh (cpp:932-960), and the skinned
|
|
292
|
-
* GetBounds overload are not modelled, hence @impl.adapted.
|
|
293
|
-
* @param {Object} updateContext - frame context (EveUpdateContext), threaded to modifiers
|
|
294
|
-
* @param {EveChildUpdateParams} params - localToWorldTransform + boneCount/bones
|
|
295
|
-
* @returns {Float32Array} worldTransform
|
|
286
|
+
/**
|
|
287
|
+
* Per-frame async update (Carbon EveChildMesh::UpdateAsyncronous,
|
|
288
|
+
* cpp:903-1000): rebuild the world transform from the parent, fold the
|
|
289
|
+
* transform modifiers over it, store the activation strength, refresh the
|
|
290
|
+
* attachment lights, the morph buffer, and the world bounds. The GPU ring
|
|
291
|
+
* buffer advance/per-object-data invalidation (cpp:905-909), audio geometry
|
|
292
|
+
* (cpp:920-930), parent VS/PS struct refresh (cpp:932-960), and the skinned
|
|
293
|
+
* GetBounds overload are not modelled, hence @impl.adapted.
|
|
294
|
+
* @param {Object} updateContext - frame context (EveUpdateContext), threaded to modifiers
|
|
295
|
+
* @param {EveChildUpdateParams} params - localToWorldTransform + boneCount/bones
|
|
296
|
+
* @returns {Float32Array} worldTransform
|
|
296
297
|
*/
|
|
297
298
|
UpdateAsyncronous(updateContext, params) {
|
|
298
299
|
const parentTransform = params?.localToWorldTransform;
|
|
@@ -335,18 +336,18 @@ new class extends _identity {
|
|
|
335
336
|
return this.worldTransform;
|
|
336
337
|
}
|
|
337
338
|
|
|
338
|
-
/**
|
|
339
|
-
* Frame visibility + LOD state (Carbon EveChildMesh::UpdateVisibility,
|
|
340
|
-
* cpp:366-463): screen size via the frustum, invLodFactor scaling, the
|
|
341
|
-
* minScreenSize/lowestLodVisible gates, the per-instance visibility gate,
|
|
342
|
-
* and the attachment/decal visibility fan-out. Carbon recomputes the local
|
|
343
|
-
* mesh bounds here (cpp:380-394) but consumes only the world sphere/box
|
|
344
|
-
* computed in UpdateAsyncronous, so the dead recompute is skipped. The
|
|
345
|
-
* raytracing branch (cpp:450-462) is engine-owned and omitted.
|
|
346
|
-
* @param {Object} updateContext - frame context (frustum + invLodFactor ducks)
|
|
347
|
-
* @param {Float32Array} _parentTransform
|
|
348
|
-
* @param {Number} parentLod - parent Tr2Lod level
|
|
349
|
-
* @returns {Boolean} isVisible
|
|
339
|
+
/**
|
|
340
|
+
* Frame visibility + LOD state (Carbon EveChildMesh::UpdateVisibility,
|
|
341
|
+
* cpp:366-463): screen size via the frustum, invLodFactor scaling, the
|
|
342
|
+
* minScreenSize/lowestLodVisible gates, the per-instance visibility gate,
|
|
343
|
+
* and the attachment/decal visibility fan-out. Carbon recomputes the local
|
|
344
|
+
* mesh bounds here (cpp:380-394) but consumes only the world sphere/box
|
|
345
|
+
* computed in UpdateAsyncronous, so the dead recompute is skipped. The
|
|
346
|
+
* raytracing branch (cpp:450-462) is engine-owned and omitted.
|
|
347
|
+
* @param {Object} updateContext - frame context (frustum + invLodFactor ducks)
|
|
348
|
+
* @param {Float32Array} _parentTransform
|
|
349
|
+
* @param {Number} parentLod - parent Tr2Lod level
|
|
350
|
+
* @returns {Boolean} isVisible
|
|
350
351
|
*/
|
|
351
352
|
UpdateVisibility(updateContext, _parentTransform = null, parentLod = Tr2Lod.TR2_LOD_HIGH) {
|
|
352
353
|
this.#isVisible = false;
|
|
@@ -417,12 +418,12 @@ new class extends _identity {
|
|
|
417
418
|
return this.#isVisible;
|
|
418
419
|
}
|
|
419
420
|
|
|
420
|
-
/**
|
|
421
|
-
* Collects this child (and its decals) as renderables (Carbon
|
|
422
|
-
* EveChildMesh::GetRenderables, cpp:571-616): instanced meshes contribute
|
|
423
|
-
* only while the per-instance gate passed; decals ride along through their
|
|
424
|
-
* duck-typed renderable collectors (mesh cache is engine-owned, passed null
|
|
425
|
-
* as in EveSpaceObject2.GetRenderables).
|
|
421
|
+
/**
|
|
422
|
+
* Collects this child (and its decals) as renderables (Carbon
|
|
423
|
+
* EveChildMesh::GetRenderables, cpp:571-616): instanced meshes contribute
|
|
424
|
+
* only while the per-instance gate passed; decals ride along through their
|
|
425
|
+
* duck-typed renderable collectors (mesh cache is engine-owned, passed null
|
|
426
|
+
* as in EveSpaceObject2.GetRenderables).
|
|
426
427
|
*/
|
|
427
428
|
GetRenderables(out = []) {
|
|
428
429
|
if (!this.#isVisible) {
|
|
@@ -450,7 +451,7 @@ new class extends _identity {
|
|
|
450
451
|
return out;
|
|
451
452
|
}
|
|
452
453
|
|
|
453
|
-
/** Carbon EveChildMesh::GetBoundingSphere (cpp:618-627): the realized world
|
|
454
|
+
/** Carbon EveChildMesh::GetBoundingSphere (cpp:618-627): the realized world
|
|
454
455
|
* sphere, valid only after an update produced bounds (radius > 0). */
|
|
455
456
|
GetBoundingSphere(out = vec4.create(), _query = 0) {
|
|
456
457
|
if (this.#worldBoundingSphere[3] > 0) {
|
|
@@ -468,7 +469,7 @@ new class extends _identity {
|
|
|
468
469
|
return false;
|
|
469
470
|
}
|
|
470
471
|
|
|
471
|
-
/** Carbon EveChildMesh::IsVisible (cpp:639-650): sphere-in-frustum plus the
|
|
472
|
+
/** Carbon EveChildMesh::IsVisible (cpp:639-650): sphere-in-frustum plus the
|
|
472
473
|
* estimated pixel size against the context visibility threshold. */
|
|
473
474
|
IsVisible(updateContext) {
|
|
474
475
|
if (this.#worldBoundingSphere[3] > 0) {
|
|
@@ -483,12 +484,12 @@ new class extends _identity {
|
|
|
483
484
|
return false;
|
|
484
485
|
}
|
|
485
486
|
|
|
486
|
-
/** Carbon EveChildMesh::GetBatches (cpp:652-670): the mesh delegates per
|
|
487
|
-
* batch type and activated attachments recurse. Carbon also passes
|
|
488
|
-
* min(currentInstanceScreenSize, currentScreenSize) for LOD selection and a
|
|
489
|
-
* reverse-winding flag from Determinant(m_worldTransform) < 0; both are
|
|
490
|
-
* resolved by the engine at batch realization in the GPU-free port.
|
|
491
|
-
* Returns whether any batch was committed (JS addition; Carbon returns
|
|
487
|
+
/** Carbon EveChildMesh::GetBatches (cpp:652-670): the mesh delegates per
|
|
488
|
+
* batch type and activated attachments recurse. Carbon also passes
|
|
489
|
+
* min(currentInstanceScreenSize, currentScreenSize) for LOD selection and a
|
|
490
|
+
* reverse-winding flag from Determinant(m_worldTransform) < 0; both are
|
|
491
|
+
* resolved by the engine at batch realization in the GPU-free port.
|
|
492
|
+
* Returns whether any batch was committed (JS addition; Carbon returns
|
|
492
493
|
* void). */
|
|
493
494
|
GetBatches(batches, batchType, perObjectData, reason = Tr2RenderReason.TR2RENDERREASON_NORMAL) {
|
|
494
495
|
if (!this.display) {
|
|
@@ -506,9 +507,9 @@ new class extends _identity {
|
|
|
506
507
|
return committed;
|
|
507
508
|
}
|
|
508
509
|
|
|
509
|
-
/** Carbon EveChildMesh::GetShadowBatches (cpp:672-681): the OPAQUE areas
|
|
510
|
-
* only, gated on display/mesh/hasUpdated. shadowPixelSize and the
|
|
511
|
-
* reverse-winding flag are engine-resolved at realization. Returns whether
|
|
510
|
+
/** Carbon EveChildMesh::GetShadowBatches (cpp:672-681): the OPAQUE areas
|
|
511
|
+
* only, gated on display/mesh/hasUpdated. shadowPixelSize and the
|
|
512
|
+
* reverse-winding flag are engine-resolved at realization. Returns whether
|
|
512
513
|
* any batch was committed (JS addition; Carbon returns void). */
|
|
513
514
|
GetShadowBatches(batches, perObjectData, _shadowPixelSize) {
|
|
514
515
|
if (this.display && this.mesh && this.#hasUpdated) {
|
|
@@ -517,7 +518,7 @@ new class extends _identity {
|
|
|
517
518
|
return false;
|
|
518
519
|
}
|
|
519
520
|
|
|
520
|
-
/** Carbon EveChildMesh::GetSortValue (cpp:787-792): view distance scaled by
|
|
521
|
+
/** Carbon EveChildMesh::GetSortValue (cpp:787-792): view distance scaled by
|
|
521
522
|
* sortValueScale plus sortValueOffset. */
|
|
522
523
|
GetSortValue(renderContext = null) {
|
|
523
524
|
const viewPosition = renderContext?.GetViewPosition?.();
|
|
@@ -527,16 +528,16 @@ new class extends _identity {
|
|
|
527
528
|
return Math.hypot(x, y, z) * this.sortValueScale + this.sortValueOffset;
|
|
528
529
|
}
|
|
529
530
|
|
|
530
|
-
/** Carbon EveChildMesh::GetShadowPerObjectData (cpp:794-797) forwards the
|
|
531
|
+
/** Carbon EveChildMesh::GetShadowPerObjectData (cpp:794-797) forwards the
|
|
531
532
|
* shadow pass to the same per-object record. */
|
|
532
533
|
GetShadowPerObjectData(accumulator = null) {
|
|
533
534
|
return this.GetPerObjectData(accumulator);
|
|
534
535
|
}
|
|
535
536
|
|
|
536
|
-
/** Carbon EveChildMesh::GetPerObjectData (cpp:799-843) uploads bone/morph
|
|
537
|
-
* ring-buffer offsets and allocates Tr2PerObjectDataWithPersistentBuffers;
|
|
538
|
-
* those fills are GPU ring-buffer state, so the GPU-free record carries the
|
|
539
|
-
* live object reference for the engine serializer to pull current values at
|
|
537
|
+
/** Carbon EveChildMesh::GetPerObjectData (cpp:799-843) uploads bone/morph
|
|
538
|
+
* ring-buffer offsets and allocates Tr2PerObjectDataWithPersistentBuffers;
|
|
539
|
+
* those fills are GPU ring-buffer state, so the GPU-free record carries the
|
|
540
|
+
* live object reference for the engine serializer to pull current values at
|
|
540
541
|
* realization (mirrors EveSpaceObject2.GetPerObjectData). */
|
|
541
542
|
GetPerObjectData(accumulator = null) {
|
|
542
543
|
const data = typeof accumulator?.Allocate === "function" ? accumulator.Allocate(Tr2PerObjectData) : new Tr2PerObjectData();
|
|
@@ -544,17 +545,17 @@ new class extends _identity {
|
|
|
544
545
|
return data;
|
|
545
546
|
}
|
|
546
547
|
|
|
547
|
-
/**
|
|
548
|
-
* Carbon's two IsCastingShadow overloads, dispatched on the second argument:
|
|
549
|
-
* a position vector (length >= 3) selects the sphere-overlap overload
|
|
550
|
-
* (cpp:338-364); anything else is the shadow-frustum overload (cpp:295-336),
|
|
551
|
-
* whose Carbon out-param float& sizeInShadow becomes the optional trailing
|
|
552
|
-
* length-1 array (out-params last).
|
|
553
|
-
* @param {Object} cameraFrustum
|
|
554
|
-
* @param {Object|Float32Array} shadowFrustumOrPosition
|
|
555
|
-
* @param {Number} renderReasonOrRadius
|
|
556
|
-
* @param {Array|Number} sizeInShadowOutOrRenderReason
|
|
557
|
-
* @returns {Boolean}
|
|
548
|
+
/**
|
|
549
|
+
* Carbon's two IsCastingShadow overloads, dispatched on the second argument:
|
|
550
|
+
* a position vector (length >= 3) selects the sphere-overlap overload
|
|
551
|
+
* (cpp:338-364); anything else is the shadow-frustum overload (cpp:295-336),
|
|
552
|
+
* whose Carbon out-param float& sizeInShadow becomes the optional trailing
|
|
553
|
+
* length-1 array (out-params last).
|
|
554
|
+
* @param {Object} cameraFrustum
|
|
555
|
+
* @param {Object|Float32Array} shadowFrustumOrPosition
|
|
556
|
+
* @param {Number} renderReasonOrRadius
|
|
557
|
+
* @param {Array|Number} sizeInShadowOutOrRenderReason
|
|
558
|
+
* @returns {Boolean}
|
|
558
559
|
*/
|
|
559
560
|
IsCastingShadow(cameraFrustum, shadowFrustumOrPosition, renderReasonOrRadius, sizeInShadowOutOrRenderReason = null) {
|
|
560
561
|
if (!this.display || !this.castShadow || !this.#hasUpdated) {
|
|
@@ -562,7 +563,7 @@ new class extends _identity {
|
|
|
562
563
|
}
|
|
563
564
|
const positionOverload = typeof shadowFrustumOrPosition?.length === "number" && shadowFrustumOrPosition.length >= 3;
|
|
564
565
|
const renderReason = positionOverload ? Number(sizeInShadowOutOrRenderReason ?? Tr2RenderReason.TR2RENDERREASON_NORMAL) : Number(renderReasonOrRadius ?? Tr2RenderReason.TR2RENDERREASON_NORMAL);
|
|
565
|
-
if (renderReason === Tr2RenderReason.TR2RENDERREASON_REFLECTION && !
|
|
566
|
+
if (renderReason === Tr2RenderReason.TR2RENDERREASON_REFLECTION && !ShouldReflect(this.reflectionMode)) {
|
|
566
567
|
return false;
|
|
567
568
|
}
|
|
568
569
|
if (positionOverload) {
|
|
@@ -622,16 +623,64 @@ new class extends _identity {
|
|
|
622
623
|
/** Carbon EveChildMesh::ChangeLOD (cpp:1052-1054) is an intentional no-op. */
|
|
623
624
|
ChangeLOD(_lod) {}
|
|
624
625
|
|
|
625
|
-
/** Carbon EveChildMesh::
|
|
626
|
-
*
|
|
627
|
-
*
|
|
626
|
+
/** Carbon EveChildMesh::RegisterComponents (cpp:239-269): LightOwner when
|
|
627
|
+
* lights are authored; ReflectionRenderable (ShouldReflect) and ShadowCaster
|
|
628
|
+
* (castShadow) only when a mesh is present; then forwards the attachments.
|
|
629
|
+
* Gate m_display. "MeshMorph" stays OUT-OF-BAND: Carbon registers it at
|
|
630
|
+
* baked-morph need inside BakeMorphs (cpp:1404-1409), not here - the JS
|
|
631
|
+
* BakeMorphs stub is the site that would register it when the GPU morph
|
|
632
|
+
* bake is ported. */
|
|
633
|
+
RegisterComponents() {
|
|
634
|
+
const registry = this.GetComponentRegistry();
|
|
635
|
+
if (registry && this.display) {
|
|
636
|
+
if (this.lights.length) {
|
|
637
|
+
registry.RegisterComponent(EveComponentType.LightOwner, this);
|
|
638
|
+
}
|
|
639
|
+
if (this.mesh !== null) {
|
|
640
|
+
if (ShouldReflect(this.reflectionMode)) {
|
|
641
|
+
registry.RegisterComponent(EveComponentType.ReflectionRenderable, this);
|
|
642
|
+
}
|
|
643
|
+
if (this.castShadow) {
|
|
644
|
+
registry.RegisterComponent(EveComponentType.ShadowCaster, this);
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
for (const attachment of this.attachments) {
|
|
648
|
+
attachment?.Register?.(registry);
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
/** Carbon EveChildMesh::UnRegisterComponents (cpp:275-290): forwards the
|
|
654
|
+
* attachments only (own components were already removed by
|
|
655
|
+
* EveEntity::UnRegister, EveEntity.cpp:90); no display re-check.
|
|
656
|
+
* UnregisterAudioGeometry (cpp:277) is audio-engine-owned and unported. */
|
|
657
|
+
UnRegisterComponents() {
|
|
658
|
+
const registry = this.GetComponentRegistry();
|
|
659
|
+
if (registry) {
|
|
660
|
+
for (const attachment of this.attachments) {
|
|
661
|
+
attachment?.UnRegister?.(registry);
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
/** Carbon EveChildMesh::GetLights (cpp:1638-1667): submits m_lights to the
|
|
667
|
+
* light manager. Awaits the LightOwner consumption pass (Tr2LightManager
|
|
668
|
+
* submission is unported); presence satisfies the "LightOwner" duck
|
|
669
|
+
* contract. */
|
|
670
|
+
GetLights(..._args) {
|
|
671
|
+
throw new Error("EveChildMesh.GetLights is not implemented in CarbonEngineJS.");
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
/** Carbon EveChildMesh::GetPickingBatches (cpp:862-889) maps Tr2PickTypes
|
|
675
|
+
* flags onto batch-type collections with transparent/additive special
|
|
676
|
+
* casing; the pick-type flag enum is not yet ported, so the surface fails
|
|
628
677
|
* loudly rather than mis-collecting. */
|
|
629
678
|
GetPickingBatches(..._args) {
|
|
630
679
|
throw new Error("EveChildMesh.GetPickingBatches is not implemented in CarbonEngineJS.");
|
|
631
680
|
}
|
|
632
681
|
|
|
633
|
-
/** Carbon EveChildMesh::InitializeAnimation (cpp:217-232) wires the
|
|
634
|
-
* animationUpdater to the mesh geometry resource; awaits the JS animation
|
|
682
|
+
/** Carbon EveChildMesh::InitializeAnimation (cpp:217-232) wires the
|
|
683
|
+
* animationUpdater to the mesh geometry resource; awaits the JS animation
|
|
635
684
|
* seam (no Tr2GrannyAnimation runtime). */
|
|
636
685
|
InitializeAnimation(..._args) {
|
|
637
686
|
throw new Error("EveChildMesh.InitializeAnimation is not implemented in CarbonEngineJS.");
|
|
@@ -652,16 +701,8 @@ new class extends _identity {
|
|
|
652
701
|
throw new Error("EveChildMesh.IsMeshBaked is not implemented in CarbonEngineJS.");
|
|
653
702
|
}
|
|
654
703
|
|
|
655
|
-
// Carbon EntityComponents::ShouldReflect (EveEntity.cpp:13-33) also consults
|
|
656
|
-
// the g_eveReflectionMode quality global (scene/engine-owned). With
|
|
657
|
-
// reflections enabled, REFLECT_NEVER is the only unconditionally-false mode,
|
|
658
|
-
// which is the portable core of the predicate.
|
|
659
|
-
|
|
660
704
|
// Carbon s_instanceScreenSizeThreshold (EveChildMesh.cpp:22).
|
|
661
705
|
}];
|
|
662
|
-
#ShouldReflect(mode) {
|
|
663
|
-
return mode !== ReflectionMode.REFLECT_NEVER;
|
|
664
|
-
}
|
|
665
706
|
#instanceScreenSizeThreshold = 1;
|
|
666
707
|
Origin = Origin;
|
|
667
708
|
ReflectionMode = ReflectionMode;
|