import * as THREE from 'three' import { Entity, loadGLBModel, type EntityConfig, getBounds, CollisionType } from '../../src' import type { JointDescriptions } from '../../src' export interface Cr30Props extends EntityConfig { paths: { robotArm: string decoder?: string } } const baseMatrix = new THREE.Matrix4(0, -1, 0, 0, 0, 0, 1, 0, -1, 0, 0, 0, 0, 0, 0, 1) export class Cr30Entity extends Entity { _robotArmOffset = new THREE.Vector3() constructor(userData: Cr30Props) { super('robotarm', userData) } get UserMatrix0() { const baseObject: any = this.getObjectByName('base') return baseObject.matrixWorld.clone().multiply(baseMatrix) } get JointDescriptions(): JointDescriptions { return { J1: { axe: 'y', direction: 1 }, J2: { axe: 'x', direction: 1 }, J3: { axe: 'x', direction: 1 }, J4: { axe: 'x', direction: 1 }, J5: { axe: 'y', direction: 1 }, J6: { axe: 'x', direction: 1 } } } async addPhysicsBody() {} async loadRobotArm() { const { paths } = this.UserData const { model, animations } = await loadGLBModel(paths.robotArm, paths.decoder) model.position.copy(this._robotArmOffset) this.addModelToGroup(model) } async loadModel() { await this.loadRobotArm() } async onAdded() {} onRemoved(): void {} onUpdating(deltaTime: number): void {} }