Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Ablesons
three.js
提交
7777df42
T
three.js
项目概览
Ablesons
/
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,发现更多精彩内容 >>
提交
7777df42
编写于
12月 07, 2012
作者:
M
Mr.doob
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Removed Rectangle.
上级
8b97c343
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
57 addition
and
271 deletion
+57
-271
examples/js/renderers/SVGRenderer.js
examples/js/renderers/SVGRenderer.js
+14
-25
src/math/Box2.js
src/math/Box2.js
+4
-2
src/math/Rectangle.js
src/math/Rectangle.js
+0
-201
src/renderers/CanvasRenderer.js
src/renderers/CanvasRenderer.js
+39
-39
utils/includes/canvas.json
utils/includes/canvas.json
+0
-1
utils/includes/common.json
utils/includes/common.json
+0
-1
utils/includes/math.json
utils/includes/math.json
+0
-1
utils/includes/webgl.json
utils/includes/webgl.json
+0
-1
未找到文件。
examples/js/renderers/SVGRenderer.js
浏览文件 @
7777df42
...
...
@@ -14,8 +14,8 @@ THREE.SVGRenderer = function () {
_v1
,
_v2
,
_v3
,
_v4
,
_clip
Rect
=
new
THREE
.
Rectangle
(),
_
bboxRect
=
new
THREE
.
Rectangle
(),
_clip
Box
=
new
THREE
.
Box2
(),
_
elemBox
=
new
THREE
.
Box2
(),
_enableLighting
=
false
,
_color
=
new
THREE
.
Color
(),
...
...
@@ -69,7 +69,8 @@ THREE.SVGRenderer = function () {
_svg
.
setAttribute
(
'
width
'
,
_svgWidth
);
_svg
.
setAttribute
(
'
height
'
,
_svgHeight
);
_clipRect
.
set
(
-
_svgWidthHalf
,
-
_svgHeightHalf
,
_svgWidthHalf
,
_svgHeightHalf
);
_clipBox
.
min
.
set
(
-
_svgWidthHalf
,
-
_svgHeightHalf
);
_clipBox
.
max
.
set
(
_svgWidthHalf
,
_svgHeightHalf
);
};
...
...
@@ -121,7 +122,7 @@ THREE.SVGRenderer = function () {
if
(
material
===
undefined
||
material
.
visible
===
false
)
continue
;
_
bboxRect
.
e
mpty
();
_
elemBox
.
makeE
mpty
();
if
(
element
instanceof
THREE
.
RenderableParticle
)
{
...
...
@@ -137,17 +138,14 @@ THREE.SVGRenderer = function () {
_v1
.
positionScreen
.
x
*=
_svgWidthHalf
;
_v1
.
positionScreen
.
y
*=
-
_svgHeightHalf
;
_v2
.
positionScreen
.
x
*=
_svgWidthHalf
;
_v2
.
positionScreen
.
y
*=
-
_svgHeightHalf
;
_bboxRect
.
addPoint
(
_v1
.
positionScreen
.
x
,
_v1
.
positionScreen
.
y
);
_bboxRect
.
addPoint
(
_v2
.
positionScreen
.
x
,
_v2
.
positionScreen
.
y
);
_elemBox
.
setFromPoints
(
[
_v1
.
positionScreen
,
_v2
.
positionScreen
]
);
if
(
!
_clipRect
.
intersects
(
_bboxRect
)
)
{
if
(
_clipBox
.
isIntersectionBox
(
_elemBox
)
===
true
)
{
continue
;
renderLine
(
_v1
,
_v2
,
element
,
material
,
scene
)
;
}
renderLine
(
_v1
,
_v2
,
element
,
material
,
scene
);
}
else
if
(
element
instanceof
THREE
.
RenderableFace3
)
{
_v1
=
element
.
v1
;
_v2
=
element
.
v2
;
_v3
=
element
.
v3
;
...
...
@@ -156,18 +154,14 @@ THREE.SVGRenderer = function () {
_v2
.
positionScreen
.
x
*=
_svgWidthHalf
;
_v2
.
positionScreen
.
y
*=
-
_svgHeightHalf
;
_v3
.
positionScreen
.
x
*=
_svgWidthHalf
;
_v3
.
positionScreen
.
y
*=
-
_svgHeightHalf
;
_bboxRect
.
addPoint
(
_v1
.
positionScreen
.
x
,
_v1
.
positionScreen
.
y
);
_bboxRect
.
addPoint
(
_v2
.
positionScreen
.
x
,
_v2
.
positionScreen
.
y
);
_bboxRect
.
addPoint
(
_v3
.
positionScreen
.
x
,
_v3
.
positionScreen
.
y
);
_elemBox
.
setFromPoints
(
[
_v1
.
positionScreen
,
_v2
.
positionScreen
,
_v3
.
positionScreen
]
);
if
(
!
_clipRect
.
intersects
(
_bboxRect
)
)
{
if
(
_clipBox
.
isIntersectionBox
(
_elemBox
)
===
true
)
{
continue
;
renderFace3
(
_v1
,
_v2
,
_v3
,
element
,
material
,
scene
)
;
}
renderFace3
(
_v1
,
_v2
,
_v3
,
element
,
material
,
scene
);
}
else
if
(
element
instanceof
THREE
.
RenderableFace4
)
{
_v1
=
element
.
v1
;
_v2
=
element
.
v2
;
_v3
=
element
.
v3
;
_v4
=
element
.
v4
;
...
...
@@ -177,19 +171,14 @@ THREE.SVGRenderer = function () {
_v3
.
positionScreen
.
x
*=
_svgWidthHalf
;
_v3
.
positionScreen
.
y
*=
-
_svgHeightHalf
;
_v4
.
positionScreen
.
x
*=
_svgWidthHalf
;
_v4
.
positionScreen
.
y
*=
-
_svgHeightHalf
;
_bboxRect
.
addPoint
(
_v1
.
positionScreen
.
x
,
_v1
.
positionScreen
.
y
);
_bboxRect
.
addPoint
(
_v2
.
positionScreen
.
x
,
_v2
.
positionScreen
.
y
);
_bboxRect
.
addPoint
(
_v3
.
positionScreen
.
x
,
_v3
.
positionScreen
.
y
);
_bboxRect
.
addPoint
(
_v4
.
positionScreen
.
x
,
_v4
.
positionScreen
.
y
);
_elemBox
.
setFromPoints
(
[
_v1
.
positionScreen
,
_v2
.
positionScreen
,
_v3
.
positionScreen
,
_v4
.
positionScreen
]
);
if
(
!
_clipRect
.
intersects
(
_bboxRect
)
)
{
if
(
_clipBox
.
isIntersectionBox
(
_elemBox
)
===
true
)
{
continue
;
renderFace4
(
_v1
,
_v2
,
_v3
,
_v4
,
element
,
material
,
scene
)
;
}
renderFace4
(
_v1
,
_v2
,
_v3
,
_v4
,
element
,
material
,
scene
);
}
}
...
...
src/math/Box2.js
浏览文件 @
7777df42
...
...
@@ -196,8 +196,10 @@ THREE.Box2.prototype = {
// using 6 splitting planes to rule out intersections.
if
(
(
box
.
max
.
x
<
this
.
min
.
x
)
||
(
box
.
min
.
x
>
this
.
max
.
x
)
||
(
box
.
max
.
y
<
this
.
min
.
y
)
||
(
box
.
min
.
y
>
this
.
max
.
y
)
)
{
if
(
(
box
.
max
.
x
<
this
.
min
.
x
)
||
(
box
.
min
.
x
>
this
.
max
.
x
)
||
(
box
.
max
.
y
<
this
.
min
.
y
)
||
(
box
.
min
.
y
>
this
.
max
.
y
)
)
{
return
false
;
...
...
src/math/Rectangle.js
已删除
100644 → 0
浏览文件 @
8b97c343
/**
* @author mrdoob / http://mrdoob.com/
*/
THREE
.
Rectangle
=
function
()
{
var
_left
=
0
;
var
_top
=
0
;
var
_right
=
0
;
var
_bottom
=
0
;
var
_width
=
0
;
var
_height
=
0
;
var
_isEmpty
=
true
;
function
resize
()
{
_width
=
_right
-
_left
;
_height
=
_bottom
-
_top
;
}
this
.
getX
=
function
()
{
return
_left
;
};
this
.
getY
=
function
()
{
return
_top
;
};
this
.
getWidth
=
function
()
{
return
_width
;
};
this
.
getHeight
=
function
()
{
return
_height
;
};
this
.
getLeft
=
function
()
{
return
_left
;
};
this
.
getTop
=
function
()
{
return
_top
;
};
this
.
getRight
=
function
()
{
return
_right
;
};
this
.
getBottom
=
function
()
{
return
_bottom
;
};
this
.
set
=
function
(
left
,
top
,
right
,
bottom
)
{
_isEmpty
=
false
;
_left
=
left
;
_top
=
top
;
_right
=
right
;
_bottom
=
bottom
;
resize
();
};
this
.
addPoint
=
function
(
x
,
y
)
{
if
(
_isEmpty
===
true
)
{
_isEmpty
=
false
;
_left
=
x
;
_top
=
y
;
_right
=
x
;
_bottom
=
y
;
resize
();
}
else
{
_left
=
_left
<
x
?
_left
:
x
;
// Math.min( _left, x );
_top
=
_top
<
y
?
_top
:
y
;
// Math.min( _top, y );
_right
=
_right
>
x
?
_right
:
x
;
// Math.max( _right, x );
_bottom
=
_bottom
>
y
?
_bottom
:
y
;
// Math.max( _bottom, y );
resize
();
}
};
this
.
add3Points
=
function
(
x1
,
y1
,
x2
,
y2
,
x3
,
y3
)
{
if
(
_isEmpty
===
true
)
{
_isEmpty
=
false
;
_left
=
x1
<
x2
?
(
x1
<
x3
?
x1
:
x3
)
:
(
x2
<
x3
?
x2
:
x3
);
_top
=
y1
<
y2
?
(
y1
<
y3
?
y1
:
y3
)
:
(
y2
<
y3
?
y2
:
y3
);
_right
=
x1
>
x2
?
(
x1
>
x3
?
x1
:
x3
)
:
(
x2
>
x3
?
x2
:
x3
);
_bottom
=
y1
>
y2
?
(
y1
>
y3
?
y1
:
y3
)
:
(
y2
>
y3
?
y2
:
y3
);
resize
();
}
else
{
_left
=
x1
<
x2
?
(
x1
<
x3
?
(
x1
<
_left
?
x1
:
_left
)
:
(
x3
<
_left
?
x3
:
_left
)
)
:
(
x2
<
x3
?
(
x2
<
_left
?
x2
:
_left
)
:
(
x3
<
_left
?
x3
:
_left
)
);
_top
=
y1
<
y2
?
(
y1
<
y3
?
(
y1
<
_top
?
y1
:
_top
)
:
(
y3
<
_top
?
y3
:
_top
)
)
:
(
y2
<
y3
?
(
y2
<
_top
?
y2
:
_top
)
:
(
y3
<
_top
?
y3
:
_top
)
);
_right
=
x1
>
x2
?
(
x1
>
x3
?
(
x1
>
_right
?
x1
:
_right
)
:
(
x3
>
_right
?
x3
:
_right
)
)
:
(
x2
>
x3
?
(
x2
>
_right
?
x2
:
_right
)
:
(
x3
>
_right
?
x3
:
_right
)
);
_bottom
=
y1
>
y2
?
(
y1
>
y3
?
(
y1
>
_bottom
?
y1
:
_bottom
)
:
(
y3
>
_bottom
?
y3
:
_bottom
)
)
:
(
y2
>
y3
?
(
y2
>
_bottom
?
y2
:
_bottom
)
:
(
y3
>
_bottom
?
y3
:
_bottom
)
);
resize
();
};
};
this
.
addRectangle
=
function
(
r
)
{
if
(
_isEmpty
===
true
)
{
_isEmpty
=
false
;
_left
=
r
.
getLeft
();
_top
=
r
.
getTop
();
_right
=
r
.
getRight
();
_bottom
=
r
.
getBottom
();
resize
();
}
else
{
_left
=
_left
<
r
.
getLeft
()
?
_left
:
r
.
getLeft
();
// Math.min(_left, r.getLeft() );
_top
=
_top
<
r
.
getTop
()
?
_top
:
r
.
getTop
();
// Math.min(_top, r.getTop() );
_right
=
_right
>
r
.
getRight
()
?
_right
:
r
.
getRight
();
// Math.max(_right, r.getRight() );
_bottom
=
_bottom
>
r
.
getBottom
()
?
_bottom
:
r
.
getBottom
();
// Math.max(_bottom, r.getBottom() );
resize
();
}
};
this
.
inflate
=
function
(
v
)
{
_left
-=
v
;
_top
-=
v
;
_right
+=
v
;
_bottom
+=
v
;
resize
();
};
this
.
minSelf
=
function
(
r
)
{
_left
=
_left
>
r
.
getLeft
()
?
_left
:
r
.
getLeft
();
// Math.max( _left, r.getLeft() );
_top
=
_top
>
r
.
getTop
()
?
_top
:
r
.
getTop
();
// Math.max( _top, r.getTop() );
_right
=
_right
<
r
.
getRight
()
?
_right
:
r
.
getRight
();
// Math.min( _right, r.getRight() );
_bottom
=
_bottom
<
r
.
getBottom
()
?
_bottom
:
r
.
getBottom
();
// Math.min( _bottom, r.getBottom() );
resize
();
};
this
.
intersects
=
function
(
r
)
{
// http://gamemath.com/2011/09/detecting-whether-two-boxes-overlap/
if
(
_right
<
r
.
getLeft
()
)
return
false
;
if
(
_left
>
r
.
getRight
()
)
return
false
;
if
(
_bottom
<
r
.
getTop
()
)
return
false
;
if
(
_top
>
r
.
getBottom
()
)
return
false
;
return
true
;
};
this
.
empty
=
function
()
{
_isEmpty
=
true
;
_left
=
0
;
_top
=
0
;
_right
=
0
;
_bottom
=
0
;
resize
();
};
this
.
isEmpty
=
function
()
{
return
_isEmpty
;
};
};
src/renderers/CanvasRenderer.js
浏览文件 @
7777df42
...
...
@@ -51,9 +51,9 @@ THREE.CanvasRenderer = function ( parameters ) {
_image
,
_uvs
,
_uv1x
,
_uv1y
,
_uv2x
,
_uv2y
,
_uv3x
,
_uv3y
,
_clipBox
2
=
new
THREE
.
Box2
(),
_clearBox
2
=
new
THREE
.
Box2
(),
_elemBox
2
=
new
THREE
.
Box2
(),
_clipBox
=
new
THREE
.
Box2
(),
_clearBox
=
new
THREE
.
Box2
(),
_elemBox
=
new
THREE
.
Box2
(),
_enableLighting
=
false
,
_ambientLight
=
new
THREE
.
Color
(),
...
...
@@ -112,10 +112,10 @@ THREE.CanvasRenderer = function ( parameters ) {
_canvas
.
width
=
_canvasWidth
;
_canvas
.
height
=
_canvasHeight
;
_clipBox
2
.
min
.
set
(
-
_canvasWidthHalf
,
-
_canvasHeightHalf
);
_clipBox
2
.
max
.
set
(
_canvasWidthHalf
,
_canvasHeightHalf
);
_clearBox
2
.
min
.
set
(
-
_canvasWidthHalf
,
-
_canvasHeightHalf
);
_clearBox
2
.
max
.
set
(
_canvasWidthHalf
,
_canvasHeightHalf
);
_clipBox
.
min
.
set
(
-
_canvasWidthHalf
,
-
_canvasHeightHalf
);
_clipBox
.
max
.
set
(
_canvasWidthHalf
,
_canvasHeightHalf
);
_clearBox
.
min
.
set
(
-
_canvasWidthHalf
,
-
_canvasHeightHalf
);
_clearBox
.
max
.
set
(
_canvasWidthHalf
,
_canvasHeightHalf
);
_contextGlobalAlpha
=
1
;
_contextGlobalCompositeOperation
=
0
;
...
...
@@ -132,8 +132,8 @@ THREE.CanvasRenderer = function ( parameters ) {
_clearColor
.
copy
(
color
);
_clearOpacity
=
opacity
!==
undefined
?
opacity
:
1
;
_clearBox
2
.
min
.
set
(
-
_canvasWidthHalf
,
-
_canvasHeightHalf
);
_clearBox
2
.
max
.
set
(
_canvasWidthHalf
,
_canvasHeightHalf
);
_clearBox
.
min
.
set
(
-
_canvasWidthHalf
,
-
_canvasHeightHalf
);
_clearBox
.
max
.
set
(
_canvasWidthHalf
,
_canvasHeightHalf
);
};
...
...
@@ -142,8 +142,8 @@ THREE.CanvasRenderer = function ( parameters ) {
_clearColor
.
setHex
(
hex
);
_clearOpacity
=
opacity
!==
undefined
?
opacity
:
1
;
_clearBox
2
.
min
.
set
(
-
_canvasWidthHalf
,
-
_canvasHeightHalf
);
_clearBox
2
.
max
.
set
(
_canvasWidthHalf
,
_canvasHeightHalf
);
_clearBox
.
min
.
set
(
-
_canvasWidthHalf
,
-
_canvasHeightHalf
);
_clearBox
.
max
.
set
(
_canvasWidthHalf
,
_canvasHeightHalf
);
};
...
...
@@ -157,14 +157,14 @@ THREE.CanvasRenderer = function ( parameters ) {
_context
.
setTransform
(
1
,
0
,
0
,
-
1
,
_canvasWidthHalf
,
_canvasHeightHalf
);
if
(
_clearBox
2
.
empty
()
===
false
)
{
if
(
_clearBox
.
empty
()
===
false
)
{
_clearBox
2
.
intersect
(
_clipBox2
);
_clearBox
2
.
expandByScalar
(
2
);
_clearBox
.
intersect
(
_clipBox
);
_clearBox
.
expandByScalar
(
2
);
if
(
_clearOpacity
<
1
)
{
_context
.
clearRect
(
_clearBox
2
.
min
.
x
|
0
,
_clearBox2
.
min
.
y
|
0
,
(
_clearBox2
.
max
.
x
-
_clearBox2
.
min
.
x
)
|
0
,
(
_clearBox2
.
max
.
y
-
_clearBox2
.
min
.
y
)
|
0
);
_context
.
clearRect
(
_clearBox
.
min
.
x
|
0
,
_clearBox
.
min
.
y
|
0
,
(
_clearBox
.
max
.
x
-
_clearBox
.
min
.
x
)
|
0
,
(
_clearBox
.
max
.
y
-
_clearBox
.
min
.
y
)
|
0
);
}
...
...
@@ -175,11 +175,11 @@ THREE.CanvasRenderer = function ( parameters ) {
setFillStyle
(
'
rgba(
'
+
Math
.
floor
(
_clearColor
.
r
*
255
)
+
'
,
'
+
Math
.
floor
(
_clearColor
.
g
*
255
)
+
'
,
'
+
Math
.
floor
(
_clearColor
.
b
*
255
)
+
'
,
'
+
_clearOpacity
+
'
)
'
);
_context
.
fillRect
(
_clearBox
2
.
min
.
x
|
0
,
_clearBox2
.
min
.
y
|
0
,
(
_clearBox2
.
max
.
x
-
_clearBox2
.
min
.
x
)
|
0
,
(
_clearBox2
.
max
.
y
-
_clearBox2
.
min
.
y
)
|
0
);
_context
.
fillRect
(
_clearBox
.
min
.
x
|
0
,
_clearBox
.
min
.
y
|
0
,
(
_clearBox
.
max
.
x
-
_clearBox
.
min
.
x
)
|
0
,
(
_clearBox
.
max
.
y
-
_clearBox
.
min
.
y
)
|
0
);
}
_clearBox
2
.
makeEmpty
();
_clearBox
.
makeEmpty
();
}
...
...
@@ -210,7 +210,7 @@ THREE.CanvasRenderer = function ( parameters ) {
/* DEBUG
_context.fillStyle = 'rgba( 0, 255, 255, 0.5 )';
_context.fillRect( _clipBox
2.min.x, _clipBox2.min.y, _clipBox2.max.x - _clipBox2.min.x, _clipBox2.max.y - _clipBox2
.min.y );
_context.fillRect( _clipBox
.min.x, _clipBox.min.y, _clipBox.max.x - _clipBox.min.x, _clipBox.max.y - _clipBox
.min.y );
*/
_enableLighting
=
_lights
.
length
>
0
;
...
...
@@ -229,7 +229,7 @@ THREE.CanvasRenderer = function ( parameters ) {
if
(
material
===
undefined
||
material
.
visible
===
false
)
continue
;
_elemBox
2
.
makeEmpty
();
_elemBox
.
makeEmpty
();
if
(
element
instanceof
THREE
.
RenderableParticle
)
{
...
...
@@ -245,9 +245,9 @@ THREE.CanvasRenderer = function ( parameters ) {
_v1
.
positionScreen
.
x
*=
_canvasWidthHalf
;
_v1
.
positionScreen
.
y
*=
_canvasHeightHalf
;
_v2
.
positionScreen
.
x
*=
_canvasWidthHalf
;
_v2
.
positionScreen
.
y
*=
_canvasHeightHalf
;
_elemBox
2
.
setFromPoints
(
[
_v1
.
positionScreen
,
_v2
.
positionScreen
]
);
_elemBox
.
setFromPoints
(
[
_v1
.
positionScreen
,
_v2
.
positionScreen
]
);
if
(
_clipBox
2
.
isIntersectionBox
(
_elemBox2
)
===
true
)
{
if
(
_clipBox
.
isIntersectionBox
(
_elemBox
)
===
true
)
{
renderLine
(
_v1
,
_v2
,
element
,
material
,
scene
);
...
...
@@ -270,9 +270,9 @@ THREE.CanvasRenderer = function ( parameters ) {
}
_elemBox
2
.
setFromPoints
(
[
_v1
.
positionScreen
,
_v2
.
positionScreen
,
_v3
.
positionScreen
]
);
_elemBox
.
setFromPoints
(
[
_v1
.
positionScreen
,
_v2
.
positionScreen
,
_v3
.
positionScreen
]
);
if
(
_clipBox
2
.
isIntersectionBox
(
_elemBox2
)
===
true
)
{
if
(
_clipBox
.
isIntersectionBox
(
_elemBox
)
===
true
)
{
renderFace3
(
_v1
,
_v2
,
_v3
,
0
,
1
,
2
,
element
,
material
,
scene
);
...
...
@@ -301,9 +301,9 @@ THREE.CanvasRenderer = function ( parameters ) {
}
_elemBox
2
.
setFromPoints
(
[
_v1
.
positionScreen
,
_v2
.
positionScreen
,
_v3
.
positionScreen
,
_v4
.
positionScreen
]
);
_elemBox
.
setFromPoints
(
[
_v1
.
positionScreen
,
_v2
.
positionScreen
,
_v3
.
positionScreen
,
_v4
.
positionScreen
]
);
if
(
_clipBox
2
.
isIntersectionBox
(
_elemBox2
)
===
true
)
{
if
(
_clipBox
.
isIntersectionBox
(
_elemBox
)
===
true
)
{
renderFace4
(
_v1
,
_v2
,
_v3
,
_v4
,
_v5
,
_v6
,
element
,
material
,
scene
);
...
...
@@ -315,17 +315,17 @@ THREE.CanvasRenderer = function ( parameters ) {
/* DEBUG
_context.lineWidth = 1;
_context.strokeStyle = 'rgba( 0, 255, 0, 0.5 )';
_context.strokeRect( _elemBox
2.min.x, _elemBox2.min.y, _elemBox2.max.x - _elemBox2.min.x, _elemBox2.max.y - _elemBox2
.min.y );
_context.strokeRect( _elemBox
.min.x, _elemBox.min.y, _elemBox.max.x - _elemBox.min.x, _elemBox.max.y - _elemBox
.min.y );
*/
_clearBox
2
.
union
(
_elemBox2
);
_clearBox
.
union
(
_elemBox
);
}
/* DEBUG
_context.lineWidth = 1;
_context.strokeStyle = 'rgba( 255, 0, 0, 0.5 )';
_context.strokeRect( _clearBox
2.min.x, _clearBox2.min.y, _clearBox2.max.x - _clearBox2.min.x, _clearBox2.max.y - _clearBox2
.min.y );
_context.strokeRect( _clearBox
.min.x, _clearBox.min.y, _clearBox.max.x - _clearBox.min.x, _clearBox.max.y - _clearBox
.min.y );
*/
_context
.
setTransform
(
1
,
0
,
0
,
1
,
0
,
0
);
...
...
@@ -436,10 +436,10 @@ THREE.CanvasRenderer = function ( parameters ) {
scaleX
*=
element
.
scale
.
x
*
_canvasWidthHalf
;
scaleY
*=
element
.
scale
.
y
*
_canvasHeightHalf
;
_elemBox
2
.
min
.
set
(
v1
.
x
-
scaleX
,
v1
.
y
-
scaleY
);
_elemBox
2
.
max
.
set
(
v1
.
x
+
scaleX
,
v1
.
y
+
scaleY
);
_elemBox
.
min
.
set
(
v1
.
x
-
scaleX
,
v1
.
y
-
scaleY
);
_elemBox
.
max
.
set
(
v1
.
x
+
scaleX
,
v1
.
y
+
scaleY
);
if
(
_clipBox
2
.
isIntersectionBox
(
_elemBox2
)
===
false
)
{
if
(
_clipBox
.
isIntersectionBox
(
_elemBox
)
===
false
)
{
return
;
...
...
@@ -468,10 +468,10 @@ THREE.CanvasRenderer = function ( parameters ) {
// TODO: Rotations break this...
_elemBox
2
.
min
.
set
(
v1
.
x
-
width
,
v1
.
y
-
height
);
_elemBox
2
.
max
.
set
(
v1
.
x
+
width
,
v1
.
y
+
height
);
_elemBox
.
min
.
set
(
v1
.
x
-
width
,
v1
.
y
-
height
);
_elemBox
.
max
.
set
(
v1
.
x
+
width
,
v1
.
y
+
height
);
if
(
_clipBox
2
.
isIntersectionBox
(
_elemBox2
)
===
false
)
{
if
(
_clipBox
.
isIntersectionBox
(
_elemBox
)
===
false
)
{
return
;
...
...
@@ -503,10 +503,10 @@ THREE.CanvasRenderer = function ( parameters ) {
width
=
element
.
scale
.
x
*
_canvasWidthHalf
;
height
=
element
.
scale
.
y
*
_canvasHeightHalf
;
_elemBox
2
.
min
.
set
(
v1
.
x
-
width
,
v1
.
y
-
height
);
_elemBox
2
.
max
.
set
(
v1
.
x
+
width
,
v1
.
y
+
height
);
_elemBox
.
min
.
set
(
v1
.
x
-
width
,
v1
.
y
-
height
);
_elemBox
.
max
.
set
(
v1
.
x
+
width
,
v1
.
y
+
height
);
if
(
_clipBox
2
.
isIntersectionBox
(
_elemBox2
)
===
false
)
{
if
(
_clipBox
.
isIntersectionBox
(
_elemBox
)
===
false
)
{
return
;
...
...
@@ -545,7 +545,7 @@ THREE.CanvasRenderer = function ( parameters ) {
setStrokeStyle
(
material
.
color
.
getStyle
()
);
_context
.
stroke
();
_elemBox
2
.
expandByScalar
(
material
.
linewidth
*
2
);
_elemBox
.
expandByScalar
(
material
.
linewidth
*
2
);
}
...
...
@@ -922,7 +922,7 @@ THREE.CanvasRenderer = function ( parameters ) {
_context
.
stroke
();
_elemBox
2
.
expandByScalar
(
linewidth
*
2
);
_elemBox
.
expandByScalar
(
linewidth
*
2
);
}
...
...
utils/includes/canvas.json
浏览文件 @
7777df42
...
...
@@ -11,7 +11,6 @@
"../src/math/Sphere.js"
,
"../src/math/Plane.js"
,
"../src/math/Frustum.js"
,
"../src/math/Rectangle.js"
,
"../src/math/Math.js"
,
"../src/math/Triangle.js"
,
"../src/math/Quaternion.js"
,
...
...
utils/includes/common.json
浏览文件 @
7777df42
...
...
@@ -11,7 +11,6 @@
"../src/math/Ray.js"
,
"../src/math/Frustum.js"
,
"../src/math/Plane.js"
,
"../src/math/Rectangle.js"
,
"../src/math/Sphere.js"
,
"../src/math/Math.js"
,
"../src/math/Quaternion.js"
,
...
...
utils/includes/math.json
浏览文件 @
7777df42
...
...
@@ -11,7 +11,6 @@
"../src/math/Ray.js"
,
"../src/math/Frustum.js"
,
"../src/math/Plane.js"
,
"../src/math/Rectangle.js"
,
"../src/math/Sphere.js"
,
"../src/math/Math.js"
,
"../src/math/Quaternion.js"
,
...
...
utils/includes/webgl.json
浏览文件 @
7777df42
...
...
@@ -7,7 +7,6 @@
"../src/math/Matrix3.js"
,
"../src/math/Matrix4.js"
,
"../src/math/Frustum.js"
,
"../src/math/Rectangle.js"
,
"../src/math/Math.js"
,
"../src/math/Quaternion.js"
,
"../src/math/Vertex.js"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录