Skip to content

Commit 3a98f72

Browse files
committed
Using custom dot that supports integer vectors
1 parent 44de1ca commit 3a98f72

File tree

8 files changed

+224
-10
lines changed

8 files changed

+224
-10
lines changed

PyGLM_lib/PyGLM/functions/detail/func_geometric.h

Lines changed: 143 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,154 @@ PyDoc_STRVAR(distance_docstr,
2828
PyGLM_MAKE_GLM_FUNC_NN_VV__tfF(distance)
2929

3030
PyDoc_STRVAR(dot_docstr,
31-
"dot(x: float, y: float) -> float\n"
31+
"dot(x: number, y: number) -> float\n"
3232
" Returns the dot product of `x` and `y`, i.e., `result = x * y`.\n"
33-
"dot(x: vecN, y: vecN) -> float\n"
33+
"dot(x: vecN, y: vecN) -> number\n"
3434
" Returns the dot product of `x` and `y`, i.e., `result = x[0] * y[0] + x[1] * y[1] + ...`\n"
3535
"dot(x: quat, y: quat) -> float\n"
3636
" Returns dot product of `x` and `y`, i.e., `x[0] * y[0] + x[1] * y[1] + ...`"
3737
);
38-
PyGLM_MAKE_GLM_FUNC_NN_VV_QQ__tfF(dot)
38+
39+
static PyObject*
40+
dot_(PyObject*, PyObject* args) {
41+
PyObject *arg1, *arg2;
42+
PyGLM_Arg_Unpack_2O(args, "dot", arg1, arg2);
43+
if (PyGLM_Number_Check(arg1) && PyGLM_Number_Check(arg2)) {
44+
return pack(glm::custom::dot(PyGLM_Number_FromPyObject<double>(arg1), PyGLM_Number_FromPyObject<double>(arg2)));
45+
}
46+
PyGLM_PTI_Init0(arg1, PyGLM_T_VEC | PyGLM_T_QUA | PyGLM_SHAPE_ALL | PyGLM_DT_FD | PyGLM_DT_I);
47+
PyGLM_PTI_Init1(arg2, PyGLM_T_VEC | PyGLM_T_QUA | PyGLM_SHAPE_ALL | PyGLM_DT_FD | PyGLM_DT_I);
48+
if (PyGLM_PTI_IsVec(0)) {
49+
if (PyGLM_Vec_PTI_Check0(1, float, arg1) && PyGLM_Vec_PTI_Check1(1, float, arg2)) {
50+
return pack(glm::custom::dot(PyGLM_Vec_PTI_Get0(1, float, arg1), PyGLM_Vec_PTI_Get1(1, float, arg2)));
51+
}
52+
if (PyGLM_Vec_PTI_Check0(1, double, arg1) && PyGLM_Vec_PTI_Check1(1, double, arg2)) {
53+
return pack(glm::custom::dot(PyGLM_Vec_PTI_Get0(1, double, arg1), PyGLM_Vec_PTI_Get1(1, double, arg2)));
54+
}
55+
if (PyGLM_Vec_PTI_Check0(1, int32, arg1) && PyGLM_Vec_PTI_Check1(1, int32, arg2)) {
56+
return pack(glm::custom::dot(PyGLM_Vec_PTI_Get0(1, int32, arg1), PyGLM_Vec_PTI_Get1(1, int32, arg2)));
57+
}
58+
if (PyGLM_Vec_PTI_Check0(1, uint32, arg1) && PyGLM_Vec_PTI_Check1(1, uint32, arg2)) {
59+
return pack(glm::custom::dot(PyGLM_Vec_PTI_Get0(1, uint32, arg1), PyGLM_Vec_PTI_Get1(1, uint32, arg2)));
60+
}
61+
if (PyGLM_Vec_PTI_Check0(1, int64, arg1) && PyGLM_Vec_PTI_Check1(1, int64, arg2)) {
62+
return pack(glm::custom::dot(PyGLM_Vec_PTI_Get0(1, int64, arg1), PyGLM_Vec_PTI_Get1(1, int64, arg2)));
63+
}
64+
if (PyGLM_Vec_PTI_Check0(1, uint64, arg1) && PyGLM_Vec_PTI_Check1(1, uint64, arg2)) {
65+
return pack(glm::custom::dot(PyGLM_Vec_PTI_Get0(1, uint64, arg1), PyGLM_Vec_PTI_Get1(1, uint64, arg2)));
66+
}
67+
if (PyGLM_Vec_PTI_Check0(1, int16, arg1) && PyGLM_Vec_PTI_Check1(1, int16, arg2)) {
68+
return pack(glm::custom::dot(PyGLM_Vec_PTI_Get0(1, int16, arg1), PyGLM_Vec_PTI_Get1(1, int16, arg2)));
69+
}
70+
if (PyGLM_Vec_PTI_Check0(1, uint16, arg1) && PyGLM_Vec_PTI_Check1(1, uint16, arg2)) {
71+
return pack(glm::custom::dot(PyGLM_Vec_PTI_Get0(1, uint16, arg1), PyGLM_Vec_PTI_Get1(1, uint16, arg2)));
72+
}
73+
if (PyGLM_Vec_PTI_Check0(1, int8, arg1) && PyGLM_Vec_PTI_Check1(1, int8, arg2)) {
74+
return pack(glm::custom::dot(PyGLM_Vec_PTI_Get0(1, int8, arg1), PyGLM_Vec_PTI_Get1(1, int8, arg2)));
75+
}
76+
if (PyGLM_Vec_PTI_Check0(1, uint8, arg1) && PyGLM_Vec_PTI_Check1(1, uint8, arg2)) {
77+
return pack(glm::custom::dot(PyGLM_Vec_PTI_Get0(1, uint8, arg1), PyGLM_Vec_PTI_Get1(1, uint8, arg2)));
78+
}
79+
if (PyGLM_Vec_PTI_Check0(2, float, arg1) && PyGLM_Vec_PTI_Check1(2, float, arg2)) {
80+
return pack(glm::custom::dot(PyGLM_Vec_PTI_Get0(2, float, arg1), PyGLM_Vec_PTI_Get1(2, float, arg2)));
81+
}
82+
if (PyGLM_Vec_PTI_Check0(2, double, arg1) && PyGLM_Vec_PTI_Check1(2, double, arg2)) {
83+
return pack(glm::custom::dot(PyGLM_Vec_PTI_Get0(2, double, arg1), PyGLM_Vec_PTI_Get1(2, double, arg2)));
84+
}
85+
if (PyGLM_Vec_PTI_Check0(2, int32, arg1) && PyGLM_Vec_PTI_Check1(2, int32, arg2)) {
86+
return pack(glm::custom::dot(PyGLM_Vec_PTI_Get0(2, int32, arg1), PyGLM_Vec_PTI_Get1(2, int32, arg2)));
87+
}
88+
if (PyGLM_Vec_PTI_Check0(2, uint32, arg1) && PyGLM_Vec_PTI_Check1(2, uint32, arg2)) {
89+
return pack(glm::custom::dot(PyGLM_Vec_PTI_Get0(2, uint32, arg1), PyGLM_Vec_PTI_Get1(2, uint32, arg2)));
90+
}
91+
if (PyGLM_Vec_PTI_Check0(2, int64, arg1) && PyGLM_Vec_PTI_Check1(2, int64, arg2)) {
92+
return pack(glm::custom::dot(PyGLM_Vec_PTI_Get0(2, int64, arg1), PyGLM_Vec_PTI_Get1(2, int64, arg2)));
93+
}
94+
if (PyGLM_Vec_PTI_Check0(2, uint64, arg1) && PyGLM_Vec_PTI_Check1(2, uint64, arg2)) {
95+
return pack(glm::custom::dot(PyGLM_Vec_PTI_Get0(2, uint64, arg1), PyGLM_Vec_PTI_Get1(2, uint64, arg2)));
96+
}
97+
if (PyGLM_Vec_PTI_Check0(2, int16, arg1) && PyGLM_Vec_PTI_Check1(2, int16, arg2)) {
98+
return pack(glm::custom::dot(PyGLM_Vec_PTI_Get0(2, int16, arg1), PyGLM_Vec_PTI_Get1(2, int16, arg2)));
99+
}
100+
if (PyGLM_Vec_PTI_Check0(2, uint16, arg1) && PyGLM_Vec_PTI_Check1(2, uint16, arg2)) {
101+
return pack(glm::custom::dot(PyGLM_Vec_PTI_Get0(2, uint16, arg1), PyGLM_Vec_PTI_Get1(2, uint16, arg2)));
102+
}
103+
if (PyGLM_Vec_PTI_Check0(2, int8, arg1) && PyGLM_Vec_PTI_Check1(2, int8, arg2)) {
104+
return pack(glm::custom::dot(PyGLM_Vec_PTI_Get0(2, int8, arg1), PyGLM_Vec_PTI_Get1(2, int8, arg2)));
105+
}
106+
if (PyGLM_Vec_PTI_Check0(2, uint8, arg1) && PyGLM_Vec_PTI_Check1(2, uint8, arg2)) {
107+
return pack(glm::custom::dot(PyGLM_Vec_PTI_Get0(2, uint8, arg1), PyGLM_Vec_PTI_Get1(2, uint8, arg2)));
108+
}
109+
if (PyGLM_Vec_PTI_Check0(3, float, arg1) && PyGLM_Vec_PTI_Check1(3, float, arg2)) {
110+
return pack(glm::custom::dot(PyGLM_Vec_PTI_Get0(3, float, arg1), PyGLM_Vec_PTI_Get1(3, float, arg2)));
111+
}
112+
if (PyGLM_Vec_PTI_Check0(3, double, arg1) && PyGLM_Vec_PTI_Check1(3, double, arg2)) {
113+
return pack(glm::custom::dot(PyGLM_Vec_PTI_Get0(3, double, arg1), PyGLM_Vec_PTI_Get1(3, double, arg2)));
114+
}
115+
if (PyGLM_Vec_PTI_Check0(3, int32, arg1) && PyGLM_Vec_PTI_Check1(3, int32, arg2)) {
116+
return pack(glm::custom::dot(PyGLM_Vec_PTI_Get0(3, int32, arg1), PyGLM_Vec_PTI_Get1(3, int32, arg2)));
117+
}
118+
if (PyGLM_Vec_PTI_Check0(3, uint32, arg1) && PyGLM_Vec_PTI_Check1(3, uint32, arg2)) {
119+
return pack(glm::custom::dot(PyGLM_Vec_PTI_Get0(3, uint32, arg1), PyGLM_Vec_PTI_Get1(3, uint32, arg2)));
120+
}
121+
if (PyGLM_Vec_PTI_Check0(3, int64, arg1) && PyGLM_Vec_PTI_Check1(3, int64, arg2)) {
122+
return pack(glm::custom::dot(PyGLM_Vec_PTI_Get0(3, int64, arg1), PyGLM_Vec_PTI_Get1(3, int64, arg2)));
123+
}
124+
if (PyGLM_Vec_PTI_Check0(3, uint64, arg1) && PyGLM_Vec_PTI_Check1(3, uint64, arg2)) {
125+
return pack(glm::custom::dot(PyGLM_Vec_PTI_Get0(3, uint64, arg1), PyGLM_Vec_PTI_Get1(3, uint64, arg2)));
126+
}
127+
if (PyGLM_Vec_PTI_Check0(3, int16, arg1) && PyGLM_Vec_PTI_Check1(3, int16, arg2)) {
128+
return pack(glm::custom::dot(PyGLM_Vec_PTI_Get0(3, int16, arg1), PyGLM_Vec_PTI_Get1(3, int16, arg2)));
129+
}
130+
if (PyGLM_Vec_PTI_Check0(3, uint16, arg1) && PyGLM_Vec_PTI_Check1(3, uint16, arg2)) {
131+
return pack(glm::custom::dot(PyGLM_Vec_PTI_Get0(3, uint16, arg1), PyGLM_Vec_PTI_Get1(3, uint16, arg2)));
132+
}
133+
if (PyGLM_Vec_PTI_Check0(3, int8, arg1) && PyGLM_Vec_PTI_Check1(3, int8, arg2)) {
134+
return pack(glm::custom::dot(PyGLM_Vec_PTI_Get0(3, int8, arg1), PyGLM_Vec_PTI_Get1(3, int8, arg2)));
135+
}
136+
if (PyGLM_Vec_PTI_Check0(3, uint8, arg1) && PyGLM_Vec_PTI_Check1(3, uint8, arg2)) {
137+
return pack(glm::custom::dot(PyGLM_Vec_PTI_Get0(3, uint8, arg1), PyGLM_Vec_PTI_Get1(3, uint8, arg2)));
138+
}
139+
if (PyGLM_Vec_PTI_Check0(4, float, arg1) && PyGLM_Vec_PTI_Check1(4, float, arg2)) {
140+
return pack(glm::custom::dot(PyGLM_Vec_PTI_Get0(4, float, arg1), PyGLM_Vec_PTI_Get1(4, float, arg2)));
141+
}
142+
if (PyGLM_Vec_PTI_Check0(4, double, arg1) && PyGLM_Vec_PTI_Check1(4, double, arg2)) {
143+
return pack(glm::custom::dot(PyGLM_Vec_PTI_Get0(4, double, arg1), PyGLM_Vec_PTI_Get1(4, double, arg2)));
144+
}
145+
if (PyGLM_Vec_PTI_Check0(4, int32, arg1) && PyGLM_Vec_PTI_Check1(4, int32, arg2)) {
146+
return pack(glm::custom::dot(PyGLM_Vec_PTI_Get0(4, int32, arg1), PyGLM_Vec_PTI_Get1(4, int32, arg2)));
147+
}
148+
if (PyGLM_Vec_PTI_Check0(4, uint32, arg1) && PyGLM_Vec_PTI_Check1(4, uint32, arg2)) {
149+
return pack(glm::custom::dot(PyGLM_Vec_PTI_Get0(4, uint32, arg1), PyGLM_Vec_PTI_Get1(4, uint32, arg2)));
150+
}
151+
if (PyGLM_Vec_PTI_Check0(4, int64, arg1) && PyGLM_Vec_PTI_Check1(4, int64, arg2)) {
152+
return pack(glm::custom::dot(PyGLM_Vec_PTI_Get0(4, int64, arg1), PyGLM_Vec_PTI_Get1(4, int64, arg2)));
153+
}
154+
if (PyGLM_Vec_PTI_Check0(4, uint64, arg1) && PyGLM_Vec_PTI_Check1(4, uint64, arg2)) {
155+
return pack(glm::custom::dot(PyGLM_Vec_PTI_Get0(4, uint64, arg1), PyGLM_Vec_PTI_Get1(4, uint64, arg2)));
156+
}
157+
if (PyGLM_Vec_PTI_Check0(4, int16, arg1) && PyGLM_Vec_PTI_Check1(4, int16, arg2)) {
158+
return pack(glm::custom::dot(PyGLM_Vec_PTI_Get0(4, int16, arg1), PyGLM_Vec_PTI_Get1(4, int16, arg2)));
159+
}
160+
if (PyGLM_Vec_PTI_Check0(4, uint16, arg1) && PyGLM_Vec_PTI_Check1(4, uint16, arg2)) {
161+
return pack(glm::custom::dot(PyGLM_Vec_PTI_Get0(4, uint16, arg1), PyGLM_Vec_PTI_Get1(4, uint16, arg2)));
162+
}
163+
if (PyGLM_Vec_PTI_Check0(4, int8, arg1) && PyGLM_Vec_PTI_Check1(4, int8, arg2)) {
164+
return pack(glm::custom::dot(PyGLM_Vec_PTI_Get0(4, int8, arg1), PyGLM_Vec_PTI_Get1(4, int8, arg2)));
165+
}
166+
if (PyGLM_Vec_PTI_Check0(4, uint8, arg1) && PyGLM_Vec_PTI_Check1(4, uint8, arg2)) {
167+
return pack(glm::custom::dot(PyGLM_Vec_PTI_Get0(4, uint8, arg1), PyGLM_Vec_PTI_Get1(4, uint8, arg2)));
168+
}
169+
}
170+
if (PyGLM_Qua_PTI_Check0(float, arg1) && PyGLM_Qua_PTI_Check1(float, arg2)) {
171+
return pack(glm::custom::dot(PyGLM_Qua_PTI_Get0(float, arg1), PyGLM_Qua_PTI_Get1(float, arg2)));
172+
}
173+
if (PyGLM_Qua_PTI_Check0(double, arg1) && PyGLM_Qua_PTI_Check1(double, arg2)) {
174+
return pack(glm::custom::dot(PyGLM_Qua_PTI_Get0(double, arg1), PyGLM_Qua_PTI_Get1(double, arg2)));
175+
}
176+
PyGLM_TYPEERROR_2O("invalid argument type(s) for dot(): ", arg1, arg2);
177+
return NULL;
178+
}
39179

40180
PyDoc_STRVAR(cross_docstr,
41181
"cross(x: vec3, y: vec3) -> vec3\n"

PyGLM_lib/PyGLM/imports.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121
#include <glm/glm.hpp>
2222

23+
#include "internal_functions/glm_customizations.h"
24+
2325
#include <glm/gtc/quaternion.hpp>
2426
#include <glm/gtc/matrix_integer.hpp>
2527
#include <glm/gtx/hash.hpp>
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
#pragma once
2+
3+
#include "../compiler_setup.h"
4+
5+
namespace glm {
6+
namespace custom {
7+
template<typename T>
8+
GLM_FUNC_QUALIFIER GLM_CONSTEXPR T dot(T x, T y)
9+
{
10+
return x * y;
11+
}
12+
13+
template<length_t L, typename T, qualifier Q>
14+
GLM_FUNC_QUALIFIER GLM_CONSTEXPR T dot(vec<L, T, Q> const& x, vec<L, T, Q> const& y)
15+
{
16+
return detail::compute_dot<vec<L, T, Q>, T, detail::is_aligned<Q>::value>::call(x, y);
17+
}
18+
19+
template<typename T, qualifier Q>
20+
GLM_FUNC_QUALIFIER GLM_CONSTEXPR T dot(qua<T, Q> const& x, qua<T, Q> const& y)
21+
{
22+
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'dot' accepts only floating-point inputs");
23+
return detail::compute_dot<qua<T, Q>, T, detail::is_aligned<Q>::value>::call(x, y);
24+
}
25+
26+
template<int C, int R, typename T, qualifier Q>
27+
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<C, R, T, Q>::col_type mat_mul
28+
(
29+
mat<C, R, T, Q> const& m,
30+
typename mat<C, R, T, Q>::row_type const& v
31+
)
32+
{
33+
return m * v;
34+
}
35+
36+
template<int C, int R, typename T, qualifier Q>
37+
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<C, R, T, Q>::row_type mat_mul
38+
(
39+
typename mat<C, R, T, Q>::col_type const& v,
40+
mat<C, R, T, Q> const& m
41+
)
42+
{
43+
return v * m;
44+
}
45+
46+
template<typename T, qualifier Q>
47+
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<3, 3, T, Q>::row_type mat_mul(typename mat<3, 3, T, Q>::col_type const& v, mat<3, 3, T, Q> const& m)
48+
{
49+
return typename mat<3, 3, T, Q>::row_type(
50+
glm::custom::dot(m[0], v),
51+
glm::custom::dot(m[1], v),
52+
glm::custom::dot(m[2], v));
53+
}
54+
55+
template<typename T, qualifier Q>
56+
GLM_FUNC_QUALIFIER GLM_CONSTEXPR typename mat<4, 4, T, Q>::row_type mat_mul
57+
(
58+
typename mat<4, 4, T, Q>::col_type const& v,
59+
mat<4, 4, T, Q> const& m
60+
)
61+
{
62+
return typename mat<4, 4, T, Q>::row_type(
63+
glm::custom::dot(m[0], v),
64+
glm::custom::dot(m[1], v),
65+
glm::custom::dot(m[2], v),
66+
glm::custom::dot(m[3], v));
67+
}
68+
}
69+
}

PyGLM_lib/PyGLM/type_methods/mat.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1375,7 +1375,7 @@ mat_mul(PyObject *obj1, PyObject *obj2)
13751375
if (PyGLM_Vec_PTI_Check0(R, T, obj1)) { // obj1 is a col_type
13761376
glm::vec<R, T> o = PyGLM_Vec_PTI_Get0(R, T, obj1);
13771377

1378-
return pack_vec(o * ((mat<C, R, T>*)obj2)->super_type);
1378+
return pack_vec(glm::custom::mat_mul(o, ((mat<C, R, T>*)obj2)->super_type));
13791379
}
13801380

13811381
if (!PyGLM_Mat_PTI_Check0(C, R, T, obj1)) { // obj1 can't be interpreted as mat<C, R, T>
@@ -1394,7 +1394,7 @@ mat_mul(PyObject *obj1, PyObject *obj2)
13941394
if (PyGLM_Vec_PTI_Check0(C, T, obj2)) { // obj2 is a row_type
13951395
glm::vec<C, T> o2 = PyGLM_Vec_PTI_Get0(C, T, obj2);
13961396

1397-
return pack_vec(o * o2);
1397+
return pack_vec(glm::custom::mat_mul(o, o2));
13981398
}
13991399

14001400
if (PyGLM_Mat_PTI_Check0(2, C, T, obj2)) {

vs-project/PyGLM build/PyGLM build.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@
206206
<ClInclude Include="..\..\PyGLM_lib\PyGLM\internal_functions\all.h" />
207207
<ClInclude Include="..\..\PyGLM_lib\PyGLM\internal_functions\ctypes_pointers.h" />
208208
<ClInclude Include="..\..\PyGLM_lib\PyGLM\internal_functions\error_functions.h" />
209-
<ClInclude Include="..\..\PyGLM_lib\PyGLM\internal_functions\glm_additions.h" />
209+
<ClInclude Include="..\..\PyGLM_lib\PyGLM\internal_functions\glm_customizations.h" />
210210
<ClInclude Include="..\..\PyGLM_lib\PyGLM\internal_functions\helper_macros.h" />
211211
<ClInclude Include="..\..\PyGLM_lib\PyGLM\internal_functions\number_functions.h" />
212212
<ClInclude Include="..\..\PyGLM_lib\PyGLM\internal_functions\packers.h" />

vs-project/PyGLM build/PyGLM build.vcxproj.filters

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,5 +734,8 @@
734734
<ClInclude Include="..\..\PyGLM_lib\version.h">
735735
<Filter>Headerdateien</Filter>
736736
</ClInclude>
737+
<ClInclude Include="..\..\PyGLM_lib\PyGLM\internal_functions\glm_customizations.h">
738+
<Filter>Headerdateien\PyGLM\internal_functions</Filter>
739+
</ClInclude>
737740
</ItemGroup>
738741
</Project>

wiki/function-reference/detail/func_geometric.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ These operate on vectors as vectors, not component\-wise\.
3030
&emsp;&emsp;Returns the distance between ``` p0 ``` and ``` p1 ```, i\.e\., ``` length(p0 - p1) ```\.
3131

3232
### dot\(\) function
33-
#### <code>glm.<code>**dot**(**x**: *float*, **y**: *float*) -\> *float*</code></code>
33+
#### <code>glm.<code>**dot**(**x**: *number*, **y**: *number*) -\> *float*</code></code>
3434
&emsp;&emsp;Returns the dot product of ``` x ``` and ``` y ```, i\.e\., ``` result = x * y ```\.
3535

36-
#### <code>glm.<code>**dot**(**x**: *vecN*, **y**: *vecN*) -\> *float*</code></code>
36+
#### <code>glm.<code>**dot**(**x**: *vecN*, **y**: *vecN*) -\> *number*</code></code>
3737
&emsp;&emsp;Returns the dot product of ``` x ``` and ``` y ```, i\.e\., ``` result = x[0] * y[0] + x[1] * y[1] + ... ```
3838

3939
#### <code>glm.<code>**dot**(**x**: *quat*, **y**: *quat*) -\> *float*</code></code>

wiki/function-reference/detail/func_geometric.sb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ These operate on vectors as vectors, not component-wise.
2828
\raw\&emsp;&emsp;\raw\Returns the distance between \code\p0\code\ and \code\p1\code\, i.e., \code\length(p0 - p1)\code\.
2929

3030
\h3\dot() function\h3\
31-
\raw\#### <code>glm.<code>**dot**(**x**: *float*, **y**: *float*) -\\> *float*</code></code>\raw\
31+
\raw\#### <code>glm.<code>**dot**(**x**: *number*, **y**: *number*) -\\> *float*</code></code>\raw\
3232
\raw\&emsp;&emsp;\raw\Returns the dot product of \code\x\code\ and \code\y\code\, i.e., \code\result = x * y\code\.
3333

34-
\raw\#### <code>glm.<code>**dot**(**x**: *vecN*, **y**: *vecN*) -\\> *float*</code></code>\raw\
34+
\raw\#### <code>glm.<code>**dot**(**x**: *vecN*, **y**: *vecN*) -\\> *number*</code></code>\raw\
3535
\raw\&emsp;&emsp;\raw\Returns the dot product of \code\x\code\ and \code\y\code\, i.e., \code\result = x[0] * y[0] + x[1] * y[1] + ...\code\
3636

3737
\raw\#### <code>glm.<code>**dot**(**x**: *quat*, **y**: *quat*) -\\> *float*</code></code>\raw\

0 commit comments

Comments
 (0)