Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FRotator arguments order should be pitch, yaw, roll instead of roll, pitch, yaw #718

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Source/UnrealEnginePython/Private/Wrappers/UEPyFRotator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ static PyGetSetDef ue_PyFRotator_getseters[] = {

static PyObject *ue_PyFRotator_str(ue_PyFRotator *self)
{
return PyUnicode_FromFormat("<unreal_engine.FRotator {'roll': %S, 'pitch': %S, 'yaw': %S}>",
PyFloat_FromDouble(self->rot.Roll), PyFloat_FromDouble(self->rot.Pitch), PyFloat_FromDouble(self->rot.Yaw));
return PyUnicode_FromFormat("<unreal_engine.FRotator {'pitch': %S, 'yaw': %S, 'roll': %S}>",
PyFloat_FromDouble(self->rot.Pitch), PyFloat_FromDouble(self->rot.Yaw), PyFloat_FromDouble(self->rot.Roll));
}

PyTypeObject ue_PyFRotatorType = {
Expand Down Expand Up @@ -211,11 +211,11 @@ static Py_ssize_t ue_py_frotator_seq_length(ue_PyFRotator *self) {
static PyObject *ue_py_frotator_seq_item(ue_PyFRotator *self, Py_ssize_t i) {
switch (i) {
case 0:
return PyFloat_FromDouble(self->rot.Roll);
case 1:
return PyFloat_FromDouble(self->rot.Pitch);
case 2:
case 1:
return PyFloat_FromDouble(self->rot.Yaw);
case 2:
return PyFloat_FromDouble(self->rot.Roll);
}
return PyErr_Format(PyExc_IndexError, "FRotator has only 3 items");
}
Expand All @@ -232,7 +232,7 @@ static int ue_py_frotator_init(ue_PyFRotator *self, PyObject *args, PyObject *kw
}
}

if (!PyArg_ParseTuple(args, "|fff", &roll, &pitch, &yaw))
if (!PyArg_ParseTuple(args, "|fff", &pitch, &yaw, &roll))
return -1;

if (PyTuple_Size(args) == 1) {
Expand Down Expand Up @@ -297,7 +297,7 @@ bool py_ue_rotator_arg(PyObject *args, FRotator &rot) {
}

float pitch, yaw, roll;
if (!PyArg_ParseTuple(args, "fff", &roll, &pitch, &yaw))
if (!PyArg_ParseTuple(args, "fff", &pitch, &yaw, &roll))
return false;
rot.Pitch = pitch;
rot.Yaw = yaw;
Expand Down