物理对象穿过电晕SDK中的墙对象 [英] Physics object passing through wall object in corona sdk

查看:81
本文介绍了物理对象穿过电晕SDK中的墙对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用力击球,有一面墙被指定为物理属性,并且是静态的,但是球是动态的,问题是当有足够的力施加到它穿过墙的球上时,是示例桌球游戏中的一种桌墙类型.我已经使用ball.isBullet = true,但是同样的问题在那里.请建议如何解决..谢谢

I am hitting a ball with a force and there is a wall which is assigned a physics property and is static, but the ball is dynamic, the problem is when enough force is applied to the ball it passes through the wall, it is a type of table wall as in sample simple pool game. I have used ball.isBullet=true but same problem is there. Please suggest how to solve it.. thanks

推荐答案

在处理快速移动的小型物体时,这是一个相当普遍的问题.通常,最好的解决方案是使墙"更厚(如果在游戏中可能的话).另外,您可能会增加速度和位置的迭代次数(下面的链接)...只需记住,这两种方法(以及.isBullet = true)都可能导致轻微的性能损失,因此第一种方法是最好的.

This is a fairly common issue when dealing with small, fast-moving objects. Typically, the best solution is to make the "walls" thicker, if that is possible within your game. Also, you may increase the velocity and position iterations (links below)... just remember that both of these (along with .isBullet=true) may result in a slight performance penalty, so the first approach is the best.

http://docs.coronalabs.com/api/library/physics/setVelocityIterations.html http://docs.coronalabs.com/api/library/physics/setPositionIterations.html

布伦特·索伦蒂诺

这篇关于物理对象穿过电晕SDK中的墙对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