Description: Android (mouse joints- Drag Body)// mouse joint public MouseJoint createMouseJoint () {MouseJointDef mjd = new MouseJointDef () // set the mouse joints first Body instance (default grounding Body) mjd.body1 = world. getGroundBody () // set the mouse joint second Body instance (being dragged Body) mjd.body2 = body1 // Set the target point X coordinate mjd.target.x = body1.getPosition () x. // Set the Y coordinate of the target point mjd.target.y = body1.getPosition () y .// body1.allowSleeping (false) //set body1 Never Sleep// set the mouse joint target location mjd.maxForce = 100 //Rally// Create the World Mouse joint MouseJoint mj = (MouseJoint) world.createJoint (mjd) return mj }
To Search:
File list (Check if you may need any files):
(鼠标关节-拖拽Body)\CreateMouseJoint\.classpath
...................\................\.project
...................\................\AndroidManifest.xml
...................\................\bin\classes.dex
...................\................\...\.om\mj\MainActivity.class
...................\................\...\...\..\MyRect.class
...................\................\...\...\..\MySurfaceView.class
...................\................\...\...\..\R$attr.class
...................\................\...\...\..\R$drawable.class
...................\................\...\...\..\R$id.class
...................\................\...\...\..\R$layout.class
...................\................\...\...\..\R$string.class
...................\................\...\...\..\R.class
...................\................\...\CreateMouseJoint.apk
...................\................\...\resources.ap_
...................\................\default.properties
...................\................\gen\com\mj\R.java
...................\................\lib\jbox2d.jar
...................\................\proguard.cfg
...................\................\res\drawable-hdpi\icon.png
...................\................\...\.........ldpi\icon.png
...................\................\...\.........mdpi\icon.png
...................\................\...\layout\main.xml
...................\................\...\values\strings.xml
...................\................\src\com\mj\MainActivity.java
...................\................\...\...\..\MyRect.java
...................\................\...\...\..\MySurfaceView.java
...................\................\bin\com\mj
...................\................\gen\com\mj
...................\................\src\com\mj
...................\................\bin\com
...................\................\gen\com
...................\................\res\drawable-hdpi
...................\................\...\drawable-ldpi
...................\................\...\drawable-mdpi
...................\................\...\layout
...................\................\...\values
...................\................\src\com
...................\................\assets
...................\................\bin
...................\................\gen
...................\................\lib
...................\................\res
...................\................\src
...................\CreateMouseJoint
(鼠标关节-拖拽Body)