As if we were chatting, as fast as the answer came, thanks.
But then the static_cast is not needed at all.
The snippet is the well pasted snippet out of the manual of Bullet. Nobody is mentioning this anywhere. Therefore I think there must be some setting effecting it (VC2010)
(am very clumbsy, especially with words on a static screen.)
Ogre 3D 1.9.0 static
Bullet 2.8 static
You're correct, the static cast is not needed, but the problem is the const modifier. C++ doesn't let you remove it with a static_cast<>, you have to use a const_cast<> instead but that signals some issues with your code design choices more often than not. It's not VC2010, it's the C++ standard and the deep thinking behind adding the const mechanics to the language.
It could be that the authors of the original code compiled it only with GCC using some forgiving options, if you say that's not a typo somewhere.
Think calling it after the bullet pipeline it should be save to change the instance and so I propably agree the const is there. But then again, it's almost right before the pipeline too XD.
Thanks tbone.
I'll leave it still unsolved too see more feedback.
Regards
(am very clumbsy, especially with words on a static screen.)
Ogre 3D 1.9.0 static
Bullet 2.8 static
A quick google shows that apparently the const was added to bullet 2.81 (latest version, from october last year). So all the code you've seen that does the static cast is out of date.
Admitted, I am the worsed at search engines. Since algorithms are trying to help me find something I can't find anything anymore. Always using different queries and getting the same results.
Took the example from their wiki, which is not updated.
Thanks for the response Kojack.
Kind regards,
(am very clumbsy, especially with words on a static screen.)
Ogre 3D 1.9.0 static
Bullet 2.8 static
I did a search for:
static_cast< btCollisionObject* >
The first link in google is a thread on the bullet forum where a guy had the same problem, then discovered that 2.81 changed constness of some members.