Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nt1100 analyser
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pascal Engeler
nt1100 analyser
Commits
14f33bad
Commit
14f33bad
authored
2 years ago
by
Pascal Engeler
Browse files
Options
Downloads
Patches
Plain Diff
Fixed bug (lmb_click <-> lmb_pressed)
parent
8aae8254
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main.cpp
+3
-3
3 additions, 3 deletions
src/main.cpp
with
3 additions
and
3 deletions
src/main.cpp
+
3
−
3
View file @
14f33bad
...
@@ -44,7 +44,7 @@ int main(int argc, char** argv) {
...
@@ -44,7 +44,7 @@ int main(int argc, char** argv) {
std
::
cout
<<
"Loading Heightmap"
<<
std
::
endl
<<
std
::
flush
;
std
::
cout
<<
"Loading Heightmap"
<<
std
::
endl
<<
std
::
flush
;
heightmaps
.
push_back
(
ResourceManager
::
fetch_heightmap
(
std
::
string
(
HEIGHTMAP_LOC
)
+
"drum1.asc"
));
heightmaps
.
push_back
(
ResourceManager
::
fetch_heightmap
(
std
::
string
(
HEIGHTMAP_LOC
)
+
"drum1.asc"
));
float
zRangeUmReference
=
heightmaps
.
back
()
->
zRangeUm
();
float
zRangeUmReference
=
heightmaps
.
back
()
->
zRangeUm
();
//
positions.push_back(glm::vec3(-0.5, -0.5, 0));
positions
.
push_back
(
glm
::
vec3
(
-
0.5
,
-
0.5
,
0
));
positions
.
push_back
(
glm
::
vec3
(
0.0
,
0.0
,
0
));
positions
.
push_back
(
glm
::
vec3
(
0.0
,
0.0
,
0
));
models
.
push_back
(
glm
::
translate
(
scale_z
(
heightmaps
.
back
()
->
minZ
(),
scale
),
positions
.
back
()));
models
.
push_back
(
glm
::
translate
(
scale_z
(
heightmaps
.
back
()
->
minZ
(),
scale
),
positions
.
back
()));
std
::
cout
<<
"Loading complete"
<<
std
::
endl
<<
std
::
flush
;
std
::
cout
<<
"Loading complete"
<<
std
::
endl
<<
std
::
flush
;
...
@@ -127,7 +127,7 @@ int main(int argc, char** argv) {
...
@@ -127,7 +127,7 @@ int main(int argc, char** argv) {
/*Check if we want to get the height*/
/*Check if we want to get the height*/
float
height_measured
=
NOT_ON_SURFACE
;
float
height_measured
=
NOT_ON_SURFACE
;
if
(
InputState
::
lmb_
click
&&
!
(
ImGui
::
GetIO
().
WantCaptureMouse
))
{
if
(
InputState
::
lmb_
pressed
&&
!
(
ImGui
::
GetIO
().
WantCaptureMouse
))
{
for
(
size_t
i
=
0
;
i
<
heightmaps
.
size
();
++
i
)
{
for
(
size_t
i
=
0
;
i
<
heightmaps
.
size
();
++
i
)
{
height_measured
=
heightmaps
[
i
]
->
getSurfaceHeight
(
InputState
::
umpos_x
,
HEIGHT
-
InputState
::
umpos_y
,
projection
,
view
,
models
[
i
]);
height_measured
=
heightmaps
[
i
]
->
getSurfaceHeight
(
InputState
::
umpos_x
,
HEIGHT
-
InputState
::
umpos_y
,
projection
,
view
,
models
[
i
]);
if
(
height_measured
!=
NOT_ON_SURFACE
)
{
if
(
height_measured
!=
NOT_ON_SURFACE
)
{
...
@@ -147,7 +147,7 @@ int main(int argc, char** argv) {
...
@@ -147,7 +147,7 @@ int main(int argc, char** argv) {
if
(
Leveler
::
fetchingP1
||
Leveler
::
fetchingP2
||
Leveler
::
fetchingP3
)
{
if
(
Leveler
::
fetchingP1
||
Leveler
::
fetchingP2
||
Leveler
::
fetchingP3
)
{
//get highlighting point
//get highlighting point
glm
::
vec2
mowopos
=
camera
.
GetWorldXyFromMouse
(
InputState
::
mpos_x
,
InputState
::
mpos_y
);
glm
::
vec2
mowopos
=
camera
.
GetWorldXyFromMouse
(
InputState
::
mpos_x
,
InputState
::
mpos_y
);
if
(
InputState
::
lmb_
pressed
&&
height_measured
!=
NOT_ON_SURFACE
)
{
//Have new point
if
(
InputState
::
lmb_
click
&&
height_measured
!=
NOT_ON_SURFACE
)
{
//Have new point
Leveler
::
place
(
mowopos
);
Leveler
::
place
(
mowopos
);
}
}
for
(
auto
heightmap
:
heightmaps
)
{
//highlight selection
for
(
auto
heightmap
:
heightmaps
)
{
//highlight selection
...
...
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