Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
KennethVanhoey
CGoGN
Commits
84dbb3d7
Commit
84dbb3d7
authored
Oct 03, 2012
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug in pickable & updatemtrices form GL
parent
d90a7c09
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
2 deletions
+15
-2
include/Utils/GLSLShader.h
include/Utils/GLSLShader.h
+2
-0
include/Utils/pickables.h
include/Utils/pickables.h
+5
-0
src/Utils/GLSLShader.cpp
src/Utils/GLSLShader.cpp
+2
-2
src/Utils/pickables.cpp
src/Utils/pickables.cpp
+6
-0
No files found.
include/Utils/GLSLShader.h
View file @
84dbb3d7
...
...
@@ -408,6 +408,8 @@ public:
static
void
pushTransfo
()
{
s_current_matrices
->
pushTransfo
();}
/// pop transformation matrix
static
void
popTransfo
()
{
s_current_matrices
->
popTransfo
();}
// apply a transformation given by its matrix
static
void
applyTransfo
(
const
glm
::
mat4
&
m
)
{
s_current_matrices
->
apply
(
m
);}
};
...
...
include/Utils/pickables.h
View file @
84dbb3d7
...
...
@@ -193,6 +193,11 @@ public:
*/
void
draw
();
/**
* draw without applying transformation
*/
void
drawNoTransfo
();
/**
* return a ref on the transformation matrix
*/
...
...
src/Utils/GLSLShader.cpp
View file @
84dbb3d7
...
...
@@ -1085,8 +1085,8 @@ void GLSLShader::updateAllFromGLMatrices()
glGetDoublev
(
GL_MODELVIEW_MATRIX
,
modelview
);
glGetDoublev
(
GL_PROJECTION_MATRIX
,
projection
);
glm
::
mat4
model
;
glm
::
mat4
proj
;
glm
::
mat4
&
model
=
currentModelView
()
;
glm
::
mat4
&
proj
=
currentProjection
()
;
for
(
unsigned
int
i
=
0
;
i
<
4
;
++
i
)
{
...
...
src/Utils/pickables.cpp
View file @
84dbb3d7
...
...
@@ -163,6 +163,12 @@ void Pickable::draw()
Utils
::
GLSLShader
::
updateCurrentMatrices
();
}
void
Pickable
::
drawNoTransfo
()
{
m_drawable
->
draw
();
}
glm
::
mat4
&
Pickable
::
transfo
()
{
...
...
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