Inherits from CC3MutableRotator : CC3Rotator : NSObject
Declared in CC3Rotator.h

Overview

CC3DirectionalRotator is a subclass of CC3MutableRotator that adds the ability to set rotation based on directional information.

In addition to specifying rotations in terms of three Euler angles, a rotation axis and a rotation angle, or a quaternion, rotations of this class can be specified in terms of pointing in a particular forwardDirection, and orienting so that ‘up’ is in a particular referenceUpDirection.

The rotationMatrix of this rotator can be used to convert between directional rotation, Euler angles, and quaternions. As such, the rotation of a node can be specified as a quaternion or a set of Euler angles, and then read back as a fowardDirection, upDirection, and rightDirection. Or, conversely, rotation may be specified by pointing to a particular forwardDirection and referenceUpDirection, and then read as a quaternion or a set of Euler angles.

The shouldReverseForwardDirection property can be used to determine whether rotation should rotate the negative-Z-axis of the local coordinate system to point in the forwardDirection, or should rotate the positive-Z-axis to the forwardDirection.

Properties

__deprecated

@deprecated Renamed to referenceUpDirection.

@property (nonatomic, assign) CC3Vector sceneUpDirection __deprecated

Declared In

CC3Rotator.h

forwardDirection

The direction towards which this node is pointing, relative to the parent of the node.

@property (nonatomic, assign) CC3Vector forwardDirection

Discussion

A valid direction vector is required. Attempting to set this property to the zero vector (kCC3VectorZero) will raise an assertion error.

See the discussion in the notes of the same property in CC3Node for more info.

The initial value of this property is kCC3VectorUnitZPositive.

Declared In

CC3Rotator.h

isDirectional

Indicates whether this rotator supports rotating to point towards a specific direction (ie- “look-towards”).

@property (nonatomic, readonly) BOOL isDirectional

Discussion

This implementation always returns YES.

Declared In

CC3Rotator.h

referenceUpDirection

The direction that is considered to be ‘up’.

@property (nonatomic, assign) CC3Vector referenceUpDirection

Discussion

A valid direction vector is required. Attempting to set this property to the zero vector (kCC3VectorZero) will raise an assertion error.

See the discussion in the notes of the same property in CC3Node for more info.

The initial value of this property is kCC3VectorUnitYPositive.

Declared In

CC3Rotator.h

rightDirection

The direction in the local coordinate system that is considered to be “off to the right” relative to the forwardDirection and upDirection.

@property (nonatomic, assign, readonly) CC3Vector rightDirection

Discussion

See the discussion in the notes of the same property in CC3Node for more info.

The initial value of this property is kCC3VectorUnitXPositive.

Declared In

CC3Rotator.h

shouldReverseForwardDirection

Indicates whether the effect of setting the forwardDirection property should be reversed.

@property (nonatomic, assign) BOOL shouldReverseForwardDirection

Discussion

Based on the OpenGL default orientation, setting the forwardDirection of a node rotates the node to align the negative-Z-axis of the node with the defined forward direction.

Setting this property to YES will invert that behaviour so that positive-Z-axis of the node will be aligned with the defined forwardDirection.

The initial value of this property is NO, indicating that the negative-Z-axis of the node will be aligned with the forwardDirection property.

Declared In

CC3Rotator.h

upDirection

The direction, in the local coordinate system, that is considered to be ‘up’. This corresponds to the referenceUpDirection, after it has been transformed by the rotationMatrix of this instance.

@property (nonatomic, assign, readonly) CC3Vector upDirection

Discussion

See the discussion in the notes of the same property in CC3Node for more info.

The initial value of this property is kCC3VectorUnitYPositive.

Declared In

CC3Rotator.h