Subversion Repositories gelsvn

Rev

Rev 630 | Rev 650 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 630 Rev 647
Line 161... Line 161...
161
    }
161
    }
162
    
162
    
163
    // Scales integer point to the range [-1, 1]
163
    // Scales integer point to the range [-1, 1]
164
    Vec2f QuatTrackBall::scalePoint(const Vec2i& v) const
164
    Vec2f QuatTrackBall::scalePoint(const Vec2i& v) const
165
    {
165
    {
166
	Vec2f w(v[0],height - v[1]);
166
	Vec2f w(v[0], v[1]);
167
	w -= Vec2f(screen_centre);
167
	w -= Vec2f(screen_centre);
168
	w /= Vec2f(width,height);
168
	w /= Vec2f(width,height);
169
	w = CGLA::v_min(Vec2f(1.0f), CGLA::v_max(Vec2f(-1), 2*w));
169
	w = CGLA::v_min(Vec2f(1.0f), CGLA::v_max(Vec2f(-1), 2*w));
170
	return w; 
170
	return w; 
171
    }
171
    }