JUCE
|
Stores a 3D orientation, which can be rotated by dragging with the mouse. More...
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. More... | |
Draggable3DOrientation (const Quaternion< float > &quaternionToUse, float objectRadius=0.5f) noexcept | |
Creates a Draggable3DOrientation from a user-supplied quaternion. More... | |
void | reset (const VectorType &axis) noexcept |
Resets the orientation, specifying the axis to align it along. More... | |
void | setViewport (Rectangle< int > newArea) noexcept |
Sets the viewport area within which mouse-drag positions will occur. More... | |
void | setRadius (float newRadius) noexcept |
Sets the size of the rotated object, as a proportion of the viewport's size. More... | |
template<typename Type > | |
void | mouseDown (Point< Type > mousePos) noexcept |
Begins a mouse-drag operation. More... | |
template<typename Type > | |
void | mouseDrag (Point< Type > mousePos) noexcept |
Continues a mouse-drag operation. More... | |
Matrix3D< float > | getRotationMatrix () const noexcept |
Returns the matrix that should be used to apply the current orientation. More... | |
QuaternionType & | getQuaternion () noexcept |
Provides direct access to the quaternion. More... | |
Stores a 3D orientation, which can be rotated by dragging with the mouse.
using Draggable3DOrientation::VectorType = Vector3D<float> |
using Draggable3DOrientation::QuaternionType = Quaternion<float> |
|
noexcept |
Creates a Draggable3DOrientation, initially set up to be aligned along the X axis.
|
noexcept |
Creates a Draggable3DOrientation from a user-supplied quaternion.
|
noexcept |
Resets the orientation, specifying the axis to align it along.
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().
|
noexcept |
Sets the size of the rotated object, as a proportion of the viewport's size.
References jmax().
|
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().
|
noexcept |
Continues a mouse-drag operation.
After calling mouseDown() to begin a drag sequence, you can call this method to continue it.
|
noexcept |
Returns the matrix that should be used to apply the current orientation.
References Quaternion< Type >::getRotationMatrix().
|
noexcept |
Provides direct access to the quaternion.
References Quaternion< float >::fromAngle(), Rectangle< ValueType >::getCentreX(), Rectangle< ValueType >::getCentreY(), Rectangle< ValueType >::getHeight(), Rectangle< ValueType >::getWidth(), jassert, jlimit(), jmin(), BlocksProtocol::scale, Point< ValueType >::x, Vector3D< float >::xAxis(), and Point< ValueType >::y.