Giter VIP home page Giter VIP logo

Comments (2)

rdb avatar rdb commented on May 29, 2024

Thank you for sharing your frustrations.

We can't use a vtable call for register_with_read_factory since those can only be done on an already-constructed object. I'm not sure what the Panda designers' reason was to create a separate method for this, it does seem slightly unnecessary. I'd be happy to consider a change to directly call register_factory in the config files.

The reason why we do need a separate virtual fillin method is that further updates to a particular object will end up needing to call fillin again in order to adopt the changed fields. This is useful when synchronizing Panda scenes over a socket connection.

For the default TextureStage, it is important that it is always resolved to the singleton default TextureStage, so checking the field and returning this pointer in make_from_bam was the easiest way to implement this. This isn't actually the best way to implement this, since it breaks when streaming changes to this object. It should instead just "peek" at the first value in the datagram, or it should implement change_this like RenderState does.

I wasn't aware of the existence of those templates or documentation files. I agree we need to update or remove them, and also update the remaining cases of factory functions that are not called make_from_bam.

Please note the existence of this document, which contains my own notes as I wrote my own bam writer library, though it looks like you might already be largely past the point where this might be useful.

from panda3d.

NWPlayer123 avatar NWPlayer123 commented on May 29, 2024

We can't use a vtable call for register_with_read_factory since those can only be done on an already-constructed object. I'm not sure what the Panda designers' reason was to create a separate method for this, it does seem slightly unnecessary. I'd be happy to consider a change to directly call register_factory in the config files.

Ah, right. The only reason I could see keeping registration in each cxx is to keep all class-specific behavior there, but now that every registered function is called make_from_bam and is easy enough to find, it'd be better to centralize it in the config files.

The reason why we do need a separate virtual fillin method is that further updates to a particular object will end up needing to call fillin again in order to adopt the changed fields. This is useful when synchronizing Panda scenes over a socket connection.

Makes sense, I haven't looked into runtime behavior much yet.

Please note the existence of this document, which contains my own notes as I wrote my own bam writer library, though it looks like you might already be largely past the point where this might be useful.

Saves me the work of having to go through each bam revision when adding crate documentation, thanks!

from panda3d.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.