Float4
Objective-C
@interface Float4 : NSObject
Swift
class Float4 : NSObject
Simple wrapper for a vector of four float
-
First vector element
Declaration
Objective-C
@property float v0;
Swift
var v0: Float { get set }
-
Second vector element
Declaration
Objective-C
@property float v1;
Swift
var v1: Float { get set }
-
Third vector element
Declaration
Objective-C
@property float v2;
Swift
var v2: Float { get set }
-
Fourth vector element
Declaration
Objective-C
@property float v3;
Swift
var v3: Float { get set }
-
Create zero-initialize vecior
Declaration
Objective-C
- (nonnull instancetype)init;
Swift
init()
-
Create vector with specified element values
Declaration
Objective-C
- (nonnull instancetype)initWithV0:(float)v0 v1:(float)v1 v2:(float)v2 v3:(float)v3;
Swift
init(v0: Float, v1: Float, v2: Float, v3: Float)
Parameters
v0
First element
v1
Second element
v2
Third element
v3
Fourth element
-
Create vector with specified element values
Declaration
Objective-C
- (nonnull instancetype)initWithVals:(nonnull NSArray<NSNumber *> *)vals;
Swift
init(vals: [NSNumber])
Parameters
vals
array of element values
-
Update vector with specified element values
Declaration
Objective-C
- (void)set:(nonnull NSArray<NSNumber *> *)vals;
Swift
func set(vals: [NSNumber])
Parameters
vals
array of element values
-
Get vector as an array
Declaration
Objective-C
- (nonnull NSArray<NSNumber *> *)get;
Swift
func get() -> [NSNumber]
-
Compare for equality
Declaration
Objective-C
- (BOOL)isEqual:(nullable id)other;
Swift
func isEqual(_ other: Any?) -> Bool
Parameters
other
Object to compare