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

Method PyUpdateQuaternion

trinity/TriPythonThunkers.cpp:241–266  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239/////////////////////////////////////////////////////////////////////////////////////////
240
241PyObject* ITriQuaternionFunction_Thunk::PyUpdateQuaternion( PyObject* args )
242{
243 PyObject* t;
244 if( !PyArg_ParseTuple( args, "O", &t ) )
245 return NULL;
246
247 ITriQuaternionPtr q;
248 q.Attach( new OTriQuaternion );
249
250 if( PyLong_Check( t ) )
251 {
252 Quaternion tmpResult;
253 q->SetQuaternion( Update( &tmpResult, Be::Time( PyLong_AsLongLong( t ) ) ) );
254 }
255 else if( PyFloat_Check( t ) )
256 {
257 Quaternion tmpResult;
258 q->SetQuaternion( Update( &tmpResult, PyFloat_AS_DOUBLE( t ) ) );
259 }
260 else
261 {
262 BeOS->SetError( BEDEF, Clsid(), "arg must be of type LongLong (Be::Time) or float" );
263 return nullptr;
264 }
265 return PyOS->WrapBlueObject( q );
266}
267
268
269PyObject* ITriQuaternionFunction_Thunk::PyGetQuaternionAt( PyObject* args )

Callers

nothing calls this directly

Calls 2

SetQuaternionMethod · 0.80
AttachMethod · 0.45

Tested by

no test coverage detected