Hi! I am having a hard time figuring out how to register a templated function.
I read this page: http://www.angelcode.com/angelscript/sdk/docs/manual/doc_adv_template.html
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?