Loading...
Searching...
No Matches
juce::Draggable3DOrientation Class Reference

## Detailed Description

Stores a 3D orientation, which can be rotated by dragging with the mouse.

The documentation for this class was generated from the following file:

- juce_opengl/geometry/juce_Draggable3DOrientation.h

## Public Types

using | VectorType = Vector3D<float>
using | QuaternionType = Quaternion<float>

## Public Member Functions

| Draggable3DOrientation (float objectRadius=0.5f) noexcept
| Creates a Draggable3DOrientation, initially set up to be aligned along the X axis.
| Draggable3DOrientation (const Quaternion< float > &quaternionToUse, float objectRadius=0.5f) noexcept
| Creates a Draggable3DOrientation from a user-supplied quaternion.
void | reset (const VectorType &axis) noexcept
| Resets the orientation, specifying the axis to align it along.
void | setViewport (Rectangle< int > newArea) noexcept
| Sets the viewport area within which mouse-drag positions will occur.
void | setRadius (float newRadius) noexcept
| Sets the size of the rotated object, as a proportion of the viewport's size.
template<typename Type>
void | mouseDown (Point< Type > mousePos) noexcept
| Begins a mouse-drag operation.
template<typename Type>
void | mouseDrag (Point< Type > mousePos) noexcept
| Continues a mouse-drag operation.
Matrix3D< float > | getRotationMatrix () const noexcept
| Returns the matrix that should be used to apply the current orientation.
QuaternionType & | getQuaternion () noexcept
| Provides direct access to the quaternion.

## Member Typedef Documentation

## VectorType

using juce::Draggable3DOrientation::VectorType = Vector3D<float>

## QuaternionType

using juce::Draggable3DOrientation::QuaternionType = Quaternion<float>

## Constructors and Destructors

## Draggable3DOrientation() [1/2]

juce::Draggable3DOrientation::Draggable3DOrientation | ( | float | objectRadius = 0.5f | ) |

inline noexcept

Creates a Draggable3DOrientation, initially set up to be aligned along the X axis.

References juce::jmax().

## Draggable3DOrientation() [2/2]

juce::Draggable3DOrientation::Draggable3DOrientation | ( | const Quaternion< float > & | quaternionToUse,
|  | float | objectRadius = 0.5f )

inline noexcept

Creates a Draggable3DOrientation from a user-supplied quaternion.

References juce::jmax().

## Member Functions

## reset()

void juce::Draggable3DOrientation::reset | ( | const VectorType & | axis | ) |

inline noexcept

Resets the orientation, specifying the axis to align it along.

## setViewport()

void juce::Draggable3DOrientation::setViewport | ( | Rectangle< int > | newArea | ) |

inline noexcept

Sets the viewport area within which mouse-drag positions will occur.

You'll need to set this rectangle before calling mouseDown. The centre of the rectangle is assumed to be the centre of the object that will be rotated, and the size of the rectangle will be used to scale the object radius - see setRadius().

## setRadius()

void juce::Draggable3DOrientation::setRadius | ( | float | newRadius | ) |

inline noexcept

Sets the size of the rotated object, as a proportion of the viewport's size.

See also
  setViewport

References juce::jmax().

## mouseDown()

template<typename Type>

void juce::Draggable3DOrientation::mouseDown | ( | Point< Type > | mousePos | ) |

inline noexcept

Begins a mouse-drag operation.

You must call this before any calls to mouseDrag(). The position that is supplied will be treated as being relative to the centre of the rectangle passed to setViewport().

## mouseDrag()

template<typename Type>

void juce::Draggable3DOrientation::mouseDrag | ( | Point< Type > | mousePos | ) |

inline noexcept

Continues a mouse-drag operation.

After calling mouseDown() to begin a drag sequence, you can call this method to continue it.

## getRotationMatrix()

Matrix3D< float > juce::Draggable3DOrientation::getRotationMatrix | ( |  | ) | const

inline noexcept

Returns the matrix that should be used to apply the current orientation.

See also
  applyToOpenGLMatrix

## getQuaternion()

QuaternionType & juce::Draggable3DOrientation::getQuaternion | ( |  | ) |

inline noexcept

Provides direct access to the quaternion.

### Purchase

Get JUCE

### Discover

What's New in JUCE Features

### Learn

Documentaion Tutorials Made with JUCE Resources

### Support

JUCE Forum Newsletter Archive

### About

Contact Us JUCE Legal JUCE Licensing FAQ

### Events

Audio Developer Conference
© Raw Material Software Limited