1//
2//  v002MeshHelper.m
3//  v002 Model Importer
4//
5//  Created by vade on 9/26/10.
6//  Copyright 2010 __MyCompanyName__. All rights reserved.
7//
8
9#import "ModelLoaderHelperClasses.h"
10
11
12@implementation MeshHelper
13
14@synthesize vao;
15@synthesize displayList;
16
17@synthesize vertexBuffer;
18@synthesize indexBuffer;
19@synthesize normalBuffer;
20@synthesize numIndices;
21
22@synthesize textureID;
23
24@dynamic diffuseColor;
25@dynamic specularColor;
26@dynamic ambientColor;
27@dynamic emissiveColor;
28
29@synthesize opacity;
30@synthesize shininess;
31@synthesize specularStrength;
32@synthesize twoSided;
33
34- (id) init
35{
36    if((self = [super init]))
37    {
38        diffuseColor = aiColor4D(0.8, 0.8, 0.8, 1.0);
39        specularColor = aiColor4D(0.0f, 0.0f, 0.0f, 1.0f);
40        ambientColor = aiColor4D(0.2f, 0.2f, 0.2f, 1.0f);
41        emissiveColor = aiColor4D(0.0f, 0.0f, 0.0f, 1.0f);
42    }
43    return self;
44}
45
46- (void) setDiffuseColor:(aiColor4D*) color;
47{
48    diffuseColor.r = color->r;
49    diffuseColor.g = color->g;
50    diffuseColor.b = color->b;
51    diffuseColor.a = color->a;
52}
53
54- (aiColor4D*) diffuseColor
55{
56    return &diffuseColor;
57}
58
59- (void) setSpecularColor:(aiColor4D*) color;
60{
61    specularColor.r = color->r;
62    specularColor.g = color->g;
63    specularColor.b = color->b;
64    specularColor.a = color->a;
65}
66
67- (aiColor4D*) specularColor
68{
69    return &specularColor;
70}
71
72- (void) setAmbientColor:(aiColor4D*) color;
73{
74    ambientColor.r = color->r;
75    ambientColor.g = color->g;
76    ambientColor.b = color->b;
77    ambientColor.a = color->a;
78}
79
80- (aiColor4D*) ambientColor
81{
82    return &ambientColor;
83}
84
85- (void) setEmissiveColor:(aiColor4D*) color;
86{
87    emissiveColor.r = color->r;
88    emissiveColor.g = color->g;
89    emissiveColor.b = color->b;
90    emissiveColor.a = color->a;
91}
92
93- (aiColor4D*) emissiveColor
94{
95    return &emissiveColor;
96}
97
98
99@end
100