CC3TargettingRotator Class Reference
Inherits from | CC3DirectionalRotator : CC3MutableRotator : CC3Rotator : NSObject |
Declared in | CC3Rotator.h |
Overview
CC3TargettingRotator is a subclass of CC3DirectionalRotator that can automatically track the location of another node, or a specific location in 3D space.
In addition to specifying rotations in terms of three Euler angles, a rotation axis and a rotation angle, a quaternion, or a direction, rotations of this class can be specified in terms of pointing at a specific target location in space, or at a specific target node. Further, the rotator can optionally be configured to track that target location or node as the target node, or the node using this rotator, move.
Tasks
-
isTargettable
property -
targetLocation
property -
targettingConstraint
property -
__deprecated
property -
– rotateToTargetLocation:from:withUp:
-
– rotateToTargetLocationFrom:
-
target
property -
shouldTrackTarget
property -
shouldAutotargetCamera
property -
shouldUpdateToTarget
property -
shouldRotateToTargetLocation
property -
isTrackingForBumpMapping
property -
isTrackingTargetDirection
property
Properties
__deprecated
@deprecated Renamed to targettingConstraint.
@property (nonatomic, assign) CC3TargettingConstraint axisRestriction __deprecated
Declared In
CC3Rotator.h
isTargettable
Indicates whether this rotator supports rotating to point towards a specific target node or target location (ie- “look-at”), including
@property (nonatomic, readonly) BOOL isTargettable
Discussion
This implementation always returns YES.
Declared In
CC3Rotator.h
isTrackingForBumpMapping
If the target node of the node carrying this rotator is a CC3Light, the target can be tracked by the node for the purpose of updating the lighting of a contained bump-map texture, instead of rotating to face the light, as normally occurs with tracking.
@property (nonatomic, assign) BOOL isTrackingForBumpMapping
Discussion
This property indicates whether the node should update its globalLightPosition from the tracked location of the light, instead of rotating to face the light.
The initial property is set to NO.
Declared In
CC3Rotator.h
isTrackingTargetDirection
Returns whether this rotator updates the target direction by tracking a target.
@property (nonatomic, readonly) BOOL isTrackingTargetDirection
Discussion
Returns YES if this rotator has a target node, the shouldTrackTarget property is set to YES, and the isTrackingForBumpMapping property is set to NO.
Declared In
CC3Rotator.h
shouldAutotargetCamera
Indicates whether the node should automatically find and track the camera as its target. If this property is set to YES, the node will automatically find and track the camera without having to set the target and shouldTrackTarget properties explicitly.
@property (nonatomic, assign, readwrite) BOOL shouldAutotargetCamera
Discussion
This initial value of this property is NO.
Declared In
CC3Rotator.h
shouldRotateToTargetLocation
Returns whether this node should rotate to face the targetLocation. It will do so if it is not tracking for bump-mapping purposes, and the targetDirection was just set, or shouldTrackTarget is YES.
@property (nonatomic, readonly) BOOL shouldRotateToTargetLocation
Declared In
CC3Rotator.h
shouldTrackTarget
Indicates whether the node should track the node set in the target property as the target and the node carrying this rotator move around.
@property (nonatomic, assign, readwrite) BOOL shouldTrackTarget
Discussion
This initial value of this property is NO.
Declared In
CC3Rotator.h
shouldUpdateToTarget
Returns whether the node should update itself towards the target.
@property (nonatomic, readonly) BOOL shouldUpdateToTarget
Discussion
Returns YES if the target property is set and the shouldTrackTarget returns YES.
Declared In
CC3Rotator.h
target
The target node at which this rotator is pointed. If the shouldTrackTarget property is set to YES, the node will track the target so that it always points to the target, regardless of how the target and this node move through the 3D scene.
@property (nonatomic, assign, readwrite) CC3Node *target
Discussion
The target is held as a weak reference. If you destroy the target node, you must remove it as the target of this rotator.
Declared In
CC3Rotator.h
targetLocation
The global location towards which this node is facing.
@property (nonatomic, assign) CC3Vector targetLocation
Discussion
The target location is determined by the node and is cached by the directional rotator.
Declared In
CC3Rotator.h
targettingConstraint
Indicates whether rotation should be constrained when attempting to rotate the node to point at the target or targetLocation.
@property (nonatomic, assign) CC3TargettingConstraint targettingConstraint
Discussion
The initial value of this property is kCC3TargettingConstraintGlobalUnconstrained.
Declared In
CC3Rotator.h
Instance Methods
rotateToTargetLocation:from:withUp:
Rotates to look at the specified target location as viewed from the specified eye location, and orienting with reference to the specifie up direction. The direction, and both locations are specified in the local coordinate system.
- (void)rotateToTargetLocation:(CC3Vector)targLoc from:(CC3Vector)eyeLoc withUp:(CC3Vector)upDir
Discussion
This is the classic LookAt rotational function.
Declared In
CC3Rotator.h