Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
781d661f
T
three.js
项目概览
车家大少爷
/
three.js
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
three.js
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
781d661f
编写于
12月 04, 2020
作者:
G
Garrett Johnson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
lint fix quotes
上级
8382314c
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
52 addition
and
52 deletion
+52
-52
src/Three.Legacy.js
src/Three.Legacy.js
+4
-4
src/animation/KeyframeTrack.js
src/animation/KeyframeTrack.js
+2
-2
src/animation/PropertyBinding.js
src/animation/PropertyBinding.js
+2
-2
src/constants.js
src/constants.js
+2
-2
src/core/Object3D.js
src/core/Object3D.js
+2
-2
src/geometries/ExtrudeBufferGeometry.js
src/geometries/ExtrudeBufferGeometry.js
+1
-1
src/materials/Material.js
src/materials/Material.js
+2
-2
src/renderers/WebGLRenderer.js
src/renderers/WebGLRenderer.js
+1
-1
src/renderers/webgl/WebGLBufferRenderer.d.ts
src/renderers/webgl/WebGLBufferRenderer.d.ts
+3
-3
src/renderers/webgl/WebGLProgram.js
src/renderers/webgl/WebGLProgram.js
+8
-8
src/renderers/webgl/WebGLPrograms.js
src/renderers/webgl/WebGLPrograms.js
+14
-14
src/renderers/webgl/WebGLShadowMap.d.ts
src/renderers/webgl/WebGLShadowMap.d.ts
+2
-2
src/renderers/webgl/WebGLShadowMap.js
src/renderers/webgl/WebGLShadowMap.js
+3
-3
src/renderers/webgl/WebGLTextures.js
src/renderers/webgl/WebGLTextures.js
+3
-3
src/renderers/webxr/WebXRController.js
src/renderers/webxr/WebXRController.js
+2
-2
src/textures/Texture.js
src/textures/Texture.js
+1
-1
未找到文件。
src/Three.Legacy.js
浏览文件 @
781d661f
...
...
@@ -583,7 +583,7 @@ Object.assign( Matrix3.prototype, {
flattenToArrayOffset
:
function
(
array
,
offset
)
{
console
.
warn
(
"
THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead.
"
);
console
.
warn
(
'
THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead.
'
);
return
this
.
toArray
(
array
,
offset
);
},
...
...
@@ -628,7 +628,7 @@ Object.assign( Matrix4.prototype, {
},
flattenToArrayOffset
:
function
(
array
,
offset
)
{
console
.
warn
(
"
THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead.
"
);
console
.
warn
(
'
THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead.
'
);
return
this
.
toArray
(
array
,
offset
);
},
...
...
@@ -1118,8 +1118,8 @@ Object.defineProperty( Curve.prototype, '__arcLengthDivisions', {
PerspectiveCamera
.
prototype
.
setLens
=
function
(
focalLength
,
filmGauge
)
{
console
.
warn
(
"
THREE.PerspectiveCamera.setLens is deprecated.
"
+
"
Use .setFocalLength and .filmGauge for a photographic setup.
"
);
console
.
warn
(
'
THREE.PerspectiveCamera.setLens is deprecated.
'
+
'
Use .setFocalLength and .filmGauge for a photographic setup.
'
);
if
(
filmGauge
!==
undefined
)
this
.
filmGauge
=
filmGauge
;
this
.
setFocalLength
(
focalLength
);
...
...
src/animation/KeyframeTrack.js
浏览文件 @
781d661f
...
...
@@ -125,8 +125,8 @@ Object.assign( KeyframeTrack.prototype, {
if
(
factoryMethod
===
undefined
)
{
const
message
=
"
unsupported interpolation for
"
+
this
.
ValueTypeName
+
"
keyframe track named
"
+
this
.
name
;
const
message
=
'
unsupported interpolation for
'
+
this
.
ValueTypeName
+
'
keyframe track named
'
+
this
.
name
;
if
(
this
.
createInterpolant
===
undefined
)
{
...
...
src/animation/PropertyBinding.js
浏览文件 @
781d661f
...
...
@@ -188,7 +188,7 @@ Object.assign( PropertyBinding, {
findNode
:
function
(
root
,
nodeName
)
{
if
(
!
nodeName
||
nodeName
===
""
||
nodeName
===
"
.
"
||
nodeName
===
-
1
||
nodeName
===
root
.
name
||
nodeName
===
root
.
uuid
)
{
if
(
!
nodeName
||
nodeName
===
''
||
nodeName
===
'
.
'
||
nodeName
===
-
1
||
nodeName
===
root
.
name
||
nodeName
===
root
.
uuid
)
{
return
root
;
...
...
@@ -591,7 +591,7 @@ Object.assign( PropertyBinding.prototype, { // prototype, continued
// access a sub element of the property array (only primitives are supported right now)
if
(
propertyName
===
"
morphTargetInfluences
"
)
{
if
(
propertyName
===
'
morphTargetInfluences
'
)
{
// potential optimization, skip this if propertyIndex is already an integer, and convert the integer string to a true integer.
...
...
src/constants.js
浏览文件 @
781d661f
...
...
@@ -196,5 +196,5 @@ export const StaticCopyUsage = 35046;
export
const
DynamicCopyUsage
=
35050
;
export
const
StreamCopyUsage
=
35042
;
export
const
GLSL1
=
"
100
"
;
export
const
GLSL3
=
"
300 es
"
;
export
const
GLSL1
=
'
100
'
;
export
const
GLSL3
=
'
300 es
'
;
src/core/Object3D.js
浏览文件 @
781d661f
...
...
@@ -315,7 +315,7 @@ Object3D.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
if
(
object
===
this
)
{
console
.
error
(
"
THREE.Object3D.add: object can't be added as a child of itself.
"
,
object
);
console
.
error
(
'
THREE.Object3D.add: object can
\'
t be added as a child of itself.
'
,
object
);
return
this
;
}
...
...
@@ -335,7 +335,7 @@ Object3D.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
}
else
{
console
.
error
(
"
THREE.Object3D.add: object not an instance of THREE.Object3D.
"
,
object
);
console
.
error
(
'
THREE.Object3D.add: object not an instance of THREE.Object3D.
'
,
object
);
}
...
...
src/geometries/ExtrudeBufferGeometry.js
浏览文件 @
781d661f
...
...
@@ -175,7 +175,7 @@ class ExtrudeBufferGeometry extends BufferGeometry {
function
scalePt2
(
pt
,
vec
,
size
)
{
if
(
!
vec
)
console
.
error
(
"
THREE.ExtrudeGeometry: vec does not exist
"
);
if
(
!
vec
)
console
.
error
(
'
THREE.ExtrudeGeometry: vec does not exist
'
);
return
vec
.
clone
().
multiplyScalar
(
size
).
add
(
pt
);
...
...
src/materials/Material.js
浏览文件 @
781d661f
...
...
@@ -96,7 +96,7 @@ Material.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
if
(
newValue
===
undefined
)
{
console
.
warn
(
"
THREE.Material: '
"
+
key
+
"
' parameter is undefined.
"
);
console
.
warn
(
'
THREE.Material:
\'
'
+
key
+
'
\'
parameter is undefined.
'
);
continue
;
}
...
...
@@ -114,7 +114,7 @@ Material.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
if
(
currentValue
===
undefined
)
{
console
.
warn
(
"
THREE.
"
+
this
.
type
+
"
: '
"
+
key
+
"
' is not a property of this material.
"
);
console
.
warn
(
'
THREE.
'
+
this
.
type
+
'
:
\'
'
+
key
+
'
\'
is not a property of this material.
'
);
continue
;
}
...
...
src/renderers/WebGLRenderer.js
浏览文件 @
781d661f
...
...
@@ -37,7 +37,7 @@ import { WebGLTextures } from './webgl/WebGLTextures.js';
import
{
WebGLUniforms
}
from
'
./webgl/WebGLUniforms.js
'
;
import
{
WebGLUtils
}
from
'
./webgl/WebGLUtils.js
'
;
import
{
WebXRManager
}
from
'
./webxr/WebXRManager.js
'
;
import
{
WebGLMaterials
}
from
"
./webgl/WebGLMaterials.js
"
;
import
{
WebGLMaterials
}
from
'
./webgl/WebGLMaterials.js
'
;
function
createCanvasElement
()
{
...
...
src/renderers/webgl/WebGLBufferRenderer.d.ts
浏览文件 @
781d661f
// Renderers / WebGL /////////////////////////////////////////////////////////////////////
import
{
WebGLExtensions
}
from
"
./WebGLExtensions
"
;
import
{
WebGLInfo
}
from
"
./WebGLInfo
"
;
import
{
WebGLCapabilities
}
from
"
./WebGLCapabilities
"
;
import
{
WebGLExtensions
}
from
'
./WebGLExtensions
'
;
import
{
WebGLInfo
}
from
'
./WebGLInfo
'
;
import
{
WebGLCapabilities
}
from
'
./WebGLCapabilities
'
;
export
class
WebGLBufferRenderer
{
...
...
src/renderers/webgl/WebGLProgram.js
浏览文件 @
781d661f
...
...
@@ -257,19 +257,19 @@ function loopReplacer( match, start, end, snippet ) {
function
generatePrecision
(
parameters
)
{
let
precisionstring
=
"
precision
"
+
parameters
.
precision
+
"
float;
\n
precision
"
+
parameters
.
precision
+
"
int;
"
;
let
precisionstring
=
'
precision
'
+
parameters
.
precision
+
'
float;
\n
precision
'
+
parameters
.
precision
+
'
int;
'
;
if
(
parameters
.
precision
===
"
highp
"
)
{
if
(
parameters
.
precision
===
'
highp
'
)
{
precisionstring
+=
"
\n
#define HIGH_PRECISION
"
;
precisionstring
+=
'
\n
#define HIGH_PRECISION
'
;
}
else
if
(
parameters
.
precision
===
"
mediump
"
)
{
}
else
if
(
parameters
.
precision
===
'
mediump
'
)
{
precisionstring
+=
"
\n
#define MEDIUM_PRECISION
"
;
precisionstring
+=
'
\n
#define MEDIUM_PRECISION
'
;
}
else
if
(
parameters
.
precision
===
"
lowp
"
)
{
}
else
if
(
parameters
.
precision
===
'
lowp
'
)
{
precisionstring
+=
"
\n
#define LOW_PRECISION
"
;
precisionstring
+=
'
\n
#define LOW_PRECISION
'
;
}
...
...
@@ -399,7 +399,7 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
const
program
=
gl
.
createProgram
();
let
prefixVertex
,
prefixFragment
;
let
versionString
=
parameters
.
glslVersion
?
'
#version
'
+
parameters
.
glslVersion
+
"
\n
"
:
''
;
let
versionString
=
parameters
.
glslVersion
?
'
#version
'
+
parameters
.
glslVersion
+
'
\n
'
:
''
;
if
(
parameters
.
isRawShaderMaterial
)
{
...
...
src/renderers/webgl/WebGLPrograms.js
浏览文件 @
781d661f
...
...
@@ -34,19 +34,19 @@ function WebGLPrograms( renderer, cubemaps, extensions, capabilities, bindingSta
};
const
parameterNames
=
[
"
precision
"
,
"
isWebGL2
"
,
"
supportsVertexTextures
"
,
"
outputEncoding
"
,
"
instancing
"
,
"
instancingColor
"
,
"
map
"
,
"
mapEncoding
"
,
"
matcap
"
,
"
matcapEncoding
"
,
"
envMap
"
,
"
envMapMode
"
,
"
envMapEncoding
"
,
"
envMapCubeUV
"
,
"
lightMap
"
,
"
lightMapEncoding
"
,
"
aoMap
"
,
"
emissiveMap
"
,
"
emissiveMapEncoding
"
,
"
bumpMap
"
,
"
normalMap
"
,
"
objectSpaceNormalMap
"
,
"
tangentSpaceNormalMap
"
,
"
clearcoatMap
"
,
"
clearcoatRoughnessMap
"
,
"
clearcoatNormalMap
"
,
"
displacementMap
"
,
"
specularMap
"
,
"
roughnessMap
"
,
"
metalnessMap
"
,
"
gradientMap
"
,
"
alphaMap
"
,
"
combine
"
,
"
vertexColors
"
,
"
vertexTangents
"
,
"
vertexUvs
"
,
"
uvsVertexOnly
"
,
"
fog
"
,
"
useFog
"
,
"
fogExp2
"
,
"
flatShading
"
,
"
sizeAttenuation
"
,
"
logarithmicDepthBuffer
"
,
"
skinning
"
,
"
maxBones
"
,
"
useVertexTexture
"
,
"
morphTargets
"
,
"
morphNormals
"
,
"
maxMorphTargets
"
,
"
maxMorphNormals
"
,
"
premultipliedAlpha
"
,
"
numDirLights
"
,
"
numPointLights
"
,
"
numSpotLights
"
,
"
numHemiLights
"
,
"
numRectAreaLights
"
,
"
numDirLightShadows
"
,
"
numPointLightShadows
"
,
"
numSpotLightShadows
"
,
"
shadowMapEnabled
"
,
"
shadowMapType
"
,
"
toneMapping
"
,
'
physicallyCorrectLights
'
,
"
alphaTest
"
,
"
doubleSided
"
,
"
flipSided
"
,
"
numClippingPlanes
"
,
"
numClipIntersection
"
,
"
depthPacking
"
,
"
dithering
"
,
"
sheen
"
,
"
transmissionMap
"
'
precision
'
,
'
isWebGL2
'
,
'
supportsVertexTextures
'
,
'
outputEncoding
'
,
'
instancing
'
,
'
instancingColor
'
,
'
map
'
,
'
mapEncoding
'
,
'
matcap
'
,
'
matcapEncoding
'
,
'
envMap
'
,
'
envMapMode
'
,
'
envMapEncoding
'
,
'
envMapCubeUV
'
,
'
lightMap
'
,
'
lightMapEncoding
'
,
'
aoMap
'
,
'
emissiveMap
'
,
'
emissiveMapEncoding
'
,
'
bumpMap
'
,
'
normalMap
'
,
'
objectSpaceNormalMap
'
,
'
tangentSpaceNormalMap
'
,
'
clearcoatMap
'
,
'
clearcoatRoughnessMap
'
,
'
clearcoatNormalMap
'
,
'
displacementMap
'
,
'
specularMap
'
,
'
roughnessMap
'
,
'
metalnessMap
'
,
'
gradientMap
'
,
'
alphaMap
'
,
'
combine
'
,
'
vertexColors
'
,
'
vertexTangents
'
,
'
vertexUvs
'
,
'
uvsVertexOnly
'
,
'
fog
'
,
'
useFog
'
,
'
fogExp2
'
,
'
flatShading
'
,
'
sizeAttenuation
'
,
'
logarithmicDepthBuffer
'
,
'
skinning
'
,
'
maxBones
'
,
'
useVertexTexture
'
,
'
morphTargets
'
,
'
morphNormals
'
,
'
maxMorphTargets
'
,
'
maxMorphNormals
'
,
'
premultipliedAlpha
'
,
'
numDirLights
'
,
'
numPointLights
'
,
'
numSpotLights
'
,
'
numHemiLights
'
,
'
numRectAreaLights
'
,
'
numDirLightShadows
'
,
'
numPointLightShadows
'
,
'
numSpotLightShadows
'
,
'
shadowMapEnabled
'
,
'
shadowMapType
'
,
'
toneMapping
'
,
'
physicallyCorrectLights
'
,
'
alphaTest
'
,
'
doubleSided
'
,
'
flipSided
'
,
'
numClippingPlanes
'
,
'
numClipIntersection
'
,
'
depthPacking
'
,
'
dithering
'
,
'
sheen
'
,
'
transmissionMap
'
];
function
getMaxBones
(
object
)
{
...
...
@@ -99,7 +99,7 @@ function WebGLPrograms( renderer, cubemaps, extensions, capabilities, bindingSta
}
else
if
(
map
.
isWebGLRenderTarget
)
{
console
.
warn
(
"
THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead.
"
);
console
.
warn
(
'
THREE.WebGLPrograms.getTextureEncodingFromMap: don
\'
t use render targets as textures. Use their .texture property instead.
'
);
encoding
=
map
.
texture
.
encoding
;
}
...
...
src/renderers/webgl/WebGLShadowMap.d.ts
浏览文件 @
781d661f
...
...
@@ -2,8 +2,8 @@ import { Scene } from './../../scenes/Scene';
import
{
Camera
}
from
'
./../../cameras/Camera
'
;
import
{
WebGLRenderer
}
from
'
../WebGLRenderer
'
;
import
{
ShadowMapType
}
from
'
../../constants
'
;
import
{
WebGLObjects
}
from
"
./WebGLObjects
"
;
import
{
Light
}
from
"
../../lights/Light
"
;
import
{
WebGLObjects
}
from
'
./WebGLObjects
'
;
import
{
Light
}
from
'
../../lights/Light
'
;
export
class
WebGLShadowMap
{
...
...
src/renderers/webgl/WebGLShadowMap.js
浏览文件 @
781d661f
...
...
@@ -53,7 +53,7 @@ function WebGLShadowMap( _renderer, _objects, maxTextureSize ) {
const
fullScreenTri
=
new
BufferGeometry
();
fullScreenTri
.
setAttribute
(
"
position
"
,
'
position
'
,
new
BufferAttribute
(
new
Float32Array
(
[
-
1
,
-
1
,
0.5
,
3
,
-
1
,
0.5
,
-
1
,
3
,
0.5
]
),
3
...
...
@@ -139,7 +139,7 @@ function WebGLShadowMap( _renderer, _objects, maxTextureSize ) {
const
pars
=
{
minFilter
:
LinearFilter
,
magFilter
:
LinearFilter
,
format
:
RGBAFormat
};
shadow
.
map
=
new
WebGLRenderTarget
(
_shadowMapSize
.
x
,
_shadowMapSize
.
y
,
pars
);
shadow
.
map
.
texture
.
name
=
light
.
name
+
"
.shadowMap
"
;
shadow
.
map
.
texture
.
name
=
light
.
name
+
'
.shadowMap
'
;
shadow
.
mapPass
=
new
WebGLRenderTarget
(
_shadowMapSize
.
x
,
_shadowMapSize
.
y
,
pars
);
...
...
@@ -152,7 +152,7 @@ function WebGLShadowMap( _renderer, _objects, maxTextureSize ) {
const
pars
=
{
minFilter
:
NearestFilter
,
magFilter
:
NearestFilter
,
format
:
RGBAFormat
};
shadow
.
map
=
new
WebGLRenderTarget
(
_shadowMapSize
.
x
,
_shadowMapSize
.
y
,
pars
);
shadow
.
map
.
texture
.
name
=
light
.
name
+
"
.shadowMap
"
;
shadow
.
map
.
texture
.
name
=
light
.
name
+
'
.shadowMap
'
;
shadow
.
camera
.
updateProjectionMatrix
();
...
...
src/renderers/webgl/WebGLTextures.js
浏览文件 @
781d661f
...
...
@@ -21,7 +21,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
try
{
useOffscreenCanvas
=
typeof
OffscreenCanvas
!==
'
undefined
'
&&
(
new
OffscreenCanvas
(
1
,
1
).
getContext
(
"
2d
"
)
)
!==
null
;
&&
(
new
OffscreenCanvas
(
1
,
1
).
getContext
(
'
2d
'
)
)
!==
null
;
}
catch
(
err
)
{
...
...
@@ -1217,7 +1217,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
if
(
warnedTexture2D
===
false
)
{
console
.
warn
(
"
THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead.
"
);
console
.
warn
(
'
THREE.WebGLTextures.safeSetTexture2D: don
\'
t use render targets as textures. Use their .texture property instead.
'
);
warnedTexture2D
=
true
;
}
...
...
@@ -1236,7 +1236,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
if
(
warnedTextureCube
===
false
)
{
console
.
warn
(
"
THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead.
"
);
console
.
warn
(
'
THREE.WebGLTextures.safeSetTextureCube: don
\'
t use cube render targets as textures. Use their .texture property instead.
'
);
warnedTextureCube
=
true
;
}
...
...
src/renderers/webxr/WebXRController.js
浏览文件 @
781d661f
...
...
@@ -171,7 +171,7 @@ Object.assign( WebXRController.prototype, {
hand
.
inputState
.
pinching
=
false
;
this
.
dispatchEvent
(
{
type
:
"
pinchend
"
,
type
:
'
pinchend
'
,
handedness
:
inputSource
.
handedness
,
target
:
this
}
);
...
...
@@ -180,7 +180,7 @@ Object.assign( WebXRController.prototype, {
hand
.
inputState
.
pinching
=
true
;
this
.
dispatchEvent
(
{
type
:
"
pinchstart
"
,
type
:
'
pinchstart
'
,
handedness
:
inputSource
.
handedness
,
target
:
this
}
);
...
...
src/textures/Texture.js
浏览文件 @
781d661f
...
...
@@ -326,7 +326,7 @@ Texture.prototype = Object.assign( Object.create( EventDispatcher.prototype ), {
}
);
Object
.
defineProperty
(
Texture
.
prototype
,
"
needsUpdate
"
,
{
Object
.
defineProperty
(
Texture
.
prototype
,
'
needsUpdate
'
,
{
set
:
function
(
value
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录