Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
We have upgraded GitLab to 15.1. Due to major code changes GitLab was down for some time.
Open sidebar
vadere
vadere
Commits
2a856b01
Commit
2a856b01
authored
Jun 29, 2018
by
Daniel Lehmberg
Browse files
Fixes
#87
: the lines were not correctly aligned with the shape. Adding a division by 2
parent
bf7ce0f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
VadereState/src/org/vadere/state/scenario/Stairs.java
View file @
2a856b01
...
...
@@ -52,7 +52,16 @@ public class Stairs extends ScenarioElement {
// subtract one on the left and add one tread depth on the right so that the last and
// next floors gets one tread too
double
x
=
rotatedBounds
.
getMinX
()
-
treadDepth
+
factor
*
(
rotatedBounds
.
getWidth
()
+
treadDepth
*
2
);
// by dividing treadDepth by 2 the lines are centered between the edges
// __________________________________ << upper edge of tread
// ---------------------------------- << line that pedestrians walk on (centered between edges)
// __________________________________ << lower edge of (same) tread
// This is the assumption that pedestrians always step in the middle of a tread.
double
x
=
rotatedBounds
.
getMinX
()
-
treadDepth
/
2
+
factor
*
(
rotatedBounds
.
getWidth
()
+
treadDepth
*
2
);
VPoint
p1
=
new
VPoint
(
x
,
rotatedBounds
.
getMinY
()).
rotate
(
angle
);
VPoint
p2
=
new
VPoint
(
x
,
rotatedBounds
.
getMaxY
()).
rotate
(
angle
);
...
...
Write
Preview
Supports
Markdown
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