Coder Social home page Coder Social logo

Comments (6)

JeroMiya avatar JeroMiya commented on September 3, 2024

Status update:
I found a way to do this without generics and with mostly minimal breaking changes. I went with creating a new base class InterfaceGameObjectBase, which InterfaceGameObject now derives from. OrientationInterface, PositionInterface, and PoseInterface now derive from InterfaceGameObjectBase instead of InterfaceGameObject. This allows existing users of InterfaceGameObject and InterfaceBase to continue working without breaking changes!

Work done:

  • Created InterfaceAdapter subclasses for Unity conversions.
  • Created InterfaceGameObjectBase, a new base class of OrientationInterface, PoseInterface, PositionInterface, and InterfaceGameObject (exposes InterfaceCallbacks).
  • Using the State APIs in OrientationInterface, PoseInterface, and PositionInterface.

Work left to do:

  • Classes for each interface type aside from InterfaceBase for components to derive from to inject strongly typed interfaces without attributes or GetComponent usage, like InterfaceBase.
  • InterfaceGameObjectBase subclasses for analog and button interfaces, along with respective InterfaceBase-like utility base classes.

from osvr-unity.

JeroMiya avatar JeroMiya commented on September 3, 2024

OK, this is implemented in a branch here:
master...JeroMiya:Adapters

Could I get a code review? Thanks.

from osvr-unity.

rpavlik avatar rpavlik commented on September 3, 2024

Easiest to comment if you start a pull request. Does this eliminate the code that used to be generated by that Lua file? (Just re-noticed that script the other day when doing OSVR-Unity/Managed-OSVR transitions.)

from osvr-unity.

JeroMiya avatar JeroMiya commented on September 3, 2024

I left InterfaceCallbacks in place for backwards compatibility, so the lua script is still applicable for now. But maybe I should mark those classes as obsolete?

from osvr-unity.

rpavlik avatar rpavlik commented on September 3, 2024

Well, if you've got a better way, then please do. I don't remember if anything internal relies on them - it might. (Feel free to modify the lua script to add the deprecated thing and re-generate)

from osvr-unity.

JeroMiya avatar JeroMiya commented on September 3, 2024

I just marked the class as obsolete. No need to modify the lua script. Pull request is up now:
https://github.com/OSVR/OSVR-Unity/pull/57/files

from osvr-unity.

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.