PY_GETSET_GETTER_DECL(OneTimeParticleGenerator, direction) { const auto& dir = self->fThis->getDirection(); PyObject* result = PyTuple_New(dir.size()); for (size_t i = 0; i < dir.size(); ++i) PyTuple_SET_ITEM(result, i, pyVector3_FromVector3(dir[i])); return result; }
static PyObject* pySpanInstance_getPosDeltas(pySpanInstance* self, void*) { std::vector<hsVector3> deltas = self->fThis->getPosDeltas(); PyObject* list = PyList_New(deltas.size()); for (size_t i=0; i<deltas.size(); i++) PyList_SET_ITEM(list, i, pyVector3_FromVector3(deltas[i])); return list; }
PY_GETSET_GETTER_DECL(OneTimeParticleGenerator, position) { const auto& pos = self->fThis->getPosition(); PyObject* result = PyTuple_New(pos.size()); for (size_t i = 0; i < pos.size(); ++i) PyTuple_SET_ITEM(result, i, pyVector3_FromVector3(pos[i])); return result; }
static PyObject* pyVector3_subtract(PyObject* left, PyObject* right) { if (!pyVector3_Check(left) || !pyVector3_Check(right)) { PyErr_SetString(PyExc_TypeError, "Incompatible Types"); return NULL; } return pyVector3_FromVector3(*((pyVector3*)left)->fThis - *((pyVector3*)right)->fThis); }
static PyObject* pyCullPoly_getVerts(pyCullPoly* self, void*) { std::vector<hsVector3> verts = self->fThis->getVerts(); PyObject* list = PyList_New(verts.size()); for (size_t i=0; i<verts.size(); i++) PyList_SET_ITEM(list, i, pyVector3_FromVector3(verts[i])); return list; }
static PyObject* pyVector3_crossP(pyVector3* self, PyObject* args) { pyVector3* vec; if (!PyArg_ParseTuple(args, "O", &vec)) { PyErr_SetString(PyExc_TypeError, "crossP expects an hsVector3"); return NULL; } if (!pyVector3_Check((PyObject*)vec)) { PyErr_SetString(PyExc_TypeError, "crossP expects an hsVector3"); return NULL; } return pyVector3_FromVector3(self->fThis->crossP(*vec->fThis)); }
static PyObject* pyMatrix44_multVector(pyMatrix44* self, PyObject* args) { pyVector3* vec; if (!PyArg_ParseTuple(args, "O", &vec)) { PyErr_SetString(PyExc_TypeError, "multVector expects an hsVector3"); return NULL; } if (!pyVector3_Check((PyObject*)vec)) { PyErr_SetString(PyExc_TypeError, "multVector expects an hsVector3"); return NULL; } hsVector3 result = self->fThis->multVector(*vec->fThis); return pyVector3_FromVector3(result); }
static PyObject* pyVector3_multiply(PyObject* left, PyObject* right) { if (pyVector3_Check(left)) { if (pyVector3_Check(right)) { PyErr_SetString(PyExc_TypeError, "Vector Multiplication should use dotP and crossP"); return NULL; } else if (PyFloat_Check(right)) { return pyVector3_FromVector3(*((pyVector3*)left)->fThis * PyFloat_AsDouble(right)); } else { PyErr_SetString(PyExc_TypeError, "Incompatible Types"); return NULL; } } else if (pyVector3_Check(right)) { if (PyFloat_Check(left)) { return pyVector3_FromVector3(*((pyVector3*)right)->fThis * PyFloat_AsDouble(left)); } else { PyErr_SetString(PyExc_TypeError, "Incompatible Types"); return NULL; } } else { PyErr_SetString(PyExc_TypeError, "This should not happen"); return NULL; } }
static PyObject* pySpanTemplateVertex_getPosition(pySpanTemplateVertex* self, void*) { return pyVector3_FromVector3(self->fThis->fPosition); }
static PyObject* pyGenericPhysical_getVerts(pyGenericPhysical* self, void*) { PyObject* list = PyList_New(self->fThis->getVerts().getSize()); for (size_t i=0; i<self->fThis->getVerts().getSize(); i++) PyList_SET_ITEM(list, i, pyVector3_FromVector3(self->fThis->getVerts()[i])); return list; }
static PyObject* pyGenericPhysical_getOffset(pyGenericPhysical* self, void*) { return pyVector3_FromVector3(self->fThis->getOffset()); }
static PyObject* pyVector3_negative(pyVector3* self) { return pyVector3_FromVector3(hsVector3(-(self->fThis->X), -(self->fThis->Y), -(self->fThis->Z))); }
static PyObject* pyVector3_absolute(pyVector3* self) { return pyVector3_FromVector3(hsVector3(fabs(self->fThis->X), fabs(self->fThis->Y), fabs(self->fThis->Z))); }
static PyObject* pyAffineParts_getK(pyAffineParts* self, void*) { return pyVector3_FromVector3(self->fThis->fK); }
static PyObject* pyTempVertex_getUVs(pyTempVertex* self, void*) { PyObject* list = PyList_New(8); for (size_t i = 0; i < 8; ++i) PyList_SET_ITEM(list, i, pyVector3_FromVector3(self->fThis->fUVs[i])); return list; }
static PyObject* pyDynamicEnvMap_getPosition(pyDynamicEnvMap* self, void*) { return pyVector3_FromVector3(self->fThis->getPosition()); }
static PyObject* pySpanTemplateVertex_getNormal(pySpanTemplateVertex* self, void*) { return pyVector3_FromVector3(self->fThis->fNormal); }
static PyObject* pySpanTemplateVertex_getUVWs(pySpanTemplateVertex* self, void*) { PyObject* list = PyList_New(10); for (size_t i=0; i<10; i++) PyList_SET_ITEM(list, i, pyVector3_FromVector3(self->fThis->fUVWs[i])); return list; }
static PyObject* pyScaleKey_getOutTan(pyScaleKey* self, void*) { return pyVector3_FromVector3(self->fThis->fOutTan); }
static PyObject* pyCullPoly_getCenter(pyCullPoly* self, void*) { return pyVector3_FromVector3(self->fThis->getCenter()); }
static PyObject* pyViewFaceModifier_getOffset(pyViewFaceModifier* self, void*) { return pyVector3_FromVector3(self->fThis->getOffset()); }
static PyObject* pyScaleKey_getValue(pyScaleKey* self, void*) { return Py_BuildValue("OO", pyVector3_FromVector3(self->fThis->fS), pyQuat_FromQuat(self->fThis->fQ)); }
static PyObject* pyVector3_positive(pyVector3* self) { return pyVector3_FromVector3(hsVector3(+(self->fThis->X), +(self->fThis->Y), +(self->fThis->Z))); }
static PyObject* pyGBufferTriangle_getCenter(pyGBufferTriangle* self, void*) { return pyVector3_FromVector3(self->fThis->fCenter); }
static PyObject* pyGenericPhysical_getDims(pyGenericPhysical* self, void*) { return pyVector3_FromVector3(self->fThis->getDimensions()); }
static PyObject* pyBounds3_getCenter(pyBounds3* self, void*) { return pyVector3_FromVector3(self->fThis->getCenter()); }
static PyObject* pyPickedEventData_getHitPoint(pyPickedEventData* self, void*) { return pyVector3_FromVector3(self->fThis->getHitPoint()); }