VOXELFORMAT: store cameras for gox format

master
Martin Gerhardy 2022-04-17 13:02:26 +02:00
parent 68c3f2256c
commit 4cea5d91d0
2 changed files with 18 additions and 6 deletions

View File

@ -442,6 +442,22 @@ bool GoxFormat::saveChunk_DictEntry(io::SeekableWriteStream &stream, const char
return true;
}
bool GoxFormat::saveChunk_CAMR(io::SeekableWriteStream& stream, const SceneGraph &sceneGraph) {
// TODO: fill with proper values
for (auto iter = sceneGraph.begin(SceneGraphNodeType::Camera); iter != sceneGraph.end(); ++iter) {
GoxScopedChunkWriter scoped(stream, FourCC('C', 'A', 'M', 'R'));
wrapBool(saveChunk_DictEntry(stream, "name", (*iter).name().c_str(), (*iter).name().size()))
wrapBool(saveChunk_DictEntry(stream, "active", "false", 5))
float distance = 10.0f;
wrapBool(saveChunk_DictEntry(stream, "active", &distance, sizeof(distance)))
char ortho = 0;
wrapBool(saveChunk_DictEntry(stream, "ortho", &ortho, sizeof(ortho)))
const glm::mat4x4 &mat = (*iter).transformForFrame(0).matrix();
wrapBool(saveChunk_DictEntry(stream, "mat", &mat, sizeof(mat)))
}
return true;
}
bool GoxFormat::saveChunk_IMG(io::SeekableWriteStream& stream) {
return true; // not used
}
@ -450,10 +466,6 @@ bool GoxFormat::saveChunk_PREV(io::SeekableWriteStream& stream) {
return true; // not used
}
bool GoxFormat::saveChunk_CAMR(io::SeekableWriteStream& stream) {
return true; // not used
}
bool GoxFormat::saveChunk_LIGH(io::SeekableWriteStream& stream) {
return true; // not used
}
@ -595,7 +607,7 @@ bool GoxFormat::saveGroups(const SceneGraph &sceneGraph, const core::String &fil
wrapBool(saveChunk_BL16(stream, sceneGraph, blocks))
wrapBool(saveChunk_MATE(stream))
wrapBool(saveChunk_LAYR(stream, sceneGraph, blocks))
wrapBool(saveChunk_CAMR(stream))
wrapBool(saveChunk_CAMR(stream, sceneGraph))
wrapBool(saveChunk_LIGH(stream))
return true;

View File

@ -102,7 +102,7 @@ private:
bool saveChunk_IMG(io::SeekableWriteStream &stream);
bool saveChunk_PREV(io::SeekableWriteStream &stream);
// Write all the cameras - not used.
bool saveChunk_CAMR(io::SeekableWriteStream &stream);
bool saveChunk_CAMR(io::SeekableWriteStream &stream, const SceneGraph &sceneGraph);
// Write all the lights - not used.
bool saveChunk_LIGH(io::SeekableWriteStream &stream);