Skip to content

Commit

Permalink
schema update
Browse files Browse the repository at this point in the history
  • Loading branch information
keyboardspecialist committed Oct 31, 2024
1 parent 80bf0a4 commit 5579e85
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,10 @@ namespace CesiumGltf {
static inline constexpr const char* TypeName = "ExtensionKhrGaussianSplatting";
static inline constexpr const char* ExtensionName = "KHR_gaussian_splatting";

/**
* @brief Scale used when dequantizing position attribute values
*/
double quantizedPositionScale = 1;

};
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#pragma once

#include <CesiumGltf/ExtensionKhrGaussianSplatting.h>
#include <CesiumJsonReader/DoubleJsonHandler.h>
#include <CesiumJsonReader/ExtensibleObjectJsonHandler.h>

namespace CesiumJsonReader {
Expand Down Expand Up @@ -31,6 +32,6 @@ namespace CesiumGltfReader {
private:

CesiumGltf::ExtensionKhrGaussianSplatting* _pObject = nullptr;

CesiumJsonReader::DoubleJsonHandler _quantizedPositionScale;
};
}
4 changes: 2 additions & 2 deletions CesiumGltfReader/generated/src/GeneratedJsonHandlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1362,7 +1362,7 @@ CesiumJsonReader::ReadJsonResult<std::vector<CesiumGltf::ExtensionCesiumPrimitiv

namespace CesiumGltfReader {

ExtensionKhrGaussianSplattingJsonHandler::ExtensionKhrGaussianSplattingJsonHandler(const CesiumJsonReader::JsonReaderOptions& options) noexcept : CesiumJsonReader::ExtensibleObjectJsonHandler(options) {}
ExtensionKhrGaussianSplattingJsonHandler::ExtensionKhrGaussianSplattingJsonHandler(const CesiumJsonReader::JsonReaderOptions& options) noexcept : CesiumJsonReader::ExtensibleObjectJsonHandler(options), _quantizedPositionScale() {}

void ExtensionKhrGaussianSplattingJsonHandler::reset(CesiumJsonReader::IJsonHandler* pParentHandler, CesiumGltf::ExtensionKhrGaussianSplatting* pObject) {
CesiumJsonReader::ExtensibleObjectJsonHandler::reset(pParentHandler, pObject);
Expand All @@ -1386,7 +1386,7 @@ void ExtensionKhrGaussianSplattingJsonHandler::reset(CesiumJsonReader::IJsonHand
CesiumJsonReader::IJsonHandler* ExtensionKhrGaussianSplattingJsonHandler::readObjectKeyExtensionKhrGaussianSplatting(const std::string& objectType, const std::string_view& str, CesiumGltf::ExtensionKhrGaussianSplatting& o) {
using namespace std::string_literals;

(void)o;
if ("quantizedPositionScale"s == str) return property("quantizedPositionScale", this->_quantizedPositionScale, o.quantizedPositionScale);

return this->readObjectKeyExtensibleObject(objectType, str, *this->_pObject);
}
Expand Down
5 changes: 5 additions & 0 deletions CesiumGltfWriter/generated/src/ModelJsonWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -953,6 +953,11 @@ void writeJson(
const CesiumJsonWriter::ExtensionWriterContext& context) {
jsonWriter.StartObject();

if (obj.quantizedPositionScale != 1) {
jsonWriter.Key("quantizedPositionScale");
writeJson(obj.quantizedPositionScale, jsonWriter, context);
}

writeExtensibleObject(obj, jsonWriter, context);

jsonWriter.EndObject();
Expand Down

0 comments on commit 5579e85

Please sign in to comment.