* Revert to this.is* = true * Put back local variables * Update tests * Add missing this.is* property * Update Color.js Co-authored-by: Michael Herzog <[email protected]>
@@ -34,6 +34,8 @@ class AnimationObjectGroup {
constructor() {
+ this.isAnimationObjectGroup = true;
+
this.uuid = MathUtils.generateUUID();
// cached objects followed by the active ones
@@ -382,6 +384,4 @@ class AnimationObjectGroup {
}
-AnimationObjectGroup.prototype.isAnimationObjectGroup = true;
-
export { AnimationObjectGroup };
@@ -6,13 +6,12 @@ class ArrayCamera extends PerspectiveCamera {
super();
+ this.isArrayCamera = true;
this.cameras = array;
-ArrayCamera.prototype.isArrayCamera = true;
export { ArrayCamera };
@@ -7,6 +7,8 @@ class Camera extends Object3D {
+ this.isCamera = true;
this.type = 'Camera';
this.matrixWorldInverse = new Matrix4();
@@ -63,6 +65,4 @@ class Camera extends Object3D {
-Camera.prototype.isCamera = true;
export { Camera };
@@ -6,6 +6,8 @@ class OrthographicCamera extends Camera {
+ this.isOrthographicCamera = true;
this.type = 'OrthographicCamera';
this.zoom = 1;
@@ -131,6 +133,4 @@ class OrthographicCamera extends Camera {
-OrthographicCamera.prototype.isOrthographicCamera = true;
export { OrthographicCamera };
@@ -7,6 +7,8 @@ class PerspectiveCamera extends Camera {
+ this.isPerspectiveCamera = true;
this.type = 'PerspectiveCamera';
this.fov = fov;
@@ -228,6 +230,4 @@ class PerspectiveCamera extends Camera {
-PerspectiveCamera.prototype.isPerspectiveCamera = true;
export { PerspectiveCamera };
@@ -17,6 +17,8 @@ class BufferAttribute {
+ this.isBufferAttribute = true;
this.name = '';
this.array = array;
@@ -399,8 +401,6 @@ class BufferAttribute {
-BufferAttribute.prototype.isBufferAttribute = true;
//
class Int8BufferAttribute extends BufferAttribute {
@@ -479,11 +479,12 @@ class Float16BufferAttribute extends BufferAttribute {
super( new Uint16Array( array ), itemSize, normalized );
+ this.isFloat16BufferAttribute = true;
-Float16BufferAttribute.prototype.isFloat16BufferAttribute = true;
class Float32BufferAttribute extends BufferAttribute {
@@ -25,6 +25,8 @@ class BufferGeometry extends EventDispatcher {
+ this.isBufferGeometry = true;
Object.defineProperty( this, 'id', { value: _id ++ } );
@@ -1125,6 +1127,4 @@ class BufferGeometry extends EventDispatcher {
-BufferGeometry.prototype.isBufferGeometry = true;
export { BufferGeometry };
@@ -2,6 +2,8 @@ class GLBufferAttribute {
constructor( buffer, type, itemSize, elementSize, count ) {
+ this.isGLBufferAttribute = true;
this.buffer = buffer;
this.type = type;
this.itemSize = itemSize;
@@ -53,6 +55,4 @@ class GLBufferAttribute {
-GLBufferAttribute.prototype.isGLBufferAttribute = true;
export { GLBufferAttribute };
@@ -16,6 +16,8 @@ class InstancedBufferAttribute extends BufferAttribute {
super( array, itemSize, normalized );
+ this.isInstancedBufferAttribute = true;
this.meshPerAttribute = meshPerAttribute;
@@ -44,6 +46,4 @@ class InstancedBufferAttribute extends BufferAttribute {
-InstancedBufferAttribute.prototype.isInstancedBufferAttribute = true;
export { InstancedBufferAttribute };
@@ -6,6 +6,8 @@ class InstancedBufferGeometry extends BufferGeometry {
+ this.isInstancedBufferGeometry = true;
this.type = 'InstancedBufferGeometry';
this.instanceCount = Infinity;
@@ -41,6 +43,4 @@ class InstancedBufferGeometry extends BufferGeometry {
-InstancedBufferGeometry.prototype.isInstancedBufferGeometry = true;
export { InstancedBufferGeometry };
@@ -6,6 +6,8 @@ class InstancedInterleavedBuffer extends InterleavedBuffer {
super( array, stride );
+ this.isInstancedInterleavedBuffer = true;
@@ -43,6 +45,4 @@ class InstancedInterleavedBuffer extends InterleavedBuffer {
-InstancedInterleavedBuffer.prototype.isInstancedInterleavedBuffer = true;
export { InstancedInterleavedBuffer };
@@ -5,6 +5,8 @@ class InterleavedBuffer {
constructor( array, stride ) {
+ this.isInterleavedBuffer = true;
this.stride = stride;
this.count = array !== undefined ? array.length / stride : 0;
@@ -140,6 +142,4 @@ class InterleavedBuffer {
-InterleavedBuffer.prototype.isInterleavedBuffer = true;
export { InterleavedBuffer };
@@ -7,6 +7,8 @@ class InterleavedBufferAttribute {
constructor( interleavedBuffer, itemSize, offset, normalized = false ) {
+ this.isInterleavedBufferAttribute = true;
this.data = interleavedBuffer;
@@ -276,7 +278,5 @@ class InterleavedBufferAttribute {
-InterleavedBufferAttribute.prototype.isInterleavedBufferAttribute = true;
export { InterleavedBufferAttribute };
@@ -31,6 +31,8 @@ class Object3D extends EventDispatcher {
+ this.isObject3D = true;
Object.defineProperty( this, 'id', { value: _object3DId ++ } );
@@ -922,6 +924,4 @@ class Object3D extends EventDispatcher {
Object3D.DefaultUp = new Vector3( 0, 1, 0 );
Object3D.DefaultMatrixAutoUpdate = true;
-Object3D.prototype.isObject3D = true;
export { Object3D };
@@ -6,12 +6,12 @@ class ArcCurve extends EllipseCurve {
super( aX, aY, aRadius, aRadius, aStartAngle, aEndAngle, aClockwise );
+ this.isArcCurve = true;
this.type = 'ArcCurve';
-ArcCurve.prototype.isArcCurve = true;
export { ArcCurve };
@@ -87,6 +87,8 @@ class CatmullRomCurve3 extends Curve {
+ this.isCatmullRomCurve3 = true;
this.type = 'CatmullRomCurve3';
this.points = points;
@@ -248,6 +250,4 @@ class CatmullRomCurve3 extends Curve {
-CatmullRomCurve3.prototype.isCatmullRomCurve3 = true;
export { CatmullRomCurve3 };
@@ -8,6 +8,8 @@ class CubicBezierCurve extends Curve {
+ this.isCubicBezierCurve = true;
this.type = 'CubicBezierCurve';
this.v0 = v0;
@@ -73,6 +75,4 @@ class CubicBezierCurve extends Curve {
-CubicBezierCurve.prototype.isCubicBezierCurve = true;
export { CubicBezierCurve };
@@ -8,6 +8,8 @@ class CubicBezierCurve3 extends Curve {
+ this.isCubicBezierCurve3 = true;
this.type = 'CubicBezierCurve3';
@@ -74,6 +76,4 @@ class CubicBezierCurve3 extends Curve {
-CubicBezierCurve3.prototype.isCubicBezierCurve3 = true;
export { CubicBezierCurve3 };
@@ -7,6 +7,8 @@ class EllipseCurve extends Curve {
+ this.isEllipseCurve = true;
this.type = 'EllipseCurve';
this.aX = aX;
@@ -151,6 +153,4 @@ class EllipseCurve extends Curve {
-EllipseCurve.prototype.isEllipseCurve = true;
export { EllipseCurve };
@@ -7,6 +7,8 @@ class LineCurve extends Curve {
+ this.isLineCurve = true;
this.type = 'LineCurve';
this.v1 = v1;
@@ -85,6 +87,4 @@ class LineCurve extends Curve {
-LineCurve.prototype.isLineCurve = true;
export { LineCurve };
@@ -7,9 +7,10 @@ class LineCurve3 extends Curve {
- this.type = 'LineCurve3';
this.isLineCurve3 = true;
+ this.type = 'LineCurve3';
this.v2 = v2;
@@ -8,6 +8,8 @@ class QuadraticBezierCurve extends Curve {
+ this.isQuadraticBezierCurve = true;
this.type = 'QuadraticBezierCurve';
@@ -69,6 +71,4 @@ class QuadraticBezierCurve extends Curve {
-QuadraticBezierCurve.prototype.isQuadraticBezierCurve = true;
export { QuadraticBezierCurve };
@@ -8,6 +8,8 @@ class QuadraticBezierCurve3 extends Curve {
+ this.isQuadraticBezierCurve3 = true;
this.type = 'QuadraticBezierCurve3';
@@ -70,6 +72,4 @@ class QuadraticBezierCurve3 extends Curve {
-QuadraticBezierCurve3.prototype.isQuadraticBezierCurve3 = true;
export { QuadraticBezierCurve3 };
@@ -8,6 +8,8 @@ class SplineCurve extends Curve {
+ this.isSplineCurve = true;
this.type = 'SplineCurve';
@@ -92,6 +94,4 @@ class SplineCurve extends Curve {
-SplineCurve.prototype.isSplineCurve = true;
export { SplineCurve };
@@ -47,9 +47,10 @@ class SkeletonHelper extends LineSegments {
super( geometry, material );
- this.type = 'SkeletonHelper';
this.isSkeletonHelper = true;
+ this.type = 'SkeletonHelper';
this.root = object;
this.bones = bones;
@@ -6,12 +6,12 @@ class AmbientLight extends Light {
super( color, intensity );
+ this.isAmbientLight = true;
this.type = 'AmbientLight';
-AmbientLight.prototype.isAmbientLight = true;
export { AmbientLight };
@@ -7,6 +7,8 @@ class AmbientLightProbe extends LightProbe {
super( undefined, intensity );
+ this.isAmbientLightProbe = true;
const color1 = new Color().set( color );
// without extra factor of PI in the shader, would be 2 / Math.sqrt( Math.PI );
@@ -16,6 +18,4 @@ class AmbientLightProbe extends LightProbe {
-AmbientLightProbe.prototype.isAmbientLightProbe = true;
export { AmbientLightProbe };
@@ -8,6 +8,8 @@ class DirectionalLight extends Light {
+ this.isDirectionalLight = true;
this.type = 'DirectionalLight';
this.position.copy( Object3D.DefaultUp );
@@ -38,6 +40,4 @@ class DirectionalLight extends Light {
-DirectionalLight.prototype.isDirectionalLight = true;
export { DirectionalLight };
@@ -7,10 +7,10 @@ class DirectionalLightShadow extends LightShadow {
super( new OrthographicCamera( - 5, 5, 5, - 5, 0.5, 500 ) );
+ this.isDirectionalLightShadow = true;
-DirectionalLightShadow.prototype.isDirectionalLightShadow = true;
export { DirectionalLightShadow };
@@ -8,6 +8,8 @@ class HemisphereLight extends Light {
super( skyColor, intensity );
+ this.isHemisphereLight = true;
this.type = 'HemisphereLight';
@@ -29,6 +31,4 @@ class HemisphereLight extends Light {
-HemisphereLight.prototype.isHemisphereLight = true;
export { HemisphereLight };
@@ -8,6 +8,8 @@ class HemisphereLightProbe extends LightProbe {
+ this.isHemisphereLightProbe = true;
const color1 = new Color().set( skyColor );
const color2 = new Color().set( groundColor );
@@ -25,6 +27,4 @@ class HemisphereLightProbe extends LightProbe {
-HemisphereLightProbe.prototype.isHemisphereLightProbe = true;
export { HemisphereLightProbe };
@@ -7,6 +7,8 @@ class Light extends Object3D {
+ this.isLight = true;
this.type = 'Light';
this.color = new Color( color );
@@ -53,6 +55,4 @@ class Light extends Object3D {
-Light.prototype.isLight = true;
export { Light };
@@ -7,6 +7,8 @@ class LightProbe extends Light {
+ this.isLightProbe = true;
this.sh = sh;
@@ -42,6 +44,4 @@ class LightProbe extends Light {
-LightProbe.prototype.isLightProbe = true;
export { LightProbe };
@@ -7,6 +7,8 @@ class PointLight extends Light {
+ this.isPointLight = true;
this.type = 'PointLight';
this.distance = distance;
@@ -52,6 +54,4 @@ class PointLight extends Light {
-PointLight.prototype.isPointLight = true;
export { PointLight };
@@ -15,6 +15,8 @@ class PointLightShadow extends LightShadow {
super( new PerspectiveCamera( 90, 1, 0.5, 500 ) );
+ this.isPointLightShadow = true;
this._frameExtents = new Vector2( 4, 2 );
this._viewportCount = 6;
@@ -91,6 +93,4 @@ class PointLightShadow extends LightShadow {
-PointLightShadow.prototype.isPointLightShadow = true;
export { PointLightShadow };
@@ -6,6 +6,8 @@ class RectAreaLight extends Light {
+ this.isRectAreaLight = true;
this.type = 'RectAreaLight';
this.width = width;
@@ -51,6 +53,4 @@ class RectAreaLight extends Light {
-RectAreaLight.prototype.isRectAreaLight = true;
export { RectAreaLight };
@@ -8,6 +8,8 @@ class SpotLight extends Light {
+ this.isSpotLight = true;
this.type = 'SpotLight';
@@ -64,6 +66,4 @@ class SpotLight extends Light {
-SpotLight.prototype.isSpotLight = true;
export { SpotLight };
@@ -8,6 +8,8 @@ class SpotLightShadow extends LightShadow {
super( new PerspectiveCamera( 50, 1, 0.5, 500 ) );
+ this.isSpotLightShadow = true;
this.focus = 1;
@@ -45,6 +47,4 @@ class SpotLightShadow extends LightShadow {
-SpotLightShadow.prototype.isSpotLightShadow = true;
export { SpotLightShadow };
@@ -7,6 +7,8 @@ class ImageBitmapLoader extends Loader {
super( manager );
+ this.isImageBitmapLoader = true;
if ( typeof createImageBitmap === 'undefined' ) {
console.warn( 'THREE.ImageBitmapLoader: createImageBitmap() not supported.' );
@@ -94,6 +96,4 @@ class ImageBitmapLoader extends Loader {
-ImageBitmapLoader.prototype.isImageBitmapLoader = true;
export { ImageBitmapLoader };
@@ -7,6 +7,8 @@ class LineBasicMaterial extends Material {
+ this.isLineBasicMaterial = true;
this.type = 'LineBasicMaterial';
this.color = new Color( 0xffffff );
@@ -40,6 +42,4 @@ class LineBasicMaterial extends Material {
-LineBasicMaterial.prototype.isLineBasicMaterial = true;
export { LineBasicMaterial };
@@ -6,6 +6,8 @@ class LineDashedMaterial extends LineBasicMaterial {
+ this.isLineDashedMaterial = true;
this.type = 'LineDashedMaterial';
this.scale = 1;
@@ -30,6 +32,4 @@ class LineDashedMaterial extends LineBasicMaterial {
-LineDashedMaterial.prototype.isLineDashedMaterial = true;
export { LineDashedMaterial };
@@ -10,6 +10,8 @@ class Material extends EventDispatcher {
+ this.isMaterial = true;
Object.defineProperty( this, 'id', { value: materialId ++ } );
@@ -496,8 +498,6 @@ class Material extends EventDispatcher {
-Material.prototype.isMaterial = true;
Material.fromType = function ( /*type*/ ) {
// TODO: Behavior added in Materials.js
@@ -8,6 +8,8 @@ class MeshBasicMaterial extends Material {
+ this.isMeshBasicMaterial = true;
this.type = 'MeshBasicMaterial';
this.color = new Color( 0xffffff ); // emissive
@@ -76,6 +78,4 @@ class MeshBasicMaterial extends Material {
-MeshBasicMaterial.prototype.isMeshBasicMaterial = true;
export { MeshBasicMaterial };
@@ -7,6 +7,8 @@ class MeshDepthMaterial extends Material {
+ this.isMeshDepthMaterial = true;
this.type = 'MeshDepthMaterial';
this.depthPacking = BasicDepthPacking;
@@ -49,6 +51,4 @@ class MeshDepthMaterial extends Material {
-MeshDepthMaterial.prototype.isMeshDepthMaterial = true;
export { MeshDepthMaterial };
@@ -7,6 +7,8 @@ class MeshDistanceMaterial extends Material {
+ this.isMeshDistanceMaterial = true;
this.type = 'MeshDistanceMaterial';
this.referencePosition = new Vector3();
@@ -47,6 +49,4 @@ class MeshDistanceMaterial extends Material {
-MeshDistanceMaterial.prototype.isMeshDistanceMaterial = true;
export { MeshDistanceMaterial };
@@ -8,6 +8,8 @@ class MeshLambertMaterial extends Material {
+ this.isMeshLambertMaterial = true;
this.type = 'MeshLambertMaterial';
this.color = new Color( 0xffffff ); // diffuse
@@ -84,6 +86,4 @@ class MeshLambertMaterial extends Material {
-MeshLambertMaterial.prototype.isMeshLambertMaterial = true;
export { MeshLambertMaterial };
@@ -9,6 +9,8 @@ class MeshMatcapMaterial extends Material {
+ this.isMeshMatcapMaterial = true;
this.defines = { 'MATCAP': '' };
this.type = 'MeshMatcapMaterial';
@@ -76,6 +78,4 @@ class MeshMatcapMaterial extends Material {
-MeshMatcapMaterial.prototype.isMeshMatcapMaterial = true;
export { MeshMatcapMaterial };
@@ -8,6 +8,8 @@ class MeshNormalMaterial extends Material {
+ this.isMeshNormalMaterial = true;
this.type = 'MeshNormalMaterial';
this.bumpMap = null;
@@ -56,6 +58,4 @@ class MeshNormalMaterial extends Material {
-MeshNormalMaterial.prototype.isMeshNormalMaterial = true;
export { MeshNormalMaterial };
@@ -9,6 +9,8 @@ class MeshPhongMaterial extends Material {
+ this.isMeshPhongMaterial = true;
this.type = 'MeshPhongMaterial';
@@ -115,6 +117,4 @@ class MeshPhongMaterial extends Material {
-MeshPhongMaterial.prototype.isMeshPhongMaterial = true;
export { MeshPhongMaterial };
@@ -9,6 +9,8 @@ class MeshPhysicalMaterial extends MeshStandardMaterial {
+ this.isMeshPhysicalMaterial = true;
this.defines = {
'STANDARD': '',
@@ -163,6 +165,4 @@ class MeshPhysicalMaterial extends MeshStandardMaterial {
-MeshPhysicalMaterial.prototype.isMeshPhysicalMaterial = true;
export { MeshPhysicalMaterial };
@@ -9,6 +9,8 @@ class MeshStandardMaterial extends Material {
+ this.isMeshStandardMaterial = true;
this.defines = { 'STANDARD': '' };
this.type = 'MeshStandardMaterial';
@@ -119,6 +121,4 @@ class MeshStandardMaterial extends Material {
-MeshStandardMaterial.prototype.isMeshStandardMaterial = true;
export { MeshStandardMaterial };
@@ -9,6 +9,8 @@ class MeshToonMaterial extends Material {
+ this.isMeshToonMaterial = true;
this.defines = { 'TOON': '' };
this.type = 'MeshToonMaterial';
@@ -97,6 +99,4 @@ class MeshToonMaterial extends Material {
-MeshToonMaterial.prototype.isMeshToonMaterial = true;
export { MeshToonMaterial };
@@ -7,6 +7,8 @@ class PointsMaterial extends Material {
+ this.isPointsMaterial = true;
this.type = 'PointsMaterial';
@@ -45,6 +47,4 @@ class PointsMaterial extends Material {
-PointsMaterial.prototype.isPointsMaterial = true;
export { PointsMaterial };
@@ -6,12 +6,12 @@ class RawShaderMaterial extends ShaderMaterial {
super( parameters );
+ this.isRawShaderMaterial = true;
this.type = 'RawShaderMaterial';
-RawShaderMaterial.prototype.isRawShaderMaterial = true;
export { RawShaderMaterial };
@@ -10,6 +10,8 @@ class ShaderMaterial extends Material {
+ this.isShaderMaterial = true;
this.type = 'ShaderMaterial';
this.defines = {};
@@ -181,6 +183,4 @@ class ShaderMaterial extends Material {
-ShaderMaterial.prototype.isShaderMaterial = true;
export { ShaderMaterial };
@@ -7,6 +7,8 @@ class ShadowMaterial extends Material {
+ this.isShadowMaterial = true;
this.type = 'ShadowMaterial';
this.color = new Color( 0x000000 );
@@ -32,6 +34,4 @@ class ShadowMaterial extends Material {
-ShadowMaterial.prototype.isShadowMaterial = true;
export { ShadowMaterial };
@@ -7,6 +7,8 @@ class SpriteMaterial extends Material {
+ this.isSpriteMaterial = true;
this.type = 'SpriteMaterial';
@@ -49,6 +51,4 @@ class SpriteMaterial extends Material {
-SpriteMaterial.prototype.isSpriteMaterial = true;
export { SpriteMaterial };
@@ -6,6 +6,8 @@ class Box2 {
constructor( min = new Vector2( + Infinity, + Infinity ), max = new Vector2( - Infinity, - Infinity ) ) {
+ this.isBox2 = true;
this.min = min;
this.max = max;
@@ -198,6 +200,4 @@ class Box2 {
-Box2.prototype.isBox2 = true;
export { Box2 };
@@ -4,6 +4,8 @@ class Box3 {
constructor( min = new Vector3( + Infinity, + Infinity, + Infinity ), max = new Vector3( - Infinity, - Infinity, - Infinity ) ) {
+ this.isBox3 = true;
@@ -469,8 +471,6 @@ class Box3 {
-Box3.prototype.isBox3 = true;
const _points = [
/*@__PURE__*/ new Vector3(),
@@ -56,6 +56,8 @@ class Color {
constructor( r, g, b ) {
+ this.isColor = true;
this.r = 1;
this.g = 1;
this.b = 1;
@@ -610,6 +612,4 @@ class Color {
Color.NAMES = _colorKeywords;
-Color.prototype.isColor = true;
export { Color, SRGBToLinear };
@@ -9,6 +9,8 @@ class Euler {
constructor( x = 0, y = 0, z = 0, order = Euler.DefaultOrder ) {
+ this.isEuler = true;
this._x = x;
this._y = y;
this._z = z;
@@ -316,8 +318,6 @@ class Euler {
-Euler.prototype.isEuler = true;
Euler.DefaultOrder = 'XYZ';
Euler.RotationOrders = [ 'XYZ', 'YZX', 'ZXY', 'XZY', 'YXZ', 'ZYX' ];
@@ -2,6 +2,8 @@ class Matrix3 {
+ this.isMatrix3 = true;
this.elements = [
1, 0, 0,
@@ -334,6 +336,4 @@ class Matrix3 {
-Matrix3.prototype.isMatrix3 = true;
export { Matrix3 };
@@ -1,9 +1,10 @@
import { Vector3 } from './Vector3.js';
class Matrix4 {
+ this.isMatrix4 = true;
1, 0, 0, 0,
@@ -872,8 +873,6 @@ class Matrix4 {
-Matrix4.prototype.isMatrix4 = true;
const _v1 = /*@__PURE__*/ new Vector3();
const _m1 = /*@__PURE__*/ new Matrix4();
const _zero = /*@__PURE__*/ new Vector3( 0, 0, 0 );
@@ -9,6 +9,8 @@ class Plane {
constructor( normal = new Vector3( 1, 0, 0 ), constant = 0 ) {
+ this.isPlane = true;
// normal is assumed to be normalized
this.normal = normal;
@@ -200,6 +202,4 @@ class Plane {
-Plane.prototype.isPlane = true;
export { Plane };
@@ -4,6 +4,8 @@ class Quaternion {
constructor( x = 0, y = 0, z = 0, w = 1 ) {
+ this.isQuaternion = true;
@@ -693,6 +695,4 @@ class Quaternion {
-Quaternion.prototype.isQuaternion = true;
export { Quaternion };
@@ -14,6 +14,8 @@ class SphericalHarmonics3 {
+ this.isSphericalHarmonics3 = true;
this.coefficients = [];
for ( let i = 0; i < 9; i ++ ) {
@@ -238,6 +240,4 @@ class SphericalHarmonics3 {
-SphericalHarmonics3.prototype.isSphericalHarmonics3 = true;
export { SphericalHarmonics3 };
@@ -2,6 +2,8 @@ class Vector2 {
constructor( x = 0, y = 0 ) {
+ this.isVector2 = true;
this.x = x;
this.y = y;
@@ -479,6 +481,4 @@ class Vector2 {
-Vector2.prototype.isVector2 = true;
export { Vector2 };
@@ -1,10 +1,11 @@
import * as MathUtils from './MathUtils.js';
import { Quaternion } from './Quaternion.js';
class Vector3 {
constructor( x = 0, y = 0, z = 0 ) {
+ this.isVector3 = true;
this.z = z;
@@ -747,8 +748,6 @@ class Vector3 {
-Vector3.prototype.isVector3 = true;
const _vector = /*@__PURE__*/ new Vector3();
const _quaternion = /*@__PURE__*/ new Quaternion();
@@ -2,6 +2,8 @@ class Vector4 {
+ this.isVector4 = true;
@@ -659,6 +661,4 @@ class Vector4 {
-Vector4.prototype.isVector4 = true;
export { Vector4 };
@@ -6,12 +6,12 @@ class Bone extends Object3D {
+ this.isBone = true;
this.type = 'Bone';
-Bone.prototype.isBone = true;
export { Bone };
@@ -6,12 +6,12 @@ class Group extends Object3D {
+ this.isGroup = true;
this.type = 'Group';
-Group.prototype.isGroup = true;
export { Group };
@@ -15,6 +15,8 @@ class InstancedMesh extends Mesh {
+ this.isInstancedMesh = true;
this.instanceMatrix = new InstancedBufferAttribute( new Float32Array( count * 16 ), 16 );
this.instanceColor = null;
@@ -121,6 +123,4 @@ class InstancedMesh extends Mesh {
-InstancedMesh.prototype.isInstancedMesh = true;
export { InstancedMesh };
@@ -19,6 +19,8 @@ class Line extends Object3D {
+ this.isLine = true;
this.type = 'Line';
this.geometry = geometry;
@@ -247,7 +249,4 @@ class Line extends Object3D {
-Line.prototype.isLine = true;
export { Line };
@@ -6,12 +6,12 @@ class LineLoop extends Line {
+ this.isLineLoop = true;
this.type = 'LineLoop';
-LineLoop.prototype.isLineLoop = true;
export { LineLoop };
@@ -11,6 +11,8 @@ class LineSegments extends Line {
+ this.isLineSegments = true;
this.type = 'LineSegments';
@@ -58,6 +60,4 @@ class LineSegments extends Line {
-LineSegments.prototype.isLineSegments = true;
export { LineSegments };
@@ -38,6 +38,8 @@ class Mesh extends Object3D {
+ this.isMesh = true;
this.type = 'Mesh';
@@ -286,8 +288,6 @@ class Mesh extends Object3D {
-Mesh.prototype.isMesh = true;
function checkIntersection( object, material, raycaster, ray, pA, pB, pC, point ) {
let intersect;
@@ -17,6 +17,8 @@ class Points extends Object3D {
+ this.isPoints = true;
this.type = 'Points';
@@ -153,8 +155,6 @@ class Points extends Object3D {
-Points.prototype.isPoints = true;
function testPoint( point, index, localThresholdSq, matrixWorld, raycaster, intersects, object ) {
const rayPointDistanceSq = _ray.distanceSqToPoint( point );
@@ -17,6 +17,8 @@ class SkinnedMesh extends Mesh {
+ this.isSkinnedMesh = true;
this.type = 'SkinnedMesh';
this.bindMode = 'attached';
@@ -146,6 +148,4 @@ class SkinnedMesh extends Mesh {
-SkinnedMesh.prototype.isSkinnedMesh = true;
export { SkinnedMesh };
@@ -32,6 +32,8 @@ class Sprite extends Object3D {
+ this.isSprite = true;
this.type = 'Sprite';
if ( _geometry === undefined ) {
@@ -149,8 +151,6 @@ class Sprite extends Object3D {
-Sprite.prototype.isSprite = true;
function transformVertex( vertexPosition, mvPosition, center, scale, sin, cos ) {
// compute position in camera space
@@ -7,6 +7,8 @@ class WebGL3DRenderTarget extends WebGLRenderTarget {
super( width, height );
+ this.isWebGL3DRenderTarget = true;
this.depth = depth;
this.texture = new Data3DTexture( null, width, height, depth );
@@ -17,6 +19,4 @@ class WebGL3DRenderTarget extends WebGLRenderTarget {
-WebGL3DRenderTarget.prototype.isWebGL3DRenderTarget = true;
export { WebGL3DRenderTarget };
@@ -7,6 +7,8 @@ class WebGLArrayRenderTarget extends WebGLRenderTarget {
+ this.isWebGLArrayRenderTarget = true;
this.texture = new DataArrayTexture( null, width, height, depth );
@@ -17,6 +19,4 @@ class WebGLArrayRenderTarget extends WebGLRenderTarget {
-WebGLArrayRenderTarget.prototype.isWebGLArrayRenderTarget = true;
export { WebGLArrayRenderTarget };
@@ -13,6 +13,8 @@ class WebGLCubeRenderTarget extends WebGLRenderTarget {
super( size, size, options );
+ this.isWebGLCubeRenderTarget = true;
const image = { width: size, height: size, depth: 1 };
const images = [ image, image, image, image, image, image ];
@@ -141,6 +143,4 @@ class WebGLCubeRenderTarget extends WebGLRenderTarget {
-WebGLCubeRenderTarget.prototype.isWebGLCubeRenderTarget = true;
export { WebGLCubeRenderTarget };
@@ -6,6 +6,8 @@ class WebGLMultipleRenderTargets extends WebGLRenderTarget {
super( width, height, options );
+ this.isWebGLMultipleRenderTargets = true;
const texture = this.texture;
this.texture = [];
@@ -77,6 +79,4 @@ class WebGLMultipleRenderTargets extends WebGLRenderTarget {
-WebGLMultipleRenderTargets.prototype.isWebGLMultipleRenderTargets = true;
export { WebGLMultipleRenderTargets };
@@ -15,6 +15,8 @@ class WebGLRenderTarget extends EventDispatcher {
+ this.isWebGLRenderTarget = true;
this.height = height;
this.depth = 1;
@@ -105,6 +107,4 @@ class WebGLRenderTarget extends EventDispatcher {
-WebGLRenderTarget.prototype.isWebGLRenderTarget = true;
export { WebGLRenderTarget };
@@ -56,6 +56,8 @@ function createCanvasElement() {
function WebGLRenderer( parameters = {} ) {
+ this.isWebGLRenderer = true;
const _canvas = parameters.canvas !== undefined ? parameters.canvas : createCanvasElement(),
_context = parameters.context !== undefined ? parameters.context : null,
@@ -2191,6 +2193,4 @@ function WebGLRenderer( parameters = {} ) {
-WebGLRenderer.prototype.isWebGLRenderer = true;
export { WebGLRenderer };
@@ -4,6 +4,8 @@ class Fog {
constructor( color, near = 1, far = 1000 ) {
+ this.isFog = true;
@@ -32,6 +34,4 @@ class Fog {
-Fog.prototype.isFog = true;
export { Fog };
@@ -4,6 +4,8 @@ class FogExp2 {
constructor( color, density = 0.00025 ) {
+ this.isFogExp2 = true;
@@ -29,6 +31,4 @@ class FogExp2 {
-FogExp2.prototype.isFogExp2 = true;
export { FogExp2 };
@@ -6,6 +6,8 @@ class Scene extends Object3D {
+ this.isScene = true;
this.type = 'Scene';
this.background = null;
@@ -53,6 +55,4 @@ class Scene extends Object3D {
-Scene.prototype.isScene = true;
export { Scene };
@@ -6,12 +6,12 @@ class CanvasTexture extends Texture {
super( canvas, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy );
+ this.isCanvasTexture = true;
this.needsUpdate = true;
-CanvasTexture.prototype.isCanvasTexture = true;
export { CanvasTexture };
@@ -6,6 +6,8 @@ class CompressedTexture extends Texture {
super( null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding );
+ this.isCompressedTexture = true;
this.image = { width: width, height: height };
this.mipmaps = mipmaps;
@@ -23,6 +25,4 @@ class CompressedTexture extends Texture {
-CompressedTexture.prototype.isCompressedTexture = true;
export { CompressedTexture };
@@ -10,6 +10,8 @@ class CubeTexture extends Texture {
super( images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding );
+ this.isCubeTexture = true;
this.flipY = false;
@@ -28,6 +30,4 @@ class CubeTexture extends Texture {
-CubeTexture.prototype.isCubeTexture = true;
export { CubeTexture };
@@ -15,6 +15,8 @@ class Data3DTexture extends Texture {
super( null );
+ this.isData3DTexture = true;
this.image = { data, width, height, depth };
this.magFilter = NearestFilter;
@@ -30,6 +32,4 @@ class Data3DTexture extends Texture {
-Data3DTexture.prototype.isData3DTexture = true;
export { Data3DTexture };
@@ -7,6 +7,8 @@ class DataArrayTexture extends Texture {
+ this.isDataArrayTexture = true;
@@ -22,6 +24,4 @@ class DataArrayTexture extends Texture {
-DataArrayTexture.prototype.isDataArrayTexture = true;
export { DataArrayTexture };
@@ -7,6 +7,8 @@ class DataTexture extends Texture {
+ this.isDataTexture = true;
this.image = { data: data, width: width, height: height };
this.generateMipmaps = false;
@@ -17,6 +19,4 @@ class DataTexture extends Texture {
-DataTexture.prototype.isDataTexture = true;
export { DataTexture };
@@ -18,6 +18,8 @@ class DepthTexture extends Texture {
super( null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy );
+ this.isDepthTexture = true;
this.magFilter = magFilter !== undefined ? magFilter : NearestFilter;
@@ -31,6 +33,4 @@ class DepthTexture extends Texture {
-DepthTexture.prototype.isDepthTexture = true;
export { DepthTexture };
@@ -7,6 +7,8 @@ class FramebufferTexture extends Texture {
super( { width, height } );
+ this.isFramebufferTexture = true;
this.format = format;
@@ -20,6 +22,4 @@ class FramebufferTexture extends Texture {
-FramebufferTexture.prototype.isFramebufferTexture = true;
export { FramebufferTexture };
@@ -5,6 +5,8 @@ class Source {
constructor( data = null ) {
+ this.isSource = true;
this.data = data;
@@ -118,6 +120,4 @@ function serializeImage( image ) {
-Source.prototype.isSource = true;
export { Source };
@@ -23,6 +23,8 @@ class Texture extends EventDispatcher {
+ this.isTexture = true;
Object.defineProperty( this, 'id', { value: textureId ++ } );
@@ -303,6 +305,4 @@ class Texture extends EventDispatcher {
Texture.DEFAULT_IMAGE = null;
Texture.DEFAULT_MAPPING = UVMapping;
-Texture.prototype.isTexture = true;
export { Texture };
@@ -7,6 +7,8 @@ class VideoTexture extends Texture {
super( video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy );
+ this.isVideoTexture = true;
this.minFilter = minFilter !== undefined ? minFilter : LinearFilter;
this.magFilter = magFilter !== undefined ? magFilter : LinearFilter;
@@ -50,6 +52,4 @@ class VideoTexture extends Texture {
-VideoTexture.prototype.isVideoTexture = true;
export { VideoTexture };
@@ -301,11 +301,9 @@ export default QUnit.module( 'Core', () => {
obj.translateOnAxis( new Vector3( 0, 1, 0 ), 1.23 );
obj.translateOnAxis( new Vector3( 0, 0, 1 ), - 4.56 );
- assert.propEqual( obj.position, {
- x: 1,
- y: 1.23,
- z: - 4.56
- } );
+ assert.numEqual( obj.position.x, 1, 'x is equal' );
+ assert.numEqual( obj.position.y, 1.23, 'y is equal' );
+ assert.numEqual( obj.position.z, - 4.56, 'z is equal' );
} );