From a4074b0feb6b2194af7c175fe1826c8e550f10aa Mon Sep 17 00:00:00 2001 From: omniscient <17525998+omnisci3nce@users.noreply.github.com> Date: Fri, 16 Aug 2024 18:54:44 +1000 Subject: cone mesh --- src/render/immdraw.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/render/immdraw.c') diff --git a/src/render/immdraw.c b/src/render/immdraw.c index c2589c3..d352ddf 100644 --- a/src/render/immdraw.c +++ b/src/render/immdraw.c @@ -25,6 +25,9 @@ void Immdraw_Init(Immdraw_Storage* storage) { Geometry plane_geo = Geo_CreatePlane(f32x2(1.0, 1.0), 1, 1); storage->plane = Mesh_Create(&plane_geo, true); + Geometry cone_geo = Geo_CreateCone(1.0, 1.0, 8); + storage->cone = Mesh_Create(&cone_geo, true); + storage->bbox = GenBboxMesh(); // Pipeline / material @@ -78,12 +81,18 @@ void Immdraw_Plane(Transform tf, Vec4 colour, bool wireframe) { Immdraw_Primitive(tf, CEL_TRI, 1.0, colour, wireframe, imm->plane); } -PUB void Immdraw_Bbox(Transform tf, Vec4 colour, bool wireframe) { +void Immdraw_Bbox(Transform tf, Vec4 colour, bool wireframe) { TRACE("Draw bbox"); Immdraw_Storage* imm = Render_GetImmdrawStorage(); Immdraw_Primitive(tf, CEL_LINE, 1.0, colour, wireframe, imm->bbox); } +void Immdraw_Cone(Transform tf, Vec4 colour, bool wireframe) { + TRACE("Draw cone"); + Immdraw_Storage* imm = Render_GetImmdrawStorage(); + Immdraw_Primitive(tf, CEL_TRI, 1.0, colour, wireframe, imm->cone); +} + void Immdraw_Primitive(Transform tf, PrimitiveTopology topology, f32 size, Vec4 colour, bool wireframe, Mesh mesh) { Immdraw_Storage* imm = Render_GetImmdrawStorage(); -- cgit v1.2.3-70-g09d2