wxml:代码片段
<xr-camera node-id="camera" id="camera" clear-color="0.4 0.8 0.6 1" background="ar" is-ar-camera > <xr-shadow id="shadow-root" position="0 -4 20" /> <xr-shadow id="route" position="0 -5 20" /> </xr-camera>
ts片段:
this.m = await this.scene.assets.loadAsset({ type: 'gltf', assetId: 'mddel-01', src: 'http://101.33.213.128:8081/arrow2.glb' });
if(!this.m) { return console.warn('加载模型错误'); }
const node = this.scene.createElement(wx.getXrFrameSystem().XRGLTF);
this.shadowModel = this.scene.getElementById('shadow-root');
this.shadowRoot = this.shadowModel.getComponent(wx.getXrFrameSystem().Transform);
const c = node.getComponent(wx.getXrFrameSystem().GLTF);
this.t = node.getComponent(wx.getXrFrameSystem().Transform);
c.setData({ model: this.m.value });
this.shadowModel.addChild(node);
this.t.scale.setValue(0.03, 0.02, 0.02);
this.t.position.setValue(0, 0, 0);
this.t.rotation.setValue((Math.PI / 180) * 90, (-Math.PI / 180) * 90, 0);
问题:
2.30.0基础库:渲染生成模型挂载在相机下,苹果手机会更新渲染,安卓手机不会
2.29.2基础库:渲染生成模型挂载在相机下,安卓手机会更新渲染,苹果手机不会
2.30.3修复。