nuclear@2: #ifndef TGI_SHAPE_H_ nuclear@2: #define TGI_SHAPE_H_ nuclear@2: nuclear@2: #include "tinygi.h" nuclear@2: #include "vmath/vmath.h" nuclear@2: nuclear@2: struct tgi_hitpoint { nuclear@2: float t; nuclear@2: ray_t ray, local_ray; nuclear@2: vec3_t pos, norm; nuclear@2: vec2_t uv; nuclear@2: struct tgi_shape *shape; nuclear@2: }; nuclear@2: nuclear@2: struct tgi_shape { nuclear@2: void *data; /* shape-specific data */ nuclear@2: struct tgi_object *obj; nuclear@2: nuclear@2: int (*intersect)(struct tgi_shape *shape, ray_t ray, struct tgi_hitpoint *hit); nuclear@2: }; nuclear@2: nuclear@2: struct tgi_sphere_data { nuclear@2: vec3_t pos; nuclear@2: float rad; nuclear@2: }; nuclear@2: nuclear@2: struct tgi_box_data { nuclear@2: vec3_t vmin, vmax; nuclear@2: }; nuclear@2: nuclear@2: #endif /* TGI_SHAPE_H_ */