Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
three.js-projector
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Дмитрий Никулин
three.js-projector
Commits
3eb25f2b
Commit
3eb25f2b
authored
Jun 20, 2016
by
Дмитрий Никулин
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for priority field
parent
57219920
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
3 deletions
+27
-3
index.js
index.js
+27
-3
No files found.
index.js
View file @
3eb25f2b
...
...
@@ -894,8 +894,19 @@ define(['three'], function(THREE, BSPTree){
});
return
;
}
if
(
comparison
){
if
(
comparison
===
0
){
var
nodePriority
=
BSPTree
.
utils
.
getPriority
(
node
);
var
compareWithPriority
=
BSPTree
.
utils
.
getPriority
(
compareWith
);
if
(
nodePriority
>
compareWithPriority
){
comparison
=
-
1
;
}
else
{
comparison
=
1
;
}
}
if
(
comparison
===
1
){
if
(
!
compareWith
.
back
){
compareWith
.
back
=
node
;
}
else
{
...
...
@@ -930,6 +941,13 @@ define(['three'], function(THREE, BSPTree){
getPointSign
:
function
(
normal
,
point
,
pointOnPlane
){
return
this
.
sign
(
normal
.
dot
(
point
.
clone
().
sub
(
pointOnPlane
)));
},
getPriority
:
function
(
node
){
if
(
typeof
node
.
element
.
priority
===
'number'
){
return
node
.
element
.
priority
;
}
else
{
return
0
;
}
},
isPointInSegment
:
function
(
point
,
p1
,
p2
){
// This function assumes that point lies on the line
// and determines whether it is in line _segment_
...
...
@@ -1004,7 +1022,13 @@ define(['three'], function(THREE, BSPTree){
if
(
thisSign
===
undefined
)
return
undefined
;
return
(
viewerSign
!==
thisSign
);
if
(
thisSign
===
0
)
return
0
;
if
(
viewerSign
!==
thisSign
){
return
1
;
}
else
{
return
-
1
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment