@carbonenginejs/runtime 0.1.0-alpha.2 → 0.1.0-alpha.3

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.
Files changed (45) hide show
  1. package/dist/global/model/CjsModel.js +3 -1
  2. package/dist/global/model/CjsModel.js.map +1 -1
  3. package/dist/global/model/document/CjsDocumentHydrator.js +5 -1
  4. package/dist/global/model/document/CjsDocumentHydrator.js.map +1 -1
  5. package/dist/global/schema/CjsSchema.js +98 -18
  6. package/dist/global/schema/CjsSchema.js.map +1 -1
  7. package/dist/global/schema/hydration.js +10 -8
  8. package/dist/global/schema/hydration.js.map +1 -1
  9. package/dist/index.js +2 -0
  10. package/dist/index.js.map +1 -1
  11. package/dist/resource/CjsResMan.js +177 -4
  12. package/dist/resource/CjsResMan.js.map +1 -1
  13. package/dist/resource/format/CjsBlueReader.js +8 -1
  14. package/dist/resource/format/CjsBlueReader.js.map +1 -1
  15. package/dist/resource/formats/webgl/core/glsl/DxbcGlslEmitter.js +7 -1
  16. package/dist/resource/formats/webgl/core/glsl/DxbcGlslEmitter.js.map +1 -1
  17. package/dist/resource/index.js +2 -0
  18. package/dist/resource/index.js.map +1 -1
  19. package/dist/resource/texture/SolidColorTextureConstructor.js +46 -0
  20. package/dist/resource/texture/SolidColorTextureConstructor.js.map +1 -0
  21. package/dist/resource/texture/TriTextureRes.js +43 -0
  22. package/dist/resource/texture/TriTextureRes.js.map +1 -1
  23. package/dist/resource/texture/index.js +2 -0
  24. package/dist/resource/texture/index.js.map +1 -1
  25. package/dist/resource/texture/solidColorTexture.js +111 -0
  26. package/dist/resource/texture/solidColorTexture.js.map +1 -0
  27. package/dist/trinity/eve/attachment/decal/EveSpaceObjectDecal.js +19 -8
  28. package/dist/trinity/eve/attachment/decal/EveSpaceObjectDecal.js.map +1 -1
  29. package/dist/trinity/eve/child/EveChildMesh.js +17 -3
  30. package/dist/trinity/eve/child/EveChildMesh.js.map +1 -1
  31. package/dist/trinity/eve/locator/EveLocatorSets.js +12 -3
  32. package/dist/trinity/eve/locator/EveLocatorSets.js.map +1 -1
  33. package/dist/trinity/eve/spaceObject/EveSpaceObject2.js +15 -2
  34. package/dist/trinity/eve/spaceObject/EveSpaceObject2.js.map +1 -1
  35. package/dist/trinity/eve/spaceObject/IEveSpaceObject2ParentData.js +44 -52
  36. package/dist/trinity/eve/spaceObject/IEveSpaceObject2ParentData.js.map +1 -1
  37. package/docs/resource/concepts/resource-lifecycle.md +10 -8
  38. package/docs/resource/formats/geometry-interchange.md +50 -0
  39. package/docs/resource/formats/webgl/decl-io.md +241 -397
  40. package/docs/resource/formats/webgl/memory-structured.md +91 -128
  41. package/docs/resource/formats/webgl/texture-sample.md +306 -469
  42. package/docs/resource/reference/classes/texture.md +11 -1
  43. package/docs/resource/reference/motherlode-cache.md +24 -11
  44. package/docs/resource/reference/queues.md +23 -1
  45. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"EveSpaceObjectDecal.js","sources":["../../../../../../src/trinity/eve/attachment/decal/EveSpaceObjectDecal.js"],"sourcesContent":["// Source: trinity/trinity/Eve/SpaceObject/Attachments/EveSpaceObjectDecal.h\n// Source: trinity/trinity/Eve/SpaceObject/Attachments/EveSpaceObjectDecal.cpp\n// Source: trinity/trinity/Eve/SpaceObject/Attachments/EveSpaceObjectDecal_Blue.cpp\nimport { box3 } from \"#math/box3\";\nimport { mat4 } from \"#math/mat4\";\nimport { quat } from \"#math/quat\";\nimport { vec3 } from \"#math/vec3\";\nimport { CjsModel } from \"#model\";\nimport { carbon, impl, io, type } from \"#schema\";\nimport { IEveSpaceObject2ParentData } from \"../../spaceObject/IEveSpaceObject2ParentData.js\";\nimport { TriBatchType } from \"#consts/graphics\";\nimport { withITr2Renderable } from \"../../../core/ITr2Renderable.js\";\nimport { BuildDecalGeometry, BuildStaticDecalGeometry } from \"./decalIndices.js\";\n\n\n/**\n * A decal projected onto a parent hull, owning its oriented projection matrix,\n * optional bone attachment, per-LOD triangle index lists and screen-size\n * visibility ramp.\n */\n@type.define({ className: \"EveSpaceObjectDecal\", family: \"eve/attachment/decal\" })\nexport class EveSpaceObjectDecal extends withITr2Renderable(CjsModel)\n{\n /**\n * Establishes Carbon's opaque decal batch type after schema initialization,\n * because the schema's legacy TriBatchType default is 0.\n */\n constructor()\n {\n super();\n // The schema's legacy TriBatchType default is 0. Carbon's decal default is\n // the opaque batch (1), so establish it after model/schema initialization.\n this.batchType = 1;\n }\n\n @io.persist\n @type.string\n name = \"\";\n\n @io.read\n @type.int32\n @type.enum(\"TriBatchType\")\n batchType = 1;\n\n @io.notify\n @io.persist\n @type.vec3\n position = vec3.create();\n\n @io.persist\n @type.float32\n minScreenSize = 0;\n\n @io.notify\n @io.persist\n @type.quat\n rotation = quat.create();\n\n @io.notify\n @io.persist\n @type.vec3\n scaling = vec3.fromValues(1, 1, 1);\n\n @io.persist\n @type.int32\n parentBoneIndex = -1;\n\n @io.rebuild(\"packedGeometry\")\n @io.persist\n @type.objectRef(\"Tr2Effect\")\n decalEffect = null;\n\n @io.readwrite\n @type.boolean\n display = true;\n\n // SOF-authored per-LOD triangle indices; persisted so the values\n // interchange reproduces Carbon's hidden decal geometry selection.\n @io.rebuild(\"packedGeometry\")\n @io.persist\n @type.array(\"unknown\")\n staticIndexBuffers = [];\n\n #decalMatrix = mat4.create();\n\n #inverseDecalMatrix = mat4.create();\n\n #priority = 0;\n\n /** m_baseGeometryResource (TriGeometryResPtr) - the hull's, not the decal's. */\n #baseGeometryResource = null;\n\n /** m_geometryLodIndex (int) */\n #geometryLodIndex = 0;\n\n /** m_decalGeometry (std::shared_ptr<MeshDecalData>) */\n #decalGeometry = null;\n\n /** m_isGeometryFrozen (bool) - pins the decal to LOD 0. */\n #isGeometryFrozen = false;\n\n /** m_parentData (EveSpaceObjectDecal.h:178) - copied by value from the\n * owning space object each frame; zeroed with an identity transform by\n * Carbon's constructor (cpp:56-57). Runtime state, never persisted. */\n #parentData = new IEveSpaceObject2ParentData();\n\n /** m_parentBoneMatrix (h:190) - the animated parent bone this decal rides,\n * identity until SetBoneMatrix supplies one. */\n #parentBoneMatrix = mat4.create();\n\n /** m_isVisible (h:204) - a float, not a bool: the non-LOD paths set exactly\n * 0 or 1 while the LOD path writes a 0..1 fade ramp (cpp:119-176). */\n #isVisible = 0;\n\n /** m_minBounds / m_maxBounds (h:215) - the geometry mesh bounds an instanced\n * decal measures instead of the unit cube. Stamped by the loader. */\n #minBounds = vec3.create();\n\n #maxBounds = vec3.create();\n\n /** m_instanceData (h:212) - non-null selects the instanced visibility path.\n * The instance buffer itself is engine-owned; the graph only needs to know\n * whether one is attached. */\n #instanceData = null;\n\n /** Carbon m_invParentBoneMatrix (h:191) is declared but never assigned; the\n * value the shader sees is recomputed per fill (cpp:366), so this port keeps\n * no member for it. */\n #inverseParentBoneMatrix = mat4.create();\n\n #shLightingScratch = new Float32Array(IEveSpaceObject2ParentData.SH_COEFFICIENT_COUNT * 4);\n\n /**\n * Property form of HasStaticIndexBuffers: whether any LOD carries decal\n * triangle indices.\n */\n get hasStaticIndexBuffers()\n {\n return this.HasStaticIndexBuffers();\n }\n\n /**\n * Builds the decal matrix and its inverse from the authored position, rotation\n * and scaling; returns false when the composed matrix is not invertible.\n */\n @carbon.method\n @impl.adapted\n Initialize()\n {\n return this.#updateDecalMatrix();\n }\n\n /**\n * Rebuilds the decal matrix and its inverse after an authored placement\n * change.\n */\n @carbon.method\n @impl.adapted\n OnModified(_options = {})\n {\n this.#updateDecalMatrix();\n return true;\n }\n\n /**\n * Copies another decal's authored description - name, display, placement, bone\n * index, minimum screen size, effect and batch type - and rebuilds the decal\n * matrix; the per-LOD index buffers are not copied. Returns false when source\n * is missing.\n */\n @carbon.method\n @impl.adapted\n CopyFrom(source)\n {\n if (!source) return false;\n this.name = String(source.name ?? \"\");\n this.display = !!source.display;\n vec3.copy(this.position, source.position || EveSpaceObjectDecal.#zero);\n quat.copy(this.rotation, source.rotation || EveSpaceObjectDecal.#identityRotation);\n vec3.copy(this.scaling, source.scaling || EveSpaceObjectDecal.#one);\n this.parentBoneIndex = Number(source.parentBoneIndex) | 0;\n this.minScreenSize = Number(source.minScreenSize) || 0;\n this.decalEffect = source.decalEffect ?? null;\n this.batchType = Number(source.batchType) | 0;\n return this.#updateDecalMatrix();\n }\n\n /**\n * Copies the authored decal position into the caller-owned out vector and\n * returns it.\n */\n @carbon.method\n @impl.adapted\n GetPosition(out = vec3.create())\n {\n return vec3.copy(out, this.position);\n }\n\n /**\n * Sets the authored decal position and rebuilds the decal matrix; a missing\n * value is taken as the origin.\n */\n @carbon.method\n @impl.adapted\n SetPosition(value)\n {\n vec3.copy(this.position, value || EveSpaceObjectDecal.#zero);\n return this.#updateDecalMatrix();\n }\n\n /**\n * Copies the authored decal rotation into the caller-owned out quaternion and\n * returns it.\n */\n @carbon.method\n @impl.adapted\n GetRotation(out = quat.create())\n {\n return quat.copy(out, this.rotation);\n }\n\n /**\n * Sets the authored decal rotation and rebuilds the decal matrix; a missing\n * value is taken as the identity rotation.\n */\n @carbon.method\n @impl.adapted\n SetRotation(value)\n {\n quat.copy(this.rotation, value || EveSpaceObjectDecal.#identityRotation);\n return this.#updateDecalMatrix();\n }\n\n /**\n * Copies the authored decal scaling into the caller-owned out vector and\n * returns it.\n */\n @carbon.method\n @impl.adapted\n GetScaling(out = vec3.create())\n {\n return vec3.copy(out, this.scaling);\n }\n\n /**\n * Copies the decal's projection matrix into out; the value is only current as\n * of the last Initialize, OnModified or placement setter.\n */\n @carbon.method\n @impl.adapted\n GetDecalMatrix(out = mat4.create())\n {\n return mat4.copy(out, this.#decalMatrix);\n }\n\n /**\n * Copies the inverse of the decal's projection matrix into out, which is what\n * maps hull-space positions into the decal's unit cube.\n */\n @carbon.method\n @impl.adapted\n GetInverseDecalMatrix(out = mat4.create())\n {\n return mat4.copy(out, this.#inverseDecalMatrix);\n }\n\n /**\n * Sets the authored decal scaling and rebuilds the decal matrix; a missing\n * value is taken as unit scale.\n */\n @carbon.method\n @impl.adapted\n SetScaling(value)\n {\n vec3.copy(this.scaling, value || EveSpaceObjectDecal.#one);\n return this.#updateDecalMatrix();\n }\n\n /**\n * The parent mesh bone the decal rides, or -1 when it rides the hull transform\n * directly.\n */\n @carbon.method\n @impl.adapted\n GetBoneIndex()\n {\n return this.parentBoneIndex;\n }\n\n /**\n * Sets the parent mesh bone the decal rides; the bone matrix itself is only\n * picked up on the next SetBoneMatrix.\n */\n @carbon.method\n @impl.adapted\n SetBoneIndex(index)\n {\n this.parentBoneIndex = Number(index) | 0;\n return true;\n }\n\n /**\n * Replaces the SOF-authored triangle index lists, one array per LOD, coercing\n * each entry to an unsigned integer.\n */\n @carbon.method\n @impl.adapted\n SetIndices(indices)\n {\n this.staticIndexBuffers = Array.from(indices || [], lod => Array.from(lod || [], value => Number(value) >>> 0));\n return true;\n }\n\n /**\n * The per-LOD triangle index lists as fresh copies, so a caller cannot mutate\n * the stored buffers.\n */\n @carbon.method\n @impl.adapted\n GetStaticIndexBuffers()\n {\n return this.staticIndexBuffers.map(lod => lod.slice());\n }\n\n /**\n * Whether any LOD carries triangle indices; a decal without them has no\n * geometry to draw.\n */\n @carbon.method\n @impl.adapted\n HasStaticIndexBuffers()\n {\n return this.staticIndexBuffers.some(lod => lod.length > 0);\n }\n\n /** The triangle count per LOD, being each index list's length divided by three. */\n @carbon.method\n @impl.adapted\n GetDecalPrimitiveCounts()\n {\n return this.staticIndexBuffers.map(lod => Math.trunc(lod.length / 3));\n }\n\n /**\n * Sets the LOD threshold in screen pixels below which UpdateVisibility culls\n * the decal; zero disables the test and makes the decal always visible.\n */\n @carbon.method\n @impl.adapted\n SetMinScreenSize(value)\n {\n this.minScreenSize = Number(value) || 0;\n return true;\n }\n\n /** Sets the effect that draws the decal; a decal without one is never visible. */\n @carbon.method\n @impl.adapted\n SetEffect(effect)\n {\n this.decalEffect = effect ?? null;\n return true;\n }\n\n /**\n * Sets a shader option on the decal effect; returns false when no effect that\n * accepts options is attached.\n */\n @carbon.method\n @impl.adapted\n SetShaderOption(name, value)\n {\n if (!this.decalEffect?.SetOption) return false;\n this.decalEffect.SetOption(name, value);\n return true;\n }\n\n /**\n * Sets the TriBatchType the decal submits under, overriding the opaque default\n * the constructor establishes.\n */\n @carbon.method\n @impl.adapted\n SetBatchType(value)\n {\n this.batchType = Number(value) | 0;\n return true;\n }\n\n /**\n * Sets the draw priority the engine sorts decals on; the value is runtime-only\n * and never persisted.\n */\n @carbon.method\n @impl.adapted\n SetPriority(value)\n {\n this.#priority = Number(value) >>> 0;\n return true;\n }\n\n /** Carbon EveSpaceObjectDecal::SetBoneMatrix (cpp:475-491): expands the\n * parent's Float4x3 mesh bone at m_parentBoneIndex into the 4x4 bone matrix.\n * A -1 index or an out-of-range index leaves the identity in place. */\n @carbon.method\n @impl.implemented\n SetBoneMatrix(boneMatrices, boneMatrixCount)\n {\n if (this.parentBoneIndex === -1 || this.parentBoneIndex >= boneMatrixCount)\n {\n return false;\n }\n\n const bone = boneMatrices?.[this.parentBoneIndex];\n if (!bone) return false;\n\n // Float4x3 is COLUMN-stride on the shared byte layout: each packed row is\n // (v0, v4, v8, v12) of the logical matrix (math skill gotcha 7), so the\n // expansion writes the transpose of the three packed rows back into the\n // 4x4 basis and leaves the last column as identity.\n const out = this.#parentBoneMatrix;\n for (let row = 0; row < 3; row++)\n {\n out[row] = bone[row * 4 + 0];\n out[4 + row] = bone[row * 4 + 1];\n out[8 + row] = bone[row * 4 + 2];\n out[12 + row] = bone[row * 4 + 3];\n }\n out[3] = 0;\n out[7] = 0;\n out[11] = 0;\n out[15] = 1;\n\n return true;\n }\n\n /** Carbon copies the parent data by value at the two points UpdateVisibility\n * accepts the decal (cpp:145, cpp:178). shLighting is a borrowed pointer into\n * the parent's own PS data, so it is carried by reference exactly as Carbon\n * carries the pointer. */\n #CopyParentData(parentData)\n {\n if (this.#parentData.SetValues) this.#parentData.SetValues(parentData);\n else Object.assign(this.#parentData, parentData);\n\n this.#parentData.shLighting = parentData.shLighting ?? null;\n }\n\n /**\n * Carbon EveSpaceObjectDecal::UpdateVisibility (cpp:117-179).\n *\n * `m_isVisible` is a FLOAT: zero when culled, one when no minimum screen\n * size is authored, otherwise a 0..1 fade ramp that reaches the shader as\n * displayData.y. The ramp has no lower clamp because the below-minimum case\n * already returned.\n *\n * On every cull path Carbon leaves m_parentData STALE - only the visibility\n * is cleared - so the copy happens solely on the accept paths.\n */\n @carbon.method\n @impl.implemented\n UpdateVisibility(updateContext, parentData)\n {\n this.#isVisible = 0;\n\n if (!this.display || !this.decalEffect || !parentData) return false;\n\n if (!(this.minScreenSize > 0))\n {\n this.#isVisible = 1;\n this.#CopyParentData(parentData);\n return true;\n }\n\n const frustum = updateContext?.GetFrustum?.() ?? updateContext?.frustum ?? null;\n if (!frustum) return false;\n\n // Carbon (row-vector): m_parentBoneMatrix * parentData->transform - the\n // bone applies first, so the gl operands swap.\n const worldDecalMatrix = mat4.multiply(\n EveSpaceObjectDecal.#worldDecalScratch,\n parentData.transform,\n this.#parentBoneMatrix\n );\n const bounds = box3.set(EveSpaceObjectDecal.#boundsScratch, -1, -1, -1, 1, 1, 1);\n\n if (this.#instanceData)\n {\n // Instanced decals measure the geometry mesh bounds instead of the unit\n // cube (cpp:135-155). Carbon transforms only the two CORNERS here (not\n // the eight, as it does below), so this is vec3, not box3.transformMat4.\n // Carbon transforms only the two CORNERS here (not the eight, as it does\n // below). A mirroring transform swaps them, which Carbon leaves inverted\n // and box3 would read as EMPTY, so the pair is accumulated as points -\n // ordering it. The eight-corner transform below is indifferent to order,\n // so this only affects the mirrored-decal early-outs (parity note\n // divergence 7).\n const corner = EveSpaceObjectDecal.#pointScratch;\n box3.empty(bounds);\n vec3.transformMat4(corner, this.#minBounds, worldDecalMatrix);\n box3.addPoint(bounds, bounds, corner);\n vec3.transformMat4(corner, this.#maxBounds, worldDecalMatrix);\n box3.addPoint(bounds, bounds, corner);\n\n if (box3.containsPoint(bounds, frustum.viewPos))\n {\n this.#isVisible = 1;\n this.#CopyParentData(parentData);\n return true;\n }\n\n if (!frustum.IsBoxVisible?.(bounds))\n {\n return false;\n }\n\n // Measure from the closest point of the box rather than its centre, so a\n // long box does not lod out while one end is near the camera.\n const offset = box3.getClampedPoint(\n EveSpaceObjectDecal.#pointScratch,\n bounds,\n frustum.viewPos\n );\n vec3.subtract(offset, offset, frustum.viewPos);\n mat4.multiply(\n worldDecalMatrix,\n mat4.fromTranslation(EveSpaceObjectDecal.#offsetScratch, offset),\n worldDecalMatrix\n );\n }\n\n // Carbon: m_decalMatrix * worldDecalMatrix - the decal applies first.\n mat4.multiply(worldDecalMatrix, worldDecalMatrix, this.#decalMatrix);\n box3.transformMat4(bounds, bounds, worldDecalMatrix);\n\n // Carbon's sphere is the box's circumscribing sphere: the centre of the\n // transformed box and HALF ITS FULL DIAGONAL (cpp:159-160).\n const center = EveSpaceObjectDecal.#pointScratch;\n const radius = box3.toPositionRadius(bounds, center);\n const pixelSize = frustum.GetPixelSizeAccrossEst(center, radius);\n const modifiedMinScreen = this.minScreenSize * (updateContext?.GetLodFactor() ?? 1);\n\n if (pixelSize < modifiedMinScreen) return false;\n\n this.#isVisible = Math.min((pixelSize - modifiedMinScreen) / (modifiedMinScreen * 0.5), 1);\n this.#CopyParentData(parentData);\n return true;\n }\n\n /** The visibility fade Carbon writes to displayData.y; 0 when lodded out. */\n @carbon.method\n @impl.adapted\n @impl.reason(\"Carbon reads the m_isVisible member directly; JavaScript exposes the private runtime value through an accessor.\")\n GetVisibility()\n {\n return this.#isVisible;\n }\n\n /** Carbon EveSpaceObjectDecal::HasTransparentBatches (cpp:241-244). */\n @carbon.method\n @impl.implemented\n HasTransparentBatches()\n {\n return true;\n }\n\n /** Carbon EveSpaceObjectDecal::GetSortValue (cpp:337-340). */\n @carbon.method\n @impl.implemented\n GetSortValue()\n {\n return 1;\n }\n\n /** Carbon ITr2Pickable::GetID is inline on the decal (h:113-116) and returns\n * the object itself; the area id selects nothing on this class. */\n @carbon.method\n @impl.implemented\n GetID(_areaId)\n {\n return this;\n }\n\n /**\n * Carbon EveSpaceObjectDecal::GetPerObjectData (cpp:346-386): the\n * EveDecalPerObjectData composite - a DecalVSPerObjectData +\n * DecalPSPerObjectData pair uploaded as TWO constant buffers (cpp:975-976).\n * Here that is two Allocs returned as a { vs, ps } record.\n *\n * SetAndTranspose performs Carbon's Transpose. Carbon computes the two\n * inverses FROM the already-transposed matrices; because Inverse(M-transpose)\n * equals Inverse(M)-transpose (carbon-math-conventions F2), inverting the\n * logical matrix and letting the encoder transpose produces byte-identical\n * output with one transpose less work.\n */\n @carbon.method\n @impl.implemented\n GetPerObjectData(accumulator)\n {\n const vs = accumulator.Alloc(\"DecalVSPerObjectData\");\n const ps = accumulator.Alloc(\"DecalPSPerObjectData\");\n const parentData = this.#parentData;\n\n vs.SetAndTranspose(\"worldMatrix\", parentData.transform);\n // cpp:358 inverts the transposed world matrix in place; by F2 that is the\n // transpose of the logical inverse, so this is the same bytes.\n mat4.invert(this.#inverseParentBoneMatrix, parentData.transform);\n vs.SetAndTranspose(\"invWorldMatrix\", this.#inverseParentBoneMatrix);\n\n vs.SetAndTranspose(\"decalMatrix\", this.#decalMatrix);\n vs.SetAndTranspose(\"inverseDecalMatrix\", this.#inverseDecalMatrix);\n vs.SetAndTranspose(\"parentBoneMatrix\", this.#parentBoneMatrix);\n\n // cpp:366 - Inverse(Transpose(m_parentBoneMatrix)), recomputed per fill;\n // Carbon never reads its own m_invParentBoneMatrix member. Same F2\n // identity as above.\n mat4.invert(this.#inverseParentBoneMatrix, this.#parentBoneMatrix);\n vs.SetAndTranspose(\"invParentBoneMatrix\", this.#inverseParentBoneMatrix);\n\n // cpp:374 - killCount is a uint widened to float; isVisible is the 0..1\n // visibility ramp; z and w are reserved literals.\n ps.Set(\"displayData\", [parentData.killCount, this.#isVisible, 0, 0]);\n ps.Set(\"shipData\", parentData.shipData);\n ps.Set(\"clipData\", [\n parentData.clipSphereCenter[0],\n parentData.clipSphereCenter[1],\n parentData.clipSphereCenter[2],\n parentData.clipRadiusSq\n ]);\n ps.Set(\"clipRadius2Sq\", [parentData.clipRadius2Sq]);\n\n // cpp:376-383 - copy the parent's seven packed coefficients, or zero the\n // whole block when the parent supplied none. m_unused stays unwritten.\n const coefficients = this.#shLightingScratch;\n coefficients.fill(0);\n const shLighting = parentData.shLighting;\n if (shLighting)\n {\n for (let index = 0; index < coefficients.length && index < shLighting.length; index++)\n {\n coefficients[index] = shLighting[index];\n }\n }\n ps.Set(\"shLightingCoefficients\", coefficients);\n\n return { vs, ps };\n }\n\n /**\n * Adds this decal to the renderable list once its geometry is ready.\n *\n * Carbon EveSpaceObjectDecal::GetRenderables (cpp:182-225). EveSpaceObject2\n * already calls this per decal with the hull's geometry resource and mesh\n * screen size (cpp:1578-1591); ours does the same.\n *\n * The decal is a RENDERABLE, not a batch source the parent drains: it puts\n * itself in the list and the renderer asks it for batches later, which is why\n * everything expensive happens here and GetBatches only submits.\n *\n * @param {Array} out Renderable list.\n * @param {object} _meshCache Carbon's DecalMeshCache, only used by the\n * selection path to avoid re-mapping hull buffers; unused here because a\n * decoded payload is already CPU-side.\n * @param {object} geometryResource The hull's geometry.\n * @param {number} screenSize The parent's mesh screen size, for LOD choice.\n * @returns {boolean} Whether the decal was added.\n */\n @carbon.method\n @impl.adapted\n @impl.reason(\"Trinity selects the LOD and builds the index list; the engine owns the device index buffer, so validity is judged on the built list rather than on a GPU allocation.\")\n GetRenderables(out = [], _meshCache = null, geometryResource = null, screenSize = Infinity)\n {\n if (this.#isVisible <= 0 || !geometryResource) return false;\n\n // A NEW MESH INVALIDATES THE BUILD. Carbon's comment calls this out as slow\n // and to be avoided, which is why it is keyed on identity rather than\n // rebuilt every frame.\n if (geometryResource !== this.#baseGeometryResource)\n {\n this.#decalGeometry = null;\n this.#baseGeometryResource = geometryResource;\n }\n\n const mesh = geometryResource.GetMeshData(0);\n\n if (!this.#decalGeometry || (mesh && mesh.lodMask !== this.#decalGeometry.lodMask))\n {\n this.#decalGeometry = this.#BuildGeometry(mesh);\n }\n\n if (!this.#decalGeometry) return false;\n\n this.#geometryLodIndex = this.#isGeometryFrozen\n ? 0\n : geometryResource.GetLodIndexForScreenSize(0, screenSize);\n\n const lod = this.#decalGeometry.lods?.[this.#geometryLodIndex];\n\n // A LOD the decal does not reach carries zero primitives, which is how\n // Carbon says \"not covered here\" - hence testing the count, not the buffer.\n if (!lod || !lod.primitiveCount) return false;\n\n out.push(this);\n\n return true;\n }\n\n /**\n * Builds the decal's index list for the hull it is attached to.\n *\n * The static lists win when present, exactly as Carbon orders it: every decal\n * on a shipped hull arrives with them, and triangle selection sits behind the\n * g_buildDecalBuffers global for decals placed at runtime (cpp:196-207).\n *\n * @param {object} mesh Decoded mesh data.\n * @returns {object|null} Built geometry, or null when there is nothing to draw.\n */\n #BuildGeometry(mesh)\n {\n if (!mesh) return null;\n\n const built = this.HasStaticIndexBuffers()\n ? BuildStaticDecalGeometry(mesh, this.staticIndexBuffers)\n : BuildDecalGeometry(mesh, this.#decalMatrix, this.#inverseDecalMatrix);\n\n if (!built.indices.length) return null;\n\n return {\n inverseDecalMatrix: mat4.clone(this.#inverseDecalMatrix),\n lodMask: mesh.lodMask ?? 0,\n lods: built.lods,\n indices: built.indices\n };\n }\n\n /** Carbon EveSpaceObjectDecal::SetHighDetailDecalState (cpp:514-517). */\n @carbon.method\n @impl.implemented\n SetHighDetailDecalState(isFrozen)\n {\n this.#isGeometryFrozen = !!isFrozen;\n return true;\n }\n\n /** Carbon EveSpaceObjectDecal::GetBatches (cpp:250-331) submits the packed\n * decal index buffers against the device geometry resource. */\n @carbon.method\n @impl.notImplemented\n GetBatches(_batches, _batchType, _perObjectData, _reason)\n {\n throw new Error(\"EveSpaceObjectDecal.GetBatches is not implemented in CarbonEngineJS.\");\n }\n\n /** Carbon EveSpaceObjectDecal::GetPickingBatches (cpp:919-926) forwards to\n * GetBatches once the attachment pick-type mask passes. */\n @carbon.method\n @impl.notImplemented\n GetPickingBatches(_batches, _pickTypes, _perObjectData)\n {\n throw new Error(\"EveSpaceObjectDecal.GetPickingBatches is not implemented in CarbonEngineJS.\");\n }\n\n /**\n * Recomposes the decal matrix from the authored rotation, position and scaling\n * and inverts it; returns whether the inverse existed.\n */\n #updateDecalMatrix()\n {\n mat4.fromRotationTranslationScale(this.#decalMatrix, this.rotation, this.position, this.scaling);\n return !!mat4.invert(this.#inverseDecalMatrix, this.#decalMatrix);\n }\n\n /** Per-frame scratch - UpdateVisibility must not allocate. */\n static #boundsScratch = box3.create();\n\n static #worldDecalScratch = mat4.create();\n\n static #offsetScratch = mat4.create();\n\n static #pointScratch = vec3.create();\n\n static #zero = vec3.create();\n\n static #one = vec3.fromValues(1, 1, 1);\n\n static #identityRotation = quat.create();\n\n static TriBatchType = TriBatchType;\n\n}\n"],"names":["_EveSpaceObjectDecal","_identity","EveSpaceObjectDecal","_withITr2Renderable","withITr2Renderable","CjsModel","e","_init_name","_init_extra_name","_init_batchType","_init_extra_batchType","_init_position","_init_extra_position","_init_minScreenSize","_init_extra_minScreenSize","_init_rotation","_init_extra_rotation","_init_scaling","_init_extra_scaling","_init_parentBoneIndex","_init_extra_parentBoneIndex","_init_decalEffect","_init_extra_decalEffect","_init_display","_init_extra_display","_init_staticIndexBuffers","_init_extra_staticIndexBuffers","_initProto","c","_initClass","_applyDecs","type","define","className","family","io","persist","string","read","int32","enum","notify","vec3","float32","quat","rebuild","objectRef","readwrite","boolean","array","carbon","method","impl","adapted","implemented","reason","notImplemented","constructor","batchType","name","position","create","minScreenSize","rotation","scaling","fromValues","parentBoneIndex","decalEffect","display","staticIndexBuffers","mat4","IEveSpaceObject2ParentData","Float32Array","SH_COEFFICIENT_COUNT","hasStaticIndexBuffers","HasStaticIndexBuffers","Initialize","OnModified","_options","CopyFrom","source","String","copy","Number","GetPosition","out","SetPosition","value","GetRotation","SetRotation","GetScaling","GetDecalMatrix","GetInverseDecalMatrix","SetScaling","GetBoneIndex","SetBoneIndex","index","SetIndices","indices","Array","from","lod","GetStaticIndexBuffers","map","slice","some","length","GetDecalPrimitiveCounts","Math","trunc","SetMinScreenSize","SetEffect","effect","SetShaderOption","SetOption","SetBatchType","SetPriority","SetBoneMatrix","boneMatrices","boneMatrixCount","bone","row","#CopyParentData","parentData","SetValues","Object","assign","shLighting","UpdateVisibility","updateContext","frustum","GetFrustum","worldDecalMatrix","multiply","transform","bounds","box3","set","corner","empty","transformMat4","addPoint","containsPoint","viewPos","IsBoxVisible","offset","getClampedPoint","subtract","fromTranslation","center","radius","toPositionRadius","pixelSize","GetPixelSizeAccrossEst","modifiedMinScreen","GetLodFactor","min","GetVisibility","HasTransparentBatches","GetSortValue","GetID","_areaId","GetPerObjectData","accumulator","vs","Alloc","ps","SetAndTranspose","invert","Set","killCount","shipData","clipSphereCenter","clipRadiusSq","clipRadius2Sq","coefficients","fill","GetRenderables","_meshCache","geometryResource","screenSize","Infinity","mesh","GetMeshData","lodMask","GetLodIndexForScreenSize","lods","primitiveCount","push","#BuildGeometry","built","BuildStaticDecalGeometry","BuildDecalGeometry","inverseDecalMatrix","clone","SetHighDetailDecalState","isFrozen","GetBatches","_batches","_batchType","_perObjectData","_reason","Error","GetPickingBatches","_pickTypes","#updateDecalMatrix","fromRotationTranslationScale","TriBatchType"],"mappings":";;;;;;;;;;;;;;;AAeA;AACA;AACA;AACA;AACA;AAJA,IAAAA;AAAA,IAAA,cAAAC,SAAA,CAAA;EAAA,QAKA,MAAAC,mBAAA,UAAAC,mBAAA,GACyCC,kBAAkB,CAACC,QAAQ,CAAC,EACrE;AAAA,IAAA;AAAA,MAAA,CAAA;AAAAC,QAAAA,CAAA,GAAAC,UAAA,EAAAC,gBAAA,EAAAC,eAAA,EAAAC,qBAAA,EAAAC,cAAA,EAAAC,oBAAA,EAAAC,mBAAA,EAAAC,yBAAA,EAAAC,cAAA,EAAAC,oBAAA,EAAAC,aAAA,EAAAC,mBAAA,EAAAC,qBAAA,EAAAC,2BAAA,EAAAC,iBAAA,EAAAC,uBAAA,EAAAC,aAAA,EAAAC,mBAAA,EAAA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EAAE;EAErB,IAAI,GAAGnB,IAAI,CAACuB,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AAE/B,EAAA,iBAAiB,GAAGrB,IAAI,CAACiB,MAAM,EAAE;AAEjCkJ,EAAAA,YAAY,GAAGA,YAAY;EAACtJ,WAAAA,GAAA;IAAA,KAAA,CAAAzD,oBAAA,GAAA6B,UAAA,EAAA;AAAA,EAAA;AAAA,CAAA,EAAA;;;;"}
