LCOV - code coverage report
Current view: top level - Core - CollisionRegion.h (source / functions) Hit Total Coverage
Test: coverxygen.info Lines: 0 30 0.0 %
Date: 2025-05-28 07:50:54 Functions: 0 0 -

          Line data    Source code
       1           0 : /*
       2             : 
       3             : CollisionRegion.h
       4             : 
       5             : Collision regions are used to group entities which may potentially collide, to
       6             : reduce the number of collision checks required.
       7             : 
       8             : Oolite
       9             : Copyright (C) 2004-2013 Giles C Williams and contributors
      10             : 
      11             : This program is free software; you can redistribute it and/or
      12             : modify it under the terms of the GNU General Public License
      13             : as published by the Free Software Foundation; either version 2
      14             : of the License, or (at your option) any later version.
      15             : 
      16             : This program is distributed in the hope that it will be useful,
      17             : but WITHOUT ANY WARRANTY; without even the implied warranty of
      18             : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19             : GNU General Public License for more details.
      20             : 
      21             : You should have received a copy of the GNU General Public License
      22             : along with this program; if not, write to the Free Software
      23             : Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
      24             : MA 02110-1301, USA.
      25             : 
      26             : */
      27             : 
      28             : #import "OOCocoa.h"
      29             : #import "OOMaths.h"
      30             : 
      31             : 
      32           0 : #define COLLISION_REGION_BORDER_RADIUS  32000.0f
      33           0 : #define COLLISION_MAX_ENTITIES                  128
      34           0 : #define MINIMUM_SHADOWING_ENTITY_RADIUS 75.0
      35             : 
      36             : @class Entity, OOSunEntity;
      37             : 
      38             : 
      39           0 : @interface CollisionRegion: NSObject
      40             : {
      41             : @private
      42           0 :         BOOL                            isUniverse;                     // if YES location is origin and radius is 0.0f
      43             :         
      44           0 :         int                                     crid;                           // identifier
      45           0 :         HPVector                                location;                       // center of the region
      46           0 :         GLfloat                         radius;                         // inner radius of the region
      47           0 :         GLfloat                         border_radius;          // additiønal, border radius of the region (typically 32km or some value > the scanner range)
      48             : 
      49           0 :         unsigned                        checks_this_tick;
      50           0 :         unsigned                        checks_within_range;
      51             : 
      52           0 :         NSMutableArray          *subregions;
      53             :         
      54           0 :         BOOL                            isPlayerInRegion;
      55             :         
      56           0 :         Entity                          **entity_array; // entities within the region
      57           0 :         unsigned                        n_entities;             // number of entities
      58           0 :         unsigned                        max_entities;   // so storage can be expanded
      59             :         
      60           0 :         CollisionRegion         *parentRegion;
      61             : }
      62             : 
      63           0 : - (id) initAsUniverse;
      64           0 : - (id) initAtLocation:(HPVector) locn withRadius:(GLfloat) rad withinRegion:(CollisionRegion*) otherRegion;
      65             : 
      66           0 : - (void) clearSubregions;
      67           0 : - (void) addSubregionAtPosition:(HPVector) pos withRadius:(GLfloat) rad;
      68             : 
      69             : // collision checking
      70           0 : - (void) clearEntityList;
      71           0 : - (void) addEntity:(Entity *)ent;
      72           0 : - (BOOL) checkEntity:(Entity *)ent;
      73             : 
      74           0 : - (void) findCollisions;
      75           0 : - (void) findShadowedEntities;
      76             : 
      77             : // Description for FPS HUD
      78           0 : - (NSString *) collisionDescription;
      79             : 
      80           0 : - (NSString *) debugOut;
      81             : 
      82             : @end
      83             : 
      84             : /* Given a region centred at e1pos with a radius of e1rad, the depth
      85             :  * of shadowing cast by e2 from the_sun is recorded in outValue, with
      86             :  * >1 = no shadow, <1 = shadow */
      87           0 : BOOL shadowAtPointOcclusionToValue(HPVector e1pos, GLfloat e1rad, Entity *e2, OOSunEntity *the_sun, float *outValue);

Generated by: LCOV version 1.14