MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/PhysX / computeCameraRay

Method computeCameraRay

physx/samples/samplebase/Picking.cpp:92–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92void Picking::computeCameraRay(PxVec3& orig, PxVec3& dir, PxI32 x, PxI32 y) const
93{
94 const PxVec3& camPos = mFrame.getCamera().getPos();
95
96 // compute picking ray
97// const PxVec3 rayOrig = unProject(x, y, 0.0f); // PT: what the frell is that?
98 const PxVec3 rayOrig = camPos;
99 const PxVec3 rayDir = (unProject(x, y, 1.0f) - rayOrig).getNormalized();
100
101 orig = rayOrig;
102 dir = rayDir;
103}
104
105bool Picking::pick(int x, int y)
106{

Callers

nothing calls this directly

Calls 3

getPosMethod · 0.45
getCameraMethod · 0.45
getNormalizedMethod · 0.45

Tested by

no test coverage detected