timeout added
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user