|
RotateToPoint | ||
Degrees# = RotateToPoint(ViewerX#, ViewerY#, ViewerAngle#, TargetX#, TargetY#, Tolerance#) | ||
Parameters: ViewerX# = The X coordinate of the viewer object ViewerY#= The Y coordinate of the viewer object ViewerAngle# = The current angle of the viewer object TargetX# = The X position of the target object TargetY# = The Y position of the target object Tolerance# = The minimum difference in degrees, where object should not be rotated |
||
Returns: Degrees# = The number of degree these two angles differ |
||
RotateToPoint returns the direction that we need to rotate an object in order to face the target point. This is useful for making a game characters move/turn towards other characters/players. FACTS: * RotateToPoint 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 RotateToPoint to turn towards the target object.
This example would output.
|
Related Info: | AngleDifference | Cos | CosNewValue | CosRadius | CurveAngle | GetAngle2D | Sin | SinNewValue | SinRadius | TurnDirection | WrapAngle : |
|
|||||||||||||||||||||||||||||||||||||||
(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com |