MCPcopy Create free account
hub / github.com/carbonengine/trinity / PyPickObjectAndAreaID

Function PyPickObjectAndAreaID

trinity/Eve/EveSpaceScene_Blue.cpp:48–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46
47#if BLUE_WITH_PYTHON
48PyObject* PyPickObjectAndAreaID( PyObject* self, PyObject* args )
49{
50 TriPythonContext pythonCtx;
51 EveSpaceScene* pThis = BluePythonCast<EveSpaceScene*>( self );
52
53 PyObject* pyProjection = NULL;
54 PyObject* pyView = NULL;
55 PyObject* pyViewport = NULL;
56
57 int x, y, flags = PICK_TYPE_PICKING | PICK_TYPE_OPAQUE;
58 if( !PyArg_ParseTuple( args, "iiOOO|i", &x, &y, &pyProjection, &pyView, &pyViewport, &flags ) )
59 return NULL;
60
61 TriProjection* projection = NULL;
62 if( !BlueExtractArgument( pyProjection, projection, 3 ) )
63 {
64 return NULL;
65 }
66
67 TriView* view = NULL;
68 if( !BlueExtractArgument( pyView, view, 4 ) )
69 {
70 return NULL;
71 }
72
73 TriViewport* viewport = NULL;
74 if( !BlueExtractArgument( pyViewport, viewport, 5 ) )
75 {
76 return NULL;
77 }
78
79 IRoot* object = NULL;
80 unsigned int areaID = 0;
81
82 USE_MAIN_THREAD_RENDER_CONTEXT();
83 object = pThis->PickObjectAndArea( x, y, projection, view, viewport, areaID, Tr2PickTypes( flags ), renderContext );
84
85 if( object )
86 {
87 PyObject* result = PyTuple_New( 2 );
88 PyTuple_SET_ITEM( result, 0, PyOS->WrapBlueObject( object ) );
89 PyTuple_SET_ITEM( result, 1, PyLong_FromUnsignedLong( areaID ) );
90 return result;
91 }
92
93 Py_INCREF( Py_None );
94 return Py_None;
95}
96#endif
97
98

Callers

nothing calls this directly

Calls 1

PickObjectAndAreaMethod · 0.80

Tested by

no test coverage detected