patch [#15865] BGE API call to delete objects

from Dalai Felinto (dfelinto) 
renamed deleteObject to endObject() to match the user interface.
This commit is contained in:
2008-06-27 11:35:55 +00:00
parent a8f00246ba
commit f0a3cbcdac
3 changed files with 20 additions and 1 deletions

View File

@@ -825,6 +825,7 @@ PyMethodDef KX_GameObject::Methods[] = {
{"getMesh", (PyCFunction)KX_GameObject::sPyGetMesh,METH_VARARGS},
{"getPhysicsId", (PyCFunction)KX_GameObject::sPyGetPhysicsId,METH_VARARGS},
{"getPropertyNames", (PyCFunction)KX_GameObject::sPyGetPropertyNames,METH_VARARGS},
{"endObject",(PyCFunction) KX_GameObject::sPyEndObject, METH_VARARGS},
KX_PYMETHODTABLE(KX_GameObject, getDistanceTo),
KX_PYMETHODTABLE(KX_GameObject, rayCastTo),
KX_PYMETHODTABLE(KX_GameObject, rayCast),
@@ -858,6 +859,18 @@ PyObject* KX_GameObject::sPySetPosition(PyObject* self,
}
PyObject* KX_GameObject::PyEndObject(PyObject* self,
PyObject* args,
PyObject* kwds)
{
KX_Scene *scene = PHY_GetActiveScene();
scene->DelayedRemoveObject(this);
return Py_None;
}
PyObject* KX_GameObject::PyGetPosition(PyObject* self,
PyObject* args,