Browse Source

fm600 动画

jx-test
修宁 5 months ago
parent
commit
73ce17f899
  1. 11
      src/core/base/BaseRenderer.ts
  2. 2
      src/modules/amr/fm600/FM600PropertySetter.ts
  3. 12
      src/modules/bracket/BracketRenderer.ts

11
src/core/base/BaseRenderer.ts

@ -177,6 +177,17 @@ export default abstract class BaseRenderer {
console.error(`无法获取物品 ${item.id} 的存储位置`) console.error(`无法获取物品 ${item.id} 的存储位置`)
} }
// 观察这个地方是不是已经有物品了
const existsGoods = this.tempViewport.runtimeManager?.getItemsByRack(item.dt.storeAt?.item)
if (existsGoods?.size > 0) {
let sumHeight = 0
for(let goodId of existsGoods) {
const itemJson = this.tempViewport.entityManager.findItemById(goodId)
sumHeight += itemJson.tf[2][1]
}
position[1] += sumHeight
}
option.position = position option.position = position
option.rotation = rotation option.rotation = rotation
option.getParentObject3D = getParentObject3D option.getParentObject3D = getParentObject3D

2
src/modules/amr/fm600/FM600PropertySetter.ts

@ -14,7 +14,7 @@ const propertySetter: PropertySetter = {
inputProps: {}, inputProps: {},
}, },
{ {
dataPath: 'state', label: 'ptr控制', input: 'PtrController', dataPath: 'state', label: 'FM600控制', input: 'PtrController',
inputProps: {}, inputProps: {},
}, },
], ],

12
src/modules/bracket/BracketRenderer.ts

@ -17,7 +17,7 @@ export default class BracketRenderer extends BaseRenderer {
* , * ,
*/ */
readonly defulePositionY: number = Constract.HEIGHT_WAY readonly defulePositionY: number = Constract.HEIGHT_WAY
readonly defaultScale: THREE.Vector3 = new THREE.Vector3(1, 1, 1) readonly defaultScale: THREE.Vector3 = new THREE.Vector3(0.85, 0.35, 0.85)
readonly defaultRotation: THREE.Vector3 = new THREE.Vector3(0, 0, 0) readonly defaultRotation: THREE.Vector3 = new THREE.Vector3(0, 0, 0)
readonly defaultLineWidth: number = 0.05 readonly defaultLineWidth: number = 0.05
@ -113,13 +113,13 @@ export default class BracketRenderer extends BaseRenderer {
// group.setMatrix4(matrix) // group.setMatrix4(matrix)
// 设置位置 // 设置位置
// group.position.set(item.tf[0][0], item.tf[0][1], item.tf[0][2]) group.position.set(item.tf[0][0], item.tf[0][1], item.tf[0][2])
group.position.set(option.position[0], option.position[1], option.position[2]) // group.position.set(option.position[0], option.position[1], option.position[2])
group.rotation.set( group.rotation.set(
THREE.MathUtils.degToRad(option.rotation[0]), THREE.MathUtils.degToRad(item.tf[1][0]),
THREE.MathUtils.degToRad(option.rotation[1]), THREE.MathUtils.degToRad(item.tf[1][1]),
THREE.MathUtils.degToRad(option.rotation[2]) THREE.MathUtils.degToRad(item.tf[1][2])
) )
return group return group

Loading…
Cancel
Save