31 assert((NewWidth > 1.0f) && (NewHeight > 1.0f));
50 float length = TempPt.s.X * TempPt.s.X + TempPt.s.Y * TempPt.s.Y;
59 NewVec->s.X = TempPt.s.X *
norm;
60 NewVec->s.Y = TempPt.s.Y *
norm;
65 NewVec->s.X = TempPt.s.X;
66 NewVec->s.Y = TempPt.s.Y;
67 NewVec->s.Z =
FuncSqrt(1.0f - length);
72 0.0f, 1.0f, 0.0f, 0.0f,
73 0.0f, 0.0f, 1.0f, 0.0f,
74 0.0f, 0.0f, 0.0f, 1.0f}
126 if (Vector3fLength(&Perp) >
Epsilon)
129 NewRot->s.X = Perp.s.X;
130 NewRot->s.Y = Perp.s.Y;
131 NewRot->s.Z = Perp.s.Z;
133 NewRot->s.W = Vector3fDot(&a->
StVec, &a->
EnVec);
137 NewRot->s.X = NewRot->s.Y = NewRot->s.Z = NewRot->s.W = 0.0f;
static void click(ArcBall_t *a, const Point2fT *NewPt)
static void mapToSphere(ArcBall_t *a, const Point2fT *NewPt, Vector3fT *NewVec)
static void drag(ArcBall_t *a, const Point2fT *NewPt, Quat4fT *NewRot)
static void setBounds(ArcBall_t *a, float NewWidth, float NewHeight)
void init_arcBall(ArcBall_t *a, float NewWidth, float NewHeight)
static Matrix4fT Transform
static double norm(int n, const double *x)