summaryrefslogtreecommitdiffstats
path: root/libdimension/dimension/object.h
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2010-11-06 02:08:32 -0400
committerTavian Barnes <tavianator@gmail.com>2010-11-06 02:08:32 -0400
commitb6f1834ac17a11c38091ae0c60e53f8f6320b019 (patch)
treeeb27bf99fbfa38382c3ddd07da03cfab0453deab /libdimension/dimension/object.h
parent120c523adc70af185b743e955837e1fe9e9a6785 (diff)
downloaddimension-b6f1834ac17a11c38091ae0c60e53f8f6320b019.tar.xz
Factor out transformation code from object callbacks.
Diffstat (limited to 'libdimension/dimension/object.h')
-rw-r--r--libdimension/dimension/object.h20
1 files changed, 5 insertions, 15 deletions
diff --git a/libdimension/dimension/object.h b/libdimension/dimension/object.h
index cef1acb..56cfacd 100644
--- a/libdimension/dimension/object.h
+++ b/libdimension/dimension/object.h
@@ -85,22 +85,12 @@ dmnsn_object *dmnsn_new_object(void);
/* Free an object */
void dmnsn_delete_object(dmnsn_object *object);
+/* Initialize an object and potentially its children */
void dmnsn_object_init(dmnsn_object *object);
-/* Useful function to transform a normal vector */
-DMNSN_INLINE dmnsn_vector
-dmnsn_transform_normal(dmnsn_matrix trans, dmnsn_vector normal)
-{
- return dmnsn_vector_normalize(
- dmnsn_vector_sub(
- dmnsn_transform_vector(trans, normal),
- /* Optimized form of dmnsn_transform_vector(trans, dmnsn_zero) */
- dmnsn_vector_div(
- dmnsn_new_vector(trans.n[0][3], trans.n[1][3], trans.n[2][3]),
- trans.n[3][3]
- )
- )
- );
-}
+/* Helpers for invoking object callbacks with correct transformations */
+bool dmnsn_object_intersection(const dmnsn_object *object, dmnsn_line line,
+ dmnsn_intersection *intersection);
+bool dmnsn_object_inside(const dmnsn_object *object, dmnsn_vector point);
#endif /* DIMENSION_OBJECT_H */