Skip to content

Remove the wire drawing methods from AppBase - #9289

Merged
mvaligursky merged 1 commit into
mainfrom
mv-remove-appbase-wire-draw
Sep 3, 2026
Merged

Remove the wire drawing methods from AppBase#9289
mvaligursky merged 1 commit into
mainfrom
mv-remove-appbase-wire-draw

Conversation

@mvaligursky

Copy link
Copy Markdown
Contributor

Follow-up to #9288, which added WireRenderer.

AppBase#drawWireSphere and #drawWireAlignedBox are replaced by WireRenderer#sphere and #boxMinMax, so their bodies and docs are gone and they now report themselves through Debug.removed:

/**
 * @deprecated Use {@link WireRenderer#sphere} instead.
 * @ignore
 */
drawWireSphere() {
    Debug.removed('AppBase#drawWireSphere is removed. Use WireRenderer#sphere instead.');
}

Both were @ignore and absent from the type definitions, so this is not a public API change — but they were used widely enough that a silent removal would be unkind. Debug.removed is dropped from release builds, so a caller in production gets a no-op and the message only in development.

Color is now only referenced from JSDoc in app-base.js, so it becomes a type import.

What stays

The other five @ignore draw methods — drawMesh, drawMeshInstance, drawQuad, drawTexture, drawDepthTexture — have no replacement yet and belong with whatever replaces the mesh submission path.

Immediate#drawWireSphere and #drawWireAlignedBox both stay too. The aligned box has three callers inside the engine that cannot use WireRenderer, because core does not depend on extras:

  • src/scene/gsplat/gsplat-data.js
  • src/scene/gsplat-unified/gsplat-manager.js
  • src/scene/gsplat-unified/gsplat-octree-instance.js

The sphere has no callers left, but is kept alongside it as it may be useful again.

Migrated examples

Example Note
gaussian-splatting/clipping single colored box, so the color moves to the renderer
gaussian-splatting/editor same
gaussian-splatting/wind colors each handle as it is drawn; its explicit segments of 20 was already the default, so it drops out
physics/offset-collision reached into scene.immediate directly with a non-default segment count and an explicit layer

That last one is the nicest read of the change. Before:

app.scene.immediate.drawWireSphere(
    modelEntity.collision.getShapePosition(), 0.3, Color.GREEN, 16, true,
    app.scene.layers.getLayerByName('World')
);

After, with the three settings applied once outside the update loop:

wire.sphere(modelEntity.collision.getShapePosition(), 0.3);

Verified

All four examples still draw as before, in the browser. wind keeps its two handle colors — measured as 1,1,0,1 for the selected handle and 0.5,0.5,0.5,1 for the rest, with 10 handles at 60 segments each. Both stubs emit their expected messages. 2626 tests passing; engine lint, examples lint, prettier and types all clean.

🤖 Generated with Claude Code

`AppBase#drawWireSphere` and `#drawWireAlignedBox` are replaced by
`WireRenderer#sphere` and `#boxMinMax` from #9288, so their bodies and docs are
gone and they report themselves through `Debug.removed`. Both were `@ignore` and
absent from the type definitions, so this is not a public API change, but they
were used widely enough that a silent removal would be unkind. `Debug.removed`
is dropped from release builds, so a caller in production gets a no-op and the
message only in development.

`Color` is now only referenced from JSDoc in this file, so it becomes a type
import.

The other five `@ignore` draw methods stay. `drawMesh`, `drawMeshInstance`,
`drawQuad`, `drawTexture` and `drawDepthTexture` have no replacement yet, and
belong with whatever replaces the mesh submission path.

`Immediate#drawWireSphere` and `#drawWireAlignedBox` both stay as well. The
aligned box has three callers inside the engine - gsplat-data, gsplat-manager
and gsplat-octree-instance - which cannot use WireRenderer because core does not
depend on extras. The sphere has no callers left, but is worth keeping alongside
it.

Migrates the four examples that used the removed methods:

- gaussian-splatting/clipping and gaussian-splatting/editor draw a single
  colored box, so the color moves to the renderer
- gaussian-splatting/wind colors each handle as it is drawn, and its explicit
  segment count of 20 was already the default
- physics/offset-collision reached into `scene.immediate` directly and passed a
  non default segment count and an explicit layer. Those are renderer settings,
  so they are applied once outside the update loop and the call itself becomes
  `wire.sphere(position, 0.3)`

Verified in the browser: all four still draw as before, wind keeps its two
handle colors, and the stubs report the expected messages.
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

Build size report

This PR changes the size of the minified bundles.

Bundle Minified Gzip Brotli
playcanvas.min.js 2407.4 KB (−0.2 KB, −0.01%) 620.0 KB (−0.0 KB, −0.01%) 481.4 KB (+0.0 KB, +0.01%)
playcanvas.min.mjs 2404.7 KB (−0.2 KB, −0.01%) 618.7 KB (−0.0 KB, −0.01%) 480.4 KB (−0.2 KB, −0.05%)

@mvaligursky
mvaligursky merged commit 43ad36a into main Sep 3, 2026
10 checks passed
@mvaligursky
mvaligursky deleted the mv-remove-appbase-wire-draw branch September 3, 2026 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant