Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Bunin, Matvii
PGR_project
Commits
8a512f5c
Commit
8a512f5c
authored
May 23, 2021
by
Bunin, Matvii
Browse files
small bugfix
parent
c1c62f6c
Changes
2
Hide whitespace changes
Inline
Side-by-side
MyEngine/render.cpp
View file @
8a512f5c
...
...
@@ -25,8 +25,8 @@ void Render::bindLightsUBO() {
void
Render
::
processClick
(
int
x
,
int
y
)
{
unsigned
char
objId
=
0
;
glReadPixels
(
x
,
y
,
1
,
1
,
GL_STENCIL_INDEX
,
GL_UNSIGNED_BYTE
,
&
objId
);
if
(
objId
!=
-
1
)
{
bool
&
disabled
=
clickableNodes
->
at
(
objId
)
->
disabled
;
if
(
objId
!=
0
)
{
bool
&
disabled
=
clickableNodes
->
at
(
objId
-
1
)
->
disabled
;
disabled
=
!
disabled
;
}
}
...
...
@@ -74,6 +74,15 @@ void Render::draw() {
return
false
;
}
}
else
{
if
(
a
->
id
==
plId
)
{
return
false
;
}
if
(
b
->
id
==
plId
)
{
return
true
;
}
}
glm
::
vec3
apos
=
a
->
nodes
[
0
]
->
getGlobalPos
();
glm
::
vec3
bpos
=
b
->
nodes
[
0
]
->
getGlobalPos
();
...
...
MyEngine/render_object.cpp
View file @
8a512f5c
...
...
@@ -139,7 +139,7 @@ void RenderObject::render(Camera& camera, GLuint lightsUBO, GLuint fogTexture, g
glStencilOp
(
GL_KEEP
,
GL_KEEP
,
GL_REPLACE
);
for
(
const
auto
&
node
:
nodes
)
{
glStencilFunc
(
GL_ALWAYS
,
node
->
objectId
,
-
1
);
glStencilFunc
(
GL_ALWAYS
,
node
->
objectId
+
1
,
0
);
glUniformMatrix4fv
(
shader
.
uniform
(
"transform.model"
),
1
,
GL_FALSE
,
glm
::
value_ptr
(
node
->
transform
));
...
...
Write
Preview
Markdown
is supported
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