コード例 #1
0
ファイル: virtuose.cpp プロジェクト: uagmw/polyvr
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));

}
コード例 #2
0
ファイル: virtuose.cpp プロジェクト: Victor-Haefner/polyvr
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));
}