laya2.7.3 Cannon物理设置了ColliderShape的localOffset属性 并 isKinematic=true时模型会匀速移动

如题 Cannon物理引擎同时设置ColliderShape的localOffset属性 和CannonRigidbody3D的isKinematic=true时模型会朝着localOffset方向匀速移动
 
index.js引用的库如下:
//-----libs-begin-----
loadLib("libs/laya.core.js")
loadLib("libs/laya.d3.js")
loadLib("libs/cannon.js")
loadLib("libs/laya.cannonPhysics.js")
//-----libs-end-------
完整重现代码如下:
Laya3D.init(720, 1280, null, Laya.Handler.create(null, () => {
Config3D.useCannonPhysics = true;
Laya.stage.scaleMode = "fixedwidth";
Laya.stage.screenMode = "none";
Laya.stage.alignV = "top";
Laya.stage.alignH = "left"; 
let scene = Laya.stage.addChild(new Laya.Scene3D()); 
let camera = new Laya.Camera(0, 0.1, 100);
scene.addChild(camera);
camera.transform.translate(new Laya.Vector3(0, 2, 5));
camera.transform.rotate(new Laya.Vector3(-15, 0, 0), true, false); 
let directionLight = new Laya.DirectionLight();
scene.addChild(directionLight);
let mat = directionLight.transform.worldMatrix;
mat.setForward(new Laya.Vector3(1.0, -1.0, -1.0));
directionLight.transform.worldMatrix = mat; 
//正方体
let box = new Laya.MeshSprite3D(Laya.PrimitiveMesh.createBox(1, 1, 1));
scene.addChild(box);
box.transform.position = new Laya.Vector3(0, 0.25, 0.6);
box.transform.rotate(new Laya.Vector3(0, 45, 0), false, false); 
const rigidBody = box.addComponent(Laya.CannonRigidbody3D) as Laya.CannonRigidbody3D; 
const shape = new Laya.CannonBoxColliderShape(1, 1, 1);
shape.localOffset = new Laya.Vector3(0, 0.1, 0); //模型会沿着y轴正方向移动
rigidBody.isKinematic = true;
rigidBody.mass = 10;
rigidBody.colliderShape = shape;
}))
已邀请:

157*****593

赞同来自:

好的,我们这边确认一下

要回复问题请先

商务合作
商务合作