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