Oolite 1.91.0.7644-241112-7f5034b
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 97 of file OOMesh.m.

◆ SCRIBBLE

#define SCRIBBLE   0

Definition at line 63 of file OOMesh.m.

◆ Scribble

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

Definition at line 2134 of file OOMesh.m.

Typedef Documentation

◆ VertexFaceRef

typedef struct VertexFaceRef VertexFaceRef

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
kBaseOctreeDepth 
kSmallOctreeDepth 
kOctreeSizeThreshold 
kOctreeSmallSizeThreshold 

Definition at line 66 of file OOMesh.m.

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

◆ anonymous enum

anonymous enum
Enumerator
kVertexFaceDefInternalCount 

Definition at line 108 of file OOMesh.m.

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

◆ OOMeshNormalMode

Enumerator
kNormalModePerFace 
kNormalModeSmooth 
kNormalModeExplicit 

Definition at line 76 of file OOMesh.m.

77{
OOMeshNormalMode
Definition OOMesh.m:77
@ kNormalModeExplicit
Definition OOMesh.m:80
@ kNormalModeSmooth
Definition OOMesh.m:79
@ kNormalModePerFace
Definition OOMesh.m:78

Function Documentation

◆ IsLegacyNormalMode()

static BOOL IsLegacyNormalMode ( OOMeshNormalMode mode)
static

Definition at line 188 of file OOMesh.m.

189{
190 /* True for modes that predate the "normal mode" concept, i.e. per-face
191 and smooth. These modes require automatic winding correction.
192 */
193 switch (mode)
194 {
197 return YES;
198
200 return NO;
201 }
202
203#ifndef NDEBUG
204 [NSException raise:NSInvalidArgumentException format:@"Unexpected normal mode in %s", __PRETTY_FUNCTION__];
205#endif
206 return NO;
207}
const char int mode
Definition ioapi.h:133

References kNormalModeExplicit, kNormalModePerFace, and kNormalModeSmooth.

◆ IsPerVertexNormalMode()

static BOOL IsPerVertexNormalMode ( OOMeshNormalMode mode)
static

Definition at line 210 of file OOMesh.m.

211{
212 /* True for modes that have per-vertex normals, i.e. not per-face mode.
213 */
214 switch (mode)
215 {
217 return NO;
218
221 return YES;
222 }
223
224#ifndef NDEBUG
225 [NSException raise:NSInvalidArgumentException format:@"Unexpected normal mode in %s", __PRETTY_FUNCTION__];
226#endif
227 return NO;
228}

References kNormalModeExplicit, kNormalModePerFace, and kNormalModeSmooth.

◆ VFRAddFace()

static void VFRAddFace ( VertexFaceRef * vfr,
NSUInteger index )
static

◆ VFRGetCount()

static NSUInteger VFRGetCount ( VertexFaceRef * vfr)
static

Referenced by OOCacheManager(Octree)::VFRGetFaceAtIndex.

+ Here is the caller graph for this function:

◆ VFRGetFaceAtIndex()

static NSUInteger VFRGetFaceAtIndex ( VertexFaceRef * vfr,
NSUInteger index )
static

Variable Documentation

◆ kOOCacheMeshes

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

Definition at line 2214 of file OOMesh.m.

◆ kOOCacheOctrees

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

Definition at line 2235 of file OOMesh.m.

◆ kOOLogMeshDataNotFound

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

Definition at line 84 of file OOMesh.m.

◆ kOOLogMeshTooManyMaterials

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

Definition at line 85 of file OOMesh.m.