Registriert: Do Dez 11, 2003 13:23 Beiträge: 25 Wohnort: South Africa
Hi all
I have just started impementing Newton into our game engine, and have hit a small snag.
I would like my OpenGL Materials and my Newton Materials to be defined in the same class.
This should be easy enough, but the problem comes in when I want to generate the NewtonTreeCollision from my static mesh (this has Many Material changes)
It seems from looking at SOS's code that you can only have one Nweton material per NewtonTreeCollision pointer.
Is this correct?
and if so, do I create NewtonTreeCollision for each material change in the static mesh?
_________________ Im out of my mind but please leave a message...
www.sulaco.co.za
Registriert: Mo Sep 23, 2002 19:27 Beiträge: 5812
Programmiersprache: C++
The last parameter of NewtonTreeCollisionAddFace lets you specify custom data for that face. So in your case you would assign the material-ID of that face with the last parameter. And the second parameter of NewtonCreateTreeCollision as a special callback that gets called as soon as something collides with your treecollision.
So you define that callback and in that callback you can retrieve the material-ID you set with NewtonTreeCollisionAddFace and depending on that, you dynamically tell newton via the NewtonMaterialSetContact*-functions in that callback (those functions can only be called in a callback) your own material parameters.
Mitglieder in diesem Forum: 0 Mitglieder und 1 Gast
Du darfst keine neuen Themen in diesem Forum erstellen. Du darfst keine Antworten zu Themen in diesem Forum erstellen. Du darfst deine Beiträge in diesem Forum nicht ändern. Du darfst deine Beiträge in diesem Forum nicht löschen. Du darfst keine Dateianhänge in diesem Forum erstellen.