From 5d5b97c95fad361b5f7e1014683d4c13cdbcae31 Mon Sep 17 00:00:00 2001 From: epoch Date: Wed, 7 Feb 2018 00:20:55 -0600 Subject: added ability for shapes to rotate around the z-axis in addition to y-axis --- src/graphics_c3.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/graphics_c3.c b/src/graphics_c3.c index 2a275bb..1b59827 100644 --- a/src/graphics_c3.c +++ b/src/graphics_c3.c @@ -204,8 +204,12 @@ void draw_c3_shape(c3_s_t s) {//outlined. needs to be filled? //draw minimap shi c3_group_rot_t *gr=get_group_rotation(s.id); if(s.len > 1) { for(i=0;ip,rotate_c3_yr(s.p[i],gr->p,d2r(gr->r.y))):s.p[i]); - //s2.p[i]=c3_to_c2(s.p[i]); + if(gr) { + //s2.p[i]=c3_add(gr->p,rotate_c3_yr(s.p[i],gr->p,d2r(gr->r.y))); + s2.p[i]=c3_add(gr->p,rotate_c3_yr(rotate_c3_zr(s.p[i],gr->p,d2r(gr->r.z)),gr->p,d2r(gr->r.y))); + } else { + s2.p[i]=s.p[i]; + } } } if(s.len == 1) { @@ -525,7 +529,7 @@ int graphics_init() { global.mmz=1;//this is minimap zoom. global.shape[0]=0;//we'll allocate as we need more. - global.camera.id=global.user; + global.camera.id=strdup(global.user);//make a copy so if we change global.user later we can reattach to this camera. global.group_rot[0]=&global.camera; global.group_rot[1]=0; -- cgit v1.2.3