From: <nik...@al...> - 2001-11-06 00:18:26
|
j'ai mis a jour le CVS, j'ai fait pas mal de modifs, principalement : - pas mal de fonctions de maths ajout=E9es/modifi=E9es=2E - je suis en train d'=E9crire une classe OR_Matrix3x3 (pas finie), servant =E0 remplacer le plus possible la classe OR_Matrix4x4 l=E0 ou ce n'est pas n=E9cessaire (matrice d'inertie, etc)=2E Toche, tu pourras les utiliser=2E c'est bien pratique, car on peut facilement multiplier Matrix4x4*Matrix3x3, Matrix4x4*OR_Vector3D, etc= =2E et faire pleins de conversion (Matrix4x4 -> Matrix3x3)=2E La regle g=E9n=E9rale pour les conversions : on garde toujours la partie rotation de la matrice=2E bref, qu'on utilise des 4x4 ou des 3x3, = le code se comprote pareil (sauf bien sur que les objets sont pas translat=E9s avec des 3x3 ;) - j'ai bien avancer les contraintes : pour l'instant, il y a un bug (=E7a fa= it tourner les objets dans tous les sens), mais je suis content car : * =E7a ne plante pas (des ASSERT de partout, c bien safe)=2E * le design est super cool : quand =E7a marchera, on va pouvoir ajouter pleins de contraintes * =E7a s'integre nikel dans ce qui existe d=E9ja * le code est super lisible=2E compar=E9 =E0 celui de ODE, c'est vraiment u= n autre monde (j'ai montr=E9 ODE =E0 Toche, je pense qu'il est oki)=2E bon, ok, les perfo= rmance aussi sont d'un autre monde ;) bon, les mauvais points : * c'est pas du tout optimiser (pleins de mutliplications de matrices sans doute inutiles) * =E7a fait pas le caf=E9 - j'ai ajouter pleins de fonctions aux rigid body, par exemple pour creer automatiquement les masses/matrices d'inerities pour les objets classiques=2E par exemple, dans un jeu de billard (hehe) : /* create and add a sphere */ OR_SphereGizmo* pGizmo =3D new OR_SphereGizmo(); pGizmo1->SetDim( OR_Vector3D(2, 2, 2) ); pGizmo1->Posit( OR_Vector3D(-2,0,0) ); pToolkit->AddObject( pGizmo1 ); /* add the gizmo to the physic engine */ OR_RigidBody* pRigidBody1 =3D new OR_RigidBody( *pGizmo1 ); pRigidBody1->SetUpMassSphere( 1, 2 ); // density / radius pRigidBody1->SetPosition( pGizmo1->GetRelativePosition() ); pToolkit->GetPhysicEntityManager()=2EAddElement( pRigidBody1, false ); ensuite, si on veut d'un coup modifier la r=E9partition massique de la boule= : pRigidBody1->AdjustMass(0=2E5f); // modifier juste la masse pRigidBody1->SetUpMassBox( 0=2E5f, OR_Vector(1,2,3) ); // density / dimensions Attention ! on n'a juste modifer la r=E9partion de la masse pour que reflete= r la r=E9partition d'un cube, cependant, si on ne modifie pas l'objet de base, les collisions se feront toujours sur une sphere (ou plutot ne se feront pas, vu que pour l'instant, seuls les mesh sont capable de collider entre eux =2E=2E=2E) en passant : Toche, tes macros ne sont pas jour, utilise celles qui sont sur le CVS (les tiennes ne semblent pas mettre des /** mais de /*) gabriel _________________________________________ Gabriel Peyr=E9 [nikopol0@altern=2Eorg] Orion3D www=2Eorion3d=2Efr=2Est Homepage www=2Egabrielpeyre=2Efr=2Est |