mirror of
https://github.com/PixarAnimationStudios/OpenSubdiv
synced 2024-12-25 01:01:15 +00:00
Fixed a couple build issues with Visual Studio 2010
This commit is contained in:
parent
732cb10fe0
commit
4168e5788d
@ -44,9 +44,9 @@ multMatrix(float *d, const float *a, const float *b)
|
||||
//
|
||||
// Create a perspective projection matrix
|
||||
//
|
||||
void setPersp( GLdouble fov, GLdouble aspect, GLdouble znear, GLdouble zfar, float* m )
|
||||
void setPersp( float fov, float aspect, float znear, float zfar, float* m )
|
||||
{
|
||||
float xymax = znear * tan(fov * 3.141592653589793238462 / 360.);
|
||||
float xymax = znear * tanf(fov * 3.141592653589793238462f / 360.f);
|
||||
float ymin = -xymax;
|
||||
float xmin = -xymax;
|
||||
|
||||
@ -62,24 +62,24 @@ void setPersp( GLdouble fov, GLdouble aspect, GLdouble znear, GLdouble zfar, flo
|
||||
float h = 2 * znear / height;
|
||||
|
||||
m[0] = w;
|
||||
m[1] = 0;
|
||||
m[2] = 0;
|
||||
m[3] = 0;
|
||||
m[1] = 0.f;
|
||||
m[2] = 0.f;
|
||||
m[3] = 0.f;
|
||||
|
||||
m[4] = 0;
|
||||
m[4] = 0.f;
|
||||
m[5] = h;
|
||||
m[6] = 0;
|
||||
m[7] = 0;
|
||||
m[6] = 0.f;
|
||||
m[7] = 0.f;
|
||||
|
||||
m[8] = 0;
|
||||
m[9] = 0;
|
||||
m[8] = 0.f;
|
||||
m[9] = 0.f;
|
||||
m[10] = q;
|
||||
m[11] = -1;
|
||||
|
||||
m[12] = 0;
|
||||
m[13] = 0;
|
||||
m[12] = 0.f;
|
||||
m[13] = 0.f;
|
||||
m[14] = qn;
|
||||
m[15] = 0;
|
||||
m[15] = 0.f;
|
||||
}
|
||||
|
||||
//
|
||||
@ -99,7 +99,7 @@ translateMatrix(float x, float y, float z, float* m)
|
||||
void
|
||||
rotateMatrix(float angle, float x, float y, float z, float* m)
|
||||
{
|
||||
float rads = (2*3.14159 / 360.) * angle;
|
||||
float rads = float((2*3.14159 / 360.) * angle);
|
||||
float c = cosf(rads);
|
||||
float s = sinf(rads);
|
||||
float xx = x * x;
|
||||
|
@ -193,8 +193,8 @@ setupForDisplay(int width, int height, float size, float* center)
|
||||
setIdentity(g_mvp);
|
||||
|
||||
// setup the projection
|
||||
double aspect = width/(double)height;
|
||||
setPersp(45.0, aspect, 0.01, 500.0, g_proj);
|
||||
float aspect = width/(float)height;
|
||||
setPersp(45.0f, aspect, 0.01f, 500.0f, g_proj);
|
||||
|
||||
// setup the model view matrix
|
||||
translateMatrix(-center[0], -center[1], -center[2], g_modelView);
|
||||
|
@ -237,14 +237,14 @@ createOsdMesh(int level, int kernel)
|
||||
// Now that we have a mesh, we need to add verticies and define the topology.
|
||||
// Here, we've declared the raw vertex data in-line, for simplicity
|
||||
//
|
||||
float verts[] = { 0.000000, -1.414214, 1.000000,
|
||||
1.414214, 0.000000, 1.000000,
|
||||
-1.414214, 0.000000, 1.000000,
|
||||
0.000000, 1.414214, 1.000000,
|
||||
-1.414214, 0.000000, -1.000000,
|
||||
0.000000, 1.414214, -1.000000,
|
||||
0.000000, -1.414214, -1.000000,
|
||||
1.414214, 0.000000, -1.000000
|
||||
float verts[] = { 0.000000f, -1.414214f, 1.000000f,
|
||||
1.414214f, 0.000000f, 1.000000f,
|
||||
-1.414214f, 0.000000f, 1.000000f,
|
||||
0.000000f, 1.414214f, 1.000000f,
|
||||
-1.414214f, 0.000000f, -1.000000f,
|
||||
0.000000f, 1.414214f, -1.000000f,
|
||||
0.000000f, -1.414214f, -1.000000f,
|
||||
1.414214f, 0.000000f, -1.000000f
|
||||
};
|
||||
|
||||
//
|
||||
|
Loading…
Reference in New Issue
Block a user