1.ode引擎中的幾何體
ode物理引擎中的幾何體有球體,盒子,膠囊,射線,平面,圓柱,網(wǎng)格等等
對于一般的幾何體比如球體,盒子等其默認(rèn)的位置為原點,也就是其中心點在坐標(biāo)原點
那么對于box來說描述一個盒子只需要3個參變量分別為長高寬
對于Capped Cylinder來說
其特點就是在圓柱的上下地上各加了一個半圓形的帽子,其新生產(chǎn)的圓柱軸總是z軸
2.ode geom和body的關(guān)系
geom是簡單的幾何體
body可以代表物理場景對象
一般而言一個body總是對應(yīng)于1個或者多個幾何體
一個物理對象總是包含1個或者多個幾何體
當(dāng)然ode有函數(shù)可以檢測給定幾何體和物理對象的管理
對于body之間也有函數(shù)檢測他們是不是相連的
3. ode關(guān)節(jié)類型
ode 具有5種類型的關(guān)節(jié)分別為
hinge,ball,slider,unversal(萬向輪)以及hinge2
hinge是常見的合頁那種關(guān)節(jié)形式
ball類型于游戲搖桿
slider:插銷形式
hinge2則是帶有軸的關(guān)節(jié)
其中大多數(shù)關(guān)節(jié)都具有內(nèi)置的馬達(dá)而球-渦球則不具有
Mos t joints have motors built in.Ball and sockets do not
3.彈簧-阻尼系統(tǒng)
2種解決方式
1.簡單的:使用erp和cfm
2.復(fù)雜點的:使用物理方程式
1.erp模式:施加力保持關(guān)節(jié)附著物理不偏離
2.cfm模式-constraint force mixing
胡克定律:非k*(ra-a);
帶阻尼的形式: f = k*(ra-a)-d*da
4.如何保持ode模擬的平穩(wěn)性
1.僵硬的彈簧不可取
2.嚴(yán)格的束縛條件
3....
5.如果保持ode模擬更快
1.使用較少的關(guān)節(jié)
2.使用簡單的替代物替換多重關(guān)節(jié)
3.使用較少的接觸面
4.如果可能使用無摩擦或者粘性接觸面替換庫倫摩擦接觸面
6.ode質(zhì)量函數(shù)類..
清空質(zhì)量
void dMassSetZero (dMass *);
void dMassSetSphere (dMass *, dReal density, dReal radius);
void dMassSetSphereTotal (dMass *, dReal total_mass, dReal radius);
void dMassSetCappedCylinder (dMass *, dReal density, int direction,dReal radius, dReal length);
void dMassSetCappedCylinderTotal (dMass *, dReal total_mass,int direction, dReal radius, dReal length);
void dMassSetCylinder (dMass *, dReal density, int direction,dReal radius, dReal length);
void dMassSetCylinderTotal (dMass *, dReal total_mass, int direction,dReal radius, dReal length);
void dMassSetBox (dMass *, dReal density,dReal lx, dReal ly, dReal lz);
void dMassSetBoxTotal (dMass *, dReal total_mass,dReal lx, dReal ly, dReal lz);
void dMassAdjust (dMass *, dReal newmass);
void dMassTranslate (dMass *, dReal x, dReal y, dReal z);
void dMassRotate (dMass *, const dMatrix3 R);
void dMassAdd (dMass *a, const dMass *b);