|
1 | 1 | // Make sure that binding definition files are always set to NOT use pre-compiled headers and conformance mode (/permissive) otherwise everything will be on fire! |
2 | 2 |
|
3 | 3 | #include "LuaBindingRegisterDefinitions.h" |
| 4 | +#include "return_reference_to_policy.hpp" |
4 | 5 |
|
5 | 6 | using namespace RTE; |
6 | 7 |
|
@@ -206,30 +207,30 @@ LuaBindingRegisterFunctionDefinitionForType(SystemLuaBindings, Vector) { |
206 | 207 |
|
207 | 208 | .def("MagnitudeIsGreaterThan", &Vector::MagnitudeIsGreaterThan) |
208 | 209 | .def("MagnitudeIsLessThan", &Vector::MagnitudeIsLessThan) |
209 | | - .def("SetMagnitude", &Vector::SetMagnitude) |
| 210 | + .def("SetMagnitude", &Vector::SetMagnitude, luabind::return_reference_to(_1)) |
210 | 211 | .def("GetXFlipped", &Vector::GetXFlipped) |
211 | 212 | .def("GetYFlipped", &Vector::GetYFlipped) |
212 | | - .def("CapMagnitude", &Vector::CapMagnitude) |
213 | | - .def("ClampMagnitude", &Vector::ClampMagnitude) |
214 | | - .def("FlipX", &Vector::FlipX) |
215 | | - .def("FlipY", &Vector::FlipY) |
| 213 | + .def("CapMagnitude", &Vector::CapMagnitude, luabind::return_reference_to(_1)) |
| 214 | + .def("ClampMagnitude", &Vector::ClampMagnitude, luabind::return_reference_to(_1)) |
| 215 | + .def("FlipX", &Vector::FlipX, luabind::return_reference_to(_1)) |
| 216 | + .def("FlipY", &Vector::FlipY, luabind::return_reference_to(_1)) |
216 | 217 | .def("IsZero", &Vector::IsZero) |
217 | 218 | .def("IsOpposedTo", &Vector::IsOpposedTo) |
218 | 219 | .def("Dot", &Vector::Dot) |
219 | 220 | .def("Cross", &Vector::Cross) |
220 | | - .def("Round", &Vector::Round) |
221 | | - .def("ToHalf", &Vector::ToHalf) |
222 | | - .def("Floor", &Vector::Floor) |
223 | | - .def("Ceiling", &Vector::Ceiling) |
224 | | - .def("Normalize", &Vector::Normalize) |
225 | | - .def("Perpendicularize", &Vector::Perpendicularize) |
| 221 | + .def("Round", &Vector::Round, luabind::return_reference_to(_1)) |
| 222 | + .def("ToHalf", &Vector::ToHalf, luabind::return_reference_to(_1)) |
| 223 | + .def("Floor", &Vector::Floor, luabind::return_reference_to(_1)) |
| 224 | + .def("Ceiling", &Vector::Ceiling, luabind::return_reference_to(_1)) |
| 225 | + .def("Normalize", &Vector::Normalize, luabind::return_reference_to(_1)) |
| 226 | + .def("Perpendicularize", &Vector::Perpendicularize, luabind::return_reference_to(_1)) |
226 | 227 | .def("Reset", &Vector::Reset) |
227 | | - .def("RadRotate", &Vector::RadRotate) |
228 | | - .def("DegRotate", &Vector::DegRotate) |
| 228 | + .def("RadRotate", &Vector::RadRotate, luabind::return_reference_to(_1)) |
| 229 | + .def("DegRotate", &Vector::DegRotate, luabind::return_reference_to(_1)) |
229 | 230 | .def("GetRadRotatedCopy", &Vector::GetRadRotatedCopy) |
230 | 231 | .def("GetDegRotatedCopy", &Vector::GetDegRotatedCopy) |
231 | | - .def("AbsRotateTo", &Vector::AbsRotateTo) |
232 | | - .def("SetXY", &Vector::SetXY); |
| 232 | + .def("AbsRotateTo", &Vector::AbsRotateTo, luabind::return_reference_to(_1)) |
| 233 | + .def("SetXY", &Vector::SetXY, luabind::return_reference_to(_1)); |
233 | 234 | } |
234 | 235 |
|
235 | 236 | LuaBindingRegisterFunctionDefinitionForType(SystemLuaBindings, PathRequest) { |
|
0 commit comments