summaryrefslogtreecommitdiffstats
path: root/libdimension/cylinder.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2010-10-24 03:11:22 -0400
committerTavian Barnes <tavianator@gmail.com>2010-10-24 03:11:22 -0400
commiteab1b0db01ea069772c04fbbf11d98fddb9a0e12 (patch)
tree1111598449c7358f4648ee9a6348bb961b98c638 /libdimension/cylinder.c
parent37b23a043e6e06d74f12fb580eda67672d712321 (diff)
downloaddimension-eab1b0db01ea069772c04fbbf11d98fddb9a0e12.tar.xz
Constness fix for cylinder.c.
Diffstat (limited to 'libdimension/cylinder.c')
-rw-r--r--libdimension/cylinder.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libdimension/cylinder.c b/libdimension/cylinder.c
index 1c08b7c..e9db50c 100644
--- a/libdimension/cylinder.c
+++ b/libdimension/cylinder.c
@@ -64,7 +64,7 @@ dmnsn_cylinder_intersection_fn(const dmnsn_object *cylinder, dmnsn_line line,
dmnsn_intersection *intersection)
{
dmnsn_line l = dmnsn_transform_line(cylinder->trans_inv, line);
- dmnsn_cylinder_payload *payload = cylinder->ptr;
+ const dmnsn_cylinder_payload *payload = cylinder->ptr;
double r1 = payload->r1, r2 = payload->r2;
/* Solve (x0 + nx*t)^2 + (z0 + nz*t)^2
@@ -150,7 +150,7 @@ static bool
dmnsn_cylinder_inside_fn(const dmnsn_object *cylinder, dmnsn_vector point)
{
point = dmnsn_transform_vector(cylinder->trans_inv, point);
- dmnsn_cylinder_payload *payload = cylinder->ptr;
+ const dmnsn_cylinder_payload *payload = cylinder->ptr;
double r1 = payload->r1, r2 = payload->r2;
double r = (point.y*(r2 - r1) + r1 + r2)/2.0;
return point.x*point.x + point.z*point.z < r*r