#include "glcompdefs.h"
+#define ARCBALL_C
#include "arcball.h"
#include "smyrnadefs.h"
-
-
-
-
-
-
-
void setBounds(ArcBall_t* a,GLfloat NewWidth, GLfloat NewHeight)
{
assert((NewWidth > 1.0f) && (NewHeight > 1.0f));
}
}
-//Create/Destroy
-void init_arcBall(ArcBall_t* a,GLfloat NewWidth, GLfloat NewHeight)
-{
-
- Matrix4fT Transform = { 1.0f, 0.0f, 0.0f, 0.0f, // NEW: Final Transform
+static Matrix4fT Transform = {{ 1.0f, 0.0f, 0.0f, 0.0f, // NEW: Final Transform
0.0f, 1.0f, 0.0f, 0.0f,
0.0f, 0.0f, 1.0f, 0.0f,
- 0.0f, 0.0f, 0.0f, 1.0f };
+ 0.0f, 0.0f, 0.0f, 1.0f }};
- Matrix3fT LastRot = { 1.0f, 0.0f, 0.0f, // NEW: Last Rotation
+static Matrix3fT LastRot = {{ 1.0f, 0.0f, 0.0f, // NEW: Last Rotation
0.0f, 1.0f, 0.0f,
- 0.0f, 0.0f, 1.0f };
+ 0.0f, 0.0f, 1.0f }};
- Matrix3fT ThisRot = { 1.0f, 0.0f, 0.0f, // NEW: This Rotation
+static Matrix3fT ThisRot = {{ 1.0f, 0.0f, 0.0f, // NEW: This Rotation
0.0f, 1.0f, 0.0f,
- 0.0f, 0.0f, 1.0f };
-
-
+ 0.0f, 0.0f, 1.0f }};
+
+//Create/Destroy
+void init_arcBall(ArcBall_t* a,GLfloat NewWidth, GLfloat NewHeight)
+{
a->Transform=Transform;
a->LastRot=LastRot;
a->ThisRot=ThisRot;
typedef union Matrix3f_t
{
+ GLfloat M[9];
struct
{
//column major
union { GLfloat M12; GLfloat ZY; }; //ZAxis.Y
union { GLfloat M22; GLfloat ZZ; GLfloat SZ; }; //ZAxis.Z and Scale Z
} s;
- GLfloat M[9];
} Matrix3fT; //A single precision floating point 3 by 3 matrix.
typedef union Matrix4f_t
{
+ GLfloat M[16];
struct
{
//column major
union { GLfloat M23; GLfloat TZ; }; //Trans.Z
union { GLfloat M33; GLfloat TW; GLfloat SW; }; //Trans.W and Scale W
} s;
- GLfloat M[16];
} Matrix4fT; //A single precision floating point 4 by 4 matrix.