Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Game Library
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
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
Game Development
Game Library
Commits
2f734440
Commit
2f734440
authored
3 years ago
by
Joseph Walton-Rivers
Browse files
Options
Downloads
Patches
Plain Diff
minor code tidying
parent
3f5359f4
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#3095
failed
3 years ago
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
demo/main.cpp
+5
-7
5 additions, 7 deletions
demo/main.cpp
with
5 additions
and
7 deletions
demo/main.cpp
+
5
−
7
View file @
2f734440
...
...
@@ -49,11 +49,9 @@ enum camera_type { cam_free, cam_arcball };
camera_type
cam_mode
=
cam_free
;
//TODO proper input system
using
namespace
fggl
::
input
;
using
InputManager
=
std
::
shared_ptr
<
fggl
::
input
::
Input
>
;
void
process_camera
(
fggl
::
ecs3
::
World
&
ecs
,
InputManager
input
)
{
void
process_camera
(
fggl
::
ecs3
::
World
&
ecs
,
const
InputManager
&
input
)
{
auto
cameras
=
ecs
.
findMatching
<
fggl
::
gfx
::
Camera
>
();
fggl
::
ecs3
::
entity_t
cam
=
cameras
[
0
];
...
...
@@ -148,7 +146,7 @@ public:
fggl
::
data
::
Mesh
mesh
;
for
(
int
j
=-
(
nSections
/
2
);
j
<=
nSections
/
2
;
j
++
)
{
const
auto
shapeOffset
=
glm
::
vec3
(
0.0
f
,
0.0
f
,
j
*
1.0
f
);
const
auto
shapeOffset
=
glm
::
vec3
(
0.0
f
,
0.0
f
,
(
float
)
j
*
1.0
f
);
const
auto
cubeMat
=
glm
::
translate
(
fggl
::
math
::
mat4
(
1.0
f
)
,
shapeOffset
);
const
auto
leftSlope
=
fggl
::
math
::
modelMatrix
(
...
...
@@ -172,7 +170,7 @@ public:
for
(
int
i
=
0
;
i
<
nCubes
;
i
++
)
{
auto
bunkerClone
=
m_world
.
copy
(
bunker
);
auto
result
=
m_world
.
get
<
fggl
::
math
::
Transform
>
(
bunkerClone
);
result
->
origin
(
glm
::
vec3
(
i
*
5.0
f
,
0.0
f
,
0.0
f
)
);
result
->
origin
(
glm
::
vec3
(
(
float
)
i
*
5.0
f
,
0.0
f
,
0.0
f
)
);
}
}
...
...
@@ -191,11 +189,11 @@ public:
}
void
render
()
override
{
debugInspector
();
}
// entity inspector
void
debugInspector
(
bool
*
visible
)
{
void
debugInspector
()
{
auto
types
=
m_world
.
types
();
ImGui
::
Begin
(
"Entities"
);
...
...
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