-- Leo's gemini proxy

-- Connecting to git.thebackupbox.net:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

repo: hackvr
action: commit
revision:
path_from:
revision_from: 6148145ea75d2fceb9a57bafea8c9e0122bdf8c2:
path_to:
revision_to:

git.thebackupbox.net

hackvr

git://git.thebackupbox.net/hackvr

commit 6148145ea75d2fceb9a57bafea8c9e0122bdf8c2
Author: epoch <epoch@hacking.allowed.org>
Date:   Wed Jun 3 04:16:16 2020 -0500

    added the "subsume" command

diff --git a/src/common.h b/src/common.h

index eff423d1b4e3edb7ddcae1ad8510470c34862e1f..

index ..99ac1fac46befd4581a974e70d923b946268a6b7 100644

--- a/src/common.h
+++ b/src/common.h
@@ -50,11 +50,12 @@ typedef struct {

 typedef struct {
   char *id;//for the camera this is $USER, right?
+  char *parent;//the position is relative to the parent's data.
   c3_rot_t r;//rotation
   c3_t p;//position
   c3_t s;//??? shape??? I dunno. really. wtf was this for? PROBABLY SCALE. DUH. that's what it is going to bed used for now anyway.
   c3_t v;//velocity
-} c3_group_rot_t;
+} c3_group_rel_t;

 //typedef struct c3_line {//is this even used? I think I just use c3_s_t with 2 points.
 // char *id;
@@ -112,8 +113,8 @@ struct hvr_global {
   struct c3_shape *shape[SHAPES];
   int shapes;
   struct hashtable ht_group;
-  c3_group_rot_t eye[MAX_SIDES];//lol. 1000 eyes! array of group_rots for each eye. how to arrange eyes?
-  c3_group_rot_t camera;//should there be an array for this? camera has .s which is a shape struct. each point is the eye?
+  c3_group_rel_t eye[MAX_SIDES];//lol. 1000 eyes! array of group_rels for each eye. how to arrange eyes?
+  c3_group_rel_t camera;//should there be an array for this? camera has .s which is a shape struct. each point is the eye?
   real zoom;
   int derp;
   real split;
diff --git a/src/graphics_c3.h b/src/graphics_c3.h

index 7ea5c74d82ca4e9f80a1559903c75ceeba9dddbe..

index ..ce3354cad6234beedf58e6982c8319f8a8cb8fdb 100644

--- a/src/graphics_c3.h
+++ b/src/graphics_c3.h
@@ -44,7 +44,7 @@ void draw_screen();
 void set_aspect_ratio();
 void recalculate_eyes();
 int selfcommand(char *s);
-cs_t c3_to_cs(c3_group_rot_t eye,c3_t p);
+cs_t c3_to_cs(c3_group_rel_t eye,c3_t p);
 radians d2r(degrees d);
 real shitdist(struct c3_shape *s,c3_t p);
 c3_t rotate_c3_xr(c3_t p1,c3_t p2,radians xr);
diff --git a/src/hackvr.c b/src/hackvr.c

index f2bc438fb50960391396e8133fb7c6656c05e0be..

index ..b789dbe16b9772205ae952d5cd5bc3b60c4ac776 100644

--- a/src/hackvr.c
+++ b/src/hackvr.c
@@ -155,7 +155,7 @@ int hackvr_handler(char *line) {
   int len;
   int j,i,k,l;
   unsigned int key_count;
-  c3_group_rot_t *gr;
+  c3_group_rel_t *gr;
   real tmpx,tmpy,tmpz;
   char **a;
   char **keys;
@@ -226,7 +226,7 @@ int hackvr_handler(char *line) {
         global.shape[k]=global.shape[l];
         global.shape[l]=0;
       }
-      //now do the same stuff but for the group_rot structs.
+      //now do the same stuff but for the group_rel structs.
       keys=ht_getkeys(&global.ht_group,&key_count);
       for(i=0;i<key_count;i++) {
         if((m=ht_getentry(&global.ht_group,keys[i]))) {
@@ -305,7 +305,7 @@ int hackvr_handler(char *line) {

 /* ---------- */
   if(helping) fprintf(stderr,"#   assimilate grou*\n");
-  if(!strcmp(command,"assimilate")) {//um... what do we do with the group_rotation? flatten it?
+  if(!strcmp(command,"assimilate")) {//um... what do we do with the group_relative? flatten it?
    if(len == 3) {
     for(j=0;global.shape[j];j++) {
      if(!glob_match(a[2],global.shape[j]->id)) {
@@ -443,6 +443,15 @@ int hackvr_handler(char *line) {
   }


+/* ---------- */
+  if(helping) fprintf(stderr,"#   subsume child-group\n");
+  if(!strcmp(command,"subsume")) {
+   gr=get_group_relative(a[2]);//we need the child's group relative...
+   gr->parent = gr->id;
+   ret=0;
+   return ret;
+  }
+
 /* ---------- */
   if(helping) fprintf(stderr,"#   addshape color N x1 y1 z1 ... xN yN zN\n");
   if(!strcmp(command,"addshape")) {
@@ -639,7 +648,7 @@ int hackvr_handler(char *line) {
    fprintf(stderr,"# * move [+]x [+]y [+]z\n");
    fprintf(stderr,"# * move forward|backward|up|down|left|right\n");
   }
-  if(!strcmp(command,"move")) {//this is only moving the first group_rot it finds instead of all group_rots that match the pattern
+  if(!strcmp(command,"move")) {//this is only moving the first group_rel it finds instead of all group_rels that match the pattern
    if(len > 2) {
     gr=get_group_relative(id);
    }
@@ -673,10 +682,8 @@ int hackvr_handler(char *line) {
      tmprady=d2r((degrees){global.camera.r.y.d+180});
     } else if(!strcmp(a[2],"up")) {
      tmprady=(radians){0};
-     tmpy=WALK_SPEED*1;
     } else if(!strcmp(a[2],"down")) {
      tmprady=(radians){0};
-     tmpy=-WALK_SPEED*1;
     } else if(!strcmp(a[2],"left")) {
      tmprady=d2r((degrees){global.camera.r.y.d+270});
     } else if(!strcmp(a[2],"right")) {
diff --git a/src/math.h b/src/math.h

index b333767520b370dbf78716bd082fb0af6367e690..

index ..9c69599038ca230760284875b5d4e903079f160f 100644

--- a/src/math.h
+++ b/src/math.h
@@ -14,12 +14,12 @@ c2_t rotate_c2(c2_t p1,c2_t p2,radians dr);
 c3_t rotate_c3_xr(c3_t p1,c3_t p2,radians xr);
 c3_t rotate_c3_yr(c3_t p1,c3_t p2,radians yr);
 c3_t rotate_c3_zr(c3_t p1,c3_t p2,radians zr);
-c3_group_rot_t *get_group_relative(char *id);
+c3_group_rel_t *get_group_relative(char *id);
 radians d2r(degrees d);
 degrees r2d(radians r);
 radians points_to_angle(c2_t p1,c2_t p2);
 int between_angles(degrees d,real lower,real upper);
-c3_s_t apply_group_relative(c3_s_t s,c3_group_rot_t *group_rot);
+c3_s_t apply_group_relative(c3_s_t s,c3_group_rel_t *group_rel);
 c3_t c3_add(c3_t p1,c3_t p2);
 c2_t c2_add(c2_t p1,c2_t p2);
 real distance3(c3_t p1,c3_t p2);

-----END OF PAGE-----

-- Response ended

-- Page fetched on Sun Jun 2 14:40:50 2024