Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
GameDevWeek
Sommersemester 2019
Cpp
PhaseShifter
Commits
b70d11a4
Commit
b70d11a4
authored
Sep 19, 2019
by
Kevin Balz
Browse files
Merge branch 'develop' into feature/8-beat-detection
parents
1296e68c
f8a2378d
Pipeline
#3293
passed with stage
in 3 minutes and 54 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/gameplay/movement_system.cpp
View file @
b70d11a4
...
...
@@ -87,14 +87,15 @@ namespace phase_shifter::gameplay {
auto
offset
=
-
move
.
last_step
*
t0
+
move
.
last_step
*
t1
;
auto
pos
=
glm
::
vec2
(
transform
.
position
.
x
,
transform
.
position
.
z
);
auto
entity_handle
=
entity
.
handle
();
entity
.
process
([
&
](
Rigid_body_comp
&
body
)
{
_level_system
.
check_contacts
(
pos
+
offset
,
body
.
radius
,
[
&
](
util
::
Contact
contact
)
{
if
(
contact
.
distance2
<=
0.0001
f
)
{
offset
=
glm
::
vec2
(
0
,
0
);
_bus
.
send
<
Entity_hit_wall
>
(
entity
.
handle
()
);
_bus
.
send
<
Entity_hit_wall
>
(
entity
_
handle
);
}
else
if
(
auto
normal_vel
=
glm
::
dot
(
offset
,
contact
.
normal
);
normal_vel
>
0
)
{
offset
-=
normal_vel
*
contact
.
normal
;
_bus
.
send
<
Entity_hit_wall
>
(
entity
.
handle
()
);
_bus
.
send
<
Entity_hit_wall
>
(
entity
_
handle
);
}
});
});
...
...
src/level/level_system.cpp
View file @
b70d11a4
...
...
@@ -125,19 +125,19 @@ namespace phase_shifter::level {
auto
min_x
=
std
::
clamp
(
static_cast
<
std
::
size_t
>
(
std
::
floor
(
origin
.
x
/
tile_size
-
radius
/
tile_size
-
0.5
f
)),
(
std
::
size_t
)
0
,
static_cast
<
std
::
size_t
>
(
0
)
,
level_size_x
-
1
);
auto
min_y
=
std
::
clamp
(
static_cast
<
std
::
size_t
>
(
std
::
floor
(
origin
.
y
/
tile_size
-
radius
/
tile_size
-
0.5
f
)),
(
std
::
size_t
)
0
,
static_cast
<
std
::
size_t
>
(
0
)
,
level_size_y
-
1
);
auto
max_x
=
std
::
clamp
(
static_cast
<
std
::
size_t
>
(
std
::
ceil
(
origin
.
x
/
tile_size
+
radius
/
tile_size
+
0.5
f
)),
(
std
::
size_t
)
0
,
static_cast
<
std
::
size_t
>
(
0
)
,
level_size_x
-
1
);
auto
max_y
=
std
::
clamp
(
static_cast
<
std
::
size_t
>
(
std
::
ceil
(
origin
.
y
/
tile_size
+
radius
/
tile_size
+
0.5
f
)),
(
std
::
size_t
)
0
,
static_cast
<
std
::
size_t
>
(
0
)
,
level_size_y
-
1
);
for
(
auto
y
=
min_y
;
y
<=
max_y
;
y
++
)
{
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment