Пример #1
0
static PyObject *ue_py_frotator_sub(ue_PyFRotator *self, PyObject *value) {
	FRotator rot = self->rot;
	ue_PyFRotator *py_rot = py_ue_is_frotator(value);
	if (py_rot) {
		rot -= py_rot->rot;
	}
	else if (PyNumber_Check(value)) {
		PyObject *f_value = PyNumber_Float(value);
		float f = PyFloat_AsDouble(f_value);
		rot.Pitch -= f;
		rot.Yaw -= f;
		rot.Roll -= f;
		Py_DECREF(f_value);
	}
	return py_ue_new_frotator(rot);
}
Пример #2
0
static PyObject *ue_py_frotator_div(ue_PyFRotator *self, PyObject *value) {
	FRotator rot = self->rot;
	
	if (PyNumber_Check(value)) {
		PyObject *f_value = PyNumber_Float(value);
		float f = PyFloat_AsDouble(f_value);
		if (f == 0)
			return PyErr_Format(PyExc_ZeroDivisionError, "division by zero");
		rot.Pitch /= f;
		rot.Yaw /= f;
		rot.Roll /= f;
		Py_DECREF(f_value);
		return py_ue_new_frotator(rot);
	}
	return PyErr_Format(PyExc_TypeError, "unsupported argument type");
	
}
Пример #3
0
static PyObject *ue_py_frotator_mul(ue_PyFRotator *self, PyObject *value) {
	ue_PyFVector *py_vec = py_ue_is_fvector(value);
	if (py_vec) {
		FVector vec = self->rot.RotateVector(py_vec->vec);
		return py_ue_new_fvector(vec);
	}
	else if (PyNumber_Check(value)) {
		FRotator rot = self->rot;
		PyObject *f_value = PyNumber_Float(value);
		float f = PyFloat_AsDouble(f_value);
		rot.Pitch *= f;
		rot.Yaw *= f;
		rot.Roll *= f;
		Py_DECREF(f_value);
		return py_ue_new_frotator(rot);
	}
	return PyErr_Format(PyExc_TypeError, "unsupported argument type");
}
Пример #4
0
static PyObject *py_ue_frotator_normalized(ue_PyFRotator *self, PyObject * args) {
	FRotator rot = self->rot.GetNormalized();
	return py_ue_new_frotator(rot);
}
Пример #5
0
static PyObject *py_ue_frotator_inversed(ue_PyFRotator *self, PyObject * args) {
	FRotator rot = self->rot.GetInverse();
	return py_ue_new_frotator(rot);
}
static PyObject *py_ue_ffoliage_instance_get_rotation(ue_PyFFoliageInstance *self, void *closure)
{
	get_instance(self);
	return py_ue_new_frotator(instance->Rotation);
}