草庐IT

newVector3

全部标签

c++ - 对于 C++ Vector3 实用程序类实现,数组是否比结构和类快?

出于好奇,我以3种方式实现了vector3实用程序:数组(使用typedef)、类和结构这是数组实现:typedeffloatnewVector3[3];namespacevec3{voidadd(constnewVector3&first,constnewVector3&second,newVector3&out_newVector3);voidsubtract(constnewVector3&first,constnewVector3&second,newVector3&out_newVector3);voiddot(constnewVector3&first,constnewVe