SFS2X Objective-C API
1.7.13
iOS / macOS / tvOS
|
#import <Vec3D.h>
Inherits NSObject.
Instance Methods | |
(id) | - initWithX:Y:Z: |
(id) | - initWithX:Y: |
(BOOL) | - isFloat |
(NSArray *) | - toArray |
Class Methods | |
(id) | + vectorWithX:Y:Z: |
(id) | + vectorWithX:Y: |
(Vec3D *) | + fromArray: |
Properties | |
NSInteger | intX |
NSInteger | intY |
NSInteger | intZ |
NSNumber * | floatX |
NSNumber * | floatY |
NSNumber * | floatZ |
The Vec3D object represents a position in a 2D or 3D space.
This class is used to express a position inside a virtual environment with no specific unit of measure (could be pixels, feet, meters, etc).
Positions along the X,Y,Z axes can be expressed as ints or floats. Although Objective-C can handle both ints and floats under the NSNumber class, SmartFoxServer 2X needs to recognize the specific types. For this reason we recommend to initialize the object with the proper literals to declare which type you are using.
For instance (x:@10, y:@10, z:@10) will use integers while (x:@10F, y:@10F, z:@10F) will use the same coordinates but with a floating point type.
Long and Doubles are not supported for this type of coordinate values.
- (BOOL) isFloat |
Checks if the object uses Floating point or Integer values
+ (id) vectorWithX: | (NSNumber *) | x | |
Y: | (NSNumber *) | y | |
2D Constructor
x | the x coordinate |
y | the y coordinate |
+ (id) vectorWithX: | (NSNumber *) | x | |
Y: | (NSNumber *) | y | |
Z: | (NSNumber *) | z | |
3D Constructor
x | the x coordinate |
y | the y coordinate |
z | the z coordinate |
|
readatomicassign |
The X coordinate as Float
|
readatomicassign |
The Y coordinate as Float
|
readatomicassign |
The Z coordinate as Float
|
readatomicassign |
The X coordinate as Integer
|
readatomicassign |
The Y coordinate as Integer
|
readatomicassign |
The Z coordinate as Integer