doing5552

记录每日点滴,不枉人生一世

  C++博客 :: 首页 :: 联系 :: 聚合  :: 管理
  73 Posts :: 0 Stories :: 94 Comments :: 0 Trackbacks

公告

常用链接

留言簿(24)

我参与的团队

最新随笔

搜索

  •  

积分与排名

  • 积分 - 452987
  • 排名 - 47

最新随笔

最新评论

阅读排行榜

评论排行榜

PhysX 中Userdata的理解!
现在主要看到有着么几种应用
1
 1static void CreateCube(const NxVec3& pos, int size=2const NxVec3* initialVelocity=NULL)
 2{
 3    if(gScene == NULL) return;    
 4
 5    // Create body
 6    NxBodyDesc bodyDesc;
 7    bodyDesc.angularDamping    = 0.5f;
 8    if(initialVelocity) bodyDesc.linearVelocity = *initialVelocity;
 9
10    NxBoxShapeDesc boxDesc;
11    boxDesc.dimensions = NxVec3((float)size, (float)size, (float)size);
12
13    NxActorDesc actorDesc;
14    actorDesc.shapes.pushBack(&boxDesc);
15    actorDesc.body            = &bodyDesc;
16    actorDesc.density        = 10.0f;
17    actorDesc.globalPose.t  = pos;
18    gScene->createActor(actorDesc)->userData = (void*)size_t(size);
19    //printf("Total: %d actors\n", gScene->getNbActors());
20}
这种userdata被转型为void* 了 不知道如何应用任意的图像样式,继续看看还有什么其他方法没有!
posted on 2008-12-29 14:39 doing5552 阅读(279) 评论(0)  编辑 收藏 引用

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理