예제 #1
0
void OBBMeshQuery::MouseCallback(int button, int state, int x, int y)
{
	mValidHit = false;
	if(!button && !state)
	{
		Point Dir = ComputeWorldRay(x, y);

		float d;
		Point hit;
		if(RayOBB(GetCameraPos(), Dir, mBox, d, hit))
		{
			mValidHit = true;
			mDist = d;
			mLocalHit = hit - mBox.mCenter;
		}
	}
}
예제 #2
0
bool IntersectionTest::OBBRay( const Volume* obbVolume, const Volume* rayVolume, glm::vec3* outIntersectionPoint )
{
	return RayOBB( rayVolume, obbVolume, outIntersectionPoint );
}