private final boolean prepareForInstancing(final Spatial spatial) { boolean skipRenderQueue = false; if (spatial instanceof Mesh) { final Mesh mesh = (Mesh) spatial; final InstancingManager instancing = mesh.getMeshData().getInstancingManager(); // Only one instance needs to be added to the render queue if (instancing != null) { skipRenderQueue = instancing.isAddedToRenderQueue(); instancing.registerMesh(mesh); } } return skipRenderQueue; }
private final boolean prepareForInstancing(final Spatial spatial) { boolean skipRenderQueue = false; if (spatial instanceof Mesh) { final Mesh mesh = (Mesh) spatial; final InstancingManager instancing = mesh.getMeshData().getInstancingManager(); // Only one instance needs to be added to the render queue if (instancing != null) { skipRenderQueue = instancing.isAddedToRenderQueue(); instancing.registerMesh(mesh); } } return skipRenderQueue; }
@Override public Mesh makeInstanced() { final Mesh mesh = (Mesh) super.makeInstanced(); if (_meshData.getInstancingManager() == null) { _meshData.setInstancingManager(new InstancingManager()); } mesh.setMeshData(_meshData); mesh.setModelBound(_modelBound != null ? _modelBound.clone(null) : null); mesh._defaultColor = _defaultColor; mesh.setVisible(_isVisible); return mesh; }
@Override public Mesh makeInstanced() { final Mesh mesh = (Mesh) super.makeInstanced(); if (_meshData.getInstancingManager() == null) { _meshData.setInstancingManager(new InstancingManager()); } mesh.setMeshData(_meshData); mesh.setModelBound(_modelBound != null ? _modelBound.clone(null) : null); mesh.setVisible(_isVisible); return mesh; }
final InstancingManager instancing = glsl != null ? meshData.getInstancingManager() : null;