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;
}
Exemplo n.º 2
0
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;
}
Exemplo n.º 4
0
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);
}
Exemplo n.º 5
0
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;
}
Exemplo n.º 6
0
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));
}
Exemplo n.º 7
0
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);
}
Exemplo n.º 8
0
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;
    }
}
Exemplo n.º 9
0
static PyObject* pySpanTemplateVertex_getPosition(pySpanTemplateVertex* self, void*) {
    return pyVector3_FromVector3(self->fThis->fPosition);
}
Exemplo n.º 10
0
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;
}
Exemplo n.º 11
0
static PyObject* pyGenericPhysical_getOffset(pyGenericPhysical* self, void*) {
    return pyVector3_FromVector3(self->fThis->getOffset());
}
Exemplo n.º 12
0
static PyObject* pyVector3_negative(pyVector3* self) {
    return pyVector3_FromVector3(hsVector3(-(self->fThis->X), -(self->fThis->Y),
                                           -(self->fThis->Z)));
}
Exemplo n.º 13
0
static PyObject* pyVector3_absolute(pyVector3* self) {
    return pyVector3_FromVector3(hsVector3(fabs(self->fThis->X),
                                           fabs(self->fThis->Y),
                                           fabs(self->fThis->Z)));
}
Exemplo n.º 14
0
static PyObject* pyAffineParts_getK(pyAffineParts* self, void*) {
    return pyVector3_FromVector3(self->fThis->fK);
}
Exemplo n.º 15
0
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;
}
Exemplo n.º 16
0
static PyObject* pyDynamicEnvMap_getPosition(pyDynamicEnvMap* self, void*) {
    return pyVector3_FromVector3(self->fThis->getPosition());
}
Exemplo n.º 17
0
static PyObject* pySpanTemplateVertex_getNormal(pySpanTemplateVertex* self, void*) {
    return pyVector3_FromVector3(self->fThis->fNormal);
}
Exemplo n.º 18
0
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;
}
Exemplo n.º 19
0
static PyObject* pyScaleKey_getOutTan(pyScaleKey* self, void*) {
    return pyVector3_FromVector3(self->fThis->fOutTan);
}
Exemplo n.º 20
0
static PyObject* pyCullPoly_getCenter(pyCullPoly* self, void*) {
    return pyVector3_FromVector3(self->fThis->getCenter());
}
Exemplo n.º 21
0
static PyObject* pyViewFaceModifier_getOffset(pyViewFaceModifier* self, void*) {
    return pyVector3_FromVector3(self->fThis->getOffset());
}
Exemplo n.º 22
0
static PyObject* pyScaleKey_getValue(pyScaleKey* self, void*) {
    return Py_BuildValue("OO",
                         pyVector3_FromVector3(self->fThis->fS),
                         pyQuat_FromQuat(self->fThis->fQ));
}
Exemplo n.º 23
0
static PyObject* pyVector3_positive(pyVector3* self) {
    return pyVector3_FromVector3(hsVector3(+(self->fThis->X), +(self->fThis->Y),
                                           +(self->fThis->Z)));
}
Exemplo n.º 24
0
static PyObject* pyGBufferTriangle_getCenter(pyGBufferTriangle* self, void*) {
    return pyVector3_FromVector3(self->fThis->fCenter);
}
Exemplo n.º 25
0
static PyObject* pyGenericPhysical_getDims(pyGenericPhysical* self, void*) {
    return pyVector3_FromVector3(self->fThis->getDimensions());
}
Exemplo n.º 26
0
static PyObject* pyBounds3_getCenter(pyBounds3* self, void*) {
    return pyVector3_FromVector3(self->fThis->getCenter());
}
Exemplo n.º 27
0
static PyObject* pyPickedEventData_getHitPoint(pyPickedEventData* self, void*) {
    return pyVector3_FromVector3(self->fThis->getHitPoint());
}