Initial work on background visualization

This commit is contained in:
Charles Magahern
2015-12-30 02:51:22 -08:00
parent 58529e96b9
commit 7cf2b3b38d
22 changed files with 762 additions and 129 deletions
@@ -0,0 +1,23 @@
//
// NSValue+XIONAdditions.h
// XIONControlPanel
//
// Created by Charles Magahern on 12/29/15.
// Copyright © 2015 XION. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <GLKit/GLKit.h>
@interface NSValue (XIONAdditions)
- (instancetype)initWithGLKMatrix3:(GLKMatrix3)matrix;
- (instancetype)initWithGLKMatrix4:(GLKMatrix4)matrix;
+ (instancetype)valueWithGLKMatrix3:(GLKMatrix3)matrix;
+ (instancetype)valueWithGLKMatrix4:(GLKMatrix4)matrix;
- (GLKMatrix3)GLKMatrix3Value;
- (GLKMatrix4)GLKMatrix4Value;
@end
@@ -0,0 +1,47 @@
//
// NSValue+XIONAdditions.m
// XIONControlPanel
//
// Created by Charles Magahern on 12/29/15.
// Copyright © 2015 XION. All rights reserved.
//
#import "NSValue+XIONAdditions.h"
@implementation NSValue (XIONAdditions)
- (instancetype)initWithGLKMatrix3:(GLKMatrix3)matrix
{
return [self initWithBytes:&matrix objCType:@encode(GLKMatrix3)];
}
- (instancetype)initWithGLKMatrix4:(GLKMatrix4)matrix
{
return [self initWithBytes:&matrix objCType:@encode(GLKMatrix4)];
}
+ (instancetype)valueWithGLKMatrix3:(GLKMatrix3)matrix
{
return [[[self class] alloc] initWithGLKMatrix3:matrix];
}
+ (instancetype)valueWithGLKMatrix4:(GLKMatrix4)matrix
{
return [[[self class] alloc] initWithGLKMatrix4:matrix];
}
- (GLKMatrix3)GLKMatrix3Value
{
GLKMatrix3 mat;
[self getValue:&mat];
return mat;
}
- (GLKMatrix4)GLKMatrix4Value
{
GLKMatrix4 mat;
[self getValue:&mat];
return mat;
}
@end
@@ -0,0 +1,5 @@
//
// Use this file to import your target's public headers that you would like to expose to Swift.
//
#import "NSValue+XIONAdditions.h"