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

Method PyUnproject

trinity/TriVector.cpp:363–377  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

361}
362
363void TriVector::PyUnproject(
364 TriViewport* vp,
365 ITriMatrix* project,
366 ITriMatrix* view,
367 ITriMatrix* world )
368{
369 Vector3 preViewport;
370 x = 2.0f * ( x - vp->x ) / vp->width - 1.0f;
371 y = 1.0f - 2.0f * ( y - vp->y ) / vp->height;
372 z = ( z - vp->minZ ) / ( vp->maxZ - vp->minZ );
373
374 Matrix worldViewProjInv = Inverse( *world->GetMatrix() * *view->GetMatrix() * *project->GetMatrix() );
375
376 *static_cast<Vector3*>( this ) = TransformCoord( *this, worldViewProjInv );
377}
378
379void TriVector::PyTransformQuaternion( ITriQuaternion* rotation )
380{

Callers

nothing calls this directly

Calls 1

GetMatrixMethod · 0.80

Tested by

no test coverage detected