Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
mlz
BornAgain
Commits
05bc5b40
Commit
05bc5b40
authored
6 years ago
by
anikhalder
Browse files
Options
Downloads
Patches
Plain Diff
Add function to set uniform bool value for axis
parent
560513f4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
GUI/ba3d/ba3d/view/program.cpp
+7
-1
7 additions, 1 deletion
GUI/ba3d/ba3d/view/program.cpp
GUI/ba3d/ba3d/view/program.h
+2
-0
2 additions, 0 deletions
GUI/ba3d/ba3d/view/program.h
with
9 additions
and
1 deletion
GUI/ba3d/ba3d/view/program.cpp
+
7
−
1
View file @
05bc5b40
...
...
@@ -54,6 +54,7 @@ void Program::init() {
bindAttributeLocation
(
"vertex"
,
0
);
bindAttributeLocation
(
"normal"
,
1
);
bindAttributeLocation
(
"axiscolor"
,
2
);
link
();
...
...
@@ -65,6 +66,7 @@ void Program::init() {
locColor
=
uniformLocation
(
"color"
);
ambient
=
uniformLocation
(
"ambient"
);
eye
=
uniformLocation
(
"eye"
);
locAxis
=
uniformLocation
(
"axis"
);
release
();
}
...
...
@@ -76,7 +78,7 @@ void Program::set(Camera const& camera) {
setUniformValue
(
eye
,
camera
.
getPos
().
eye
);
}
void
Program
::
set
(
QColor
const
&
color
)
{
void
Program
::
set
(
QColor
const
&
color
)
{
setUniformValue
(
locColor
,
color
);
}
...
...
@@ -88,4 +90,8 @@ void Program::setMatModel(QMatrix4x4 const& mat) {
setUniformValue
(
locMatModel
,
mat
);
}
void
Program
::
setAxis
(
bool
const
&
axis_
)
{
setUniformValue
(
locAxis
,
axis_
);
}
}
// namespace RealSpace
This diff is collapsed.
Click to expand it.
GUI/ba3d/ba3d/view/program.h
+
2
−
0
View file @
05bc5b40
...
...
@@ -37,10 +37,12 @@ private:
void
set
(
QColor
const
&
);
// object color
void
set
(
QMatrix4x4
const
&
);
// set matObject
void
setMatModel
(
QMatrix4x4
const
&
);
// set matModel
void
setAxis
(
bool
const
&
);
bool
doInit
;
int
locMatProj
,
locMatModel
,
locMatObject
;
int
locLightPos1
,
locColor
,
ambient
,
eye
;
int
locAxis
;
};
}
// namespace RealSpace
...
...
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