Modify the blob lh/rh flag depending on writer params
MODIFY
include/irr/asset/IAssetWriter.h
include/irr/asset/IAssetWriter.h
@@ -94,6 +94,12 @@ public:
return ctx.params.flags;
}
+ //! It allows you to get writer flags which specify some information on saving process like handedness coordinate system
+ inline virtual IAssetWriter::E_WRITER_PARAMETER_FLAGS getAssetWritingParameterFlags(const SAssetWriteContext& ctx, const IAsset* assetToWrite, const uint32_t& hierarchyLevel)
+ {
+ return ctx.params.writerFlags;
+ }
+
//! For altering the compression level for individual assets, i.e. images, etc.
inline virtual float getAssetCompressionLevel(const SAssetWriteContext& ctx, const IAsset* assetToWrite, const uint32_t& hierarchyLevel)
{

MODIFY
include/irr/asset/bawformat/blobs/MeshBufferBlob.h
include/irr/asset/bawformat/blobs/MeshBufferBlob.h
@@ -37,7 +37,7 @@ struct IRR_FORCE_EBO MeshBufferBlobV3 : TypedBlob<MeshBufferBlobV3, ICPUMeshBuff
uint32_t baseInstance;
uint32_t primitiveType;
uint32_t posAttrId;
- bool isRightHandedCoordinateSystem;
+ uint8_t isRightHandedCoordinateSystem;
} PACK_STRUCT;
#include "irr/irrunpack.h"
static_assert(sizeof(MeshBufferBlobV3::mat)==197, "sizeof(MeshBufferBlobV0::mat) must be 197");

MODIFY
src/irr/asset/CBAWMeshWriter.cpp
src/irr/asset/CBAWMeshWriter.cpp
@@ -79,6 +79,13 @@ struct LzmaMemMngmnt
MeshBufferBlobV3 data(_obj);
const E_WRITER_FLAGS flags = _ctx.writerOverride->getAssetWritingFlags(_ctx.inner, _obj, 1u);
+ const auto parameterFlags = _ctx.writerOverride->getAssetWritingParameterFlags(_ctx.inner, _obj, 1u);
+
+ if (parameterFlags & IAssetWriter::E_WRITER_PARAMETER_FLAGS::EWPF_MESH_IS_RIGHT_HANDED)
+ data.isRightHandedCoordinateSystem = 1;
+ else
+ data.isRightHandedCoordinateSystem = 0;
+
const uint8_t* encrPwd = nullptr;
_ctx.writerOverride->getEncryptionKey(encrPwd, _ctx.inner, _obj, 1u);
const float comprLvl = _ctx.writerOverride->getAssetCompressionLevel(_ctx.inner, _obj, 1u);

MODIFY
src/irr/asset/bawformat/CBAWFile.cpp
src/irr/asset/bawformat/CBAWFile.cpp
@@ -80,6 +80,8 @@ MeshBufferBlobV3::MeshBufferBlobV3(const asset::ICPUMeshBuffer* _mb)
baseInstance = _mb->getBaseInstance();
primitiveType = _mb->getPrimitiveType();
posAttrId = _mb->getPositionAttributeIx();
+
+ isRightHandedCoordinateSystem = 0; // false
}
MeshBufferBlobV3::MeshBufferBlobV3(const legacyv2::MeshBufferBlobV2* meshBufferV2)
@@ -97,7 +99,7 @@ MeshBufferBlobV3::MeshBufferBlobV3(const legacyv2::MeshBufferBlobV2* meshBufferV
primitiveType = meshBufferV2->primitiveType;
posAttrId = meshBufferV2->posAttrId;
- isRightHandedCoordinateSystem = false;
+ isRightHandedCoordinateSystem = 0; // false
}
template<>

Modify the blob lh/rh flag depending on writer params