39#define FACE GL_FRONT_AND_BACK
44- (id)initWithName:(NSString *)name
51 [
self setDiffuseRed:1.0f green:1.0f blue:1.0f alpha:1.0f];
52 [
self setAmbientRed:1.0f green:1.0f blue:1.0f alpha:1.0f];
60- (id)initWithName:(NSString *)name configuration:(NSDictionary *)configuration
65 self = [
self initWithName:name];
68 if (configuration ==
nil) configuration = [NSDictionary dictionary];
70 colorDesc = [configuration oo_diffuseColor];
73 colorDesc = [configuration oo_ambientColor];
75 else [
self setAmbientColor:[
self diffuseColor]];
77 colorDesc = [configuration oo_emissionColor];
80 specularExponent = [configuration oo_specularExponent];
83 colorDesc = [configuration oo_specularColor];
84 [
self setShininess:specularExponent];
95 [materialName release];
142- (void)setDiffuseColor:(
OOColor *)color
154- (void)setAmbientAndDiffuseColor:(
OOColor *)color
156 [
self setAmbientColor:color];
157 [
self setDiffuseColor:color];
170- (void)setSpecularColor:(
OOColor *)color
191- (void)setAmbientColor:(
OOColor *)color
212- (void)setEmissionColor:(
OOColor *)color
224- (void)getDiffuseComponents:(GLfloat[4])outComponents
226 memcpy(outComponents,
diffuse, 4 *
sizeof *outComponents);
230- (void)setDiffuseComponents:(const GLfloat[4])components
232 memcpy(
diffuse, components, 4 *
sizeof *components);
236- (void)setAmbientAndDiffuseComponents:(const GLfloat[4])components
238 [
self setAmbientComponents:components];
239 [
self setDiffuseComponents:components];
243- (void)getSpecularComponents:(GLfloat[4])outComponents
245 memcpy(outComponents,
specular, 4 *
sizeof *outComponents);
249- (void)setSpecularComponents:(const GLfloat[4])components
251 memcpy(
specular, components, 4 *
sizeof *components);
255- (void)getAmbientComponents:(GLfloat[4])outComponents
257 memcpy(outComponents,
ambient, 4 *
sizeof *outComponents);
261- (void)setAmbientComponents:(const GLfloat[4])components
263 memcpy(
ambient, components, 4 *
sizeof *components);
267- (void)getEmissionComponents:(GLfloat[4])outComponents
269 memcpy(outComponents,
emission, 4 *
sizeof *outComponents);
273- (void)setEmissionComponents:(const GLfloat[4])components
275 memcpy(
emission, components, 4 *
sizeof *components);
279- (void)setDiffuseRed:(GLfloat)r green:(GLfloat)g blue:(GLfloat)b alpha:(GLfloat)a
288- (void)setAmbientAndDiffuseRed:(GLfloat)r green:(GLfloat)g blue:(GLfloat)b alpha:(GLfloat)a
290 [
self setAmbientRed:r green:g blue:b alpha:a];
291 [
self setDiffuseRed:r green:g blue:b alpha:a];
295- (void)setSpecularRed:(GLfloat)r green:(GLfloat)g blue:(GLfloat)b alpha:(GLfloat)a
304- (void)setAmbientRed:(GLfloat)r green:(GLfloat)g blue:(GLfloat)b alpha:(GLfloat)a
313- (void)setEmissionRed:(GLfloat)r green:(GLfloat)g blue:(GLfloat)b alpha:(GLfloat)a
329- (void)setShininess:(uint8_t)value
337 return ![UNIVERSE reducedDetail];