Oolite 1.91.0.7644-241112-7f5034b
Loading...
Searching...
No Matches
OOJSVisualEffect.m
Go to the documentation of this file.
1/*
2OOJSVisualEffect.m
3
4Oolite
5Copyright (C) 2004-2013 Giles C Williams and contributors
6
7This program is free software; you can redistribute it and/or
8modify it under the terms of the GNU General Public License
9as published by the Free Software Foundation; either version 2
10of the License, or (at your option) any later version.
11
12This program is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with this program; if not, write to the Free Software
19Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
20MA 02110-1301, USA.
21
22 */
23
25#import "OOJSVisualEffect.h"
26#import "OOJSEntity.h"
27#import "OOJSVector.h"
29#import "OOMesh.h"
31#import "ResourceManager.h"
33
34
35static JSObject *sVisualEffectPrototype;
36
37static BOOL JSVisualEffectGetVisualEffectEntity(JSContext *context, JSObject *stationObj, OOVisualEffectEntity **outEntity);
38
39
40static JSBool VisualEffectGetProperty(JSContext *context, JSObject *this, jsid propID, jsval *value);
41static JSBool VisualEffectSetProperty(JSContext *context, JSObject *this, jsid propID, JSBool strict, jsval *value);
42
43static JSBool VisualEffectRemove(JSContext *context, uintN argc, jsval *vp);
44static JSBool VisualEffectGetShaders(JSContext *context, uintN argc, jsval *vp);
45static JSBool VisualEffectSetShaders(JSContext *context, uintN argc, jsval *vp);
46static JSBool VisualEffectGetMaterials(JSContext *context, uintN argc, jsval *vp);
47static JSBool VisualEffectSetMaterials(JSContext *context, uintN argc, jsval *vp);
48static JSBool VisualEffectScale(JSContext *context, uintN argc, jsval *vp);
49static JSBool VisualEffectRestoreSubEntities(JSContext *context, uintN argc, jsval *vp);
50
51static JSBool VisualEffectSetMaterialsInternal(JSContext *context, uintN argc, jsval *vp, OOVisualEffectEntity *thisEnt, BOOL fromShaders);
52
53
54static JSClass sVisualEffectClass =
55{
56 "VisualEffect",
57 JSCLASS_HAS_PRIVATE,
58
59 JS_PropertyStub, // addProperty
60 JS_PropertyStub, // delProperty
61 VisualEffectGetProperty, // getProperty
62 VisualEffectSetProperty, // setProperty
63 JS_EnumerateStub, // enumerate
64 JS_ResolveStub, // resolve
65 JS_ConvertStub, // convert
67 JSCLASS_NO_OPTIONAL_MEMBERS
68};
69
70
71enum
72{
73 // Property IDs
96};
97
98
99static JSPropertySpec sVisualEffectProperties[] =
100{
101 // JS name ID flags
124 { 0 }
125};
126
127
128static JSFunctionSpec sVisualEffectMethods[] =
129{
130 // JS name Function min args
131 { "getMaterials", VisualEffectGetMaterials, 0 },
132 { "getShaders", VisualEffectGetShaders, 0 },
133 { "remove", VisualEffectRemove, 0 },
134 { "restoreSubEntities", VisualEffectRestoreSubEntities, 0 },
135 { "scale", VisualEffectScale, 1 },
136 { "setMaterials", VisualEffectSetMaterials, 1 },
137 { "setShaders", VisualEffectSetShaders, 2 },
138
139 { 0 }
140};
141
142
149
150
151static BOOL JSVisualEffectGetVisualEffectEntity(JSContext *context, JSObject *visualEffectObj, OOVisualEffectEntity **outEntity)
152{
154
155 BOOL result;
156 Entity *entity = nil;
157
158 if (outEntity == NULL) return NO;
159 *outEntity = nil;
160
161 result = OOJSEntityGetEntity(context, visualEffectObj, &entity);
162 if (!result) return NO;
163
164 if (![entity isKindOfClass:[OOVisualEffectEntity class]]) return NO;
165
166 *outEntity = (OOVisualEffectEntity *)entity;
167 return YES;
168
170}
171
172
173@implementation OOVisualEffectEntity (OOJavaScriptExtensions)
174
175- (void)getJSClass:(JSClass **)outClass andPrototype:(JSObject **)outPrototype
176{
177 *outClass = &sVisualEffectClass;
178 *outPrototype = sVisualEffectPrototype;
179}
180
181
182- (NSString *) oo_jsClassName
183{
184 return @"VisualEffect";
185}
186
187- (BOOL) isVisibleToScripts
188{
189 return YES;
190}
191
192- (NSArray *) subEntitiesForScript
193{
194 return [[self visualEffectSubEntityEnumerator] allObjects];
195}
196
197@end
198
199
200static JSBool VisualEffectGetProperty(JSContext *context, JSObject *this, jsid propID, jsval *value)
201{
202 if (!JSID_IS_INT(propID)) return YES;
203
204 OOJS_NATIVE_ENTER(context)
205
206 OOVisualEffectEntity *entity = nil;
207 id result = nil;
208
209 if (!JSVisualEffectGetVisualEffectEntity(context, this, &entity)) return NO;
210 if (entity == nil) { *value = JSVAL_VOID; return YES; }
211
212 switch (JSID_TO_INT(propID))
213 {
215 result = [entity beaconCode];
216 break;
217
219 result = [entity beaconLabel];
220 break;
221
223 result = [entity effectKey];
224 break;
225
227 *value = OOJSValueFromBOOL([entity isBreakPattern]);
228
229 return YES;
230
232 return VectorToJSValue(context, [entity rightVector], value);
233
235 return VectorToJSValue(context, [entity forwardVector], value);
236
238 return VectorToJSValue(context, [entity upVector], value);
239
241 return JS_NewNumberValue(context, [entity scaleX], value);
242
244 return JS_NewNumberValue(context, [entity scaleY], value);
245
247 return JS_NewNumberValue(context, [entity scaleZ], value);
248
250 result = [[entity scannerDisplayColor1] normalizedArray];
251 break;
252
254 result = [[entity scannerDisplayColor2] normalizedArray];
255 break;
256
258 return JS_NewNumberValue(context, [entity hullHeatLevel], value);
259
261 return JS_NewNumberValue(context, [entity shaderFloat1], value);
262
264 return JS_NewNumberValue(context, [entity shaderFloat2], value);
265
267 *value = INT_TO_JSVAL([entity shaderInt1]);
268 return YES;
269
271 *value = INT_TO_JSVAL([entity shaderInt2]);
272 return YES;
273
275 return VectorToJSValue(context, [entity shaderVector1], value);
276
278 return VectorToJSValue(context, [entity shaderVector2], value);
279
281 result = [entity subEntitiesForScript];
282 break;
283
284
286 result = [entity script];
287 break;
288
290 result = [entity scriptInfo];
291 if (result == nil) result = [NSDictionary dictionary]; // empty rather than null
292 break;
293
294 default:
296 return NO;
297 }
298
299 *value = OOJSValueFromNativeObject(context, result);
300 return YES;
301
303}
304
305
306static JSBool VisualEffectSetProperty(JSContext *context, JSObject *this, jsid propID, JSBool strict, jsval *value)
307{
308 if (!JSID_IS_INT(propID)) return YES;
309
310 OOJS_NATIVE_ENTER(context)
311
312 OOVisualEffectEntity *entity = nil;
313 JSBool bValue;
314 OOColor *colorForScript;
315 int32 iValue;
316 jsdouble fValue;
317 Vector vValue;
318 NSString *sValue = nil;
319
320
321 if (!JSVisualEffectGetVisualEffectEntity(context, this, &entity)) return NO;
322 if (entity == nil) return YES;
323
324 switch (JSID_TO_INT(propID))
325 {
327 sValue = OOStringFromJSValue(context,*value);
328 if (sValue == nil || [sValue length] == 0)
329 {
330 if ([entity isBeacon])
331 {
332 [UNIVERSE clearBeacon:entity];
333 if ([PLAYER nextBeacon] == entity)
334 {
335 [PLAYER setCompassMode:COMPASS_MODE_PLANET];
336 }
337 }
338 }
339 else
340 {
341 if ([entity isBeacon])
342 {
343 [entity setBeaconCode:sValue];
344 }
345 else // Universe needs to update beacon lists in this case only
346 {
347 [entity setBeaconCode:sValue];
348 [UNIVERSE setNextBeacon:entity];
349 }
350 }
351 return YES;
352 break;
353
355 sValue = OOStringFromJSValue(context,*value);
356 if (sValue != nil)
357 {
358 [entity setBeaconLabel:sValue];
359 return YES;
360 }
361 break;
362
364 if (JS_ValueToBoolean(context, *value, &bValue))
365 {
366 [entity setIsBreakPattern:bValue];
367 return YES;
368 }
369 break;
370
372 colorForScript = [OOColor colorWithDescription:OOJSNativeObjectFromJSValue(context, *value)];
373 if (colorForScript != nil || JSVAL_IS_NULL(*value))
374 {
375 [entity setScannerDisplayColor1:colorForScript];
376 return YES;
377 }
378 break;
379
381 colorForScript = [OOColor colorWithDescription:OOJSNativeObjectFromJSValue(context, *value)];
382 if (colorForScript != nil || JSVAL_IS_NULL(*value))
383 {
384 [entity setScannerDisplayColor2:colorForScript];
385 return YES;
386 }
387 break;
388
390 if (JS_ValueToNumber(context, *value, &fValue))
391 {
392 if (fValue > 0.0)
393 {
394 [entity setScaleX:fValue];
395 return YES;
396 }
397 }
398 break;
399
401 if (JS_ValueToNumber(context, *value, &fValue))
402 {
403 if (fValue > 0.0)
404 {
405 [entity setScaleY:fValue];
406 return YES;
407 }
408 }
409 break;
410
412 if (JS_ValueToNumber(context, *value, &fValue))
413 {
414 if (fValue > 0.0)
415 {
416 [entity setScaleZ:fValue];
417 return YES;
418 }
419 }
420 break;
421
423 if (JS_ValueToNumber(context, *value, &fValue))
424 {
425 [entity setHullHeatLevel:fValue];
426 return YES;
427 }
428 break;
429
431 if (JS_ValueToNumber(context, *value, &fValue))
432 {
433 [entity setShaderFloat1:fValue];
434 return YES;
435 }
436 break;
437
439 if (JS_ValueToNumber(context, *value, &fValue))
440 {
441 [entity setShaderFloat2:fValue];
442 return YES;
443 }
444 break;
445
447 if (JS_ValueToInt32(context, *value, &iValue))
448 {
449 [entity setShaderInt1:iValue];
450 return YES;
451 }
452 break;
453
455 if (JS_ValueToInt32(context, *value, &iValue))
456 {
457 [entity setShaderInt2:iValue];
458 return YES;
459 }
460 break;
461
463 if (JSValueToVector(context, *value, &vValue))
464 {
465 [entity setShaderVector1:vValue];
466 return YES;
467 }
468 break;
469
471 if (JSValueToVector(context, *value, &vValue))
472 {
473 [entity setShaderVector2:vValue];
474 return YES;
475 }
476 break;
477
478 default:
480 return NO;
481 }
482
483 OOJSReportBadPropertyValue(context, this, propID, sVisualEffectProperties, *value);
484 return NO;
485
487}
488
489
490// *** Methods ***
491
492#define GET_THIS_EFFECT(THISENT) do { \
493 if (EXPECT_NOT(!JSVisualEffectGetVisualEffectEntity(context, OOJS_THIS, &THISENT))) return NO; /* Exception */ \
494 if (OOIsStaleEntity(THISENT)) OOJS_RETURN_VOID; \
495} while (0)
496
497
498static JSBool VisualEffectRemove(JSContext *context, uintN argc, jsval *vp)
499{
500 OOJS_NATIVE_ENTER(context)
501
502 OOVisualEffectEntity *thisEnt = nil;
503 GET_THIS_EFFECT(thisEnt);
504
505 if ([thisEnt isSubEntity])
506 {
507 OOVisualEffectEntity *parent = [thisEnt owner];
508 [parent removeSubEntity:thisEnt];
509 }
510 else
511 {
512 [thisEnt remove];
513 }
514
516
518}
519
520
521//getMaterials()
522static JSBool VisualEffectGetMaterials(JSContext *context, uintN argc, jsval *vp)
523{
525
526 NSObject *result = nil;
527 OOVisualEffectEntity *thisEnt = nil;
528
529 GET_THIS_EFFECT(thisEnt);
530
531 result = [[thisEnt mesh] materials];
532 if (result == nil) result = [NSDictionary dictionary];
533 OOJS_RETURN_OBJECT(result);
534
536}
537
538//getShaders()
539static JSBool VisualEffectGetShaders(JSContext *context, uintN argc, jsval *vp)
540{
542
543 NSObject *result = nil;
544 OOVisualEffectEntity *thisEnt = nil;
545
546 GET_THIS_EFFECT(thisEnt);
547
548 result = [[thisEnt mesh] shaders];
549 if (result == nil) result = [NSDictionary dictionary];
550 OOJS_RETURN_OBJECT(result);
551
553}
554
555
556// setMaterials(params: dict, [shaders: dict]) // sets materials dictionary. Optional parameter sets the shaders dictionary too.
557static JSBool VisualEffectSetMaterials(JSContext *context, uintN argc, jsval *vp)
558{
559 OOJS_NATIVE_ENTER(context)
560
561 OOVisualEffectEntity *thisEnt = nil;
562
563 if (argc < 1)
564 {
565 OOJSReportBadArguments(context, @"VisualEffect", @"setMaterials", 0, OOJS_ARGV, nil, @"parameter object");
566 return NO;
567 }
568
569 GET_THIS_EFFECT(thisEnt);
570
571 return VisualEffectSetMaterialsInternal(context, argc, vp, thisEnt, NO);
572
574}
575
576
577// setShaders(params: dict)
578static JSBool VisualEffectSetShaders(JSContext *context, uintN argc, jsval *vp)
579{
580 OOJS_NATIVE_ENTER(context)
581
582 OOVisualEffectEntity *thisEnt = nil;
583
584 GET_THIS_EFFECT(thisEnt);
585
586 if (argc < 1)
587 {
588 OOJSReportBadArguments(context, @"VisualEffect", @"setShaders", 0, OOJS_ARGV, nil, @"parameter object");
589 return NO;
590 }
591
592 if (JSVAL_IS_NULL(OOJS_ARGV[0]) || (!JSVAL_IS_NULL(OOJS_ARGV[0]) && !JSVAL_IS_OBJECT(OOJS_ARGV[0])))
593 {
594 // EMMSTRAN: JS_ValueToObject() and normal error handling here.
595 OOJSReportWarning(context, @"VisualEffect.%@: expected %@ instead of '%@'.", @"setShaders", @"object", OOStringFromJSValueEvenIfNull(context, OOJS_ARGV[0]));
597 }
598
599 OOJS_ARGV[1] = OOJS_ARGV[0];
600 return VisualEffectSetMaterialsInternal(context, argc, vp, thisEnt, YES);
601
603}
604
605
606
607
608
609/* ** helper functions ** */
610
611static JSBool VisualEffectSetMaterialsInternal(JSContext *context, uintN argc, jsval *vp, OOVisualEffectEntity *thisEnt, BOOL fromShaders)
612{
614
615 JSObject *params = NULL;
616 NSDictionary *materials;
617 NSDictionary *shaders;
618 BOOL withShaders = NO;
619 BOOL success = NO;
620
621 GET_THIS_EFFECT(thisEnt);
622
623 if (JSVAL_IS_NULL(OOJS_ARGV[0]) || (!JSVAL_IS_NULL(OOJS_ARGV[0]) && !JSVAL_IS_OBJECT(OOJS_ARGV[0])))
624 {
625 OOJSReportWarning(context, @"VisualEffect.%@: expected %@ instead of '%@'.", @"setMaterials", @"object", OOStringFromJSValueEvenIfNull(context, OOJS_ARGV[0]));
627 }
628
629 if (argc > 1)
630 {
631 withShaders = YES;
632 if (JSVAL_IS_NULL(OOJS_ARGV[1]) || (!JSVAL_IS_NULL(OOJS_ARGV[1]) && !JSVAL_IS_OBJECT(OOJS_ARGV[1])))
633 {
634 OOJSReportWarning(context, @"VisualEffect.%@: expected %@ instead of '%@'.", @"setMaterials", @"object as second parameter", OOStringFromJSValueEvenIfNull(context, OOJS_ARGV[1]));
635 withShaders = NO;
636 }
637 }
638
639 if (fromShaders)
640 {
641 materials = [[thisEnt mesh] materials];
642 params = JSVAL_TO_OBJECT(OOJS_ARGV[0]);
643 shaders = OOJSNativeObjectFromJSObject(context, params);
644 }
645 else
646 {
647 params = JSVAL_TO_OBJECT(OOJS_ARGV[0]);
648 materials = OOJSNativeObjectFromJSObject(context, params);
649 if (withShaders)
650 {
651 params = JSVAL_TO_OBJECT(OOJS_ARGV[1]);
652 shaders = OOJSNativeObjectFromJSObject(context, params);
653 }
654 else
655 {
656 shaders = [[thisEnt mesh] shaders];
657 }
658 }
659
661 NSDictionary *effectDict = [thisEnt effectInfoDictionary];
662
663 // First we test to see if we can create the mesh.
664 OOMesh *mesh = [OOMesh meshWithName:[effectDict oo_stringForKey:@"model"]
665 cacheKey:nil
666 materialDictionary:materials
667 shadersDictionary:shaders
668 smooth:[effectDict oo_boolForKey:@"smooth" defaultValue:NO]
669 shaderMacros:[[ResourceManager materialDefaults] oo_dictionaryForKey:@"ship-prefix-macros"]
670 shaderBindingTarget:thisEnt];
671
672 if (mesh != nil)
673 {
674 [thisEnt setMesh:mesh];
675 success = YES;
676 }
678
679 OOJS_RETURN_BOOL(success);
680
682}
683
684static JSBool VisualEffectScale(JSContext *context, uintN argc, jsval *vp)
685{
686 OOJS_NATIVE_ENTER(context)
687
688 OOVisualEffectEntity *thisEnt = nil;
689 GET_THIS_EFFECT(thisEnt);
690 jsdouble scale;
691 BOOL gotScale;
692
693 if (argc < 1)
694 {
695 OOJSReportBadArguments(context, @"VisualEffect", @"scale", argc, OOJS_ARGV, nil, @"scale factor needed");
696 return NO;
697 }
698
699 gotScale = JS_ValueToNumber(context, OOJS_ARGV[0], &scale);
700 if (EXPECT_NOT(scale <= 0.0 || !gotScale))
701 {
702 OOJSReportBadArguments(context, @"VisualEffect", @"scale", argc, OOJS_ARGV, nil, @"scale factor must be positive");
703 return NO;
704 }
705
706 // set all three scales
707 [thisEnt setScaleX:scale];
708 [thisEnt setScaleY:scale];
709 [thisEnt setScaleZ:scale];
710
711 return YES;
713
714}
715
716
717// restoreSubEntities(): boolean
718static JSBool VisualEffectRestoreSubEntities(JSContext *context, uintN argc, jsval *vp)
719{
720 OOJS_NATIVE_ENTER(context)
721
722 OOVisualEffectEntity *thisEnt = nil;
723 NSUInteger numSubEntitiesRestored = 0U;
724
725 GET_THIS_EFFECT(thisEnt);
726
727 NSUInteger subCount = [[thisEnt subEntitiesForScript] count];
728
729 [thisEnt clearSubEntities];
730 [thisEnt setUpSubEntities];
731
732 if ([[thisEnt subEntitiesForScript] count] - subCount > 0) numSubEntitiesRestored = [[thisEnt subEntitiesForScript] count] - subCount;
733
734 OOJS_RETURN_BOOL(numSubEntitiesRestored > 0);
735
737}
738
#define EXPECT_NOT(x)
#define OOJS_PROFILE_EXIT
#define OOJS_END_FULL_NATIVE
#define OOJS_BEGIN_FULL_NATIVE(context)
#define OOJS_NATIVE_ENTER(cx)
#define OOJS_NATIVE_EXIT
#define OOJS_PROFILE_ENTER
OOINLINE JSClass * JSEntityClass(void)
Definition OOJSEntity.h:42
OOINLINE JSObject * JSEntityPrototype(void)
Definition OOJSEntity.h:43
BOOL JSValueToVector(JSContext *context, jsval value, Vector *outVector) NONNULL_FUNC
Definition OOJSVector.m:259
BOOL VectorToJSValue(JSContext *context, Vector vector, jsval *outValue) NONNULL_FUNC
Definition OOJSVector.m:185
static JSBool VisualEffectRemove(JSContext *context, uintN argc, jsval *vp)
static JSFunctionSpec sVisualEffectMethods[]
static JSBool VisualEffectRestoreSubEntities(JSContext *context, uintN argc, jsval *vp)
static JSBool VisualEffectSetMaterials(JSContext *context, uintN argc, jsval *vp)
#define GET_THIS_EFFECT(THISENT)
static JSObject * sVisualEffectPrototype
@ kVisualEffect_isBreakPattern
@ kVisualEffect_vectorUp
@ kVisualEffect_shaderFloat1
@ kVisualEffect_beaconCode
@ kVisualEffect_hullHeatLevel
@ kVisualEffect_scannerDisplayColor2
@ kVisualEffect_scannerDisplayColor1
@ kVisualEffect_beaconLabel
@ kVisualEffect_vectorRight
@ kVisualEffect_subEntities
@ kVisualEffect_shaderFloat2
@ kVisualEffect_scaleY
@ kVisualEffect_scaleZ
@ kVisualEffect_script
@ kVisualEffect_dataKey
@ kVisualEffect_scriptInfo
@ kVisualEffect_shaderInt1
@ kVisualEffect_shaderVector1
@ kVisualEffect_vectorForward
@ kVisualEffect_shaderInt2
@ kVisualEffect_scaleX
@ kVisualEffect_shaderVector2
static JSBool VisualEffectScale(JSContext *context, uintN argc, jsval *vp)
static JSBool VisualEffectGetProperty(JSContext *context, JSObject *this, jsid propID, jsval *value)
static JSBool VisualEffectGetMaterials(JSContext *context, uintN argc, jsval *vp)
static JSClass sVisualEffectClass
static JSPropertySpec sVisualEffectProperties[]
void InitOOJSVisualEffect(JSContext *context, JSObject *global)
static JSBool VisualEffectSetProperty(JSContext *context, JSObject *this, jsid propID, JSBool strict, jsval *value)
static JSBool VisualEffectSetShaders(JSContext *context, uintN argc, jsval *vp)
static JSBool VisualEffectGetShaders(JSContext *context, uintN argc, jsval *vp)
static JSBool VisualEffectSetMaterialsInternal(JSContext *context, uintN argc, jsval *vp, OOVisualEffectEntity *thisEnt, BOOL fromShaders)
static BOOL JSVisualEffectGetVisualEffectEntity(JSContext *context, JSObject *stationObj, OOVisualEffectEntity **outEntity)
void OOJSReportWarning(JSContext *context, NSString *format,...)
#define OOJS_PROP_READWRITE_CB
void OOJSRegisterObjectConverter(JSClass *theClass, OOJSClassConverterCallback converter)
OOINLINE jsval OOJSValueFromNativeObject(JSContext *context, id object)
id OOJSNativeObjectFromJSObject(JSContext *context, JSObject *object)
void OOJSObjectWrapperFinalize(JSContext *context, JSObject *this)
#define OOJS_RETURN_OBJECT(o)
void OOJSReportBadPropertySelector(JSContext *context, JSObject *thisObj, jsid propID, JSPropertySpec *propertySpec)
#define OOJS_RETURN_BOOL(v)
NSString * OOStringFromJSValue(JSContext *context, jsval value)
JSBool OOJSUnconstructableConstruct(JSContext *context, uintN argc, jsval *vp)
void OOJSRegisterSubclass(JSClass *subclass, JSClass *superclass)
#define OOJS_ARGV
OOINLINE jsval OOJSValueFromBOOL(int b) INLINE_CONST_FUNC
NSString * OOStringFromJSValueEvenIfNull(JSContext *context, jsval value)
void OOJSReportBadPropertyValue(JSContext *context, JSObject *thisObj, jsid propID, JSPropertySpec *propertySpec, jsval value)
id OOJSBasicPrivateObjectConverter(JSContext *context, JSObject *object)
void OOJSReportBadArguments(JSContext *context, NSString *scriptClass, NSString *function, uintN argc, jsval *argv, NSString *message, NSString *expectedArgsDescription)
#define OOJS_PROP_READONLY_CB
#define OOJS_RETURN_VOID
unsigned count
return nil
#define PLAYER
id owner()
Definition Entity.m:583
OOColor * colorWithDescription:(id description)
Definition OOColor.m:127
NSArray * normalizedArray()
Definition OOColor.m:511
NSDictionary * shaders()
Definition OOMesh.m:617
OOMaterial * materials[kOOMeshMaxMaterials]
Definition OOMesh.h:115
instancetype meshWithName:cacheKey:materialDictionary:shadersDictionary:smooth:shaderMacros:shaderBindingTarget:(NSString *name,[cacheKey] NSString *cacheKey,[materialDictionary] NSDictionary *materialDict,[shadersDictionary] NSDictionary *shadersDict,[smooth] BOOL smooth,[shaderMacros] NSDictionary *macros,[shaderBindingTarget] id< OOWeakReferenceSupport > object)
Definition OOMesh.m:233
void setShaderVector2:(Vector value)
void setScaleZ:(GLfloat factor)
void setShaderVector1:(Vector value)
void removeSubEntity:(Entity< OOSubEntity > *sub)
void setScannerDisplayColor1:(OOColor *color)
void setShaderFloat2:(GLfloat value)
void setScannerDisplayColor2:(OOColor *color)
void setScaleY:(GLfloat factor)
void setScaleX:(GLfloat factor)
NSDictionary * effectInfoDictionary()
void setBeaconLabel:(NSString *blabel)
void setShaderFloat1:(GLfloat value)
void setHullHeatLevel:(GLfloat value)
void setBeaconCode:(NSString *bcode)
NSDictionary * materialDefaults()