timeout added

This commit is contained in:
2025-04-28 13:35:13 +05:30
parent dc77d9ed43
commit 6bf53bf72c
3 changed files with 32 additions and 26 deletions

View File

@@ -15,7 +15,7 @@ type IKInstanceProps = {
setArmBotCurvePoints: any
};
function IKInstance({ modelUrl, setIkSolver, ikSolver, robot, groupRef, processes, setArmBotCurvePoints }: IKInstanceProps) {
console.log('robot: ', robot.position, robot.rotation);
const { scene } = useThree();
const gltf = useLoader(GLTFLoader, modelUrl, (loader) => {
const draco = new DRACOLoader();
@@ -66,16 +66,16 @@ function IKInstance({ modelUrl, setIkSolver, ikSolver, robot, groupRef, processe
setIkSolver(solver);
const helper = new CCDIKHelper(OOI.Skinned_Mesh, iks, 0.05);
if (solver) {
const bone = solver.mesh.skeleton.bones.find(
(b: any) => b.name === targetBoneName
) ?? "";
if (bone) {
const position = new THREE.Vector3();
bone.getWorldPosition(position);
console.log("world position", position.x, position.y, position.z); // this is the bone's world position
}
}
// if (solver) {
// const bone = solver.mesh.skeleton.bones.find(
// (b: any) => b.name === targetBoneName
// ) ?? "";
// if (bone) {
// const position = new THREE.Vector3();
// bone.getWorldPosition(position);
// console.log("world position", position.x, position.y, position.z); // this is the bone's world position
// }
// }
scene.add(helper)