1
+ {"version":3,"file":"EveSpaceObjectDecal.js","sources":["../../../../../../src/trinity/eve/attachment/decal/EveSpaceObjectDecal.js"],"sourcesContent":["// Source: trinity/trinity/Eve/SpaceObject/Attachments/EveSpaceObjectDecal.h\n// Source: trinity/trinity/Eve/SpaceObject/Attachments/EveSpaceObjectDecal.cpp\n// Source: trinity/trinity/Eve/SpaceObject/Attachments/EveSpaceObjectDecal_Blue.cpp\nimport { box3 } from \"#math/box3\";\nimport { mat4 } from \"#math/mat4\";\nimport { quat } from \"#math/quat\";\nimport { vec3 } from \"#math/vec3\";\nimport { vec4 } from \"#math/vec4\";\nimport { CjsModel } from \"#model\";\nimport { carbon, impl, io, type } from \"#schema\";\nimport { IEveSpaceObject2ParentData } from \"../../spaceObject/IEveSpaceObject2ParentData.js\";\nimport { TriBatchType } from \"#consts/graphics\";\nimport { withITr2Renderable } from \"../../../core/ITr2Renderable.js\";\nimport { BuildDecalGeometry, BuildStaticDecalGeometry } from \"./decalIndices.js\";\n\n\n/**\n * A decal projected onto a parent hull, owning its oriented projection matrix,\n * optional bone attachment, per-LOD triangle index lists and screen-size\n * visibility ramp.\n */\n@type.define({ className: \"EveSpaceObjectDecal\", family: \"eve/attachment/decal\" })\nexport class EveSpaceObjectDecal extends withITr2Renderable(CjsModel)\n{\n /**\n * Establishes Carbon's opaque decal batch type after schema initialization,\n * because the schema's legacy TriBatchType default is 0.\n */\n constructor()\n {\n super();\n // The schema's legacy TriBatchType default is 0. Carbon's decal default is\n // the opaque batch (1), so establish it after model/schema initialization.\n this.batchType = 1;\n }\n\n @io.persist\n @type.string\n name = \"\";\n\n @io.read\n @type.int32\n @type.enum(\"TriBatchType\")\n batchType = 1;\n\n @io.notify\n @io.persist\n @type.vec3\n position = vec3.create();\n\n @io.persist\n @type.float32\n minScreenSize = 0;\n\n @io.notify\n @io.persist\n @type.quat\n rotation = quat.create();\n\n @io.notify\n @io.persist\n @type.vec3\n scaling = vec3.fromValues(1, 1, 1);\n\n @io.persist\n @type.int32\n parentBoneIndex = -1;\n\n @io.rebuild(\"packedGeometry\")\n @io.persist\n @type.objectRef(\"Tr2Effect\")\n decalEffect = null;\n\n @io.readwrite\n @type.boolean\n display = true;\n\n // SOF-authored per-LOD triangle indices; persisted so the values\n // interchange reproduces Carbon's hidden decal geometry selection.\n @io.rebuild(\"packedGeometry\")\n @io.persist\n @type.array(\"unknown\")\n staticIndexBuffers = [];\n\n #decalMatrix = mat4.create();\n\n #inverseDecalMatrix = mat4.create();\n\n #priority = 0;\n\n /** m_baseGeometryResource (TriGeometryResPtr) - the hull's, not the decal's. */\n #baseGeometryResource = null;\n\n /** m_geometryLodIndex (int) */\n #geometryLodIndex = 0;\n\n /** m_decalGeometry (std::shared_ptr<MeshDecalData>) */\n #decalGeometry = null;\n\n /** m_isGeometryFrozen (bool) - pins the decal to LOD 0. */\n #isGeometryFrozen = false;\n\n /** m_parentData (EveSpaceObjectDecal.h:178) - copied by value from the\n * owning space object each frame; zeroed with an identity transform by\n * Carbon's constructor (cpp:56-57). Runtime state, never persisted. */\n #parentData = new IEveSpaceObject2ParentData();\n\n /** m_parentBoneMatrix (h:190) - the animated parent bone this decal rides,\n * identity until SetBoneMatrix supplies one. */\n #parentBoneMatrix = mat4.create();\n\n /** m_isVisible (h:204) - a float, not a bool: the non-LOD paths set exactly\n * 0 or 1 while the LOD path writes a 0..1 fade ramp (cpp:119-176). */\n #isVisible = 0;\n\n /** m_minBounds / m_maxBounds (h:215) - the geometry mesh bounds an instanced\n * decal measures instead of the unit cube. Stamped by the loader. */\n #minBounds = vec3.create();\n\n #maxBounds = vec3.create();\n\n /** m_instanceData (h:212) - non-null selects the instanced visibility path.\n * The instance buffer itself is engine-owned; the graph only needs to know\n * whether one is attached. */\n #instanceData = null;\n\n /** Carbon m_invParentBoneMatrix (h:191) is declared but never assigned; the\n * value the shader sees is recomputed per fill (cpp:366), so this port keeps\n * no member for it. */\n #inverseParentBoneMatrix = mat4.create();\n\n #shLightingScratch = new Float32Array(IEveSpaceObject2ParentData.SH_COEFFICIENT_COUNT * 4);\n\n /**\n * Property form of HasStaticIndexBuffers: whether any LOD carries decal\n * triangle indices.\n */\n get hasStaticIndexBuffers()\n {\n return this.HasStaticIndexBuffers();\n }\n\n /**\n * Builds the decal matrix and its inverse from the authored position, rotation\n * and scaling; returns false when the composed matrix is not invertible.\n */\n @carbon.method\n @impl.adapted\n Initialize()\n {\n return this.#updateDecalMatrix();\n }\n\n /**\n * Rebuilds the decal matrix and its inverse after an authored placement\n * change.\n */\n @carbon.method\n @impl.adapted\n OnModified(_options = {})\n {\n this.#updateDecalMatrix();\n return true;\n }\n\n /**\n * Copies another decal's authored description - name, display, placement, bone\n * index, minimum screen size, effect and batch type - and rebuilds the decal\n * matrix; the per-LOD index buffers are not copied. Returns false when source\n * is missing.\n */\n @carbon.method\n @impl.adapted\n CopyFrom(source)\n {\n if (!source) return false;\n this.name = String(source.name ?? \"\");\n this.display = !!source.display;\n vec3.copy(this.position, source.position || EveSpaceObjectDecal.#zero);\n quat.copy(this.rotation, source.rotation || EveSpaceObjectDecal.#identityRotation);\n vec3.copy(this.scaling, source.scaling || EveSpaceObjectDecal.#one);\n this.parentBoneIndex = Number(source.parentBoneIndex) | 0;\n this.minScreenSize = Number(source.minScreenSize) || 0;\n this.decalEffect = source.decalEffect ?? null;\n this.batchType = Number(source.batchType) | 0;\n return this.#updateDecalMatrix();\n }\n\n /**\n * Copies the authored decal position into the caller-owned out vector and\n * returns it.\n */\n @carbon.method\n @impl.adapted\n GetPosition(out = vec3.create())\n {\n return vec3.copy(out, this.position);\n }\n\n /**\n * Sets the authored decal position and rebuilds the decal matrix; a missing\n * value is taken as the origin.\n */\n @carbon.method\n @impl.adapted\n SetPosition(value)\n {\n vec3.copy(this.position, value || EveSpaceObjectDecal.#zero);\n return this.#updateDecalMatrix();\n }\n\n /**\n * Copies the authored decal rotation into the caller-owned out quaternion and\n * returns it.\n */\n @carbon.method\n @impl.adapted\n GetRotation(out = quat.create())\n {\n return quat.copy(out, this.rotation);\n }\n\n /**\n * Sets the authored decal rotation and rebuilds the decal matrix; a missing\n * value is taken as the identity rotation.\n */\n @carbon.method\n @impl.adapted\n SetRotation(value)\n {\n quat.copy(this.rotation, value || EveSpaceObjectDecal.#identityRotation);\n return this.#updateDecalMatrix();\n }\n\n /**\n * Copies the authored decal scaling into the caller-owned out vector and\n * returns it.\n */\n @carbon.method\n @impl.adapted\n GetScaling(out = vec3.create())\n {\n return vec3.copy(out, this.scaling);\n }\n\n /**\n * Copies the decal's projection matrix into out; the value is only current as\n * of the last Initialize, OnModified or placement setter.\n */\n @carbon.method\n @impl.adapted\n GetDecalMatrix(out = mat4.create())\n {\n return mat4.copy(out, this.#decalMatrix);\n }\n\n /**\n * Copies the inverse of the decal's projection matrix into out, which is what\n * maps hull-space positions into the decal's unit cube.\n */\n @carbon.method\n @impl.adapted\n GetInverseDecalMatrix(out = mat4.create())\n {\n return mat4.copy(out, this.#inverseDecalMatrix);\n }\n\n /**\n * Sets the authored decal scaling and rebuilds the decal matrix; a missing\n * value is taken as unit scale.\n */\n @carbon.method\n @impl.adapted\n SetScaling(value)\n {\n vec3.copy(this.scaling, value || EveSpaceObjectDecal.#one);\n return this.#updateDecalMatrix();\n }\n\n /**\n * The parent mesh bone the decal rides, or -1 when it rides the hull transform\n * directly.\n */\n @carbon.method\n @impl.adapted\n GetBoneIndex()\n {\n return this.parentBoneIndex;\n }\n\n /**\n * Sets the parent mesh bone the decal rides; the bone matrix itself is only\n * picked up on the next SetBoneMatrix.\n */\n @carbon.method\n @impl.adapted\n SetBoneIndex(index)\n {\n this.parentBoneIndex = Number(index) | 0;\n return true;\n }\n\n /**\n * Replaces the SOF-authored triangle index lists, one array per LOD, coercing\n * each entry to an unsigned integer.\n */\n @carbon.method\n @impl.adapted\n SetIndices(indices)\n {\n this.staticIndexBuffers = Array.from(indices || [], lod => Array.from(lod || [], value => Number(value) >>> 0));\n return true;\n }\n\n /**\n * The per-LOD triangle index lists as fresh copies, so a caller cannot mutate\n * the stored buffers.\n */\n @carbon.method\n @impl.adapted\n GetStaticIndexBuffers()\n {\n return this.staticIndexBuffers.map(lod => lod.slice());\n }\n\n /**\n * Whether any LOD carries triangle indices; a decal without them has no\n * geometry to draw.\n */\n @carbon.method\n @impl.adapted\n HasStaticIndexBuffers()\n {\n return this.staticIndexBuffers.some(lod => lod.length > 0);\n }\n\n /** The triangle count per LOD, being each index list's length divided by three. */\n @carbon.method\n @impl.adapted\n GetDecalPrimitiveCounts()\n {\n return this.staticIndexBuffers.map(lod => Math.trunc(lod.length / 3));\n }\n\n /**\n * Sets the LOD threshold in screen pixels below which UpdateVisibility culls\n * the decal; zero disables the test and makes the decal always visible.\n */\n @carbon.method\n @impl.adapted\n SetMinScreenSize(value)\n {\n this.minScreenSize = Number(value) || 0;\n return true;\n }\n\n /** Sets the effect that draws the decal; a decal without one is never visible. */\n @carbon.method\n @impl.adapted\n SetEffect(effect)\n {\n this.decalEffect = effect ?? null;\n return true;\n }\n\n /**\n * Sets a shader option on the decal effect; returns false when no effect that\n * accepts options is attached.\n */\n @carbon.method\n @impl.adapted\n SetShaderOption(name, value)\n {\n if (!this.decalEffect?.SetOption) return false;\n this.decalEffect.SetOption(name, value);\n return true;\n }\n\n /**\n * Sets the TriBatchType the decal submits under, overriding the opaque default\n * the constructor establishes.\n */\n @carbon.method\n @impl.adapted\n SetBatchType(value)\n {\n this.batchType = Number(value) | 0;\n return true;\n }\n\n /**\n * Sets the draw priority the engine sorts decals on; the value is runtime-only\n * and never persisted.\n */\n @carbon.method\n @impl.adapted\n SetPriority(value)\n {\n this.#priority = Number(value) >>> 0;\n return true;\n }\n\n /** Carbon EveSpaceObjectDecal::SetBoneMatrix (cpp:475-491): expands the\n * parent's Float4x3 mesh bone at m_parentBoneIndex into the 4x4 bone matrix.\n * A -1 index or an out-of-range index leaves the identity in place. */\n @carbon.method\n @impl.implemented\n SetBoneMatrix(boneMatrices, boneMatrixCount)\n {\n if (this.parentBoneIndex === -1 || this.parentBoneIndex >= boneMatrixCount)\n {\n return false;\n }\n\n const bone = boneMatrices?.[this.parentBoneIndex];\n if (!bone) return false;\n\n // Float4x3 is COLUMN-stride on the shared byte layout: each packed row is\n // (v0, v4, v8, v12) of the logical matrix (math skill gotcha 7), so the\n // expansion writes the transpose of the three packed rows back into the\n // 4x4 basis and leaves the last column as identity.\n const out = this.#parentBoneMatrix;\n for (let row = 0; row < 3; row++)\n {\n out[row] = bone[row * 4 + 0];\n out[4 + row] = bone[row * 4 + 1];\n out[8 + row] = bone[row * 4 + 2];\n out[12 + row] = bone[row * 4 + 3];\n }\n out[3] = 0;\n out[7] = 0;\n out[11] = 0;\n out[15] = 1;\n\n return true;\n }\n\n /** Carbon copies the parent data by value at the two points UpdateVisibility\n * accepts the decal (cpp:145, cpp:178): `m_parentData = *parentData`. Member\n * by member is that struct copy - no export, no allocation, on a per-decal\n * per-frame path. shLighting is a borrowed pointer into the parent's own PS\n * data, so it is carried by reference exactly as Carbon carries the pointer. */\n #CopyParentData(parentData)\n {\n const own = this.#parentData;\n mat4.copy(own.transform, parentData.transform);\n own.killCount = parentData.killCount;\n vec4.copy(own.shipData, parentData.shipData);\n vec3.copy(own.clipSphereCenter, parentData.clipSphereCenter);\n own.clipRadiusSq = parentData.clipRadiusSq;\n own.clipRadius2Sq = parentData.clipRadius2Sq;\n own.clipFactor = parentData.clipFactor;\n own.clipFactor2 = parentData.clipFactor2;\n own.shLighting = parentData.shLighting;\n vec4.copy(own.customData, parentData.customData);\n }\n\n /**\n * Carbon EveSpaceObjectDecal::UpdateVisibility (cpp:117-179).\n *\n * `m_isVisible` is a FLOAT: zero when culled, one when no minimum screen\n * size is authored, otherwise a 0..1 fade ramp that reaches the shader as\n * displayData.y. The ramp has no lower clamp because the below-minimum case\n * already returned.\n *\n * On every cull path Carbon leaves m_parentData STALE - only the visibility\n * is cleared - so the copy happens solely on the accept paths.\n */\n @carbon.method\n @impl.implemented\n UpdateVisibility(updateContext, parentData)\n {\n this.#isVisible = 0;\n\n if (!this.display || !this.decalEffect || !parentData) return false;\n\n if (!(this.minScreenSize > 0))\n {\n this.#isVisible = 1;\n this.#CopyParentData(parentData);\n return true;\n }\n\n const frustum = updateContext?.GetFrustum?.() ?? updateContext?.frustum ?? null;\n if (!frustum) return false;\n\n // Carbon (row-vector): m_parentBoneMatrix * parentData->transform - the\n // bone applies first, so the gl operands swap.\n const worldDecalMatrix = mat4.multiply(\n EveSpaceObjectDecal.#worldDecalScratch,\n parentData.transform,\n this.#parentBoneMatrix\n );\n const bounds = box3.set(EveSpaceObjectDecal.#boundsScratch, -1, -1, -1, 1, 1, 1);\n\n if (this.#instanceData)\n {\n // Instanced decals measure the geometry mesh bounds instead of the unit\n // cube (cpp:135-155). Carbon transforms only the two CORNERS here (not\n // the eight, as it does below), so this is vec3, not box3.transformMat4.\n // Carbon transforms only the two CORNERS here (not the eight, as it does\n // below). A mirroring transform swaps them, which Carbon leaves inverted\n // and box3 would read as EMPTY, so the pair is accumulated as points -\n // ordering it. The eight-corner transform below is indifferent to order,\n // so this only affects the mirrored-decal early-outs (parity note\n // divergence 7).\n const corner = EveSpaceObjectDecal.#pointScratch;\n box3.empty(bounds);\n vec3.transformMat4(corner, this.#minBounds, worldDecalMatrix);\n box3.addPoint(bounds, bounds, corner);\n vec3.transformMat4(corner, this.#maxBounds, worldDecalMatrix);\n box3.addPoint(bounds, bounds, corner);\n\n if (box3.containsPoint(bounds, frustum.viewPos))\n {\n this.#isVisible = 1;\n this.#CopyParentData(parentData);\n return true;\n }\n\n if (!frustum.IsBoxVisible?.(bounds))\n {\n return false;\n }\n\n // Measure from the closest point of the box rather than its centre, so a\n // long box does not lod out while one end is near the camera.\n const offset = box3.getClampedPoint(\n EveSpaceObjectDecal.#pointScratch,\n bounds,\n frustum.viewPos\n );\n vec3.subtract(offset, offset, frustum.viewPos);\n mat4.multiply(\n worldDecalMatrix,\n mat4.fromTranslation(EveSpaceObjectDecal.#offsetScratch, offset),\n worldDecalMatrix\n );\n }\n\n // Carbon: m_decalMatrix * worldDecalMatrix - the decal applies first.\n mat4.multiply(worldDecalMatrix, worldDecalMatrix, this.#decalMatrix);\n box3.transformMat4(bounds, bounds, worldDecalMatrix);\n\n // Carbon's sphere is the box's circumscribing sphere: the centre of the\n // transformed box and HALF ITS FULL DIAGONAL (cpp:159-160).\n const center = EveSpaceObjectDecal.#pointScratch;\n const radius = box3.toPositionRadius(bounds, center);\n const pixelSize = frustum.GetPixelSizeAccrossEst(center, radius);\n const modifiedMinScreen = this.minScreenSize * (updateContext?.GetLodFactor() ?? 1);\n\n if (pixelSize < modifiedMinScreen) return false;\n\n this.#isVisible = Math.min((pixelSize - modifiedMinScreen) / (modifiedMinScreen * 0.5), 1);\n this.#CopyParentData(parentData);\n return true;\n }\n\n /** The visibility fade Carbon writes to displayData.y; 0 when lodded out. */\n @carbon.method\n @impl.adapted\n @impl.reason(\"Carbon reads the m_isVisible member directly; JavaScript exposes the private runtime value through an accessor.\")\n GetVisibility()\n {\n return this.#isVisible;\n }\n\n /** Carbon EveSpaceObjectDecal::HasTransparentBatches (cpp:241-244). */\n @carbon.method\n @impl.implemented\n HasTransparentBatches()\n {\n return true;\n }\n\n /** Carbon EveSpaceObjectDecal::GetSortValue (cpp:337-340). */\n @carbon.method\n @impl.implemented\n GetSortValue()\n {\n return 1;\n }\n\n /** Carbon ITr2Pickable::GetID is inline on the decal (h:113-116) and returns\n * the object itself; the area id selects nothing on this class. */\n @carbon.method\n @impl.implemented\n GetID(_areaId)\n {\n return this;\n }\n\n /**\n * Carbon EveSpaceObjectDecal::GetPerObjectData (cpp:346-386): the\n * EveDecalPerObjectData composite - a DecalVSPerObjectData +\n * DecalPSPerObjectData pair uploaded as TWO constant buffers (cpp:975-976).\n * Here that is two Allocs returned as a { vs, ps } record.\n *\n * SetAndTranspose performs Carbon's Transpose. Carbon computes the two\n * inverses FROM the already-transposed matrices; because Inverse(M-transpose)\n * equals Inverse(M)-transpose (carbon-math-conventions F2), inverting the\n * logical matrix and letting the encoder transpose produces byte-identical\n * output with one transpose less work.\n */\n @carbon.method\n @impl.implemented\n GetPerObjectData(accumulator)\n {\n const vs = accumulator.Alloc(\"DecalVSPerObjectData\");\n const ps = accumulator.Alloc(\"DecalPSPerObjectData\");\n const parentData = this.#parentData;\n\n vs.SetAndTranspose(\"worldMatrix\", parentData.transform);\n // cpp:358 inverts the transposed world matrix in place; by F2 that is the\n // transpose of the logical inverse, so this is the same bytes.\n mat4.invert(this.#inverseParentBoneMatrix, parentData.transform);\n vs.SetAndTranspose(\"invWorldMatrix\", this.#inverseParentBoneMatrix);\n\n vs.SetAndTranspose(\"decalMatrix\", this.#decalMatrix);\n vs.SetAndTranspose(\"inverseDecalMatrix\", this.#inverseDecalMatrix);\n vs.SetAndTranspose(\"parentBoneMatrix\", this.#parentBoneMatrix);\n\n // cpp:366 - Inverse(Transpose(m_parentBoneMatrix)), recomputed per fill;\n // Carbon never reads its own m_invParentBoneMatrix member. Same F2\n // identity as above.\n mat4.invert(this.#inverseParentBoneMatrix, this.#parentBoneMatrix);\n vs.SetAndTranspose(\"invParentBoneMatrix\", this.#inverseParentBoneMatrix);\n\n // cpp:374 - killCount is a uint widened to float; isVisible is the 0..1\n // visibility ramp; z and w are reserved literals.\n ps.Set(\"displayData\", [parentData.killCount, this.#isVisible, 0, 0]);\n ps.Set(\"shipData\", parentData.shipData);\n ps.Set(\"clipData\", [\n parentData.clipSphereCenter[0],\n parentData.clipSphereCenter[1],\n parentData.clipSphereCenter[2],\n parentData.clipRadiusSq\n ]);\n ps.Set(\"clipRadius2Sq\", [parentData.clipRadius2Sq]);\n\n // cpp:376-383 - copy the parent's seven packed coefficients, or zero the\n // whole block when the parent supplied none. m_unused stays unwritten.\n const coefficients = this.#shLightingScratch;\n coefficients.fill(0);\n const shLighting = parentData.shLighting;\n if (shLighting)\n {\n for (let index = 0; index < coefficients.length && index < shLighting.length; index++)\n {\n coefficients[index] = shLighting[index];\n }\n }\n ps.Set(\"shLightingCoefficients\", coefficients);\n\n return { vs, ps };\n }\n\n /**\n * Adds this decal to the renderable list once its geometry is ready.\n *\n * Carbon EveSpaceObjectDecal::GetRenderables (cpp:182-225). EveSpaceObject2\n * already calls this per decal with the hull's geometry resource and mesh\n * screen size (cpp:1578-1591); ours does the same.\n *\n * The decal is a RENDERABLE, not a batch source the parent drains: it puts\n * itself in the list and the renderer asks it for batches later, which is why\n * everything expensive happens here and GetBatches only submits.\n *\n * @param {Array} out Renderable list.\n * @param {object} _meshCache Carbon's DecalMeshCache, only used by the\n * selection path to avoid re-mapping hull buffers; unused here because a\n * decoded payload is already CPU-side.\n * @param {object} geometryResource The hull's geometry.\n * @param {number} screenSize The parent's mesh screen size, for LOD choice.\n * @returns {boolean} Whether the decal was added.\n */\n @carbon.method\n @impl.adapted\n @impl.reason(\"Trinity selects the LOD and builds the index list; the engine owns the device index buffer, so validity is judged on the built list rather than on a GPU allocation.\")\n GetRenderables(out = [], _meshCache = null, geometryResource = null, screenSize = Infinity)\n {\n if (this.#isVisible <= 0 || !geometryResource) return false;\n\n // A NEW MESH INVALIDATES THE BUILD. Carbon's comment calls this out as slow\n // and to be avoided, which is why it is keyed on identity rather than\n // rebuilt every frame.\n if (geometryResource !== this.#baseGeometryResource)\n {\n this.#decalGeometry = null;\n this.#baseGeometryResource = geometryResource;\n }\n\n const mesh = geometryResource.GetMeshData(0);\n\n if (!this.#decalGeometry || (mesh && mesh.lodMask !== this.#decalGeometry.lodMask))\n {\n this.#decalGeometry = this.#BuildGeometry(mesh);\n }\n\n if (!this.#decalGeometry) return false;\n\n this.#geometryLodIndex = this.#isGeometryFrozen\n ? 0\n : geometryResource.GetLodIndexForScreenSize(0, screenSize);\n\n const lod = this.#decalGeometry.lods?.[this.#geometryLodIndex];\n\n // A LOD the decal does not reach carries zero primitives, which is how\n // Carbon says \"not covered here\" - hence testing the count, not the buffer.\n if (!lod || !lod.primitiveCount) return false;\n\n out.push(this);\n\n return true;\n }\n\n /**\n * Builds the decal's index list for the hull it is attached to.\n *\n * The static lists win when present, exactly as Carbon orders it: every decal\n * on a shipped hull arrives with them, and triangle selection sits behind the\n * g_buildDecalBuffers global for decals placed at runtime (cpp:196-207).\n *\n * @param {object} mesh Decoded mesh data.\n * @returns {object|null} Built geometry, or null when there is nothing to draw.\n */\n #BuildGeometry(mesh)\n {\n if (!mesh) return null;\n\n const built = this.HasStaticIndexBuffers()\n ? BuildStaticDecalGeometry(mesh, this.staticIndexBuffers)\n : BuildDecalGeometry(mesh, this.#decalMatrix, this.#inverseDecalMatrix);\n\n if (!built.indices.length) return null;\n\n return {\n inverseDecalMatrix: mat4.clone(this.#inverseDecalMatrix),\n lodMask: mesh.lodMask ?? 0,\n lods: built.lods,\n indices: built.indices\n };\n }\n\n /** Carbon EveSpaceObjectDecal::SetHighDetailDecalState (cpp:514-517). */\n @carbon.method\n @impl.implemented\n SetHighDetailDecalState(isFrozen)\n {\n this.#isGeometryFrozen = !!isFrozen;\n return true;\n }\n\n /** Carbon EveSpaceObjectDecal::GetBatches (cpp:250-331) submits the packed\n * decal index buffers against the device geometry resource. */\n @carbon.method\n @impl.notImplemented\n GetBatches(_batches, _batchType, _perObjectData, _reason)\n {\n throw new Error(\"EveSpaceObjectDecal.GetBatches is not implemented in CarbonEngineJS.\");\n }\n\n /** Carbon EveSpaceObjectDecal::GetPickingBatches (cpp:919-926) forwards to\n * GetBatches once the attachment pick-type mask passes. */\n @carbon.method\n @impl.notImplemented\n GetPickingBatches(_batches, _pickTypes, _perObjectData)\n {\n throw new Error(\"EveSpaceObjectDecal.GetPickingBatches is not implemented in CarbonEngineJS.\");\n }\n\n /**\n * Recomposes the decal matrix from the authored rotation, position and scaling\n * and inverts it; returns whether the inverse existed.\n */\n #updateDecalMatrix()\n {\n mat4.fromRotationTranslationScale(this.#decalMatrix, this.rotation, this.position, this.scaling);\n return !!mat4.invert(this.#inverseDecalMatrix, this.#decalMatrix);\n }\n\n /** Per-frame scratch - UpdateVisibility must not allocate. */\n static #boundsScratch = box3.create();\n\n static #worldDecalScratch = mat4.create();\n\n static #offsetScratch = mat4.create();\n\n static #pointScratch = vec3.create();\n\n static #zero = vec3.create();\n\n static #one = vec3.fromValues(1, 1, 1);\n\n static #identityRotation = quat.create();\n\n static TriBatchType = TriBatchType;\n\n}\n"],"names":["_EveSpaceObjectDecal","_identity","EveSpaceObjectDecal","_withITr2Renderable","withITr2Renderable","CjsModel","e","_init_name","_init_extra_name","_init_batchType","_init_extra_batchType","_init_position","_init_extra_position","_init_minScreenSize","_init_extra_minScreenSize","_init_rotation","_init_extra_rotation","_init_scaling","_init_extra_scaling","_init_parentBoneIndex","_init_extra_parentBoneIndex","_init_decalEffect","_init_extra_decalEffect","_init_display","_init_extra_display","_init_staticIndexBuffers","_init_extra_staticIndexBuffers","_initProto","c","_initClass","_applyDecs","type","define","className","family","io","persist","string","read","int32","enum","notify","vec3","float32","quat","rebuild","objectRef","readwrite","boolean","array","carbon","method","impl","adapted","implemented","reason","notImplemented","constructor","batchType","name","position","create","minScreenSize","rotation","scaling","fromValues","parentBoneIndex","decalEffect","display","staticIndexBuffers","mat4","IEveSpaceObject2ParentData","Float32Array","SH_COEFFICIENT_COUNT","hasStaticIndexBuffers","HasStaticIndexBuffers","Initialize","OnModified","_options","CopyFrom","source","String","copy","Number","GetPosition","out","SetPosition","value","GetRotation","SetRotation","GetScaling","GetDecalMatrix","GetInverseDecalMatrix","SetScaling","GetBoneIndex","SetBoneIndex","index","SetIndices","indices","Array","from","lod","GetStaticIndexBuffers","map","slice","some","length","GetDecalPrimitiveCounts","Math","trunc","SetMinScreenSize","SetEffect","effect","SetShaderOption","SetOption","SetBatchType","SetPriority","SetBoneMatrix","boneMatrices","boneMatrixCount","bone","row","#CopyParentData","parentData","own","transform","killCount","vec4","shipData","clipSphereCenter","clipRadiusSq","clipRadius2Sq","clipFactor","clipFactor2","shLighting","customData","UpdateVisibility","updateContext","frustum","GetFrustum","worldDecalMatrix","multiply","bounds","box3","set","corner","empty","transformMat4","addPoint","containsPoint","viewPos","IsBoxVisible","offset","getClampedPoint","subtract","fromTranslation","center","radius","toPositionRadius","pixelSize","GetPixelSizeAccrossEst","modifiedMinScreen","GetLodFactor","min","GetVisibility","HasTransparentBatches","GetSortValue","GetID","_areaId","GetPerObjectData","accumulator","vs","Alloc","ps","SetAndTranspose","invert","Set","coefficients","fill","GetRenderables","_meshCache","geometryResource","screenSize","Infinity","mesh","GetMeshData","lodMask","GetLodIndexForScreenSize","lods","primitiveCount","push","#BuildGeometry","built","BuildStaticDecalGeometry","BuildDecalGeometry","inverseDecalMatrix","clone","SetHighDetailDecalState","isFrozen","GetBatches","_batches","_batchType","_perObjectData","_reason","Error","GetPickingBatches","_pickTypes","#updateDecalMatrix","fromRotationTranslationScale","TriBatchType"],"mappings":";;;;;;;;;;;;;;;;AAgBA;AACA;AACA;AACA;AACA;AAJA,IAAAA;AAAA,IAAA,cAAAC,SAAA,CAAA;EAAA,QAKA,MAAAC,mBAAA,UAAAC,mBAAA,GACyCC,kBAAkB,CAACC,QAAQ,CAAC,EACrE;AAAA,IAAA;AAAA,MAAA,CAAA;AAAAC,QAAAA,CAAA,GAAAC,UAAA,EAAAC,gBAAA,EAAAC,eAAA,EAAAC,qBAAA,EAAAC,cAAA,EAAAC,oBAAA,EAAAC,mBAAA,EAAAC,yBAAA,EAAAC,cAAA,EAAAC,oBAAA,EAAAC,aAAA,EAAAC,mBAAA,EAAAC,qBAAA,EAAAC,2BAAA,EAAAC,iBAAA,EAAAC,uBAAA,EAAAC,aAAA,EAAAC,mBAAA,EAAAC,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AAI,CAAC,YAAY,EAAE,IAAI,CAACjJ,QAAQ,EAAE,IAAI,CAACH,QAAQ,EAAE,IAAI,CAACI,OAAO,CAAC;AAChG,MAAA,OAAO,CAAC,CAACM,IAAI,CAACyG,MAAM,CAAC,IAAI,CAAC,mBAAmB,EAAE,IAAI,CAAC,YAAY,CAAC;AACnE,IAAA;;AAEA;GAiBD;AAhBQ,EAAA,cAAc,GAAGhC,IAAI,CAAClF,MAAM,EAAE;AAE9B,EAAA,kBAAkB,GAAGS,IAAI,CAACT,MAAM,EAAE;AAElC,EAAA,cAAc,GAAGS,IAAI,CAACT,MAAM,EAAE;AAE9B,EAAA,aAAa,GAAGnB,IAAI,CAACmB,MAAM,EAAE;AAE7B,EAAA,KAAK,GAAGnB,IAAI,CAACmB,MAAM,EAAE;EAErB,IAAI,GAAGnB,IAAI,CAACuB,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;AAE/B,EAAA,iBAAiB,GAAGrB,IAAI,CAACiB,MAAM,EAAE;AAEjCoJ,EAAAA,YAAY,GAAGA,YAAY;EAACxJ,WAAAA,GAAA;IAAA,KAAA,CAAAzD,oBAAA,GAAA6B,UAAA,EAAA;AAAA,EAAA;AAAA,CAAA,EAAA;;;;"}
@@ -13,6 +13,7 @@ import { ShouldReflect, EveComponentType } from '../EveComponentTypes.js';
13
13
  import { Tr2RenderReason } from '../../generated/trinityCore/enums.js';
