From 6fbeed135509885ea1d81de8344b9db2181b17e1 Mon Sep 17 00:00:00 2001 From: Robin Allen Date: Sat, 29 Nov 2008 16:52:06 +0000 Subject: Changed vector math to use library functions. --- source/blender/nodes/intern/TEX_nodes/TEX_distance.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_distance.c b/source/blender/nodes/intern/TEX_nodes/TEX_distance.c index eb6f27e8477..ff9ec4db76b 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_distance.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_distance.c @@ -27,6 +27,7 @@ */ #include +#include "BLI_arithb.h" #include "../TEX_util.h" static bNodeSocketType inputs[]= { @@ -48,11 +49,7 @@ static void valuefn(float *out, float *coord, bNode *node, bNodeStack **in, shor tex_input_vec(coord1, in[0], coord, thread); tex_input_vec(coord2, in[1], coord, thread); - x = coord2[0] - coord1[0]; - y = coord2[1] - coord1[1]; - z = coord2[2] - coord1[2]; - - *out = sqrt(x * x + y * y + z * z); + *out = VecLenf(coord2, coord1); } static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out) -- cgit v1.2.3