Skip to content

Commit

Permalink
Helpers: Set some default arguments.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Aug 25, 2020
1 parent 013f047 commit d798868
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 10 deletions.
4 changes: 1 addition & 3 deletions src/helpers/AxesHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ import { BufferGeometry } from '../core/BufferGeometry.js';

class AxesHelper extends LineSegments {

constructor( size ) {

size = size || 1;
constructor( size = 1 ) {

const vertices = [
0, 0, 0, size, 0, 0,
Expand Down
4 changes: 1 addition & 3 deletions src/helpers/Box3Helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ import { BufferGeometry } from '../core/BufferGeometry.js';

class Box3Helper extends LineSegments {

constructor( box, color ) {

if ( color === undefined ) color = 0xffff00;
constructor( box, color = 0xffff00 ) {

const indices = new Uint16Array( [ 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7 ] );

Expand Down
4 changes: 1 addition & 3 deletions src/helpers/BoxHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ const _box = new Box3();

class BoxHelper extends LineSegments {

constructor( object, color ) {

if ( color === undefined ) color = 0xffff00;
constructor( object, color = 0xffff00 ) {

const indices = new Uint16Array( [ 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7 ] );
const positions = new Float32Array( 8 * 3 );
Expand Down
1 change: 0 additions & 1 deletion src/helpers/PlaneHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class PlaneHelper extends Line {

constructor( plane, size, hex ) {


const color = ( hex !== undefined ) ? hex : 0xffff00;

const positions = [ 1, - 1, 1, - 1, 1, 1, - 1, - 1, 1, 1, 1, 1, - 1, 1, 1, - 1, - 1, 1, 1, - 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0 ];
Expand Down

0 comments on commit d798868

Please sign in to comment.