Example #1
0
Socket* Grid::getSocketAtCoordinates( const int x, const int y )
{
	Socket* selectedSocket = NULL;
	
	if( withinBound( x, y ) )
	{
		int column = getColumnFromXCoord(x);
		int row = getRowFromYCoord(y);
		selectedSocket = getSocketAtRowColumn(row, column);
	}
	return selectedSocket;
}
double SAngleDownloadPlanner::calculatePriority(ProxyObjectPtr proxy)
{
    if (camera == NULL || !proxy) return 0;

    float radius = proxy->bounds().radius();
    Vector3d objLoc(proxy->location().position());
    Vector3d cameraLoc = camera->getPosition();

    if (withinBound(radius, objLoc, cameraLoc)) return 0.99;

    Vector3d diff = cameraLoc - objLoc;
    SolidAngle sa = SolidAngle::fromCenterRadius((Vector3f)diff, radius);
    float priority = (sa.asFloat())/(SolidAngle::Max.asFloat());
    return (double)priority;
}