goat3d

diff src/goat3d.h @ 25:d0260d80ae09

adding the nodes interface, and continuing the max plugin
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 28 Sep 2013 19:12:50 +0300
parents b35427826b60
children 1c601bf07b86
line diff
     1.1 --- a/src/goat3d.h	Sat Sep 28 06:32:00 2013 +0300
     1.2 +++ b/src/goat3d.h	Sat Sep 28 19:12:50 2013 +0300
     1.3 @@ -25,6 +25,12 @@
     1.4  	NUM_GOAT3D_MESH_ATTRIBS
     1.5  };
     1.6  
     1.7 +enum goat3d_node_type {
     1.8 +	GOAT3D_NODE_MESH,
     1.9 +	GOAT3D_NODE_LIGHT,
    1.10 +	GOAT3D_NODE_CAMERA
    1.11 +};
    1.12 +
    1.13  /* immediate mode mesh construction primitive type */
    1.14  enum goat3d_im_primitive {
    1.15  	GOAT3D_TRIANGLES,
    1.16 @@ -158,6 +164,32 @@
    1.17  int goat3d_get_mesh_count(struct goat3d *g);
    1.18  struct goat3d_mesh *goat3d_get_mesh(struct goat3d *g, int idx);
    1.19  
    1.20 +/* nodes */
    1.21 +struct goat3d_node *goat3d_create_node(void);
    1.22 +
    1.23 +void goat3d_set_node_name(struct goat3d_node *node, const char *name);
    1.24 +const char *goat3d_get_node_name(struct goat3d_node *node);
    1.25 +
    1.26 +void goat3d_set_node_object(struct goat3d_node *node, enum goat3d_node_type type, void *obj);
    1.27 +void *goat3d_get_node_object(struct goat3d_node *node);
    1.28 +enum goat3d_node_type goat3d_get_node_type(struct goat3d_node *node);
    1.29 +
    1.30 +void goat3d_add_node_child(struct goat3d_node *node, struct goat3d_node *child);
    1.31 +int goat3d_get_node_child_count(struct goat3d_node *node);
    1.32 +struct goat3d_node *goat3d_get_node_child(struct goat3d_node *node, int idx);
    1.33 +
    1.34 +void goat3d_set_node_position(struct goat3d_node *node, float x, float y, float z, long tmsec);
    1.35 +void goat3d_set_node_rotation(struct goat3d_node *node, float qx, float qy, float qz, float qw, long tmsec);
    1.36 +void goat3d_set_node_scaling(struct goat3d_node *node, float sx, float sy, float sz, long tmsec);
    1.37 +void goat3d_set_node_pivot(struct goat3d_node *node, float px, float py, float pz);
    1.38 +
    1.39 +void goat3d_get_node_position(struct goat3d_node *node, float *xptr, float *yptr, float *zptr, long tmsec);
    1.40 +void goat3d_get_node_rotation(struct goat3d_node *node, float *xptr, float *yptr, float *zptr, float *wptr, long tmsec);
    1.41 +void goat3d_get_node_scaling(struct goat3d_node *node, float *xptr, float *yptr, float *zptr, long tmsec);
    1.42 +void goat3d_get_node_pivot(struct goat3d_node *node, float *xptr, float *yptr, float *zptr);
    1.43 +
    1.44 +void goat3d_get_node_matrix(struct goat3d_node *node, float *matrix, long tmsec);
    1.45 +
    1.46  #ifdef __cplusplus
    1.47  }
    1.48  #endif