91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 3.19MB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發布日期: 2023-10-20
  • 語言: 其他
  • 標簽: open??inventor??碰撞??

資源簡介

利用open inventor Coin3D中自帶的Intersections 類實現兩個物體之間的碰撞檢測

資源截圖

代碼片段和文件信息


//?添加COIN頭文件-Window操作顯示庫和節點庫???
#include????
#include?
#include?
#include?
#include?
#include????
#include?
#include?
#include????
#include???
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?
#include?


SoIntersectionDetectionAction::Resp?onIntersection(void?*userDataconst?

SoIntersectingPrimitive?*primitive1const?SoIntersectingPrimitive?*primitive2)
{
//?These?two?primitive?have?an?intersection.
??(void)fprintf(stdout?“intersection?hit!/n“);??

//?This?callback?will?be?called?for?the?two?next?colliding?shapes
??return?SoIntersectionDetectionAction::NEXT_SHAPE;
}

static?void?alarmCB(void?*?data?SoSensor?*sensor)??//響應函數
{
???
SoWin::exitMainLoop();?


//重新調度警報傳感器
SoAlarmSensor?*alarm=(SoAlarmSensor*)sensor;
alarm->setTimeFromNow(0.022);
alarm->schedule();
}


int?main(int?argc?char?**argv)??
{??
????SoDB::init();???????????????????????????????????????//?初始化SoDB讀取iv文件???
????HWND?hWnd?=?SoWin::init(argv[0]);???//?產生窗口句柄???
????SoSeparator?*pRootSeparator?=?new?SoSeparator;??
????pRootSeparator->ref();???????????????????????//?創建根節點并ref計數???
????
//SoPerspectiveCamera?*myCamera?=?new?SoPerspectiveCamera;
????SoPendulum?*myPend?=?new?SoPendulum;
????myPend->rotation0.setValue(SbVec3f(001)0);
????myPend->rotation1.setValue(SbVec3f(001)-1);
????myPend->speed=0.2f;

????
????SoInput?input;??
????if?(input.openFile(“finger002.iv“))????????????????????//?加載iv文件并讀取全部內容???
????{??
????????pRootSeparator->addChild(SoDB::readAll(&input));??
????}??
????//子節點1
????SoSeparator?*pSon1Separator?=?new?SoSeparator;?
????SoPendulum?*mySon1Pend?=?new?SoPendulum;
????pRootSeparator->addChild(pSon1Separator);
????
SoTransform?*mySon1Tform=new?SoTransform;
????pSon1Separator->addChild(mySon1Tform);
mySon1Tform->translation.setValue(0.04f?0.0?0.00);
????pSon1Separator->addChild(mySon1Pend);
????mySon1Pend->rotation0.setValue(SbVec3f(001)0);
????mySon1Pend->rotation1.setValue(SbVec3f(001)-1.0);
????mySon1Pend->speed=0.2;

????if?(input.openFile(“finger001.iv“))????????????????????//?加載iv文件并讀取全部內容???
????{??
????????pSon1Separator->addChild(SoDB::readAll(&input));??
????}??
???


????SoSeparator?*sphere=new?SoSeparator;
pRootSeparator->addChild

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2013-10-08?09:13??碰撞\
?????目錄???????????0??2013-10-08?09:13??碰撞\Debug\
?????文件?????2573312??2013-10-08?09:11??碰撞\Debug\test.bsc
?????文件??????221234??2013-10-08?09:11??碰撞\Debug\test.exe
?????文件??????412688??2013-10-08?09:11??碰撞\Debug\test.ilk
?????文件???????43428??2013-10-08?09:11??碰撞\Debug\test.obj
?????文件?????5663172??2013-10-07?20:01??碰撞\Debug\test.pch
?????文件??????738304??2013-10-08?09:11??碰撞\Debug\test.pdb
?????文件???????????0??2013-10-08?09:11??碰撞\Debug\test.sbr
?????文件??????525312??2013-10-08?09:13??碰撞\Debug\vc60.idb
?????文件??????372736??2013-10-08?09:11??碰撞\Debug\vc60.pdb
?????文件??????477791??2013-09-07?17:02??碰撞\finger001.iv
?????文件??????319532??2013-09-07?17:01??碰撞\finger002.iv
?????文件????????4251??2013-10-08?09:11??碰撞\test.cpp
?????文件????????4229??2013-09-08?23:04??碰撞\test.dsp
?????文件?????????531??2013-05-04?10:26??碰撞\test.dsw
?????文件???????66560??2013-10-08?09:13??碰撞\test.ncb
?????文件???????54784??2013-10-08?09:13??碰撞\test.opt
?????文件?????????242??2013-10-08?09:13??碰撞\test.plg

評論

共有 條評論