1
0
mirror of https://github.com/thes3m/XNI synced 2024-12-26 13:26:06 +01:00
Matej Jan 08abf7ffe0 NSCoding support added to data classes.
git-svn-id: http://xni.googlecode.com/svn/XNI@120 ac433895-eea3-a490-d80a-17149a75e588
2012-10-11 21:45:34 +00:00

74 lines
1.9 KiB
Objective-C

//
// Vector3.h
// XNI
//
// Created by Matej Jan on 9.9.10.
// Copyright 2010 Retronator. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "Retronator.Xni.Framework.classes.h"
@interface Vector3 : NSObject <NSCopying, NSCoding> {
Vector3Struct data;
}
- (id) initWithX:(float)x y:(float)y z:(float)z;
- (id) initWithVector3Struct: (Vector3Struct*)vectorData;
- (id) initWithVector3: (Vector3*)vector;
+ (Vector3*) vectorWithX:(float)x y:(float)y z:(float)z;
+ (Vector3*) vectorWithStruct: (Vector3Struct*)vectorData;
+ (Vector3*) vectorWithVector: (Vector3*)vector;
@property (nonatomic) float x;
@property (nonatomic) float y;
@property (nonatomic) float z;
@property (nonatomic, readonly) Vector3Struct *data;
+ (Vector3*) normalize:(Vector3*)value;
+ (Vector3*) negate:(Vector3*)value;
+ (Vector3*) add:(Vector3*)value1 to:(Vector3*)value2;
+ (Vector3*) subtract:(Vector3*)value1 by:(Vector3*)value2;
+ (Vector3*) multiply:(Vector3*)value1 by:(float)scaleFactor;
+ (Vector3*) crossProductOf:(Vector3*)value1 with:(Vector3*)value2;
+ (float) dotProductOf:(Vector3*)value1 with:(Vector3*)value2;
+ (Vector3*) transform:(Vector3*)value with:(Matrix*)matrix;
+ (Vector3*) transformNormal:(Vector3*)value with:(Matrix*)matrix;
+ (Vector3*) lerp:(Vector3*)value1 to:(Vector3*)value2 by:(float)amount;
- (float) length;
- (float) lengthSquared;
- (Vector3*) normalize;
- (Vector3*) negate;
- (Vector3*) set:(Vector3*)value;
- (Vector3*) add:(Vector3*)value;
- (Vector3*) subtract:(Vector3*)value;
- (Vector3*) multiplyBy:(float)scaleFactor;
- (Vector3*) transformWith:(Matrix*)matrix;
- (Vector3*) transformNormalWith:(Matrix*)matrix;
- (BOOL) equals:(Vector3*)vector;
// Constants
+ (Vector3*) zero;
+ (Vector3*) one;
+ (Vector3*) unitX;
+ (Vector3*) unitY;
+ (Vector3*) unitZ;
+ (Vector3*) up;
+ (Vector3*) down;
+ (Vector3*) left;
+ (Vector3*) right;
+ (Vector3*) forward;
+ (Vector3*) backward;
@end