Instance Method

convertVector:toNode:

Converts a direction vector from the node’s local coordinate space to that of another node.

Declaration

- (SCNVector3)convertVector:(SCNVector3)vector toNode:(SCNNode *)node;

Parameters

vector

A direction vector in the node’s local coordinate space.

node

Another node in the same scene graph as the node, or nil to convert to the scene’s world coordinate space.

Return Value

A direction vector in the local coordinate space defined by the other node.

Discussion

Unlike the convertPosition:toNode: method, this method ignores the translational aspect of both nodes' transforms. As such, this method is more appropriate for use with vectors that represent only directional information, such as velocity or facing.

See Also

Converting Between Coordinate Spaces (SceneKit Types)

- convertPosition:fromNode:

Converts a position to the node’s local coordinate space from that of another node.

- convertPosition:toNode:

Converts a position from the node’s local coordinate space to that of another node.

- convertTransform:fromNode:

Converts a transform to the node’s local coordinate space from that of another node.

- convertTransform:toNode:

Converts a transform from the node’s local coordinate space to that of another node.

- convertVector:fromNode:

Converts a direction vector to the node’s local coordinate space from that of another node.