cocos / cocos-engine

Cocos simplifies game creation and distribution with Cocos Creator, a free, open-source, cross-platform game engine. Empowering millions of developers to create high-performance, engaging 2D/3D games and instant web entertainment.
https://www.cocos.com/en/creator
Other
8.21k stars 1.94k forks source link

Use Bullet system ConfigurableConstraint Component, angularDriverSettings.targetOrientation setting will be a fixed orientation. #17318

Open tangkaikk opened 3 months ago

tangkaikk commented 3 months ago

Cocos Creator version

3.x

System information

CocosEditor, Browser

Issue description

Use Bullet system ConfigurableConstraint Component, when angularDriverSettings.targetOrientation setting, the object will be a fixed orientation.

Relevant error log output

none

Steps to reproduce

1.Use Bullet system ConfigurableConstraint Component 2.Set angularDriverSettings.targetOrientation z Axis,normally , z is positive the car wheel will turn left,z is negative the car wheel will turn right, but during testing, no matter z is positive or negative, the car wheel is turn one side. After logging in the code, the code call bt.Generic6DofSpring2Constraint_setTargetVelocity function to adjust the wheel orientation。 3.Change physic system from bullet to physX, the car can turn left and right while setting angularDriverSettings.targetOrientation z value。

1.使用bullet物理系统 configurableConstraint 2.设置angularDriverSettings.targetOrientation,主要是z,理论上z为正轮子向左,z为负轮子向右, 但是测试结果物理z是正数或者负数都是向一边。打印log跟踪bullet系统最终调用Generic6DofSpring2Constraint_setTargetVelocity来设置转向数值。 3.把物理系统从bullet改为physX则能根据z正负数来向左和向右。

Minimal reproduction project

race3dCopy.zip

minggo commented 2 weeks ago

I've dipped into this issue, but could not resolve it.

tangkaikk commented 2 weeks ago

Could you refer the physX system code to adjust the bullet system behavior?