Oolite 1.91.0.7644-241112-7f5034b
Loading...
Searching...
No Matches
OOVisualEffectEntity(Private) Category Reference

Instance Methods

(void) - drawSubEntityImmediate:translucent:
 
(void) - addSubEntity:
 
(BOOL) - setUpOneSubentity:
 
(BOOL) - setUpOneFlasher:
 
(BOOL) - setUpOneStandardSubentity:
 

Detailed Description

Definition at line 56 of file OOVisualEffectEntity.m.

Method Documentation

◆ addSubEntity:

- (void) addSubEntity: (Entity< OOSubEntity > *) subent

Extends class OOVisualEffectEntity.

Definition at line 1 of file OOVisualEffectEntity.m.

332 :(Entity<OOSubEntity> *)sub
333{
334 if (sub == nil) return;
335
336 if (subEntities == nil) subEntities = [[NSMutableArray alloc] init];
337 sub->isSubEntity = YES;
338 // Order matters - need consistent state in setOwner:. -- Ahruman 2008-04-20
339 [subEntities addObject:sub];
340 [sub setOwner:self];
341
342 double distance = HPmagnitude([sub position]) + [sub findCollisionRadius];
343 if (distance > _profileRadius)
344 {
345 _profileRadius = distance;
346 }
347}
return nil

◆ drawSubEntityImmediate:translucent:

- (void) drawSubEntityImmediate: (bool) immediate
translucent: (bool) translucent 

Extends class OOVisualEffectEntity.

Definition at line 1 of file OOVisualEffectEntity.m.

392 :(bool)immediate translucent:(bool)translucent
393{
394 if (cam_zero_distance > no_draw_distance) // this test provides an opportunity to do simple LoD culling
395 {
396 return; // TOO FAR AWAY
397 }
399 // HPVect: camera position
400 OOGLTranslateModelView(HPVectorToVector(position));
401 OOGLMultModelView(rotMatrix);
402 [self drawImmediate:immediate translucent:translucent];
403
405}
void OOGLPushModelView(void)
void OOGLTranslateModelView(Vector vector)
void OOGLMultModelView(OOMatrix matrix)
OOMatrix OOGLPopModelView(void)

◆ setUpOneFlasher:

- (BOOL) setUpOneFlasher: (NSDictionary *) subentDict

Extends class OOVisualEffectEntity.

Definition at line 1 of file OOVisualEffectEntity.m.

290 :(NSDictionary *) subentDict
291{
293 [flasher setPosition:[subentDict oo_hpvectorForKey:@"position"]];
294 [self addSubEntity:flasher];
295 return YES;
296}
void setPosition:(HPVector posn)
Definition Entity.m:647
instancetype flasherWithDictionary:(NSDictionary *dictionary)

◆ setUpOneStandardSubentity:

- (BOOL) setUpOneStandardSubentity: (NSDictionary *) subentDict

Extends class OOVisualEffectEntity.

Definition at line 1 of file OOVisualEffectEntity.m.

299 :(NSDictionary *)subentDict
300{
301 OOVisualEffectEntity *subentity = nil;
302 NSString *subentKey = nil;
303 HPVector subPosition;
304 Quaternion subOrientation;
305
306 subentKey = [subentDict oo_stringForKey:@"subentity_key"];
307 if (subentKey == nil) {
308 OOLog(@"setup.visualeffect.badEntry.subentities",@"Failed to set up entity - no subentKey in %@",subentDict);
309 return NO;
310 }
311
312 subentity = [UNIVERSE newVisualEffectWithName:subentKey];
313 if (subentity == nil) {
314 OOLog(@"setup.visualeffect.badEntry.subentities",@"Failed to set up entity %@",subentKey);
315 return NO;
316 }
317
318 subPosition = [subentDict oo_hpvectorForKey:@"position"];
319 subOrientation = [subentDict oo_quaternionForKey:@"orientation"];
320
321 [subentity setPosition:subPosition];
322 [subentity setOrientation:subOrientation];
323
324 [self addSubEntity:subentity];
325
326 [subentity release];
327
328 return YES;
329}
#define OOLog(class, format,...)
Definition OOLogging.h:88
void setOrientation:(Quaternion quat)
Definition Entity.m:725

◆ setUpOneSubentity:

- (BOOL) setUpOneSubentity: (NSDictionary *) subentDict

Extends class OOVisualEffectEntity.

Definition at line 1 of file OOVisualEffectEntity.m.

274 :(NSDictionary *) subentDict
275{
276 NSString *type = [subentDict oo_stringForKey:@"type"];
277 if ([type isEqualToString:@"flasher"])
278 {
279 return [self setUpOneFlasher:subentDict];
280 }
281 else
282 {
283 return [self setUpOneStandardSubentity:subentDict];
284 }
285
286
287}

The documentation for this category was generated from the following file: