EngineKit
|
#import <Vector.h>
Instance Methods | |
(instancetype) | - initUniformWithNumber: |
(instancetype) | - initWithX:Y:Z: |
(instancetype) | - initWithSCNVector: |
(instancetype) | - initWithSCNVector4: |
(instancetype) | - initWithCIVector: |
(instancetype) | - initWithVector: |
(instancetype) | - initWithArray: |
(instancetype) | - initWithObject: |
(BOOL) | - isEqualToVector: |
(SCNVector3) | - toSCNVector |
Class Methods | |
(instancetype) | + origin |
Properties | |
SCNVector3 | vector |
CGFloat | x |
The Vector's x component. | |
CGFloat | y |
The Vector's y component. | |
CGFloat | z |
The Vector's z component. | |
![]() | |
CGFloat | x |
CGFloat | y |
CGFloat | z |
Represents a tuple of three CGFloats
, here named x
, y
and z
.
- (instancetype) initUniformWithNumber: | (CGFloat) | x |
Creates a Vector in which all components are set to x
. Useful for uniform scales.
x | The value to set to all the Vector's components. |
Reimplemented from <VectorExport>.
- (instancetype) initWithArray: | (NSArray *) | array |
Creates a Vector based on the given NSArray. Trusts that the array has enough (3 or more) components, and that the first 3 components may be cast into NSNumbers
.
array | The array to copy into the Vector. |
Reimplemented from <VectorExport>.
- (instancetype) initWithCIVector: | (CIVector *) | newValue |
Creates a Vector in which all components are set as just as the first 3 components (x, y and z) in the given CIVector. This method trusts that the CIVector has been correctly initialized and has the necessary components.
Useful for obtaining a Vector through a CIVector initialization method.
newValue | The CIValue whose x, y and z components should be used. |
Reimplemented from <VectorExport>.
- (instancetype) initWithObject: | (id) | object |
Creates a Vector based on the given object. The supported objects are:
-initUniformWithNumber
.-initWithArray
.-initWithSCNVector3
.-initWithVector
.assert(false)
will be triggered.object | An object of any one of the classes mentioned above. |
Reimplemented from <VectorExport>.
- (instancetype) initWithSCNVector4: | (SCNVector4) | newValue |
Creates a Vector in which all components are set as just as the first 3 components in the given SCNVector4. If that vector is written as (x y z w), the created Vector object will be (x y z).
Useful for obtaining the axis of a rotation, for instance.
newValue | The SCNVector4 whose first three components should be used. |
Reimplemented from <VectorExport>.
- (instancetype) initWithSCNVector: | (SCNVector3) | newValue |
Creates a Vector in which all components are set as just as the given SCNVector3.
newValue | The SCNVector3 that should be used as a model. |
Reimplemented from <VectorExport>.
- (instancetype) initWithVector: | (Vector *) | vector |
Creates a Vector that is a copy of the given vector
.
vector | The Vector object that should be copied. |
Reimplemented from <VectorExport>.
- (instancetype) initWithX: | (CGFloat) | x | |
Y: | (CGFloat) | y | |
Z: | (CGFloat) | z | |
- (BOOL) isEqualToVector: | (SCNVector3) | vector |
Returns YES
if the Vector has the same components as the given vector
, as determined by the SCNVector3EqualToVector3
function.
vector | The SCNVector3 used for comparison. |
YES
if the components are all the same; NO
otherwise. Reimplemented from <VectorExport>.
+ (instancetype) origin |
Represents a commonly used Vector, (0 0 0)
origin
Vector object. Reimplemented from <VectorExport>.
- (SCNVector3) toSCNVector |
Creates an SCNVector3 with the same components as the Vector.
Reimplemented from <VectorExport>.
|
readwritenonatomicassign |
The Vector class's inner representation of a vector. Meant to be used only by subclasses; use -toSCNVector
instead.