32 DE_MATH_API
void deSetV3S3(deFloat* res,
const deFloat x,
const deFloat y,
const deFloat z)
39 DE_MATH_API
void deSetV3V3(deFloat* res,
const deFloat* v1)
46 DE_MATH_API
void deNegateV3V3(deFloat* res,
const deFloat* v1)
53 DE_MATH_API
void deAddV3S1(deFloat* res,
const deFloat s)
60 DE_MATH_API
void deMulV3S1(deFloat* res,
const deFloat s)
67 DE_MATH_API
int deIsEqualV3V3(
const deFloat* v1,
const deFloat* v2)
69 return (v1[0] == v2[0] && v1[1] == v2[1] && v1[2] == v2[2]);
72 DE_MATH_API deFloat deDotV3V3(
const deFloat* v1,
const deFloat* v2)
74 return (v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2]);
77 DE_MATH_API
void deZeroV3(deFloat* res)
84 DE_MATH_API
void deNegV3V3(deFloat* res,
const deFloat* v1)
91 DE_MATH_API
void deAddV3V3(deFloat* res,
const deFloat* v1)
98 DE_MATH_API
void deSubV3V3(deFloat* res,
const deFloat* v1)
105 DE_MATH_API
void deMulV3V3(deFloat* res,
const deFloat* v1)
112 DE_MATH_API
void deAddV3V3S1(deFloat* res,
const deFloat* v1,
const deFloat s)
119 DE_MATH_API
void deMulV3V3S1(deFloat* res,
const deFloat* v1,
const deFloat s)
127 DE_MATH_API
void deAddV3V3V3(deFloat* res,
const deFloat* v1,
const deFloat* v2)
129 res[0] = v1[0] + v2[0];
130 res[1] = v1[1] + v2[1];
131 res[2] = v1[2] + v2[2];
134 DE_MATH_API
void deSubV3V3V3(deFloat* res,
const deFloat* v1,
const deFloat* v2)
136 res[0] = v1[0] - v2[0];
137 res[1] = v1[1] - v2[1];
138 res[2] = v1[2] - v2[2];
141 DE_MATH_API
void deMulV3V3V3(deFloat* res,
const deFloat* v1,
const deFloat* v2)
143 res[0] = v1[0] * v2[0];
144 res[1] = v1[1] * v2[1];
145 res[2] = v1[2] * v2[2];
148 DE_MATH_API
void deCrossV3V3V3(deFloat* res,
const deFloat* v1,
const deFloat* v2)
150 res[0] = v1[1] * v2[2] - v1[2] * v2[1];
151 res[1] = v1[2] * v2[0] - v1[0] * v2[2];
152 res[2] = v1[0] * v2[1] - v1[1] * v2[0];
155 DE_MATH_API deFloat deMagnitudeV3(
const deFloat* v1)
157 return deSqrt(v1[0] * v1[0] + v1[1] * v1[1] + v1[2] * v1[2]);
160 DE_MATH_API
void deNormalizeV3(deFloat* res)
162 deFloat mag = 1 / deSqrt(res[0] * res[0] + res[1] * res[1] + res[2] * res[2]);
168 DE_MATH_API
void deMinV3V3(deFloat* res,
const deFloat* v1)
170 if (v1[0] < res[0]) res[0] = v1[0];
171 if (v1[1] < res[1]) res[1] = v1[1];
172 if (v1[2] < res[2]) res[2] = v1[2];
175 DE_MATH_API
void deMaxV3V3(deFloat* res,
const deFloat* v1)
177 if (v1[0] > res[0]) res[0] = v1[0];
178 if (v1[1] > res[1]) res[1] = v1[1];
179 if (v1[2] > res[2]) res[2] = v1[2];
185 DE_MATH_API
void deLerpV3V3V3S1(deFloat* res,
const deFloat* v1,
const deFloat* v2,
const deFloat t)
187 res[0] = v1[0] + t * (v2[0] - v1[0]);
188 res[1] = v1[1] + t * (v2[1] - v1[1]);
189 res[2] = v1[2] + t * (v2[2] - v1[2]);