MCPcopy Create free account
hub / github.com/JeanPhilippeKernel/RendererEngine / CreateSquare

Method CreateSquare

ZEngine/src/MeshBuilder.cpp:165–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163 }
164
165 Mesh* MeshBuilder::CreateSquare(const Vector2& position, const Vector2& size, float angle) {
166 Mesh* mesh = new Mesh{};
167 SquareGeometry* quad_geometry = new SquareGeometry({position.x, position.y, 0.0f}, {size.x, size.y, 0.0f}, Vector3(0.0f, 0.0f, 1.0f), angle);
168 Texture* texture = CreateTexture(1, 1);
169 StandardMaterial* material = new StandardMaterial{};
170
171 material->SetTexture(texture);
172 mesh->SetGeometry(quad_geometry);
173 mesh->SetMaterial(material);
174 return mesh;
175 }
176
177 Mesh* MeshBuilder::CreateSquare(const Vector2& position, const Vector2& size, const Vector3& color, float angle) {
178 Mesh* mesh = CreateSquare(position, size, angle);

Callers

nothing calls this directly

Calls 5

CreateTextureFunction · 0.85
SetGeometryMethod · 0.80
SetMaterialMethod · 0.80
SetTextureMethod · 0.45
SetDataMethod · 0.45

Tested by

no test coverage detected