26 |
|
|
27 |
#include <Foundation/NSObject.h> |
#include <Foundation/NSObject.h> |
28 |
|
|
29 |
|
typedef float Matrix[4*4]; |
30 |
|
|
31 |
@interface Quaternion: NSObject |
@interface Quaternion: NSObject |
32 |
{ |
{ |
33 |
@private |
@private |
34 |
float _x, _y, _z, _w; |
float _x, _y, _z, _w; |
|
float *_matrix; |
|
35 |
} |
} |
36 |
|
|
37 |
- (id) init; |
- (id) initWithValuesX: (float)x |
38 |
- (void) dealloc; |
Y: (float)y |
39 |
|
Z: (float)z |
40 |
- (id) initWithValuesX: (float) x |
W: (float)w; |
41 |
Y: (float) y |
- (id) initWithRotation: (Matrix)rotation; |
42 |
Z: (float) z |
|
43 |
W: (float) w; |
- (void) convertToRotation: (Matrix)rotation; |
44 |
- (id) initWithMatrix: (float *)matrix; /* 4x4 matrix */ |
- (void) slerp: (Quaternion *)q1 |
45 |
|
with: (Quaternion *)q2 |
46 |
- (float *) createMatrix; |
accordingTime: (float)t; |
|
- (void) slerp: (Quaternion *) q1 |
|
|
with: (Quaternion *) q2 |
|
|
accordingTime: (float) t; |
|
47 |
|
|
48 |
- (BOOL) isEqual: (Quaternion *) quat; |
- (BOOL) isEqual: (Quaternion *)quat; |
49 |
|
- (void) negate; |
50 |
|
|
51 |
@end |
@end |
52 |
|
|