MCPcopy Create free account
hub / github.com/melonjs/melonJS / captureDepthOffset

Function captureDepthOffset

packages/melonjs/src/renderable/container.js:77–82  ·  view source on GitHub ↗

* Capture the world-space position of the given container into the * module-level `_depthOffset*` triple. Called once per sort by `sort` / * `sortNow` before walking the children, so `_sortDepth` can translate * each child's LOCAL `pos.x/y/z` into world space without paying for * an `ancestor.ge

(container)

Source from the content-addressed store, hash-verified

75 * @ignore
76 */
77function captureDepthOffset(container) {
78 const abs = container.getAbsolutePosition();
79 _depthOffsetX = abs.x;
80 _depthOffsetY = abs.y;
81 _depthOffsetZ = abs.z;
82}
83
84/**
85 * Register a child's physics body with the root world container when the

Callers 2

sortMethod · 0.85
sortNowMethod · 0.85

Calls 1

getAbsolutePositionMethod · 0.65

Tested by

no test coverage detected