FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
SolarSystem/Scene/MaterialObjects/diffuseobject.cpp at dev · Instand/SolarSystem · GitHub
Instand
/
SolarSystem
Public
Notifications
You must be signed in to change notification settings
Fork
12
Star
44
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
SolarSystem
/
Scene
/
MaterialObjects
/
diffuseobject.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
30 lines (24 loc) · 1.08 KB
Breadcrumbs
SolarSystem
/
Scene
/
MaterialObjects
/
diffuseobject.cpp
Copy path
File metadata and controls
30 lines (24 loc) · 1.08 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#
include
"
diffuseobject.h
"
#
include
<
QTextureWrapMode
>
#
include
<
QAbstractTexture
>
SolarSystem::DiffuseObject::DiffuseObject
(Qt3DCore::QNode* parent):
Object3D(parent)
{
m_materialType = SolarMaterials::Diffuse;
m_material =
new
Qt3DExtras::QDiffuseMapMaterial
();
auto
mat = qobject_cast<Qt3DExtras::QDiffuseMapMaterial*>(m_material);
Qt3DRender::QTextureWrapMode wrapMode;
wrapMode.
setX
(Qt3DRender::QTextureWrapMode::WrapMode::Repeat);
wrapMode.
setY
(Qt3DRender::QTextureWrapMode::WrapMode::Repeat);
wrapMode.
setZ
(Qt3DRender::QTextureWrapMode::WrapMode::Repeat);
mat->
diffuse
()->
setWrapMode
(wrapMode);
mat->
diffuse
()->
setGenerateMipMaps
(
true
);
mat->
diffuse
()->
setMagnificationFilter
(Qt3DRender::QAbstractTexture::Linear);
mat->
diffuse
()->
setMinificationFilter
(Qt3DRender::QAbstractTexture::LinearMipMapLinear);
mat->
diffuse
()->
setMaximumAnisotropy
(
16
.
0f
);
mat->
setShininess
(
10000000
);
mat->
setSpecular
(
QColor
(
qRgba
(
0
,
0
,
0
,
255
)));
mat->
setAmbient
(
QColor
(
qRgba
(
10
,
10
,
10
,
255
)));
mat->
setTextureScale
(
1
.
0f
);
addComponent
(m_material);
}
Back
|
FazBrowse Home
|
New Git URL