From 3037c067f2937b68bfd0c7f906f7e7ecadd4b8d5 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Thu, 15 Apr 2010 00:06:22 -0400 Subject: Add transformations to textures and pigments. Also, object intersection callbacks are now responsible for handling their own transformations. --- libdimension/dimension/texture.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'libdimension/dimension/texture.h') diff --git a/libdimension/dimension/texture.h b/libdimension/dimension/texture.h index 70cfdc5..91dda23 100644 --- a/libdimension/dimension/texture.h +++ b/libdimension/dimension/texture.h @@ -42,6 +42,9 @@ struct dmnsn_pigment { dmnsn_pigment_fn *pigment_fn; dmnsn_free_fn *free_fn; + /* Transformation matrix */ + dmnsn_matrix trans, trans_inv; + /* Generic pointer */ void *ptr; }; @@ -49,6 +52,8 @@ struct dmnsn_pigment { dmnsn_pigment *dmnsn_new_pigment(); void dmnsn_delete_pigment(dmnsn_pigment *pigment); +void dmnsn_pigment_precompute(dmnsn_pigment *pigment); + /* * Finishes */ @@ -91,11 +96,17 @@ void dmnsn_delete_finish(dmnsn_finish *finish); */ typedef struct { + /* Texture components */ dmnsn_pigment *pigment; dmnsn_finish *finish; + + /* Transformation matrix */ + dmnsn_matrix trans, trans_inv; } dmnsn_texture; dmnsn_texture *dmnsn_new_texture(); void dmnsn_delete_texture(dmnsn_texture *texture); +void dmnsn_texture_precompute(dmnsn_texture *texture); + #endif /* DIMENSION_TEXTURE_H */ -- cgit v1.2.3