Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion examples/jsm/renderers/CSS2DRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ class CSS2DObject extends Object3D {
* @default true
*/
this.isCSS2DObject = true;
/**
* If set to `true` (default), the renderer will automatically assign `z-index` css properties
* according to the object's renderOrder and distance to the camera. If set to `false`, the `z-index`
* of the object's element will not be changed by the renderer and can be controlled manually.
*
* @type {boolean}
* @default true
*/
this.autoSortZ = true;

/**
* The DOM element which defines the appearance of this 3D object.
Expand Down Expand Up @@ -268,7 +277,7 @@ class CSS2DRenderer {

scene.traverseVisible( function ( object ) {

if ( object.isCSS2DObject ) result.push( object );
if ( object.isCSS2DObject && object.autoSortZ ) result.push( object );

} );

Expand Down
Loading