MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / walkTree

Function walkTree

Source/Engine/CSG/CSGBuilder.cpp:123–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121 typedef Dictionary<Actor*, Mesh*> MeshesLookup;
122
123 bool walkTree(Actor* actor, MeshesArray& meshes, MeshesLookup& cache)
124 {
125 // Check if actor is a brush
126 auto brush = dynamic_cast<Brush*>(actor);
127 if (brush)
128 {
129 // Check if can build it
130 if (brush->CanUseCSG())
131 {
132 // Skip subtract/common meshes from the beginning (they have no effect)
133 if (meshes.Count() > 0 || brush->GetBrushMode() == Mode::Additive)
134 {
135 // Create new mesh and build for given brush
136 auto mesh = New<CSG::Mesh>();
137 mesh->Build(brush);
138
139 // Save results
140 meshes.Add(mesh);
141 cache.Add(actor, mesh);
142 }
143 else
144 {
145 // Info
146 LOG(Info, "Skipping CSG brush '{0}'", actor->ToString());
147 }
148 }
149 }
150
151 return true;
152 }
153
154 Mesh* Combine(Actor* actor, MeshesLookup& cache, Mesh* combineParent)
155 {

Callers

nothing calls this directly

Calls 6

CanUseCSGMethod · 0.80
GetBrushModeMethod · 0.80
CountMethod · 0.45
BuildMethod · 0.45
AddMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected