We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks.
Unify math library
Unify math library
Bug #4634 [Closed]
Not sure if GLM works
Link
http://glm.g-truc.net/0.9.5/code.html
https://github.com/g-truc/glm
Currently cocos2d-x has two math libraries:
Problem:
Solution:
Replace kazmath and CCGeometry with a good, object oriented, mobile-optimized math library like Gameplay's math library.
Scope:
The cocos2d API should be replaced:
Point
should be replaced byVector2
Vertex3
should be replaced byVector3
kmMat4
should be replaced byMatrix
But it should be backwards compatible (whenever it makes sense).
eg:
Point
could be defined as:Additionally, the API should be optimized for 2D... at least for the moment.
So,
getPosition()
should return aconst &Vector2
(since position is stored internally in aVector2
... butgetPosition3()
should return aVector3
(noconst&
)....at least for the moment.