Quantcast
Channel: BEPUphysics
Viewing all articles
Browse latest Browse all 243

Commented Unassigned: Directional vectors - up, down etc could be problematic [22]

$
0
0
Depending on how they are used, having Up, Down, Left, etc vectors can be a problem. For instance, If I'm working in 2d I use XY as the wall or ground plane, but If I'm working in 3d, XY is ALWAYS the ground plane, Z is up/down. This conflicts with the BEPU's notion of up/down, which is in Y.

I don't yet know if it's a problem but I suspect it will be and I'll need to rewrite you're vectors to have configurable ups. I notice that SharpDX math also uses the 'y is up' designation. I'm going to add a static setter for Up/Right/Forward to my copy of your vectors classes.

Just a suggestion really, it seems sensible to not lock the system to an orientation when there isn't even a convention.

Q) Will adding configurable Direction vectors cause any issues ?
Comments: So I would add this ... // default RHS / z up system private static Vector3 right = new Vector3(1, 0, 0); private static Vector3 forward = new Vector3(0, 1, 0); private static Vector3 up = new Vector3(0, 0, 1); public static void SetOrientation(Vector3 right, Vector3 forward, Vector3 up) { Vector3.right = right; Vector3.forward = forward; Vector3.up = up; } /// <summary> /// Gets the up vector. [in BEPU, it was (0,1,0)]. /// </summary> public static Vector3 Up { get { return up; } } /// <summary> /// Gets the down vector. [in BEPU, it was (0,-1,0)]. /// </summary> public static Vector3 Down { get { return -up; } } etc.

Viewing all articles
Browse latest Browse all 243

Trending Articles