Opened 6 years ago

Last modified 2 years ago

#4834 new defect

JS Vector2D should use XZ instead of XY

Reported by: elexis Owned by:
Priority: Nice to Have Milestone: Backlog
Component: UI – Miscellaneous Keywords:
Cc: Patch:

Description

In the engine we use Y for the elevation and X and Z for the horizonal plane.

r9096 introduced the Vector JS object which uses X and Y. This is now in globalscripts/ and used in not few places. In many if not all places, the Y represents Z.

So it would be much more clear if it would use X and Z.

rP9271 made some effort going into the same direction.

There is also a Vector2D.h class that also uses Y with the same issue in most if not all simulation uses.

Perhaps we could have VectorXY and VectorXZ that inherit the same class.

Change History (4)

comment:1 by elexis, 6 years ago

In 20388:

rmgen cleanup.

Remove PointXZ class which is essentially a subset of Vector2D, refs #4834, #4804.
Remove Point3D which is unused and the same as Vector3D without the math features, refs #4805.

comment:2 by Imarok, 6 years ago

As far as I can see that's a good idea. Though you would also have to change the C++ 2D-Vector (CFixedVector2D) because we sometimes convert between the JS and the C++ ones.

comment:3 by Imarok, 5 years ago

Component: UI & SimulationMisc. UI

Move tickets to their correct component as "UI & Simulation" got some sub components.

comment:4 by Vladislav Belov, 2 years ago

Vector2D might be still useful for real 2D math, so I'd prefer to have a different class (might be inherited) with a proper naming, like VectorXZ, VectorHorizontal2D or VectorH2D.

Note: See TracTickets for help on using tickets.