Oolite
Loading...
Searching...
No Matches
OOMesh.m File Reference
Include dependency graph for OOMesh.m:

Go to the source code of this file.

Classes

struct  VertexFaceRef
category  OOMesh(Private)
category  OOCacheManager(OOMesh)

Macros

#define ADAPTIVE_OCTREE_DEPTH   1
#define SCRIBBLE   0
#define PROFILE(tag)
#define Scribble(bytes, size)

Typedefs

typedef struct VertexFaceRef VertexFaceRef

Enumerations

enum  { kBaseOctreeDepth = 5 , kSmallOctreeDepth = 4 , kOctreeSizeThreshold = 900 , kOctreeSmallSizeThreshold = 20 }
enum  OOMeshNormalMode { kNormalModePerFace , kNormalModeSmooth , kNormalModeExplicit }
enum  { kVertexFaceDefInternalCount = 5 }

Functions

static void VFRAddFace (VertexFaceRef *vfr, NSUInteger index)
static NSUInteger VFRGetCount (VertexFaceRef *vfr)
static NSUInteger VFRGetFaceAtIndex (VertexFaceRef *vfr, NSUInteger index)
static BOOL IsLegacyNormalMode (OOMeshNormalMode mode)
static BOOL IsPerVertexNormalMode (OOMeshNormalMode mode)

Variables

static NSString *const kOOLogMeshDataNotFound = @"mesh.load.failed.fileNotFound"
static NSString *const kOOLogMeshTooManyMaterials = @"mesh.load.failed.tooManyMaterials"
static NSString *const kOOCacheMeshes = @"@"OOMesh"
static NSString *const kOOCacheOctrees = @"@"octrees"

Macro Definition Documentation

◆ ADAPTIVE_OCTREE_DEPTH

#define ADAPTIVE_OCTREE_DEPTH   1

Definition at line 60 of file OOMesh.m.

◆ PROFILE

#define PROFILE ( tag)
Value:
do { \
} while (0)

Definition at line 94 of file OOMesh.m.

94#define PROFILE(tag) \
95 do { \
96 } while (0)

Referenced by OOMesh(Private)::initWithName:cacheKey:materialDictionary:shadersDictionary:smooth:shaderMacros:shaderBindingTarget:scaleFactor:cacheWriteable:, and OOMesh(Private)::loadData:scaleFactor:.

◆ SCRIBBLE

#define SCRIBBLE   0

Definition at line 63 of file OOMesh.m.

◆ Scribble

#define Scribble ( bytes,
size )
Value:
do { \
} while (0)

Definition at line 1933 of file OOMesh.m.

1933#define Scribble(bytes, size) \
1934 do { \
1935 } while (0)

Referenced by OOMesh(Private)::allocateBytesWithSize:count:key:.

Typedef Documentation

◆ VertexFaceRef

typedef struct VertexFaceRef VertexFaceRef

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
kVertexFaceDefInternalCount 

Definition at line 106 of file OOMesh.m.

106 {
107#if OOLITE_64_BIT
108 kVertexFaceDefInternalCount = 11 // sizeof (VertexFaceRef) = 32
109#else
110 kVertexFaceDefInternalCount = 5 // sizeof (VertexFaceRef) = 16
111#endif
112};
@ kVertexFaceDefInternalCount
Definition OOMesh.m:110

◆ anonymous enum

anonymous enum
Enumerator
kBaseOctreeDepth 
kSmallOctreeDepth 
kOctreeSizeThreshold 
kOctreeSmallSizeThreshold 

Definition at line 65 of file OOMesh.m.

65 {
66 kBaseOctreeDepth = 5, // 32x32x32
67 // kMaxOctreeDepth declared in Octree.h.
68 kSmallOctreeDepth = 4, // 16x16x16
69 kOctreeSizeThreshold = 900, // Size at which we start increasing octree depth
71};
@ kBaseOctreeDepth
Definition OOMesh.m:66
@ kOctreeSmallSizeThreshold
Definition OOMesh.m:70
@ kSmallOctreeDepth
Definition OOMesh.m:68
@ kOctreeSizeThreshold
Definition OOMesh.m:69

