Merge pull request #4702 from Gargaj/assbinlights

add missing light data to assbin import/export
pull/4713/head^2
Kim Kulling 2022-09-05 18:29:59 +02:00 committed by GitHub
commit 57f4163c67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -642,6 +642,10 @@ protected:
Write<aiString>(&chunk, l->mName); Write<aiString>(&chunk, l->mName);
Write<unsigned int>(&chunk, l->mType); Write<unsigned int>(&chunk, l->mType);
Write<aiVector3D>(&chunk, l->mPosition);
Write<aiVector3D>(&chunk, l->mDirection);
Write<aiVector3D>(&chunk, l->mUp);
if (l->mType != aiLightSource_DIRECTIONAL) { if (l->mType != aiLightSource_DIRECTIONAL) {
Write<float>(&chunk, l->mAttenuationConstant); Write<float>(&chunk, l->mAttenuationConstant);
Write<float>(&chunk, l->mAttenuationLinear); Write<float>(&chunk, l->mAttenuationLinear);

View File

@ -556,6 +556,10 @@ void AssbinImporter::ReadBinaryLight(IOStream *stream, aiLight *l) {
l->mName = Read<aiString>(stream); l->mName = Read<aiString>(stream);
l->mType = (aiLightSourceType)Read<unsigned int>(stream); l->mType = (aiLightSourceType)Read<unsigned int>(stream);
l->mPosition = Read<aiVector3D>(stream);
l->mDirection = Read<aiVector3D>(stream);
l->mUp = Read<aiVector3D>(stream);
if (l->mType != aiLightSource_DIRECTIONAL) { if (l->mType != aiLightSource_DIRECTIONAL) {
l->mAttenuationConstant = Read<float>(stream); l->mAttenuationConstant = Read<float>(stream);
l->mAttenuationLinear = Read<float>(stream); l->mAttenuationLinear = Read<float>(stream);