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

Method preDraw

packages/melonjs/src/renderable/mesh.js:788–793  ·  view source on GitHub ↗

* Prepare the renderer for drawing the mesh. On the `Camera3d` world-space * path the mesh emits final world coordinates, so it opts out of the base * anchor-point offset (Renderable#applyAnchorTransform = `false`) — * otherwise the offset would leak into the shared mesh view matrix. T

(renderer)

Source from the content-addressed store, hash-verified

786 * @param {CanvasRenderer|WebGLRenderer} renderer - a renderer instance
787 */
788 preDraw(renderer) {
789 // world-space meshes pivot about their own origin, not a bounds-box
790 // anchor (see Mesh class doc + Renderable#applyAnchorTransform)
791 this.applyAnchorTransform = this._useWorldSpace !== true;
792 super.preDraw(renderer);
793 }
794
795 /**
796 * Draw the mesh (automatically called by melonJS). Picks between two

Callers 15

drawMethod · 0.45
drawMethod · 0.45
imagelayer.spec.jsFile · 0.45
fullDrawFunction · 0.45
drawOnceFunction · 0.45
drawOnceFunction · 0.45
renderedVerticesFunction · 0.45
drawFullFunction · 0.45
firstVertexWithFlagFunction · 0.45
renderable.spec.jsFile · 0.45
clipRect.spec.jsFile · 0.45

Calls

no outgoing calls

Tested by 6

fullDrawFunction · 0.36
drawOnceFunction · 0.36
drawOnceFunction · 0.36
renderedVerticesFunction · 0.36
drawFullFunction · 0.36
firstVertexWithFlagFunction · 0.36