Initial work on background visualization
This commit is contained in:
@@ -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"
|
||||
Reference in New Issue
Block a user