Dimension3¶
Overview¶
Dimension3 is a basic width, height, and depth, like a Bounds3 but without the position defined.
@author Jonathan Olson <jonathan.olson@colorado.edu> @author Chris Malley (PixelZoom, Inc.)
Class Dimension3¶
Constructor¶
new Dimension3( width : number, height : number, depth : number )¶
Instance Methods¶
toString() : string¶
Debugging string for the dimension.
set( dimension : Dimension3 ) : Dimension3¶
Sets this dimension to be a copy of another dimension. This is the mutable form of the function copy(). This will mutate (change) this dimension, in addition to returning this dimension itself.
setWidth( width : number ) : Dimension3¶
Sets the width of the dimension, returning this.
setHeight( height : number ) : Dimension3¶
Sets the height of the dimension, returning this.
setDepth( depth : number ) : Dimension3¶
Sets the depth of the dimension, returning this.
copy( dimension? : Dimension3 ) : Dimension3¶
Creates a copy of this dimension, or if a dimension is passed in, set that dimension's values to ours. This is the immutable form of the function set(), if a dimension is provided. This will return a new dimension, and will not modify this dimension.
@param [dimension] - If not provided, creates a new Dimension3 with filled in values. Otherwise, fills in the values of the provided dimension so that it equals this dimension.
toBounds( x? : number, y? : number, z? : number ) : Bounds3¶
Creates a Bounds2 from this dimension based on passing in the minimum (top-left) corner as (x,y). @param [x] - Minimum x coordinate of the bounds, or 0 if not provided. @param [y] - Minimum y coordinate of the bounds, or 0 if not provided. @param [z] - Minimum z coordinate of the bounds, or 0 if not provided.
equals( that : Dimension3 ) : boolean¶
Exact equality comparison between this dimension and another dimension.
toStateObject() : Dimension3StateObject¶
Instance Properties¶
width : number¶
height : number¶
depth : number¶
Static Methods¶
fromStateObject( stateObject : Dimension3StateObject ) : Dimension3¶
Static Properties¶
Dimension3IO : IOType¶
Type Dimension3StateObject¶
StateObject<typeof STATE_SCHEMA>
Source Code¶
See the source for Dimension3.ts in the dot repository.