Inherits from NSObject
Conforms to NGLIterator
NGLMaterial
NSFastEnumeration
Declared in NGLMaterialMulti.h

Overview

Multi/Sub instance of NGLMaterial.

NGLMaterialMulti is a special kind of NGLMaterial and represents a collection of multiple materials. It allows you to create many materials onto one single mesh. So you can use many shaders behaviors using the same mesh instance.

Tasks

Class Methods

materialMultiWithMaterial:

Returns an autorelease instance of NGLMaterialMulti.

+ (id)materialMultiWithMaterial:(NGLMaterial *)first

Parameters

first

The first material to be added.

Return Value

A NGLMaterialMulti autoreleased instance.

Discussion

Returns an autorelease instance of NGLMaterialMulti.

This method creates a material library with one material inside of it.

See Also

Declared In

NGLMaterialMulti.h

Instance Methods

addMaterial:

Adds a NGLMaterial instance to this material library.

- (void)addMaterial:(NGLMaterial *)item

Parameters

item

The NGLMaterial instance to add.

Discussion

Adds a NGLMaterial instance to this material library.

The NGLMaterial instance will be internally retained.

See Also

Declared In

NGLMaterialMulti.h

addNGLMaterialMulti:copyItems:

Adds a set of NGLMaterial instances to this material library.

- (void)addNGLMaterialMulti:(NGLMaterialMulti *)multi copyItems:(BOOL)flag

Parameters

multi

A NGLMaterialMulti instance.

flag

Specifies if the new items will be copied or just retained.

Discussion

Adds a set of NGLMaterial instances to this material library.

Just as the addMaterial: method, every NGLMaterial will be internally retained.

See Also

Declared In

NGLMaterialMulti.h

count

Returns the number of instances in this library at the moment.

- (unsigned int)count

Return Value

An unsigned int data type.

Discussion

Returns the number of instances in this library at the moment.

Declared In

NGLMaterialMulti.h

hasMaterial:

Checks if a material exists in this library.

- (BOOL)hasMaterial:(NGLMaterial *)item

Parameters

item

The NGLMaterial to search for.

Discussion

Checks if a material exists in this library.

See Also

Declared In

NGLMaterialMulti.h

initWithMaterialKind:

Initiates a material library based NGLMaterial protocol.

- (id)initWithMaterialKind:(id<NGLMaterial>)material

Parameters

material

An object that conforms with the NGLMaterial protocol.

Return Value

A NGLMaterialMulti instance.

Discussion

Initiates a material library based NGLMaterial protocol.

This method will check if the informed object is a simple NGLMaterial or a NGLMaterialMulti and will automatically retain its items.

See Also

Declared In

NGLMaterialMulti.h

initWithMaterials:

Initiates a material library based on many NGLMaterial instances.

- (id)initWithMaterials:(NGLMaterial *)first, ...

Parameters

first

The first material to be added.

...

A sequence of NGLMaterial instances separated by commas. This method must end with a nil element.

Return Value

A NGLMaterialMulti instance.

Discussion

Initiates a material library based on many NGLMaterial instances.

This method initializes a material library and puts many materials into it.

See Also

Declared In

NGLMaterialMulti.h

materialWithIdentifier:

Returns a material by its identifier.

- (NGLMaterial *)materialWithIdentifier:(unsigned int)identifier

Parameters

identifier

The identifier to search for.

Return Value

The pointer to the object in this library.

Discussion

Returns a material by its identifier.

This method returns a NGLMaterial. If the identifier was not found, then this method returns nil. If more than one material has the same identifier, only the first occurence will be returned.

See Also

Declared In

NGLMaterialMulti.h

materialWithName:

Returns a material by its name.

- (NGLMaterial *)materialWithName:(NSString *)name

Parameters

name

A NSString containing the material’s name to search for.

Return Value

The pointer to the object in this library.

Discussion

Returns a material by its name.

This method returns a NGLMaterial. If the identifier was not found, then this method returns nil. If more than one material has the same name, only the first occurence will be returned.

See Also

Declared In

NGLMaterialMulti.h

removeAll

Removes all materials in this library. All the materials will receive a release message.

- (void)removeAll

Discussion

Removes all materials in this library. All the materials will receive a release message.

If there is no material in this library, this method does nothing.

Declared In

NGLMaterialMulti.h