18 Creating and Managing Trackers

18 Q3Tracker_GetPosition

You can use the Q3Tracker_GetPosition function to get the position of a tracker.

TQ3Status Q3Tracker_GetPosition (
TQ3TrackerObject trackerObject, 
TQ3Point3D *position, 
TQ3Vector3D *delta, 
TQ3Boolean *changed, 
unsigned long *serialNumber);
trackerObject
A tracker object.
position On exit, the current position of the specified tracker.
delta On exit, the change in position since the last call to Q3Tracker_GetPosition.
changed On exit, a Boolean value that indicates whether the position or delta parameter was changed (kQ3True) or not (kQ3False).
serialNumber
On entry, a tracker serial number, or NULL. On output, the current tracker serial number.

DESCRIPTION


The Q3Tracker_GetPosition function returns, in the position parameter, the current position of the tracker specified by the trackerObject parameter. In addition, it can return, in the delta parameter, the relative change in position since the previous call to Q3Tracker_GetPosition.

On entry, if the value of delta is NULL, the relative contribution is combined into the reported position. If the value of delta is not NULL, then delta is set to the relative motion that has been accumulated since the previous call to Q3Tracker_GetPosition. In either case, the position accumulator is set to (0, 0, 0) by this function.

If the value of the serialNumber parameter is NULL, Q3Tracker_GetPosition fills in the position and delta parameters and returns the value kQ3True in the changed parameter. Otherwise, the value specified in the serialNumber parameter is compared with the tracker's current serial number. If the two serial numbers are identical, Q3Tracker_GetPosition leaves the two coordinate parameters and the serialNumber parameter unchanged and returns the value kQ3False in the changed parameter. If the two serial number differ, Q3Tracker_GetPosition fills in the two coordinate parameters, updates the serialNumber parameter, and returns the value kQ3True in the changed parameter.

If the specified tracker is inactive, then the position parameter is set to the point (0, 0, 0), the delta parameter is set to (0, 0, 0) if it is non-NULL, and the changed parameter is set to kQ3False if it is non-NULL.

DESCRIPTION

3D Graphics Programming with QuickDraw 3D - 21 OCT 1995

© Apple Computer, Inc.

Let us know what you think of these prototype pages.

Generated with Harlequin WebMaker