35#define OOWAYPOINT_KEY_POSITION @"position"
36#define OOWAYPOINT_KEY_ORIENTATION @"orientation"
37#define OOWAYPOINT_KEY_SIZE @"size"
38#define OOWAYPOINT_KEY_CODE @"beaconCode"
39#define OOWAYPOINT_KEY_LABEL @"beaconLabel"
43+ (instancetype) waypointWithDictionary:(NSDictionary *)info
48- (id) initWithDictionary:(NSDictionary *)info
54 position = [info oo_hpvectorForKey:OOWAYPOINT_KEY_POSITION];
55 Quaternion q = [info oo_quaternionForKey:OOWAYPOINT_KEY_ORIENTATION];
56 [
self setOrientation:q];
57 [
self setSize:[info oo_nonNegativeFloatForKey:OOWAYPOINT_KEY_SIZE defaultValue:1000.0]];
58 [
self setBeaconCode:[info oo_stringForKey:OOWAYPOINT_KEY_CODE defaultValue:@"W"]];
59 [
self setBeaconLabel:[info oo_stringForKey:OOWAYPOINT_KEY_LABEL defaultValue:@"Waypoint"]];
61 [
self setStatus:STATUS_EFFECT];
62 [
self setScanClass:CLASS_NO_DRAW];
81- (void) setOrientation:(Quaternion)q
89 [
super setOrientation:q];
128- (void) drawImmediate:(
bool)immediate translucent:(
bool)translucent
135 if (![
PLAYER hasEquipmentItemProviding:
@"EQ_ADVANCED_COMPASS"])
143 if ([
PLAYER compassTarget] !=
self)
159 GLfloat s1 =
_size * 0.75f;
163 OOGL(glEnable(GL_BLEND));
166 OOGL(glColor4f(0.0, 0.0, 1.0, a));
168 for (i = -1; i <= 1; i+=2)
170 for (j = -1; j <= 1; j+=2)
172 for (k = -1; k <= 1; k+=2)
174 glVertex3f(i*s0,j*s0,k*s1); glVertex3f(i*s0,j*s1,k*s0);
175 glVertex3f(i*s0,j*s1,k*s0); glVertex3f(i*s1,j*s0,k*s0);
176 glVertex3f(i*s1,j*s0,k*s0); glVertex3f(i*s0,j*s0,k*s1);
184 glVertex3f(-20.0,0,-s1-20.0f); glVertex3f(0,0,-s1);
185 glVertex3f(20.0,0,-s1-20.0f); glVertex3f(0,0,-s1);
186 glVertex3f(-20.0,0,s1-20.0f); glVertex3f(0,0,s1);
187 glVertex3f(20.0,0,s1-20.0f); glVertex3f(0,0,s1);
193 OOGL(glDisable(GL_BLEND));
200- (NSComparisonResult) compareBeaconCodeWith:(
Entity<OOBeaconEntity> *) other
202 return [[
self beaconCode] compare:[other beaconCode] options: NSCaseInsensitiveSearch];