• Breaking News

    Register a templated function? Hi! I am having a hard time figuring out how to register a templated function. I read this page: http://bit.ly/2YGXQYW But it only seems to cover how to create a templated type with member functions (object behaviors). I saw this thread that has almost the same problem and usecase as me, in it one of the comments says that the following usage should be possible in AngelScript. Velocity@ vel = entity.getComponent(); But it doesn't go into any details on how to do this. It also suggests this syntax which I would prefer to avoid if possible, and yes I read the part about this having better performance. entity.getVelocity(); My most preferable usecase would be getComponent(entity); with entity.getComponent() as a close second. Is this even possible without a templated type? Could anyone show me a concrete example of registering a templated global function, preferable with specializations as well? https://ift.tt/eA8V8J

    Hi! I am having a hard time figuring out how to register a templated function. I read this page: http://bit.ly/2YGXQYW But it only seems to cover how to create a templated type with member functions (object behaviors). I saw this thread that has almost the same problem and usecase as me, in it one of the comments says that the following usage should be possible in AngelScript. Velocity@ vel = entity.getComponent<Velocity>(); But it doesn't go into any details on how to do this. It also suggests this syntax which I would prefer to avoid if possible, and yes I read the part about this having better performance. entity.getVelocity(); My most preferable usecase would be getComponent<Velocity>(entity); with entity.getComponent<Velocity>() as a close second. Is this even possible without a templated type? Could anyone show me a concrete example of registering a templated global function, preferable with specializations as well?

    from GameDev.net http://bit.ly/2HAA8b4

    ليست هناك تعليقات

    Post Top Ad

    ad728

    Post Bottom Ad

    ad728