|
TurnDirection | ||
Direction# = TurnDirection(CurrentAngle#, TargetAngle#, Tolerance) | ||
Parameters: CurrentAngle# = The current angle of the viewer object TargetAngle# = The Target angle we wish to turn our object towards Tolerance = The minimum difference in degrees where the object should not be rotated |
||
Returns: Direction# = The direction that the object should turn (0=no turn, 1 or -1) |
||
TurnDirection returns the direction that we need to change the current angle by in order for it be aligned to the target angle. The function will turn the shortest distance. FACTS: * TurnDirection returns a zero when target point is within the required tolerance. Mini Tutorial: In this example the user controls a test object. The object uses TurnDirection to rotate towards the target object.
This example would output.
|
Related Info: | AngleDifference | Cos | CosH | CosNewValue | CosRadius | CurveAngle | GetAngle2D | Sin | SinH | SinNewValue | SinRadius | WrapAngle : |
|
|||||||||||||||||||||||||||||||||||||||
(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com |