*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
/**
* @return The index of the object into the vector.
* @note It is client code responsibility to ensure that the vector is unambiguous. It should be in
* a glTF document, since there's one vector for each type.
*/
/**
* @return The index of the object into the vector.
* @note It is client code responsibility to ensure that the vector is unambiguous. It should be in
* a glTF document, since there's one vector for each type.
*/
/**
* @brief There may be scenarios in which the object, whose vector we're populating, changes, e.g.
/**
* @brief There may be scenarios in which the object, whose vector we're populating, changes, e.g.
- operator bool() const { return mVector != nullptr; }
- T* operator->() const { return &(*mVector)[mIndex]; }
- T& operator*() const { return (*mVector)[mIndex]; }
+ operator bool() const
+ {
+ return mVector != nullptr;
+ }
+ T* operator->() const
+ {
+ return &(*mVector)[mIndex];
+ }
+ T& operator*() const
+ {
+ return (*mVector)[mIndex];
+ }
- uint32_t mByteOffset = 0;
- uint32_t mByteLength;
- uint32_t mByteStride = 0; // if 0 after reading, it needs to be calculated
- uint32_t mTarget;
+ uint32_t mByteOffset = 0;
+ uint32_t mByteLength;
+ uint32_t mByteStride = 0; // if 0 after reading, it needs to be calculated
+ uint32_t mTarget;
- uint32_t mCount;
- bool mNormalized = false;
- AccessorType::Type mType = AccessorType::INVALID;
- std::vector<float> mMin;
- std::vector<float> mMax;
+ uint32_t mCount;
+ bool mNormalized = false;
+ AccessorType::Type mType = AccessorType::INVALID;
+ std::vector<float> mMin;
+ std::vector<float> mMax;
- NEAREST_MIPMAP_LINEAR = 9985,
- LINEAR_MIPMAP_NEAREST = 9986,
- LINEAR_MIPMAP_LINEAR = 9987,
+ NEAREST_MIPMAP_LINEAR = 9985,
+ LINEAR_MIPMAP_NEAREST = 9986,
+ LINEAR_MIPMAP_LINEAR = 9987,
- TextureInfo mBaseColorTexture;
- float mMetallicFactor = 1.f;
- float mRoughnessFactor = 1.f;
- TextureInfo mMetallicRoughnessTexture;
+ TextureInfo mBaseColorTexture;
+ float mMetallicFactor = 1.f;
+ float mRoughnessFactor = 1.f;
+ TextureInfo mMetallicRoughnessTexture;
- Pbr mPbrMetallicRoughness;
- TextureInfo mNormalTexture;
- TextureInfo mOcclusionTexture;
- TextureInfo mEmissiveTexture;
- Dali::Vector3 mEmissiveFactor;
- AlphaMode::Type mAlphaMode = AlphaMode::OPAQUE;
- float mAlphaCutoff = .5f;
- bool mDoubleSided = false;
+ Pbr mPbrMetallicRoughness;
+ TextureInfo mNormalTexture;
+ TextureInfo mOcclusionTexture;
+ TextureInfo mEmissiveTexture;
+ Dali::Vector3 mEmissiveFactor;
+ AlphaMode::Type mAlphaMode = AlphaMode::OPAQUE;
+ float mAlphaCutoff = .5f;
+ bool mDoubleSided = false;
- Ref<Accessor> mIndices;
- Ref<Material> mMaterial;
- Mode mMode = TRIANGLES;
+ Ref<Accessor> mIndices;
+ Ref<Material> mMaterial;
+ Mode mMode = TRIANGLES;
- Dali::Vector3 mTranslation = Dali::Vector3::ZERO;
- Dali::Quaternion mRotation = Dali::Quaternion::IDENTITY;
- Dali::Vector3 mScale = Dali::Vector3::ONE;
+ Dali::Vector3 mTranslation = Dali::Vector3::ZERO;
+ Dali::Quaternion mRotation = Dali::Quaternion::IDENTITY;
+ Dali::Vector3 mScale = Dali::Vector3::ONE;
- std::vector<Image> mImages;
- std::vector<Sampler> mSamplers;
- std::vector<Texture> mTextures;
+ std::vector<Image> mImages;
+ std::vector<Sampler> mSamplers;
+ std::vector<Texture> mTextures;
std::vector<Material> mMaterials;
std::vector<Mesh> mMeshes;
std::vector<Skin> mSkins;
std::vector<Camera> mCameras;
std::vector<Material> mMaterials;
std::vector<Mesh> mMeshes;
std::vector<Skin> mSkins;
std::vector<Camera> mCameras;
* @brief Provides a json::Property<T>::ReadFn for interpreting unsigned integers
* as a Ref<U> into a std::vector<U> data member of a type T.
*/
* @brief Provides a json::Property<T>::ReadFn for interpreting unsigned integers
* as a Ref<U> into a std::vector<U> data member of a type T.
*/
* @note The enum must: 1, be called Type, nested to T, 2, provide a FromString static method taking a const char*
* (string data) and a size_t (string length) and returning T::Type.
*/
* @note The enum must: 1, be called Type, nested to T, 2, provide a FromString static method taking a const char*
* (string data) and a size_t (string length) and returning T::Type.
*/
std::copy(floats.begin(), std::min(floats.end(), floats.begin() + sizeof(T) / sizeof(float)), result.AsFloat());
return result;
}
std::copy(floats.begin(), std::min(floats.end(), floats.begin() + sizeof(T) / sizeof(float)), result.AsFloat());
return result;
}