PyAPI RNA/BGE

* all mathutils types now have optional callbacks
* PyRNA returns mathutils quat and euler types automatically when they have the rotation subtype.
* PyRNA, reuse the BPy_StructRNA PyObject rather name making a new one for each function returned.
* use more arithb.c functions for Mathutils quaternion type (less inline cruft).
* BGE Mathutils integration mostly finished- KX_PyMath now converts to Mathutils types rather then lists.
* make all mathutils types share the same header so they can share a number of functions - dealloc, getWrapped, getOwner.
This commit is contained in:
Campbell Barton
2009-06-25 10:11:37 +00:00
parent 7a357cba39
commit d428ba1de8
21 changed files with 714 additions and 611 deletions

View File

@@ -1184,11 +1184,7 @@ CListValue* KX_GameObject::GetChildrenRecursive()
return list;
}
#ifdef USE_MATHUTILS
extern "C" {
#include "../../blender/python/generic/Mathutils.h" /* so we can have mathutils callbacks */
}
/* These require an SGNode */
#define MATHUTILS_VEC_CB_POS_LOCAL 1
@@ -1880,12 +1876,7 @@ int KX_GameObject::pyattr_set_worldOrientation(void *self_v, const KX_PYATTRIBUT
if (!PyOrientationTo(value, rot, "gameOb.worldOrientation = sequence: KX_GameObject, "))
return PY_SET_ATTR_FAIL;
if (self->GetSGNode() && self->GetSGNode()->GetSGParent()) {
self->NodeSetLocalOrientation(self->GetSGNode()->GetSGParent()->GetWorldOrientation().inverse()*rot);
}
else {
self->NodeSetLocalOrientation(rot);
}
self->NodeSetGlobalOrientation(rot);
self->NodeUpdateGS(0.f);
return PY_SET_ATTR_SUCCESS;