|
10 | 10 |
|
11 | 11 | namespace PyBindImath { |
12 | 12 |
|
13 | | -template <class T, class V> |
| 13 | +template <class T, class V, class S> |
14 | 14 | void register_frustum(pybind11::module& m, const char *name) |
15 | 15 | { |
16 | 16 | pybind11::class_<T> c(m, name); |
17 | 17 | c.def(pybind11::init<>(), "Uninitialized by default") |
18 | 18 | .def(pybind11::init<T>(), pybind11::arg("frustum"), "Copy constructor") |
19 | | - .def(pybind11::init<T>(), pybind11::arg("nearPlane"), pybind11::arg("farPlane"), pybind11::arg("fovx"), pybind11::arg("aspect"), "Initialize with basic frustum properties") |
| 19 | + .def(pybind11::init<const S, S, S, S>(), pybind11::arg("nearPlane"), pybind11::arg("farPlane"), pybind11::arg("fovx"), pybind11::arg("aspect"), "Initialize with basic frustum properties") |
20 | 20 |
|
21 | 21 | .def_readwrite("nearPlane", &T::nearPlane, "The near clipping plane") |
22 | 22 | .def_readwrite("farPlane", &T::farPlane, "The far clipping plane") |
23 | 23 | .def_readwrite("fovx", &T::fovx, "The field of view in x direction") |
24 | 24 | .def_readwrite("aspect", &T::aspect, "The aspect ratio") |
25 | 25 |
|
26 | | - .def("set", pybind11::overload_cast<T>(&T::set), pybind11::arg("nearPlane"), pybind11::arg("farPlane"), pybind11::arg("fovx"), pybind11::arg("aspect"), "Set frustum properties") |
| 26 | + .def("set", pybind11::overload_cast<const S, S, S, S>(&T::set), pybind11::arg("nearPlane"), pybind11::arg("farPlane"), pybind11::arg("fovx"), pybind11::arg("aspect"), "Set frustum properties") |
27 | 27 | .def("projectionMatrix", &T::projectionMatrix, "Returns the projection matrix of the frustum") |
28 | 28 | .def("transform", &T::transform, pybind11::arg("matrix"), "Applies a transformation matrix to the frustum") |
29 | 29 | .def("intersects", [](T& self, const V& point) { |
|
0 commit comments