◆ OOMeshNormalMode

Enumerator
kNormalModePerFace 
kNormalModeSmooth 
kNormalModeExplicit 

Definition at line 73 of file OOMesh.m.

73 {
OOMeshNormalMode
Definition OOMesh.m:73
@ kNormalModeExplicit
Definition OOMesh.m:76
@ kNormalModeSmooth
Definition OOMesh.m:75
@ kNormalModePerFace
Definition OOMesh.m:74

Function Documentation

◆ IsLegacyNormalMode()

BOOL IsLegacyNormalMode ( OOMeshNormalMode mode)
static

Definition at line 180 of file OOMesh.m.

181{
182 /* True for modes that predate the "normal mode" concept, i.e. per-face
183 and smooth. These modes require automatic winding correction.
184 */
185 switch (mode) {
188 return YES;
189
191 return NO;
192 }
193
194#ifndef NDEBUG
195 [NSException raise:NSInvalidArgumentException
196 format:@"Unexpected normal mode in %s", __PRETTY_FUNCTION__];
197#endif
198 return NO;
199}
const char int mode
Definition ioapi.h:125

References kNormalModeExplicit, kNormalModePerFace, and kNormalModeSmooth.

Referenced by OOMesh(Private)::loadData:scaleFactor:.

Here is the caller graph for this function:

◆ IsPerVertexNormalMode()

BOOL IsPerVertexNormalMode ( OOMeshNormalMode mode)
static

Definition at line 201 of file OOMesh.m.

202{
203 /* True for modes that have per-vertex normals, i.e. not per-face mode.
204 */
205 switch (mode) {
207 return NO;
208
211 return YES;
212 }
213
214#ifndef NDEBUG
215 [NSException raise:NSInvalidArgumentException
216 format:@"Unexpected normal mode in %s", __PRETTY_FUNCTION__];
217#endif
218 return NO;
219}

References kNormalModeExplicit, kNormalModePerFace, and kNormalModeSmooth.

Referenced by OOMesh(Private)::loadData:scaleFactor:, OOMesh(Private)::modelData, OOMesh(Private)::setModelFromModelData:name:, and OOMesh(Private)::setUpVertexArrays.

Here is the caller graph for this function:

◆ VFRAddFace()

void VFRAddFace ( VertexFaceRef * vfr,
NSUInteger index )
static

Referenced by OOMesh(Private)::loadData:scaleFactor:.

Here is the caller graph for this function:

◆ VFRGetCount()

NSUInteger VFRGetCount ( VertexFaceRef * vfr)
static

Referenced by OOMesh(Private)::calculateVertexNormalsAndTangentsWithFaceRefs:, OOMesh(Private)::calculateVertexTangentsWithFaceRefs:, and OOCacheManager(Octree)::VFRGetFaceAtIndex.

Here is the caller graph for this function:

◆ VFRGetFaceAtIndex()

NSUInteger VFRGetFaceAtIndex ( VertexFaceRef * vfr,
NSUInteger index )
static

Referenced by OOMesh(Private)::calculateVertexNormalsAndTangentsWithFaceRefs:, and OOMesh(Private)::calculateVertexTangentsWithFaceRefs:.

Here is the caller graph for this function:

Variable Documentation

◆ kOOCacheMeshes

NSString* const kOOCacheMeshes = @"@"OOMesh"
static

Definition at line 2002 of file OOMesh.m.

◆ kOOCacheOctrees

NSString* const kOOCacheOctrees = @"@"octrees"
static

Definition at line 2020 of file OOMesh.m.

◆ kOOLogMeshDataNotFound

NSString* const kOOLogMeshDataNotFound = @"mesh.load.failed.fileNotFound"
static

Definition at line 79 of file OOMesh.m.

Referenced by OOMesh(Private)::loadData:scaleFactor:.

◆ kOOLogMeshTooManyMaterials

NSString* const kOOLogMeshTooManyMaterials = @"mesh.load.failed.tooManyMaterials"
static

Definition at line 80 of file OOMesh.m.

Referenced by OOMesh(Private)::loadData:scaleFactor:.