MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / isCompiled

Method isCompiled

engine/Poseidon/World/Model/Model.cpp:165–198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163}
164
165bool Model::isCompiled() const
166{
167 if (lodLevels.empty())
168 {
169 return false;
170 }
171
172 bool hasAnyGeometry = false;
173
174 for (const auto& lod : lodLevels)
175 {
176 const auto& mesh = lod.mesh;
177
178 // Special LODs like hitpoints may be empty
179 if (mesh.vertices.empty() && mesh.triangles.empty())
180 {
181 continue;
182 }
183
184 if (mesh.HasGeometry())
185 {
186 hasAnyGeometry = true;
187
188 if (mesh.boundingSphere.radius <= 0.0f)
189 {
190 return false;
191 }
192 }
193
194 // Point-only LODs (e.g., hitpoints) may have vertices without triangles — valid
195 }
196
197 return !hasAnyGeometry || boundingSphere.radius > 0.0f;
198}
199
200} // namespace Poseidon::Model

Calls 2

emptyMethod · 0.45
HasGeometryMethod · 0.45

Tested by 1

InspectShadowFunction · 0.64