博客又好久不更新了,今天上課拿手機正好查Havok的內容,突然發現Havok自從08年5月后對商業用和非商業用的

游戲開發者是免費的,(以前我一直以為是收費的,甚至不開放給非商業開發者-。-!!被Physx迷惑了,5555)如果是商業用途,價格低于10美金(也就是國內單機游戲的價格),你甚至不用和Intel打招呼就能直接用。高于10美刀的話,也只需要問Intel要個免費授權即可~0~
----------------------------分割線----------------------------
恩恩恩,我知道,我的題目是比較;鑒于我是個物理引擎小白(只“看”過physx),所以不一定能保證準確性,但我盡力保證比較客觀的去比較兩者。
安裝:havok提供兩個壓縮包,一個是SDK庫,還有一個是提供給美工的Behaivor Tool。Physx是一個SDK包,不過之前必須裝一個SystemSoftware(我記得Physx的GPU加速只支持英偉達自家的顯卡)
Samples:Havok的實例寫的還是挺工整的,附帶了基本的注釋,基本能保證你明白哪塊代碼干嘛用的.
// 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詳細程度上粗看差不多,不過貌似Physx沒有提供索引功能,而只有搜索;
教程上看,我個人更偏好Havok的教程,上面譬如車輛那部分,havok專門劃了塊Vehicle Kit來講,里面把物理大概原理什么都講了,而且帶了很多解釋圖,我覺得這對初學者會很不錯。

Physx的教程更多帶的是實例的代碼,里面的lesson就對應了一個小程序,不過覺得里面的解釋相對havok較少,而且畢竟是word文檔,看著比chm的累。。。

我現在有這感覺,在國內而言Physx的名聲比Havok要大。但似乎Havok更強大且更易用些。
累了。。睡個午覺去