Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Failframeit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FrameIT
Failframeit
Commits
6182137a
Commit
6182137a
authored
5 years ago
by
John Schihada
Browse files
Options
Downloads
Patches
Plain Diff
Adjusted Angle-Preview to consider possible angles first
parent
599e6f4e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Assets/InteractionEngine/ShinyThings.cs
+26
-4
26 additions, 4 deletions
Assets/InteractionEngine/ShinyThings.cs
with
26 additions
and
4 deletions
Assets/InteractionEngine/ShinyThings.cs
+
26
−
4
View file @
6182137a
...
...
@@ -162,13 +162,35 @@ public void ActivateCurveDrawing(Fact startFact)
public
void
UpdateCurveDrawing
(
Vector3
currentPosition
)
{
//Determine the Start-Point
Vector3
startPoint
=
angleMiddlePoint
+
curveRadius
*
(
currentPosition
-
angleMiddlePoint
).
normalized
;
//Find the nearest of all potential third points
PointFact
nearestPoint
=
null
;
foreach
(
Fact
fact
in
Facts
)
{
if
(
fact
is
PointFact
&&
fact
.
Id
!=
curveDrawingStartLine
.
Pid1
&&
fact
.
Id
!=
curveDrawingStartLine
.
Pid2
&&
nearestPoint
==
null
)
nearestPoint
=
(
PointFact
)
fact
;
else
if
(
fact
is
PointFact
&&
fact
.
Id
!=
curveDrawingStartLine
.
Pid1
&&
fact
.
Id
!=
curveDrawingStartLine
.
Pid2
&&
(
nearestPoint
.
Point
-
currentPosition
).
magnitude
>
(((
PointFact
)
fact
).
Point
-
currentPosition
).
magnitude
)
nearestPoint
=
(
PointFact
)
fact
;
}
Vector3
startPoint
=
new
Vector3
(
0
,
0
,
0
);
if
(
nearestPoint
!=
null
)
{
Vector3
planePoint
=
Vector3
.
ProjectOnPlane
(
currentPosition
,
Vector3
.
Cross
((
nearestPoint
.
Point
-
angleMiddlePoint
),
(
curveEndPoint
-
angleMiddlePoint
)));
//Determine the Start-Point for the nearest third-point
startPoint
=
angleMiddlePoint
+
curveRadius
*
(
planePoint
-
angleMiddlePoint
).
normalized
;
}
else
{
//Determine the Start-Point
startPoint
=
angleMiddlePoint
+
curveRadius
*
(
currentPosition
-
angleMiddlePoint
).
normalized
;
}
//Determine the Center of Start-Point and End-Point
Vector3
tempCenterPoint
=
Vector3
.
Lerp
(
startPoint
,
curveEndPoint
,
0.5f
);
Vector3
curveMiddlePoint
=
angleMiddlePoint
+
curveRadius
*
(
tempCenterPoint
-
angleMiddlePoint
).
normalized
;
linePositions
=
new
List
<
Vector3
>();
//Start: AngleMiddlePoint -> FirstPoint of Curve
linePositions
.
Add
(((
PointFact
)
Facts
.
Find
(
x
=>
x
.
Id
==
curveDrawingStartLine
.
Pid2
)).
Point
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment