Skip to content

Commit

Permalink
Further explained SceneKit hacks and minor stylistic fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
b3ll committed Nov 3, 2014
1 parent a10d5f9 commit 7fee64d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pop/POPAnimationRuntime.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ enum POPValueType
kPOPValueRange,
kPOPValueColor,
kPOPValueSCNVector3,
kPOPValueSCNVector4
kPOPValueSCNVector4,
};

using namespace POP;
Expand Down
6 changes: 4 additions & 2 deletions pop/POPGeometry.mm
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,13 @@ - (CGAffineTransform)CGAffineTransformValue {
#import <SceneKit/SceneKit.h>

/**
Dirty hacks because iOS is stupid and decided to define both SCNVector3's and SCNVector4's objCType as "t". However @encode(SCNVector3) and @encode(SCNVector4) both return the proper definition ("{SCNVector3=fff}" and "{SCNVector4=ffff}" respectively)
Dirty hacks because iOS is weird and decided to define both SCNVector3's and SCNVector4's objCType as "t". However @encode(SCNVector3) and @encode(SCNVector4) both return the proper definition ("{SCNVector3=fff}" and "{SCNVector4=ffff}" respectively)
[[NSValue valueWithSCNVector3:SCNVector3Make(0.0, 0.0, 0.0)] objcType] returns "t", whereas it should return "{SCNVector3=fff}".
*flips table*
*/
@implementation NSValue (SceneKitFU)
@implementation NSValue (SceneKitFixes)

+ (NSValue *)valueWithSCNVector3:(SCNVector3)vec3 {
return [NSValue valueWithBytes:&vec3 objCType:@encode(SCNVector3)];
Expand Down

0 comments on commit 7fee64d

Please sign in to comment.