Subversion Repositories gelsvn

Rev

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

Rev 178 Rev 204
Line 98... Line 98...
98
    
98
    
99
    void QuatTrackBall::calcRotation(const Vec2f& new_pos) 
99
    void QuatTrackBall::calcRotation(const Vec2f& new_pos) 
100
    {
100
    {
101
	// Check for zero rotation
101
	// Check for zero rotation
102
	if (new_pos == last_pos) 
102
	if (new_pos == last_pos) 
103
	    qinc = Quaternion();
103
	    qinc = Quaternion(0.0f, 0.0f, 0.0f, 1.0f);
104
	else
104
	else
105
	{
105
	{
106
		// Form two vectors based on input points, find rotation axis
106
		// Form two vectors based on input points, find rotation axis
107
		Vec3f p1 = Vec3f(new_pos[0], new_pos[1], projectToSphere(new_pos));
107
		Vec3f p1 = Vec3f(new_pos[0], new_pos[1], projectToSphere(new_pos));
108
		Vec3f p2 = Vec3f(last_pos[0], last_pos[1], projectToSphere(last_pos));
108
		Vec3f p2 = Vec3f(last_pos[0], last_pos[1], projectToSphere(last_pos));