class
#include <Magnum/Trade/ObjectData2D.h>
ObjectData2D Two-dimensional object data.
Provides access to object transformation and hierarchy.
Derived classes
- class MeshObjectData2D deprecated in Git master
- Two-dimensional mesh object data.
Constructors, destructors, conversion operators
-
ObjectData2D(std::
vector<UnsignedInt> children, const Matrix3& transformation, ObjectInstanceType2D instanceType, UnsignedInt instance, const void* importerState = nullptr) explicit - Construct with combined transformation.
-
ObjectData2D(std::
vector<UnsignedInt> children, const Vector2& translation, const Complex& rotation, const Vector2& scaling, ObjectInstanceType2D instanceType, UnsignedInt instance, const void* importerState = nullptr) explicit - Construct with separate transformations.
-
ObjectData2D(std::
vector<UnsignedInt> children, const Matrix3& transformation, const void* importerState = nullptr) explicit - Construct empty instance with combined transformation.
-
ObjectData2D(std::
vector<UnsignedInt> children, const Vector2& translation, const Complex& rotation, const Vector2& scaling, const void* importerState = nullptr) explicit - Construct empty instance with separate transformations.
- ObjectData2D(const ObjectData2D&) deleted
- Copying is not allowed.
- ObjectData2D(ObjectData2D&&) noexcept
- Move constructor.
- ~ObjectData2D() virtual
- Destructor.
Public functions
- auto operator=(const ObjectData2D&) -> ObjectData2D& deleted
- Copying is not allowed.
- auto operator=(ObjectData2D&&) -> ObjectData2D& noexcept
- Move assignment.
-
auto children() -> std::
vector<UnsignedInt>& - Child objects.
-
auto children() const -> const std::
vector<UnsignedInt>& - auto flags() const -> ObjectFlags2D
- Flags.
- auto translation() const -> Vector2
- Translation (relative to parent)
- auto rotation() const -> Complex
- Rotation (relative to parent)
- auto scaling() const -> Vector2
- Scaling (relative to parent)
- auto transformation() const -> Matrix3
- Transformation (relative to parent)
- auto instanceType() const -> ObjectInstanceType2D
- Instance type.
- auto instance() const -> Int
- Instance ID.
- auto importerState() const -> const void*
- Importer-specific state.
Function documentation
Magnum:: Trade:: ObjectData2D:: ObjectData2D(std:: vector<UnsignedInt> children,
const Matrix3& transformation,
ObjectInstanceType2D instanceType,
UnsignedInt instance,
const void* importerState = nullptr) explicit
Construct with combined transformation.
Parameters | |
---|---|
children | Child objects |
transformation | Transformation (relative to parent) |
instanceType | Instance type |
instance | Instance ID |
importerState | Importer-specific state |
Magnum:: Trade:: ObjectData2D:: ObjectData2D(std:: vector<UnsignedInt> children,
const Vector2& translation,
const Complex& rotation,
const Vector2& scaling,
ObjectInstanceType2D instanceType,
UnsignedInt instance,
const void* importerState = nullptr) explicit
Construct with separate transformations.
Parameters | |
---|---|
children | Child objects |
translation | Translation (relative to parent) |
rotation | Rotation (relative to parent) |
scaling | Scaling (relative to parent) |
instanceType | Instance type |
instance | Instance ID |
importerState | Importer-specific state |
Magnum:: Trade:: ObjectData2D:: ObjectData2D(std:: vector<UnsignedInt> children,
const Matrix3& transformation,
const void* importerState = nullptr) explicit
Construct empty instance with combined transformation.
Parameters | |
---|---|
children | Child objects |
transformation | Transformation (relative to parent) |
importerState | Importer-specific state |
Magnum:: Trade:: ObjectData2D:: ObjectData2D(std:: vector<UnsignedInt> children,
const Vector2& translation,
const Complex& rotation,
const Vector2& scaling,
const void* importerState = nullptr) explicit
Construct empty instance with separate transformations.
Parameters | |
---|---|
children | Child objects |
translation | Translation (relative to parent) |
rotation | Rotation (relative to parent) |
scaling | Scaling (relative to parent) |
importerState | Importer-specific state |
const std:: vector<UnsignedInt>& Magnum:: Trade:: ObjectData2D:: children() const
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Vector2 Magnum:: Trade:: ObjectData2D:: translation() const
Translation (relative to parent)
Available only if ObjectFlag2D::
Complex Magnum:: Trade:: ObjectData2D:: rotation() const
Rotation (relative to parent)
Available only if ObjectFlag2D::
Vector2 Magnum:: Trade:: ObjectData2D:: scaling() const
Scaling (relative to parent)
Available only if ObjectFlag2D::
Matrix3 Magnum:: Trade:: ObjectData2D:: transformation() const
Transformation (relative to parent)
If ObjectFlag2D::
The corresponding code is as follows:
Matrix3 transformation = Matrix3::from(data.rotation().toMatrix(), data.translation())* Matrix3::scaling(data.scaling());
ObjectInstanceType2D Magnum:: Trade:: ObjectData2D:: instanceType() const
Instance type.
Int Magnum:: Trade:: ObjectData2D:: instance() const
Instance ID.
Returns ID of given camera / light / mesh etc., specified by instanceType(). If instanceType() is ObjectInstanceType2D::-1
.
const void* Magnum:: Trade:: ObjectData2D:: importerState() const
Importer-specific state.
See AbstractImporter::