The renderer system had an old check in it for "undefined skin properties" which threw an error. There are now a range of ways to handle the case when a simulation object (e.g. an agent) does not have its skin property set.
draw nothing
draw an "unknown" sprite 32x32
draw a "turtle" sprite 32x32, with a line pointing to cartesian 0 degrees (right)
The specific behavior is set in modules/flags, which seems to store visual flags that Ben assigned for use with class-visual.
TECHNICAL DETAILS
class-visual setTexture(name) now checks whether name is undefined. If it is, it sets it to DEFAULT_SPRITE. If DEFAULT_SPRITE happens to be empty string, the method just returns without doing anything.
The default sprite is assigned assetId 1 which should be available, as manifest autogeneration in ursys/util/manifest.js starts at 100. A collision is possible if an asset directory is using a hand-created manifest.
The default sprite is loaded by making it part of the as-load-sprites resource module constructor. It just calls queueAssetList normally so it's already in the queue by the time the Asset Manager passes its own asset list to it.
The default sprite files are part of apps/static and so are always available outside of the asset directory at http://static
In GitLab by @daveseah on Jul 13, 2022, 20:23
Merges dev-sri/360-null-sprite-default -> next-gui-dirty
Addresses #360:
The renderer system had an old check in it for "undefined skin properties" which threw an error. There are now a range of ways to handle the case when a simulation object (e.g. an agent) does not have its
skin
property set.The specific behavior is set in
modules/flags
, which seems to store visual flags that Ben assigned for use withclass-visual
.TECHNICAL DETAILS
class-visual setTexture(name)
now checks whethername
is undefined. If it is, it sets it toDEFAULT_SPRITE
. IfDEFAULT_SPRITE
happens to be empty string, the method just returns without doing anything.ursys/util/manifest.js
starts at 100. A collision is possible if an asset directory is using a hand-created manifest.as-load-sprites
resource module constructor. It just callsqueueAssetList
normally so it's already in the queue by the time the Asset Manager passes its own asset list to it.apps/static
and so are always available outside of the asset directory athttp://static