The C++ Switch statement doesn’t actually work on strings, for example the following code would generate a compiler error (VC++ C2450):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
std::string s = "bleh";
switch( s )
{
case "dude":
(…);
break;
case "hello":
(…);
break;
case: "bleh":
(…);
break;
}
Well I say, that’s a bit of a sticky wicket. So why not just resort to an if/then/else stream? Because I wanted to use the switch statement [...]
I wrote the matrix class a while ago, it really simplifies a lot of the generic coding you’d have to otherwise do to convert the matrix classes between PhysX and DirectX.
The basic idea is to inherit from the PhysX matrix/vector classes (NxMat34/NxVec3) and add a few constructors and overloaded operators to make it play nice [...]