Files
assimp/samples/SimpleAssimpViewX/ModelLoaderHelperClasses.h
aramis_acg 6f1408a7f0 - update CHANGES.current.
- mark aiAnimMesh data structures as *NOT CURRENTLY USED*. They are, however, still contained and visible because some ports may be relying on their presence.
- add SimpleAssimpViewX sample provided by drparallax. Thanks! (http://sourceforge.net/projects/assimp/forums/forum/817654/topic/3917829)


git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@843 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
2010-11-21 14:57:00 +00:00

99 lines
2.6 KiB
Objective-C

//
// v002MeshHelper.h
// v002 Model Importer
//
// Created by vade on 9/26/10.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import <OpenGL/OpenGL.h>
#import "aiColor4D.h"
#import "aiVector3D.h"
#import "aiVector2D.h"
#import "aiMatrix4x4.h"
/* workflow:
1) create a new scene wrapper
2) populate an array of of meshHelpers for each mesh in the original scene
3) (eventually) create an animator instance
4) scale the asset (needed?)
5) create the asset data (GL resources, textures etc)
5a) for each mesh create a material instance
5b) create a static vertex buffer
5c) create index buffer
5d) populate the index buffer
5e) (eventually) gather weights
*/
#define BUFFER_OFFSET(i) ((char *)NULL + (i))
struct Vertex
{
aiVector3D vPosition;
aiVector3D vNormal;
aiColor4D dColorDiffuse;
aiVector3D vTangent;
aiVector3D vBitangent;
aiVector3D vTextureUV;
aiVector3D vTextureUV2;
unsigned char mBoneIndices[4];
unsigned char mBoneWeights[4]; // last Weight not used, calculated inside the vertex shader
};
// Helper Class to store GPU related resources from a given aiMesh
// Modeled after AssimpView asset helper
@interface MeshHelper : NSObject
{
// Display list ID, this one shots *all drawing* of the mesh. Only ever use this to draw. Booya.
GLuint displayList;
// VAO that encapsulates all VBO drawing state
GLuint vao;
// VBOs
GLuint vertexBuffer;
GLuint indexBuffer;
GLuint normalBuffer;
GLuint numIndices;
// texture
GLuint textureID;
// Material
aiColor4D diffuseColor;
aiColor4D specularColor;
aiColor4D ambientColor;
aiColor4D emissiveColor;
GLfloat opacity;
GLfloat shininess;
GLfloat specularStrength;
BOOL twoSided;
}
@property (readwrite, assign) GLuint vao;
@property (readwrite, assign) GLuint displayList;
@property (readwrite, assign) GLuint vertexBuffer;
@property (readwrite, assign) GLuint indexBuffer;
@property (readwrite, assign) GLuint normalBuffer;
@property (readwrite, assign) GLuint numIndices;
@property (readwrite, assign) GLuint textureID;
@property (readwrite, assign) aiColor4D* diffuseColor;
@property (readwrite, assign) aiColor4D* specularColor;
@property (readwrite, assign) aiColor4D* ambientColor;
@property (readwrite, assign) aiColor4D* emissiveColor;
@property (readwrite, assign) GLfloat opacity;
@property (readwrite, assign) GLfloat shininess;
@property (readwrite, assign) GLfloat specularStrength;
@property (readwrite, assign) BOOL twoSided;
@end