42 Commits
Author SHA1 Message Date
Bret Curtis 812e108521 Carry plain values as user data instead of osg::Object wrappers
osg::UserDataContainer only accepts osg::Object, so four payloads that are
pure game data inherited from it purely to get in the door: TextKeyMapHolder,
MWRender::PtrHolder, RefnumMarker and RefnumSet. SceneUtil::UserData<T> takes
that base on once so the payloads do not have to, which lets TextKeyMapHolder,
PtrHolder and RefnumSet disappear entirely in favour of TextKeyMap, MWWorld::Ptr
and std::vector<ESM::RefNum>, and leaves RefnumMarker a plain aggregate. The
five hand-rolled dynamic_cast scans over the container collapse into findUserData
and forEachUserData, which also drops the positional getUserObject(0) assumption
in getPagedRefnums in favour of a lookup by type.
2026-09-21 10:09:03 +02:00
Bret Curtis d69b861fcb Restore TemplateRef as a nameable marker for scene dumps
Deleting the wrapper missed that it had a second job: being a type serialize.cpp could ignore by name, which a bare osg::Object parked in a user data container cannot be singled out for. Without it a scene dump hoists the entire template subtree into the user-data block and demotes the node's real children to bare UniqueID back-references, and no blunt filter can fix that because the same containers carry shaderPrefix, recordIndex and fileHash value objects that the dump should keep. TemplateMultiRef stays gone, the eight call sites still share one addTemplateRef helper that ignores a null template, and holding a ref_ptr<const osg::Object> means no call site needs a const_cast any more.
2026-09-20 12:18:52 +02:00
Bret Curtis 586a9dafc3 Drop TemplateRef/TemplateMultiRef wrappers
Both were osg::Object subclasses whose only job was to hold a ref_ptr to another Object so it could be parked in a UserDataContainer. Since UserDataContainer already keeps a ref to any object handed to it, the wrapper is dead weight; add the referenced object directly with addUserObject instead. Nothing reads the wrappers back (no dynamic_cast hits on either type), so pure keep-alive semantics are preserved and no visitor logic changes; serializer ignore-list entries for the two class names are dropped alongside.
2026-09-18 18:50:02 +02:00
Cody Glassman 6a5840c895 rename some things and fix default state 2026-08-08 10:52:57 -07:00
Cody Glassman 8da72387d4 add serializer and fix the cs 2026-08-08 10:52:57 -07:00
Cody Glassman e827efdba8 remove osg::Fog 2026-07-31 08:37:35 -07:00
Alexei Kotov a5aed7b00f Implement NiLookAtController (#6938) 2026-07-22 21:42:13 +03:00
Alexei Kotov fe97ae7b98 Serialize AutoTransform mode 2026-06-23 15:02:32 +03:00
Alexei Kotov c000a02354 Implement ROTATE_ABOUT_UP billboard mode 2026-06-21 23:14:28 +03:00
Cody GlassmanandSarah Sunday e53536a3ec Remove exclusive FFP mode 2026-03-15 14:13:19 -05:00
Alexei Kotov cfa1ad0b33 Add a dummy serializer for billboards 2025-02-04 20:22:14 +03:00
Sam Hellawell 014cba807b Refactor easings, serialize per-line items, constexpr path 2024-07-19 00:04:16 +01:00
Sam Hellawell eb290bebbb Refactor AnimBlendControllers 2024-07-19 00:04:16 +01:00
Sam Hellawell 00a7d0281f Cleanup, refactor, rename AnimBlendControllerBase -> AnimBlendController 2024-07-19 00:04:16 +01:00
Sam Hellawell 42406ed0af Use META_Object, ignore for serialize 2024-07-19 00:04:16 +01:00
Alexei Kotov cbe61e2c93 In TextureType, use osg::Object's name field 2024-05-31 14:42:48 +03:00
Alexei Kotov 84f4ba4ca1 Support defining the texture type with a state attribute (#6240)
Named textures are still supported for easier native format compatibility (and so that I don't have to edit the documentation)
2024-05-18 23:11:20 +03:00
Alexei Kotov 38ab09a52e Try to uncursify DebugDrawer scene representation 2024-02-09 20:49:40 +03:00
Alexei Kotov 9cdaf2c29b Handle NiFogProperty (feature #5173) 2023-12-09 17:13:16 +03:00
Alexei Kotov 715efe6cb1 Handle NiParticleBomb (feature #7634) 2023-10-22 16:26:46 +03:00
clang-format-botandζeh Matt ddb0522bbf Apply clang-format to code base 2022-09-22 21:35:26 +03:00
Nelsson Huotariandpsi29a 334c6dde0b custom class for osgAnimation::RigGeometry, Collada animated deforming body parts 2022-06-21 15:27:34 +00:00
glassmancody.info 750514cda2 simply lightmanager and fix racey behavior 2021-11-18 19:40:13 -08:00
Bo SvenssonandGitHub 5debd6e25a removes two dummy serialisers (#3212)
This PR removes dummy serialisers for `StateSetUpdater`, `NodeCallback` and the respective `META` macros that trigger serialisation requirement here.

`StateSetUpdater` and `NodeCallback` are just base classes that can not be used on their own, so there is no need to incorporate them into serialisation. These changes might have minor effects on derived classes that forget to override `className()`, `libraryName()` through `META`, but it makes hardly a difference to now serialise such classes as a dysfunctional `osg::Callback` instead of a dysfunctional `SceneUtil::NodeCallback`.
2021-11-04 22:31:22 +01:00
Andrei Kortunov 566380c0d6 Fix showscenegraph warnings 2021-10-24 12:37:49 +04:00
Alexei Dobrohotov b49f51cbfc Serialize NifOsg::MatrixTransform children properly 2021-08-12 18:33:06 +03:00
Andrei Kortunov 2e8873af51 Add new scene nodes to scene graph serializer blacklist 2021-05-07 19:27:23 +04:00
Andrei Kortunov f175beb304 Define template ref classes in components 2021-01-13 14:25:21 +04:00
Alexei Dobrohotov 4fc5e22e9e NIF fixes and cleanup
Get rid of NodeIndexHolder
Use unsigned 32-bit type for NIF record index
Fix calculation of the number of UV sets
2020-10-26 02:51:25 +03:00
Andrei Kortunov 215ddb9106 Do not print warnings for VisController 2020-08-12 11:16:37 +04:00
Capostrophic 46825e8a4d Move NIF record index back to a separate user object
This makes sure it's never erroneously optimized out. NodeIndexHolders don't need to be cloned as their record index is never supposed to be changed.
2020-07-26 09:57:43 +03:00
Capostrophic cc791af0f5 Serialization fixes
Make sure NifOsg::MatrixTransform serialization behaves as intended
Add a dummy serializer for NifOsg::UVController
2020-07-26 09:57:43 +03:00
Capostrophic a61267f57d Replace NodeUserData with a custom transform node 2020-07-26 09:57:43 +03:00
Capostrophic 4c9cefefdd Get rid of NifOsg::CollisionSwitch 2020-07-26 09:57:43 +03:00
Capostrophic 63fe02b1ba CollisionSwitch and Switch/LOD node fixes
Properly apply transformations to both switch and LOD nodes
Allow both NiSwitchNode and NiLODNode to be the root node
Properly add CollisionSwitch into the scene graph
2020-04-30 15:04:57 +03:00
Bret Curtis 31a75a962a Add 3 additional classes to be ignored who dumping "showscenegraph" debug output; less spammy 2020-04-27 11:56:10 +02:00
Bret Curtis ca0adc25bb add two additional classes we do not need to serialize; less pam during showscenegraph debug dump. 2020-04-27 11:51:18 +02:00
scrawl 5d524a6a10 Add custom version of MorphGeometry replacing osgAnimation
Double buffering, custom bounding box and the update in the cull visitor (instead of update) are now all handled internally rather than needing hacks and/or callbacks.
2017-09-01 21:42:36 +00:00
scrawl 209e139aa8 Move double buffering implementation inside RigGeometry
The double buffering is an implementation detail so it should be handled as such, rather than mandating the scene graph to be structured in a certain way.

Override accept(NodeVisitor&) instead of using callbacks.
2017-09-01 21:42:34 +00:00
scrawl 305cccd263 Don't print Geometry data (vertices, triangles, etc.) in showscenegraph 2017-02-23 23:28:50 +01:00
scrawl 53e4db8a8f Add dummy serializer for CameraRelativeTransform to allow serializing content of Sky Root 2017-02-02 21:57:18 +01:00
scrawl 34deb6e7b1 Add 'showSceneGraph' command to export the scene or a particular object to .osgt for debugging purposes 2017-02-01 06:00:14 +01:00