Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OP72
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
template admin
OP72
Commits
695f22b7
Commit
695f22b7
authored
Jan 12, 2023
by
limingzhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 斜圈展示
parent
422dcecd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
91 additions
and
64 deletions
+91
-64
.DS_Store
.DS_Store
+0
-0
OP72.meta
assets/OP72.meta
+15
-1
OP72.js
assets/OP72/scene/OP72.js
+58
-45
OP72_util.js
assets/OP72/script/OP72_util.js
+18
-18
No files found.
.DS_Store
View file @
695f22b7
No preview for this file type
assets/OP72.meta
View file @
695f22b7
{"ver":"1.1.2","uuid":"62f3ac14-b21c-45c1-adfc-93c1ec87ab00","isBundle":false,"bundleName":"","priority":1,"compressionType":{},"optimizeHotUpdate":{},"inlineSpriteFrames":{},"isRemoteBundle":{"ios":false,"android":false},"subMetas":{}}
\ No newline at end of file
{
"ver": "1.1.2",
"uuid": "62f3ac14-b21c-45c1-adfc-93c1ec87ab00",
"isBundle": false,
"bundleName": "",
"priority": 1,
"compressionType": {},
"optimizeHotUpdate": {},
"inlineSpriteFrames": {},
"isRemoteBundle": {
"ios": false,
"android": false
},
"subMetas": {}
}
\ No newline at end of file
assets/OP72/scene/OP72.js
View file @
695f22b7
This source diff could not be displayed because it is too large. You can
view the blob
instead.
assets/OP72/script/OP72_util.js
View file @
695f22b7
...
...
@@ -18,24 +18,24 @@ export function getAngleByPos(px, py, mx, my) {
const
radina
=
Math
.
acos
(
cos
);
// 用反三角函数求弧度
let
angle
=
Math
.
floor
(
180
/
(
Math
.
PI
/
radina
)
*
100
)
/
100
;
// 将弧度转换成角度
if
(
mx
>
px
&&
my
>
py
)
{
// 鼠标在第四象限
angle
=
180
-
angle
;
}
if
(
mx
===
px
&&
my
>
py
)
{
// 鼠标在y轴负方向上
angle
=
180
;
}
if
(
mx
>
px
&&
my
===
py
)
{
// 鼠标在x轴正方向上
angle
=
90
;
}
if
(
mx
<
px
&&
my
>
py
)
{
// 鼠标在第三象限
angle
=
180
+
angle
;
}
if
(
mx
<
px
&&
my
===
py
)
{
// 鼠标在x轴负方向
angle
=
270
;
}
if
(
mx
<
px
&&
my
<
py
)
{
// 鼠标在第二象限
angle
=
360
-
angle
;
}
//
if (mx > px && my > py) {// 鼠标在第四象限
//
angle = 180 - angle;
//
}
//
if (mx === px && my > py) {// 鼠标在y轴负方向上
//
angle = 180;
//
}
//
if (mx > px && my === py) {// 鼠标在x轴正方向上
//
angle = 90;
//
}
//
if (mx < px && my > py) {// 鼠标在第三象限
//
angle = 180 + angle;
//
}
//
if (mx < px && my === py) {// 鼠标在x轴负方向
//
angle = 270;
//
}
//
if (mx < px && my < py) {// 鼠标在第二象限
//
angle = 360 - angle;
//
}
// console.log('angle: ', angle);
return
angle
;
...
...
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