mirror of
https://github.com/thes3m/XNI
synced 2024-12-26 13:26:06 +01:00
61 lines
1.4 KiB
Objective-C
61 lines
1.4 KiB
Objective-C
//
|
|
// Vector4.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 Vector4 : NSObject {
|
|
Vector4Struct data;
|
|
}
|
|
|
|
- (id) initWithX:(float)x y:(float)y z:(float)z w:(float)w;
|
|
- (id) initWithStruct: (Vector4Struct*)vectorData;
|
|
- (id) initWithVector: (Vector4*)vector;
|
|
|
|
+ (Vector4*) vectorWithX:(float)x y:(float)y z:(float)z w:(float)w;
|
|
+ (Vector4*) vectorWithStruct: (Vector4Struct*)vectorData;
|
|
+ (Vector4*) vectorWithVector: (Vector4*)vector;
|
|
|
|
@property (nonatomic) float x;
|
|
@property (nonatomic) float y;
|
|
@property (nonatomic) float z;
|
|
@property (nonatomic) float w;
|
|
|
|
@property (nonatomic, readonly) Vector4Struct *data;
|
|
|
|
+ (Vector4*) normalize:(Vector4*)value;
|
|
+ (Vector4*) negate:(Vector4*)value;
|
|
|
|
+ (Vector4*) add:(Vector4*)value1 to:(Vector4*)value2;
|
|
+ (Vector4*) subtract:(Vector4*)value1 by:(Vector4*)value2;
|
|
+ (Vector4*) multiply:(Vector4*)value by:(float)scalar;
|
|
|
|
+ (Vector4*) transform:(Vector4*)value with:(Matrix*)matrix;
|
|
|
|
- (float) length;
|
|
- (float) lengthSquared;
|
|
|
|
- (Vector4*) normalize;
|
|
- (Vector4*) negate;
|
|
- (Vector4*) add:(Vector4*)value;
|
|
- (Vector4*) subtract:(Vector4*)value;
|
|
- (Vector4*) multiplyBy:(float)scalar;
|
|
- (Vector4*) transformWith:(Matrix*)matrix;
|
|
|
|
// Constants
|
|
+ (Vector4*) zero;
|
|
+ (Vector4*) one;
|
|
+ (Vector4*) unitX;
|
|
+ (Vector4*) unitY;
|
|
+ (Vector4*) unitZ;
|
|
+ (Vector4*) unitW;
|
|
|
|
|
|
@end
|