|
|
|
|
@ -65,17 +65,24 @@ initEllipseEntity(RenderState* rs,
|
|
|
|
|
TwoBodySystem* system, |
|
|
|
|
u32 num_vertices) |
|
|
|
|
{ |
|
|
|
|
system->e3d = ellipseInit3D(system->ep, num_vertices); |
|
|
|
|
Mesh* m = meshInit(rs->rg_arena, num_vertices, num_vertices, false, true); |
|
|
|
|
vec3 vertex_color = vec3(255, 0, 255); |
|
|
|
|
|
|
|
|
|
for (uint i = 0; i < system->e3d.vert_count; i++) { |
|
|
|
|
m->vertices[i] = system->e3d.vertices[i]; |
|
|
|
|
m->colors[i] = vertex_color; |
|
|
|
|
// FIXME: it might be worth using stack memory here, and in
|
|
|
|
|
// initSatelliteEntity(), so we're not storing basically the same model
|
|
|
|
|
// over and over with just different vertices
|
|
|
|
|
// Could also use a temporary arena maybe?
|
|
|
|
|
e3d = ellipse3DInit(ep, num_vertices); |
|
|
|
|
Mesh* m = meshInit(rs->assets.arena, |
|
|
|
|
num_vertices, |
|
|
|
|
num_vertices, |
|
|
|
|
false, |
|
|
|
|
true); |
|
|
|
|
|
|
|
|
|
for (uint i = 0; i < e3d.vert_count; i++) { |
|
|
|
|
m->vertices[i] = e3d.vertices[i]; |
|
|
|
|
m->colors[i] = DEFAULT_ELLIPSE_COLOR; |
|
|
|
|
m->indices[i] = i; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Model* mdl = modelInitManual(rs->rg_arena, 1, m); |
|
|
|
|
Model* mdl = modelInitManual(rs->assets.arena, 1, m); |
|
|
|
|
RenderGroup* rg = getRenderGroupByName(rs, "manual mesh group"); |
|
|
|
|
Entity* e = getFreeEntity(rg); |
|
|
|
|
initEntity(e, rs->gl_ctx, |
|
|
|
|
@ -115,7 +122,12 @@ initSatelliteEntity(RenderState* rs, const char* name)
|
|
|
|
|
{ |
|
|
|
|
u32 num_vertices = 3; |
|
|
|
|
vec3 vertex_color = vec3(255, 0, 0); |
|
|
|
|
Mesh* m = meshInit(rs->rg_arena, num_vertices, num_vertices, false, true); |
|
|
|
|
Mesh* m = meshInit(rs->assets.arena, |
|
|
|
|
num_vertices, |
|
|
|
|
num_vertices, |
|
|
|
|
false, |
|
|
|
|
true); |
|
|
|
|
|
|
|
|
|
m->vertices[0] = vec3(0, 1, 0); |
|
|
|
|
m->colors[0] = vertex_color; |
|
|
|
|
m->indices[0] = 0; |
|
|
|
|
@ -126,7 +138,7 @@ initSatelliteEntity(RenderState* rs, const char* name)
|
|
|
|
|
m->colors[2] = vertex_color; |
|
|
|
|
m->indices[2] = 2; |
|
|
|
|
|
|
|
|
|
Model* mdl = modelInitManual(rs->rg_arena, 1, m); |
|
|
|
|
Model* mdl = modelInitManual(rs->assets.arena, 1, m); |
|
|
|
|
RenderGroup* rg = getRenderGroupByName(rs, "manual mesh group"); |
|
|
|
|
Entity* e = getFreeEntity(rg); |
|
|
|
|
initEntity(e, rs->gl_ctx, |
|
|
|
|
|