Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 3 additions & 3 deletions src/animation/AnimationClip.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import { VectorKeyframeTrack } from './tracks/VectorKeyframeTrack.js';
import { MathUtils } from '../math/MathUtils.js';
import { NormalAnimationBlendMode } from '../constants.js';

function AnimationClip( name, duration, tracks, blendMode ) {
function AnimationClip( name, duration = - 1, tracks, blendMode = NormalAnimationBlendMode ) {

this.name = name;
this.tracks = tracks;
this.duration = ( duration !== undefined ) ? duration : - 1;
this.blendMode = ( blendMode !== undefined ) ? blendMode : NormalAnimationBlendMode;
this.duration = duration;
this.blendMode = blendMode;

this.uuid = MathUtils.generateUUID();

Expand Down
14 changes: 7 additions & 7 deletions src/cameras/OrthographicCamera.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Camera } from './Camera.js';
import { Object3D } from '../core/Object3D.js';

function OrthographicCamera( left, right, top, bottom, near, far ) {
function OrthographicCamera( left = - 1, right = 1, top = 1, bottom = - 1, near = 0.1, far = 2000 ) {

Camera.call( this );

Expand All @@ -10,13 +10,13 @@ function OrthographicCamera( left, right, top, bottom, near, far ) {
this.zoom = 1;
this.view = null;

this.left = ( left !== undefined ) ? left : - 1;
this.right = ( right !== undefined ) ? right : 1;
this.top = ( top !== undefined ) ? top : 1;
this.bottom = ( bottom !== undefined ) ? bottom : - 1;
this.left = left;
this.right = right;
this.top = top;
this.bottom = bottom;

this.near = ( near !== undefined ) ? near : 0.1;
this.far = ( far !== undefined ) ? far : 2000;
this.near = near;
this.far = far;

this.updateProjectionMatrix();

Expand Down
6 changes: 3 additions & 3 deletions src/objects/Line.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const _inverseMatrix = new Matrix4();
const _ray = new Ray();
const _sphere = new Sphere();

function Line( geometry, material, mode ) {
function Line( geometry = new BufferGeometry(), material = new LineBasicMaterial(), mode ) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's okay to finally remove the mode parameter.

@mrdoob What do you think? Otherwise the signature looks a bit strange again.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. I'll remove it.


if ( mode === 1 ) {

Expand All @@ -25,8 +25,8 @@ function Line( geometry, material, mode ) {

this.type = 'Line';

this.geometry = geometry !== undefined ? geometry : new BufferGeometry();
this.material = material !== undefined ? material : new LineBasicMaterial();
this.geometry = geometry;
this.material = material;

this.updateMorphTargets();

Expand Down
6 changes: 3 additions & 3 deletions src/objects/Mesh.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ const _uvC = new Vector2();
const _intersectionPoint = new Vector3();
const _intersectionPointWorld = new Vector3();

function Mesh( geometry, material ) {
function Mesh( geometry = new BufferGeometry(), material = new MeshBasicMaterial() ) {

Object3D.call( this );

this.type = 'Mesh';

this.geometry = geometry !== undefined ? geometry : new BufferGeometry();
this.material = material !== undefined ? material : new MeshBasicMaterial();
this.geometry = geometry;
this.material = material;

this.updateMorphTargets();

Expand Down
6 changes: 3 additions & 3 deletions src/objects/Points.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ const _ray = new Ray();
const _sphere = new Sphere();
const _position = new Vector3();

function Points( geometry, material ) {
function Points( geometry = new BufferGeometry(), material = new PointsMaterial() ) {

Object3D.call( this );

this.type = 'Points';

this.geometry = geometry !== undefined ? geometry : new BufferGeometry();
this.material = material !== undefined ? material : new PointsMaterial();
this.geometry = geometry;
this.material = material;

this.updateMorphTargets();

Expand Down