//
//  OBJModel.h
//  Lesson37_OSXCocoa
//
//  Created by Will Thimbleby on Mon Sep 01 2003.
//  Copyright (c) 2003 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#include <OpenGL/glext.h>
#import "MTLLoader.h"

#define _NEWTON_USE_LIB 1
#import "newton.h"

#if defined(__cplusplus)
#import "Vector.h"
#endif

extern GLuint shaderTexture;          // Storage For One Texture

#if defined(__cplusplus)
typedef struct
{
	float		u, v;
}TextureUV;

typedef struct
{
	Vector			normal;
	int				vertex[3];
	int				normals[3];
	int				texture[3];
	MTLMaterial*	material;
	
	int				neighbours[3];
	BOOL			visible;
}Face;

typedef struct
{
	int			vertex[3];
}Triangle;

#endif

@interface OBJModel : NSObject
{    
	MTLLoader		*materialLoader;

#if defined(__cplusplus)
    Vector			vertices[3000];
    Vector			normals[3000];
	TextureUV		textures[3000];
    Face			faces[3000];
    Triangle		triangles[3000];
#endif
	
	int			vertexCount;
	int			normalCount;
	int			textureCount;
	int			faceCount;
	int			triangleCount;
	
	GLuint 		model, shadowList;
	
	NewtonCollision* collision;
}


- (NewtonCollision*)newtonCollision;

@end
