PeriDyno 1.0.0
Loading...
Searching...
No Matches
TextureMesh.h
Go to the documentation of this file.
1
16
17#pragma once
18
21
22
23namespace dyno
24{
25 // simple PBR material model
26 class Material : public Object
27 {
28 public:
30 ~Material() override {
31 texColor.clear();
32 texBump.clear();
33 };
34
35 public:
36
37 Vec3f baseColor = { 0.8f, 0.8f, 0.8f };
38
39 float metallic = 0.0f;
40 float roughness = 1.0f;
41 float alpha = 1.0f;
42
44
46 float bumpScale = 1.f;
47 };
48
69
71 {
72 public:
74 ~TextureMesh() override;
75
80
81 std::vector<std::shared_ptr<Shape>>& shapes() { return mShapes; }
82 std::vector<std::shared_ptr<Material>>& materials() { return mMaterials; }
83
84 void merge(const std::shared_ptr<TextureMesh>& texMesh01, const std::shared_ptr<TextureMesh>& texMesh02);
85
86 void clear();
87
88 private:
93
94 std::vector<std::shared_ptr<Material>> mMaterials;
95 std::vector<std::shared_ptr<Shape>> mShapes;
96 };
97};
DArray2D< Vec4f > texColor
Definition TextureMesh.h:43
DArray2D< Vec4f > texBump
Definition TextureMesh.h:45
~Material() override
Definition TextureMesh.h:30
Transform3f boundingTransform
Definition TextureMesh.h:64
~Shape() override
Definition TextureMesh.h:53
DArray< TopologyModule::Triangle > texCoordIndex
Definition TextureMesh.h:61
DArray< TopologyModule::Triangle > normalIndex
Definition TextureMesh.h:60
std::shared_ptr< Material > material
Definition TextureMesh.h:66
DArray< TopologyModule::Triangle > vertexIndex
Definition TextureMesh.h:59
TAlignedBox3D< Real > boundingBox
Definition TextureMesh.h:63
DArray< uint > & shapeIds()
Definition TextureMesh.h:79
DArray< Vec2f > & texCoords()
Definition TextureMesh.h:78
DArray< Vec2f > mTexCoords
Definition TextureMesh.h:91
DArray< Vec3f > & vertices()
Definition TextureMesh.h:76
std::vector< std::shared_ptr< Material > > & materials()
Definition TextureMesh.h:82
void merge(const std::shared_ptr< TextureMesh > &texMesh01, const std::shared_ptr< TextureMesh > &texMesh02)
DArray< uint > mShapeIds
Definition TextureMesh.h:92
std::vector< std::shared_ptr< Shape > > & shapes()
Definition TextureMesh.h:81
DArray< Vec3f > & normals()
Definition TextureMesh.h:77
DArray< Vec3f > mNormals
Definition TextureMesh.h:90
std::vector< std::shared_ptr< Material > > mMaterials
Definition TextureMesh.h:94
~TextureMesh() override
std::vector< std::shared_ptr< Shape > > mShapes
Definition TextureMesh.h:95
DArray< Vec3f > mVertices
Definition TextureMesh.h:89
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25
Array< T, DeviceType::GPU > DArray
Definition Array.inl:89
Array2D< T, DeviceType::GPU > DArray2D
Definition Array2D.inl:90
Transform< float, 3 > Transform3f
Vector< float, 3 > Vec3f
Definition Vector3D.h:93