Inherits from NSObject
Conforms to NGLSurface
Declared in NGLSurface.h

Overview

The instructions to cover a mesh.

NGLSurface is something very abstract, but it’s a very important part in the shader creation process. It’s like a blue print that defines and delimits the area of each material onto the mesh. NGLSurface is organized by its identifier (ID). Each ID must match with the desired material and custom shader. For example:


NGLMaterial ID            NGLShaders ID             NGLSurface ID
       1      ---------->       1      ----------->       1

                 |------------------------------|
       2      ---|              3      ------|  |->       2
                    |------------------------|
                    |                        |
       3      ------|           4      ---|  |---->       3
                                          |
                                          |
       7                        7         |------->       4

The NGLSurface is the coordinator to construct the surface of a mesh. As in the example above, if a NGLMaterial or NGLShaders doesn’t have the same ID as NGLSurface, they will be ignored in the mesh’s compilation process.

If no NGLSurface was specified, a default NGLSurface will be used. The default NGLSurface always cover the entire mesh.

Tasks

Properties

identifier

The identifier of this object.

@property (nonatomic) unsigned int identifier

Discussion

The identifier of this object.

Declared In

NGLSurface.h

lengthData

Represents the length, in elements, of this surface on the mesh’s array of indices.

@property (nonatomic) unsigned int lengthData

Discussion

Represents the length, in elements, of this surface on the mesh’s array of indices.

Declared In

NGLSurface.h

startData

Represents the starting index inside of this surface on the mesh’s array of indices.

@property (nonatomic) unsigned int startData

Discussion

Represents the starting index inside of this surface on the mesh’s array of indices.

Declared In

NGLSurface.h

Class Methods

surface

Returns an autorelease instance of NGLSurface.

+ (id)surface

Return Value

A NGLSurface autoreleased instance.

Discussion

Returns an autorelease instance of NGLSurface.

This method creates a surface using the default NGLSurface.

Declared In

NGLSurface.h

surfacetWithStart:length:identifier:

Returns an autorelease instance of NGLSurface.

+ (id)surfacetWithStart:(unsigned int)start length:(unsigned int)length identifier:(unsigned int)newId

Parameters

start

The starting index for data.

length

The length of data.

newId

The identifier to this instance.

Return Value

A NGLSurface autoreleased instance.

Discussion

Returns an autorelease instance of NGLSurface.

This method creates a surface. This method sets a starting index to it, a length data and an identifier.

Declared In

NGLSurface.h

Instance Methods

initWithStart:length:identifier:

Initiates a new instance with a start data, length data and an identifier.

- (id)initWithStart:(unsigned int)start length:(unsigned int)length identifier:(unsigned int)newId

Parameters

start

The starting index for data.

length

The length of data.

newId

The identifier to this instance.

Return Value

A new initialized instance.

Discussion

Initiates a new instance with a start data, length data and an identifier.

Declared In

NGLSurface.h