博客又好久不更新了,今天上課拿手機(jī)正好查Havok的內(nèi)容,突然發(fā)現(xiàn)Havok自從08年5月后對(duì)商業(yè)用和非商業(yè)用的

游戲開發(fā)者是免費(fèi)的,(以前我一直以為是收費(fèi)的,甚至不開放給非商業(yè)開發(fā)者-。-!!被Physx迷惑了,5555)如果是商業(yè)用途,價(jià)格低于10美金(也就是國(guó)內(nèi)單機(jī)游戲的價(jià)格),你甚至不用和Intel打招呼就能直接用。高于10美刀的話,也只需要問(wèn)Intel要個(gè)免費(fèi)授權(quán)即可~0~
----------------------------分割線----------------------------
恩恩恩,我知道,我的題目是比較;鑒于我是個(gè)物理引擎小白(只“看”過(guò)physx),所以不一定能保證準(zhǔn)確性,但我盡力保證比較客觀的去比較兩者。
安裝:havok提供兩個(gè)壓縮包,一個(gè)是SDK庫(kù),還有一個(gè)是提供給美工的Behaivor Tool。Physx是一個(gè)SDK包,不過(guò)之前必須裝一個(gè)SystemSoftware(我記得Physx的GPU加速只支持英偉達(dá)自家的顯卡)
Samples:Havok的實(shí)例寫的還是挺工整的,附帶了基本的注釋,基本能保證你明白哪塊代碼干嘛用的.
// The cache size in bytes is equal to m_buckets * m_slots * m_chunkSize
hkaDefaultChunkCacheCinfo cacheCinfo;
cacheCinfo.m_numberOfCachePools = 2;
cacheCinfo.m_cachePools.setSize( 2 );
cacheCinfo.m_cachePools[0] = cpCinfo[0];
cacheCinfo.m_cachePools[1] = cpCinfo[1];
// Create a cache only if the number of buckets is nonzero
// Some variants of this demo do not use a cache.
// N.B. This is the default chunk cache which is not threadsafe (but invokes no critical sections
// so is fastest when used in a single threaded environment). For sharing a cache across
// multiple threads, the Animation/Animation/Playback/Cache/Multithreaded/hkaMultithreadedChunkCache
// class is provided - see also the Demo\StandAloneDemos\ConsoleExampleAnimationMT for an example use.
m_cache = ( cpCinfo[0].m_buckets ) ? new hkaDefaultChunkCache( cacheCinfo ) : HK_NULL;
}
相比Physx的代碼就差一些,解釋性的注釋很少。
1 _computeMostTouchedActor();
2 NxVec3 relativeVelocity;
3 if (_mostTouchedActor == NULL || !_mostTouchedActor->isDynamic())
4 {
5 relativeVelocity = _bodyActor->getLinearVelocity();
6 } else {
7 relativeVelocity = _bodyActor->getLinearVelocity() - _mostTouchedActor->getLinearVelocity();
8 }
9 NxQuat rotation = _bodyActor->getGlobalOrientationQuat();
10 NxQuat global2Local;
11 _localVelocity = relativeVelocity;
12 rotation.inverseRotate(_localVelocity);
13 //printf("Velocity: %2.3f %2.3f %2.3f\n", _localVelocity.x, _localVelocity.y, _localVelocity.z);
文檔和教程:API詳細(xì)程度上粗看差不多,不過(guò)貌似Physx沒(méi)有提供索引功能,而只有搜索;
教程上看,我個(gè)人更偏好Havok的教程,上面譬如車輛那部分,havok專門劃了塊Vehicle Kit來(lái)講,里面把物理大概原理什么都講了,而且?guī)Я撕芏嘟忉寛D,我覺(jué)得這對(duì)初學(xué)者會(huì)很不錯(cuò)。

Physx的教程更多帶的是實(shí)例的代碼,里面的lesson就對(duì)應(yīng)了一個(gè)小程序,不過(guò)覺(jué)得里面的解釋相對(duì)havok較少,而且畢竟是word文檔,看著比chm的累。。。

我現(xiàn)在有這感覺(jué),在國(guó)內(nèi)而言Physx的名聲比Havok要大。但似乎Havok更強(qiáng)大且更易用些。
累了。。睡個(gè)午覺(jué)去