Oolite 1.91.0.7658-250404-b1488af
All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Modules Pages
Octree.m File Reference
import "Octree.h"
import "OOMaths.h"
import "Entity.h"
import "OOOpenGL.h"
import "OODebugGLDrawing.h"
import "OOMacroOpenGL.h"
import "OODebugFlags.h"
import "NSObjectOOExtensions.h"
import "OOCollectionExtractors.h"
+ Include dependency graph for Octree.m:

Go to the source code of this file.

Classes

struct  Octree_details
 
category  Octree(Private)
 

Macros

#define OctreeDebugLog(format, ...)
 
#define OCTREE_COLOR(r, g, b, a)
 

Enumerations

enum  { kMinimumBuilderCapacity = 16 << 10 }
 

Functions

static BOOL isHitByLine (const int *octbuffer, unsigned char *collbuffer, int level, GLfloat rad, Vector v0, Vector v1, Vector off, int face_hit)
 
static GLfloat volumeOfOctree (Octree_details octree_details, unsigned depthLimit)
 
static Vector randomFullNodeFrom (Octree_details details, Vector offset)
 
static BOOL isHitByOctree (Octree_details axialDetails, Octree_details otherDetails, Vector delta, Triangle other_ijk)
 

Variables

static const int change_oct [] = { 0, 1, 2, 4, 3, 5, 6, 7 }
 
static BOOL drawTestForCollisions
 
static BOOL hasCollided = NO
 
static GLfloat hit_dist = 0.0
 

Macro Definition Documentation

◆ OCTREE_COLOR

#define OCTREE_COLOR ( r,
g,
b,
a )
Value:
do {} while (0)

Definition at line 200 of file Octree.m.

Referenced by Octree(Private)::drawOctreeFromLocation:loc:scale:.

◆ OctreeDebugLog

#define OctreeDebugLog ( format,
... )
Value:
do { if (EXPECT_NOT(gDebugFlags & DEBUG_OCTREE_LOGGING)) OOLog(@"octree.debug", format, ## __VA_ARGS__); } while (0)
NSUInteger gDebugFlags
Definition main.m:7
@ DEBUG_OCTREE_LOGGING
Definition OODebugFlags.h:9
#define EXPECT_NOT(x)
#define OOLog(class, format,...)
Definition OOLogging.h:88

Definition at line 37 of file Octree.m.

Referenced by Octree::isHitByLine, Octree::isHitByLine:v0:, and Octree::isHitByOctree.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
kMinimumBuilderCapacity 

Definition at line 779 of file Octree.m.

780{
781 /*
782 Initial capacity of OOOctreeBuilder. 16 KibiEntries is enough to handle
783 all but 2 built-in models; I expect similar results for OXPs, since
784 geometry detail has limited effect on the octree. Large models with
785 higher depth are more likely to need growth.
786 */
787 kMinimumBuilderCapacity = 16 << 10
788};
@ kMinimumBuilderCapacity
Definition Octree.m:787

Function Documentation

◆ isHitByLine()

static BOOL isHitByLine ( const int * octbuffer,
unsigned char * collbuffer,
int level,
GLfloat rad,
Vector v0,
Vector v1,
Vector off,
int face_hit )
static

Referenced by Octree::isHitByLine:v0:, and Octree::isHitByLineSub.

+ Here is the caller graph for this function:

◆ isHitByOctree()

static BOOL isHitByOctree ( Octree_details axialDetails,
Octree_details otherDetails,
Vector delta,
Triangle other_ijk )
static

Referenced by ShipEntity::doOctreesCollide, Octree::isHitByOctree, Octree::isHitByOctree:withOrigin:andIJK:, and Octree::isHitByOctree:withOrigin:andIJK:andScales:s1:.

+ Here is the caller graph for this function:

◆ randomFullNodeFrom()

static Vector randomFullNodeFrom ( Octree_details details,
Vector offset )
static

Referenced by Octree::randomFullNodeFrom, and Octree::randomPoint.

+ Here is the caller graph for this function:

◆ volumeOfOctree()

static GLfloat volumeOfOctree ( Octree_details octree_details,
unsigned depthLimit )
static

Referenced by Octree::volume, and Octree::volumeOfOctree.

+ Here is the caller graph for this function:

Variable Documentation

◆ change_oct

const int change_oct[] = { 0, 1, 2, 4, 3, 5, 6, 7 }
static

Definition at line 68 of file Octree.m.

68{ 0, 1, 2, 4, 3, 5, 6, 7 }; // used to move from nearest to furthest octant

Referenced by Octree::isHitByOctree.

◆ drawTestForCollisions

BOOL drawTestForCollisions
static

◆ hasCollided

BOOL hasCollided = NO
static

Definition at line 370 of file Octree.m.

Referenced by Octree::isHitByLine, and Octree::isHitByLine:v0:.

◆ hit_dist

GLfloat hit_dist = 0.0
static

Definition at line 371 of file Octree.m.

Referenced by Octree::isHitByLine, and Octree::isHitByLine:v0:.