Historique des modifications - Message

Message #10451

Sujet: createCollisionResponseAnimator ne marche pas sur son parent ?


Type Date Auteur Contenu
Création du message 10-04-2012 19:46:08 johnplayer
Jai trouvé ça dans ITerrainSceneNode.h :

* The Patch Size of the terrain must always be a size of ( 2^N+1, i.e. 8+1(9), 16+1(17), etc. ).
* The MaxLOD available is directly dependent on the patch size of the terrain. LOD 0 contains all
* of the indices to draw all the triangles at the max detail for a patch. As each LOD goes up by 1
* the step taken, in generating indices increases by - 2^LOD, so for LOD 1, the step taken is 2, for
* LOD 2, the step taken is 4, LOD 3 - 8, etc. The step can be no larger than the size of the patch,
* so having a LOD of 8, with a patch size of 17, is asking the algoritm to generate indices every
* 2^8 ( 256 ) vertices, which is not possible with a patch size of 17. The maximum LOD for a patch
* size of 17 is 2^4 ( 16 ). So, with a MaxLOD of 5, you'll have LOD 0 ( full detail ), LOD 1 ( every
* 2 vertices ), LOD 2 ( every 4 vertices ), LOD 3 ( every 8 vertices ) and LOD 4 ( every 16 vertices ).

Moi et l'anglais, ça fait 4 voire 5 donc à vérifier^^ mais ton problème vient peut-être du fait que dans :
scene::ITriangleSelector* selector = smgr->createTerrainTriangleSelector(terrain, 0);
// Tu as mis le 2 ème paramètres à 0.  Essaie de mettre le maxLOD de ton terrain :
scene::ITriangleSelector* selector = smgr->createTerrainTriangleSelector(terrain, 5);

Ou l'inverse :
irr::scene::ITerrainSceneNode* terrain = smgr->addTerrainSceneNode(
                "./media/Map1_field.bmp",
                0,                                      // parent node
                -1,                                     // node id
                irr::core::vector3df(-900.f, -50.f, -900.f),         // position
                irr::core::vector3df(0.f, 0.f, 0.f),         // rotation
                irr::core::vector3df(2.f, 1.0f, 2.f),      // scale
                irr::video::SColor ( 255, 255, 255, 255 ),   // vertexColor
                5,                                      // maxLOD      => Le remplacer par 0 et garder scene::ITriangleSelector* selector = smgr->createTerrainTriangleSelector(terrain, 0); ?
                irr::scene::ETPS_17,                         // patchSize
                4                                       // smoothFactor
                );

Sinon tu as essayé de l'attacher à un autre node que celui de ton terrain? C'est peut-être la construction de ITerrainSceneNode qui pose problème.

J'espère avoir fait avancer le schmilblick.

MODE HS = ON; ^^
Sinon j'ai aussi un conseil qui n'a rien à voir avec ton problème. Si tu as la version 1.7.2 ou supérieur d'Irrlicht (les plus anciennes, je ne sais pas si elles acceptent), tu peux essayer les VBOs.
terrain->getMesh()->setHardwareMappingHint( EHM_STREAM );
// tu auras peut-être même plus de performances avec :
terrain->getMesh()->setHardwareMappingHint( EHM_DYNAMIC );

C'est pas garanti sur ce genre de mesh mais ça vaut le coup d'essayer.

Retour

Options Liens officiels Caractéristiques Statistiques Communauté
Préférences cookies
Corrections
irrlicht
irrklang
irredit
irrxml
Propulsé par Django
xhtml 1.0
css 2.1
884 membres
1440 sujets
11337 messages
Dernier membre inscrit: Saidov17
144 invités en ligne
membre en ligne: -
RSS Feed