File: ModelLoaderHelperClasses.mm

package info (click to toggle)
assimp 5.4.3%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 100,104 kB
  • sloc: cpp: 164,162; cobol: 65,664; ansic: 16,520; xml: 11,246; python: 5,311; java: 2,303; sh: 398; objc: 122; pascal: 100; makefile: 66
file content (99 lines) | stat: -rw-r--r-- 1,833 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
//
//  v002MeshHelper.m
//  v002 Model Importer
//
//  Created by vade on 9/26/10.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import "ModelLoaderHelperClasses.h"


@implementation MeshHelper

@synthesize vao;
@synthesize displayList;

@synthesize vertexBuffer;
@synthesize indexBuffer;
@synthesize normalBuffer;
@synthesize numIndices;

@synthesize textureID;

@dynamic diffuseColor;
@dynamic specularColor;
@dynamic ambientColor;
@dynamic emissiveColor;

@synthesize opacity;
@synthesize shininess;
@synthesize specularStrength;
@synthesize twoSided;

- (id) init
{
    if((self = [super init]))
    {
        diffuseColor = aiColor4D(0.8, 0.8, 0.8, 1.0);
        specularColor = aiColor4D(0.0f, 0.0f, 0.0f, 1.0f);
        ambientColor = aiColor4D(0.2f, 0.2f, 0.2f, 1.0f);
        emissiveColor = aiColor4D(0.0f, 0.0f, 0.0f, 1.0f);
    }
    return self; 
}

- (void) setDiffuseColor:(aiColor4D*) color;
{
    diffuseColor.r = color->r;
    diffuseColor.g = color->g;
    diffuseColor.b = color->b;
    diffuseColor.a = color->a;
}

- (aiColor4D*) diffuseColor
{
    return &diffuseColor;
}

- (void) setSpecularColor:(aiColor4D*) color;
{
    specularColor.r = color->r;
    specularColor.g = color->g;
    specularColor.b = color->b;
    specularColor.a = color->a;
}

- (aiColor4D*) specularColor
{
    return &specularColor;
}

- (void) setAmbientColor:(aiColor4D*) color;
{
    ambientColor.r = color->r;
    ambientColor.g = color->g;
    ambientColor.b = color->b;
    ambientColor.a = color->a;
}

- (aiColor4D*) ambientColor
{
    return &ambientColor;
}

- (void) setEmissiveColor:(aiColor4D*) color;
{
    emissiveColor.r = color->r;
    emissiveColor.g = color->g;
    emissiveColor.b = color->b;
    emissiveColor.a = color->a;
}

- (aiColor4D*) emissiveColor
{
    return &emissiveColor;
}


@end