文件名称:bodycollision
介绍说明--下载内容均来自于网络,请自行研究使用
(Body碰撞监听),碰撞筛选器比监听器更加的具有扩展性,可以在筛选器中实现监听器的功能;但是由于自由度太大,一般不推荐使用final float RATE = 30 // 屏幕到现实世界的比例 30px:1m
World world // 声明一个物理世界对象
AABB aabb // 声明一个物理世界的范围对象
Vec2 gravity // 声明一个重力向量对象
float timeStep = 1f / 60f // 物理世界模拟的的频率
int iterations = 10 // 迭代值,迭代越大模拟越精确,但性能越低
// --->>给第一个Body赋予力
Body body1, body2
Shape 里的 m_isSensor 属性表示发生碰撞但是不产生碰撞效果
public void result(ContactResult arg0) {
// 发生碰撞(有新的接触点被监听到)会调用此函数
// 持续碰撞时也会调用此函数
}-(Body Collision listening), collision filters more scalable than the listener, the listener function can be achieved in the filter However, due to the degree of freedom too, is generally not recommended final float RATE = 30 //screen to the proportion of the real world 30px: 1m World world //declare a physical world objects AABB aabb //declare a range of physical world objects Vec2 gravity //declare a gravity vector objects float timeStep = 1f/60f //Physics world analog frequency int iterations = 10 //iteration values, the greater the iterative simulation more accurate, but the lower the performance//--- > > gives force to the first Body Body body1, body2 Shape Properties in the m_isSensor said the collision but no collision effects public void result (ContactResult arg0) {//collision (new points of contact are listening to) will call this function// when the collision will continue to call this function}
World world // 声明一个物理世界对象
AABB aabb // 声明一个物理世界的范围对象
Vec2 gravity // 声明一个重力向量对象
float timeStep = 1f / 60f // 物理世界模拟的的频率
int iterations = 10 // 迭代值,迭代越大模拟越精确,但性能越低
// --->>给第一个Body赋予力
Body body1, body2
Shape 里的 m_isSensor 属性表示发生碰撞但是不产生碰撞效果
public void result(ContactResult arg0) {
// 发生碰撞(有新的接触点被监听到)会调用此函数
// 持续碰撞时也会调用此函数
}-(Body Collision listening), collision filters more scalable than the listener, the listener function can be achieved in the filter However, due to the degree of freedom too, is generally not recommended final float RATE = 30 //screen to the proportion of the real world 30px: 1m World world //declare a physical world objects AABB aabb //declare a range of physical world objects Vec2 gravity //declare a gravity vector objects float timeStep = 1f/60f //Physics world analog frequency int iterations = 10 //iteration values, the greater the iterative simulation more accurate, but the lower the performance//--- > > gives force to the first Body Body body1, body2 Shape Properties in the m_isSensor said the collision but no collision effects public void result (ContactResult arg0) {//collision (new points of contact are listening to) will call this function// when the collision will continue to call this function}
(系统自动生成,下载前可以参看下载内容)
下载文件列表
(Body碰撞监听)\BodyCollision\.classpath
..............\.............\.project
..............\.............\AndroidManifest.xml
..............\.............\bin\BodyCollision.apk
..............\.............\...\classes.dex
..............\.............\...\.om\bc\MainActivity.class
..............\.............\...\...\..\MyCircle.class
..............\.............\...\...\..\MySurfaceView.class
..............\.............\...\...\..\R$attr.class
..............\.............\...\...\..\R$drawable.class
..............\.............\...\...\..\R$layout.class
..............\.............\...\...\..\R$string.class
..............\.............\...\...\..\R.class
..............\.............\...\resources.ap_
..............\.............\default.properties
..............\.............\gen\com\bc\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\bc\MainActivity.java
..............\.............\...\...\..\MyCircle.java
..............\.............\...\...\..\MySurfaceView.java
..............\.............\bin\com\bc
..............\.............\gen\com\bc
..............\.............\src\com\bc
..............\.............\bin\com
..............\.............\gen\com
..............\.............\res\drawable-hdpi
..............\.............\...\drawable-ldpi
..............\.............\...\drawable-mdpi
..............\.............\...\layout
..............\.............\...\values
..............\.............\src\com
..............\.............\assets
..............\.............\bin
..............\.............\gen
..............\.............\lib
..............\.............\res
..............\.............\src
..............\BodyCollision
(Body碰撞监听)