feat(codegen): SceneSerializer glm::vec3 Clamp support (#451 slice)#580
Conversation
…ields Migrates BuoyancyComponent and NoiseAnimationComponent off kComponentsCustomSerialize by teaching OLO_SERIALIZE(Clamp, Min=..., Max=...) to accept glm::vec3 fields (clamped per-component via glm::clamp/glm::max/glm::min), closing the vec3-Clamp gap called out in issue #451 as a natural follow-up to the scalar Clamp slice. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughExtends the OloHeaderTool serialization codegen to support ChangesVec3 Clamp Codegen
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…p/ApplyVec3Clamp Both helpers had identical both/one-sided/no-op branching, differing only in the clamp-function namespace and how a bound gets wrapped. Factored the branching into AssembleClampExpr; regenerated .inl output is byte-identical, confirming this is behavior-preserving. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|




Summary
OLO_SERIALIZE(Clamp, Min=…, Max=…)(issue Codegen: SceneSerializer blocks for complex-field components (#380 follow-up) #451's Clamp slice, Add clamping functionality to component serialization and deserializa… #536) to acceptglm::vec3fields, clamped per-component viaglm::clamp/glm::max/glm::min— mirroring the hand-writtenSanitizeVec3Clampedidiom.BuoyancyComponent(m_ProbeExtents, plus its five scalar float fields onto the existing scalarClamp) andNoiseAnimationComponent(RotationAmplitude/TranslationAmplitude, plusChainLength/Octaves/Frequency/Lacunarity/Gain/Weight) fully offkComponentsCustomSerializeand onto the generatedSceneSerializer.cpppath — both were excluded solely for this reason..inlfiles are behaviorally identical to the removed code.Vec3ClampSerializerCodegenTest.cppmirroring the existing codegen-test pattern (in-range/out-of-range/missing-key/min-only/max-only/non-finite-fallback cases).CLAUDE.md,ComponentReflection.h's doc comment, and issue Codegen: SceneSerializer blocks for complex-field components (#380 follow-up) #451's body (struck through the completed item; left the umbrella issue open for remaining scope).Test plan
ComponentSerializerCoverage.*(existence + disjointness) passComponentTupleCoverage.*/ComponentHandlerCoverage.*/SaveGameComponentSerializerCoverage.*passComponentRoundTrip.BuoyancyComponentSurvivesYAMLRoundTrip/NoiseAnimationComponentSurvivesYAMLRoundTrip/NoiseAnimationComponentNonFiniteFieldsAreSanitizedOnLoadpassVec3ClampSerializerCodegen.*(6/6) passOloEngine-Testssuite: 4188 passed, 5 skipped (environment-gated), 0 failed🤖 Generated with Claude Code
Summary by CodeRabbit
vec3) fields, applying per-component bounds during scene loading.vec3clamp behavior, including min-only/max-only and fallback scenarios.vec3clamp examples and behavior notes.