void virtuose::attachTransform(VRTransformPtr trans) { if(vc == 0) return; isAttached = true; attached = trans; VRPhysics* o = trans->getPhysics(); btMatrix3x3 t = o->getInertiaTensor(); float inertia[9] {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}; Matrix3ToArray(t,inertia); cout<<"\n "<<"\n "<<inertia[0] << " " <<inertia[1] << " " <<inertia[2] << "\n "<<inertia[3] << " " <<inertia[4] << " " <<inertia[5] << "\n "<<inertia[6] << " " <<inertia[7] <<" " << inertia[8]<<"\n "; CHECK(virtAttachVO(vc, o->getMass(), inertia)); }
void virtuose::attachTransform(VRTransformPtr trans) { //if(!connected()) return; isAttached = true; attached = trans; VRPhysics* o = trans->getPhysics(); btMatrix3x3 t = o->getInertiaTensor(); Vec9 inertia; Matrix3ToArray(t,inertia.data); print(inertia, 9); //cout<<"\n virtuose::attachTransform:\n " << inertia[0] << " " <<inertia[1] << " " <<inertia[2] << "\n "<<inertia[3] << " " <<inertia[4] << " " <<inertia[5] << "\n "<<inertia[6] << " " <<inertia[7] <<" " << inertia[8]<<"\n "; cout<<"\n virtuose::attachTransform:\n "; interface.setObject<Vec9>("inertia", inertia); interface.setObject<float>("mass", o->getMass()); interface.setObject<bool>("doAttach", true); //CHECK(virtAttachVO(vc, o->getMass(), inertia)); }