Skip to content

Commit

Permalink
Fix some param check bug
Browse files Browse the repository at this point in the history
  • Loading branch information
06wj committed Jun 7, 2017
1 parent e83d43a commit 4408740
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/core/BufferGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Object.assign( BufferGeometry.prototype, EventDispatcher.prototype, {

addAttribute: function ( name, attribute ) {

if ( ( attribute && attribute.isBufferAttribute ) === false && ( attribute && attribute.isInterleavedBufferAttribute ) === false ) {
if ( ! ( attribute && attribute.isBufferAttribute ) && ! ( attribute && attribute.isInterleavedBufferAttribute ) ) {

console.warn( 'THREE.BufferGeometry: .addAttribute() now expects ( name, attribute ).' );

Expand Down Expand Up @@ -777,7 +777,7 @@ Object.assign( BufferGeometry.prototype, EventDispatcher.prototype, {

merge: function ( geometry, offset ) {

if ( ( geometry && geometry.isBufferGeometry ) === false ) {
if ( ! ( geometry && geometry.isBufferGeometry ) ) {

console.error( 'THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.', geometry );
return;
Expand Down
2 changes: 1 addition & 1 deletion src/math/Matrix4.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ Object.assign( Matrix4.prototype, {

makeRotationFromEuler: function ( euler ) {

if ( ( euler && euler.isEuler ) === false ) {
if ( ! ( euler && euler.isEuler ) ) {

console.error( 'THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.' );

Expand Down
2 changes: 1 addition & 1 deletion src/math/Quaternion.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ Object.assign( Quaternion.prototype, {

setFromEuler: function ( euler, update ) {

if ( ( euler && euler.isEuler ) === false ) {
if ( ! ( euler && euler.isEuler ) ) {

throw new Error( 'THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.' );

Expand Down
2 changes: 1 addition & 1 deletion src/math/Vector3.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ Object.assign( Vector3.prototype, {

return function applyEuler( euler ) {

if ( ( euler && euler.isEuler ) === false ) {
if ( ! ( euler && euler.isEuler ) ) {

console.error( 'THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order.' );

Expand Down
3 changes: 2 additions & 1 deletion src/renderers/WebGLRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1082,6 +1082,7 @@ function WebGLRenderer( parameters ) {
// Rendering

this.render = function ( scene, camera, renderTarget, forceClear ) {

if ( ! ( camera && camera.isCamera ) ) {

console.error( 'THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.' );
Expand Down Expand Up @@ -2689,7 +2690,7 @@ function WebGLRenderer( parameters ) {

this.readRenderTargetPixels = function ( renderTarget, x, y, width, height, buffer ) {

if ( ( renderTarget && renderTarget.isWebGLRenderTarget ) === false ) {
if ( ! ( renderTarget && renderTarget.isWebGLRenderTarget ) ) {

console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.' );
return;
Expand Down

0 comments on commit 4408740

Please sign in to comment.