PhysX 3.2中的刚体模拟: TolerancesScale

PhysX 3.2中的PxTolerancesScale参数影响模拟稳定性,包括碰撞判断、物体睡眠状态及反弹判断。Scale.length影响碰撞精度,Scale.speed影响睡眠和反弹判断,Scale.mass目前未使用。合理设置这些参数和相关变量如contactOffset、restOffset、gravity是确保模拟正常的关键。例如,若单位系统中10单位=1m,可设scene.gravity.y = -9.8f*10,Scale.speed = scene.gravity.y,Scale.length = 10。遇到模拟问题时,应检查这些设置。
摘要由CSDN通过智能技术生成

在创建PhysX 3.2的PhysX SDK对象和PxScene对象的时候,我们会发现,跟PhysX 2.8时候相比,有一个多出来的参数特别醒目:

PX_INLINE physx::PxPhysics* PxCreatePhysics(
	physx::PxU32 version,
	physx::PxFoundation& foundation,
	const physx::PxTolerancesScale& scale,
	bool trackOutstandingAllocations = false,
	physx::PxProfileZoneManager* profileZoneManager = NULL);

PX_INLINE PxSceneDesc::PxSceneDesc(const PxTolerancesScale& scale):


这个参数就是上面加粗的参数,PxTolerancesScale scale。这个参数干什么用的呢?

我们还是看看它的定义吧:

 

class PxTolerancesScale
{
public: 

	/** brief
	The approximate size of objects in the simulation. 
	*/

	PxReal	length;


	/** brief
	The approximate mass of a length * length * length block.
	*/
	PxReal	mass;

	/** brief
	The typical magnitude of velocities of objects in simulation. This is used to estimate 
	*/
	PxReal	spe
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值