collapse_all
expand_all
collapse_allexpand_alldropdowndropdownHovercopycodecopycodeHighlight

collapse_all Collapse AllExpand All     dropdown Code: All Code: Multiple Code: C# Code: Visual Basic Code: Visual C++

[TCheckBoxFormControlObj]C#

[TCheckBoxFormControlObj]Visual Basic

[TCheckBoxFormControlObj]
Visual C++
DPSF API Documentation
Orientation3D
.
.
::

..GetRotationTo Method (Vector3, Vector3)

gradient

Returns the shortest arc Quaternion Rotation needed to rotate the CurrentDirection to be the same as the DestinationDirection. This method is based on Stan Melax's article in Game Programming Gems, and the code was referenced from OgreVector3.h of the Ogre library (www.Ogre3d.org).

Namespace: DPSF

Assembly: DPSF (in DPSF.dll) Version: 2.5.0.0

collapse_allSyntax

C#

public static Quaternion GetRotationTo(

 Vector3 CurrentDirection,

 Vector3 DesiredDirection

)

Visual Basic

Public Shared Function GetRotationTo (

 CurrentDirection As Vector3,

 DesiredDirection As Vector3

As Quaternion

Visual C++

public:

static Quaternion GetRotationTo(

 Vector3 CurrentDirection,

 Vector3 DesiredDirection

)

Parameters

CurrentDirection

Type: Vector3

The current Direction the Vector is facing.

DesiredDirection

Type: Vector3

The Direction we want the Vector to face.

Return Value

Type: Quaternion

Returns the shortest arc Quaternion Rotation needed to rotate the CurrentDirection to be the same as the DestinationDirection.

collapse_allSee Also

Orientation3D Class

Orientation3D Members

GetRotationTo Overload

DPSF Namespace

footer

Send comments on this topic to
Dan@DansKingdom.com