14
14
  import { Tr2Lod } from '#consts/trinity';
15
15
  import '../../core/rawData/perObjectData/Tr2PerObjectData.js';
16
+ import { IEveSpaceObject2ParentData } from '../spaceObject/IEveSpaceObject2ParentData.js';
16
17
  import { TR2_PICK_TYPE_DEFAULT, Tr2PickType } from '../../core/view/Tr2PickType.js';
17
18
  import { createChildPerObjectRecords, inheritParentPerObjectData, stampChildTransforms } from '../perObjectData/childPerObjectRecords.js';
18
19
  import { Float4x3 as _Float4x } from '../../utilities/Float4x3.js';
@@ -100,6 +101,10 @@ new class extends _identity {
100
101
  /** Identity rest-pose palette for skinned shaders without live animation. */
101
102
  #restPoseBoneTransforms = null;
102
103
  #parentOverlayEffects = null;
104
+
105
+ /** m_parentData (IEveSpaceObject2::ParentData) - refreshed from the space
106
+ * object parent in UpdateSyncronous and handed to the decals (cpp:1015, 450). */
107
+ #parentData = new IEveSpaceObject2ParentData();
103
108
  #overlayAreaBlocks = [[], []];
104
109
  #overlayAreaBlocksBuilt = false;
105
110
 
@@ -516,6 +521,9 @@ new class extends _identity {
516
521
  // data by this child's translation, then stamp our own transforms.
517
522
  const parent = params?.spaceObjectParent ?? null;
518
523
  inheritParentPerObjectData(this.#perObjectData, parent, this.translation);
524
+ // Carbon cpp:1015: the decals' parent data comes from the space object
525
+ // parent, then is made relevant to this child below.
526
+ if (parent) parent.GetParentData(this.#parentData);
519
527
  this.#parentOverlayEffects = this.inheritOverlayEffects && Array.isArray(parent?.overlayEffects) ? parent.overlayEffects : null;
520
528
  if (parent && !this.inheritOverlayEffects) {
521
529
  this.#perObjectData.vs.Set("clipData", [0, 0, 0, 0]);
@@ -523,7 +531,14 @@ new class extends _identity {
523
531
  this.#perObjectData.ps.Set("clipRadius2Sq", [0]);
524
532
  this.#perObjectData.ps.Set("clipSphereFactor", [0]);
525
533
  this.#perObjectData.ps.Set("clipSphereFactor2", [0]);
534
+ // cpp:1033-1036: the decals lose the inherited clip sphere too.
535
+ this.#parentData.clipRadiusSq = 0;
536
+ this.#parentData.clipRadius2Sq = 0;
537
+ this.#parentData.clipFactor = 0;
538
+ this.#parentData.clipFactor2 = 0;
526
539
  }
540
+ // cpp:1044: the decals are placed by this child's world transform.
541
+ if (parent) mat4.copy(this.#parentData.transform, this.worldTransform);
527
542
  stampChildTransforms(this.#perObjectData, this.worldTransform, this.#lastWorldTransform);
528
543
  this.#activationStrength = Number(params?.activationStrength ?? 1);
529
544
  if (this.damageOverlay) {
@@ -721,9 +736,8 @@ new class extends _identity {
721
736
  for (const decal of this.decals) {
722
737
  // Carbon (cpp:441-446) feeds animated bone matrices to the decal first
723
738
  // - skipped until the JS animation seam exists. Carbon passes
724
- // &m_parentData (per-object shading struct, GPU seam); the owning
725
- // child stands in as the duck-typed parent.
726
- decal?.UpdateVisibility(updateContext, this);
739
+ // &m_parentData (cpp:450), refreshed in UpdateSyncronous.
740
+ decal?.UpdateVisibility(updateContext, this.#parentData);
727
741
  }
728
742
  }
729
743
  return this.#isVisible;