mirror of https://github.com/mosra/magnum.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
2.0 KiB
60 lines
2.0 KiB
|
14 years ago
|
#ifndef Magnum_Trade_MeshObjectData2D_h
|
||
|
|
#define Magnum_Trade_MeshObjectData2D_h
|
||
|
14 years ago
|
/*
|
||
|
|
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz>
|
||
|
|
|
||
|
|
This file is part of Magnum.
|
||
|
|
|
||
|
|
Magnum is free software: you can redistribute it and/or modify
|
||
|
|
it under the terms of the GNU Lesser General Public License version 3
|
||
|
|
only, as published by the Free Software Foundation.
|
||
|
|
|
||
|
|
Magnum is distributed in the hope that it will be useful,
|
||
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
|
GNU Lesser General Public License version 3 for more details.
|
||
|
|
*/
|
||
|
|
|
||
|
|
/** @file
|
||
|
14 years ago
|
* @brief Class Magnum::Trade::MeshObjectData2D
|
||
|
14 years ago
|
*/
|
||
|
|
|
||
|
14 years ago
|
#include "ObjectData2D.h"
|
||
|
14 years ago
|
|
||
|
|
namespace Magnum { namespace Trade {
|
||
|
|
|
||
|
|
/**
|
||
|
14 years ago
|
@brief Two-dimensional mesh object data
|
||
|
14 years ago
|
|
||
|
|
Provides access to material information for given mesh instance.
|
||
|
|
*/
|
||
|
14 years ago
|
class MeshObjectData2D: public ObjectData2D {
|
||
|
|
MeshObjectData2D(const MeshObjectData2D& other) = delete;
|
||
|
|
MeshObjectData2D(MeshObjectData2D&& other) = delete;
|
||
|
|
MeshObjectData2D& operator=(const MeshObjectData2D& other) = delete;
|
||
|
|
MeshObjectData2D& operator=(MeshObjectData2D&& other) = delete;
|
||
|
14 years ago
|
|
||
|
|
public:
|
||
|
|
/**
|
||
|
|
* @brief Constructor
|
||
|
14 years ago
|
* @param name %Mesh object name
|
||
|
14 years ago
|
* @param children Child objects
|
||
|
|
* @param transformation Transformation (relative to parent)
|
||
|
|
* @param instance Instance ID
|
||
|
|
* @param material Material ID
|
||
|
|
*
|
||
|
|
* Creates object with mesh instance type.
|
||
|
|
*/
|
||
|
14 years ago
|
inline MeshObjectData2D(const std::string& name, const std::vector<unsigned int>& children, const Matrix4& transformation, unsigned int instance, unsigned int material): ObjectData2D(name, children, transformation, InstanceType::Mesh, instance), _material(material) {}
|
||
|
14 years ago
|
|
||
|
|
/** @brief Material ID */
|
||
|
14 years ago
|
inline unsigned int material() const { return _material; }
|
||
|
14 years ago
|
|
||
|
|
private:
|
||
|
14 years ago
|
unsigned int _material;
|
||
|
14 years ago
|
};
|
||
|
|
|
||
|
|
}}
|
||
|
|
|
||
|
|
#endif
|