Пример #1
0
PyObject* VRPyTransform::setWOrientation(VRPyTransform* self, PyObject* args) {
    if (!self->valid()) return NULL;
    PyObject *d, *u;
    if (! PyArg_ParseTuple(args, "OO", &d, &u)) return NULL;
    self->objPtr->setWorldOrientation(parseVec3fList(d), parseVec3fList(u));
    Py_RETURN_TRUE;
}
Пример #2
0
PyObject* VRPyTransform::setWOrientation(VRPyTransform* self, PyObject* args) {
    if (self->obj == 0) { PyErr_SetString(err, "VRPyTransform::setWDir, Object is invalid"); return NULL; }
    PyObject *d, *u;
    if (! PyArg_ParseTuple(args, "OO", &d, &u)) return NULL;
    self->obj->setWorldOrientation(parseVec3fList(d), parseVec3fList(u));
    Py_RETURN_TRUE;
}
Пример #3
0
PyObject* VRPyTransform::setPose(VRPyTransform* self, PyObject* args) {
    if (self->obj == 0) { PyErr_SetString(err, "VRPyTransform::setPose, Object is invalid"); return NULL; }
    PyObject *fl, *dl, *ul;
    if (! PyArg_ParseTuple(args, "OOO", &fl, &dl, &ul)) return NULL;
    self->obj->setPose( parseVec3fList(fl), parseVec3fList(dl), parseVec3fList(ul));
    Py_RETURN_TRUE;
}
Пример #4
0
PyObject* VRPyMaterial::setQRCode(VRPyMaterial* self, PyObject* args) {
	if (self->objPtr == 0) { PyErr_SetString(err, "VRPyMaterial::setQRCode, C obj is invalid"); return NULL; }
	PyObject *data, *fg, *bg; int i;
    if (! PyArg_ParseTuple(args, "OOOi", &data, &fg, &bg, &i)) return NULL;
	self->objPtr->setQRCode(PyString_AsString(data), parseVec3fList(fg), parseVec3fList(bg), i);
	Py_RETURN_TRUE;
}
Пример #5
0
PyObject* VRPyAnalyticGeometry::setVector(VRPyAnalyticGeometry* self, PyObject* args) {
    if (self->objPtr == 0) { PyErr_SetString(err, "VRPyAnalyticGeometry::set - Object is invalid"); return NULL; }

    int i;
    PyObject *p, *v, *c, *s;
    if (! PyArg_ParseTuple(args, "iOOOO", &i, &p, &v, &c, &s)) return NULL;

    self->objPtr->setVector(i, parseVec3fList(p), parseVec3fList(v), parseVec3fList(c), PyString_AsString(s));
    Py_RETURN_TRUE;
}
Пример #6
0
PyObject* VRPyPath::setEndPoint(VRPyPath* self, PyObject* args) {
    PyObject *_p, *_n, *_c; _p=_n=_c=0;
    if (! PyArg_ParseTuple(args, "OOO", &_p, &_n, &_c)) return NULL;

    OSG::Vec3f p, n, c;
    p = parseVec3fList(_p);
    n = parseVec3fList(_n);
    c = parseVec3fList(_c);

    if (self->obj == 0) { PyErr_SetString(err, "VRPyPath::setEndPoint, Object is invalid"); return NULL; }
    self->obj->addPoint(p,n,c);
    Py_RETURN_TRUE;
}
Пример #7
0
PyObject* VRPyTransform::setPose(VRPyTransform* self, PyObject* args) {
    if (!self->valid()) return NULL;
    if (pySize(args) == 1) {
        VRPyPose* p;
        if (! PyArg_ParseTuple(args, "O", &p)) return NULL;
        if (p->objPtr) self->objPtr->setPose( *p->objPtr );
        Py_RETURN_TRUE;
    }

    PyObject *fl, *dl, *ul;
    if (! PyArg_ParseTuple(args, "OOO", &fl, &dl, &ul)) return NULL;
    self->objPtr->setPose( parseVec3fList(fl), parseVec3fList(dl), parseVec3fList(ul));
    Py_RETURN_TRUE;
}
Пример #8
0
PyObject* VRPyConstructionKit::addObjectAnchor(VRPyConstructionKit* self, PyObject* args) {
    if (!self->valid()) return NULL;
    VRPyGeometry* g; PyObject* p;
    int a; float d;
    if (! PyArg_ParseTuple(args, "OiOf", &g, &a, &p, &d)) return NULL;
    auto anc = self->obj->addObjectAnchor(g->objPtr, a, parseVec3fList(p), d);
    return VRPyGeometry::fromSharedPtr(anc);
}
Пример #9
0
PyObject* VRPyTransform::castRay(VRPyTransform* self, PyObject* args) {
    if (!self->valid()) return NULL;
    VRPyObject* o = 0; PyObject* d;
    if (! PyArg_ParseTuple(args, "OO", &o, &d)) return NULL;
    auto line = self->objPtr->castRay( 0, parseVec3fList(d) );
    OSG::VRIntersect in;
    return VRPyIntersection::fromObject( in.intersect(o->objPtr, line) );
}
Пример #10
0
PyObject* VRPyAnnotationEngine::set(VRPyAnnotationEngine* self, PyObject* args) {
    if (self->objPtr == 0) { PyErr_SetString(err, "VRPyAnnotationEngine::set - Object is invalid"); return NULL; }

    int i;
    PyObject* s;
    PyObject* p;
    if (! PyArg_ParseTuple(args, "iOO", &i, &p, &s)) return NULL;

    self->objPtr->set(i, parseVec3fList(p), PyString_AsString(s));
    Py_RETURN_TRUE;
}
Пример #11
0
PyObject* VRPyPath::set(VRPyPath* self, PyObject* args) {
    if (self->obj == 0) { PyErr_SetString(err, "VRPyPath::set, Object is invalid"); return NULL; }

    int i;
    PyObject *p1, *p2, *n1, *n2, *u1 = 0, *u2 = 0;
    if (PyList_GET_SIZE(args) <= 5) {
        if (! PyArg_ParseTuple(args, "OOOOi", &p1, &n1, &p2, &n2, &i)) return NULL;
    } else if (! PyArg_ParseTuple(args, "OOOOOOi", &p1, &n1, &u1, &p2, &n2, &u2, &i)) return NULL;

    OSG::Vec3f c, uv1(0,1,0), uv2(0,1,0);
    if (u1) uv1 = parseVec3fList(u1);
    if (u2) uv2 = parseVec3fList(u2);
    self->obj->addPoint(parseVec3fList(p1), parseVec3fList(n1), c, uv1);
    self->obj->addPoint(parseVec3fList(p2), parseVec3fList(n2), c, uv2);
    self->obj->compute(i);
    Py_RETURN_TRUE;
}
Пример #12
0
PyObject* VRPyConstructionKit::addAnchorType(VRPyConstructionKit* self, PyObject* args) {
    if (!self->valid()) return NULL;
    float f; PyObject* o = 0;
    if (! PyArg_ParseTuple(args, "fO", &f, &o)) return NULL;
    return PyInt_FromLong( self->obj->addAnchorType(f, parseVec3fList(o)) );
}
Пример #13
0
PyObject* VRPyTransform::setPhysicsConstraintTo(VRPyTransform* self, PyObject *args) {
    if (!self->valid()) return NULL;
    //if this is soft, the args have to be: RigidBody other, int nodeIndex, vec3 localpivot, bool ignoreCollision, float influence
    VRPyTransform *t;
    if(self->objPtr->getPhysics()->isSoft()) {
        int nodeIndex;
        int ignoreCollision;
        float influence;
        PyObject* localPiv;
        if (! PyArg_ParseTuple(args, "OiOif", &t, &nodeIndex, &localPiv, &ignoreCollision, &influence)) return NULL;
        self->objPtr->getPhysics()->setConstraint(t->objPtr->getPhysics(), nodeIndex, parseVec3fList(localPiv), ignoreCollision, influence);
    }
    else {
        VRPyTransform *t; VRPyConstraint *c; VRPyConstraint *cs;
        if (! PyArg_ParseTuple(args, "OOO", &t, &c, &cs)) return NULL;
        self->objPtr->getPhysics()->setConstraint( t->objPtr->getPhysics(), c->obj, cs->obj );
    }
    Py_RETURN_TRUE;
}