WEB开发网
开发学院图形图像Flash Rendering joints with Box2D 阅读

Rendering joints with Box2D

 2009-10-18 00:00:00 来源:WEB开发网   
核心提示: The key is in the loop at lines 134-137 and its GetJointList() function that gets the world joint list. With the returned joint, using GetNext() I g

The key is in the loop at lines 134-137 and its GetJointList() function that gets the world joint list. With the returned joint, using GetNext() I get the next joint in the world list. A NULL joint indicates the end of the list.

Then, GetAnchor1 and GetAnchor2 return me the anchor point of both bodies linked by the joint in world coordinates.

And that’s it… that easy…

Click on a static object (green) to create a joint on the fly and have it rendered

No need to include the source code, just replace the script at Box2D joints: Distance Joint with this one.

上一页  1 2 

Tags:Rendering joints with

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接