361
360
PyMethodDef KX_CameraActuator::Methods[] = {
361
{"setObject",(PyCFunction) KX_CameraActuator::sPySetObject, METH_VARARGS, SetObject_doc},
362
{"getObject",(PyCFunction) KX_CameraActuator::sPyGetObject, METH_NOARGS, GetObject_doc},
363
{"setMin" ,(PyCFunction) KX_CameraActuator::sPySetMin, METH_VARARGS, SetMin_doc},
364
{"getMin" ,(PyCFunction) KX_CameraActuator::sPyGetMin, METH_NOARGS, GetMin_doc},
365
{"setMax" ,(PyCFunction) KX_CameraActuator::sPySetMax, METH_VARARGS, SetMax_doc},
366
{"getMax" ,(PyCFunction) KX_CameraActuator::sPyGetMax, METH_NOARGS, GetMax_doc},
367
{"setHeight",(PyCFunction) KX_CameraActuator::sPySetHeight, METH_VARARGS, SetHeight_doc},
368
{"getHeight",(PyCFunction) KX_CameraActuator::sPyGetHeight, METH_NOARGS, GetHeight_doc},
369
{"setXY" ,(PyCFunction) KX_CameraActuator::sPySetXY, METH_VARARGS, SetXY_doc},
370
{"getXY" ,(PyCFunction) KX_CameraActuator::sPyGetXY, METH_VARARGS, GetXY_doc},
362
371
{NULL,NULL,NULL,NULL} //Sentinel
365
374
PyObject* KX_CameraActuator::_getattr(const STR_String& attr) {
366
375
_getattr_up(SCA_IActuator);
377
/* get obj ---------------------------------------------------------- */
378
char KX_CameraActuator::GetObject_doc[] =
380
"\tReturns the object this sensor reacts to.\n";
381
PyObject* KX_CameraActuator::PyGetObject(PyObject* self,
385
return PyString_FromString(m_ob->GetName());
387
/* set obj ---------------------------------------------------------- */
388
char KX_CameraActuator::SetObject_doc[] =
390
"\tSets the object this sensor reacts to.\n";
391
PyObject* KX_CameraActuator::PySetObject(PyObject* self,
397
if (PyArg_ParseTuple(args, "O!", &KX_GameObject::Type, &gameobj))
399
m_ob = (CValue*)gameobj;
405
if (PyArg_ParseTuple(args, "s", &objectname))
407
CValue *object = (CValue*)SCA_ILogicBrick::m_sCurrentLogicManager->GetGameObjectByName(STR_String(objectname));
418
/* get min ---------------------------------------------------------- */
419
char KX_CameraActuator::GetMin_doc[] =
421
"\tReturns the minimum value set in the Min: field.\n";
422
PyObject* KX_CameraActuator::PyGetMin(PyObject* self,
426
return PyFloat_FromDouble(m_minHeight);
428
/* set min ---------------------------------------------------------- */
429
char KX_CameraActuator::SetMin_doc[] =
431
"\tSets the minimum value.\n";
432
PyObject* KX_CameraActuator::PySetMin(PyObject* self,
437
if(PyArg_ParseTuple(args,"f", &min))
444
/* get min ---------------------------------------------------------- */
445
char KX_CameraActuator::GetMax_doc[] =
447
"\tReturns the maximum value set in the Max: field.\n";
448
PyObject* KX_CameraActuator::PyGetMax(PyObject* self,
452
return PyFloat_FromDouble(m_maxHeight);
454
/* set min ---------------------------------------------------------- */
455
char KX_CameraActuator::SetMax_doc[] =
457
"\tSets the maximum value.\n";
458
PyObject* KX_CameraActuator::PySetMax(PyObject* self,
463
if(PyArg_ParseTuple(args,"f", &max))
470
/* get height ---------------------------------------------------------- */
471
char KX_CameraActuator::GetHeight_doc[] =
473
"\tReturns the height value set in the height: field.\n";
474
PyObject* KX_CameraActuator::PyGetHeight(PyObject* self,
478
return PyFloat_FromDouble(m_height);
480
/* set height ---------------------------------------------------------- */
481
char KX_CameraActuator::SetHeight_doc[] =
483
"\tSets the height value.\n";
484
PyObject* KX_CameraActuator::PySetHeight(PyObject* self,
489
if(PyArg_ParseTuple(args,"f", &height))
496
/* set XY ---------------------------------------------------------- */
497
char KX_CameraActuator::SetXY_doc[] =
499
"\tSets axis the camera tries to get behind.\n"
501
PyObject* KX_CameraActuator::PySetXY(PyObject* self,
506
if(PyArg_ParseTuple(args,"i", &value))
514
/* get XY -------------------------------------------------------------*/
515
char KX_CameraActuator::GetXY_doc[] =
517
"\tGets the axis the camera tries to get behind.\n"
518
"\tTrue = X, False = Y\n";
519
PyObject* KX_CameraActuator::PyGetXY(PyObject* self,
523
return PyInt_FromLong(m_x);