MCPcopy Create free account
hub / github.com/crownengine/crown / rect_3d

Method rect_3d

src/world/gui.cpp:166–206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

164}
165
166void Gui::rect_3d(const Matrix4x4 &local_pose, const Vector3 &pos, const Vector2 &size, const Color4 &color, f32 depth)
167{
168 VertexData *vd = (VertexData *)_buffer->vertex_buffer_end();
169 vd[0].pos.x = pos.x;
170 vd[0].pos.y = pos.y;
171 vd[0].pos.z = pos.z;
172 vd[0].uv.x = 0.0f;
173 vd[0].uv.y = 1.0f;
174 vd[0].col = to_abgr(color);
175
176 vd[1].pos.x = pos.x + size.x;
177 vd[1].pos.y = pos.y;
178 vd[1].pos.z = pos.z;
179 vd[1].uv.x = 1.0f;
180 vd[1].uv.y = 1.0f;
181 vd[1].col = to_abgr(color);
182
183 vd[2].pos.x = pos.x + size.x;
184 vd[2].pos.y = pos.y + size.y;
185 vd[2].pos.z = pos.z;
186 vd[2].uv.x = 1.0f;
187 vd[2].uv.y = 0.0f;
188 vd[2].col = to_abgr(color);
189
190 vd[3].pos.x = pos.x;
191 vd[3].pos.y = pos.y + size.y;
192 vd[3].pos.z = pos.z;
193 vd[3].uv.x = 0.0f;
194 vd[3].uv.y = 0.0f;
195 vd[3].col = to_abgr(color);
196
197 u16 *inds = (u16 *)_buffer->index_buffer_end();
198 inds[0] = 0;
199 inds[1] = 1;
200 inds[2] = 2;
201 inds[3] = 0;
202 inds[4] = 2;
203 inds[5] = 3;
204
205 _buffer->submit(4, 6, local_pose*_world, *_gui_shader, _view, depth_u32(depth));
206}
207
208void Gui::rect(const Vector3 &pos, const Vector2 &size, const Color4 &color)
209{

Callers 1

load_apiFunction · 0.80

Calls 4

depth_u32Function · 0.85
vertex_buffer_endMethod · 0.80
index_buffer_endMethod · 0.80
submitMethod · 0.45

Tested by

no test coverage detected