MCPcopy Create free account
hub / github.com/ValveSoftware/steam-audio / commit

Method commit

core/src/core/scene.cpp:122–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120}
121
122void Scene::commit()
123{
124 // If no static/instanced meshes have been added or removed since the last commit(), check to see if any
125 // instanced meshes have had their transforms updated.
126 if (!mHasChanged)
127 {
128 for (const auto& instancedMesh : mInstancedMeshes[0])
129 {
130 if (instancedMesh->hasChanged())
131 {
132 mHasChanged = true;
133 break;
134 }
135 }
136 }
137
138 // If something changed in the scene, increment the version.
139 if (mHasChanged)
140 {
141 mVersion++;
142 }
143
144 mStaticMeshes[0] = mStaticMeshes[1];
145 mInstancedMeshes[0] = mInstancedMeshes[1];
146
147 for (const auto& instancedMesh : mInstancedMeshes[0])
148 {
149 instancedMesh->commit(*this);
150 }
151
152 // Update materials if needed
153 for (const auto& staticMesh : mStaticMeshes[0])
154 {
155 auto phononStaticMesh = static_cast<StaticMesh*>(staticMesh.get());
156 if (phononStaticMesh->isMarkedToUpdateMaterials())
157 {
158 memcpy(phononStaticMesh->materials(), phononStaticMesh->materialsToUpdate().data(), phononStaticMesh->numMaterials() * sizeof(Material));
159 phononStaticMesh->unmarkToUpdateMaterials();
160 }
161 }
162
163 // The scene will be considered unchanged until something is changed subsequently.
164 mHasChanged = false;
165}
166
167uint32_t Scene::version() const
168{

Callers 15

iplSceneCommitFunction · 0.45
iplProbeBatchCommitFunction · 0.45
iplSimulatorCommitFunction · 0.45
iplSceneCommitFunction · 0.45
iplProbeBatchCommitFunction · 0.45
iplSimulatorCommitFunction · 0.45
serializeAsRootMethod · 0.45
serializeAsRootMethod · 0.45
benchmarkVisGraphFunction · 0.45
benchmarkPathFindingFunction · 0.45
BENCHMARKFunction · 0.45

Calls 7

hasChangedMethod · 0.45
getMethod · 0.45
materialsMethod · 0.45
dataMethod · 0.45
numMaterialsMethod · 0.45

Tested by 6

loadMeshFunction · 0.36
ITESTFunction · 0.36
ITESTFunction · 0.36
ITESTFunction · 0.36
ITESTFunction · 0.36
ITESTFunction · 0.36