DGL https://delphigl.com/forum/ |
|
Newton and Materials https://delphigl.com/forum/viewtopic.php?f=19&t=3376 |
Seite 1 von 1 |
Autor: | McCLaw [ Di Okt 19, 2004 13:22 ] |
Betreff des Beitrags: | Newton and Materials |
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? |
Autor: | Sascha Willems [ Di Okt 19, 2004 14:05 ] |
Betreff des Beitrags: | |
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. |
Autor: | McCLaw [ Di Okt 19, 2004 22:01 ] |
Betreff des Beitrags: | |
Thanks Sascha I will try that and give some feedback once I have it working ![]() |
Seite 1 von 1 | Alle Zeiten sind UTC + 1 Stunde |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |