The engine itself wouldn’t need it I suppose but, to me, it doesn’t make sense to put Vector3d in the blender subproject. For exemple, for my game, I had to use Vector3d and, to do so, I had to import the whole blender subproject
I think it makes more sense to gather all vector classes together.
Hmmm you are right. Maybe I could just add the new overload mentioned?
The documentation is supposed to rectify that. The perpendicular vector of a 2D vector is its cross product and takes only the vector as parameter (I learned that there are multiple forms for cross products). As I recall, it computes the CCW perpendicular vector.
No. Clone will clone everything, including all data from the child classes. A copy constructor will only copy the data from the current class and create a new object with it. Let’s say you need 1 500 000 Vector3fs and you happen to have a variable to initialize them with called
Vector3f vec6 = new Vector6f(), which is an instance of the class Vector6f, which inherits from Vector3f for the purpose of this example. Then, cloning
vec6 will allocate 4 500 000 floats for nothing and will still be kept in memory, even if the user call set() on them as they will be seen as Vector3f. Using the copy constructor assures the programmer that only the Vector3f data is copied.