remove all python api functions deprecated in 2.49
This commit is contained in:
@@ -436,365 +436,6 @@ bool BL_ActionActuator::Update(double curtime, bool frame)
|
||||
/* Python functions */
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
/* setStart */
|
||||
const char BL_ActionActuator::GetAction_doc[] =
|
||||
"getAction()\n"
|
||||
"\tReturns a string containing the name of the current action.\n";
|
||||
|
||||
PyObject* BL_ActionActuator::PyGetAction(PyObject* args,
|
||||
PyObject* kwds) {
|
||||
ShowDeprecationWarning("getAction()", "the action property");
|
||||
|
||||
if (m_action){
|
||||
return PyUnicode_FromString(m_action->id.name+2);
|
||||
}
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* getProperty */
|
||||
const char BL_ActionActuator::GetProperty_doc[] =
|
||||
"getProperty()\n"
|
||||
"\tReturns the name of the property to be used in FromProp mode.\n";
|
||||
|
||||
PyObject* BL_ActionActuator::PyGetProperty(PyObject* args,
|
||||
PyObject* kwds) {
|
||||
ShowDeprecationWarning("getProperty()", "the property property");
|
||||
|
||||
PyObject *result;
|
||||
|
||||
result = Py_BuildValue("s", (const char *)m_propname);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/* getProperty */
|
||||
const char BL_ActionActuator::GetFrameProperty_doc[] =
|
||||
"getFrameProperty()\n"
|
||||
"\tReturns the name of the property, that is set to the current frame number.\n";
|
||||
|
||||
PyObject* BL_ActionActuator::PyGetFrameProperty(PyObject* args,
|
||||
PyObject* kwds) {
|
||||
ShowDeprecationWarning("getFrameProperty()", "the frameProperty property");
|
||||
|
||||
PyObject *result;
|
||||
|
||||
result = Py_BuildValue("s", (const char *)m_framepropname);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/* getFrame */
|
||||
const char BL_ActionActuator::GetFrame_doc[] =
|
||||
"getFrame()\n"
|
||||
"\tReturns the current frame number.\n";
|
||||
|
||||
PyObject* BL_ActionActuator::PyGetFrame(PyObject* args,
|
||||
PyObject* kwds) {
|
||||
ShowDeprecationWarning("getFrame()", "the frame property");
|
||||
|
||||
PyObject *result;
|
||||
|
||||
result = Py_BuildValue("f", m_localtime);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/* getEnd */
|
||||
const char BL_ActionActuator::GetEnd_doc[] =
|
||||
"getEnd()\n"
|
||||
"\tReturns the last frame of the action.\n";
|
||||
|
||||
PyObject* BL_ActionActuator::PyGetEnd(PyObject* args,
|
||||
PyObject* kwds) {
|
||||
ShowDeprecationWarning("getEnd()", "the end property");
|
||||
|
||||
PyObject *result;
|
||||
|
||||
result = Py_BuildValue("f", m_endframe);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/* getStart */
|
||||
const char BL_ActionActuator::GetStart_doc[] =
|
||||
"getStart()\n"
|
||||
"\tReturns the starting frame of the action.\n";
|
||||
|
||||
PyObject* BL_ActionActuator::PyGetStart(PyObject* args,
|
||||
PyObject* kwds) {
|
||||
ShowDeprecationWarning("getStart()", "the start property");
|
||||
|
||||
PyObject *result;
|
||||
|
||||
result = Py_BuildValue("f", m_startframe);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/* getBlendin */
|
||||
const char BL_ActionActuator::GetBlendin_doc[] =
|
||||
"getBlendin()\n"
|
||||
"\tReturns the number of interpolation animation frames to be\n"
|
||||
"\tgenerated when this actuator is triggered.\n";
|
||||
|
||||
PyObject* BL_ActionActuator::PyGetBlendin(PyObject* args,
|
||||
PyObject* kwds) {
|
||||
ShowDeprecationWarning("getBlendin()", "the blendin property");
|
||||
|
||||
PyObject *result;
|
||||
|
||||
result = Py_BuildValue("f", m_blendin);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/* getPriority */
|
||||
const char BL_ActionActuator::GetPriority_doc[] =
|
||||
"getPriority()\n"
|
||||
"\tReturns the priority for this actuator. Actuators with lower\n"
|
||||
"\tPriority numbers will override actuators with higher numbers.\n";
|
||||
|
||||
PyObject* BL_ActionActuator::PyGetPriority(PyObject* args,
|
||||
PyObject* kwds) {
|
||||
ShowDeprecationWarning("getPriority()", "the priority property");
|
||||
|
||||
PyObject *result;
|
||||
|
||||
result = Py_BuildValue("i", m_priority);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/* setAction */
|
||||
const char BL_ActionActuator::SetAction_doc[] =
|
||||
"setAction(action, (reset))\n"
|
||||
"\t - action : The name of the action to set as the current action.\n"
|
||||
"\t - reset : Optional parameter indicating whether to reset the\n"
|
||||
"\t blend timer or not. A value of 1 indicates that the\n"
|
||||
"\t timer should be reset. A value of 0 will leave it\n"
|
||||
"\t unchanged. If reset is not specified, the timer will"
|
||||
"\t be reset.\n";
|
||||
|
||||
PyObject* BL_ActionActuator::PySetAction(PyObject* args,
|
||||
PyObject* kwds) {
|
||||
ShowDeprecationWarning("setAction()", "the action property");
|
||||
|
||||
char *string;
|
||||
int reset = 1;
|
||||
|
||||
if (PyArg_ParseTuple(args,"s|i:setAction",&string, &reset))
|
||||
{
|
||||
bAction *action;
|
||||
|
||||
action = (bAction*)SCA_ILogicBrick::m_sCurrentLogicManager->GetActionByName(STR_String(string));
|
||||
|
||||
if (!action){
|
||||
/* NOTE! Throw an exception or something */
|
||||
// printf ("setAction failed: Action not found\n", string);
|
||||
}
|
||||
else{
|
||||
m_action=action;
|
||||
if (reset)
|
||||
m_blendframe = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* setStart */
|
||||
const char BL_ActionActuator::SetStart_doc[] =
|
||||
"setStart(start)\n"
|
||||
"\t - start : Specifies the starting frame of the animation.\n";
|
||||
|
||||
PyObject* BL_ActionActuator::PySetStart(PyObject* args,
|
||||
PyObject* kwds) {
|
||||
ShowDeprecationWarning("setStart()", "the start property");
|
||||
|
||||
float start;
|
||||
|
||||
if (PyArg_ParseTuple(args,"f:setStart",&start))
|
||||
{
|
||||
m_startframe = start;
|
||||
}
|
||||
else {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* setEnd */
|
||||
const char BL_ActionActuator::SetEnd_doc[] =
|
||||
"setEnd(end)\n"
|
||||
"\t - end : Specifies the ending frame of the animation.\n";
|
||||
|
||||
PyObject* BL_ActionActuator::PySetEnd(PyObject* args,
|
||||
PyObject* kwds) {
|
||||
ShowDeprecationWarning("setEnd()", "the end property");
|
||||
|
||||
float end;
|
||||
|
||||
if (PyArg_ParseTuple(args,"f:setEnd",&end))
|
||||
{
|
||||
m_endframe = end;
|
||||
}
|
||||
else {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* setBlendin */
|
||||
const char BL_ActionActuator::SetBlendin_doc[] =
|
||||
"setBlendin(blendin)\n"
|
||||
"\t - blendin : Specifies the number of frames of animation to generate\n"
|
||||
"\t when making transitions between actions.\n";
|
||||
|
||||
PyObject* BL_ActionActuator::PySetBlendin(PyObject* args,
|
||||
PyObject* kwds) {
|
||||
ShowDeprecationWarning("setBlendin()", "the blendin property");
|
||||
|
||||
float blendin;
|
||||
|
||||
if (PyArg_ParseTuple(args,"f:setBlendin",&blendin))
|
||||
{
|
||||
m_blendin = blendin;
|
||||
}
|
||||
else {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* setBlendtime */
|
||||
const char BL_ActionActuator::SetBlendtime_doc[] =
|
||||
"setBlendtime(blendtime)\n"
|
||||
"\t - blendtime : Allows the script to directly modify the internal timer\n"
|
||||
"\t used when generating transitions between actions. This\n"
|
||||
"\t parameter must be in the range from 0.0 to 1.0.\n";
|
||||
|
||||
PyObject* BL_ActionActuator::PySetBlendtime(PyObject* args,
|
||||
PyObject* kwds) {
|
||||
ShowDeprecationWarning("setBlendtime()", "the blendtime property");
|
||||
|
||||
float blendframe;
|
||||
|
||||
if (PyArg_ParseTuple(args,"f:setBlendtime",&blendframe))
|
||||
{
|
||||
m_blendframe = blendframe * m_blendin;
|
||||
if (m_blendframe<0)
|
||||
m_blendframe = 0;
|
||||
if (m_blendframe>m_blendin)
|
||||
m_blendframe = m_blendin;
|
||||
}
|
||||
else {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* setPriority */
|
||||
const char BL_ActionActuator::SetPriority_doc[] =
|
||||
"setPriority(priority)\n"
|
||||
"\t - priority : Specifies the new priority. Actuators will lower\n"
|
||||
"\t priority numbers will override actuators with higher\n"
|
||||
"\t numbers.\n";
|
||||
|
||||
PyObject* BL_ActionActuator::PySetPriority(PyObject* args,
|
||||
PyObject* kwds) {
|
||||
ShowDeprecationWarning("setPriority()", "the priority property");
|
||||
|
||||
int priority;
|
||||
|
||||
if (PyArg_ParseTuple(args,"i:setPriority",&priority))
|
||||
{
|
||||
m_priority = priority;
|
||||
}
|
||||
else {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* setFrame */
|
||||
const char BL_ActionActuator::SetFrame_doc[] =
|
||||
"setFrame(frame)\n"
|
||||
"\t - frame : Specifies the new current frame for the animation\n";
|
||||
|
||||
PyObject* BL_ActionActuator::PySetFrame(PyObject* args,
|
||||
PyObject* kwds) {
|
||||
ShowDeprecationWarning("setFrame()", "the frame property");
|
||||
|
||||
float frame;
|
||||
|
||||
if (PyArg_ParseTuple(args,"f:setFrame",&frame))
|
||||
{
|
||||
m_localtime = frame;
|
||||
if (m_localtime<m_startframe)
|
||||
m_localtime=m_startframe;
|
||||
else if (m_localtime>m_endframe)
|
||||
m_localtime=m_endframe;
|
||||
}
|
||||
else {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* setProperty */
|
||||
const char BL_ActionActuator::SetProperty_doc[] =
|
||||
"setProperty(prop)\n"
|
||||
"\t - prop : A string specifying the property name to be used in\n"
|
||||
"\t FromProp playback mode.\n";
|
||||
|
||||
PyObject* BL_ActionActuator::PySetProperty(PyObject* args,
|
||||
PyObject* kwds) {
|
||||
ShowDeprecationWarning("setProperty()", "the property property");
|
||||
|
||||
char *string;
|
||||
|
||||
if (PyArg_ParseTuple(args,"s:setProperty",&string))
|
||||
{
|
||||
m_propname = string;
|
||||
}
|
||||
else {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* setFrameProperty */
|
||||
const char BL_ActionActuator::SetFrameProperty_doc[] =
|
||||
"setFrameProperty(prop)\n"
|
||||
"\t - prop : A string specifying the property of the frame set up update.\n";
|
||||
|
||||
PyObject* BL_ActionActuator::PySetFrameProperty(PyObject* args,
|
||||
PyObject* kwds) {
|
||||
ShowDeprecationWarning("setFrameProperty()", "the frameProperty property");
|
||||
|
||||
char *string;
|
||||
|
||||
if (PyArg_ParseTuple(args,"s:setFrameProperty",&string))
|
||||
{
|
||||
m_framepropname = string;
|
||||
}
|
||||
else {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyObject* BL_ActionActuator::PyGetChannel(PyObject* value) {
|
||||
char *string= _PyUnicode_AsString(value);
|
||||
|
||||
@@ -849,72 +490,6 @@ PyObject* BL_ActionActuator::PyGetChannel(PyObject* value) {
|
||||
*/
|
||||
}
|
||||
|
||||
/* getType */
|
||||
const char BL_ActionActuator::GetType_doc[] =
|
||||
"getType()\n"
|
||||
"\tReturns the operation mode of the actuator.\n";
|
||||
PyObject* BL_ActionActuator::PyGetType(PyObject* args,
|
||||
PyObject* kwds) {
|
||||
ShowDeprecationWarning("getType()", "the type property");
|
||||
|
||||
return Py_BuildValue("h", m_playtype);
|
||||
}
|
||||
|
||||
/* setType */
|
||||
const char BL_ActionActuator::SetType_doc[] =
|
||||
"setType(mode)\n"
|
||||
"\t - mode: Play (0), Flipper (2), LoopStop (3), LoopEnd (4) or Property (6)\n"
|
||||
"\tSet the operation mode of the actuator.\n";
|
||||
PyObject* BL_ActionActuator::PySetType(PyObject* args,
|
||||
PyObject* kwds) {
|
||||
ShowDeprecationWarning("setType()", "the type property");
|
||||
|
||||
short typeArg;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "h:setType", &typeArg)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
switch (typeArg) {
|
||||
case ACT_ACTION_PLAY:
|
||||
case ACT_ACTION_FLIPPER:
|
||||
case ACT_ACTION_LOOP_STOP:
|
||||
case ACT_ACTION_LOOP_END:
|
||||
case ACT_ACTION_FROM_PROP:
|
||||
m_playtype = typeArg;
|
||||
break;
|
||||
default:
|
||||
printf("Invalid type for action actuator: %d\n", typeArg); /* error */
|
||||
}
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyObject* BL_ActionActuator::PyGetContinue() {
|
||||
ShowDeprecationWarning("getContinue()", "the continue property");
|
||||
|
||||
return PyLong_FromSsize_t((long)(m_end_reset==0));
|
||||
}
|
||||
|
||||
PyObject* BL_ActionActuator::PySetContinue(PyObject* value) {
|
||||
ShowDeprecationWarning("setContinue()", "the continue property");
|
||||
|
||||
int param = PyObject_IsTrue( value );
|
||||
|
||||
if( param == -1 ) {
|
||||
PyErr_SetString( PyExc_TypeError, "expected True/False or 0/1" );
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (param) {
|
||||
m_end_reset = 0;
|
||||
} else {
|
||||
m_end_reset = 1;
|
||||
}
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
//<-----Deprecated
|
||||
|
||||
/* setChannel */
|
||||
KX_PYMETHODDEF_DOC(BL_ActionActuator, setChannel,
|
||||
"setChannel(channel, matrix)\n"
|
||||
@@ -1028,31 +603,7 @@ PyTypeObject BL_ActionActuator::Type = {
|
||||
};
|
||||
|
||||
PyMethodDef BL_ActionActuator::Methods[] = {
|
||||
//Deprecated ----->
|
||||
{"setAction", (PyCFunction) BL_ActionActuator::sPySetAction, METH_VARARGS, (const char *)SetAction_doc},
|
||||
{"setStart", (PyCFunction) BL_ActionActuator::sPySetStart, METH_VARARGS, (const char *)SetStart_doc},
|
||||
{"setEnd", (PyCFunction) BL_ActionActuator::sPySetEnd, METH_VARARGS, (const char *)SetEnd_doc},
|
||||
{"setBlendin", (PyCFunction) BL_ActionActuator::sPySetBlendin, METH_VARARGS, (const char *)SetBlendin_doc},
|
||||
{"setPriority", (PyCFunction) BL_ActionActuator::sPySetPriority, METH_VARARGS, (const char *)SetPriority_doc},
|
||||
{"setFrame", (PyCFunction) BL_ActionActuator::sPySetFrame, METH_VARARGS, (const char *)SetFrame_doc},
|
||||
{"setProperty", (PyCFunction) BL_ActionActuator::sPySetProperty, METH_VARARGS, (const char *)SetProperty_doc},
|
||||
{"setFrameProperty", (PyCFunction) BL_ActionActuator::sPySetFrameProperty, METH_VARARGS, (const char *)SetFrameProperty_doc},
|
||||
{"setBlendtime", (PyCFunction) BL_ActionActuator::sPySetBlendtime, METH_VARARGS, (const char *)SetBlendtime_doc},
|
||||
|
||||
{"getAction", (PyCFunction) BL_ActionActuator::sPyGetAction, METH_VARARGS, (const char *)GetAction_doc},
|
||||
{"getStart", (PyCFunction) BL_ActionActuator::sPyGetStart, METH_VARARGS, (const char *)GetStart_doc},
|
||||
{"getEnd", (PyCFunction) BL_ActionActuator::sPyGetEnd, METH_VARARGS, (const char *)GetEnd_doc},
|
||||
{"getBlendin", (PyCFunction) BL_ActionActuator::sPyGetBlendin, METH_VARARGS, (const char *)GetBlendin_doc},
|
||||
{"getPriority", (PyCFunction) BL_ActionActuator::sPyGetPriority, METH_VARARGS, (const char *)GetPriority_doc},
|
||||
{"getFrame", (PyCFunction) BL_ActionActuator::sPyGetFrame, METH_VARARGS, (const char *)GetFrame_doc},
|
||||
{"getProperty", (PyCFunction) BL_ActionActuator::sPyGetProperty, METH_VARARGS, (const char *)GetProperty_doc},
|
||||
{"getFrameProperty", (PyCFunction) BL_ActionActuator::sPyGetFrameProperty, METH_VARARGS, (const char *)GetFrameProperty_doc},
|
||||
{"getChannel", (PyCFunction) BL_ActionActuator::sPyGetChannel, METH_O},
|
||||
{"getType", (PyCFunction) BL_ActionActuator::sPyGetType, METH_VARARGS, (const char *)GetType_doc},
|
||||
{"setType", (PyCFunction) BL_ActionActuator::sPySetType, METH_VARARGS, (const char *)SetType_doc},
|
||||
{"getContinue", (PyCFunction) BL_ActionActuator::sPyGetContinue, METH_NOARGS, 0},
|
||||
{"setContinue", (PyCFunction) BL_ActionActuator::sPySetContinue, METH_O, 0},
|
||||
//<------
|
||||
KX_PYMETHODTABLE(BL_ActionActuator, setChannel),
|
||||
{NULL,NULL} //Sentinel
|
||||
};
|
||||
|
@@ -84,32 +84,7 @@ public:
|
||||
bAction* GetAction() { return m_action; }
|
||||
void SetAction(bAction* act) { m_action= act; }
|
||||
|
||||
//Deprecated ----->
|
||||
KX_PYMETHOD_DOC(BL_ActionActuator,SetAction);
|
||||
KX_PYMETHOD_DOC(BL_ActionActuator,SetBlendin);
|
||||
KX_PYMETHOD_DOC(BL_ActionActuator,SetPriority);
|
||||
KX_PYMETHOD_DOC(BL_ActionActuator,SetStart);
|
||||
KX_PYMETHOD_DOC(BL_ActionActuator,SetEnd);
|
||||
KX_PYMETHOD_DOC(BL_ActionActuator,SetFrame);
|
||||
KX_PYMETHOD_DOC(BL_ActionActuator,SetProperty);
|
||||
KX_PYMETHOD_DOC(BL_ActionActuator,SetFrameProperty);
|
||||
KX_PYMETHOD_DOC(BL_ActionActuator,SetBlendtime);
|
||||
|
||||
KX_PYMETHOD_DOC(BL_ActionActuator,GetAction);
|
||||
KX_PYMETHOD_DOC(BL_ActionActuator,GetBlendin);
|
||||
KX_PYMETHOD_DOC(BL_ActionActuator,GetPriority);
|
||||
KX_PYMETHOD_DOC(BL_ActionActuator,GetStart);
|
||||
KX_PYMETHOD_DOC(BL_ActionActuator,GetEnd);
|
||||
KX_PYMETHOD_DOC(BL_ActionActuator,GetFrame);
|
||||
KX_PYMETHOD_DOC(BL_ActionActuator,GetProperty);
|
||||
KX_PYMETHOD_DOC(BL_ActionActuator,GetFrameProperty);
|
||||
KX_PYMETHOD_O(BL_ActionActuator,GetChannel);
|
||||
KX_PYMETHOD_DOC(BL_ActionActuator,GetType);
|
||||
KX_PYMETHOD_DOC(BL_ActionActuator,SetType);
|
||||
KX_PYMETHOD_NOARGS(BL_ActionActuator,GetContinue);
|
||||
KX_PYMETHOD_O(BL_ActionActuator,SetContinue);
|
||||
//<-----
|
||||
|
||||
KX_PYMETHOD_DOC(BL_ActionActuator,setChannel);
|
||||
|
||||
static PyObject* pyattr_get_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
|
@@ -434,26 +434,6 @@ PyTypeObject BL_ShapeActionActuator::Type = {
|
||||
|
||||
|
||||
PyMethodDef BL_ShapeActionActuator::Methods[] = {
|
||||
{"setAction", (PyCFunction) BL_ShapeActionActuator::sPySetAction, METH_VARARGS, (const char *)SetAction_doc},
|
||||
{"setStart", (PyCFunction) BL_ShapeActionActuator::sPySetStart, METH_VARARGS, (const char *)SetStart_doc},
|
||||
{"setEnd", (PyCFunction) BL_ShapeActionActuator::sPySetEnd, METH_VARARGS, (const char *)SetEnd_doc},
|
||||
{"setBlendin", (PyCFunction) BL_ShapeActionActuator::sPySetBlendin, METH_VARARGS, (const char *)SetBlendin_doc},
|
||||
{"setPriority", (PyCFunction) BL_ShapeActionActuator::sPySetPriority, METH_VARARGS, (const char *)SetPriority_doc},
|
||||
{"setFrame", (PyCFunction) BL_ShapeActionActuator::sPySetFrame, METH_VARARGS, (const char *)SetFrame_doc},
|
||||
{"setProperty", (PyCFunction) BL_ShapeActionActuator::sPySetProperty, METH_VARARGS, (const char *)SetProperty_doc},
|
||||
{"setFrameProperty", (PyCFunction) BL_ShapeActionActuator::sPySetFrameProperty, METH_VARARGS, (const char *)SetFrameProperty_doc},
|
||||
{"setBlendtime", (PyCFunction) BL_ShapeActionActuator::sPySetBlendtime, METH_VARARGS, (const char *)SetBlendtime_doc},
|
||||
|
||||
{"getAction", (PyCFunction) BL_ShapeActionActuator::sPyGetAction, METH_NOARGS, (const char *)GetAction_doc},
|
||||
{"getStart", (PyCFunction) BL_ShapeActionActuator::sPyGetStart, METH_NOARGS, (const char *)GetStart_doc},
|
||||
{"getEnd", (PyCFunction) BL_ShapeActionActuator::sPyGetEnd, METH_NOARGS, (const char *)GetEnd_doc},
|
||||
{"getBlendin", (PyCFunction) BL_ShapeActionActuator::sPyGetBlendin, METH_NOARGS, (const char *)GetBlendin_doc},
|
||||
{"getPriority", (PyCFunction) BL_ShapeActionActuator::sPyGetPriority, METH_NOARGS, (const char *)GetPriority_doc},
|
||||
{"getFrame", (PyCFunction) BL_ShapeActionActuator::sPyGetFrame, METH_NOARGS, (const char *)GetFrame_doc},
|
||||
{"getProperty", (PyCFunction) BL_ShapeActionActuator::sPyGetProperty, METH_NOARGS, (const char *)GetProperty_doc},
|
||||
{"getFrameProperty", (PyCFunction) BL_ShapeActionActuator::sPyGetFrameProperty, METH_NOARGS, (const char *)GetFrameProperty_doc},
|
||||
{"getType", (PyCFunction) BL_ShapeActionActuator::sPyGetType, METH_NOARGS, (const char *)GetType_doc},
|
||||
{"setType", (PyCFunction) BL_ShapeActionActuator::sPySetType, METH_NOARGS, (const char *)SetType_doc},
|
||||
{NULL,NULL} //Sentinel
|
||||
};
|
||||
|
||||
@@ -471,370 +451,6 @@ PyAttributeDef BL_ShapeActionActuator::Attributes[] = {
|
||||
{ NULL } //Sentinel
|
||||
};
|
||||
|
||||
/* setStart */
|
||||
const char BL_ShapeActionActuator::GetAction_doc[] =
|
||||
"getAction()\n"
|
||||
"\tReturns a string containing the name of the current action.\n";
|
||||
|
||||
PyObject* BL_ShapeActionActuator::PyGetAction() {
|
||||
ShowDeprecationWarning("getAction()", "the action property");
|
||||
if (m_action){
|
||||
return PyUnicode_FromString(m_action->id.name+2);
|
||||
}
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* getProperty */
|
||||
const char BL_ShapeActionActuator::GetProperty_doc[] =
|
||||
"getProperty()\n"
|
||||
"\tReturns the name of the property to be used in FromProp mode.\n";
|
||||
|
||||
PyObject* BL_ShapeActionActuator::PyGetProperty() {
|
||||
ShowDeprecationWarning("getProperty()", "the property property");
|
||||
PyObject *result;
|
||||
|
||||
result = Py_BuildValue("s", (const char *)m_propname);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/* getFrame */
|
||||
const char BL_ShapeActionActuator::GetFrame_doc[] =
|
||||
"getFrame()\n"
|
||||
"\tReturns the current frame number.\n";
|
||||
|
||||
PyObject* BL_ShapeActionActuator::PyGetFrame() {
|
||||
ShowDeprecationWarning("getFrame()", "the frame property");
|
||||
PyObject *result;
|
||||
|
||||
result = Py_BuildValue("f", m_localtime);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/* getEnd */
|
||||
const char BL_ShapeActionActuator::GetEnd_doc[] =
|
||||
"getEnd()\n"
|
||||
"\tReturns the last frame of the action.\n";
|
||||
|
||||
PyObject* BL_ShapeActionActuator::PyGetEnd() {
|
||||
ShowDeprecationWarning("getEnd()", "the end property");
|
||||
PyObject *result;
|
||||
|
||||
result = Py_BuildValue("f", m_endframe);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/* getStart */
|
||||
const char BL_ShapeActionActuator::GetStart_doc[] =
|
||||
"getStart()\n"
|
||||
"\tReturns the starting frame of the action.\n";
|
||||
|
||||
PyObject* BL_ShapeActionActuator::PyGetStart() {
|
||||
ShowDeprecationWarning("getStart()", "the start property");
|
||||
PyObject *result;
|
||||
|
||||
result = Py_BuildValue("f", m_startframe);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/* getBlendin */
|
||||
const char BL_ShapeActionActuator::GetBlendin_doc[] =
|
||||
"getBlendin()\n"
|
||||
"\tReturns the number of interpolation animation frames to be\n"
|
||||
"\tgenerated when this actuator is triggered.\n";
|
||||
|
||||
PyObject* BL_ShapeActionActuator::PyGetBlendin() {
|
||||
ShowDeprecationWarning("getBlendin()", "the blendin property");
|
||||
PyObject *result;
|
||||
|
||||
result = Py_BuildValue("f", m_blendin);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/* getPriority */
|
||||
const char BL_ShapeActionActuator::GetPriority_doc[] =
|
||||
"getPriority()\n"
|
||||
"\tReturns the priority for this actuator. Actuators with lower\n"
|
||||
"\tPriority numbers will override actuators with higher numbers.\n";
|
||||
|
||||
PyObject* BL_ShapeActionActuator::PyGetPriority() {
|
||||
ShowDeprecationWarning("getPriority()", "the priority property");
|
||||
PyObject *result;
|
||||
|
||||
result = Py_BuildValue("i", m_priority);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/* setAction */
|
||||
const char BL_ShapeActionActuator::SetAction_doc[] =
|
||||
"setAction(action, (reset))\n"
|
||||
"\t - action : The name of the action to set as the current action.\n"
|
||||
"\t Should be an action with Shape channels.\n"
|
||||
"\t - reset : Optional parameter indicating whether to reset the\n"
|
||||
"\t blend timer or not. A value of 1 indicates that the\n"
|
||||
"\t timer should be reset. A value of 0 will leave it\n"
|
||||
"\t unchanged. If reset is not specified, the timer will"
|
||||
"\t be reset.\n";
|
||||
|
||||
PyObject* BL_ShapeActionActuator::PySetAction(PyObject* args) {
|
||||
ShowDeprecationWarning("setAction()", "the action property");
|
||||
char *string;
|
||||
int reset = 1;
|
||||
|
||||
if (PyArg_ParseTuple(args,"s|i:setAction",&string, &reset))
|
||||
{
|
||||
bAction *action;
|
||||
|
||||
action = (bAction*)SCA_ILogicBrick::m_sCurrentLogicManager->GetActionByName(STR_String(string));
|
||||
|
||||
if (!action){
|
||||
/* NOTE! Throw an exception or something */
|
||||
// printf ("setAction failed: Action not found\n", string);
|
||||
}
|
||||
else{
|
||||
m_action=action;
|
||||
if (reset)
|
||||
m_blendframe = 0.f;
|
||||
}
|
||||
}
|
||||
else {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* setStart */
|
||||
const char BL_ShapeActionActuator::SetStart_doc[] =
|
||||
"setStart(start)\n"
|
||||
"\t - start : Specifies the starting frame of the animation.\n";
|
||||
|
||||
PyObject* BL_ShapeActionActuator::PySetStart(PyObject* args) {
|
||||
ShowDeprecationWarning("setStart()", "the start property");
|
||||
float start;
|
||||
|
||||
if (PyArg_ParseTuple(args,"f:setStart",&start))
|
||||
{
|
||||
m_startframe = start;
|
||||
}
|
||||
else {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* setEnd */
|
||||
const char BL_ShapeActionActuator::SetEnd_doc[] =
|
||||
"setEnd(end)\n"
|
||||
"\t - end : Specifies the ending frame of the animation.\n";
|
||||
|
||||
PyObject* BL_ShapeActionActuator::PySetEnd(PyObject* args) {
|
||||
ShowDeprecationWarning("setEnd()", "the end property");
|
||||
float end;
|
||||
|
||||
if (PyArg_ParseTuple(args,"f:setEnd",&end))
|
||||
{
|
||||
m_endframe = end;
|
||||
}
|
||||
else {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* setBlendin */
|
||||
const char BL_ShapeActionActuator::SetBlendin_doc[] =
|
||||
"setBlendin(blendin)\n"
|
||||
"\t - blendin : Specifies the number of frames of animation to generate\n"
|
||||
"\t when making transitions between actions.\n";
|
||||
|
||||
PyObject* BL_ShapeActionActuator::PySetBlendin(PyObject* args) {
|
||||
ShowDeprecationWarning("setBlendin()", "the blendin property");
|
||||
float blendin;
|
||||
|
||||
if (PyArg_ParseTuple(args,"f:setBlendin",&blendin))
|
||||
{
|
||||
m_blendin = blendin;
|
||||
}
|
||||
else {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* setBlendtime */
|
||||
const char BL_ShapeActionActuator::SetBlendtime_doc[] =
|
||||
"setBlendtime(blendtime)\n"
|
||||
"\t - blendtime : Allows the script to directly modify the internal timer\n"
|
||||
"\t used when generating transitions between actions. This\n"
|
||||
"\t parameter must be in the range from 0.0 to 1.0.\n";
|
||||
|
||||
PyObject* BL_ShapeActionActuator::PySetBlendtime(PyObject* args) {
|
||||
ShowDeprecationWarning("setBlendtime()", "the blendTime property");
|
||||
float blendframe;
|
||||
|
||||
if (PyArg_ParseTuple(args,"f:setBlendtime",&blendframe))
|
||||
{
|
||||
m_blendframe = blendframe * m_blendin;
|
||||
if (m_blendframe<0.f)
|
||||
m_blendframe = 0.f;
|
||||
if (m_blendframe>m_blendin)
|
||||
m_blendframe = m_blendin;
|
||||
}
|
||||
else {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* setPriority */
|
||||
const char BL_ShapeActionActuator::SetPriority_doc[] =
|
||||
"setPriority(priority)\n"
|
||||
"\t - priority : Specifies the new priority. Actuators will lower\n"
|
||||
"\t priority numbers will override actuators with higher\n"
|
||||
"\t numbers.\n";
|
||||
|
||||
PyObject* BL_ShapeActionActuator::PySetPriority(PyObject* args) {
|
||||
ShowDeprecationWarning("setPriority()", "the priority property");
|
||||
int priority;
|
||||
|
||||
if (PyArg_ParseTuple(args,"i:setPriority",&priority))
|
||||
{
|
||||
m_priority = priority;
|
||||
}
|
||||
else {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* getProperty */
|
||||
const char BL_ShapeActionActuator::GetFrameProperty_doc[] =
|
||||
"getFrameProperty()\n"
|
||||
"\tReturns the name of the property, that is set to the current frame number.\n";
|
||||
|
||||
PyObject* BL_ShapeActionActuator::PyGetFrameProperty() {
|
||||
ShowDeprecationWarning("getFrameProperty()", "the frameProperty property");
|
||||
PyObject *result;
|
||||
|
||||
result = Py_BuildValue("s", (const char *)m_framepropname);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/* setFrame */
|
||||
const char BL_ShapeActionActuator::SetFrame_doc[] =
|
||||
"setFrame(frame)\n"
|
||||
"\t - frame : Specifies the new current frame for the animation\n";
|
||||
|
||||
PyObject* BL_ShapeActionActuator::PySetFrame(PyObject* args) {
|
||||
ShowDeprecationWarning("setFrame()", "the frame property");
|
||||
float frame;
|
||||
|
||||
if (PyArg_ParseTuple(args,"f:setFrame",&frame))
|
||||
{
|
||||
m_localtime = frame;
|
||||
if (m_localtime<m_startframe)
|
||||
m_localtime=m_startframe;
|
||||
else if (m_localtime>m_endframe)
|
||||
m_localtime=m_endframe;
|
||||
}
|
||||
else {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* setProperty */
|
||||
const char BL_ShapeActionActuator::SetProperty_doc[] =
|
||||
"setProperty(prop)\n"
|
||||
"\t - prop : A string specifying the property name to be used in\n"
|
||||
"\t FromProp playback mode.\n";
|
||||
|
||||
PyObject* BL_ShapeActionActuator::PySetProperty(PyObject* args) {
|
||||
ShowDeprecationWarning("setProperty()", "the property property");
|
||||
char *string;
|
||||
|
||||
if (PyArg_ParseTuple(args,"s:setProperty",&string))
|
||||
{
|
||||
m_propname = string;
|
||||
}
|
||||
else {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* setFrameProperty */
|
||||
const char BL_ShapeActionActuator::SetFrameProperty_doc[] =
|
||||
"setFrameProperty(prop)\n"
|
||||
"\t - prop : A string specifying the property of the frame set up update.\n";
|
||||
|
||||
PyObject* BL_ShapeActionActuator::PySetFrameProperty(PyObject* args) {
|
||||
ShowDeprecationWarning("setFrameProperty()", "the frameProperty property");
|
||||
char *string;
|
||||
|
||||
if (PyArg_ParseTuple(args,"s:setFrameProperty",&string))
|
||||
{
|
||||
m_framepropname = string;
|
||||
}
|
||||
else {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* getType */
|
||||
const char BL_ShapeActionActuator::GetType_doc[] =
|
||||
"getType()\n"
|
||||
"\tReturns the operation mode of the actuator.\n";
|
||||
PyObject* BL_ShapeActionActuator::PyGetType() {
|
||||
ShowDeprecationWarning("getType()", "the type property");
|
||||
return Py_BuildValue("h", m_playtype);
|
||||
}
|
||||
|
||||
/* setType */
|
||||
const char BL_ShapeActionActuator::SetType_doc[] =
|
||||
"setType(mode)\n"
|
||||
"\t - mode: Play (0), Flipper (2), LoopStop (3), LoopEnd (4) or Property (6)\n"
|
||||
"\tSet the operation mode of the actuator.\n";
|
||||
PyObject* BL_ShapeActionActuator::PySetType(PyObject* args) {
|
||||
ShowDeprecationWarning("setType()", "the type property");
|
||||
short typeArg;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "h:setType", &typeArg)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
switch (typeArg) {
|
||||
case ACT_ACTION_PLAY:
|
||||
case ACT_ACTION_FLIPPER:
|
||||
case ACT_ACTION_LOOP_STOP:
|
||||
case ACT_ACTION_LOOP_END:
|
||||
case ACT_ACTION_FROM_PROP:
|
||||
m_playtype = typeArg;
|
||||
break;
|
||||
default:
|
||||
printf("Invalid type for action actuator: %d\n", typeArg); /* error */
|
||||
}
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyObject* BL_ShapeActionActuator::pyattr_get_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
BL_ShapeActionActuator* self= static_cast<BL_ShapeActionActuator*>(self_v);
|
||||
|
@@ -82,29 +82,6 @@ public:
|
||||
bAction* GetAction() { return m_action; }
|
||||
void SetAction(bAction* act) { m_action= act; }
|
||||
|
||||
KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetAction);
|
||||
KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetBlendin);
|
||||
KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetPriority);
|
||||
KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetStart);
|
||||
KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetEnd);
|
||||
KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetFrame);
|
||||
KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetProperty);
|
||||
KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetFrameProperty);
|
||||
KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetBlendtime);
|
||||
KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetChannel);
|
||||
|
||||
KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetAction);
|
||||
KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetBlendin);
|
||||
KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetPriority);
|
||||
KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetStart);
|
||||
KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetEnd);
|
||||
KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetFrame);
|
||||
KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetProperty);
|
||||
KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetFrameProperty);
|
||||
// KX_PYMETHOD(BL_ActionActuator,GetChannel);
|
||||
KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetType);
|
||||
KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetType);
|
||||
|
||||
static PyObject* pyattr_get_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static int pyattr_set_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
|
||||
|
||||
|
@@ -62,17 +62,9 @@ PyTypeObject CValue::Type = {
|
||||
};
|
||||
|
||||
PyMethodDef CValue::Methods[] = {
|
||||
{ "getName", (PyCFunction) CValue::sPyGetName, METH_NOARGS},
|
||||
{NULL,NULL} //Sentinel
|
||||
};
|
||||
|
||||
PyObject* CValue::PyGetName()
|
||||
{
|
||||
ShowDeprecationWarning("getName()", "the name property");
|
||||
|
||||
return PyUnicode_FromString(this->GetName());
|
||||
}
|
||||
|
||||
/*#define CVALUE_DEBUG*/
|
||||
#ifdef CVALUE_DEBUG
|
||||
int gRefCount;
|
||||
|
@@ -243,8 +243,6 @@ public:
|
||||
|
||||
virtual PyObject* ConvertKeysToPython( void );
|
||||
|
||||
KX_PYMETHOD_NOARGS(CValue,GetName);
|
||||
|
||||
#else
|
||||
CValue();
|
||||
#endif //NO_EXP_PYTHON_EMBEDDING
|
||||
|
@@ -143,10 +143,6 @@ PyTypeObject SCA_ActuatorSensor::Type = {
|
||||
};
|
||||
|
||||
PyMethodDef SCA_ActuatorSensor::Methods[] = {
|
||||
//Deprecated functions ------>
|
||||
{"getActuator", (PyCFunction) SCA_ActuatorSensor::sPyGetActuator, METH_NOARGS, (const char *)GetActuator_doc},
|
||||
{"setActuator", (PyCFunction) SCA_ActuatorSensor::sPySetActuator, METH_VARARGS, (const char *)SetActuator_doc},
|
||||
//<----- Deprecated
|
||||
{NULL,NULL} //Sentinel
|
||||
};
|
||||
|
||||
@@ -167,41 +163,4 @@ int SCA_ActuatorSensor::CheckActuator(void *self, const PyAttributeDef*)
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* 3. getActuator */
|
||||
const char SCA_ActuatorSensor::GetActuator_doc[] =
|
||||
"getActuator()\n"
|
||||
"\tReturn the Actuator with which the sensor operates.\n";
|
||||
PyObject* SCA_ActuatorSensor::PyGetActuator()
|
||||
{
|
||||
ShowDeprecationWarning("getActuator()", "the actuator property");
|
||||
return PyUnicode_FromString(m_checkactname);
|
||||
}
|
||||
|
||||
/* 4. setActuator */
|
||||
const char SCA_ActuatorSensor::SetActuator_doc[] =
|
||||
"setActuator(name)\n"
|
||||
"\t- name: string\n"
|
||||
"\tSets the Actuator with which to operate. If there is no Actuator\n"
|
||||
"\tof this name, the call is ignored.\n";
|
||||
PyObject* SCA_ActuatorSensor::PySetActuator(PyObject* args)
|
||||
{
|
||||
ShowDeprecationWarning("setActuator()", "the actuator property");
|
||||
/* We should query whether the name exists. Or should we create a prop */
|
||||
/* on the fly? */
|
||||
char *actNameArg = NULL;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "s:setActuator", &actNameArg)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SCA_IActuator* act = GetParent()->FindActuator(STR_String(actNameArg));
|
||||
if (act) {
|
||||
m_checkactname = actNameArg;
|
||||
m_actuator = act;
|
||||
} else {
|
||||
; /* error: bad actuator name */
|
||||
}
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* eof */
|
||||
|
@@ -60,11 +60,6 @@ public:
|
||||
/* Python interface ---------------------------------------------------- */
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
/* 3. setProperty */
|
||||
KX_PYMETHOD_DOC_VARARGS(SCA_ActuatorSensor,SetActuator);
|
||||
/* 4. getProperty */
|
||||
KX_PYMETHOD_DOC_NOARGS(SCA_ActuatorSensor,GetActuator);
|
||||
|
||||
static int CheckActuator(void *self, const PyAttributeDef*);
|
||||
};
|
||||
|
||||
|
@@ -152,16 +152,6 @@ PyTypeObject SCA_DelaySensor::Type = {
|
||||
};
|
||||
|
||||
PyMethodDef SCA_DelaySensor::Methods[] = {
|
||||
//Deprecated functions ------>
|
||||
/* setProperty */
|
||||
{"setDelay", (PyCFunction) SCA_DelaySensor::sPySetDelay, METH_VARARGS, (const char *)SetDelay_doc},
|
||||
{"setDuration", (PyCFunction) SCA_DelaySensor::sPySetDuration, METH_VARARGS, (const char *)SetDuration_doc},
|
||||
{"setRepeat", (PyCFunction) SCA_DelaySensor::sPySetRepeat, METH_VARARGS, (const char *)SetRepeat_doc},
|
||||
/* getProperty */
|
||||
{"getDelay", (PyCFunction) SCA_DelaySensor::sPyGetDelay, METH_NOARGS, (const char *)GetDelay_doc},
|
||||
{"getDuration", (PyCFunction) SCA_DelaySensor::sPyGetDuration, METH_NOARGS, (const char *)GetDuration_doc},
|
||||
{"getRepeat", (PyCFunction) SCA_DelaySensor::sPyGetRepeat, METH_NOARGS, (const char *)GetRepeat_doc},
|
||||
//<----- Deprecated
|
||||
{NULL,NULL} //Sentinel
|
||||
};
|
||||
|
||||
@@ -172,91 +162,4 @@ PyAttributeDef SCA_DelaySensor::Attributes[] = {
|
||||
{ NULL } //Sentinel
|
||||
};
|
||||
|
||||
const char SCA_DelaySensor::SetDelay_doc[] =
|
||||
"setDelay(delay)\n"
|
||||
"\t- delay: length of the initial OFF period as number of frame\n"
|
||||
"\t 0 for immediate trigger\n"
|
||||
"\tSet the initial delay before the positive trigger\n";
|
||||
PyObject* SCA_DelaySensor::PySetDelay(PyObject* args)
|
||||
{
|
||||
ShowDeprecationWarning("setDelay()", "the delay property");
|
||||
int delay;
|
||||
|
||||
if(!PyArg_ParseTuple(args, "i:setDelay", &delay)) {
|
||||
return NULL;
|
||||
}
|
||||
if (delay < 0) {
|
||||
PyErr_SetString(PyExc_ValueError, "Delay cannot be negative");
|
||||
return NULL;
|
||||
}
|
||||
m_delay = delay;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
const char SCA_DelaySensor::SetDuration_doc[] =
|
||||
"setDuration(duration)\n"
|
||||
"\t- duration: length of the ON period in number of frame after the initial off period\n"
|
||||
"\t 0 for no ON period\n"
|
||||
"\tSet the duration of the ON pulse after initial delay.\n"
|
||||
"\tIf > 0, a negative trigger is fired at the end of the ON pulse.\n";
|
||||
PyObject* SCA_DelaySensor::PySetDuration(PyObject* args)
|
||||
{
|
||||
ShowDeprecationWarning("setDuration()", "the duration property");
|
||||
int duration;
|
||||
|
||||
if(!PyArg_ParseTuple(args, "i:setDuration", &duration)) {
|
||||
return NULL;
|
||||
}
|
||||
if (duration < 0) {
|
||||
PyErr_SetString(PyExc_ValueError, "Duration cannot be negative");
|
||||
return NULL;
|
||||
}
|
||||
m_duration = duration;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
const char SCA_DelaySensor::SetRepeat_doc[] =
|
||||
"setRepeat(repeat)\n"
|
||||
"\t- repeat: 1 if the initial OFF-ON cycle should be repeated indefinately\n"
|
||||
"\t 0 if the initial OFF-ON cycle should run only once\n"
|
||||
"\tSet the sensor repeat mode\n";
|
||||
PyObject* SCA_DelaySensor::PySetRepeat(PyObject* args)
|
||||
{
|
||||
ShowDeprecationWarning("setRepeat()", "the repeat property");
|
||||
int repeat;
|
||||
|
||||
if(!PyArg_ParseTuple(args, "i:setRepeat", &repeat)) {
|
||||
return NULL;
|
||||
}
|
||||
m_repeat = (repeat != 0);
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
const char SCA_DelaySensor::GetDelay_doc[] =
|
||||
"getDelay()\n"
|
||||
"\tReturn the delay parameter value\n";
|
||||
PyObject* SCA_DelaySensor::PyGetDelay()
|
||||
{
|
||||
ShowDeprecationWarning("getDelay()", "the delay property");
|
||||
return PyLong_FromSsize_t(m_delay);
|
||||
}
|
||||
|
||||
const char SCA_DelaySensor::GetDuration_doc[] =
|
||||
"getDuration()\n"
|
||||
"\tReturn the duration parameter value\n";
|
||||
PyObject* SCA_DelaySensor::PyGetDuration()
|
||||
{
|
||||
ShowDeprecationWarning("getDuration()", "the duration property");
|
||||
return PyLong_FromSsize_t(m_duration);
|
||||
}
|
||||
|
||||
const char SCA_DelaySensor::GetRepeat_doc[] =
|
||||
"getRepeat()\n"
|
||||
"\tReturn the repeat parameter value\n";
|
||||
PyObject* SCA_DelaySensor::PyGetRepeat()
|
||||
{
|
||||
ShowDeprecationWarning("getRepeat()", "the repeat property");
|
||||
return BoolToPyArg(m_repeat);
|
||||
}
|
||||
|
||||
/* eof */
|
||||
|
@@ -59,14 +59,6 @@ public:
|
||||
/* Python interface ---------------------------------------------------- */
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
/* setProperty */
|
||||
KX_PYMETHOD_DOC_VARARGS(SCA_DelaySensor,SetDelay);
|
||||
KX_PYMETHOD_DOC_VARARGS(SCA_DelaySensor,SetDuration);
|
||||
KX_PYMETHOD_DOC_VARARGS(SCA_DelaySensor,SetRepeat);
|
||||
/* getProperty */
|
||||
KX_PYMETHOD_DOC_NOARGS(SCA_DelaySensor,GetDelay);
|
||||
KX_PYMETHOD_DOC_NOARGS(SCA_DelaySensor,GetDuration);
|
||||
KX_PYMETHOD_DOC_NOARGS(SCA_DelaySensor,GetRepeat);
|
||||
|
||||
};
|
||||
|
||||
|
@@ -221,13 +221,6 @@ PyTypeObject SCA_IController::Type = {
|
||||
};
|
||||
|
||||
PyMethodDef SCA_IController::Methods[] = {
|
||||
//Deprecated functions ------>
|
||||
{"getSensor", (PyCFunction) SCA_IController::sPyGetSensor, METH_O},
|
||||
{"getActuator", (PyCFunction) SCA_IController::sPyGetActuator, METH_O},
|
||||
{"getSensors", (PyCFunction) SCA_IController::sPyGetSensors, METH_NOARGS},
|
||||
{"getActuators", (PyCFunction) SCA_IController::sPyGetActuators, METH_NOARGS},
|
||||
{"getState", (PyCFunction) SCA_IController::sPyGetState, METH_NOARGS},
|
||||
//<----- Deprecated
|
||||
{NULL,NULL} //Sentinel
|
||||
};
|
||||
|
||||
@@ -239,85 +232,6 @@ PyAttributeDef SCA_IController::Attributes[] = {
|
||||
{ NULL } //Sentinel
|
||||
};
|
||||
|
||||
PyObject* SCA_IController::PyGetActuators()
|
||||
{
|
||||
ShowDeprecationWarning("getActuators()", "the actuators property");
|
||||
|
||||
PyObject* resultlist = PyList_New(m_linkedactuators.size());
|
||||
for (unsigned int index=0;index<m_linkedactuators.size();index++)
|
||||
{
|
||||
PyList_SET_ITEM(resultlist,index, m_linkedactuators[index]->GetProxy());
|
||||
}
|
||||
|
||||
return resultlist;
|
||||
}
|
||||
|
||||
PyObject* SCA_IController::PyGetSensor(PyObject* value)
|
||||
{
|
||||
ShowDeprecationWarning("getSensor(string)", "the sensors[string] property");
|
||||
|
||||
char *scriptArg = _PyUnicode_AsString(value);
|
||||
if (scriptArg==NULL) {
|
||||
PyErr_SetString(PyExc_TypeError, "controller.getSensor(string): Python Controller, expected a string (sensor name)");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (unsigned int index=0;index<m_linkedsensors.size();index++)
|
||||
{
|
||||
SCA_ISensor* sensor = m_linkedsensors[index];
|
||||
STR_String& realname = sensor->GetName();
|
||||
if (realname == scriptArg)
|
||||
{
|
||||
return sensor->GetProxy();
|
||||
}
|
||||
}
|
||||
|
||||
PyErr_Format(PyExc_AttributeError, "controller.getSensor(string): Python Controller, unable to find requested sensor \"%s\"", scriptArg);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PyObject* SCA_IController::PyGetActuator(PyObject* value)
|
||||
{
|
||||
ShowDeprecationWarning("getActuator(string)", "the actuators[string] property");
|
||||
|
||||
char *scriptArg = _PyUnicode_AsString(value);
|
||||
if (scriptArg==NULL) {
|
||||
PyErr_SetString(PyExc_TypeError, "controller.getActuator(string): Python Controller, expected a string (actuator name)");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (unsigned int index=0;index<m_linkedactuators.size();index++)
|
||||
{
|
||||
SCA_IActuator* actua = m_linkedactuators[index];
|
||||
if (actua->GetName() == scriptArg)
|
||||
{
|
||||
return actua->GetProxy();
|
||||
}
|
||||
}
|
||||
|
||||
PyErr_Format(PyExc_AttributeError, "controller.getActuator(string): Python Controller, unable to find requested actuator \"%s\"", scriptArg);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PyObject* SCA_IController::PyGetSensors()
|
||||
{
|
||||
ShowDeprecationWarning("getSensors()", "the sensors property");
|
||||
|
||||
PyObject* resultlist = PyList_New(m_linkedsensors.size());
|
||||
for (unsigned int index=0;index<m_linkedsensors.size();index++)
|
||||
{
|
||||
PyList_SET_ITEM(resultlist,index, m_linkedsensors[index]->GetProxy());
|
||||
}
|
||||
|
||||
return resultlist;
|
||||
}
|
||||
|
||||
PyObject* SCA_IController::PyGetState()
|
||||
{
|
||||
ShowDeprecationWarning("getState()", "the state property");
|
||||
return PyLong_FromSsize_t(m_statemask);
|
||||
}
|
||||
|
||||
PyObject* SCA_IController::pyattr_get_state(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
SCA_IController* self= static_cast<SCA_IController*>(self_v);
|
||||
|
@@ -98,12 +98,6 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
KX_PYMETHOD_NOARGS(SCA_IController,GetSensors);
|
||||
KX_PYMETHOD_NOARGS(SCA_IController,GetActuators);
|
||||
KX_PYMETHOD_O(SCA_IController,GetSensor);
|
||||
KX_PYMETHOD_O(SCA_IController,GetActuator);
|
||||
KX_PYMETHOD_NOARGS(SCA_IController,GetState);
|
||||
|
||||
static PyObject* pyattr_get_state(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject* pyattr_get_sensors(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject* pyattr_get_actuators(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
|
@@ -199,11 +199,6 @@ PyTypeObject SCA_ILogicBrick::Type = {
|
||||
};
|
||||
|
||||
PyMethodDef SCA_ILogicBrick::Methods[] = {
|
||||
// --> Deprecated
|
||||
{"getOwner", (PyCFunction) SCA_ILogicBrick::sPyGetOwner, METH_NOARGS},
|
||||
{"getExecutePriority", (PyCFunction) SCA_ILogicBrick::sPyGetExecutePriority, METH_NOARGS},
|
||||
{"setExecutePriority", (PyCFunction) SCA_ILogicBrick::sPySetExecutePriority, METH_VARARGS},
|
||||
// <-- Deprecated
|
||||
{NULL,NULL} //Sentinel
|
||||
};
|
||||
|
||||
@@ -232,46 +227,6 @@ int SCA_ILogicBrick::CheckProperty(void *self, const PyAttributeDef *attrdef)
|
||||
return 0;
|
||||
}
|
||||
|
||||
PyObject* SCA_ILogicBrick::PyGetOwner()
|
||||
{
|
||||
ShowDeprecationWarning("getOwner()", "the owner property");
|
||||
|
||||
CValue* parent = GetParent();
|
||||
if (parent)
|
||||
{
|
||||
return parent->GetProxy();
|
||||
}
|
||||
|
||||
printf("ERROR: Python scriptblock without owner\n");
|
||||
Py_RETURN_NONE; //Int_FromLong(IsPositiveTrigger());
|
||||
}
|
||||
|
||||
|
||||
|
||||
PyObject* SCA_ILogicBrick::PySetExecutePriority(PyObject* args)
|
||||
{
|
||||
ShowDeprecationWarning("setExecutePriority()", "the executePriority property");
|
||||
|
||||
int priority=0;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "i:setExecutePriority", &priority)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
m_Execute_Priority = priority;
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
PyObject* SCA_ILogicBrick::PyGetExecutePriority()
|
||||
{
|
||||
ShowDeprecationWarning("getExecutePriority()", "the executePriority property");
|
||||
return PyLong_FromSsize_t(m_Execute_Priority);
|
||||
}
|
||||
|
||||
|
||||
/*Attribute functions */
|
||||
PyObject* SCA_ILogicBrick::pyattr_get_owner(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
|
@@ -127,10 +127,6 @@ public:
|
||||
|
||||
// python methods
|
||||
|
||||
KX_PYMETHOD_NOARGS(SCA_ILogicBrick,GetOwner);
|
||||
KX_PYMETHOD_VARARGS(SCA_ILogicBrick,SetExecutePriority);
|
||||
KX_PYMETHOD_NOARGS(SCA_ILogicBrick,GetExecutePriority);
|
||||
|
||||
static PyObject* pyattr_get_owner(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
|
||||
// check that attribute is a property
|
||||
|
@@ -292,171 +292,6 @@ void SCA_ISensor::Activate(class SCA_LogicManager* logicmgr)
|
||||
/* Python Functions */
|
||||
/* ----------------------------------------------- */
|
||||
|
||||
//Deprecated Functions ------>
|
||||
const char SCA_ISensor::IsPositive_doc[] =
|
||||
"isPositive()\n"
|
||||
"\tReturns whether the sensor is in an active state.\n";
|
||||
PyObject* SCA_ISensor::PyIsPositive()
|
||||
{
|
||||
ShowDeprecationWarning("isPositive()", "the read-only positive property");
|
||||
int retval = GetState();
|
||||
return PyLong_FromSsize_t(retval);
|
||||
}
|
||||
|
||||
const char SCA_ISensor::IsTriggered_doc[] =
|
||||
"isTriggered()\n"
|
||||
"\tReturns whether the sensor has triggered the current controller.\n";
|
||||
PyObject* SCA_ISensor::PyIsTriggered()
|
||||
{
|
||||
ShowDeprecationWarning("isTriggered()", "the read-only triggered property");
|
||||
// check with the current controller
|
||||
int retval = 0;
|
||||
if (SCA_PythonController::m_sCurrentController)
|
||||
retval = SCA_PythonController::m_sCurrentController->IsTriggered(this);
|
||||
return PyLong_FromSsize_t(retval);
|
||||
}
|
||||
|
||||
/**
|
||||
* getUsePulseMode: getter for the pulse mode (KX_TRUE = on)
|
||||
*/
|
||||
const char SCA_ISensor::GetUsePosPulseMode_doc[] =
|
||||
"getUsePosPulseMode()\n"
|
||||
"\tReturns whether positive pulse mode is active.\n";
|
||||
PyObject* SCA_ISensor::PyGetUsePosPulseMode()
|
||||
{
|
||||
ShowDeprecationWarning("getUsePosPulseMode()", "the usePosPulseMode property");
|
||||
return BoolToPyArg(m_pos_pulsemode);
|
||||
}
|
||||
|
||||
/**
|
||||
* setUsePulseMode: setter for the pulse mode (KX_TRUE = on)
|
||||
*/
|
||||
const char SCA_ISensor::SetUsePosPulseMode_doc[] =
|
||||
"setUsePosPulseMode(pulse?)\n"
|
||||
"\t - pulse? : Pulse when a positive event occurs?\n"
|
||||
"\t (KX_TRUE, KX_FALSE)\n"
|
||||
"\tSet whether to do pulsing when positive pulses occur.\n";
|
||||
PyObject* SCA_ISensor::PySetUsePosPulseMode(PyObject* args)
|
||||
{
|
||||
ShowDeprecationWarning("setUsePosPulseMode()", "the usePosPulseMode property");
|
||||
int pyarg = 0;
|
||||
if(!PyArg_ParseTuple(args, "i:setUsePosPulseMode", &pyarg)) { return NULL; }
|
||||
m_pos_pulsemode = PyArgToBool(pyarg);
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/**
|
||||
* getFrequency: getter for the pulse mode interval
|
||||
*/
|
||||
const char SCA_ISensor::GetFrequency_doc[] =
|
||||
"getFrequency()\n"
|
||||
"\tReturns the frequency of the updates in pulse mode.\n" ;
|
||||
PyObject* SCA_ISensor::PyGetFrequency()
|
||||
{
|
||||
ShowDeprecationWarning("getFrequency()", "the frequency property");
|
||||
return PyLong_FromSsize_t(m_pulse_frequency);
|
||||
}
|
||||
|
||||
/**
|
||||
* setFrequency: setter for the pulse mode (KX_TRUE = on)
|
||||
*/
|
||||
const char SCA_ISensor::SetFrequency_doc[] =
|
||||
"setFrequency(pulse_frequency)\n"
|
||||
"\t- pulse_frequency: The frequency of the updates in pulse mode (integer)"
|
||||
"\tSet the frequency of the updates in pulse mode.\n"
|
||||
"\tIf the frequency is negative, it is set to 0.\n" ;
|
||||
PyObject* SCA_ISensor::PySetFrequency(PyObject* args)
|
||||
{
|
||||
ShowDeprecationWarning("setFrequency()", "the frequency property");
|
||||
int pulse_frequencyArg = 0;
|
||||
|
||||
if(!PyArg_ParseTuple(args, "i:setFrequency", &pulse_frequencyArg)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* We can do three things here: clip, ignore and raise an exception. */
|
||||
/* Exceptions don't work yet, ignoring is not desirable now... */
|
||||
if (pulse_frequencyArg < 0) {
|
||||
pulse_frequencyArg = 0;
|
||||
};
|
||||
m_pulse_frequency = pulse_frequencyArg;
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
|
||||
const char SCA_ISensor::GetInvert_doc[] =
|
||||
"getInvert()\n"
|
||||
"\tReturns whether or not pulses from this sensor are inverted.\n" ;
|
||||
PyObject* SCA_ISensor::PyGetInvert()
|
||||
{
|
||||
ShowDeprecationWarning("getInvert()", "the invert property");
|
||||
return BoolToPyArg(m_invert);
|
||||
}
|
||||
|
||||
const char SCA_ISensor::SetInvert_doc[] =
|
||||
"setInvert(invert?)\n"
|
||||
"\t- invert?: Invert the event-values? (KX_TRUE, KX_FALSE)\n"
|
||||
"\tSet whether to invert pulses.\n";
|
||||
PyObject* SCA_ISensor::PySetInvert(PyObject* args)
|
||||
{
|
||||
ShowDeprecationWarning("setInvert()", "the invert property");
|
||||
int pyarg = 0;
|
||||
if(!PyArg_ParseTuple(args, "i:setInvert", &pyarg)) { return NULL; }
|
||||
m_invert = PyArgToBool(pyarg);
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
const char SCA_ISensor::GetLevel_doc[] =
|
||||
"getLevel()\n"
|
||||
"\tReturns whether this sensor is a level detector or a edge detector.\n"
|
||||
"\tIt makes a difference only in case of logic state transition (state actuator).\n"
|
||||
"\tA level detector will immediately generate a pulse, negative or positive\n"
|
||||
"\tdepending on the sensor condition, as soon as the state is activated.\n"
|
||||
"\tA edge detector will wait for a state change before generating a pulse.\n";
|
||||
PyObject* SCA_ISensor::PyGetLevel()
|
||||
{
|
||||
ShowDeprecationWarning("getLevel()", "the level property");
|
||||
return BoolToPyArg(m_level);
|
||||
}
|
||||
|
||||
const char SCA_ISensor::SetLevel_doc[] =
|
||||
"setLevel(level?)\n"
|
||||
"\t- level?: Detect level instead of edge? (KX_TRUE, KX_FALSE)\n"
|
||||
"\tSet whether to detect level or edge transition when entering a state.\n";
|
||||
PyObject* SCA_ISensor::PySetLevel(PyObject* args)
|
||||
{
|
||||
ShowDeprecationWarning("setLevel()", "the level property");
|
||||
int pyarg = 0;
|
||||
if(!PyArg_ParseTuple(args, "i:setLevel", &pyarg)) { return NULL; }
|
||||
m_level = PyArgToBool(pyarg);
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
const char SCA_ISensor::GetUseNegPulseMode_doc[] =
|
||||
"getUseNegPulseMode()\n"
|
||||
"\tReturns whether negative pulse mode is active.\n";
|
||||
PyObject* SCA_ISensor::PyGetUseNegPulseMode()
|
||||
{
|
||||
ShowDeprecationWarning("getUseNegPulseMode()", "the useNegPulseMode property");
|
||||
return BoolToPyArg(m_neg_pulsemode);
|
||||
}
|
||||
|
||||
const char SCA_ISensor::SetUseNegPulseMode_doc[] =
|
||||
"setUseNegPulseMode(pulse?)\n"
|
||||
"\t - pulse? : Pulse when a negative event occurs?\n"
|
||||
"\t (KX_TRUE, KX_FALSE)\n"
|
||||
"\tSet whether to do pulsing when negative pulses occur.\n";
|
||||
PyObject* SCA_ISensor::PySetUseNegPulseMode(PyObject* args)
|
||||
{
|
||||
ShowDeprecationWarning("setUseNegPulseMode()", "the useNegPulseMode property");
|
||||
int pyarg = 0;
|
||||
if(!PyArg_ParseTuple(args, "i:setUseNegPulseMode", &pyarg)) { return NULL; }
|
||||
m_neg_pulsemode = PyArgToBool(pyarg);
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
//<------Deprecated
|
||||
|
||||
KX_PYMETHODDEF_DOC_NOARGS(SCA_ISensor, reset,
|
||||
"reset()\n"
|
||||
"\tReset sensor internal state, effect depends on the type of sensor and settings.\n"
|
||||
@@ -494,32 +329,6 @@ PyTypeObject SCA_ISensor::Type = {
|
||||
};
|
||||
|
||||
PyMethodDef SCA_ISensor::Methods[] = {
|
||||
//Deprecated functions ----->
|
||||
{"isPositive", (PyCFunction) SCA_ISensor::sPyIsPositive,
|
||||
METH_NOARGS, (const char *)IsPositive_doc},
|
||||
{"isTriggered", (PyCFunction) SCA_ISensor::sPyIsTriggered,
|
||||
METH_VARARGS, (const char *)IsTriggered_doc},
|
||||
{"getUsePosPulseMode", (PyCFunction) SCA_ISensor::sPyGetUsePosPulseMode,
|
||||
METH_NOARGS, (const char *)GetUsePosPulseMode_doc},
|
||||
{"setUsePosPulseMode", (PyCFunction) SCA_ISensor::sPySetUsePosPulseMode,
|
||||
METH_VARARGS, (const char *)SetUsePosPulseMode_doc},
|
||||
{"getFrequency", (PyCFunction) SCA_ISensor::sPyGetFrequency,
|
||||
METH_NOARGS, (const char *)GetFrequency_doc},
|
||||
{"setFrequency", (PyCFunction) SCA_ISensor::sPySetFrequency,
|
||||
METH_VARARGS, (const char *)SetFrequency_doc},
|
||||
{"getUseNegPulseMode", (PyCFunction) SCA_ISensor::sPyGetUseNegPulseMode,
|
||||
METH_NOARGS, (const char *)GetUseNegPulseMode_doc},
|
||||
{"setUseNegPulseMode", (PyCFunction) SCA_ISensor::sPySetUseNegPulseMode,
|
||||
METH_VARARGS, (const char *)SetUseNegPulseMode_doc},
|
||||
{"getInvert", (PyCFunction) SCA_ISensor::sPyGetInvert,
|
||||
METH_NOARGS, (const char *)GetInvert_doc},
|
||||
{"setInvert", (PyCFunction) SCA_ISensor::sPySetInvert,
|
||||
METH_VARARGS, (const char *)SetInvert_doc},
|
||||
{"getLevel", (PyCFunction) SCA_ISensor::sPyGetLevel,
|
||||
METH_NOARGS, (const char *)GetLevel_doc},
|
||||
{"setLevel", (PyCFunction) SCA_ISensor::sPySetLevel,
|
||||
METH_VARARGS, (const char *)SetLevel_doc},
|
||||
//<----- Deprecated
|
||||
KX_PYMETHODTABLE_NOARGS(SCA_ISensor, reset),
|
||||
{NULL,NULL} //Sentinel
|
||||
};
|
||||
|
@@ -172,21 +172,6 @@ public:
|
||||
{ return !m_links; }
|
||||
|
||||
/* Python functions: */
|
||||
|
||||
//Deprecated functions ----->
|
||||
KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,IsPositive);
|
||||
KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,IsTriggered);
|
||||
KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,GetUsePosPulseMode);
|
||||
KX_PYMETHOD_DOC_VARARGS(SCA_ISensor,SetUsePosPulseMode);
|
||||
KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,GetFrequency);
|
||||
KX_PYMETHOD_DOC_VARARGS(SCA_ISensor,SetFrequency);
|
||||
KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,GetUseNegPulseMode);
|
||||
KX_PYMETHOD_DOC_VARARGS(SCA_ISensor,SetUseNegPulseMode);
|
||||
KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,GetInvert);
|
||||
KX_PYMETHOD_DOC_VARARGS(SCA_ISensor,SetInvert);
|
||||
KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,GetLevel);
|
||||
KX_PYMETHOD_DOC_VARARGS(SCA_ISensor,SetLevel);
|
||||
//<------
|
||||
KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,reset);
|
||||
|
||||
static PyObject* pyattr_get_triggered(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
|
@@ -273,24 +273,6 @@ PyTypeObject SCA_JoystickSensor::Type = {
|
||||
};
|
||||
|
||||
PyMethodDef SCA_JoystickSensor::Methods[] = {
|
||||
//Deprecated functions ------>
|
||||
{"getIndex", (PyCFunction) SCA_JoystickSensor::sPyGetIndex, METH_NOARGS, (const char *)GetIndex_doc},
|
||||
{"setIndex", (PyCFunction) SCA_JoystickSensor::sPySetIndex, METH_O, (const char *)SetIndex_doc},
|
||||
{"getAxis", (PyCFunction) SCA_JoystickSensor::sPyGetAxis, METH_NOARGS, (const char *)GetAxis_doc},
|
||||
{"setAxis", (PyCFunction) SCA_JoystickSensor::sPySetAxis, METH_VARARGS, (const char *)SetAxis_doc},
|
||||
{"getAxisValue", (PyCFunction) SCA_JoystickSensor::sPyGetAxisValue, METH_NOARGS, (const char *)GetAxisValue_doc},
|
||||
{"getThreshold", (PyCFunction) SCA_JoystickSensor::sPyGetThreshold, METH_NOARGS, (const char *)GetThreshold_doc},
|
||||
{"setThreshold", (PyCFunction) SCA_JoystickSensor::sPySetThreshold, METH_VARARGS, (const char *)SetThreshold_doc},
|
||||
{"getButton", (PyCFunction) SCA_JoystickSensor::sPyGetButton, METH_NOARGS, (const char *)GetButton_doc},
|
||||
{"setButton", (PyCFunction) SCA_JoystickSensor::sPySetButton, METH_O, (const char *)SetButton_doc},
|
||||
{"getHat", (PyCFunction) SCA_JoystickSensor::sPyGetHat, METH_NOARGS, (const char *)GetHat_doc},
|
||||
{"setHat", (PyCFunction) SCA_JoystickSensor::sPySetHat, METH_VARARGS, (const char *)SetHat_doc},
|
||||
{"getNumAxes", (PyCFunction) SCA_JoystickSensor::sPyNumberOfAxes, METH_NOARGS, (const char *)NumberOfAxes_doc},
|
||||
{"getNumButtons",(PyCFunction) SCA_JoystickSensor::sPyNumberOfButtons,METH_NOARGS, (const char *)NumberOfButtons_doc},
|
||||
{"getNumHats", (PyCFunction) SCA_JoystickSensor::sPyNumberOfHats, METH_NOARGS, (const char *)NumberOfHats_doc},
|
||||
{"isConnected", (PyCFunction) SCA_JoystickSensor::sPyConnected, METH_NOARGS, (const char *)Connected_doc},
|
||||
{"getButtonValue",(PyCFunction) SCA_JoystickSensor::sPyGetButtonValue, METH_NOARGS,(const char *)GetButtonValue_doc},
|
||||
//<----- Deprecated
|
||||
{"getButtonActiveList",(PyCFunction) SCA_JoystickSensor::sPyGetButtonActiveList, METH_NOARGS,(const char *)GetButtonActiveList_doc},
|
||||
{"getButtonStatus",(PyCFunction) SCA_JoystickSensor::sPyGetButtonStatus, METH_VARARGS,(const char *)GetButtonStatus_doc},
|
||||
{NULL,NULL} //Sentinel
|
||||
@@ -314,138 +296,6 @@ PyAttributeDef SCA_JoystickSensor::Attributes[] = {
|
||||
{ NULL } //Sentinel
|
||||
};
|
||||
|
||||
|
||||
/* get index ---------------------------------------------------------- */
|
||||
const char SCA_JoystickSensor::GetIndex_doc[] =
|
||||
"getIndex\n"
|
||||
"\tReturns the joystick index to use.\n";
|
||||
PyObject* SCA_JoystickSensor::PyGetIndex( ) {
|
||||
ShowDeprecationWarning("getIndex()", "the index property");
|
||||
return PyLong_FromSsize_t(m_joyindex);
|
||||
}
|
||||
|
||||
|
||||
/* set index ---------------------------------------------------------- */
|
||||
const char SCA_JoystickSensor::SetIndex_doc[] =
|
||||
"setIndex\n"
|
||||
"\tSets the joystick index to use.\n";
|
||||
PyObject* SCA_JoystickSensor::PySetIndex( PyObject* value ) {
|
||||
ShowDeprecationWarning("setIndex()", "the index property");
|
||||
int index = PyLong_AsSsize_t( value ); /* -1 on error, will raise an error in this case */
|
||||
if (index < 0 || index >= JOYINDEX_MAX) {
|
||||
PyErr_SetString(PyExc_ValueError, "joystick index out of range or not an int");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
m_joyindex = index;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* get axis ---------------------------------------------------------- */
|
||||
const char SCA_JoystickSensor::GetAxis_doc[] =
|
||||
"getAxis\n"
|
||||
"\tReturns the current axis this sensor reacts to.\n";
|
||||
PyObject* SCA_JoystickSensor::PyGetAxis( ) {
|
||||
ShowDeprecationWarning("getAxis()", "the axis property");
|
||||
return Py_BuildValue("[ii]",m_axis, m_axisf);
|
||||
}
|
||||
|
||||
|
||||
/* set axis ---------------------------------------------------------- */
|
||||
const char SCA_JoystickSensor::SetAxis_doc[] =
|
||||
"setAxis\n"
|
||||
"\tSets the current axis this sensor reacts to.\n";
|
||||
PyObject* SCA_JoystickSensor::PySetAxis( PyObject* args ) {
|
||||
ShowDeprecationWarning("setAxis()", "the axis property");
|
||||
|
||||
int axis,axisflag;
|
||||
if(!PyArg_ParseTuple(args, "ii:setAxis", &axis, &axisflag)){
|
||||
return NULL;
|
||||
}
|
||||
m_axis = axis;
|
||||
m_axisf = axisflag;
|
||||
|
||||
CheckAxis((void *)this, NULL); /* clamp values */
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
|
||||
/* get axis value ----------------------------------------------------- */
|
||||
const char SCA_JoystickSensor::GetAxisValue_doc[] =
|
||||
"getAxisValue\n"
|
||||
"\tReturns a list of the values for the current state of each axis.\n";
|
||||
PyObject* SCA_JoystickSensor::PyGetAxisValue( ) {
|
||||
ShowDeprecationWarning("getAxisValue()", "the axisPosition property");
|
||||
SCA_Joystick *joy = ((SCA_JoystickManager *)m_eventmgr)->GetJoystickDevice(m_joyindex);
|
||||
|
||||
int axis_index= joy->GetNumberOfAxes();
|
||||
PyObject *list= PyList_New(axis_index);
|
||||
|
||||
while(axis_index--) {
|
||||
PyList_SET_ITEM(list, axis_index, PyLong_FromSsize_t(joy->GetAxisPosition(axis_index)));
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
/* get threshold ----------------------------------------------------- */
|
||||
const char SCA_JoystickSensor::GetThreshold_doc[] =
|
||||
"getThreshold\n"
|
||||
"\tReturns the threshold of the axis.\n";
|
||||
PyObject* SCA_JoystickSensor::PyGetThreshold( ) {
|
||||
ShowDeprecationWarning("getThreshold()", "the threshold property");
|
||||
return PyLong_FromSsize_t(m_precision);
|
||||
}
|
||||
|
||||
|
||||
/* set threshold ----------------------------------------------------- */
|
||||
const char SCA_JoystickSensor::SetThreshold_doc[] =
|
||||
"setThreshold\n"
|
||||
"\tSets the threshold of the axis.\n";
|
||||
PyObject* SCA_JoystickSensor::PySetThreshold( PyObject* args ) {
|
||||
ShowDeprecationWarning("setThreshold()", "the threshold property");
|
||||
int thresh;
|
||||
if(!PyArg_ParseTuple(args, "i:setThreshold", &thresh)){
|
||||
return NULL;
|
||||
}
|
||||
m_precision = thresh;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* get button -------------------------------------------------------- */
|
||||
const char SCA_JoystickSensor::GetButton_doc[] =
|
||||
"getButton\n"
|
||||
"\tReturns the current button this sensor is checking.\n";
|
||||
PyObject* SCA_JoystickSensor::PyGetButton( ) {
|
||||
ShowDeprecationWarning("getButton()", "the button property");
|
||||
return PyLong_FromSsize_t(m_button);
|
||||
}
|
||||
|
||||
/* set button -------------------------------------------------------- */
|
||||
const char SCA_JoystickSensor::SetButton_doc[] =
|
||||
"setButton\n"
|
||||
"\tSets the button the sensor reacts to.\n";
|
||||
PyObject* SCA_JoystickSensor::PySetButton( PyObject* value ) {
|
||||
ShowDeprecationWarning("setButton()", "the button property");
|
||||
int button = PyLong_AsSsize_t(value);
|
||||
if(button==-1 && PyErr_Occurred()) {
|
||||
PyErr_SetString(PyExc_ValueError, "expected an int");
|
||||
return NULL;
|
||||
}
|
||||
m_button = button;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* get button value -------------------------------------------------- */
|
||||
const char SCA_JoystickSensor::GetButtonValue_doc[] =
|
||||
"getButtonValue\n"
|
||||
"\tReturns a list containing the indicies of the current pressed state of each button.\n";
|
||||
PyObject* SCA_JoystickSensor::PyGetButtonValue( ) {
|
||||
ShowDeprecationWarning("getButtonValue()", "getButtonActiveList");
|
||||
return PyGetButtonActiveList( );
|
||||
}
|
||||
|
||||
/* get button active list -------------------------------------------------- */
|
||||
const char SCA_JoystickSensor::GetButtonActiveList_doc[] =
|
||||
"getButtonActiveList\n"
|
||||
@@ -485,75 +335,6 @@ PyObject* SCA_JoystickSensor::PyGetButtonStatus( PyObject* args ) {
|
||||
return PyBool_FromLong(0);
|
||||
}
|
||||
|
||||
/* get hat ----------------------------------------------------------- */
|
||||
const char SCA_JoystickSensor::GetHat_doc[] =
|
||||
"getHat\n"
|
||||
"\tReturns the current direction of the hat.\n";
|
||||
PyObject* SCA_JoystickSensor::PyGetHat( ) {
|
||||
ShowDeprecationWarning("getHat()", "the hat property");
|
||||
return Py_BuildValue("[ii]",m_hat, m_hatf);
|
||||
}
|
||||
|
||||
|
||||
/* set hat ----------------------------------------------------------- */
|
||||
const char SCA_JoystickSensor::SetHat_doc[] =
|
||||
"setHat\n"
|
||||
"\tSets the hat the sensor reacts to.\n";
|
||||
PyObject* SCA_JoystickSensor::PySetHat( PyObject* args ) {
|
||||
ShowDeprecationWarning("setHat()", "the hat property");
|
||||
int hat,hatflag;
|
||||
if(!PyArg_ParseTuple(args, "ii:setHat", &hat, &hatflag)){
|
||||
return NULL;
|
||||
}
|
||||
m_hat = hat;
|
||||
m_hatf = hatflag;
|
||||
|
||||
CheckHat((void *)this, NULL); /* clamp values */
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
|
||||
/* get # of ----------------------------------------------------- */
|
||||
const char SCA_JoystickSensor::NumberOfAxes_doc[] =
|
||||
"getNumAxes\n"
|
||||
"\tReturns the number of axes .\n";
|
||||
PyObject* SCA_JoystickSensor::PyNumberOfAxes( ) {
|
||||
ShowDeprecationWarning("getNumAxes()", "the numAxis property");
|
||||
SCA_Joystick *joy = ((SCA_JoystickManager *)m_eventmgr)->GetJoystickDevice(m_joyindex);
|
||||
// when the joystick is null their is 0 exis still. dumb but scripters should use isConnected()
|
||||
return PyLong_FromSsize_t( joy ? joy->GetNumberOfAxes() : 0 );
|
||||
}
|
||||
|
||||
|
||||
const char SCA_JoystickSensor::NumberOfButtons_doc[] =
|
||||
"getNumButtons\n"
|
||||
"\tReturns the number of buttons .\n";
|
||||
PyObject* SCA_JoystickSensor::PyNumberOfButtons( ) {
|
||||
ShowDeprecationWarning("getNumButtons()", "the numButtons property");
|
||||
SCA_Joystick *joy = ((SCA_JoystickManager *)m_eventmgr)->GetJoystickDevice(m_joyindex);
|
||||
return PyLong_FromSsize_t( joy ? joy->GetNumberOfButtons() : 0 );
|
||||
}
|
||||
|
||||
|
||||
const char SCA_JoystickSensor::NumberOfHats_doc[] =
|
||||
"getNumHats\n"
|
||||
"\tReturns the number of hats .\n";
|
||||
PyObject* SCA_JoystickSensor::PyNumberOfHats( ) {
|
||||
ShowDeprecationWarning("getNumHats()", "the numHats property");
|
||||
SCA_Joystick *joy = ((SCA_JoystickManager *)m_eventmgr)->GetJoystickDevice(m_joyindex);
|
||||
return PyLong_FromSsize_t( joy ? joy->GetNumberOfHats() : 0 );
|
||||
}
|
||||
|
||||
const char SCA_JoystickSensor::Connected_doc[] =
|
||||
"getConnected\n"
|
||||
"\tReturns True if a joystick is connected at this joysticks index.\n";
|
||||
PyObject* SCA_JoystickSensor::PyConnected( ) {
|
||||
ShowDeprecationWarning("getConnected()", "the connected property");
|
||||
SCA_Joystick *joy = ((SCA_JoystickManager *)m_eventmgr)->GetJoystickDevice(m_joyindex);
|
||||
return PyBool_FromLong( joy ? joy->Connected() : 0 );
|
||||
}
|
||||
|
||||
|
||||
PyObject* SCA_JoystickSensor::pyattr_get_axis_values(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
SCA_JoystickSensor* self= static_cast<SCA_JoystickSensor*>(self_v);
|
||||
|
@@ -122,28 +122,8 @@ public:
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
/* Joystick Index */
|
||||
KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,GetIndex);
|
||||
KX_PYMETHOD_DOC_O(SCA_JoystickSensor,SetIndex);
|
||||
/* Axes*/
|
||||
KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,GetAxis);
|
||||
KX_PYMETHOD_DOC_VARARGS(SCA_JoystickSensor,SetAxis);
|
||||
KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,GetAxisValue);
|
||||
KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,GetThreshold);
|
||||
KX_PYMETHOD_DOC_VARARGS(SCA_JoystickSensor,SetThreshold);
|
||||
/* Buttons */
|
||||
KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,GetButton);
|
||||
KX_PYMETHOD_DOC_O(SCA_JoystickSensor,SetButton);
|
||||
KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,GetButtonValue);
|
||||
KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,GetButtonActiveList);
|
||||
KX_PYMETHOD_DOC_VARARGS(SCA_JoystickSensor,GetButtonStatus);
|
||||
/* Hats */
|
||||
KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,GetHat);
|
||||
KX_PYMETHOD_DOC_VARARGS(SCA_JoystickSensor,SetHat);
|
||||
/* number of */
|
||||
KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,NumberOfAxes);
|
||||
KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,NumberOfButtons);
|
||||
KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,NumberOfHats);
|
||||
KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,Connected);
|
||||
|
||||
static PyObject* pyattr_get_axis_values(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject* pyattr_get_axis_single(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
|
@@ -408,184 +408,6 @@ void SCA_KeyboardSensor::LogKeystrokes(void)
|
||||
/* Python Functions */
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
//Deprecated ----->
|
||||
/** 1. GetKey : check which key this sensor looks at */
|
||||
const char SCA_KeyboardSensor::GetKey_doc[] =
|
||||
"getKey()\n"
|
||||
"\tReturn the code of the key this sensor is listening to.\n" ;
|
||||
PyObject* SCA_KeyboardSensor::PyGetKey()
|
||||
{
|
||||
ShowDeprecationWarning("getKey()", "the key property");
|
||||
return PyLong_FromSsize_t(m_hotkey);
|
||||
}
|
||||
|
||||
/** 2. SetKey: change the key to look at */
|
||||
const char SCA_KeyboardSensor::SetKey_doc[] =
|
||||
"setKey(keycode)\n"
|
||||
"\t- keycode: any code from GameKeys\n"
|
||||
"\tSet the key this sensor should listen to.\n" ;
|
||||
PyObject* SCA_KeyboardSensor::PySetKey(PyObject* args)
|
||||
{
|
||||
ShowDeprecationWarning("setKey()", "the key property");
|
||||
int keyCode;
|
||||
|
||||
if(!PyArg_ParseTuple(args, "i:setKey", &keyCode)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Since we have symbolic constants for this in Python, we don't guard */
|
||||
/* anything. It's up to the user to provide a sensible number. */
|
||||
m_hotkey = keyCode;
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/** 3. GetHold1 : set the first bucky bit */
|
||||
const char SCA_KeyboardSensor::GetHold1_doc[] =
|
||||
"getHold1()\n"
|
||||
"\tReturn the code of the first key modifier to the key this \n"
|
||||
"\tsensor is listening to.\n" ;
|
||||
PyObject* SCA_KeyboardSensor::PyGetHold1()
|
||||
{
|
||||
ShowDeprecationWarning("getHold1()", "the hold1 property");
|
||||
return PyLong_FromSsize_t(m_qual);
|
||||
}
|
||||
|
||||
/** 4. SetHold1: change the first bucky bit */
|
||||
const char SCA_KeyboardSensor::SetHold1_doc[] =
|
||||
"setHold1(keycode)\n"
|
||||
"\t- keycode: any code from GameKeys\n"
|
||||
"\tSet the first modifier to the key this sensor should listen to.\n" ;
|
||||
PyObject* SCA_KeyboardSensor::PySetHold1(PyObject* args)
|
||||
{
|
||||
ShowDeprecationWarning("setHold1()", "the hold1 property");
|
||||
int keyCode;
|
||||
|
||||
if(!PyArg_ParseTuple(args, "i:setHold1", &keyCode)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Since we have symbolic constants for this in Python, we don't guard */
|
||||
/* anything. It's up to the user to provide a sensible number. */
|
||||
m_qual = keyCode;
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/** 5. GetHold2 : get the second bucky bit */
|
||||
const char SCA_KeyboardSensor::GetHold2_doc[] =
|
||||
"getHold2()\n"
|
||||
"\tReturn the code of the second key modifier to the key this \n"
|
||||
"\tsensor is listening to.\n" ;
|
||||
PyObject* SCA_KeyboardSensor::PyGetHold2()
|
||||
{
|
||||
ShowDeprecationWarning("getHold2()", "the hold2 property");
|
||||
return PyLong_FromSsize_t(m_qual2);
|
||||
}
|
||||
|
||||
/** 6. SetHold2: change the second bucky bit */
|
||||
const char SCA_KeyboardSensor::SetHold2_doc[] =
|
||||
"setHold2(keycode)\n"
|
||||
"\t- keycode: any code from GameKeys\n"
|
||||
"\tSet the first modifier to the key this sensor should listen to.\n" ;
|
||||
PyObject* SCA_KeyboardSensor::PySetHold2(PyObject* args)
|
||||
{
|
||||
ShowDeprecationWarning("setHold2()", "the hold2 property");
|
||||
int keyCode;
|
||||
|
||||
if(!PyArg_ParseTuple(args, "i:setHold2", &keyCode)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Since we have symbolic constants for this in Python, we don't guard */
|
||||
/* anything. It's up to the user to provide a sensible number. */
|
||||
m_qual2 = keyCode;
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
|
||||
const char SCA_KeyboardSensor::GetPressedKeys_doc[] =
|
||||
"getPressedKeys()\n"
|
||||
"\tGet a list of pressed keys that have either been pressed, or just released this frame.\n" ;
|
||||
|
||||
PyObject* SCA_KeyboardSensor::PyGetPressedKeys()
|
||||
{
|
||||
ShowDeprecationWarning("getPressedKeys()", "events");
|
||||
|
||||
SCA_IInputDevice* inputdev = ((SCA_KeyboardManager *)m_eventmgr)->GetInputDevice();
|
||||
|
||||
int num = inputdev->GetNumJustEvents();
|
||||
PyObject* resultlist = PyList_New(num);
|
||||
|
||||
if (num > 0)
|
||||
{
|
||||
|
||||
int index = 0;
|
||||
|
||||
for (int i=SCA_IInputDevice::KX_BEGINKEY ; i<= SCA_IInputDevice::KX_ENDKEY;i++)
|
||||
{
|
||||
const SCA_InputEvent & inevent = inputdev->GetEventValue((SCA_IInputDevice::KX_EnumInputs) i);
|
||||
if ((inevent.m_status == SCA_InputEvent::KX_JUSTACTIVATED)
|
||||
|| (inevent.m_status == SCA_InputEvent::KX_JUSTRELEASED))
|
||||
{
|
||||
PyObject* keypair = PyList_New(2);
|
||||
PyList_SET_ITEM(keypair,0,PyLong_FromSsize_t(i));
|
||||
PyList_SET_ITEM(keypair,1,PyLong_FromSsize_t(inevent.m_status));
|
||||
PyList_SET_ITEM(resultlist,index,keypair);
|
||||
index++;
|
||||
|
||||
if (index >= num) /* should not happen */
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return resultlist;
|
||||
}
|
||||
|
||||
|
||||
|
||||
const char SCA_KeyboardSensor::GetCurrentlyPressedKeys_doc[] =
|
||||
"getCurrentlyPressedKeys()\n"
|
||||
"\tGet a list of keys that are currently pressed.\n" ;
|
||||
|
||||
PyObject* SCA_KeyboardSensor::PyGetCurrentlyPressedKeys()
|
||||
{
|
||||
ShowDeprecationWarning("getCurrentlyPressedKeys()", "events");
|
||||
|
||||
SCA_IInputDevice* inputdev = ((SCA_KeyboardManager *)m_eventmgr)->GetInputDevice();
|
||||
|
||||
int num = inputdev->GetNumActiveEvents();
|
||||
PyObject* resultlist = PyList_New(num);
|
||||
|
||||
if (num > 0)
|
||||
{
|
||||
int index = 0;
|
||||
|
||||
for (int i=SCA_IInputDevice::KX_BEGINKEY ; i<= SCA_IInputDevice::KX_ENDKEY;i++)
|
||||
{
|
||||
const SCA_InputEvent & inevent = inputdev->GetEventValue((SCA_IInputDevice::KX_EnumInputs) i);
|
||||
if ( (inevent.m_status == SCA_InputEvent::KX_ACTIVE)
|
||||
|| (inevent.m_status == SCA_InputEvent::KX_JUSTACTIVATED))
|
||||
{
|
||||
PyObject* keypair = PyList_New(2);
|
||||
PyList_SET_ITEM(keypair,0,PyLong_FromSsize_t(i));
|
||||
PyList_SET_ITEM(keypair,1,PyLong_FromSsize_t(inevent.m_status));
|
||||
PyList_SET_ITEM(resultlist,index,keypair);
|
||||
index++;
|
||||
|
||||
if (index >= num) /* should never happen */
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return resultlist;
|
||||
}
|
||||
|
||||
//<---- Deprecated
|
||||
|
||||
KX_PYMETHODDEF_DOC_O(SCA_KeyboardSensor, getKeyStatus,
|
||||
"getKeyStatus(keycode)\n"
|
||||
"\tGet the given key's status (KX_NO_INPUTSTATUS, KX_JUSTACTIVATED, KX_ACTIVE or KX_JUSTRELEASED).\n")
|
||||
@@ -635,16 +457,6 @@ PyTypeObject SCA_KeyboardSensor::Type = {
|
||||
};
|
||||
|
||||
PyMethodDef SCA_KeyboardSensor::Methods[] = {
|
||||
//Deprecated functions ------>
|
||||
{"getKey", (PyCFunction) SCA_KeyboardSensor::sPyGetKey, METH_NOARGS, (const char *)GetKey_doc},
|
||||
{"setKey", (PyCFunction) SCA_KeyboardSensor::sPySetKey, METH_VARARGS, (const char *)SetKey_doc},
|
||||
{"getHold1", (PyCFunction) SCA_KeyboardSensor::sPyGetHold1, METH_NOARGS, (const char *)GetHold1_doc},
|
||||
{"setHold1", (PyCFunction) SCA_KeyboardSensor::sPySetHold1, METH_VARARGS, (const char *)SetHold1_doc},
|
||||
{"getHold2", (PyCFunction) SCA_KeyboardSensor::sPyGetHold2, METH_NOARGS, (const char *)GetHold2_doc},
|
||||
{"setHold2", (PyCFunction) SCA_KeyboardSensor::sPySetHold2, METH_VARARGS, (const char *)SetHold2_doc},
|
||||
{"getPressedKeys", (PyCFunction) SCA_KeyboardSensor::sPyGetPressedKeys, METH_NOARGS, (const char *)GetPressedKeys_doc},
|
||||
{"getCurrentlyPressedKeys", (PyCFunction) SCA_KeyboardSensor::sPyGetCurrentlyPressedKeys, METH_NOARGS, (const char *)GetCurrentlyPressedKeys_doc},
|
||||
//<----- Deprecated
|
||||
KX_PYMETHODTABLE_O(SCA_KeyboardSensor, getKeyStatus),
|
||||
{NULL,NULL} //Sentinel
|
||||
};
|
||||
|
@@ -107,25 +107,6 @@ public:
|
||||
/* Python interface ---------------------------------------------------- */
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
//Deprecated functions ----->
|
||||
/** 1. GetKey : check which key this sensor looks at */
|
||||
KX_PYMETHOD_DOC_NOARGS(SCA_KeyboardSensor,GetKey);
|
||||
/** 2. SetKey: change the key to look at */
|
||||
KX_PYMETHOD_DOC_VARARGS(SCA_KeyboardSensor,SetKey);
|
||||
/** 3. GetHold1 : set the first bucky bit */
|
||||
KX_PYMETHOD_DOC_NOARGS(SCA_KeyboardSensor,GetHold1);
|
||||
/** 4. SetHold1: change the first bucky bit */
|
||||
KX_PYMETHOD_DOC_VARARGS(SCA_KeyboardSensor,SetHold1);
|
||||
/** 5. GetHold2 : set the second bucky bit */
|
||||
KX_PYMETHOD_DOC_NOARGS(SCA_KeyboardSensor,GetHold2);
|
||||
/** 6. SetHold2: change the second bucky bit */
|
||||
KX_PYMETHOD_DOC_VARARGS(SCA_KeyboardSensor,SetHold2);
|
||||
/** 9. GetPressedKeys: */
|
||||
KX_PYMETHOD_DOC_NOARGS(SCA_KeyboardSensor,GetPressedKeys);
|
||||
/** 9. GetCurrrentlyPressedKeys: */
|
||||
KX_PYMETHOD_DOC_NOARGS(SCA_KeyboardSensor,GetCurrentlyPressedKeys);
|
||||
// <------
|
||||
|
||||
// KeyEvents:
|
||||
KX_PYMETHOD_DOC_NOARGS(SCA_KeyboardSensor,getEventList);
|
||||
// KeyStatus:
|
||||
|
@@ -243,30 +243,6 @@ bool SCA_MouseSensor::isValid(SCA_MouseSensor::KX_MOUSESENSORMODE m)
|
||||
/* Python functions */
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
//Deprecated functions ------>
|
||||
/* get x position ---------------------------------------------------------- */
|
||||
const char SCA_MouseSensor::GetXPosition_doc[] =
|
||||
"getXPosition\n"
|
||||
"\tReturns the x-coordinate of the mouse sensor, in frame coordinates.\n"
|
||||
"\tThe lower-left corner is the origin. The coordinate is given in\n"
|
||||
"\tpixels\n";
|
||||
PyObject* SCA_MouseSensor::PyGetXPosition() {
|
||||
ShowDeprecationWarning("getXPosition()", "the position property");
|
||||
return PyLong_FromSsize_t(m_x);
|
||||
}
|
||||
|
||||
/* get y position ---------------------------------------------------------- */
|
||||
const char SCA_MouseSensor::GetYPosition_doc[] =
|
||||
"getYPosition\n"
|
||||
"\tReturns the y-coordinate of the mouse sensor, in frame coordinates.\n"
|
||||
"\tThe lower-left corner is the origin. The coordinate is given in\n"
|
||||
"\tpixels\n";
|
||||
PyObject* SCA_MouseSensor::PyGetYPosition() {
|
||||
ShowDeprecationWarning("getYPosition()", "the position property");
|
||||
return PyLong_FromSsize_t(m_y);
|
||||
}
|
||||
//<----- Deprecated
|
||||
|
||||
KX_PYMETHODDEF_DOC_O(SCA_MouseSensor, getButtonStatus,
|
||||
"getButtonStatus(button)\n"
|
||||
"\tGet the given button's status (KX_INPUT_NONE, KX_INPUT_NONE, KX_INPUT_JUST_ACTIVATED, KX_INPUT_ACTIVE, KX_INPUT_JUST_RELEASED).\n")
|
||||
@@ -316,10 +292,6 @@ PyTypeObject SCA_MouseSensor::Type = {
|
||||
};
|
||||
|
||||
PyMethodDef SCA_MouseSensor::Methods[] = {
|
||||
//Deprecated functions ------>
|
||||
{"getXPosition", (PyCFunction) SCA_MouseSensor::sPyGetXPosition, METH_VARARGS, (const char *)GetXPosition_doc},
|
||||
{"getYPosition", (PyCFunction) SCA_MouseSensor::sPyGetYPosition, METH_VARARGS, (const char *)GetYPosition_doc},
|
||||
//<----- Deprecated
|
||||
KX_PYMETHODTABLE_O(SCA_MouseSensor, getButtonStatus),
|
||||
{NULL,NULL} //Sentinel
|
||||
};
|
||||
|
@@ -107,13 +107,6 @@ class SCA_MouseSensor : public SCA_ISensor
|
||||
/* Python interface ---------------------------------------------------- */
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
//Deprecated functions ----->
|
||||
/* read x-coordinate */
|
||||
KX_PYMETHOD_DOC_NOARGS(SCA_MouseSensor,GetXPosition);
|
||||
/* read y-coordinate */
|
||||
KX_PYMETHOD_DOC_NOARGS(SCA_MouseSensor,GetYPosition);
|
||||
//<----- deprecated
|
||||
|
||||
// get button status
|
||||
KX_PYMETHOD_DOC_O(SCA_MouseSensor,getButtonStatus);
|
||||
|
||||
|
@@ -250,12 +250,6 @@ PyTypeObject SCA_PropertyActuator::Type = {
|
||||
};
|
||||
|
||||
PyMethodDef SCA_PropertyActuator::Methods[] = {
|
||||
//Deprecated functions ------>
|
||||
{"setProperty", (PyCFunction) SCA_PropertyActuator::sPySetProperty, METH_VARARGS, (const char *)SetProperty_doc},
|
||||
{"getProperty", (PyCFunction) SCA_PropertyActuator::sPyGetProperty, METH_VARARGS, (const char *)GetProperty_doc},
|
||||
{"setValue", (PyCFunction) SCA_PropertyActuator::sPySetValue, METH_VARARGS, (const char *)SetValue_doc},
|
||||
{"getValue", (PyCFunction) SCA_PropertyActuator::sPyGetValue, METH_VARARGS, (const char *)GetValue_doc},
|
||||
//<----- Deprecated
|
||||
{NULL,NULL} //Sentinel
|
||||
};
|
||||
|
||||
@@ -266,71 +260,4 @@ PyAttributeDef SCA_PropertyActuator::Attributes[] = {
|
||||
{ NULL } //Sentinel
|
||||
};
|
||||
|
||||
/* 1. setProperty */
|
||||
const char SCA_PropertyActuator::SetProperty_doc[] =
|
||||
"setProperty(name)\n"
|
||||
"\t- name: string\n"
|
||||
"\tSet the property on which to operate. If there is no property\n"
|
||||
"\tof this name, the call is ignored.\n";
|
||||
PyObject* SCA_PropertyActuator::PySetProperty(PyObject* args, PyObject* kwds)
|
||||
{
|
||||
ShowDeprecationWarning("setProperty()", "the 'propName' property");
|
||||
/* Check whether the name exists first ! */
|
||||
char *nameArg;
|
||||
if (!PyArg_ParseTuple(args, "s:setProperty", &nameArg)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
CValue* prop = GetParent()->FindIdentifier(nameArg);
|
||||
|
||||
if (!prop->IsError()) {
|
||||
m_propname = nameArg;
|
||||
} else {
|
||||
; /* not found ... */
|
||||
}
|
||||
prop->Release();
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* 2. getProperty */
|
||||
const char SCA_PropertyActuator::GetProperty_doc[] =
|
||||
"getProperty(name)\n"
|
||||
"\tReturn the property on which the actuator operates.\n";
|
||||
PyObject* SCA_PropertyActuator::PyGetProperty(PyObject* args, PyObject* kwds)
|
||||
{
|
||||
ShowDeprecationWarning("getProperty()", "the 'propName' property");
|
||||
return PyUnicode_FromString(m_propname);
|
||||
}
|
||||
|
||||
/* 3. setValue */
|
||||
const char SCA_PropertyActuator::SetValue_doc[] =
|
||||
"setValue(value)\n"
|
||||
"\t- value: string\n"
|
||||
"\tSet the value with which the actuator operates. If the value\n"
|
||||
"\tis not compatible with the type of the property, the subsequent\n"
|
||||
"\t action is ignored.\n";
|
||||
PyObject* SCA_PropertyActuator::PySetValue(PyObject* args, PyObject* kwds)
|
||||
{
|
||||
ShowDeprecationWarning("setValue()", "the value property");
|
||||
char *valArg;
|
||||
if(!PyArg_ParseTuple(args, "s:setValue", &valArg)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (valArg) m_exprtxt = valArg;
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* 4. getValue */
|
||||
const char SCA_PropertyActuator::GetValue_doc[] =
|
||||
"getValue()\n"
|
||||
"\tReturns the value with which the actuator operates.\n";
|
||||
PyObject* SCA_PropertyActuator::PyGetValue(PyObject* args, PyObject* kwds)
|
||||
{
|
||||
ShowDeprecationWarning("getValue()", "the value property");
|
||||
return PyUnicode_FromString(m_exprtxt);
|
||||
}
|
||||
|
||||
/* eof */
|
||||
|
@@ -84,14 +84,6 @@ public:
|
||||
/* Python interface ---------------------------------------------------- */
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
// python wrapped methods
|
||||
KX_PYMETHOD_DOC(SCA_PropertyActuator,SetProperty);
|
||||
KX_PYMETHOD_DOC(SCA_PropertyActuator,GetProperty);
|
||||
KX_PYMETHOD_DOC(SCA_PropertyActuator,SetValue);
|
||||
KX_PYMETHOD_DOC(SCA_PropertyActuator,GetValue);
|
||||
|
||||
/* 5. - ... setObject, getObject, setProp2, getProp2, setMode, getMode*/
|
||||
|
||||
};
|
||||
|
||||
#endif //__KX_PROPERTYACTUATOR_DOC
|
||||
|
@@ -324,14 +324,6 @@ PyTypeObject SCA_PropertySensor::Type = {
|
||||
};
|
||||
|
||||
PyMethodDef SCA_PropertySensor::Methods[] = {
|
||||
//Deprecated functions ------>
|
||||
{"getType", (PyCFunction) SCA_PropertySensor::sPyGetType, METH_NOARGS, (const char *)GetType_doc},
|
||||
{"setType", (PyCFunction) SCA_PropertySensor::sPySetType, METH_VARARGS, (const char *)SetType_doc},
|
||||
{"getProperty", (PyCFunction) SCA_PropertySensor::sPyGetProperty, METH_NOARGS, (const char *)GetProperty_doc},
|
||||
{"setProperty", (PyCFunction) SCA_PropertySensor::sPySetProperty, METH_VARARGS, (const char *)SetProperty_doc},
|
||||
{"getValue", (PyCFunction) SCA_PropertySensor::sPyGetValue, METH_NOARGS, (const char *)GetValue_doc},
|
||||
{"setValue", (PyCFunction) SCA_PropertySensor::sPySetValue, METH_VARARGS, (const char *)SetValue_doc},
|
||||
//<----- Deprecated
|
||||
{NULL,NULL} //Sentinel
|
||||
};
|
||||
|
||||
@@ -342,111 +334,4 @@ PyAttributeDef SCA_PropertySensor::Attributes[] = {
|
||||
{ NULL } //Sentinel
|
||||
};
|
||||
|
||||
/* 1. getType */
|
||||
const char SCA_PropertySensor::GetType_doc[] =
|
||||
"getType()\n"
|
||||
"\tReturns the type of check this sensor performs.\n";
|
||||
PyObject* SCA_PropertySensor::PyGetType()
|
||||
{
|
||||
ShowDeprecationWarning("getType()", "the mode property");
|
||||
return PyLong_FromSsize_t(m_checktype);
|
||||
}
|
||||
|
||||
/* 2. setType */
|
||||
const char SCA_PropertySensor::SetType_doc[] =
|
||||
"setType(type)\n"
|
||||
"\t- type: KX_PROPSENSOR_EQUAL, KX_PROPSENSOR_NOTEQUAL,\n"
|
||||
"\t KX_PROPSENSOR_INTERVAL, KX_PROPSENSOR_CHANGED,\n"
|
||||
"\t or KX_PROPSENSOR_EXPRESSION.\n"
|
||||
"\tSet the type of check to perform.\n";
|
||||
PyObject* SCA_PropertySensor::PySetType(PyObject* args)
|
||||
{
|
||||
ShowDeprecationWarning("setType()", "the mode property");
|
||||
int typeArg;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "i:setType", &typeArg)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if ( (typeArg > KX_PROPSENSOR_NODEF)
|
||||
&& (typeArg < KX_PROPSENSOR_MAX) ) {
|
||||
m_checktype = typeArg;
|
||||
}
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* 3. getProperty */
|
||||
const char SCA_PropertySensor::GetProperty_doc[] =
|
||||
"getProperty()\n"
|
||||
"\tReturn the property with which the sensor operates.\n";
|
||||
PyObject* SCA_PropertySensor::PyGetProperty()
|
||||
{
|
||||
ShowDeprecationWarning("getProperty()", "the 'propName' property");
|
||||
return PyUnicode_FromString(m_checkpropname);
|
||||
}
|
||||
|
||||
/* 4. setProperty */
|
||||
const char SCA_PropertySensor::SetProperty_doc[] =
|
||||
"setProperty(name)\n"
|
||||
"\t- name: string\n"
|
||||
"\tSets the property with which to operate. If there is no property\n"
|
||||
"\tof this name, the call is ignored.\n";
|
||||
PyObject* SCA_PropertySensor::PySetProperty(PyObject* args)
|
||||
{
|
||||
ShowDeprecationWarning("setProperty()", "the 'propName' property");
|
||||
/* We should query whether the name exists. Or should we create a prop */
|
||||
/* on the fly? */
|
||||
char *propNameArg = NULL;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "s:setProperty", &propNameArg)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
CValue *prop = FindIdentifier(STR_String(propNameArg));
|
||||
if (!prop->IsError()) {
|
||||
m_checkpropname = propNameArg;
|
||||
} else {
|
||||
; /* error: bad property name */
|
||||
}
|
||||
prop->Release();
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* 5. getValue */
|
||||
const char SCA_PropertySensor::GetValue_doc[] =
|
||||
"getValue()\n"
|
||||
"\tReturns the value with which the sensor operates.\n";
|
||||
PyObject* SCA_PropertySensor::PyGetValue()
|
||||
{
|
||||
ShowDeprecationWarning("getValue()", "the value property");
|
||||
return PyUnicode_FromString(m_checkpropval);
|
||||
}
|
||||
|
||||
/* 6. setValue */
|
||||
const char SCA_PropertySensor::SetValue_doc[] =
|
||||
"setValue(value)\n"
|
||||
"\t- value: string\n"
|
||||
"\tSet the value with which the sensor operates. If the value\n"
|
||||
"\tis not compatible with the type of the property, the subsequent\n"
|
||||
"\t action is ignored.\n";
|
||||
PyObject* SCA_PropertySensor::PySetValue(PyObject* args)
|
||||
{
|
||||
ShowDeprecationWarning("setValue()", "the value property");
|
||||
/* Here, we need to check whether the value is 'valid' for this property.*/
|
||||
/* We know that the property exists, or is NULL. */
|
||||
char *propValArg = NULL;
|
||||
|
||||
if(!PyArg_ParseTuple(args, "s:setValue", &propValArg)) {
|
||||
return NULL;
|
||||
}
|
||||
STR_String oldval = m_checkpropval;
|
||||
m_checkpropval = propValArg;
|
||||
if (validValueForProperty(m_proxy, NULL)) {
|
||||
m_checkpropval = oldval;
|
||||
return NULL;
|
||||
}
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* eof */
|
||||
|
@@ -88,18 +88,6 @@ public:
|
||||
/* Python interface ---------------------------------------------------- */
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
/* 1. getType */
|
||||
KX_PYMETHOD_DOC_NOARGS(SCA_PropertySensor,GetType);
|
||||
/* 2. setType */
|
||||
KX_PYMETHOD_DOC_VARARGS(SCA_PropertySensor,SetType);
|
||||
/* 3. setProperty */
|
||||
KX_PYMETHOD_DOC_VARARGS(SCA_PropertySensor,SetProperty);
|
||||
/* 4. getProperty */
|
||||
KX_PYMETHOD_DOC_NOARGS(SCA_PropertySensor,GetProperty);
|
||||
/* 5. getValue */
|
||||
KX_PYMETHOD_DOC_NOARGS(SCA_PropertySensor,GetValue);
|
||||
/* 6. setValue */
|
||||
KX_PYMETHOD_DOC_VARARGS(SCA_PropertySensor,SetValue);
|
||||
/**
|
||||
* Test whether this is a sensible value (type check)
|
||||
*/
|
||||
|
@@ -204,27 +204,7 @@ SCA_IActuator* SCA_PythonController::LinkedActuatorFromPy(PyObject *value)
|
||||
return false;
|
||||
}
|
||||
|
||||
/* warning, self is not the SCA_PythonController, its a PyObjectPlus_Proxy */
|
||||
PyObject* SCA_PythonController::sPyAddActiveActuator(PyObject* self, PyObject* args)
|
||||
{
|
||||
ShowDeprecationWarning("GameLogic.addActiveActuator(act, bool)", "controller.activate(act) or controller.deactivate(act)");
|
||||
|
||||
PyObject* ob1;
|
||||
int activate;
|
||||
if (!PyArg_ParseTuple(args, "Oi:addActiveActuator", &ob1,&activate))
|
||||
return NULL;
|
||||
|
||||
SCA_IActuator* actu = LinkedActuatorFromPy(ob1);
|
||||
if(actu==NULL)
|
||||
return NULL;
|
||||
|
||||
bool boolval = (activate!=0);
|
||||
m_sCurrentLogicManager->AddActiveActuator((SCA_IActuator*)actu,boolval);
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
const char* SCA_PythonController::sPyGetCurrentController__doc__ = "getCurrentController()";
|
||||
const char* SCA_PythonController::sPyAddActiveActuator__doc__= "addActiveActuator(actuator,bool)";
|
||||
|
||||
PyTypeObject SCA_PythonController::Type = {
|
||||
PyVarObject_HEAD_INIT(NULL, 0)
|
||||
@@ -251,11 +231,6 @@ PyTypeObject SCA_PythonController::Type = {
|
||||
PyMethodDef SCA_PythonController::Methods[] = {
|
||||
{"activate", (PyCFunction) SCA_PythonController::sPyActivate, METH_O},
|
||||
{"deactivate", (PyCFunction) SCA_PythonController::sPyDeActivate, METH_O},
|
||||
|
||||
//Deprecated functions ------>
|
||||
{"setScript", (PyCFunction) SCA_PythonController::sPySetScript, METH_O},
|
||||
{"getScript", (PyCFunction) SCA_PythonController::sPyGetScript, METH_NOARGS},
|
||||
//<----- Deprecated
|
||||
{NULL,NULL} //Sentinel
|
||||
};
|
||||
|
||||
@@ -510,33 +485,6 @@ PyObject* SCA_PythonController::PyDeActivate(PyObject *value)
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* 1. getScript */
|
||||
PyObject* SCA_PythonController::PyGetScript()
|
||||
{
|
||||
ShowDeprecationWarning("getScript()", "the script property");
|
||||
return PyUnicode_FromString(m_scriptText);
|
||||
}
|
||||
|
||||
/* 2. setScript */
|
||||
PyObject* SCA_PythonController::PySetScript(PyObject* value)
|
||||
{
|
||||
char *scriptArg = _PyUnicode_AsString(value);
|
||||
|
||||
ShowDeprecationWarning("setScript()", "the script property");
|
||||
|
||||
if (scriptArg==NULL) {
|
||||
PyErr_SetString(PyExc_TypeError, "expected a string (script name)");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* set scripttext sets m_bModified to true,
|
||||
so next time the script is needed, a reparse into byte code is done */
|
||||
|
||||
this->SetScriptText(scriptArg);
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyObject* SCA_PythonController::pyattr_get_script(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
//SCA_PythonController* self= static_cast<SCA_PythonController*>(static_cast<SCA_IController*>(static_cast<SCA_ILogicBrick*>(static_cast<CValue*>(static_cast<PyObjectPlus*>(self_v)))));
|
||||
|
@@ -337,15 +337,6 @@ PyTypeObject SCA_RandomActuator::Type = {
|
||||
};
|
||||
|
||||
PyMethodDef SCA_RandomActuator::Methods[] = {
|
||||
//Deprecated functions ------>
|
||||
{"setSeed", (PyCFunction) SCA_RandomActuator::sPySetSeed, METH_VARARGS, (const char *)SetSeed_doc},
|
||||
{"getSeed", (PyCFunction) SCA_RandomActuator::sPyGetSeed, METH_NOARGS, (const char *)GetSeed_doc},
|
||||
{"getPara1", (PyCFunction) SCA_RandomActuator::sPyGetPara1, METH_NOARGS, (const char *)GetPara1_doc},
|
||||
{"getPara2", (PyCFunction) SCA_RandomActuator::sPyGetPara2, METH_NOARGS, (const char *)GetPara2_doc},
|
||||
{"getDistribution", (PyCFunction) SCA_RandomActuator::sPyGetDistribution, METH_NOARGS, (const char *)GetDistribution_doc},
|
||||
{"setProperty", (PyCFunction) SCA_RandomActuator::sPySetProperty, METH_VARARGS, (const char *)SetProperty_doc},
|
||||
{"getProperty", (PyCFunction) SCA_RandomActuator::sPyGetProperty, METH_NOARGS, (const char *)GetProperty_doc},
|
||||
//<----- Deprecated
|
||||
KX_PYMETHODTABLE(SCA_RandomActuator, setBoolConst),
|
||||
KX_PYMETHODTABLE_NOARGS(SCA_RandomActuator, setBoolUniform),
|
||||
KX_PYMETHODTABLE(SCA_RandomActuator, setBoolBernouilli),
|
||||
@@ -389,104 +380,6 @@ int SCA_RandomActuator::pyattr_set_seed(void *self, const struct KX_PYATTRIBUTE_
|
||||
}
|
||||
}
|
||||
|
||||
/* 1. setSeed */
|
||||
const char SCA_RandomActuator::SetSeed_doc[] =
|
||||
"setSeed(seed)\n"
|
||||
"\t- seed: integer\n"
|
||||
"\tSet the initial seed of the generator. Equal seeds produce\n"
|
||||
"\tequal series. If the seed is 0, the generator will produce\n"
|
||||
"\tthe same value on every call.\n";
|
||||
PyObject* SCA_RandomActuator::PySetSeed(PyObject* args) {
|
||||
ShowDeprecationWarning("setSeed()", "the seed property");
|
||||
long seedArg;
|
||||
if(!PyArg_ParseTuple(args, "i:setSeed", &seedArg)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
m_base->SetSeed(seedArg);
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
/* 2. getSeed */
|
||||
const char SCA_RandomActuator::GetSeed_doc[] =
|
||||
"getSeed()\n"
|
||||
"\tReturns the initial seed of the generator. Equal seeds produce\n"
|
||||
"\tequal series.\n";
|
||||
PyObject* SCA_RandomActuator::PyGetSeed()
|
||||
{
|
||||
ShowDeprecationWarning("getSeed()", "the seed property");
|
||||
return PyLong_FromSsize_t(m_base->GetSeed());
|
||||
}
|
||||
|
||||
/* 4. getPara1 */
|
||||
const char SCA_RandomActuator::GetPara1_doc[] =
|
||||
"getPara1()\n"
|
||||
"\tReturns the first parameter of the active distribution. Refer\n"
|
||||
"\tto the documentation of the generator types for the meaning\n"
|
||||
"\tof this value.";
|
||||
PyObject* SCA_RandomActuator::PyGetPara1()
|
||||
{
|
||||
ShowDeprecationWarning("getPara1()", "the para1 property");
|
||||
return PyFloat_FromDouble(m_parameter1);
|
||||
}
|
||||
|
||||
/* 6. getPara2 */
|
||||
const char SCA_RandomActuator::GetPara2_doc[] =
|
||||
"getPara2()\n"
|
||||
"\tReturns the first parameter of the active distribution. Refer\n"
|
||||
"\tto the documentation of the generator types for the meaning\n"
|
||||
"\tof this value.";
|
||||
PyObject* SCA_RandomActuator::PyGetPara2()
|
||||
{
|
||||
ShowDeprecationWarning("getPara2()", "the para2 property");
|
||||
return PyFloat_FromDouble(m_parameter2);
|
||||
}
|
||||
|
||||
/* 8. getDistribution */
|
||||
const char SCA_RandomActuator::GetDistribution_doc[] =
|
||||
"getDistribution()\n"
|
||||
"\tReturns the type of the active distribution.\n";
|
||||
PyObject* SCA_RandomActuator::PyGetDistribution()
|
||||
{
|
||||
ShowDeprecationWarning("getDistribution()", "the distribution property");
|
||||
return PyLong_FromSsize_t(m_distribution);
|
||||
}
|
||||
|
||||
/* 9. setProperty */
|
||||
const char SCA_RandomActuator::SetProperty_doc[] =
|
||||
"setProperty(name)\n"
|
||||
"\t- name: string\n"
|
||||
"\tSet the property to which the random value is assigned. If the \n"
|
||||
"\tgenerator and property types do not match, the assignment is ignored.\n";
|
||||
PyObject* SCA_RandomActuator::PySetProperty(PyObject* args) {
|
||||
ShowDeprecationWarning("setProperty()", "the 'propName' property");
|
||||
char *nameArg;
|
||||
if (!PyArg_ParseTuple(args, "s:setProperty", &nameArg)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
CValue* prop = GetParent()->FindIdentifier(nameArg);
|
||||
|
||||
if (!prop->IsError()) {
|
||||
m_propname = nameArg;
|
||||
} else {
|
||||
; /* not found ... */
|
||||
}
|
||||
prop->Release();
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
/* 10. getProperty */
|
||||
const char SCA_RandomActuator::GetProperty_doc[] =
|
||||
"getProperty(name)\n"
|
||||
"\tReturn the property to which the random value is assigned. If the \n"
|
||||
"\tgenerator and property types do not match, the assignment is ignored.\n";
|
||||
PyObject* SCA_RandomActuator::PyGetProperty()
|
||||
{
|
||||
ShowDeprecationWarning("getProperty()", "the 'propName' property");
|
||||
return PyUnicode_FromString(m_propname);
|
||||
}
|
||||
|
||||
/* 11. setBoolConst */
|
||||
KX_PYMETHODDEF_DOC_VARARGS(SCA_RandomActuator, setBoolConst,
|
||||
"setBoolConst(value)\n"
|
||||
|
@@ -99,16 +99,6 @@ class SCA_RandomActuator : public SCA_IActuator
|
||||
static PyObject* pyattr_get_seed(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static int pyattr_set_seed(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
|
||||
|
||||
// Deprecated methods ----->
|
||||
KX_PYMETHOD_DOC_VARARGS(SCA_RandomActuator,SetSeed);
|
||||
KX_PYMETHOD_DOC_NOARGS(SCA_RandomActuator,GetSeed);
|
||||
KX_PYMETHOD_DOC_NOARGS(SCA_RandomActuator,GetPara1);
|
||||
KX_PYMETHOD_DOC_NOARGS(SCA_RandomActuator,GetPara2);
|
||||
KX_PYMETHOD_DOC_NOARGS(SCA_RandomActuator,GetDistribution);
|
||||
KX_PYMETHOD_DOC_VARARGS(SCA_RandomActuator,SetProperty);
|
||||
KX_PYMETHOD_DOC_NOARGS(SCA_RandomActuator,GetProperty);
|
||||
// <-----
|
||||
|
||||
KX_PYMETHOD_DOC_VARARGS(SCA_RandomActuator, setBoolConst);
|
||||
KX_PYMETHOD_DOC_NOARGS(SCA_RandomActuator, setBoolUniform);
|
||||
KX_PYMETHOD_DOC_VARARGS(SCA_RandomActuator, setBoolBernouilli);
|
||||
|
@@ -152,11 +152,6 @@ PyTypeObject SCA_RandomSensor::Type = {
|
||||
};
|
||||
|
||||
PyMethodDef SCA_RandomSensor::Methods[] = {
|
||||
//Deprecated functions ----->
|
||||
{"setSeed", (PyCFunction) SCA_RandomSensor::sPySetSeed, METH_VARARGS, (const char *)SetSeed_doc},
|
||||
{"getSeed", (PyCFunction) SCA_RandomSensor::sPyGetSeed, METH_NOARGS, (const char *)GetSeed_doc},
|
||||
{"getLastDraw", (PyCFunction) SCA_RandomSensor::sPyGetLastDraw, METH_NOARGS, (const char *)GetLastDraw_doc},
|
||||
//<----- Deprecated
|
||||
{NULL,NULL} //Sentinel
|
||||
};
|
||||
|
||||
@@ -166,45 +161,6 @@ PyAttributeDef SCA_RandomSensor::Attributes[] = {
|
||||
{NULL} //Sentinel
|
||||
};
|
||||
|
||||
/* 1. setSeed */
|
||||
const char SCA_RandomSensor::SetSeed_doc[] =
|
||||
"setSeed(seed)\n"
|
||||
"\t- seed: integer\n"
|
||||
"\tSet the initial seed of the generator. Equal seeds produce\n"
|
||||
"\tequal series. If the seed is 0, the generator will produce\n"
|
||||
"\tthe same value on every call.\n";
|
||||
PyObject* SCA_RandomSensor::PySetSeed(PyObject* args) {
|
||||
ShowDeprecationWarning("setSeed()", "the seed property");
|
||||
long seedArg;
|
||||
if(!PyArg_ParseTuple(args, "i:setSeed", &seedArg)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
m_basegenerator->SetSeed(seedArg);
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* 2. getSeed */
|
||||
const char SCA_RandomSensor::GetSeed_doc[] =
|
||||
"getSeed()\n"
|
||||
"\tReturns the initial seed of the generator. Equal seeds produce\n"
|
||||
"\tequal series.\n";
|
||||
PyObject* SCA_RandomSensor::PyGetSeed() {
|
||||
ShowDeprecationWarning("getSeed()", "the seed property");
|
||||
return PyLong_FromSsize_t(m_basegenerator->GetSeed());
|
||||
}
|
||||
|
||||
/* 3. getLastDraw */
|
||||
const char SCA_RandomSensor::GetLastDraw_doc[] =
|
||||
"getLastDraw()\n"
|
||||
"\tReturn the last value that was drawn.\n";
|
||||
PyObject* SCA_RandomSensor::PyGetLastDraw() {
|
||||
ShowDeprecationWarning("getLastDraw()", "the lastDraw property");
|
||||
return PyLong_FromSsize_t(m_lastdraw);
|
||||
}
|
||||
|
||||
|
||||
PyObject* SCA_RandomSensor::pyattr_get_seed(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
SCA_RandomSensor* self= static_cast<SCA_RandomSensor*>(self_v);
|
||||
|
@@ -60,13 +60,6 @@ public:
|
||||
/* Python interface ---------------------------------------------------- */
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
/* 1. setSeed */
|
||||
KX_PYMETHOD_DOC_VARARGS(SCA_RandomSensor,SetSeed);
|
||||
/* 2. getSeed */
|
||||
KX_PYMETHOD_DOC_NOARGS(SCA_RandomSensor,GetSeed);
|
||||
/* 3. getLastDraw */
|
||||
KX_PYMETHOD_DOC_NOARGS(SCA_RandomSensor,GetLastDraw);
|
||||
|
||||
static PyObject* pyattr_get_seed(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static int pyattr_set_seed(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
|
||||
|
||||
|
@@ -123,16 +123,6 @@ PyTypeObject KX_NetworkMessageActuator::Type = {
|
||||
};
|
||||
|
||||
PyMethodDef KX_NetworkMessageActuator::Methods[] = {
|
||||
// Deprecated ----->
|
||||
{"setToPropName", (PyCFunction)
|
||||
KX_NetworkMessageActuator::sPySetToPropName, METH_VARARGS},
|
||||
{"setSubject", (PyCFunction)
|
||||
KX_NetworkMessageActuator::sPySetSubject, METH_VARARGS},
|
||||
{"setBodyType", (PyCFunction)
|
||||
KX_NetworkMessageActuator::sPySetBodyType, METH_VARARGS},
|
||||
{"setBody", (PyCFunction)
|
||||
KX_NetworkMessageActuator::sPySetBody, METH_VARARGS},
|
||||
// <-----
|
||||
{NULL,NULL} // Sentinel
|
||||
};
|
||||
|
||||
@@ -143,78 +133,3 @@ PyAttributeDef KX_NetworkMessageActuator::Attributes[] = {
|
||||
KX_PYATTRIBUTE_STRING_RW("body", 0, 16384, false, KX_NetworkMessageActuator, m_body),
|
||||
{ NULL } //Sentinel
|
||||
};
|
||||
|
||||
// Deprecated ----->
|
||||
// 1. SetToPropName
|
||||
PyObject* KX_NetworkMessageActuator::PySetToPropName(
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
{
|
||||
ShowDeprecationWarning("setToProp()", "the propName property");
|
||||
char* ToPropName;
|
||||
|
||||
if (PyArg_ParseTuple(args, "s:setToPropName", &ToPropName)) {
|
||||
m_toPropName = ToPropName;
|
||||
}
|
||||
else {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
// 2. SetSubject
|
||||
PyObject* KX_NetworkMessageActuator::PySetSubject(
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
{
|
||||
ShowDeprecationWarning("setSubject()", "the subject property");
|
||||
char* Subject;
|
||||
|
||||
if (PyArg_ParseTuple(args, "s:setSubject", &Subject)) {
|
||||
m_subject = Subject;
|
||||
}
|
||||
else {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
// 3. SetBodyType
|
||||
PyObject* KX_NetworkMessageActuator::PySetBodyType(
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
{
|
||||
ShowDeprecationWarning("setBodyType()", "the usePropBody property");
|
||||
int BodyType;
|
||||
|
||||
if (PyArg_ParseTuple(args, "i:setBodyType", &BodyType)) {
|
||||
m_bPropBody = (BodyType != 0);
|
||||
}
|
||||
else {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
// 4. SetBody
|
||||
PyObject* KX_NetworkMessageActuator::PySetBody(
|
||||
PyObject* args,
|
||||
PyObject* kwds)
|
||||
{
|
||||
ShowDeprecationWarning("setBody()", "the body property");
|
||||
char* Body;
|
||||
|
||||
if (PyArg_ParseTuple(args, "s:setBody", &Body)) {
|
||||
m_body = Body;
|
||||
}
|
||||
else {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
// <----- Deprecated
|
||||
|
@@ -60,13 +60,6 @@ public:
|
||||
/* Python interface ------------------------------------------- */
|
||||
/* ------------------------------------------------------------ */
|
||||
|
||||
// Deprecated ----->
|
||||
KX_PYMETHOD(KX_NetworkMessageActuator, SetToPropName);
|
||||
KX_PYMETHOD(KX_NetworkMessageActuator, SetSubject);
|
||||
KX_PYMETHOD(KX_NetworkMessageActuator, SetBodyType);
|
||||
KX_PYMETHOD(KX_NetworkMessageActuator, SetBody);
|
||||
// <-----
|
||||
|
||||
};
|
||||
|
||||
#endif //__KX_NETWORKMESSAGEACTUATOR_H
|
||||
|
@@ -186,23 +186,6 @@ PyTypeObject KX_NetworkMessageSensor::Type = {
|
||||
};
|
||||
|
||||
PyMethodDef KX_NetworkMessageSensor::Methods[] = {
|
||||
// Deprecated ----->
|
||||
{"setSubjectFilterText", (PyCFunction)
|
||||
KX_NetworkMessageSensor::sPySetSubjectFilterText, METH_O,
|
||||
(const char *)SetSubjectFilterText_doc},
|
||||
{"getFrameMessageCount", (PyCFunction)
|
||||
KX_NetworkMessageSensor::sPyGetFrameMessageCount, METH_NOARGS,
|
||||
(const char *)GetFrameMessageCount_doc},
|
||||
{"getBodies", (PyCFunction)
|
||||
KX_NetworkMessageSensor::sPyGetBodies, METH_NOARGS,
|
||||
(const char *)GetBodies_doc},
|
||||
{"getSubject", (PyCFunction)
|
||||
KX_NetworkMessageSensor::sPyGetSubject, METH_NOARGS,
|
||||
(const char *)GetSubject_doc},
|
||||
{"getSubjects", (PyCFunction)
|
||||
KX_NetworkMessageSensor::sPyGetSubjects, METH_NOARGS,
|
||||
(const char *)GetSubjects_doc},
|
||||
// <-----
|
||||
{NULL,NULL} //Sentinel
|
||||
};
|
||||
|
||||
@@ -233,75 +216,3 @@ PyObject* KX_NetworkMessageSensor::pyattr_get_subjects(void *self_v, const KX_PY
|
||||
return (new CListValue())->NewProxy(true);
|
||||
}
|
||||
}
|
||||
|
||||
// Deprecated ----->
|
||||
// 1. Set the message subject that this sensor listens for
|
||||
const char KX_NetworkMessageSensor::SetSubjectFilterText_doc[] =
|
||||
"\tsetSubjectFilterText(value)\n"
|
||||
"\tChange the message subject text that this sensor is listening to.\n";
|
||||
|
||||
PyObject* KX_NetworkMessageSensor::PySetSubjectFilterText(PyObject* value)
|
||||
{
|
||||
ShowDeprecationWarning("setSubjectFilterText()", "subject");
|
||||
char* Subject = _PyUnicode_AsString(value);
|
||||
if (Subject==NULL) {
|
||||
PyErr_SetString(PyExc_TypeError, "sensor.tsetSubjectFilterText(string): KX_NetworkMessageSensor, expected a string message");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
m_subject = Subject;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
// 2. Get the number of messages received since the last frame
|
||||
const char KX_NetworkMessageSensor::GetFrameMessageCount_doc[] =
|
||||
"\tgetFrameMessageCount()\n"
|
||||
"\tGet the number of messages received since the last frame.\n";
|
||||
|
||||
PyObject* KX_NetworkMessageSensor::PyGetFrameMessageCount()
|
||||
{
|
||||
ShowDeprecationWarning("getFrameMessageCount()", "frameMessageCount");
|
||||
return PyLong_FromSsize_t(long(m_frame_message_count));
|
||||
}
|
||||
|
||||
// 3. Get the message bodies
|
||||
const char KX_NetworkMessageSensor::GetBodies_doc[] =
|
||||
"\tgetBodies()\n"
|
||||
"\tGet the list of message bodies.\n";
|
||||
|
||||
PyObject* KX_NetworkMessageSensor::PyGetBodies()
|
||||
{
|
||||
ShowDeprecationWarning("getBodies()", "bodies");
|
||||
if (m_BodyList) {
|
||||
return m_BodyList->GetProxy();
|
||||
} else {
|
||||
return (new CListValue())->NewProxy(true);
|
||||
}
|
||||
}
|
||||
|
||||
// 4. Get the message subject: field of the message sensor
|
||||
const char KX_NetworkMessageSensor::GetSubject_doc[] =
|
||||
"\tgetSubject()\n"
|
||||
"\tGet the subject: field of the message sensor.\n";
|
||||
|
||||
PyObject* KX_NetworkMessageSensor::PyGetSubject()
|
||||
{
|
||||
ShowDeprecationWarning("getSubject()", "subject");
|
||||
return PyUnicode_FromString(m_subject ? m_subject : "");
|
||||
}
|
||||
|
||||
// 5. Get the message subjects
|
||||
const char KX_NetworkMessageSensor::GetSubjects_doc[] =
|
||||
"\tgetSubjects()\n"
|
||||
"\tGet list of message subjects.\n";
|
||||
|
||||
PyObject* KX_NetworkMessageSensor::PyGetSubjects()
|
||||
{
|
||||
ShowDeprecationWarning("getSubjects()", "subjects");
|
||||
if (m_SubjectList) {
|
||||
return m_SubjectList->GetProxy();
|
||||
} else {
|
||||
return (new CListValue())->NewProxy(true);
|
||||
}
|
||||
}
|
||||
// <----- Deprecated
|
||||
|
@@ -70,14 +70,6 @@ public:
|
||||
/* Python interface -------------------------------------------- */
|
||||
/* ------------------------------------------------------------- */
|
||||
|
||||
// Deprecated ----->
|
||||
KX_PYMETHOD_DOC_O(KX_NetworkMessageSensor, SetSubjectFilterText);
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_NetworkMessageSensor, GetFrameMessageCount);
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_NetworkMessageSensor, GetBodies);
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_NetworkMessageSensor, GetSubject);
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_NetworkMessageSensor, GetSubjects);
|
||||
// <-----
|
||||
|
||||
/* attributes */
|
||||
static PyObject* pyattr_get_bodies(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject* pyattr_get_subjects(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
|
@@ -496,12 +496,6 @@ PyMethodDef KX_Camera::Methods[] = {
|
||||
KX_PYMETHODTABLE_O(KX_Camera, getScreenPosition),
|
||||
KX_PYMETHODTABLE(KX_Camera, getScreenVect),
|
||||
KX_PYMETHODTABLE(KX_Camera, getScreenRay),
|
||||
|
||||
// DEPRECATED
|
||||
KX_PYMETHODTABLE_O(KX_Camera, enableViewport),
|
||||
KX_PYMETHODTABLE_NOARGS(KX_Camera, getProjectionMatrix),
|
||||
KX_PYMETHODTABLE_O(KX_Camera, setProjectionMatrix),
|
||||
|
||||
{NULL,NULL} //Sentinel
|
||||
};
|
||||
|
||||
@@ -680,92 +674,6 @@ KX_PYMETHODDEF_DOC_NOARGS(KX_Camera, getWorldToCamera,
|
||||
return PyObjectFrom(GetWorldToCamera()); /* new ref */
|
||||
}
|
||||
|
||||
KX_PYMETHODDEF_DOC_NOARGS(KX_Camera, getProjectionMatrix,
|
||||
"getProjectionMatrix() -> Matrix4x4\n"
|
||||
"\treturns this camera's projection matrix, as a list of four lists of four values.\n\n"
|
||||
"\tie: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]])\n"
|
||||
)
|
||||
{
|
||||
ShowDeprecationWarning("getProjectionMatrix()", "the projection_matrix property");
|
||||
return PyObjectFrom(GetProjectionMatrix()); /* new ref */
|
||||
}
|
||||
|
||||
KX_PYMETHODDEF_DOC_O(KX_Camera, setProjectionMatrix,
|
||||
"setProjectionMatrix(MT_Matrix4x4 m) -> None\n"
|
||||
"\tSets this camera's projection matrix\n"
|
||||
"\n"
|
||||
"\tExample:\n"
|
||||
"\timport GameLogic\n"
|
||||
"\t# Set a perspective projection matrix\n"
|
||||
"\tdef Perspective(left, right, bottom, top, near, far):\n"
|
||||
"\t\tm = MT_Matrix4x4()\n"
|
||||
"\t\tm[0][0] = m[0][2] = right - left\n"
|
||||
"\t\tm[1][1] = m[1][2] = top - bottom\n"
|
||||
"\t\tm[2][2] = m[2][3] = -far - near\n"
|
||||
"\t\tm[3][2] = -1\n"
|
||||
"\t\tm[3][3] = 0\n"
|
||||
"\t\treturn m\n"
|
||||
"\n"
|
||||
"\t# Set an orthographic projection matrix\n"
|
||||
"\tdef Orthographic(left, right, bottom, top, near, far):\n"
|
||||
"\t\tm = MT_Matrix4x4()\n"
|
||||
"\t\tm[0][0] = right - left\n"
|
||||
"\t\tm[0][3] = -right - left\n"
|
||||
"\t\tm[1][1] = top - bottom\n"
|
||||
"\t\tm[1][3] = -top - bottom\n"
|
||||
"\t\tm[2][2] = far - near\n"
|
||||
"\t\tm[2][3] = -far - near\n"
|
||||
"\t\tm[3][3] = 1\n"
|
||||
"\t\treturn m\n"
|
||||
"\n"
|
||||
"\t# Set an isometric projection matrix\n"
|
||||
"\tdef Isometric(left, right, bottom, top, near, far):\n"
|
||||
"\t\tm = MT_Matrix4x4()\n"
|
||||
"\t\tm[0][0] = m[0][2] = m[1][1] = 0.8660254037844386\n"
|
||||
"\t\tm[1][0] = 0.25\n"
|
||||
"\t\tm[1][2] = -0.25\n"
|
||||
"\t\tm[3][3] = 1\n"
|
||||
"\t\treturn m\n"
|
||||
"\n"
|
||||
"\t"
|
||||
"\tco = GameLogic.getCurrentController()\n"
|
||||
"\tcam = co.getOwner()\n"
|
||||
"\tcam.setProjectionMatrix(Perspective(-1.0, 1.0, -1.0, 1.0, 0.1, 1))\n")
|
||||
{
|
||||
ShowDeprecationWarning("setProjectionMatrix(mat)", "the projection_matrix property");
|
||||
|
||||
MT_Matrix4x4 mat;
|
||||
if (!PyMatTo(value, mat))
|
||||
{
|
||||
PyErr_SetString(PyExc_TypeError, "camera.setProjectionMatrix(matrix): KX_Camera, expected 4x4 list as matrix argument.");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SetProjectionMatrix(mat);
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
KX_PYMETHODDEF_DOC_O(KX_Camera, enableViewport,
|
||||
"enableViewport(viewport)\n"
|
||||
"Sets this camera's viewport status\n"
|
||||
)
|
||||
{
|
||||
ShowDeprecationWarning("enableViewport(bool)", "the useViewport property");
|
||||
|
||||
int viewport = PyObject_IsTrue(value);
|
||||
if (viewport == -1) {
|
||||
PyErr_SetString(PyExc_ValueError, "camera.enableViewport(bool): KX_Camera, expected True/False or 0/1");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if(viewport)
|
||||
EnableViewport(true);
|
||||
else
|
||||
EnableViewport(false);
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
KX_PYMETHODDEF_DOC_VARARGS(KX_Camera, setViewport,
|
||||
"setViewport(left, bottom, right, top)\n"
|
||||
"Sets this camera's viewport\n")
|
||||
|
@@ -273,10 +273,7 @@ public:
|
||||
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_Camera, getCameraToWorld);
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_Camera, getWorldToCamera);
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_Camera, getProjectionMatrix);
|
||||
KX_PYMETHOD_DOC_O(KX_Camera, setProjectionMatrix);
|
||||
|
||||
KX_PYMETHOD_DOC_O(KX_Camera, enableViewport);
|
||||
KX_PYMETHOD_DOC_VARARGS(KX_Camera, setViewport);
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_Camera, setOnTop);
|
||||
|
||||
|
@@ -378,17 +378,6 @@ PyTypeObject KX_CameraActuator::Type = {
|
||||
};
|
||||
|
||||
PyMethodDef KX_CameraActuator::Methods[] = {
|
||||
// ---> deprecated (all)
|
||||
{"setObject",(PyCFunction) KX_CameraActuator::sPySetObject, METH_O, (const char *)SetObject_doc},
|
||||
{"getObject",(PyCFunction) KX_CameraActuator::sPyGetObject, METH_VARARGS, (const char *)GetObject_doc},
|
||||
{"setMin" ,(PyCFunction) KX_CameraActuator::sPySetMin, METH_VARARGS, (const char *)SetMin_doc},
|
||||
{"getMin" ,(PyCFunction) KX_CameraActuator::sPyGetMin, METH_NOARGS, (const char *)GetMin_doc},
|
||||
{"setMax" ,(PyCFunction) KX_CameraActuator::sPySetMax, METH_VARARGS, (const char *)SetMax_doc},
|
||||
{"getMax" ,(PyCFunction) KX_CameraActuator::sPyGetMax, METH_NOARGS, (const char *)GetMax_doc},
|
||||
{"setHeight",(PyCFunction) KX_CameraActuator::sPySetHeight, METH_VARARGS, (const char *)SetHeight_doc},
|
||||
{"getHeight",(PyCFunction) KX_CameraActuator::sPyGetHeight, METH_NOARGS, (const char *)GetHeight_doc},
|
||||
{"setXY" ,(PyCFunction) KX_CameraActuator::sPySetXY, METH_VARARGS, (const char *)SetXY_doc},
|
||||
{"getXY" ,(PyCFunction) KX_CameraActuator::sPyGetXY, METH_NOARGS, (const char *)GetXY_doc},
|
||||
{NULL,NULL,NULL,NULL} //Sentinel
|
||||
};
|
||||
|
||||
@@ -401,152 +390,6 @@ PyAttributeDef KX_CameraActuator::Attributes[] = {
|
||||
{NULL}
|
||||
};
|
||||
|
||||
/* get obj ---------------------------------------------------------- */
|
||||
const char KX_CameraActuator::GetObject_doc[] =
|
||||
"getObject(name_only = 1)\n"
|
||||
"name_only - optional arg, when true will return the KX_GameObject rather then its name\n"
|
||||
"\tReturns the object this sensor reacts to.\n";
|
||||
PyObject* KX_CameraActuator::PyGetObject(PyObject* args)
|
||||
{
|
||||
int ret_name_only = 1;
|
||||
|
||||
ShowDeprecationWarning("getObject()", "the object property");
|
||||
|
||||
if (!PyArg_ParseTuple(args, "|i:getObject", &ret_name_only))
|
||||
return NULL;
|
||||
|
||||
if (!m_ob)
|
||||
Py_RETURN_NONE;
|
||||
|
||||
if (ret_name_only)
|
||||
return PyUnicode_FromString(m_ob->GetName().ReadPtr());
|
||||
else
|
||||
return m_ob->GetProxy();
|
||||
}
|
||||
/* set obj ---------------------------------------------------------- */
|
||||
const char KX_CameraActuator::SetObject_doc[] =
|
||||
"setObject(object)\n"
|
||||
"\t- object: KX_GameObject, string or None\n"
|
||||
"\tSets the object this sensor reacts to.\n";
|
||||
PyObject* KX_CameraActuator::PySetObject(PyObject* value)
|
||||
{
|
||||
KX_GameObject *gameobj;
|
||||
|
||||
ShowDeprecationWarning("setObject()", "the object property");
|
||||
|
||||
if (!ConvertPythonToGameObject(value, &gameobj, true, "actuator.setObject(value): KX_CameraActuator"))
|
||||
return NULL; // ConvertPythonToGameObject sets the error
|
||||
|
||||
if (m_ob != NULL)
|
||||
m_ob->UnregisterActuator(this);
|
||||
|
||||
m_ob = (SCA_IObject*)gameobj;
|
||||
if (m_ob)
|
||||
m_ob->RegisterActuator(this);
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* get min ---------------------------------------------------------- */
|
||||
const char KX_CameraActuator::GetMin_doc[] =
|
||||
"getMin\n"
|
||||
"\tReturns the minimum value set in the Min: field.\n";
|
||||
PyObject* KX_CameraActuator::PyGetMin()
|
||||
{
|
||||
ShowDeprecationWarning("getMin()", "the min property");
|
||||
return PyFloat_FromDouble(m_minHeight);
|
||||
}
|
||||
/* set min ---------------------------------------------------------- */
|
||||
const char KX_CameraActuator::SetMin_doc[] =
|
||||
"setMin\n"
|
||||
"\tSets the minimum value.\n";
|
||||
PyObject* KX_CameraActuator::PySetMin(PyObject* args)
|
||||
{
|
||||
ShowDeprecationWarning("setMin()", "the min property");
|
||||
float min;
|
||||
if(PyArg_ParseTuple(args,"f:setMin", &min))
|
||||
{
|
||||
m_minHeight = min;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
/* get min ---------------------------------------------------------- */
|
||||
const char KX_CameraActuator::GetMax_doc[] =
|
||||
"getMax\n"
|
||||
"\tReturns the maximum value set in the Max: field.\n";
|
||||
PyObject* KX_CameraActuator::PyGetMax()
|
||||
{
|
||||
ShowDeprecationWarning("getMax()", "the max property");
|
||||
return PyFloat_FromDouble(m_maxHeight);
|
||||
}
|
||||
/* set min ---------------------------------------------------------- */
|
||||
const char KX_CameraActuator::SetMax_doc[] =
|
||||
"setMax\n"
|
||||
"\tSets the maximum value.\n";
|
||||
PyObject* KX_CameraActuator::PySetMax(PyObject* args)
|
||||
{
|
||||
ShowDeprecationWarning("getMax()", "the max property");
|
||||
float max;
|
||||
if(PyArg_ParseTuple(args,"f:setMax", &max))
|
||||
{
|
||||
m_maxHeight = max;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
/* get height ---------------------------------------------------------- */
|
||||
const char KX_CameraActuator::GetHeight_doc[] =
|
||||
"getHeight\n"
|
||||
"\tReturns the height value set in the height: field.\n";
|
||||
PyObject* KX_CameraActuator::PyGetHeight()
|
||||
{
|
||||
ShowDeprecationWarning("getHeight()", "the height property");
|
||||
return PyFloat_FromDouble(m_height);
|
||||
}
|
||||
/* set height ---------------------------------------------------------- */
|
||||
const char KX_CameraActuator::SetHeight_doc[] =
|
||||
"setHeight\n"
|
||||
"\tSets the height value.\n";
|
||||
PyObject* KX_CameraActuator::PySetHeight(PyObject* args)
|
||||
{
|
||||
ShowDeprecationWarning("getHeight()", "the height property");
|
||||
float height;
|
||||
if(PyArg_ParseTuple(args,"f:setHeight", &height))
|
||||
{
|
||||
m_height = height;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
/* set XY ---------------------------------------------------------- */
|
||||
const char KX_CameraActuator::SetXY_doc[] =
|
||||
"setXY\n"
|
||||
"\tSets axis the camera tries to get behind.\n"
|
||||
"\t1=x, 0=y\n";
|
||||
PyObject* KX_CameraActuator::PySetXY(PyObject* args)
|
||||
{
|
||||
ShowDeprecationWarning("setXY()", "the useXY property");
|
||||
int value;
|
||||
if(PyArg_ParseTuple(args,"i:setXY", &value))
|
||||
{
|
||||
m_x = value != 0;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* get XY -------------------------------------------------------------*/
|
||||
const char KX_CameraActuator::GetXY_doc[] =
|
||||
"getXY\n"
|
||||
"\tGets the axis the camera tries to get behind.\n"
|
||||
"\tTrue = X, False = Y\n";
|
||||
PyObject* KX_CameraActuator::PyGetXY()
|
||||
{
|
||||
ShowDeprecationWarning("getXY()", "the xy property");
|
||||
return PyLong_FromSsize_t(m_x);
|
||||
}
|
||||
|
||||
PyObject* KX_CameraActuator::pyattr_get_object(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_CameraActuator* self= static_cast<KX_CameraActuator*>(self_v);
|
||||
|
@@ -119,18 +119,6 @@ private :
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
/* set object to look at */
|
||||
KX_PYMETHOD_DOC_O(KX_CameraActuator,SetObject);
|
||||
/* get current object */
|
||||
KX_PYMETHOD_DOC_VARARGS(KX_CameraActuator,GetObject);
|
||||
KX_PYMETHOD_DOC_VARARGS(KX_CameraActuator,SetMin);
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_CameraActuator,GetMin);
|
||||
KX_PYMETHOD_DOC_VARARGS(KX_CameraActuator,SetMax);
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_CameraActuator,GetMax);
|
||||
KX_PYMETHOD_DOC_VARARGS(KX_CameraActuator,SetHeight);
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_CameraActuator,GetHeight);
|
||||
KX_PYMETHOD_DOC_VARARGS(KX_CameraActuator,SetXY);
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_CameraActuator,GetXY);
|
||||
|
||||
static PyObject* pyattr_get_object(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static int pyattr_set_object(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
|
||||
|
||||
|
@@ -587,30 +587,6 @@ PyTypeObject KX_ConstraintActuator::Type = {
|
||||
};
|
||||
|
||||
PyMethodDef KX_ConstraintActuator::Methods[] = {
|
||||
// Deprecated -->
|
||||
{"setDamp", (PyCFunction) KX_ConstraintActuator::sPySetDamp, METH_VARARGS, (const char *)SetDamp_doc},
|
||||
{"getDamp", (PyCFunction) KX_ConstraintActuator::sPyGetDamp, METH_NOARGS, (const char *)GetDamp_doc},
|
||||
{"setRotDamp", (PyCFunction) KX_ConstraintActuator::sPySetRotDamp, METH_VARARGS, (const char *)SetRotDamp_doc},
|
||||
{"getRotDamp", (PyCFunction) KX_ConstraintActuator::sPyGetRotDamp, METH_NOARGS, (const char *)GetRotDamp_doc},
|
||||
{"setDirection", (PyCFunction) KX_ConstraintActuator::sPySetDirection, METH_VARARGS, (const char *)SetDirection_doc},
|
||||
{"getDirection", (PyCFunction) KX_ConstraintActuator::sPyGetDirection, METH_NOARGS, (const char *)GetDirection_doc},
|
||||
{"setOption", (PyCFunction) KX_ConstraintActuator::sPySetOption, METH_VARARGS, (const char *)SetOption_doc},
|
||||
{"getOption", (PyCFunction) KX_ConstraintActuator::sPyGetOption, METH_NOARGS, (const char *)GetOption_doc},
|
||||
{"setTime", (PyCFunction) KX_ConstraintActuator::sPySetTime, METH_VARARGS, (const char *)SetTime_doc},
|
||||
{"getTime", (PyCFunction) KX_ConstraintActuator::sPyGetTime, METH_NOARGS, (const char *)GetTime_doc},
|
||||
{"setProperty", (PyCFunction) KX_ConstraintActuator::sPySetProperty, METH_VARARGS, (const char *)SetProperty_doc},
|
||||
{"getProperty", (PyCFunction) KX_ConstraintActuator::sPyGetProperty, METH_NOARGS, (const char *)GetProperty_doc},
|
||||
{"setMin", (PyCFunction) KX_ConstraintActuator::sPySetMin, METH_VARARGS, (const char *)SetMin_doc},
|
||||
{"getMin", (PyCFunction) KX_ConstraintActuator::sPyGetMin, METH_NOARGS, (const char *)GetMin_doc},
|
||||
{"setDistance", (PyCFunction) KX_ConstraintActuator::sPySetMin, METH_VARARGS, (const char *)SetDistance_doc},
|
||||
{"getDistance", (PyCFunction) KX_ConstraintActuator::sPyGetMin, METH_NOARGS, (const char *)GetDistance_doc},
|
||||
{"setMax", (PyCFunction) KX_ConstraintActuator::sPySetMax, METH_VARARGS, (const char *)SetMax_doc},
|
||||
{"getMax", (PyCFunction) KX_ConstraintActuator::sPyGetMax, METH_NOARGS, (const char *)GetMax_doc},
|
||||
{"setRayLength", (PyCFunction) KX_ConstraintActuator::sPySetMax, METH_VARARGS, (const char *)SetRayLength_doc},
|
||||
{"getRayLength", (PyCFunction) KX_ConstraintActuator::sPyGetMax, METH_NOARGS, (const char *)GetRayLength_doc},
|
||||
{"setLimit", (PyCFunction) KX_ConstraintActuator::sPySetLimit, METH_VARARGS, (const char *)SetLimit_doc},
|
||||
{"getLimit", (PyCFunction) KX_ConstraintActuator::sPyGetLimit, METH_NOARGS, (const char *)GetLimit_doc},
|
||||
// <--
|
||||
{NULL,NULL} //Sentinel
|
||||
};
|
||||
|
||||
@@ -642,318 +618,4 @@ int KX_ConstraintActuator::pyattr_check_direction(void *self, const struct KX_PY
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* 2. setDamp */
|
||||
const char KX_ConstraintActuator::SetDamp_doc[] =
|
||||
"setDamp(duration)\n"
|
||||
"\t- duration: integer\n"
|
||||
"\tSets the time constant of the orientation and distance constraint.\n"
|
||||
"\tIf the duration is negative, it is set to 0.\n";
|
||||
PyObject* KX_ConstraintActuator::PySetDamp(PyObject* args) {
|
||||
ShowDeprecationWarning("setDamp()", "the damp property");
|
||||
int dampArg;
|
||||
if(!PyArg_ParseTuple(args, "i:setDamp", &dampArg)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
m_posDampTime = dampArg;
|
||||
if (m_posDampTime < 0) m_posDampTime = 0;
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
/* 3. getDamp */
|
||||
const char KX_ConstraintActuator::GetDamp_doc[] =
|
||||
"getDamp()\n"
|
||||
"\tReturns the damping parameter.\n";
|
||||
PyObject* KX_ConstraintActuator::PyGetDamp(){
|
||||
ShowDeprecationWarning("getDamp()", "the damp property");
|
||||
return PyLong_FromSsize_t(m_posDampTime);
|
||||
}
|
||||
|
||||
/* 2. setRotDamp */
|
||||
const char KX_ConstraintActuator::SetRotDamp_doc[] =
|
||||
"setRotDamp(duration)\n"
|
||||
"\t- duration: integer\n"
|
||||
"\tSets the time constant of the orientation constraint.\n"
|
||||
"\tIf the duration is negative, it is set to 0.\n";
|
||||
PyObject* KX_ConstraintActuator::PySetRotDamp(PyObject* args) {
|
||||
ShowDeprecationWarning("setRotDamp()", "the rotDamp property");
|
||||
int dampArg;
|
||||
if(!PyArg_ParseTuple(args, "i:setRotDamp", &dampArg)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
m_rotDampTime = dampArg;
|
||||
if (m_rotDampTime < 0) m_rotDampTime = 0;
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
/* 3. getRotDamp */
|
||||
const char KX_ConstraintActuator::GetRotDamp_doc[] =
|
||||
"getRotDamp()\n"
|
||||
"\tReturns the damping time for application of the constraint.\n";
|
||||
PyObject* KX_ConstraintActuator::PyGetRotDamp(){
|
||||
ShowDeprecationWarning("getRotDamp()", "the rotDamp property");
|
||||
return PyLong_FromSsize_t(m_rotDampTime);
|
||||
}
|
||||
|
||||
/* 2. setDirection */
|
||||
const char KX_ConstraintActuator::SetDirection_doc[] =
|
||||
"setDirection(vector)\n"
|
||||
"\t- vector: 3-tuple\n"
|
||||
"\tSets the reference direction in world coordinate for the orientation constraint.\n";
|
||||
PyObject* KX_ConstraintActuator::PySetDirection(PyObject* args) {
|
||||
ShowDeprecationWarning("setDirection()", "the direction property");
|
||||
float x, y, z;
|
||||
MT_Scalar len;
|
||||
MT_Vector3 dir;
|
||||
|
||||
if(!PyArg_ParseTuple(args, "(fff):setDirection", &x, &y, &z)) {
|
||||
return NULL;
|
||||
}
|
||||
dir[0] = x;
|
||||
dir[1] = y;
|
||||
dir[2] = z;
|
||||
len = dir.length();
|
||||
if (MT_fuzzyZero(len)) {
|
||||
std::cout << "Invalid direction" << std::endl;
|
||||
return NULL;
|
||||
}
|
||||
m_refDirVector = dir/len;
|
||||
m_refDirection[0] = x/len;
|
||||
m_refDirection[1] = y/len;
|
||||
m_refDirection[2] = z/len;
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
/* 3. getDirection */
|
||||
const char KX_ConstraintActuator::GetDirection_doc[] =
|
||||
"getDirection()\n"
|
||||
"\tReturns the reference direction of the orientation constraint as a 3-tuple.\n";
|
||||
PyObject* KX_ConstraintActuator::PyGetDirection(){
|
||||
ShowDeprecationWarning("getDirection()", "the direction property");
|
||||
PyObject *retVal = PyList_New(3);
|
||||
|
||||
PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_refDirection[0]));
|
||||
PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_refDirection[1]));
|
||||
PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_refDirection[2]));
|
||||
return retVal;
|
||||
}
|
||||
|
||||
/* 2. setOption */
|
||||
const char KX_ConstraintActuator::SetOption_doc[] =
|
||||
"setOption(option)\n"
|
||||
"\t- option: integer\n"
|
||||
"\tSets several options of the distance constraint.\n"
|
||||
"\tBinary combination of the following values:\n"
|
||||
"\t\t 64 : Activate alignment to surface\n"
|
||||
"\t\t128 : Detect material rather than property\n"
|
||||
"\t\t256 : No deactivation if ray does not hit target\n"
|
||||
"\t\t512 : Activate distance control\n";
|
||||
PyObject* KX_ConstraintActuator::PySetOption(PyObject* args) {
|
||||
ShowDeprecationWarning("setOption()", "the option property");
|
||||
int option;
|
||||
if(!PyArg_ParseTuple(args, "i:setOption", &option)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
m_option = option;
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
/* 3. getOption */
|
||||
const char KX_ConstraintActuator::GetOption_doc[] =
|
||||
"getOption()\n"
|
||||
"\tReturns the option parameter.\n";
|
||||
PyObject* KX_ConstraintActuator::PyGetOption(){
|
||||
ShowDeprecationWarning("getOption()", "the option property");
|
||||
return PyLong_FromSsize_t(m_option);
|
||||
}
|
||||
|
||||
/* 2. setTime */
|
||||
const char KX_ConstraintActuator::SetTime_doc[] =
|
||||
"setTime(duration)\n"
|
||||
"\t- duration: integer\n"
|
||||
"\tSets the activation time of the actuator.\n"
|
||||
"\tThe actuator disables itself after this many frame.\n"
|
||||
"\tIf set to 0 or negative, the actuator is not limited in time.\n";
|
||||
PyObject* KX_ConstraintActuator::PySetTime(PyObject* args) {
|
||||
ShowDeprecationWarning("setTime()", "the time property");
|
||||
int t;
|
||||
if(!PyArg_ParseTuple(args, "i:setTime", &t)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (t < 0)
|
||||
t = 0;
|
||||
m_activeTime = t;
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
/* 3. getTime */
|
||||
const char KX_ConstraintActuator::GetTime_doc[] =
|
||||
"getTime()\n"
|
||||
"\tReturns the time parameter.\n";
|
||||
PyObject* KX_ConstraintActuator::PyGetTime(){
|
||||
ShowDeprecationWarning("getTime()", "the time property");
|
||||
return PyLong_FromSsize_t(m_activeTime);
|
||||
}
|
||||
|
||||
/* 2. setProperty */
|
||||
const char KX_ConstraintActuator::SetProperty_doc[] =
|
||||
"setProperty(property)\n"
|
||||
"\t- property: string\n"
|
||||
"\tSets the name of the property or material for the ray detection of the distance constraint.\n"
|
||||
"\tIf empty, the ray will detect any collisioning object.\n";
|
||||
PyObject* KX_ConstraintActuator::PySetProperty(PyObject* args) {
|
||||
ShowDeprecationWarning("setProperty()", "the 'property' property");
|
||||
char *property;
|
||||
if (!PyArg_ParseTuple(args, "s:setProperty", &property)) {
|
||||
return NULL;
|
||||
}
|
||||
if (property == NULL) {
|
||||
m_property = "";
|
||||
} else {
|
||||
m_property = property;
|
||||
}
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
/* 3. getProperty */
|
||||
const char KX_ConstraintActuator::GetProperty_doc[] =
|
||||
"getProperty()\n"
|
||||
"\tReturns the property parameter.\n";
|
||||
PyObject* KX_ConstraintActuator::PyGetProperty(){
|
||||
ShowDeprecationWarning("getProperty()", "the 'property' property");
|
||||
return PyUnicode_FromString(m_property.Ptr());
|
||||
}
|
||||
|
||||
/* 4. setDistance */
|
||||
const char KX_ConstraintActuator::SetDistance_doc[] =
|
||||
"setDistance(distance)\n"
|
||||
"\t- distance: float\n"
|
||||
"\tSets the target distance in distance constraint\n";
|
||||
/* 4. setMin */
|
||||
const char KX_ConstraintActuator::SetMin_doc[] =
|
||||
"setMin(lower_bound)\n"
|
||||
"\t- lower_bound: float\n"
|
||||
"\tSets the lower value of the interval to which the value\n"
|
||||
"\tis clipped.\n";
|
||||
PyObject* KX_ConstraintActuator::PySetMin(PyObject* args) {
|
||||
ShowDeprecationWarning("setMin() or setDistance()", "the min or distance property");
|
||||
float minArg;
|
||||
if(!PyArg_ParseTuple(args, "f:setMin", &minArg)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
switch (m_locrot) {
|
||||
default:
|
||||
m_minimumBound = minArg;
|
||||
break;
|
||||
case KX_ACT_CONSTRAINT_ROTX:
|
||||
case KX_ACT_CONSTRAINT_ROTY:
|
||||
case KX_ACT_CONSTRAINT_ROTZ:
|
||||
m_minimumBound = MT_radians(minArg);
|
||||
break;
|
||||
}
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
/* 5. getDistance */
|
||||
const char KX_ConstraintActuator::GetDistance_doc[] =
|
||||
"getDistance()\n"
|
||||
"\tReturns the distance parameter \n";
|
||||
/* 5. getMin */
|
||||
const char KX_ConstraintActuator::GetMin_doc[] =
|
||||
"getMin()\n"
|
||||
"\tReturns the lower value of the interval to which the value\n"
|
||||
"\tis clipped.\n";
|
||||
PyObject* KX_ConstraintActuator::PyGetMin() {
|
||||
ShowDeprecationWarning("getMin() or getDistance()", "the min or distance property");
|
||||
return PyFloat_FromDouble(m_minimumBound);
|
||||
}
|
||||
|
||||
/* 6. setRayLength */
|
||||
const char KX_ConstraintActuator::SetRayLength_doc[] =
|
||||
"setRayLength(length)\n"
|
||||
"\t- length: float\n"
|
||||
"\tSets the maximum ray length of the distance constraint\n";
|
||||
/* 6. setMax */
|
||||
const char KX_ConstraintActuator::SetMax_doc[] =
|
||||
"setMax(upper_bound)\n"
|
||||
"\t- upper_bound: float\n"
|
||||
"\tSets the upper value of the interval to which the value\n"
|
||||
"\tis clipped.\n";
|
||||
PyObject* KX_ConstraintActuator::PySetMax(PyObject* args){
|
||||
ShowDeprecationWarning("setMax() or setRayLength()", "the max or rayLength property");
|
||||
float maxArg;
|
||||
if(!PyArg_ParseTuple(args, "f:setMax", &maxArg)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
switch (m_locrot) {
|
||||
default:
|
||||
m_maximumBound = maxArg;
|
||||
break;
|
||||
case KX_ACT_CONSTRAINT_ROTX:
|
||||
case KX_ACT_CONSTRAINT_ROTY:
|
||||
case KX_ACT_CONSTRAINT_ROTZ:
|
||||
m_maximumBound = MT_radians(maxArg);
|
||||
break;
|
||||
}
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
/* 7. getRayLength */
|
||||
const char KX_ConstraintActuator::GetRayLength_doc[] =
|
||||
"getRayLength()\n"
|
||||
"\tReturns the length of the ray\n";
|
||||
/* 7. getMax */
|
||||
const char KX_ConstraintActuator::GetMax_doc[] =
|
||||
"getMax()\n"
|
||||
"\tReturns the upper value of the interval to which the value\n"
|
||||
"\tis clipped.\n";
|
||||
PyObject* KX_ConstraintActuator::PyGetMax() {
|
||||
ShowDeprecationWarning("getMax() or getRayLength()", "the max or rayLength property");
|
||||
return PyFloat_FromDouble(m_maximumBound);
|
||||
}
|
||||
|
||||
|
||||
/* This setter/getter probably for the constraint type */
|
||||
/* 8. setLimit */
|
||||
const char KX_ConstraintActuator::SetLimit_doc[] =
|
||||
"setLimit(type)\n"
|
||||
"\t- type: integer\n"
|
||||
"\t 1 : LocX\n"
|
||||
"\t 2 : LocY\n"
|
||||
"\t 3 : LocZ\n"
|
||||
"\t 7 : Distance along +X axis\n"
|
||||
"\t 8 : Distance along +Y axis\n"
|
||||
"\t 9 : Distance along +Z axis\n"
|
||||
"\t 10 : Distance along -X axis\n"
|
||||
"\t 11 : Distance along -Y axis\n"
|
||||
"\t 12 : Distance along -Z axis\n"
|
||||
"\t 13 : Align X axis\n"
|
||||
"\t 14 : Align Y axis\n"
|
||||
"\t 15 : Align Z axis\n"
|
||||
"\tSets the type of constraint.\n";
|
||||
PyObject* KX_ConstraintActuator::PySetLimit(PyObject* args) {
|
||||
ShowDeprecationWarning("setLimit()", "the limit property");
|
||||
int locrotArg;
|
||||
if(!PyArg_ParseTuple(args, "i:setLimit", &locrotArg)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (IsValidMode((KX_CONSTRAINTTYPE)locrotArg)) m_locrot = locrotArg;
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
/* 9. getLimit */
|
||||
const char KX_ConstraintActuator::GetLimit_doc[] =
|
||||
"getLimit()\n"
|
||||
"\tReturns the type of constraint.\n";
|
||||
PyObject* KX_ConstraintActuator::PyGetLimit() {
|
||||
ShowDeprecationWarning("setLimit()", "the limit property");
|
||||
return PyLong_FromSsize_t(m_locrot);
|
||||
}
|
||||
|
||||
/* eof */
|
||||
|
@@ -143,28 +143,6 @@ protected:
|
||||
static int pyattr_check_direction(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static int pyattr_check_min(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
|
||||
KX_PYMETHOD_DOC_VARARGS(KX_ConstraintActuator,SetDamp);
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetDamp);
|
||||
KX_PYMETHOD_DOC_VARARGS(KX_ConstraintActuator,SetRotDamp);
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetRotDamp);
|
||||
KX_PYMETHOD_DOC_VARARGS(KX_ConstraintActuator,SetDirection);
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetDirection);
|
||||
KX_PYMETHOD_DOC_VARARGS(KX_ConstraintActuator,SetOption);
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetOption);
|
||||
KX_PYMETHOD_DOC_VARARGS(KX_ConstraintActuator,SetTime);
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetTime);
|
||||
KX_PYMETHOD_DOC_VARARGS(KX_ConstraintActuator,SetProperty);
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetProperty);
|
||||
KX_PYMETHOD_DOC_VARARGS(KX_ConstraintActuator,SetMin);
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetMin);
|
||||
static const char SetDistance_doc[];
|
||||
static const char GetDistance_doc[];
|
||||
KX_PYMETHOD_DOC_VARARGS(KX_ConstraintActuator,SetMax);
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetMax);
|
||||
static const char SetRayLength_doc[];
|
||||
static const char GetRayLength_doc[];
|
||||
KX_PYMETHOD_DOC_VARARGS(KX_ConstraintActuator,SetLimit);
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetLimit);
|
||||
};
|
||||
|
||||
#endif //__KX_CONSTRAINTACTUATOR
|
||||
|
@@ -230,10 +230,6 @@ PyTypeObject KX_GameActuator::Type = {
|
||||
|
||||
PyMethodDef KX_GameActuator::Methods[] =
|
||||
{
|
||||
// Deprecated ----->
|
||||
{"getFile", (PyCFunction) KX_GameActuator::sPyGetFile, METH_VARARGS, (const char *)GetFile_doc},
|
||||
{"setFile", (PyCFunction) KX_GameActuator::sPySetFile, METH_VARARGS, (const char *)SetFile_doc},
|
||||
// <-----
|
||||
{NULL,NULL} //Sentinel
|
||||
};
|
||||
|
||||
@@ -242,36 +238,3 @@ PyAttributeDef KX_GameActuator::Attributes[] = {
|
||||
KX_PYATTRIBUTE_INT_RW("mode", KX_GAME_NODEF+1, KX_GAME_MAX-1, true, KX_GameActuator, m_mode),
|
||||
{ NULL } //Sentinel
|
||||
};
|
||||
|
||||
// Deprecated ----->
|
||||
/* getFile */
|
||||
const char KX_GameActuator::GetFile_doc[] =
|
||||
"getFile()\n"
|
||||
"get the name of the file to start.\n";
|
||||
PyObject* KX_GameActuator::PyGetFile(PyObject* args, PyObject* kwds)
|
||||
{
|
||||
ShowDeprecationWarning("getFile()", "the fileName property");
|
||||
return PyUnicode_FromString(m_filename);
|
||||
}
|
||||
|
||||
/* setFile */
|
||||
const char KX_GameActuator::SetFile_doc[] =
|
||||
"setFile(name)\n"
|
||||
"set the name of the file to start.\n";
|
||||
PyObject* KX_GameActuator::PySetFile(PyObject* args, PyObject* kwds)
|
||||
{
|
||||
char* new_file;
|
||||
|
||||
ShowDeprecationWarning("setFile()", "the fileName property");
|
||||
|
||||
if (!PyArg_ParseTuple(args, "s:setFile", &new_file))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
m_filename = STR_String(new_file);
|
||||
|
||||
Py_RETURN_NONE;
|
||||
|
||||
}
|
||||
// <-----
|
||||
|
@@ -76,11 +76,6 @@ protected:
|
||||
/* Python interface ---------------------------------------------------- */
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
// Deprecated functions ----->
|
||||
KX_PYMETHOD_DOC(KX_GameActuator,GetFile);
|
||||
KX_PYMETHOD_DOC(KX_GameActuator,SetFile);
|
||||
// <-----
|
||||
|
||||
}; /* end of class KX_GameActuator */
|
||||
|
||||
#endif
|
||||
|
@@ -1383,8 +1383,8 @@ PyMethodDef KX_GameObject::Methods[] = {
|
||||
{"setVisible",(PyCFunction) KX_GameObject::sPySetVisible, METH_VARARGS},
|
||||
{"setOcclusion",(PyCFunction) KX_GameObject::sPySetOcclusion, METH_VARARGS},
|
||||
{"removeParent", (PyCFunction)KX_GameObject::sPyRemoveParent,METH_NOARGS},
|
||||
{"getChildren", (PyCFunction)KX_GameObject::sPyGetChildren,METH_NOARGS},
|
||||
{"getChildrenRecursive", (PyCFunction)KX_GameObject::sPyGetChildrenRecursive,METH_NOARGS},
|
||||
|
||||
|
||||
{"getPhysicsId", (PyCFunction)KX_GameObject::sPyGetPhysicsId,METH_NOARGS},
|
||||
{"getPropertyNames", (PyCFunction)KX_GameObject::sPyGetPropertyNames,METH_NOARGS},
|
||||
{"replaceMesh",(PyCFunction) KX_GameObject::sPyReplaceMesh, METH_VARARGS},
|
||||
@@ -1400,18 +1400,6 @@ PyMethodDef KX_GameObject::Methods[] = {
|
||||
// dict style access for props
|
||||
{"get",(PyCFunction) KX_GameObject::sPyget, METH_VARARGS},
|
||||
|
||||
// deprecated
|
||||
{"getPosition", (PyCFunction) KX_GameObject::sPyGetPosition, METH_NOARGS},
|
||||
{"setPosition", (PyCFunction) KX_GameObject::sPySetPosition, METH_O},
|
||||
{"setWorldPosition", (PyCFunction) KX_GameObject::sPySetWorldPosition, METH_O},
|
||||
{"getOrientation", (PyCFunction) KX_GameObject::sPyGetOrientation, METH_NOARGS},
|
||||
{"setOrientation", (PyCFunction) KX_GameObject::sPySetOrientation, METH_O},
|
||||
{"getState",(PyCFunction) KX_GameObject::sPyGetState, METH_NOARGS},
|
||||
{"setState",(PyCFunction) KX_GameObject::sPySetState, METH_O},
|
||||
{"getParent", (PyCFunction)KX_GameObject::sPyGetParent,METH_NOARGS},
|
||||
{"getVisible",(PyCFunction) KX_GameObject::sPyGetVisible, METH_NOARGS},
|
||||
{"getMass", (PyCFunction) KX_GameObject::sPyGetMass, METH_NOARGS},
|
||||
{"getMesh", (PyCFunction)KX_GameObject::sPyGetMesh,METH_VARARGS},
|
||||
{NULL,NULL} //Sentinel
|
||||
};
|
||||
|
||||
@@ -1514,13 +1502,6 @@ PyObject* KX_GameObject::PyReinstancePhysicsMesh(PyObject* args)
|
||||
Py_RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
||||
PyObject* KX_GameObject::PyGetPosition()
|
||||
{
|
||||
ShowDeprecationWarning("getPosition()", "the position property");
|
||||
return PyObjectFrom(NodeGetWorldPosition());
|
||||
}
|
||||
|
||||
static PyObject *Map_GetItem(PyObject *self_v, PyObject *item)
|
||||
{
|
||||
KX_GameObject* self= static_cast<KX_GameObject*>BGE_PROXY_REF(self_v);
|
||||
@@ -2200,41 +2181,6 @@ PyObject* KX_GameObject::PySetOcclusion(PyObject* args)
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::PyGetVisible()
|
||||
{
|
||||
ShowDeprecationWarning("getVisible()", "the visible property");
|
||||
return PyLong_FromSsize_t(m_bVisible);
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::PyGetState()
|
||||
{
|
||||
ShowDeprecationWarning("getState()", "the state property");
|
||||
int state = 0;
|
||||
state |= GetState();
|
||||
return PyLong_FromSsize_t(state);
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::PySetState(PyObject* value)
|
||||
{
|
||||
ShowDeprecationWarning("setState()", "the state property");
|
||||
int state_i = PyLong_AsSsize_t(value);
|
||||
unsigned int state = 0;
|
||||
|
||||
if (state_i == -1 && PyErr_Occurred()) {
|
||||
PyErr_SetString(PyExc_TypeError, "expected an int bit field");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
state |= state_i;
|
||||
if ((state & ((1<<30)-1)) == 0) {
|
||||
PyErr_SetString(PyExc_AttributeError, "The state bitfield was not between 0 and 30 (1<<0 and 1<<29)");
|
||||
return NULL;
|
||||
}
|
||||
SetState(state);
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::PyGetVelocity(PyObject* args)
|
||||
{
|
||||
// only can get the velocity if we have a physics object connected to us...
|
||||
@@ -2253,14 +2199,6 @@ PyObject* KX_GameObject::PyGetVelocity(PyObject* args)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
PyObject* KX_GameObject::PyGetMass()
|
||||
{
|
||||
ShowDeprecationWarning("getMass()", "the mass property");
|
||||
return PyFloat_FromDouble((GetPhysicsController() != NULL) ? GetPhysicsController()->GetMass() : 0.0f);
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::PyGetReactionForce()
|
||||
{
|
||||
// only can get the velocity if we have a physics object connected to us...
|
||||
@@ -2297,18 +2235,6 @@ PyObject* KX_GameObject::PyDisableRigidBody()
|
||||
}
|
||||
|
||||
|
||||
|
||||
PyObject* KX_GameObject::PyGetParent()
|
||||
{
|
||||
ShowDeprecationWarning("getParent()", "the parent property");
|
||||
KX_GameObject* parent = this->GetParent();
|
||||
if (parent) {
|
||||
parent->Release(); /* self->GetParent() AddRef's */
|
||||
return parent->GetProxy();
|
||||
}
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::PySetParent(PyObject* args)
|
||||
{
|
||||
KX_Scene *scene = KX_GetActiveScene();
|
||||
@@ -2334,41 +2260,6 @@ PyObject* KX_GameObject::PyRemoveParent()
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::PyGetChildren()
|
||||
{
|
||||
ShowDeprecationWarning("getChildren()", "the children property");
|
||||
|
||||
return GetChildren()->NewProxy(true);
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::PyGetChildrenRecursive()
|
||||
{
|
||||
ShowDeprecationWarning("getChildrenRecursive()", "the childrenRecursive property");
|
||||
|
||||
return GetChildrenRecursive()->NewProxy(true);
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::PyGetMesh(PyObject* args)
|
||||
{
|
||||
ShowDeprecationWarning("getMesh()", "the meshes property (now a list of meshes)");
|
||||
|
||||
int mesh = 0;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "|i:getMesh", &mesh))
|
||||
return NULL; // python sets a simple error
|
||||
|
||||
if (((unsigned int)mesh < m_meshes.size()) && mesh >= 0)
|
||||
{
|
||||
KX_MeshProxy* meshproxy = new KX_MeshProxy(m_meshes[mesh]);
|
||||
return meshproxy->NewProxy(true); // XXX Todo Python own.
|
||||
}
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
PyObject* KX_GameObject::PySetCollisionMargin(PyObject* value)
|
||||
{
|
||||
@@ -2432,29 +2323,6 @@ PyObject* KX_GameObject::PyRestoreDynamics()
|
||||
}
|
||||
|
||||
|
||||
|
||||
PyObject* KX_GameObject::PyGetOrientation() //keywords
|
||||
{
|
||||
ShowDeprecationWarning("getOrientation()", "the orientation property");
|
||||
return PyObjectFrom(NodeGetWorldOrientation());
|
||||
}
|
||||
|
||||
|
||||
|
||||
PyObject* KX_GameObject::PySetOrientation(PyObject* value)
|
||||
{
|
||||
ShowDeprecationWarning("setOrientation()", "the orientation property");
|
||||
MT_Matrix3x3 rot;
|
||||
|
||||
/* if value is not a sequence PyOrientationTo makes an error */
|
||||
if (!PyOrientationTo(value, rot, "gameOb.setOrientation(sequence): KX_GameObject, "))
|
||||
return NULL;
|
||||
|
||||
NodeSetLocalOrientation(rot);
|
||||
NodeUpdateGS(0.f);
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::PyAlignAxisToVect(PyObject* args)
|
||||
{
|
||||
PyObject* pyvect;
|
||||
@@ -2487,33 +2355,6 @@ PyObject* KX_GameObject::PyGetAxisVect(PyObject* value)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::PySetPosition(PyObject* value)
|
||||
{
|
||||
ShowDeprecationWarning("setPosition()", "the localPosition property");
|
||||
MT_Point3 pos;
|
||||
if (PyVecTo(value, pos))
|
||||
{
|
||||
NodeSetLocalPosition(pos);
|
||||
NodeUpdateGS(0.f);
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::PySetWorldPosition(PyObject* value)
|
||||
{
|
||||
ShowDeprecationWarning("setWorldPosition()", "the worldPosition property");
|
||||
MT_Point3 pos;
|
||||
if (PyVecTo(value, pos))
|
||||
{
|
||||
NodeSetWorldPosition(pos);
|
||||
NodeUpdateGS(0.f);
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PyObject* KX_GameObject::PyGetPhysicsId()
|
||||
{
|
||||
|
@@ -796,8 +796,6 @@ public:
|
||||
return PyUnicode_FromString(GetName().ReadPtr());
|
||||
}
|
||||
|
||||
KX_PYMETHOD_NOARGS(KX_GameObject,GetPosition);
|
||||
KX_PYMETHOD_O(KX_GameObject,SetPosition);
|
||||
KX_PYMETHOD_O(KX_GameObject,SetWorldPosition);
|
||||
KX_PYMETHOD_VARARGS(KX_GameObject, ApplyForce);
|
||||
KX_PYMETHOD_VARARGS(KX_GameObject, ApplyTorque);
|
||||
@@ -808,10 +806,10 @@ public:
|
||||
KX_PYMETHOD_VARARGS(KX_GameObject,GetAngularVelocity);
|
||||
KX_PYMETHOD_VARARGS(KX_GameObject,SetAngularVelocity);
|
||||
KX_PYMETHOD_VARARGS(KX_GameObject,GetVelocity);
|
||||
KX_PYMETHOD_NOARGS(KX_GameObject,GetMass);
|
||||
|
||||
KX_PYMETHOD_NOARGS(KX_GameObject,GetReactionForce);
|
||||
KX_PYMETHOD_NOARGS(KX_GameObject,GetOrientation);
|
||||
KX_PYMETHOD_O(KX_GameObject,SetOrientation);
|
||||
|
||||
|
||||
KX_PYMETHOD_NOARGS(KX_GameObject,GetVisible);
|
||||
KX_PYMETHOD_VARARGS(KX_GameObject,SetVisible);
|
||||
KX_PYMETHOD_VARARGS(KX_GameObject,SetOcclusion);
|
||||
|
@@ -434,21 +434,6 @@ PyTypeObject KX_IpoActuator::Type = {
|
||||
};
|
||||
|
||||
PyMethodDef KX_IpoActuator::Methods[] = {
|
||||
// deprecated
|
||||
{"set", (PyCFunction) KX_IpoActuator::sPySet, METH_VARARGS, (const char *)Set_doc},
|
||||
{"setProperty", (PyCFunction) KX_IpoActuator::sPySetProperty, METH_VARARGS, (const char *)SetProperty_doc},
|
||||
{"setStart", (PyCFunction) KX_IpoActuator::sPySetStart, METH_VARARGS, (const char *)SetStart_doc},
|
||||
{"getStart", (PyCFunction) KX_IpoActuator::sPyGetStart, METH_NOARGS, (const char *)GetStart_doc},
|
||||
{"setEnd", (PyCFunction) KX_IpoActuator::sPySetEnd, METH_VARARGS, (const char *)SetEnd_doc},
|
||||
{"getEnd", (PyCFunction) KX_IpoActuator::sPyGetEnd, METH_NOARGS, (const char *)GetEnd_doc},
|
||||
{"setIpoAsForce", (PyCFunction) KX_IpoActuator::sPySetIpoAsForce, METH_VARARGS, (const char *)SetIpoAsForce_doc},
|
||||
{"getIpoAsForce", (PyCFunction) KX_IpoActuator::sPyGetIpoAsForce, METH_NOARGS, (const char *)GetIpoAsForce_doc},
|
||||
{"setIpoAdd", (PyCFunction) KX_IpoActuator::sPySetIpoAdd, METH_VARARGS, (const char *)SetIpoAdd_doc},
|
||||
{"getIpoAdd", (PyCFunction) KX_IpoActuator::sPyGetIpoAdd, METH_NOARGS, (const char *)GetIpoAdd_doc},
|
||||
{"setForceIpoActsLocal", (PyCFunction) KX_IpoActuator::sPySetForceIpoActsLocal, METH_VARARGS, (const char *)SetForceIpoActsLocal_doc},
|
||||
{"getForceIpoActsLocal", (PyCFunction) KX_IpoActuator::sPyGetForceIpoActsLocal, METH_NOARGS, (const char *)GetForceIpoActsLocal_doc},
|
||||
{"setType", (PyCFunction) KX_IpoActuator::sPySetType, METH_VARARGS, (const char *)SetType_doc},
|
||||
{"getType", (PyCFunction) KX_IpoActuator::sPyGetType, METH_NOARGS, (const char *)GetType_doc},
|
||||
{NULL,NULL} //Sentinel
|
||||
};
|
||||
|
||||
@@ -466,237 +451,4 @@ PyAttributeDef KX_IpoActuator::Attributes[] = {
|
||||
{ NULL } //Sentinel
|
||||
};
|
||||
|
||||
|
||||
/* set --------------------------------------------------------------------- */
|
||||
const char KX_IpoActuator::Set_doc[] =
|
||||
"set(type, startframe, endframe, mode?)\n"
|
||||
"\t - type: Play, PingPong, Flipper, LoopStop, LoopEnd or FromProp (string)\n"
|
||||
"\t - startframe: first frame to use (int)\n"
|
||||
"\t - endframe : last frame to use (int)\n"
|
||||
"\t - mode? : special mode (0=normal, 1=interpret location as force, 2=additive)"
|
||||
"\tSet the properties of the actuator.\n";
|
||||
PyObject* KX_IpoActuator::PySet(PyObject* args) {
|
||||
|
||||
ShowDeprecationWarning("set()", "a range properties");
|
||||
|
||||
/* sets modes PLAY, PINGPONG, FLIPPER, LOOPSTOP, LOOPEND */
|
||||
/* arg 1 = mode string, arg 2 = startframe, arg3 = stopframe, */
|
||||
/* arg4 = force toggle */
|
||||
char* mode;
|
||||
int forceToggle;
|
||||
int modenum;
|
||||
int startFrame, stopFrame;
|
||||
if(!PyArg_ParseTuple(args, "siii:set", &mode, &startFrame,
|
||||
&stopFrame, &forceToggle)) {
|
||||
return NULL;
|
||||
}
|
||||
modenum = string2mode(mode);
|
||||
|
||||
switch (modenum) {
|
||||
case KX_ACT_IPO_PLAY:
|
||||
case KX_ACT_IPO_PINGPONG:
|
||||
case KX_ACT_IPO_FLIPPER:
|
||||
case KX_ACT_IPO_LOOPSTOP:
|
||||
case KX_ACT_IPO_LOOPEND:
|
||||
m_type = modenum;
|
||||
m_startframe = startFrame;
|
||||
m_endframe = stopFrame;
|
||||
m_ipo_as_force = forceToggle == 1;
|
||||
m_ipo_add = forceToggle == 2;
|
||||
break;
|
||||
default:
|
||||
; /* error */
|
||||
}
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* set property ----------------------------------------------------------- */
|
||||
const char KX_IpoActuator::SetProperty_doc[] =
|
||||
"setProperty(propname)\n"
|
||||
"\t - propname: name of the property (string)\n"
|
||||
"\tSet the property to be used in FromProp mode.\n";
|
||||
PyObject* KX_IpoActuator::PySetProperty(PyObject* args) {
|
||||
|
||||
ShowDeprecationWarning("setProperty()", "the propName property");
|
||||
|
||||
/* mode is implicit here, but not supported yet... */
|
||||
/* args: property */
|
||||
char *propertyName;
|
||||
if(!PyArg_ParseTuple(args, "s:setProperty", &propertyName)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
m_propname = propertyName;
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* 4. setStart: */
|
||||
const char KX_IpoActuator::SetStart_doc[] =
|
||||
"setStart(frame)\n"
|
||||
"\t - frame: first frame to use (int)\n"
|
||||
"\tSet the frame from which the ipo starts playing.\n";
|
||||
PyObject* KX_IpoActuator::PySetStart(PyObject* args) {
|
||||
|
||||
ShowDeprecationWarning("setStart()", "the frameStart property");
|
||||
|
||||
float startArg;
|
||||
if(!PyArg_ParseTuple(args, "f:setStart", &startArg)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
m_startframe = startArg;
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
/* 5. getStart: */
|
||||
const char KX_IpoActuator::GetStart_doc[] =
|
||||
"getStart()\n"
|
||||
"\tReturns the frame from which the ipo starts playing.\n";
|
||||
PyObject* KX_IpoActuator::PyGetStart() {
|
||||
ShowDeprecationWarning("getStart()", "the frameStart property");
|
||||
return PyFloat_FromDouble(m_startframe);
|
||||
}
|
||||
|
||||
/* 6. setEnd: */
|
||||
const char KX_IpoActuator::SetEnd_doc[] =
|
||||
"setEnd(frame)\n"
|
||||
"\t - frame: last frame to use (int)\n"
|
||||
"\tSet the frame at which the ipo stops playing.\n";
|
||||
PyObject* KX_IpoActuator::PySetEnd(PyObject* args) {
|
||||
ShowDeprecationWarning("setEnd()", "the frameEnd property");
|
||||
float endArg;
|
||||
if(!PyArg_ParseTuple(args, "f:setEnd", &endArg)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
m_endframe = endArg;
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
/* 7. getEnd: */
|
||||
const char KX_IpoActuator::GetEnd_doc[] =
|
||||
"getEnd()\n"
|
||||
"\tReturns the frame at which the ipo stops playing.\n";
|
||||
PyObject* KX_IpoActuator::PyGetEnd() {
|
||||
ShowDeprecationWarning("getEnd()", "the frameEnd property");
|
||||
return PyFloat_FromDouble(m_endframe);
|
||||
}
|
||||
|
||||
/* 6. setIpoAsForce: */
|
||||
const char KX_IpoActuator::SetIpoAsForce_doc[] =
|
||||
"setIpoAsForce(force?)\n"
|
||||
"\t - force? : interpret this ipo as a force? (KX_TRUE, KX_FALSE)\n"
|
||||
"\tSet whether to interpret the ipo as a force rather than a displacement.\n";
|
||||
PyObject* KX_IpoActuator::PySetIpoAsForce(PyObject* args) {
|
||||
ShowDeprecationWarning("setIpoAsForce()", "the useIpoAsForce property");
|
||||
int boolArg;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "i:setIpoAsForce", &boolArg)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
m_ipo_as_force = PyArgToBool(boolArg);
|
||||
if (m_ipo_as_force)
|
||||
m_ipo_add = false;
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
/* 7. getIpoAsForce: */
|
||||
const char KX_IpoActuator::GetIpoAsForce_doc[] =
|
||||
"getIpoAsForce()\n"
|
||||
"\tReturns whether to interpret the ipo as a force rather than a displacement.\n";
|
||||
PyObject* KX_IpoActuator::PyGetIpoAsForce() {
|
||||
ShowDeprecationWarning("getIpoAsForce()", "the useIpoAsForce property");
|
||||
return BoolToPyArg(m_ipo_as_force);
|
||||
}
|
||||
|
||||
/* 6. setIpoAsForce: */
|
||||
const char KX_IpoActuator::SetIpoAdd_doc[] =
|
||||
"setIpoAdd(add?)\n"
|
||||
"\t - add? : add flag (KX_TRUE, KX_FALSE)\n"
|
||||
"\tSet whether to interpret the ipo as additive rather than absolute.\n";
|
||||
PyObject* KX_IpoActuator::PySetIpoAdd(PyObject* args) {
|
||||
ShowDeprecationWarning("setIpoAdd()", "the useIpoAdd property");
|
||||
int boolArg;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "i:setIpoAdd", &boolArg)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
m_ipo_add = PyArgToBool(boolArg);
|
||||
if (m_ipo_add)
|
||||
m_ipo_as_force = false;
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
/* 7. getIpoAsForce: */
|
||||
const char KX_IpoActuator::GetIpoAdd_doc[] =
|
||||
"getIpoAsAdd()\n"
|
||||
"\tReturns whether to interpret the ipo as additive rather than absolute.\n";
|
||||
PyObject* KX_IpoActuator::PyGetIpoAdd() {
|
||||
ShowDeprecationWarning("getIpoAdd()", "the useIpoAdd property");
|
||||
return BoolToPyArg(m_ipo_add);
|
||||
}
|
||||
|
||||
/* 8. setType: */
|
||||
const char KX_IpoActuator::SetType_doc[] =
|
||||
"setType(mode)\n"
|
||||
"\t - mode: Play, PingPong, Flipper, LoopStop, LoopEnd or FromProp (string)\n"
|
||||
"\tSet the operation mode of the actuator.\n";
|
||||
PyObject* KX_IpoActuator::PySetType(PyObject* args) {
|
||||
ShowDeprecationWarning("setType()", "the mode property");
|
||||
int typeArg;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "i:setType", &typeArg)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if ( (typeArg > KX_ACT_IPO_NODEF)
|
||||
&& (typeArg < KX_ACT_IPO_MAX) ) {
|
||||
m_type = typeArg;
|
||||
}
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
/* 9. getType: */
|
||||
const char KX_IpoActuator::GetType_doc[] =
|
||||
"getType()\n"
|
||||
"\tReturns the operation mode of the actuator.\n";
|
||||
PyObject* KX_IpoActuator::PyGetType() {
|
||||
ShowDeprecationWarning("getType()", "the mode property");
|
||||
return PyLong_FromSsize_t(m_type);
|
||||
}
|
||||
|
||||
/* 10. setForceIpoActsLocal: */
|
||||
const char KX_IpoActuator::SetForceIpoActsLocal_doc[] =
|
||||
"setForceIpoActsLocal(local?)\n"
|
||||
"\t - local? : Apply the ipo-as-force in the object's local\n"
|
||||
"\t coordinates? (KX_TRUE, KX_FALSE)\n"
|
||||
"\tSet whether to apply the force in the object's local\n"
|
||||
"\tcoordinates rather than the world global coordinates.\n";
|
||||
PyObject* KX_IpoActuator::PySetForceIpoActsLocal(PyObject* args) {
|
||||
ShowDeprecationWarning("setForceIpoActsLocal()", "the useIpoLocal property");
|
||||
int boolArg;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "i:setForceIpoActsLocal", &boolArg)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
m_ipo_local = PyArgToBool(boolArg);
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
/* 11. getForceIpoActsLocal: */
|
||||
const char KX_IpoActuator::GetForceIpoActsLocal_doc[] =
|
||||
"getForceIpoActsLocal()\n"
|
||||
"\tReturn whether to apply the force in the object's local\n"
|
||||
"\tcoordinates rather than the world global coordinates.\n";
|
||||
PyObject* KX_IpoActuator::PyGetForceIpoActsLocal() {
|
||||
ShowDeprecationWarning("getForceIpoActsLocal()", "the useIpoLocal property");
|
||||
return BoolToPyArg(m_ipo_local);
|
||||
}
|
||||
|
||||
|
||||
/* eof */
|
||||
|
@@ -138,23 +138,6 @@ public:
|
||||
/* Python interface ---------------------------------------------------- */
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
//KX_PYMETHOD_DOC
|
||||
KX_PYMETHOD_DOC_VARARGS(KX_IpoActuator,Set);
|
||||
KX_PYMETHOD_DOC_VARARGS(KX_IpoActuator,SetProperty);
|
||||
/* KX_PYMETHOD_DOC(KX_IpoActuator,SetKey2Key); */
|
||||
KX_PYMETHOD_DOC_VARARGS(KX_IpoActuator,SetStart);
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetStart);
|
||||
KX_PYMETHOD_DOC_VARARGS(KX_IpoActuator,SetEnd);
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetEnd);
|
||||
KX_PYMETHOD_DOC_VARARGS(KX_IpoActuator,SetIpoAsForce);
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetIpoAsForce);
|
||||
KX_PYMETHOD_DOC_VARARGS(KX_IpoActuator,SetIpoAdd);
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetIpoAdd);
|
||||
KX_PYMETHOD_DOC_VARARGS(KX_IpoActuator,SetType);
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetType);
|
||||
KX_PYMETHOD_DOC_VARARGS(KX_IpoActuator,SetForceIpoActsLocal);
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetForceIpoActsLocal);
|
||||
|
||||
};
|
||||
|
||||
#endif //__KX_IPOACTUATOR
|
||||
|
@@ -68,18 +68,12 @@ PyTypeObject KX_MeshProxy::Type = {
|
||||
};
|
||||
|
||||
PyMethodDef KX_MeshProxy::Methods[] = {
|
||||
// Deprecated ----->
|
||||
{"getNumMaterials", (PyCFunction)KX_MeshProxy::sPyGetNumMaterials,METH_VARARGS},
|
||||
{"getNumPolygons", (PyCFunction)KX_MeshProxy::sPyGetNumPolygons,METH_NOARGS},
|
||||
// <-----
|
||||
|
||||
{"getMaterialName", (PyCFunction)KX_MeshProxy::sPyGetMaterialName,METH_VARARGS},
|
||||
{"getTextureName", (PyCFunction)KX_MeshProxy::sPyGetTextureName,METH_VARARGS},
|
||||
{"getVertexArrayLength", (PyCFunction)KX_MeshProxy::sPyGetVertexArrayLength,METH_VARARGS},
|
||||
{"getVertex", (PyCFunction)KX_MeshProxy::sPyGetVertex,METH_VARARGS},
|
||||
{"getPolygon", (PyCFunction)KX_MeshProxy::sPyGetPolygon,METH_VARARGS},
|
||||
//{"getIndexArrayLength", (PyCFunction)KX_MeshProxy::sPyGetIndexArrayLength,METH_VARARGS},
|
||||
|
||||
{NULL,NULL} //Sentinel
|
||||
};
|
||||
|
||||
@@ -120,20 +114,6 @@ CValue* KX_MeshProxy::GetReplica() { return NULL;}
|
||||
|
||||
// stuff for python integration
|
||||
|
||||
PyObject* KX_MeshProxy::PyGetNumMaterials(PyObject* args, PyObject* kwds)
|
||||
{
|
||||
int num = m_meshobj->NumMaterials();
|
||||
ShowDeprecationWarning("getNumMaterials()", "the numMaterials property");
|
||||
return PyLong_FromSsize_t(num);
|
||||
}
|
||||
|
||||
PyObject* KX_MeshProxy::PyGetNumPolygons()
|
||||
{
|
||||
int num = m_meshobj->NumPolygons();
|
||||
ShowDeprecationWarning("getNumPolygons()", "the numPolygons property");
|
||||
return PyLong_FromSsize_t(num);
|
||||
}
|
||||
|
||||
PyObject* KX_MeshProxy::PyGetMaterialName(PyObject* args, PyObject* kwds)
|
||||
{
|
||||
int matid= 1;
|
||||
|
@@ -368,13 +368,6 @@ PyTypeObject KX_MouseFocusSensor::Type = {
|
||||
};
|
||||
|
||||
PyMethodDef KX_MouseFocusSensor::Methods[] = {
|
||||
{"getRayTarget", (PyCFunction) KX_MouseFocusSensor::sPyGetRayTarget, METH_NOARGS, (const char *)GetRayTarget_doc},
|
||||
{"getRaySource", (PyCFunction) KX_MouseFocusSensor::sPyGetRaySource, METH_NOARGS, (const char *)GetRaySource_doc},
|
||||
{"getHitObject",(PyCFunction) KX_MouseFocusSensor::sPyGetHitObject,METH_NOARGS, (const char *)GetHitObject_doc},
|
||||
{"getHitPosition",(PyCFunction) KX_MouseFocusSensor::sPyGetHitPosition,METH_NOARGS, (const char *)GetHitPosition_doc},
|
||||
{"getHitNormal",(PyCFunction) KX_MouseFocusSensor::sPyGetHitNormal,METH_NOARGS, (const char *)GetHitNormal_doc},
|
||||
{"getRayDirection",(PyCFunction) KX_MouseFocusSensor::sPyGetRayDirection,METH_NOARGS, (const char *)GetRayDirection_doc},
|
||||
|
||||
{NULL,NULL} //Sentinel
|
||||
};
|
||||
|
||||
@@ -389,78 +382,6 @@ PyAttributeDef KX_MouseFocusSensor::Attributes[] = {
|
||||
{ NULL } //Sentinel
|
||||
};
|
||||
|
||||
const char KX_MouseFocusSensor::GetHitObject_doc[] =
|
||||
"getHitObject()\n"
|
||||
"\tReturns the object that was hit by this ray.\n";
|
||||
PyObject* KX_MouseFocusSensor::PyGetHitObject()
|
||||
{
|
||||
ShowDeprecationWarning("GetHitObject()", "the hitObject property");
|
||||
|
||||
if (m_hitObject)
|
||||
return m_hitObject->GetProxy();
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
|
||||
const char KX_MouseFocusSensor::GetHitPosition_doc[] =
|
||||
"getHitPosition()\n"
|
||||
"\tReturns the position (in worldcoordinates) where the object was hit by this ray.\n";
|
||||
PyObject* KX_MouseFocusSensor::PyGetHitPosition()
|
||||
{
|
||||
ShowDeprecationWarning("getHitPosition()", "the hitPosition property");
|
||||
|
||||
return PyObjectFrom(m_hitPosition);
|
||||
}
|
||||
|
||||
const char KX_MouseFocusSensor::GetRayDirection_doc[] =
|
||||
"getRayDirection()\n"
|
||||
"\tReturns the direction from the ray (in worldcoordinates) .\n";
|
||||
PyObject* KX_MouseFocusSensor::PyGetRayDirection()
|
||||
{
|
||||
ShowDeprecationWarning("getRayDirection()", "the rayDirection property");
|
||||
|
||||
MT_Vector3 dir = m_prevTargetPoint - m_prevSourcePoint;
|
||||
if(MT_fuzzyZero(dir)) dir.setValue(0,0,0);
|
||||
else dir.normalize();
|
||||
return PyObjectFrom(dir);
|
||||
}
|
||||
|
||||
const char KX_MouseFocusSensor::GetHitNormal_doc[] =
|
||||
"getHitNormal()\n"
|
||||
"\tReturns the normal (in worldcoordinates) at the point of collision where the object was hit by this ray.\n";
|
||||
PyObject* KX_MouseFocusSensor::PyGetHitNormal()
|
||||
{
|
||||
ShowDeprecationWarning("getHitNormal()", "the hitNormal property");
|
||||
|
||||
return PyObjectFrom(m_hitNormal);
|
||||
}
|
||||
|
||||
|
||||
/* getRayTarget */
|
||||
const char KX_MouseFocusSensor::GetRayTarget_doc[] =
|
||||
"getRayTarget()\n"
|
||||
"\tReturns the target of the ray that seeks the focus object,\n"
|
||||
"\tin worldcoordinates.";
|
||||
PyObject* KX_MouseFocusSensor::PyGetRayTarget()
|
||||
{
|
||||
ShowDeprecationWarning("getRayTarget()", "the rayTarget property");
|
||||
|
||||
return PyObjectFrom(m_prevTargetPoint);
|
||||
}
|
||||
|
||||
/* getRayTarget */
|
||||
const char KX_MouseFocusSensor::GetRaySource_doc[] =
|
||||
"getRaySource()\n"
|
||||
"\tReturns the source of the ray that seeks the focus object,\n"
|
||||
"\tin worldcoordinates.";
|
||||
PyObject* KX_MouseFocusSensor::PyGetRaySource()
|
||||
{
|
||||
ShowDeprecationWarning("getRaySource()", "the raySource property");
|
||||
|
||||
return PyObjectFrom(m_prevSourcePoint);
|
||||
}
|
||||
|
||||
/* Attributes */
|
||||
PyObject* KX_MouseFocusSensor::pyattr_get_ray_source(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
|
@@ -90,14 +90,6 @@ class KX_MouseFocusSensor : public SCA_MouseSensor
|
||||
/* Python interface ---------------------------------------------------- */
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_MouseFocusSensor,GetRayTarget);
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_MouseFocusSensor,GetRaySource);
|
||||
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_MouseFocusSensor,GetHitObject);
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_MouseFocusSensor,GetHitPosition);
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_MouseFocusSensor,GetHitNormal);
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_MouseFocusSensor,GetRayDirection);
|
||||
|
||||
/* attributes */
|
||||
static PyObject* pyattr_get_ray_source(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject* pyattr_get_ray_target(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
|
@@ -347,32 +347,6 @@ PyTypeObject KX_ObjectActuator::Type = {
|
||||
};
|
||||
|
||||
PyMethodDef KX_ObjectActuator::Methods[] = {
|
||||
// Deprecated ----->
|
||||
{"getForce", (PyCFunction) KX_ObjectActuator::sPyGetForce, METH_NOARGS},
|
||||
{"setForce", (PyCFunction) KX_ObjectActuator::sPySetForce, METH_VARARGS},
|
||||
{"getTorque", (PyCFunction) KX_ObjectActuator::sPyGetTorque, METH_NOARGS},
|
||||
{"setTorque", (PyCFunction) KX_ObjectActuator::sPySetTorque, METH_VARARGS},
|
||||
{"getDLoc", (PyCFunction) KX_ObjectActuator::sPyGetDLoc, METH_NOARGS},
|
||||
{"setDLoc", (PyCFunction) KX_ObjectActuator::sPySetDLoc, METH_VARARGS},
|
||||
{"getDRot", (PyCFunction) KX_ObjectActuator::sPyGetDRot, METH_NOARGS},
|
||||
{"setDRot", (PyCFunction) KX_ObjectActuator::sPySetDRot, METH_VARARGS},
|
||||
{"getLinearVelocity", (PyCFunction) KX_ObjectActuator::sPyGetLinearVelocity, METH_NOARGS},
|
||||
{"setLinearVelocity", (PyCFunction) KX_ObjectActuator::sPySetLinearVelocity, METH_VARARGS},
|
||||
{"getAngularVelocity", (PyCFunction) KX_ObjectActuator::sPyGetAngularVelocity, METH_NOARGS},
|
||||
{"setAngularVelocity", (PyCFunction) KX_ObjectActuator::sPySetAngularVelocity, METH_VARARGS},
|
||||
{"setDamping", (PyCFunction) KX_ObjectActuator::sPySetDamping, METH_VARARGS},
|
||||
{"getDamping", (PyCFunction) KX_ObjectActuator::sPyGetDamping, METH_NOARGS},
|
||||
{"setForceLimitX", (PyCFunction) KX_ObjectActuator::sPySetForceLimitX, METH_VARARGS},
|
||||
{"getForceLimitX", (PyCFunction) KX_ObjectActuator::sPyGetForceLimitX, METH_NOARGS},
|
||||
{"setForceLimitY", (PyCFunction) KX_ObjectActuator::sPySetForceLimitY, METH_VARARGS},
|
||||
{"getForceLimitY", (PyCFunction) KX_ObjectActuator::sPyGetForceLimitY, METH_NOARGS},
|
||||
{"setForceLimitZ", (PyCFunction) KX_ObjectActuator::sPySetForceLimitZ, METH_VARARGS},
|
||||
{"getForceLimitZ", (PyCFunction) KX_ObjectActuator::sPyGetForceLimitZ, METH_NOARGS},
|
||||
{"setPID", (PyCFunction) KX_ObjectActuator::sPyGetPID, METH_NOARGS},
|
||||
{"getPID", (PyCFunction) KX_ObjectActuator::sPySetPID, METH_VARARGS},
|
||||
|
||||
// <----- Deprecated
|
||||
|
||||
{NULL,NULL} //Sentinel
|
||||
};
|
||||
|
||||
@@ -667,305 +641,4 @@ int KX_ObjectActuator::pyattr_set_reference(void *self, const struct KX_PYATTRIB
|
||||
return PY_SET_ATTR_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/* 1. set ------------------------------------------------------------------ */
|
||||
/* Removed! */
|
||||
|
||||
/* 2. getForce */
|
||||
PyObject* KX_ObjectActuator::PyGetForce()
|
||||
{
|
||||
ShowDeprecationWarning("getForce()", "the force and the useLocalForce properties");
|
||||
PyObject *retVal = PyList_New(4);
|
||||
|
||||
PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_force[0]));
|
||||
PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_force[1]));
|
||||
PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_force[2]));
|
||||
PyList_SET_ITEM(retVal, 3, BoolToPyArg(m_bitLocalFlag.Force));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
/* 3. setForce */
|
||||
PyObject* KX_ObjectActuator::PySetForce(PyObject* args)
|
||||
{
|
||||
ShowDeprecationWarning("setForce()", "the force and the useLocalForce properties");
|
||||
float vecArg[3];
|
||||
int bToggle = 0;
|
||||
if (!PyArg_ParseTuple(args, "fffi:setForce", &vecArg[0], &vecArg[1],
|
||||
&vecArg[2], &bToggle)) {
|
||||
return NULL;
|
||||
}
|
||||
m_force.setValue(vecArg);
|
||||
m_bitLocalFlag.Force = PyArgToBool(bToggle);
|
||||
UpdateFuzzyFlags();
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* 4. getTorque */
|
||||
PyObject* KX_ObjectActuator::PyGetTorque()
|
||||
{
|
||||
ShowDeprecationWarning("getTorque()", "the torque and the useLocalTorque properties");
|
||||
PyObject *retVal = PyList_New(4);
|
||||
|
||||
PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_torque[0]));
|
||||
PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_torque[1]));
|
||||
PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_torque[2]));
|
||||
PyList_SET_ITEM(retVal, 3, BoolToPyArg(m_bitLocalFlag.Torque));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
/* 5. setTorque */
|
||||
PyObject* KX_ObjectActuator::PySetTorque(PyObject* args)
|
||||
{
|
||||
ShowDeprecationWarning("setTorque()", "the torque and the useLocalTorque properties");
|
||||
float vecArg[3];
|
||||
int bToggle = 0;
|
||||
if (!PyArg_ParseTuple(args, "fffi:setTorque", &vecArg[0], &vecArg[1],
|
||||
&vecArg[2], &bToggle)) {
|
||||
return NULL;
|
||||
}
|
||||
m_torque.setValue(vecArg);
|
||||
m_bitLocalFlag.Torque = PyArgToBool(bToggle);
|
||||
UpdateFuzzyFlags();
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* 6. getDLoc */
|
||||
PyObject* KX_ObjectActuator::PyGetDLoc()
|
||||
{
|
||||
ShowDeprecationWarning("getDLoc()", "the dLoc and the useLocalDLoc properties");
|
||||
PyObject *retVal = PyList_New(4);
|
||||
|
||||
PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_dloc[0]));
|
||||
PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_dloc[1]));
|
||||
PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_dloc[2]));
|
||||
PyList_SET_ITEM(retVal, 3, BoolToPyArg(m_bitLocalFlag.DLoc));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
/* 7. setDLoc */
|
||||
PyObject* KX_ObjectActuator::PySetDLoc(PyObject* args)
|
||||
{
|
||||
ShowDeprecationWarning("setDLoc()", "the dLoc and the useLocalDLoc properties");
|
||||
float vecArg[3];
|
||||
int bToggle = 0;
|
||||
if(!PyArg_ParseTuple(args, "fffi:setDLoc", &vecArg[0], &vecArg[1],
|
||||
&vecArg[2], &bToggle)) {
|
||||
return NULL;
|
||||
}
|
||||
m_dloc.setValue(vecArg);
|
||||
m_bitLocalFlag.DLoc = PyArgToBool(bToggle);
|
||||
UpdateFuzzyFlags();
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* 8. getDRot */
|
||||
PyObject* KX_ObjectActuator::PyGetDRot()
|
||||
{
|
||||
ShowDeprecationWarning("getDRot()", "the dRot and the useLocalDRot properties");
|
||||
PyObject *retVal = PyList_New(4);
|
||||
|
||||
PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_drot[0]));
|
||||
PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_drot[1]));
|
||||
PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_drot[2]));
|
||||
PyList_SET_ITEM(retVal, 3, BoolToPyArg(m_bitLocalFlag.DRot));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
/* 9. setDRot */
|
||||
PyObject* KX_ObjectActuator::PySetDRot(PyObject* args)
|
||||
{
|
||||
ShowDeprecationWarning("setDRot()", "the dRot and the useLocalDRot properties");
|
||||
float vecArg[3];
|
||||
int bToggle = 0;
|
||||
if (!PyArg_ParseTuple(args, "fffi:setDRot", &vecArg[0], &vecArg[1],
|
||||
&vecArg[2], &bToggle)) {
|
||||
return NULL;
|
||||
}
|
||||
m_drot.setValue(vecArg);
|
||||
m_bitLocalFlag.DRot = PyArgToBool(bToggle);
|
||||
UpdateFuzzyFlags();
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* 10. getLinearVelocity */
|
||||
PyObject* KX_ObjectActuator::PyGetLinearVelocity() {
|
||||
ShowDeprecationWarning("getLinearVelocity()", "the linV and the useLocalLinV properties");
|
||||
PyObject *retVal = PyList_New(4);
|
||||
|
||||
PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_linear_velocity[0]));
|
||||
PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_linear_velocity[1]));
|
||||
PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_linear_velocity[2]));
|
||||
PyList_SET_ITEM(retVal, 3, BoolToPyArg(m_bitLocalFlag.LinearVelocity));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
/* 11. setLinearVelocity */
|
||||
PyObject* KX_ObjectActuator::PySetLinearVelocity(PyObject* args) {
|
||||
ShowDeprecationWarning("setLinearVelocity()", "the linV and the useLocalLinV properties");
|
||||
float vecArg[3];
|
||||
int bToggle = 0;
|
||||
if (!PyArg_ParseTuple(args, "fffi:setLinearVelocity", &vecArg[0], &vecArg[1],
|
||||
&vecArg[2], &bToggle)) {
|
||||
return NULL;
|
||||
}
|
||||
m_linear_velocity.setValue(vecArg);
|
||||
m_bitLocalFlag.LinearVelocity = PyArgToBool(bToggle);
|
||||
UpdateFuzzyFlags();
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
|
||||
/* 12. getAngularVelocity */
|
||||
PyObject* KX_ObjectActuator::PyGetAngularVelocity() {
|
||||
ShowDeprecationWarning("getAngularVelocity()", "the angV and the useLocalAngV properties");
|
||||
PyObject *retVal = PyList_New(4);
|
||||
|
||||
PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_angular_velocity[0]));
|
||||
PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_angular_velocity[1]));
|
||||
PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_angular_velocity[2]));
|
||||
PyList_SET_ITEM(retVal, 3, BoolToPyArg(m_bitLocalFlag.AngularVelocity));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
/* 13. setAngularVelocity */
|
||||
PyObject* KX_ObjectActuator::PySetAngularVelocity(PyObject* args) {
|
||||
ShowDeprecationWarning("setAngularVelocity()", "the angV and the useLocalAngV properties");
|
||||
float vecArg[3];
|
||||
int bToggle = 0;
|
||||
if (!PyArg_ParseTuple(args, "fffi:setAngularVelocity", &vecArg[0], &vecArg[1],
|
||||
&vecArg[2], &bToggle)) {
|
||||
return NULL;
|
||||
}
|
||||
m_angular_velocity.setValue(vecArg);
|
||||
m_bitLocalFlag.AngularVelocity = PyArgToBool(bToggle);
|
||||
UpdateFuzzyFlags();
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* 13. setDamping */
|
||||
PyObject* KX_ObjectActuator::PySetDamping(PyObject* args) {
|
||||
ShowDeprecationWarning("setDamping()", "the damping property");
|
||||
int damping = 0;
|
||||
if (!PyArg_ParseTuple(args, "i:setDamping", &damping) || damping < 0 || damping > 1000) {
|
||||
return NULL;
|
||||
}
|
||||
m_damping = damping;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* 13. getVelocityDamping */
|
||||
PyObject* KX_ObjectActuator::PyGetDamping() {
|
||||
ShowDeprecationWarning("getDamping()", "the damping property");
|
||||
return Py_BuildValue("i",m_damping);
|
||||
}
|
||||
/* 6. getForceLimitX */
|
||||
PyObject* KX_ObjectActuator::PyGetForceLimitX()
|
||||
{
|
||||
ShowDeprecationWarning("getForceLimitX()", "the forceLimitX property");
|
||||
PyObject *retVal = PyList_New(3);
|
||||
|
||||
PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_drot[0]));
|
||||
PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_dloc[0]));
|
||||
PyList_SET_ITEM(retVal, 2, BoolToPyArg(m_bitLocalFlag.Torque));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
/* 7. setForceLimitX */
|
||||
PyObject* KX_ObjectActuator::PySetForceLimitX(PyObject* args)
|
||||
{
|
||||
ShowDeprecationWarning("setForceLimitX()", "the forceLimitX property");
|
||||
float vecArg[2];
|
||||
int bToggle = 0;
|
||||
if(!PyArg_ParseTuple(args, "ffi:setForceLimitX", &vecArg[0], &vecArg[1], &bToggle)) {
|
||||
return NULL;
|
||||
}
|
||||
m_drot[0] = vecArg[0];
|
||||
m_dloc[0] = vecArg[1];
|
||||
m_bitLocalFlag.Torque = PyArgToBool(bToggle);
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* 6. getForceLimitY */
|
||||
PyObject* KX_ObjectActuator::PyGetForceLimitY()
|
||||
{
|
||||
ShowDeprecationWarning("getForceLimitY()", "the forceLimitY property");
|
||||
PyObject *retVal = PyList_New(3);
|
||||
|
||||
PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_drot[1]));
|
||||
PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_dloc[1]));
|
||||
PyList_SET_ITEM(retVal, 2, BoolToPyArg(m_bitLocalFlag.DLoc));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
/* 7. setForceLimitY */
|
||||
PyObject* KX_ObjectActuator::PySetForceLimitY(PyObject* args)
|
||||
{
|
||||
ShowDeprecationWarning("setForceLimitY()", "the forceLimitY property");
|
||||
float vecArg[2];
|
||||
int bToggle = 0;
|
||||
if(!PyArg_ParseTuple(args, "ffi:setForceLimitY", &vecArg[0], &vecArg[1], &bToggle)) {
|
||||
return NULL;
|
||||
}
|
||||
m_drot[1] = vecArg[0];
|
||||
m_dloc[1] = vecArg[1];
|
||||
m_bitLocalFlag.DLoc = PyArgToBool(bToggle);
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* 6. getForceLimitZ */
|
||||
PyObject* KX_ObjectActuator::PyGetForceLimitZ()
|
||||
{
|
||||
ShowDeprecationWarning("getForceLimitZ()", "the forceLimitZ property");
|
||||
PyObject *retVal = PyList_New(3);
|
||||
|
||||
PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_drot[2]));
|
||||
PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_dloc[2]));
|
||||
PyList_SET_ITEM(retVal, 2, BoolToPyArg(m_bitLocalFlag.DRot));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
/* 7. setForceLimitZ */
|
||||
PyObject* KX_ObjectActuator::PySetForceLimitZ(PyObject* args)
|
||||
{
|
||||
ShowDeprecationWarning("setForceLimitZ()", "the forceLimitZ property");
|
||||
float vecArg[2];
|
||||
int bToggle = 0;
|
||||
if(!PyArg_ParseTuple(args, "ffi:setForceLimitZ", &vecArg[0], &vecArg[1], &bToggle)) {
|
||||
return NULL;
|
||||
}
|
||||
m_drot[2] = vecArg[0];
|
||||
m_dloc[2] = vecArg[1];
|
||||
m_bitLocalFlag.DRot = PyArgToBool(bToggle);
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* 4. getPID */
|
||||
PyObject* KX_ObjectActuator::PyGetPID()
|
||||
{
|
||||
ShowDeprecationWarning("getPID()", "the pid property");
|
||||
PyObject *retVal = PyList_New(3);
|
||||
|
||||
PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_pid[0]));
|
||||
PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_pid[1]));
|
||||
PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_pid[2]));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
/* 5. setPID */
|
||||
PyObject* KX_ObjectActuator::PySetPID(PyObject* args)
|
||||
{
|
||||
ShowDeprecationWarning("setPID()", "the pid property");
|
||||
float vecArg[3];
|
||||
if (!PyArg_ParseTuple(args, "fff:setPID", &vecArg[0], &vecArg[1], &vecArg[2])) {
|
||||
return NULL;
|
||||
}
|
||||
m_pid.setValue(vecArg);
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* eof */
|
||||
|
@@ -163,29 +163,6 @@ public:
|
||||
/* Python interface ---------------------------------------------------- */
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetForce);
|
||||
KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetForce);
|
||||
KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetTorque);
|
||||
KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetTorque);
|
||||
KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetDLoc);
|
||||
KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetDLoc);
|
||||
KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetDRot);
|
||||
KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetDRot);
|
||||
KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetLinearVelocity);
|
||||
KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetLinearVelocity);
|
||||
KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetAngularVelocity);
|
||||
KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetAngularVelocity);
|
||||
KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetDamping);
|
||||
KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetDamping);
|
||||
KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetForceLimitX);
|
||||
KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetForceLimitX);
|
||||
KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetForceLimitY);
|
||||
KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetForceLimitY);
|
||||
KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetForceLimitZ);
|
||||
KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetForceLimitZ);
|
||||
KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetPID);
|
||||
KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetPID);
|
||||
|
||||
/* Attributes */
|
||||
static PyObject* pyattr_get_forceLimitX(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static int pyattr_set_forceLimitX(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
|
||||
|
@@ -162,10 +162,6 @@ PyTypeObject KX_ParentActuator::Type = {
|
||||
};
|
||||
|
||||
PyMethodDef KX_ParentActuator::Methods[] = {
|
||||
// Deprecated ----->
|
||||
{"setObject", (PyCFunction) KX_ParentActuator::sPySetObject, METH_O, (const char *)SetObject_doc},
|
||||
{"getObject", (PyCFunction) KX_ParentActuator::sPyGetObject, METH_VARARGS, (const char *)GetObject_doc},
|
||||
// <-----
|
||||
{NULL,NULL} //Sentinel
|
||||
};
|
||||
|
||||
@@ -205,55 +201,4 @@ int KX_ParentActuator::pyattr_set_object(void *self, const struct KX_PYATTRIBUTE
|
||||
return PY_SET_ATTR_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/* Deprecated -----> */
|
||||
/* 1. setObject */
|
||||
const char KX_ParentActuator::SetObject_doc[] =
|
||||
"setObject(object)\n"
|
||||
"\t- object: KX_GameObject, string or None\n"
|
||||
"\tSet the object to set as parent.\n";
|
||||
PyObject* KX_ParentActuator::PySetObject(PyObject* value) {
|
||||
KX_GameObject *gameobj;
|
||||
|
||||
ShowDeprecationWarning("setObject()", "the object property");
|
||||
|
||||
if (!ConvertPythonToGameObject(value, &gameobj, true, "actuator.setObject(value): KX_ParentActuator"))
|
||||
return NULL; // ConvertPythonToGameObject sets the error
|
||||
|
||||
if (m_ob != NULL)
|
||||
m_ob->UnregisterActuator(this);
|
||||
|
||||
m_ob = (SCA_IObject*)gameobj;
|
||||
if (m_ob)
|
||||
m_ob->RegisterActuator(this);
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* 2. getObject */
|
||||
|
||||
/* get obj ---------------------------------------------------------- */
|
||||
const char KX_ParentActuator::GetObject_doc[] =
|
||||
"getObject(name_only = 1)\n"
|
||||
"name_only - optional arg, when true will return the KX_GameObject rather then its name\n"
|
||||
"\tReturns the object that is set to.\n";
|
||||
PyObject* KX_ParentActuator::PyGetObject(PyObject* args)
|
||||
{
|
||||
int ret_name_only = 1;
|
||||
|
||||
ShowDeprecationWarning("getObject()", "the object property");
|
||||
|
||||
if (!PyArg_ParseTuple(args, "|i:getObject", &ret_name_only))
|
||||
return NULL;
|
||||
|
||||
if (!m_ob)
|
||||
Py_RETURN_NONE;
|
||||
|
||||
if (ret_name_only)
|
||||
return PyUnicode_FromString(m_ob->GetName().ReadPtr());
|
||||
else
|
||||
return m_ob->GetProxy();
|
||||
}
|
||||
/* <----- */
|
||||
|
||||
/* eof */
|
||||
|
@@ -85,11 +85,6 @@ class KX_ParentActuator : public SCA_IActuator
|
||||
static PyObject* pyattr_get_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static int pyattr_set_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
|
||||
|
||||
// Deprecated ----->
|
||||
KX_PYMETHOD_DOC_O(KX_ParentActuator,SetObject);
|
||||
KX_PYMETHOD_DOC_VARARGS(KX_ParentActuator,GetObject);
|
||||
// <-----
|
||||
|
||||
}; /* end of class KX_ParentActuator : public SCA_PropertyActuator */
|
||||
|
||||
#endif
|
||||
|
@@ -484,8 +484,6 @@ static struct PyMethodDef game_methods[] = {
|
||||
METH_NOARGS, gPyGetCurrentScene_doc},
|
||||
{"getSceneList", (PyCFunction) gPyGetSceneList,
|
||||
METH_NOARGS, (const char *)gPyGetSceneList_doc},
|
||||
{"addActiveActuator",(PyCFunction) SCA_PythonController::sPyAddActiveActuator,
|
||||
METH_VARARGS, (const char *)SCA_PythonController::sPyAddActiveActuator__doc__},
|
||||
{"getRandomFloat",(PyCFunction) gPyGetRandomFloat,
|
||||
METH_NOARGS, (const char *)gPyGetRandomFloat_doc},
|
||||
{"setGravity",(PyCFunction) gPySetGravity, METH_O, (const char *)"set Gravitation"},
|
||||
|
@@ -176,51 +176,7 @@ void KX_RadarSensor::SynchronizeTransform()
|
||||
/* Python Functions */
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
//Deprecated ----->
|
||||
/* getConeOrigin */
|
||||
const char KX_RadarSensor::GetConeOrigin_doc[] =
|
||||
"getConeOrigin()\n"
|
||||
"\tReturns the origin of the cone with which to test. The origin\n"
|
||||
"\tis in the middle of the cone.";
|
||||
PyObject* KX_RadarSensor::PyGetConeOrigin() {
|
||||
ShowDeprecationWarning("getConeOrigin()", "the coneOrigin property");
|
||||
|
||||
PyObject *retVal = PyList_New(3);
|
||||
|
||||
PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_cone_origin[0]));
|
||||
PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_cone_origin[1]));
|
||||
PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_cone_origin[2]));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
/* getConeOrigin */
|
||||
const char KX_RadarSensor::GetConeTarget_doc[] =
|
||||
"getConeTarget()\n"
|
||||
"\tReturns the center of the bottom face of the cone with which to test.\n";
|
||||
PyObject* KX_RadarSensor::PyGetConeTarget() {
|
||||
ShowDeprecationWarning("getConeTarget()", "the coneTarget property");
|
||||
|
||||
PyObject *retVal = PyList_New(3);
|
||||
|
||||
PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_cone_target[0]));
|
||||
PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_cone_target[1]));
|
||||
PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_cone_target[2]));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
/* getConeHeight */
|
||||
const char KX_RadarSensor::GetConeHeight_doc[] =
|
||||
"getConeHeight()\n"
|
||||
"\tReturns the height of the cone with which to test.\n";
|
||||
PyObject* KX_RadarSensor::PyGetConeHeight() {
|
||||
|
||||
ShowDeprecationWarning("getConeHeight()", "the distance property");
|
||||
|
||||
return PyFloat_FromDouble(m_coneheight);
|
||||
}
|
||||
//<----- Deprecated
|
||||
/* none */
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
/* Python Integration Hooks */
|
||||
@@ -248,14 +204,6 @@ PyTypeObject KX_RadarSensor::Type = {
|
||||
};
|
||||
|
||||
PyMethodDef KX_RadarSensor::Methods[] = {
|
||||
//Deprecated ----->
|
||||
{"getConeOrigin", (PyCFunction) KX_RadarSensor::sPyGetConeOrigin,
|
||||
METH_VARARGS, (const char *)GetConeOrigin_doc},
|
||||
{"getConeTarget", (PyCFunction) KX_RadarSensor::sPyGetConeTarget,
|
||||
METH_VARARGS, (const char *)GetConeTarget_doc},
|
||||
{"getConeHeight", (PyCFunction) KX_RadarSensor::sPyGetConeHeight,
|
||||
METH_VARARGS, (const char *)GetConeHeight_doc},
|
||||
//<-----
|
||||
{NULL} //Sentinel
|
||||
};
|
||||
|
||||
|
@@ -90,11 +90,6 @@ public:
|
||||
/* python */
|
||||
virtual sensortype GetSensorType() { return ST_RADAR; }
|
||||
|
||||
//Deprecated ----->
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_RadarSensor,GetConeOrigin);
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_RadarSensor,GetConeTarget);
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_RadarSensor,GetConeHeight);
|
||||
//<-----
|
||||
};
|
||||
|
||||
#endif //__KX_RADAR_SENSOR_H
|
||||
|
@@ -342,12 +342,6 @@ PyTypeObject KX_RaySensor::Type = {
|
||||
};
|
||||
|
||||
PyMethodDef KX_RaySensor::Methods[] = {
|
||||
// Deprecated ----->
|
||||
{"getHitObject",(PyCFunction) KX_RaySensor::sPyGetHitObject,METH_NOARGS, (const char *)GetHitObject_doc},
|
||||
{"getHitPosition",(PyCFunction) KX_RaySensor::sPyGetHitPosition,METH_NOARGS, (const char *)GetHitPosition_doc},
|
||||
{"getHitNormal",(PyCFunction) KX_RaySensor::sPyGetHitNormal,METH_NOARGS, (const char *)GetHitNormal_doc},
|
||||
{"getRayDirection",(PyCFunction) KX_RaySensor::sPyGetRayDirection,METH_NOARGS, (const char *)GetRayDirection_doc},
|
||||
// <-----
|
||||
{NULL,NULL} //Sentinel
|
||||
};
|
||||
|
||||
@@ -372,68 +366,3 @@ PyObject* KX_RaySensor::pyattr_get_hitobject(void *self_v, const KX_PYATTRIBUTE_
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
// Deprecated ----->
|
||||
const char KX_RaySensor::GetHitObject_doc[] =
|
||||
"getHitObject()\n"
|
||||
"\tReturns the name of the object that was hit by this ray.\n";
|
||||
PyObject* KX_RaySensor::PyGetHitObject()
|
||||
{
|
||||
ShowDeprecationWarning("getHitObject()", "the hitObject property");
|
||||
if (m_hitObject)
|
||||
{
|
||||
return m_hitObject->GetProxy();
|
||||
}
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
|
||||
const char KX_RaySensor::GetHitPosition_doc[] =
|
||||
"getHitPosition()\n"
|
||||
"\tReturns the position (in worldcoordinates) where the object was hit by this ray.\n";
|
||||
PyObject* KX_RaySensor::PyGetHitPosition()
|
||||
{
|
||||
ShowDeprecationWarning("getHitPosition()", "the hitPosition property");
|
||||
|
||||
PyObject *retVal = PyList_New(3);
|
||||
|
||||
PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_hitPosition[0]));
|
||||
PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_hitPosition[1]));
|
||||
PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_hitPosition[2]));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
const char KX_RaySensor::GetRayDirection_doc[] =
|
||||
"getRayDirection()\n"
|
||||
"\tReturns the direction from the ray (in worldcoordinates) .\n";
|
||||
PyObject* KX_RaySensor::PyGetRayDirection()
|
||||
{
|
||||
ShowDeprecationWarning("getRayDirection()", "the rayDirection property");
|
||||
|
||||
PyObject *retVal = PyList_New(3);
|
||||
|
||||
PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_rayDirection[0]));
|
||||
PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_rayDirection[1]));
|
||||
PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_rayDirection[2]));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
const char KX_RaySensor::GetHitNormal_doc[] =
|
||||
"getHitNormal()\n"
|
||||
"\tReturns the normal (in worldcoordinates) of the object at the location where the object was hit by this ray.\n";
|
||||
PyObject* KX_RaySensor::PyGetHitNormal()
|
||||
{
|
||||
ShowDeprecationWarning("getHitNormal()", "the hitNormal property");
|
||||
|
||||
PyObject *retVal = PyList_New(3);
|
||||
|
||||
PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_hitNormal[0]));
|
||||
PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_hitNormal[1]));
|
||||
PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_hitNormal[2]));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
// <----- Deprecated
|
||||
|
@@ -84,12 +84,6 @@ public:
|
||||
KX_RAY_AXIS_NEG_Z
|
||||
};
|
||||
|
||||
// Deprecated ----->
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_RaySensor,GetHitObject);
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_RaySensor,GetHitPosition);
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_RaySensor,GetHitNormal);
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_RaySensor,GetRayDirection);
|
||||
// <-----
|
||||
|
||||
/* Attributes */
|
||||
static PyObject* pyattr_get_hitobject(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
|
@@ -192,18 +192,7 @@ PyTypeObject KX_SCA_AddObjectActuator::Type = {
|
||||
};
|
||||
|
||||
PyMethodDef KX_SCA_AddObjectActuator::Methods[] = {
|
||||
// ---> deprecated
|
||||
{"setTime", (PyCFunction) KX_SCA_AddObjectActuator::sPySetTime, METH_O, (const char *)SetTime_doc},
|
||||
{"getTime", (PyCFunction) KX_SCA_AddObjectActuator::sPyGetTime, METH_NOARGS, (const char *)GetTime_doc},
|
||||
{"getLinearVelocity", (PyCFunction) KX_SCA_AddObjectActuator::sPyGetLinearVelocity, METH_NOARGS, (const char *)GetLinearVelocity_doc},
|
||||
{"setLinearVelocity", (PyCFunction) KX_SCA_AddObjectActuator::sPySetLinearVelocity, METH_VARARGS, (const char *)SetLinearVelocity_doc},
|
||||
{"getAngularVelocity", (PyCFunction) KX_SCA_AddObjectActuator::sPyGetAngularVelocity, METH_NOARGS, (const char *)GetAngularVelocity_doc},
|
||||
{"setAngularVelocity", (PyCFunction) KX_SCA_AddObjectActuator::sPySetAngularVelocity, METH_VARARGS, (const char *)SetAngularVelocity_doc},
|
||||
{"getLastCreatedObject", (PyCFunction) KX_SCA_AddObjectActuator::sPyGetLastCreatedObject, METH_NOARGS,"getLastCreatedObject() : get the object handle to the last created object\n"},
|
||||
{"instantAddObject", (PyCFunction) KX_SCA_AddObjectActuator::sPyInstantAddObject, METH_NOARGS,"instantAddObject() : immediately add object without delay\n"},
|
||||
{"setObject", (PyCFunction) KX_SCA_AddObjectActuator::sPySetObject, METH_O, (const char *)SetObject_doc},
|
||||
{"getObject", (PyCFunction) KX_SCA_AddObjectActuator::sPyGetObject, METH_VARARGS, (const char *)GetObject_doc},
|
||||
|
||||
{NULL,NULL} //Sentinel
|
||||
};
|
||||
|
||||
@@ -253,181 +242,6 @@ PyObject* KX_SCA_AddObjectActuator::pyattr_get_objectLastCreated(void *self, con
|
||||
return actuator->m_lastCreatedObject->GetProxy();
|
||||
}
|
||||
|
||||
/* 1. setObject */
|
||||
const char KX_SCA_AddObjectActuator::SetObject_doc[] =
|
||||
"setObject(object)\n"
|
||||
"\t- object: KX_GameObject, string or None\n"
|
||||
"\tSets the object that will be added. There has to be an object\n"
|
||||
"\tof this name. If not, this function does nothing.\n";
|
||||
PyObject* KX_SCA_AddObjectActuator::PySetObject(PyObject* value)
|
||||
{
|
||||
KX_GameObject *gameobj;
|
||||
|
||||
ShowDeprecationWarning("setObject()", "the object property");
|
||||
|
||||
if (!ConvertPythonToGameObject(value, &gameobj, true, "actuator.setObject(value): KX_SCA_AddObjectActuator"))
|
||||
return NULL; // ConvertPythonToGameObject sets the error
|
||||
|
||||
if (m_OriginalObject != NULL)
|
||||
m_OriginalObject->UnregisterActuator(this);
|
||||
|
||||
m_OriginalObject = (SCA_IObject*)gameobj;
|
||||
if (m_OriginalObject)
|
||||
m_OriginalObject->RegisterActuator(this);
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* 2. setTime */
|
||||
const char KX_SCA_AddObjectActuator::SetTime_doc[] =
|
||||
"setTime(duration)\n"
|
||||
"\t- duration: integer\n"
|
||||
"\tSets the lifetime of the object that will be added, in frames. \n"
|
||||
"\tIf the duration is negative, it is set to 0.\n";
|
||||
|
||||
|
||||
PyObject* KX_SCA_AddObjectActuator::PySetTime(PyObject* value)
|
||||
{
|
||||
ShowDeprecationWarning("setTime()", "the time property");
|
||||
int deltatime = PyLong_AsSsize_t(value);
|
||||
if (deltatime==-1 && PyErr_Occurred()) {
|
||||
PyErr_SetString(PyExc_TypeError, "expected an int");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
m_timeProp = deltatime;
|
||||
if (m_timeProp < 0) m_timeProp = 0;
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* 3. getTime */
|
||||
const char KX_SCA_AddObjectActuator::GetTime_doc[] =
|
||||
"getTime()\n"
|
||||
"\tReturns the lifetime of the object that will be added.\n";
|
||||
|
||||
|
||||
PyObject* KX_SCA_AddObjectActuator::PyGetTime()
|
||||
{
|
||||
ShowDeprecationWarning("getTime()", "the time property");
|
||||
return PyLong_FromSsize_t(m_timeProp);
|
||||
}
|
||||
|
||||
|
||||
/* 4. getObject */
|
||||
const char KX_SCA_AddObjectActuator::GetObject_doc[] =
|
||||
"getObject(name_only = 1)\n"
|
||||
"name_only - optional arg, when true will return the KX_GameObject rather then its name\n"
|
||||
"\tReturns the name of the object that will be added.\n";
|
||||
PyObject* KX_SCA_AddObjectActuator::PyGetObject(PyObject* args)
|
||||
{
|
||||
int ret_name_only = 1;
|
||||
|
||||
ShowDeprecationWarning("getObject()", "the object property");
|
||||
|
||||
if (!PyArg_ParseTuple(args, "|i:getObject", &ret_name_only))
|
||||
return NULL;
|
||||
|
||||
if (!m_OriginalObject)
|
||||
Py_RETURN_NONE;
|
||||
|
||||
if (ret_name_only)
|
||||
return PyUnicode_FromString(m_OriginalObject->GetName().ReadPtr());
|
||||
else
|
||||
return m_OriginalObject->GetProxy();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* 5. getLinearVelocity */
|
||||
const char KX_SCA_AddObjectActuator::GetLinearVelocity_doc[] =
|
||||
"GetLinearVelocity()\n"
|
||||
"\tReturns the linear velocity that will be assigned to \n"
|
||||
"\tthe created object.\n";
|
||||
|
||||
PyObject* KX_SCA_AddObjectActuator::PyGetLinearVelocity()
|
||||
{
|
||||
ShowDeprecationWarning("getLinearVelocity()", "the linearVelocity property");
|
||||
PyObject *retVal = PyList_New(3);
|
||||
|
||||
PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_linear_velocity[0]));
|
||||
PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_linear_velocity[1]));
|
||||
PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_linear_velocity[2]));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* 6. setLinearVelocity */
|
||||
const char KX_SCA_AddObjectActuator::SetLinearVelocity_doc[] =
|
||||
"setLinearVelocity(vx, vy, vz)\n"
|
||||
"\t- vx: float\n"
|
||||
"\t- vy: float\n"
|
||||
"\t- vz: float\n"
|
||||
"\t- local: bool\n"
|
||||
"\tAssign this velocity to the created object. \n";
|
||||
|
||||
PyObject* KX_SCA_AddObjectActuator::PySetLinearVelocity(PyObject* args)
|
||||
{
|
||||
ShowDeprecationWarning("setLinearVelocity()", "the linearVelocity property");
|
||||
|
||||
float vecArg[3];
|
||||
if (!PyArg_ParseTuple(args, "fff:setLinearVelocity", &vecArg[0], &vecArg[1], &vecArg[2]))
|
||||
return NULL;
|
||||
|
||||
m_linear_velocity[0] = vecArg[0];
|
||||
m_linear_velocity[1] = vecArg[1];
|
||||
m_linear_velocity[2] = vecArg[2];
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* 7. getAngularVelocity */
|
||||
const char KX_SCA_AddObjectActuator::GetAngularVelocity_doc[] =
|
||||
"GetAngularVelocity()\n"
|
||||
"\tReturns the angular velocity that will be assigned to \n"
|
||||
"\tthe created object.\n";
|
||||
|
||||
PyObject* KX_SCA_AddObjectActuator::PyGetAngularVelocity()
|
||||
{
|
||||
ShowDeprecationWarning("getAngularVelocity()", "the angularVelocity property");
|
||||
PyObject *retVal = PyList_New(3);
|
||||
|
||||
PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_angular_velocity[0]));
|
||||
PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_angular_velocity[1]));
|
||||
PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_angular_velocity[2]));
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* 8. setAngularVelocity */
|
||||
const char KX_SCA_AddObjectActuator::SetAngularVelocity_doc[] =
|
||||
"setAngularVelocity(vx, vy, vz)\n"
|
||||
"\t- vx: float\n"
|
||||
"\t- vy: float\n"
|
||||
"\t- vz: float\n"
|
||||
"\t- local: bool\n"
|
||||
"\tAssign this angular velocity to the created object. \n";
|
||||
|
||||
PyObject* KX_SCA_AddObjectActuator::PySetAngularVelocity(PyObject* args)
|
||||
{
|
||||
ShowDeprecationWarning("setAngularVelocity()", "the angularVelocity property");
|
||||
|
||||
float vecArg[3];
|
||||
if (!PyArg_ParseTuple(args, "fff:setAngularVelocity", &vecArg[0], &vecArg[1], &vecArg[2]))
|
||||
return NULL;
|
||||
|
||||
m_angular_velocity[0] = vecArg[0];
|
||||
m_angular_velocity[1] = vecArg[1];
|
||||
m_angular_velocity[2] = vecArg[2];
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
void KX_SCA_AddObjectActuator::InstantAddObject()
|
||||
{
|
||||
@@ -470,26 +284,3 @@ PyObject* KX_SCA_AddObjectActuator::PyInstantAddObject()
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* 7. GetLastCreatedObject */
|
||||
const char KX_SCA_AddObjectActuator::GetLastCreatedObject_doc[] =
|
||||
"getLastCreatedObject()\n"
|
||||
"\tReturn the last created object. \n";
|
||||
|
||||
|
||||
PyObject* KX_SCA_AddObjectActuator::PyGetLastCreatedObject()
|
||||
{
|
||||
ShowDeprecationWarning("getLastCreatedObject()", "the objectLastCreated property");
|
||||
SCA_IObject* result = this->GetLastCreatedObject();
|
||||
|
||||
// if result->GetSGNode() is NULL
|
||||
// it means the object has ended, The BGE python api crashes in many places if the object is returned.
|
||||
if (result && (static_cast<KX_GameObject *>(result))->GetSGNode())
|
||||
{
|
||||
return result->GetProxy();
|
||||
}
|
||||
// don't return NULL to python anymore, it gives trouble in the scripts
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
@@ -115,25 +115,6 @@ public:
|
||||
|
||||
void InstantAddObject();
|
||||
|
||||
/* 1. setObject */
|
||||
KX_PYMETHOD_DOC_O(KX_SCA_AddObjectActuator,SetObject);
|
||||
/* 2. setTime */
|
||||
KX_PYMETHOD_DOC_O(KX_SCA_AddObjectActuator,SetTime);
|
||||
/* 3. getTime */
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_SCA_AddObjectActuator,GetTime);
|
||||
/* 4. getObject */
|
||||
KX_PYMETHOD_DOC_VARARGS(KX_SCA_AddObjectActuator,GetObject);
|
||||
/* 5. getLinearVelocity */
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_SCA_AddObjectActuator,GetLinearVelocity);
|
||||
/* 6. setLinearVelocity */
|
||||
KX_PYMETHOD_DOC_VARARGS(KX_SCA_AddObjectActuator,SetLinearVelocity);
|
||||
/* 7. getAngularVelocity */
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_SCA_AddObjectActuator,GetAngularVelocity);
|
||||
/* 8. setAngularVelocity */
|
||||
KX_PYMETHOD_DOC_VARARGS(KX_SCA_AddObjectActuator,SetAngularVelocity);
|
||||
/* 9. getLastCreatedObject */
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_SCA_AddObjectActuator,GetLastCreatedObject);
|
||||
/* 10. instantAddObject*/
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_SCA_AddObjectActuator,InstantAddObject);
|
||||
|
||||
static PyObject* pyattr_get_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
|
@@ -70,9 +70,6 @@ PyTypeObject KX_SCA_DynamicActuator::Type = {
|
||||
};
|
||||
|
||||
PyMethodDef KX_SCA_DynamicActuator::Methods[] = {
|
||||
// ---> deprecated
|
||||
KX_PYMETHODTABLE(KX_SCA_DynamicActuator, setOperation),
|
||||
KX_PYMETHODTABLE(KX_SCA_DynamicActuator, getOperation),
|
||||
{NULL,NULL} //Sentinel
|
||||
};
|
||||
|
||||
@@ -82,42 +79,6 @@ PyAttributeDef KX_SCA_DynamicActuator::Attributes[] = {
|
||||
{ NULL } //Sentinel
|
||||
};
|
||||
|
||||
|
||||
/* 1. setOperation */
|
||||
KX_PYMETHODDEF_DOC(KX_SCA_DynamicActuator, setOperation,
|
||||
"setOperation(operation?)\n"
|
||||
"\t - operation? : type of dynamic operation\n"
|
||||
"\t 0 = restore dynamics\n"
|
||||
"\t 1 = disable dynamics\n"
|
||||
"\t 2 = enable rigid body\n"
|
||||
"\t 3 = disable rigid body\n"
|
||||
"Change the dynamic status of the parent object.\n")
|
||||
{
|
||||
ShowDeprecationWarning("setOperation()", "the mode property");
|
||||
int dyn_operation;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "i:setOperation", &dyn_operation))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
if (dyn_operation <0 || dyn_operation>3) {
|
||||
PyErr_SetString(PyExc_IndexError, "Dynamic Actuator's setOperation() range must be between 0 and 3");
|
||||
return NULL;
|
||||
}
|
||||
m_dyn_operation= dyn_operation;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
KX_PYMETHODDEF_DOC(KX_SCA_DynamicActuator, getOperation,
|
||||
"getOperation() -> integer\n"
|
||||
"Returns the operation type of this actuator.\n"
|
||||
)
|
||||
{
|
||||
ShowDeprecationWarning("getOperation()", "the mode property");
|
||||
return PyLong_FromSsize_t((long)m_dyn_operation);
|
||||
}
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
/* Native functions */
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
@@ -71,11 +71,6 @@ class KX_SCA_DynamicActuator : public SCA_IActuator
|
||||
KX_DYN_DISABLE_RIGID_BODY,
|
||||
KX_DYN_SET_MASS,
|
||||
};
|
||||
|
||||
/* 1. setOperation */
|
||||
KX_PYMETHOD_DOC(KX_SCA_DynamicActuator,setOperation);
|
||||
KX_PYMETHOD_DOC(KX_SCA_DynamicActuator,getOperation);
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -74,9 +74,6 @@ PyTypeObject KX_SCA_ReplaceMeshActuator::Type = {
|
||||
|
||||
PyMethodDef KX_SCA_ReplaceMeshActuator::Methods[] = {
|
||||
KX_PYMETHODTABLE(KX_SCA_ReplaceMeshActuator, instantReplaceMesh),
|
||||
// Deprecated ----->
|
||||
{"setMesh", (PyCFunction) KX_SCA_ReplaceMeshActuator::sPySetMesh, METH_O, (const char *)SetMesh_doc},
|
||||
KX_PYMETHODTABLE(KX_SCA_ReplaceMeshActuator, getMesh),
|
||||
{NULL,NULL} //Sentinel
|
||||
};
|
||||
|
||||
@@ -108,37 +105,6 @@ int KX_SCA_ReplaceMeshActuator::pyattr_set_mesh(void *self, const struct KX_PYAT
|
||||
return PY_SET_ATTR_SUCCESS;
|
||||
}
|
||||
|
||||
/* 1. setMesh */
|
||||
const char KX_SCA_ReplaceMeshActuator::SetMesh_doc[] =
|
||||
"setMesh(name)\n"
|
||||
"\t- name: string or None\n"
|
||||
"\tSet the mesh that will be substituted for the current one.\n";
|
||||
|
||||
PyObject* KX_SCA_ReplaceMeshActuator::PySetMesh(PyObject* value)
|
||||
{
|
||||
ShowDeprecationWarning("setMesh()", "the mesh property");
|
||||
RAS_MeshObject* new_mesh;
|
||||
|
||||
if (!ConvertPythonToMesh(value, &new_mesh, true, "actuator.mesh = value: KX_SCA_ReplaceMeshActuator"))
|
||||
return NULL;
|
||||
|
||||
m_mesh = new_mesh;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
KX_PYMETHODDEF_DOC(KX_SCA_ReplaceMeshActuator, getMesh,
|
||||
"getMesh() -> string\n"
|
||||
"Returns the name of the mesh to be substituted.\n"
|
||||
)
|
||||
{
|
||||
ShowDeprecationWarning("getMesh()", "the mesh property");
|
||||
if (!m_mesh)
|
||||
Py_RETURN_NONE;
|
||||
|
||||
return PyUnicode_FromString(const_cast<char *>(m_mesh->GetName().ReadPtr()));
|
||||
}
|
||||
|
||||
|
||||
KX_PYMETHODDEF_DOC(KX_SCA_ReplaceMeshActuator, instantReplaceMesh,
|
||||
"instantReplaceMesh() : immediately replace mesh without delay\n")
|
||||
{
|
||||
|
@@ -74,12 +74,13 @@ class KX_SCA_ReplaceMeshActuator : public SCA_IActuator
|
||||
|
||||
void InstantReplaceMesh();
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
/* Python interface ---------------------------------------------------- */
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
static PyObject* pyattr_get_mesh(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static int pyattr_set_mesh(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
|
||||
|
||||
/* 1. setMesh */
|
||||
KX_PYMETHOD_DOC_O(KX_SCA_ReplaceMeshActuator,SetMesh);
|
||||
KX_PYMETHOD_DOC(KX_SCA_ReplaceMeshActuator,getMesh);
|
||||
KX_PYMETHOD_DOC(KX_SCA_ReplaceMeshActuator,instantReplaceMesh);
|
||||
|
||||
};
|
||||
|
@@ -1630,9 +1630,6 @@ PyTypeObject KX_Scene::Type = {
|
||||
};
|
||||
|
||||
PyMethodDef KX_Scene::Methods[] = {
|
||||
KX_PYMETHODTABLE_NOARGS(KX_Scene, getLightList),
|
||||
KX_PYMETHODTABLE_NOARGS(KX_Scene, getObjectList),
|
||||
KX_PYMETHODTABLE_NOARGS(KX_Scene, getName),
|
||||
KX_PYMETHODTABLE(KX_Scene, addObject),
|
||||
|
||||
/* dict style access */
|
||||
@@ -1824,33 +1821,6 @@ PyAttributeDef KX_Scene::Attributes[] = {
|
||||
{ NULL } //Sentinel
|
||||
};
|
||||
|
||||
KX_PYMETHODDEF_DOC_NOARGS(KX_Scene, getLightList,
|
||||
"getLightList() -> list [KX_Light]\n"
|
||||
"Returns a list of all lights in the scene.\n"
|
||||
)
|
||||
{
|
||||
ShowDeprecationWarning("getLightList()", "the lights property");
|
||||
return m_lightlist->GetProxy();
|
||||
}
|
||||
|
||||
KX_PYMETHODDEF_DOC_NOARGS(KX_Scene, getObjectList,
|
||||
"getObjectList() -> list [KX_GameObject]\n"
|
||||
"Returns a list of all game objects in the scene.\n"
|
||||
)
|
||||
{
|
||||
ShowDeprecationWarning("getObjectList()", "the objects property");
|
||||
return m_objectlist->GetProxy();
|
||||
}
|
||||
|
||||
KX_PYMETHODDEF_DOC_NOARGS(KX_Scene, getName,
|
||||
"getName() -> string\n"
|
||||
"Returns the name of the scene.\n"
|
||||
)
|
||||
{
|
||||
ShowDeprecationWarning("getName()", "the name property");
|
||||
return PyUnicode_FromString(GetName());
|
||||
}
|
||||
|
||||
KX_PYMETHODDEF_DOC(KX_Scene, addObject,
|
||||
"addObject(object, other, time=0)\n"
|
||||
"Returns the added object.\n")
|
||||
|
@@ -517,26 +517,13 @@ public:
|
||||
*/
|
||||
void SetNodeTree(SG_Tree* root);
|
||||
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_Scene, getLightList);
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_Scene, getObjectList);
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_Scene, getName);
|
||||
/* --------------------------------------------------------------------- */
|
||||
/* Python interface ---------------------------------------------------- */
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
KX_PYMETHOD_DOC(KX_Scene, addObject);
|
||||
KX_PYMETHOD_DOC(KX_Scene, get);
|
||||
|
||||
/*
|
||||
KX_PYMETHOD_DOC(KX_Scene, getActiveCamera);
|
||||
KX_PYMETHOD_DOC(KX_Scene, getActiveCamera);
|
||||
KX_PYMETHOD_DOC(KX_Scene, findCamera);
|
||||
|
||||
KX_PYMETHOD_DOC(KX_Scene, getGravity);
|
||||
|
||||
KX_PYMETHOD_DOC(KX_Scene, setActivityCulling);
|
||||
KX_PYMETHOD_DOC(KX_Scene, setActivityCullingRadius);
|
||||
|
||||
KX_PYMETHOD_DOC(KX_Scene, setSceneViewport);
|
||||
KX_PYMETHOD_DOC(KX_Scene, setSceneViewport);
|
||||
*/
|
||||
|
||||
/* attributes */
|
||||
static PyObject* pyattr_get_name(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject* pyattr_get_objects(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
|
@@ -245,14 +245,6 @@ PyTypeObject KX_SceneActuator::Type = {
|
||||
|
||||
PyMethodDef KX_SceneActuator::Methods[] =
|
||||
{
|
||||
//Deprecated functions ------>
|
||||
{"setUseRestart", (PyCFunction) KX_SceneActuator::sPySetUseRestart, METH_VARARGS, (const char *)SetUseRestart_doc},
|
||||
{"setScene", (PyCFunction) KX_SceneActuator::sPySetScene, METH_VARARGS, (const char *)SetScene_doc},
|
||||
{"setCamera", (PyCFunction) KX_SceneActuator::sPySetCamera, METH_O, (const char *)SetCamera_doc},
|
||||
{"getUseRestart", (PyCFunction) KX_SceneActuator::sPyGetUseRestart, METH_NOARGS, (const char *)GetUseRestart_doc},
|
||||
{"getScene", (PyCFunction) KX_SceneActuator::sPyGetScene, METH_NOARGS, (const char *)GetScene_doc},
|
||||
{"getCamera", (PyCFunction) KX_SceneActuator::sPyGetCamera, METH_NOARGS, (const char *)GetCamera_doc},
|
||||
//<----- Deprecated
|
||||
{NULL,NULL} //Sentinel
|
||||
};
|
||||
|
||||
@@ -295,117 +287,4 @@ int KX_SceneActuator::pyattr_set_camera(void *self, const struct KX_PYATTRIBUTE_
|
||||
return PY_SET_ATTR_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/* 2. setUseRestart--------------------------------------------------------- */
|
||||
const char KX_SceneActuator::SetUseRestart_doc[] =
|
||||
"setUseRestart(flag)\n"
|
||||
"\t- flag: 0 or 1.\n"
|
||||
"\tSet flag to 1 to restart the scene.\n" ;
|
||||
PyObject* KX_SceneActuator::PySetUseRestart(PyObject* args)
|
||||
{
|
||||
ShowDeprecationWarning("setUseRestart()", "the useRestart property");
|
||||
int boolArg;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "i:setUseRestart", &boolArg))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
m_restart = boolArg != 0;
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* 3. getUseRestart: */
|
||||
const char KX_SceneActuator::GetUseRestart_doc[] =
|
||||
"getUseRestart()\n"
|
||||
"\tReturn whether the scene will be restarted.\n" ;
|
||||
PyObject* KX_SceneActuator::PyGetUseRestart()
|
||||
{
|
||||
ShowDeprecationWarning("getUseRestart()", "the useRestart property");
|
||||
return PyLong_FromSsize_t(!(m_restart == 0));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* 4. set scene------------------------------------------------------------- */
|
||||
const char KX_SceneActuator::SetScene_doc[] =
|
||||
"setScene(scene)\n"
|
||||
"\t- scene: string\n"
|
||||
"\tSet the name of scene the actuator will switch to.\n" ;
|
||||
PyObject* KX_SceneActuator::PySetScene(PyObject* args)
|
||||
{
|
||||
ShowDeprecationWarning("setScene()", "the scene property");
|
||||
/* one argument: a scene, ignore the rest */
|
||||
char *scene_name;
|
||||
|
||||
if(!PyArg_ParseTuple(args, "s:setScene", &scene_name))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Scene switch is done by name. */
|
||||
m_nextSceneName = scene_name;
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* 5. getScene: */
|
||||
const char KX_SceneActuator::GetScene_doc[] =
|
||||
"getScene()\n"
|
||||
"\tReturn the name of the scene the actuator wants to switch to.\n" ;
|
||||
PyObject* KX_SceneActuator::PyGetScene()
|
||||
{
|
||||
ShowDeprecationWarning("getScene()", "the scene property");
|
||||
return PyUnicode_FromString(m_nextSceneName);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* 6. set camera------------------------------------------------------------ */
|
||||
const char KX_SceneActuator::SetCamera_doc[] =
|
||||
"setCamera(camera)\n"
|
||||
"\t- camera: string\n"
|
||||
"\tSet the camera to switch to.\n" ;
|
||||
PyObject* KX_SceneActuator::PySetCamera(PyObject* value)
|
||||
{
|
||||
ShowDeprecationWarning("setCamera()", "the camera property");
|
||||
KX_Camera *camOb;
|
||||
|
||||
if (!ConvertPythonToCamera(value, &camOb, true, "actu.setCamera(value): KX_SceneActuator"))
|
||||
return NULL;
|
||||
|
||||
if (m_camera)
|
||||
m_camera->UnregisterActuator(this);
|
||||
|
||||
if(camOb==NULL) {
|
||||
m_camera= NULL;
|
||||
}
|
||||
else {
|
||||
m_camera = camOb;
|
||||
m_camera->RegisterActuator(this);
|
||||
}
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* 7. getCamera: */
|
||||
const char KX_SceneActuator::GetCamera_doc[] =
|
||||
"getCamera()\n"
|
||||
"\tReturn the name of the camera to switch to.\n" ;
|
||||
PyObject* KX_SceneActuator::PyGetCamera()
|
||||
{
|
||||
ShowDeprecationWarning("getCamera()", "the camera property");
|
||||
if (m_camera) {
|
||||
return PyUnicode_FromString(m_camera->GetName());
|
||||
}
|
||||
else {
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
}
|
||||
/* eof */
|
||||
|
@@ -91,22 +91,6 @@ class KX_SceneActuator : public SCA_IActuator
|
||||
/* Python interface ---------------------------------------------------- */
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
/* 1. set */
|
||||
/* Removed */
|
||||
|
||||
/* 2. setUseRestart: */
|
||||
KX_PYMETHOD_DOC_VARARGS(KX_SceneActuator,SetUseRestart);
|
||||
/* 3. getUseRestart: */
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_SceneActuator,GetUseRestart);
|
||||
/* 4. setScene: */
|
||||
KX_PYMETHOD_DOC_VARARGS(KX_SceneActuator,SetScene);
|
||||
/* 5. getScene: */
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_SceneActuator,GetScene);
|
||||
/* 6. setCamera: */
|
||||
KX_PYMETHOD_DOC_O(KX_SceneActuator,SetCamera);
|
||||
/* 7. getCamera: */
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_SceneActuator,GetCamera);
|
||||
|
||||
static PyObject* pyattr_get_camera(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static int pyattr_set_camera(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
|
||||
|
||||
|
@@ -296,17 +296,6 @@ PyTypeObject KX_SoundActuator::Type = {
|
||||
};
|
||||
|
||||
PyMethodDef KX_SoundActuator::Methods[] = {
|
||||
// Deprecated ----->
|
||||
{"setGain",(PyCFunction) KX_SoundActuator::sPySetGain,METH_VARARGS,NULL},
|
||||
{"getGain",(PyCFunction) KX_SoundActuator::sPyGetGain,METH_NOARGS,NULL},
|
||||
{"setPitch",(PyCFunction) KX_SoundActuator::sPySetPitch,METH_VARARGS,NULL},
|
||||
{"getPitch",(PyCFunction) KX_SoundActuator::sPyGetPitch,METH_NOARGS,NULL},
|
||||
{"setRollOffFactor",(PyCFunction) KX_SoundActuator::sPySetRollOffFactor,METH_VARARGS,NULL},
|
||||
{"getRollOffFactor",(PyCFunction) KX_SoundActuator::sPyGetRollOffFactor,METH_NOARGS,NULL},
|
||||
{"setType",(PyCFunction) KX_SoundActuator::sPySetType,METH_VARARGS,NULL},
|
||||
{"getType",(PyCFunction) KX_SoundActuator::sPyGetType,METH_NOARGS,NULL},
|
||||
// <-----
|
||||
|
||||
KX_PYMETHODTABLE_NOARGS(KX_SoundActuator, startSound),
|
||||
KX_PYMETHODTABLE_NOARGS(KX_SoundActuator, pauseSound),
|
||||
KX_PYMETHODTABLE_NOARGS(KX_SoundActuator, stopSound),
|
||||
@@ -427,109 +416,3 @@ int KX_SoundActuator::pyattr_set_rollOffFactor(void *self, const struct KX_PYATT
|
||||
|
||||
return PY_SET_ATTR_SUCCESS;
|
||||
}
|
||||
|
||||
PyObject* KX_SoundActuator::PySetGain(PyObject* args)
|
||||
{
|
||||
ShowDeprecationWarning("setGain()", "the volume property");
|
||||
float gain = 1.0;
|
||||
if (!PyArg_ParseTuple(args, "f:setGain", &gain))
|
||||
return NULL;
|
||||
|
||||
m_volume = gain;
|
||||
if(m_handle)
|
||||
AUD_setSoundVolume(m_handle, gain);
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
PyObject* KX_SoundActuator::PyGetGain()
|
||||
{
|
||||
ShowDeprecationWarning("getGain()", "the volume property");
|
||||
float gain = m_volume;
|
||||
PyObject* result = PyFloat_FromDouble(gain);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
PyObject* KX_SoundActuator::PySetPitch(PyObject* args)
|
||||
{
|
||||
ShowDeprecationWarning("setPitch()", "the pitch property");
|
||||
float pitch = 1.0;
|
||||
if (!PyArg_ParseTuple(args, "f:setPitch", &pitch))
|
||||
return NULL;
|
||||
|
||||
m_pitch = pitch;
|
||||
if(m_handle)
|
||||
AUD_setSoundPitch(m_handle, pitch);
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
PyObject* KX_SoundActuator::PyGetPitch()
|
||||
{
|
||||
ShowDeprecationWarning("getPitch()", "the pitch property");
|
||||
float pitch = m_pitch;
|
||||
PyObject* result = PyFloat_FromDouble(pitch);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
PyObject* KX_SoundActuator::PySetRollOffFactor(PyObject* args)
|
||||
{
|
||||
ShowDeprecationWarning("setRollOffFactor()", "the rollOffFactor property");
|
||||
float rollofffactor = 1.0;
|
||||
if (!PyArg_ParseTuple(args, "f:setRollOffFactor", &rollofffactor))
|
||||
return NULL;
|
||||
|
||||
m_3d.rolloff_factor = rollofffactor;
|
||||
if(m_handle)
|
||||
AUD_set3DSourceSetting(m_handle, AUD_3DSS_ROLLOFF_FACTOR, rollofffactor);
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
PyObject* KX_SoundActuator::PyGetRollOffFactor()
|
||||
{
|
||||
ShowDeprecationWarning("getRollOffFactor()", "the rollOffFactor property");
|
||||
float rollofffactor = m_3d.rolloff_factor;
|
||||
PyObject* result = PyFloat_FromDouble(rollofffactor);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
PyObject* KX_SoundActuator::PySetType(PyObject* args)
|
||||
{
|
||||
int typeArg;
|
||||
ShowDeprecationWarning("setType()", "the mode property");
|
||||
|
||||
if (!PyArg_ParseTuple(args, "i:setType", &typeArg)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if ( (typeArg > KX_SOUNDACT_NODEF)
|
||||
&& (typeArg < KX_SOUNDACT_MAX) ) {
|
||||
m_type = (KX_SOUNDACT_TYPE) typeArg;
|
||||
}
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
PyObject* KX_SoundActuator::PyGetType()
|
||||
{
|
||||
ShowDeprecationWarning("getType()", "the mode property");
|
||||
return PyLong_FromSsize_t(m_type);
|
||||
}
|
||||
// <-----
|
||||
|
||||
|
@@ -110,18 +110,6 @@ public:
|
||||
static PyObject* pyattr_get_pitch(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject* pyattr_get_rollOffFactor(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject* pyattr_get_type(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
|
||||
// Deprecated ----->
|
||||
KX_PYMETHOD_VARARGS(KX_SoundActuator,SetGain);
|
||||
KX_PYMETHOD_NOARGS(KX_SoundActuator,GetGain);
|
||||
KX_PYMETHOD_VARARGS(KX_SoundActuator,SetPitch);
|
||||
KX_PYMETHOD_NOARGS(KX_SoundActuator,GetPitch);
|
||||
KX_PYMETHOD_VARARGS(KX_SoundActuator,SetRollOffFactor);
|
||||
KX_PYMETHOD_NOARGS(KX_SoundActuator,GetRollOffFactor);
|
||||
KX_PYMETHOD_VARARGS(KX_SoundActuator,SetType);
|
||||
KX_PYMETHOD_NOARGS(KX_SoundActuator,GetType);
|
||||
// <-----
|
||||
|
||||
};
|
||||
|
||||
#endif //__KX_SOUNDACTUATOR
|
||||
|
@@ -159,12 +159,6 @@ PyTypeObject KX_StateActuator::Type = {
|
||||
};
|
||||
|
||||
PyMethodDef KX_StateActuator::Methods[] = {
|
||||
// deprecated -->
|
||||
{"setOperation", (PyCFunction) KX_StateActuator::sPySetOperation,
|
||||
METH_VARARGS, (const char *)SetOperation_doc},
|
||||
{"setMask", (PyCFunction) KX_StateActuator::sPySetMask,
|
||||
METH_VARARGS, (const char *)SetMask_doc},
|
||||
// <--
|
||||
{NULL,NULL} //Sentinel
|
||||
};
|
||||
|
||||
@@ -173,52 +167,3 @@ PyAttributeDef KX_StateActuator::Attributes[] = {
|
||||
KX_PYATTRIBUTE_INT_RW("mask",0,0x3FFFFFFF,false,KX_StateActuator,m_mask),
|
||||
{ NULL } //Sentinel
|
||||
};
|
||||
|
||||
|
||||
/* set operation ---------------------------------------------------------- */
|
||||
const char
|
||||
KX_StateActuator::SetOperation_doc[] =
|
||||
"setOperation(op)\n"
|
||||
"\t - op : bit operation (0=Copy, 1=Set, 2=Clear, 3=Negate)"
|
||||
"\tSet the type of bit operation to be applied on object state mask.\n"
|
||||
"\tUse setMask() to specify the bits that will be modified.\n";
|
||||
PyObject*
|
||||
|
||||
KX_StateActuator::PySetOperation(PyObject* args) {
|
||||
ShowDeprecationWarning("setOperation()", "the operation property");
|
||||
int oper;
|
||||
|
||||
if(!PyArg_ParseTuple(args, "i:setOperation", &oper)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
m_operation = oper;
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* set mask ---------------------------------------------------------- */
|
||||
const char
|
||||
KX_StateActuator::SetMask_doc[] =
|
||||
"setMask(mask)\n"
|
||||
"\t - mask : bits that will be modified"
|
||||
"\tSet the value that defines the bits that will be modified by the operation.\n"
|
||||
"\tThe bits that are 1 in the value will be updated in the object state,\n"
|
||||
"\tthe bits that are 0 are will be left unmodified expect for the Copy operation\n"
|
||||
"\twhich copies the value to the object state.\n";
|
||||
PyObject*
|
||||
|
||||
KX_StateActuator::PySetMask(PyObject* args) {
|
||||
ShowDeprecationWarning("setMask()", "the mask property");
|
||||
int mask;
|
||||
|
||||
if(!PyArg_ParseTuple(args, "i:setMask", &mask)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
m_mask = mask;
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -88,9 +88,7 @@ class KX_StateActuator : public SCA_IActuator
|
||||
/* --------------------------------------------------------------------- */
|
||||
/* Python interface ---------------------------------------------------- */
|
||||
/* --------------------------------------------------------------------- */
|
||||
//KX_PYMETHOD_DOC
|
||||
KX_PYMETHOD_DOC_VARARGS(KX_StateActuator,SetOperation);
|
||||
KX_PYMETHOD_DOC_VARARGS(KX_StateActuator,SetMask);
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -315,16 +315,6 @@ PyTypeObject KX_TouchSensor::Type = {
|
||||
};
|
||||
|
||||
PyMethodDef KX_TouchSensor::Methods[] = {
|
||||
//Deprecated ----->
|
||||
{"setProperty",
|
||||
(PyCFunction) KX_TouchSensor::sPySetProperty, METH_O, (const char *)SetProperty_doc},
|
||||
{"getProperty",
|
||||
(PyCFunction) KX_TouchSensor::sPyGetProperty, METH_NOARGS, (const char *)GetProperty_doc},
|
||||
{"getHitObject",
|
||||
(PyCFunction) KX_TouchSensor::sPyGetHitObject, METH_NOARGS, (const char *)GetHitObject_doc},
|
||||
{"getHitObjectList",
|
||||
(PyCFunction) KX_TouchSensor::sPyGetHitObjectList, METH_NOARGS, (const char *)GetHitObjectList_doc},
|
||||
//<-----
|
||||
{NULL,NULL} //Sentinel
|
||||
};
|
||||
|
||||
@@ -339,101 +329,6 @@ PyAttributeDef KX_TouchSensor::Attributes[] = {
|
||||
|
||||
/* Python API */
|
||||
|
||||
/* 1. setProperty */
|
||||
const char KX_TouchSensor::SetProperty_doc[] =
|
||||
"setProperty(name)\n"
|
||||
"\t- name: string\n"
|
||||
"\tSet the property or material to collide with. Use\n"
|
||||
"\tsetTouchMaterial() to switch between properties and\n"
|
||||
"\tmaterials.";
|
||||
PyObject* KX_TouchSensor::PySetProperty(PyObject* value)
|
||||
{
|
||||
ShowDeprecationWarning("setProperty()", "the propName property");
|
||||
char *nameArg= _PyUnicode_AsString(value);
|
||||
if (nameArg==NULL) {
|
||||
PyErr_SetString(PyExc_ValueError, "expected a ");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
m_touchedpropname = nameArg;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
/* 2. getProperty */
|
||||
const char KX_TouchSensor::GetProperty_doc[] =
|
||||
"getProperty(name)\n"
|
||||
"\tReturns the property or material to collide with. Use\n"
|
||||
"\tgetTouchMaterial() to find out whether this sensor\n"
|
||||
"\tlooks for properties or materials.";
|
||||
PyObject* KX_TouchSensor::PyGetProperty() {
|
||||
ShowDeprecationWarning("getProperty()", "the propName property");
|
||||
|
||||
return PyUnicode_FromString(m_touchedpropname);
|
||||
}
|
||||
|
||||
const char KX_TouchSensor::GetHitObject_doc[] =
|
||||
"getHitObject()\n"
|
||||
;
|
||||
PyObject* KX_TouchSensor::PyGetHitObject()
|
||||
{
|
||||
ShowDeprecationWarning("getHitObject()", "the hitObject property");
|
||||
/* to do: do Py_IncRef if the object is already known in Python */
|
||||
/* otherwise, this leaks memory */
|
||||
if (m_hitObject)
|
||||
{
|
||||
return m_hitObject->GetProxy();
|
||||
}
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
const char KX_TouchSensor::GetHitObjectList_doc[] =
|
||||
"getHitObjectList()\n"
|
||||
"\tReturn a list of the objects this object collided with,\n"
|
||||
"\tbut only those matching the property/material condition.\n";
|
||||
PyObject* KX_TouchSensor::PyGetHitObjectList()
|
||||
{
|
||||
ShowDeprecationWarning("getHitObjectList()", "the hitObjectList property");
|
||||
/* to do: do Py_IncRef if the object is already known in Python */
|
||||
/* otherwise, this leaks memory */ /* Edit, this seems ok and not to leak memory - Campbell */
|
||||
return m_colliders->GetProxy();
|
||||
}
|
||||
|
||||
/*getTouchMaterial and setTouchMaterial were never added to the api,
|
||||
they can probably be removed with out anyone noticing*/
|
||||
|
||||
/* 5. getTouchMaterial */
|
||||
const char KX_TouchSensor::GetTouchMaterial_doc[] =
|
||||
"getTouchMaterial()\n"
|
||||
"\tReturns KX_TRUE if this sensor looks for a specific material,\n"
|
||||
"\tKX_FALSE if it looks for a specific property.\n" ;
|
||||
PyObject* KX_TouchSensor::PyGetTouchMaterial()
|
||||
{
|
||||
ShowDeprecationWarning("getTouchMaterial()", "the useMaterial property");
|
||||
return PyLong_FromSsize_t(m_bFindMaterial);
|
||||
}
|
||||
|
||||
/* 6. setTouchMaterial */
|
||||
#if 0
|
||||
const char KX_TouchSensor::SetTouchMaterial_doc[] =
|
||||
"setTouchMaterial(flag)\n"
|
||||
"\t- flag: KX_TRUE or KX_FALSE.\n"
|
||||
"\tSet flag to KX_TRUE to switch on positive pulse mode,\n"
|
||||
"\tKX_FALSE to switch off positive pulse mode.\n" ;
|
||||
PyObject* KX_TouchSensor::PySetTouchMaterial(PyObject *value)
|
||||
{
|
||||
ShowDeprecationWarning("setTouchMaterial()", "the useMaterial property");
|
||||
int pulseArg = PyLong_AsSsize_t(value);
|
||||
|
||||
if(pulseArg ==-1 && PyErr_Occurred()) {
|
||||
PyErr_SetString(PyExc_ValueError, "expected a bool");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
m_bFindMaterial = pulseArg != 0;
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
#endif
|
||||
|
||||
PyObject* KX_TouchSensor::pyattr_get_object_hit(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
|
||||
{
|
||||
KX_TouchSensor* self= static_cast<KX_TouchSensor*>(self_v);
|
||||
|
@@ -120,23 +120,6 @@ public:
|
||||
/* Python interface ---------------------------------------------------- */
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
//Deprecated ----->
|
||||
/* 1. setProperty */
|
||||
KX_PYMETHOD_DOC_O(KX_TouchSensor,SetProperty);
|
||||
/* 2. getProperty */
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_TouchSensor,GetProperty);
|
||||
/* 3. getHitObject */
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_TouchSensor,GetHitObject);
|
||||
/* 4. getHitObject */
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_TouchSensor,GetHitObjectList);
|
||||
/* 5. getTouchMaterial */
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_TouchSensor,GetTouchMaterial);
|
||||
#if 0
|
||||
/* 6. setTouchMaterial */
|
||||
KX_PYMETHOD_DOC_O(KX_TouchSensor,SetTouchMaterial);
|
||||
#endif
|
||||
//<-----
|
||||
|
||||
static PyObject* pyattr_get_object_hit(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static PyObject* pyattr_get_object_hit_list(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef);
|
||||
|
||||
|
@@ -453,14 +453,6 @@ PyTypeObject KX_TrackToActuator::Type = {
|
||||
};
|
||||
|
||||
PyMethodDef KX_TrackToActuator::Methods[] = {
|
||||
// ---> deprecated
|
||||
{"setTime", (PyCFunction) KX_TrackToActuator::sPySetTime, METH_VARARGS, (const char *)SetTime_doc},
|
||||
{"getTime", (PyCFunction) KX_TrackToActuator::sPyGetTime, METH_NOARGS, (const char *)GetTime_doc},
|
||||
{"setUse3D", (PyCFunction) KX_TrackToActuator::sPySetUse3D, METH_VARARGS, (const char *)SetUse3D_doc},
|
||||
{"getUse3D", (PyCFunction) KX_TrackToActuator::sPyGetUse3D, METH_NOARGS, (const char *)GetUse3D_doc},
|
||||
{"setObject", (PyCFunction) KX_TrackToActuator::sPySetObject, METH_O, (const char *)SetObject_doc},
|
||||
{"getObject", (PyCFunction) KX_TrackToActuator::sPyGetObject, METH_VARARGS, (const char *)GetObject_doc},
|
||||
|
||||
{NULL,NULL} //Sentinel
|
||||
};
|
||||
|
||||
@@ -500,123 +492,4 @@ int KX_TrackToActuator::pyattr_set_object(void *self, const struct KX_PYATTRIBUT
|
||||
return PY_SET_ATTR_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/* 1. setObject */
|
||||
const char KX_TrackToActuator::SetObject_doc[] =
|
||||
"setObject(object)\n"
|
||||
"\t- object: KX_GameObject, string or None\n"
|
||||
"\tSet the object to track with the parent of this actuator.\n";
|
||||
PyObject* KX_TrackToActuator::PySetObject(PyObject* value)
|
||||
{
|
||||
KX_GameObject *gameobj;
|
||||
|
||||
ShowDeprecationWarning("setObject()", "the object property");
|
||||
|
||||
if (!ConvertPythonToGameObject(value, &gameobj, true, "actuator.setObject(value): KX_TrackToActuator"))
|
||||
return NULL; // ConvertPythonToGameObject sets the error
|
||||
|
||||
if (m_object != NULL)
|
||||
m_object->UnregisterActuator(this);
|
||||
|
||||
m_object = (SCA_IObject*)gameobj;
|
||||
if (m_object)
|
||||
m_object->RegisterActuator(this);
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* 2. getObject */
|
||||
const char KX_TrackToActuator::GetObject_doc[] =
|
||||
"getObject(name_only = 1)\n"
|
||||
"name_only - optional arg, when true will return the KX_GameObject rather then its name\n"
|
||||
"\tReturns the object to track with the parent of this actuator\n";
|
||||
PyObject* KX_TrackToActuator::PyGetObject(PyObject* args)
|
||||
{
|
||||
int ret_name_only = 1;
|
||||
|
||||
ShowDeprecationWarning("getObject()", "the object property");
|
||||
|
||||
if (!PyArg_ParseTuple(args, "|i:getObject", &ret_name_only))
|
||||
return NULL;
|
||||
|
||||
if (!m_object)
|
||||
Py_RETURN_NONE;
|
||||
|
||||
if (ret_name_only)
|
||||
return PyUnicode_FromString(m_object->GetName());
|
||||
else
|
||||
return m_object->GetProxy();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* 3. setTime */
|
||||
const char KX_TrackToActuator::SetTime_doc[] =
|
||||
"setTime(time)\n"
|
||||
"\t- time: integer\n"
|
||||
"\tSet the time in frames with which to delay the tracking motion.\n";
|
||||
PyObject* KX_TrackToActuator::PySetTime(PyObject* args)
|
||||
{
|
||||
ShowDeprecationWarning("setTime()", "the timer property");
|
||||
int timeArg;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "i:setTime", &timeArg))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
m_time= timeArg;
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* 4.getTime */
|
||||
const char KX_TrackToActuator::GetTime_doc[] =
|
||||
"getTime()\n"
|
||||
"\t- time: integer\n"
|
||||
"\tReturn the time in frames with which the tracking motion is delayed.\n";
|
||||
PyObject* KX_TrackToActuator::PyGetTime()
|
||||
{
|
||||
ShowDeprecationWarning("getTime()", "the timer property");
|
||||
return PyLong_FromSsize_t(m_time);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* 5. getUse3D */
|
||||
const char KX_TrackToActuator::GetUse3D_doc[] =
|
||||
"getUse3D()\n"
|
||||
"\tReturns 1 if the motion is allowed to extend in the z-direction.\n";
|
||||
PyObject* KX_TrackToActuator::PyGetUse3D()
|
||||
{
|
||||
ShowDeprecationWarning("setTime()", "the use3D property");
|
||||
return PyLong_FromSsize_t(!(m_allow3D == 0));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* 6. setUse3D */
|
||||
const char KX_TrackToActuator::SetUse3D_doc[] =
|
||||
"setUse3D(value)\n"
|
||||
"\t- value: 0 or 1\n"
|
||||
"\tSet to 1 to allow the tracking motion to extend in the z-direction,\n"
|
||||
"\tset to 0 to lock the tracking motion to the x-y plane.\n";
|
||||
PyObject* KX_TrackToActuator::PySetUse3D(PyObject* args)
|
||||
{
|
||||
ShowDeprecationWarning("setTime()", "the use3D property");
|
||||
int boolArg;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "i:setUse3D", &boolArg)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
m_allow3D = !(boolArg == 0);
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
/* eof */
|
||||
|
@@ -75,19 +75,6 @@ class KX_TrackToActuator : public SCA_IActuator
|
||||
static PyObject* pyattr_get_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef);
|
||||
static int pyattr_set_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value);
|
||||
|
||||
/* 1. setObject */
|
||||
KX_PYMETHOD_DOC_O(KX_TrackToActuator,SetObject);
|
||||
/* 2. getObject */
|
||||
KX_PYMETHOD_DOC_VARARGS(KX_TrackToActuator,GetObject);
|
||||
/* 3. setTime */
|
||||
KX_PYMETHOD_DOC_VARARGS(KX_TrackToActuator,SetTime);
|
||||
/* 4. getTime */
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_TrackToActuator,GetTime);
|
||||
/* 5. getUse3D */
|
||||
KX_PYMETHOD_DOC_NOARGS(KX_TrackToActuator,GetUse3D);
|
||||
/* 6. setUse3D */
|
||||
KX_PYMETHOD_DOC_VARARGS(KX_TrackToActuator,SetUse3D);
|
||||
|
||||
}; /* end of class KX_TrackToActuator : public KX_EditObjectActuator */
|
||||
|
||||
#endif
|
||||
|
@@ -113,10 +113,6 @@ PyTypeObject KX_VisibilityActuator::Type = {
|
||||
};
|
||||
|
||||
PyMethodDef KX_VisibilityActuator::Methods[] = {
|
||||
// Deprecated ----->
|
||||
{"set", (PyCFunction) KX_VisibilityActuator::sPySetVisible, METH_VARARGS,
|
||||
(const char *) SetVisible_doc},
|
||||
// <-----
|
||||
{NULL,NULL} //Sentinel
|
||||
};
|
||||
|
||||
@@ -126,26 +122,3 @@ PyAttributeDef KX_VisibilityActuator::Attributes[] = {
|
||||
KX_PYATTRIBUTE_BOOL_RW("useRecursion", KX_VisibilityActuator, m_recursive),
|
||||
{ NULL } //Sentinel
|
||||
};
|
||||
|
||||
/* set visibility ---------------------------------------------------------- */
|
||||
const char
|
||||
KX_VisibilityActuator::SetVisible_doc[] =
|
||||
"setVisible(visible?)\n"
|
||||
"\t - visible? : Make the object visible? (KX_TRUE, KX_FALSE)"
|
||||
"\tSet the properties of the actuator.\n";
|
||||
PyObject*
|
||||
|
||||
KX_VisibilityActuator::PySetVisible(PyObject* args) {
|
||||
int vis;
|
||||
ShowDeprecationWarning("SetVisible()", "the visible property");
|
||||
|
||||
if(!PyArg_ParseTuple(args, "i:setVisible", &vis)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
m_visible = PyArgToBool(vis);
|
||||
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -67,11 +67,6 @@ class KX_VisibilityActuator : public SCA_IActuator
|
||||
/* Python interface ---------------------------------------------------- */
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
// Deprecated ----->
|
||||
KX_PYMETHOD_DOC_VARARGS(KX_VisibilityActuator,SetVisible);
|
||||
// <-----
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user