Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
车家大少爷
three.js
提交
46485726
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 搜索 >>
未验证
提交
46485726
编写于
6月 16, 2021
作者:
M
Michael Herzog
提交者:
GitHub
6月 16, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Core: Remove checks for mandatory target parameter. (#21990)
上级
2272eaec
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
0 addition
and
253 deletion
+0
-253
src/cameras/Camera.js
src/cameras/Camera.js
+0
-8
src/core/Object3D.js
src/core/Object3D.js
+0
-28
src/math/Box2.js
src/math/Box2.js
+0
-28
src/math/Box3.js
src/math/Box3.js
+0
-35
src/math/Color.js
src/math/Color.js
+0
-7
src/math/Line3.js
src/math/Line3.js
+0
-28
src/math/Plane.js
src/math/Plane.js
+0
-21
src/math/Ray.js
src/math/Ray.js
+0
-14
src/math/Sphere.js
src/math/Sphere.js
+0
-14
src/math/Triangle.js
src/math/Triangle.js
+0
-36
src/renderers/WebGLRenderer.js
src/renderers/WebGLRenderer.js
+0
-34
未找到文件。
src/cameras/Camera.js
浏览文件 @
46485726
import
{
Matrix4
}
from
'
../math/Matrix4.js
'
;
import
{
Object3D
}
from
'
../core/Object3D.js
'
;
import
{
Vector3
}
from
'
../math/Vector3.js
'
;
class
Camera
extends
Object3D
{
...
...
@@ -32,13 +31,6 @@ class Camera extends Object3D {
getWorldDirection
(
target
)
{
if
(
target
===
undefined
)
{
console
.
warn
(
'
THREE.Camera: .getWorldDirection() target is now required
'
);
target
=
new
Vector3
();
}
this
.
updateWorldMatrix
(
true
,
false
);
const
e
=
this
.
matrixWorld
.
elements
;
...
...
src/core/Object3D.js
浏览文件 @
46485726
...
...
@@ -461,13 +461,6 @@ class Object3D extends EventDispatcher {
getWorldPosition
(
target
)
{
if
(
target
===
undefined
)
{
console
.
warn
(
'
THREE.Object3D: .getWorldPosition() target is now required
'
);
target
=
new
Vector3
();
}
this
.
updateWorldMatrix
(
true
,
false
);
return
target
.
setFromMatrixPosition
(
this
.
matrixWorld
);
...
...
@@ -476,13 +469,6 @@ class Object3D extends EventDispatcher {
getWorldQuaternion
(
target
)
{
if
(
target
===
undefined
)
{
console
.
warn
(
'
THREE.Object3D: .getWorldQuaternion() target is now required
'
);
target
=
new
Quaternion
();
}
this
.
updateWorldMatrix
(
true
,
false
);
this
.
matrixWorld
.
decompose
(
_position
,
target
,
_scale
);
...
...
@@ -493,13 +479,6 @@ class Object3D extends EventDispatcher {
getWorldScale
(
target
)
{
if
(
target
===
undefined
)
{
console
.
warn
(
'
THREE.Object3D: .getWorldScale() target is now required
'
);
target
=
new
Vector3
();
}
this
.
updateWorldMatrix
(
true
,
false
);
this
.
matrixWorld
.
decompose
(
_position
,
_quaternion
,
target
);
...
...
@@ -510,13 +489,6 @@ class Object3D extends EventDispatcher {
getWorldDirection
(
target
)
{
if
(
target
===
undefined
)
{
console
.
warn
(
'
THREE.Object3D: .getWorldDirection() target is now required
'
);
target
=
new
Vector3
();
}
this
.
updateWorldMatrix
(
true
,
false
);
const
e
=
this
.
matrixWorld
.
elements
;
...
...
src/math/Box2.js
浏览文件 @
46485726
...
...
@@ -78,26 +78,12 @@ class Box2 {
getCenter
(
target
)
{
if
(
target
===
undefined
)
{
console
.
warn
(
'
THREE.Box2: .getCenter() target is now required
'
);
target
=
new
Vector2
();
}
return
this
.
isEmpty
()
?
target
.
set
(
0
,
0
)
:
target
.
addVectors
(
this
.
min
,
this
.
max
).
multiplyScalar
(
0.5
);
}
getSize
(
target
)
{
if
(
target
===
undefined
)
{
console
.
warn
(
'
THREE.Box2: .getSize() target is now required
'
);
target
=
new
Vector2
();
}
return
this
.
isEmpty
()
?
target
.
set
(
0
,
0
)
:
target
.
subVectors
(
this
.
max
,
this
.
min
);
}
...
...
@@ -148,13 +134,6 @@ class Box2 {
// This can potentially have a divide by zero if the box
// has a size dimension of 0.
if
(
target
===
undefined
)
{
console
.
warn
(
'
THREE.Box2: .getParameter() target is now required
'
);
target
=
new
Vector2
();
}
return
target
.
set
(
(
point
.
x
-
this
.
min
.
x
)
/
(
this
.
max
.
x
-
this
.
min
.
x
),
(
point
.
y
-
this
.
min
.
y
)
/
(
this
.
max
.
y
-
this
.
min
.
y
)
...
...
@@ -173,13 +152,6 @@ class Box2 {
clampPoint
(
point
,
target
)
{
if
(
target
===
undefined
)
{
console
.
warn
(
'
THREE.Box2: .clampPoint() target is now required
'
);
target
=
new
Vector2
();
}
return
target
.
copy
(
point
).
clamp
(
this
.
min
,
this
.
max
);
}
...
...
src/math/Box3.js
浏览文件 @
46485726
...
...
@@ -151,26 +151,12 @@ class Box3 {
getCenter
(
target
)
{
if
(
target
===
undefined
)
{
console
.
warn
(
'
THREE.Box3: .getCenter() target is now required
'
);
target
=
new
Vector3
();
}
return
this
.
isEmpty
()
?
target
.
set
(
0
,
0
,
0
)
:
target
.
addVectors
(
this
.
min
,
this
.
max
).
multiplyScalar
(
0.5
);
}
getSize
(
target
)
{
if
(
target
===
undefined
)
{
console
.
warn
(
'
THREE.Box3: .getSize() target is now required
'
);
target
=
new
Vector3
();
}
return
this
.
isEmpty
()
?
target
.
set
(
0
,
0
,
0
)
:
target
.
subVectors
(
this
.
max
,
this
.
min
);
}
...
...
@@ -259,13 +245,6 @@ class Box3 {
// This can potentially have a divide by zero if the box
// has a size dimension of 0.
if
(
target
===
undefined
)
{
console
.
warn
(
'
THREE.Box3: .getParameter() target is now required
'
);
target
=
new
Vector3
();
}
return
target
.
set
(
(
point
.
x
-
this
.
min
.
x
)
/
(
this
.
max
.
x
-
this
.
min
.
x
),
(
point
.
y
-
this
.
min
.
y
)
/
(
this
.
max
.
y
-
this
.
min
.
y
),
...
...
@@ -395,13 +374,6 @@ class Box3 {
clampPoint
(
point
,
target
)
{
if
(
target
===
undefined
)
{
console
.
warn
(
'
THREE.Box3: .clampPoint() target is now required
'
);
target
=
new
Vector3
();
}
return
target
.
copy
(
point
).
clamp
(
this
.
min
,
this
.
max
);
}
...
...
@@ -416,13 +388,6 @@ class Box3 {
getBoundingSphere
(
target
)
{
if
(
target
===
undefined
)
{
console
.
error
(
'
THREE.Box3: .getBoundingSphere() target is now required
'
);
//target = new Sphere(); // removed to avoid cyclic dependency
}
this
.
getCenter
(
target
.
center
);
target
.
radius
=
this
.
getSize
(
_vector
).
length
()
*
0.5
;
...
...
src/math/Color.js
浏览文件 @
46485726
...
...
@@ -388,13 +388,6 @@ class Color {
// h,s,l ranges are in 0.0 - 1.0
if
(
target
===
undefined
)
{
console
.
warn
(
'
THREE.Color: .getHSL() target is now required
'
);
target
=
{
h
:
0
,
s
:
0
,
l
:
0
};
}
const
r
=
this
.
r
,
g
=
this
.
g
,
b
=
this
.
b
;
const
max
=
Math
.
max
(
r
,
g
,
b
);
...
...
src/math/Line3.js
浏览文件 @
46485726
...
...
@@ -33,26 +33,12 @@ class Line3 {
getCenter
(
target
)
{
if
(
target
===
undefined
)
{
console
.
warn
(
'
THREE.Line3: .getCenter() target is now required
'
);
target
=
new
Vector3
();
}
return
target
.
addVectors
(
this
.
start
,
this
.
end
).
multiplyScalar
(
0.5
);
}
delta
(
target
)
{
if
(
target
===
undefined
)
{
console
.
warn
(
'
THREE.Line3: .delta() target is now required
'
);
target
=
new
Vector3
();
}
return
target
.
subVectors
(
this
.
end
,
this
.
start
);
}
...
...
@@ -71,13 +57,6 @@ class Line3 {
at
(
t
,
target
)
{
if
(
target
===
undefined
)
{
console
.
warn
(
'
THREE.Line3: .at() target is now required
'
);
target
=
new
Vector3
();
}
return
this
.
delta
(
target
).
multiplyScalar
(
t
).
add
(
this
.
start
);
}
...
...
@@ -106,13 +85,6 @@ class Line3 {
const
t
=
this
.
closestPointToPointParameter
(
point
,
clampToLine
);
if
(
target
===
undefined
)
{
console
.
warn
(
'
THREE.Line3: .closestPointToPoint() target is now required
'
);
target
=
new
Vector3
();
}
return
this
.
delta
(
target
).
multiplyScalar
(
t
).
add
(
this
.
start
);
}
...
...
src/math/Plane.js
浏览文件 @
46485726
...
...
@@ -99,26 +99,12 @@ class Plane {
projectPoint
(
point
,
target
)
{
if
(
target
===
undefined
)
{
console
.
warn
(
'
THREE.Plane: .projectPoint() target is now required
'
);
target
=
new
Vector3
();
}
return
target
.
copy
(
this
.
normal
).
multiplyScalar
(
-
this
.
distanceToPoint
(
point
)
).
add
(
point
);
}
intersectLine
(
line
,
target
)
{
if
(
target
===
undefined
)
{
console
.
warn
(
'
THREE.Plane: .intersectLine() target is now required
'
);
target
=
new
Vector3
();
}
const
direction
=
line
.
delta
(
_vector1
);
const
denominator
=
this
.
normal
.
dot
(
direction
);
...
...
@@ -174,13 +160,6 @@ class Plane {
coplanarPoint
(
target
)
{
if
(
target
===
undefined
)
{
console
.
warn
(
'
THREE.Plane: .coplanarPoint() target is now required
'
);
target
=
new
Vector3
();
}
return
target
.
copy
(
this
.
normal
).
multiplyScalar
(
-
this
.
constant
);
}
...
...
src/math/Ray.js
浏览文件 @
46485726
...
...
@@ -38,13 +38,6 @@ class Ray {
at
(
t
,
target
)
{
if
(
target
===
undefined
)
{
console
.
warn
(
'
THREE.Ray: .at() target is now required
'
);
target
=
new
Vector3
();
}
return
target
.
copy
(
this
.
direction
).
multiplyScalar
(
t
).
add
(
this
.
origin
);
}
...
...
@@ -67,13 +60,6 @@ class Ray {
closestPointToPoint
(
point
,
target
)
{
if
(
target
===
undefined
)
{
console
.
warn
(
'
THREE.Ray: .closestPointToPoint() target is now required
'
);
target
=
new
Vector3
();
}
target
.
subVectors
(
point
,
this
.
origin
);
const
directionDistance
=
target
.
dot
(
this
.
direction
);
...
...
src/math/Sphere.js
浏览文件 @
46485726
...
...
@@ -112,13 +112,6 @@ class Sphere {
const
deltaLengthSq
=
this
.
center
.
distanceToSquared
(
point
);
if
(
target
===
undefined
)
{
console
.
warn
(
'
THREE.Sphere: .clampPoint() target is now required
'
);
target
=
new
Vector3
();
}
target
.
copy
(
point
);
if
(
deltaLengthSq
>
(
this
.
radius
*
this
.
radius
)
)
{
...
...
@@ -134,13 +127,6 @@ class Sphere {
getBoundingBox
(
target
)
{
if
(
target
===
undefined
)
{
console
.
warn
(
'
THREE.Sphere: .getBoundingBox() target is now required
'
);
target
=
new
Box3
();
}
if
(
this
.
isEmpty
()
)
{
// Empty sphere produces empty bounding box
...
...
src/math/Triangle.js
浏览文件 @
46485726
import
{
Vector3
}
from
'
./Vector3.js
'
;
import
{
Plane
}
from
'
./Plane.js
'
;
const
_v0
=
/*@__PURE__*/
new
Vector3
();
const
_v1
=
/*@__PURE__*/
new
Vector3
();
...
...
@@ -25,13 +24,6 @@ class Triangle {
static
getNormal
(
a
,
b
,
c
,
target
)
{
if
(
target
===
undefined
)
{
console
.
warn
(
'
THREE.Triangle: .getNormal() target is now required
'
);
target
=
new
Vector3
();
}
target
.
subVectors
(
c
,
b
);
_v0
.
subVectors
(
a
,
b
);
target
.
cross
(
_v0
);
...
...
@@ -63,13 +55,6 @@ class Triangle {
const
denom
=
(
dot00
*
dot11
-
dot01
*
dot01
);
if
(
target
===
undefined
)
{
console
.
warn
(
'
THREE.Triangle: .getBarycoord() target is now required
'
);
target
=
new
Vector3
();
}
// collinear or singular triangle
if
(
denom
===
0
)
{
...
...
@@ -166,13 +151,6 @@ class Triangle {
getMidpoint
(
target
)
{
if
(
target
===
undefined
)
{
console
.
warn
(
'
THREE.Triangle: .getMidpoint() target is now required
'
);
target
=
new
Vector3
();
}
return
target
.
addVectors
(
this
.
a
,
this
.
b
).
add
(
this
.
c
).
multiplyScalar
(
1
/
3
);
}
...
...
@@ -185,13 +163,6 @@ class Triangle {
getPlane
(
target
)
{
if
(
target
===
undefined
)
{
console
.
warn
(
'
THREE.Triangle: .getPlane() target is now required
'
);
target
=
new
Plane
();
}
return
target
.
setFromCoplanarPoints
(
this
.
a
,
this
.
b
,
this
.
c
);
}
...
...
@@ -228,13 +199,6 @@ class Triangle {
closestPointToPoint
(
p
,
target
)
{
if
(
target
===
undefined
)
{
console
.
warn
(
'
THREE.Triangle: .closestPointToPoint() target is now required
'
);
target
=
new
Vector3
();
}
const
a
=
this
.
a
,
b
=
this
.
b
,
c
=
this
.
c
;
let
v
,
w
;
...
...
src/renderers/WebGLRenderer.js
浏览文件 @
46485726
...
...
@@ -14,10 +14,8 @@ import {
}
from
'
../constants.js
'
;
import
{
Frustum
}
from
'
../math/Frustum.js
'
;
import
{
Matrix4
}
from
'
../math/Matrix4.js
'
;
import
{
Vector2
}
from
'
../math/Vector2.js
'
;
import
{
Vector3
}
from
'
../math/Vector3.js
'
;
import
{
Vector4
}
from
'
../math/Vector4.js
'
;
import
{
Color
}
from
'
../math/Color.js
'
;
import
{
WebGLAnimation
}
from
'
./webgl/WebGLAnimation.js
'
;
import
{
WebGLAttributes
}
from
'
./webgl/WebGLAttributes.js
'
;
import
{
WebGLBackground
}
from
'
./webgl/WebGLBackground.js
'
;
...
...
@@ -375,14 +373,6 @@ function WebGLRenderer( parameters = {} ) {
this
.
getSize
=
function
(
target
)
{
if
(
target
===
undefined
)
{
console
.
warn
(
'
WebGLRenderer: .getsize() now requires a Vector2 as an argument
'
);
target
=
new
Vector2
();
}
return
target
.
set
(
_width
,
_height
);
};
...
...
@@ -415,14 +405,6 @@ function WebGLRenderer( parameters = {} ) {
this
.
getDrawingBufferSize
=
function
(
target
)
{
if
(
target
===
undefined
)
{
console
.
warn
(
'
WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument
'
);
target
=
new
Vector2
();
}
return
target
.
set
(
_width
*
_pixelRatio
,
_height
*
_pixelRatio
).
floor
();
};
...
...
@@ -443,14 +425,6 @@ function WebGLRenderer( parameters = {} ) {
this
.
getCurrentViewport
=
function
(
target
)
{
if
(
target
===
undefined
)
{
console
.
warn
(
'
WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument
'
);
target
=
new
Vector4
();
}
return
target
.
copy
(
_currentViewport
);
};
...
...
@@ -527,14 +501,6 @@ function WebGLRenderer( parameters = {} ) {
this
.
getClearColor
=
function
(
target
)
{
if
(
target
===
undefined
)
{
console
.
warn
(
'
WebGLRenderer: .getClearColor() now requires a Color as an argument
'
);
target
=
new
Color
();
}
return
target
.
copy
(
background
.
getClearColor
()
);
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录