Skip to content

Commit d3e96e3

Browse files
committed
Added NULL Vector constructor
1 parent 556de1e commit d3e96e3

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/core/modules/mathlib/mathlib_wrap_python.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,20 @@ class VectorExt
5151
{
5252
pVec[iIndex] = fValue;
5353
}
54+
55+
static Vector* CreateNullVector()
56+
{
57+
return new Vector(0, 0, 0);
58+
}
5459
};
5560

5661
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(is_zero_overload, IsZero, 0, 1)
5762

5863
void export_vector()
5964
{
6065
// TODO: Rename
61-
class_<Vector>("CVector")
62-
.def(init<float, float, float>())
63-
// TODO: Missing on CS:GO
64-
//.def(init<float>())
66+
class_<Vector>("CVector", init<float, float, float>())
67+
.def("__init__", make_constructor(&VectorExt::CreateNullVector))
6568

6669
// Members
6770
.def_readwrite("x",

0 commit comments

Comments
 (0)