示例#1
0
boost::shared_ptr<Joint> Joint::GetJoint(long jointID)
{
    if (jointID == 0)
        {
            return boost::shared_ptr<Joint>();
        }

    Joint* jointPtr = mJointImp->GetJoint(jointID);

    if (jointPtr == 0)
        {
            // we cannot use the logserver here
            cerr << "ERROR: (Joint) no joint found for dJointID "
                 << jointID << "\n";
            return boost::shared_ptr<Joint>();
        }

    boost::shared_ptr<Joint> joint = static_pointer_cast<Joint>
        (jointPtr->GetSelf().lock());

    if (joint.get() == 0)
        {
            // we cannot use the logserver here
            cerr << "ERROR: (Joint) got no boost::shared_ptr for dJointID "
                 << jointID << "\n";
        }

    return joint;
}
示例#2
0
shared_ptr<Joint> Joint::GetJoint(dJointID id)
{
    if (id == 0)
        {
            return shared_ptr<Joint>();
        }

    Joint* jointPtr =
        static_cast<Joint*>(dJointGetData(id));

    if (jointPtr == 0)
        {
            // we cannot use the logserver here
            cerr << "ERROR: (Joint) no joint found for dJointID "
                 << id << "\n";
            return shared_ptr<Joint>();
        }

    shared_ptr<Joint> joint = shared_static_cast<Joint>
        (jointPtr->GetSelf().lock());

    if (joint.get() == 0)
        {
            // we cannot use the logserver here
            cerr << "ERROR: (Joint) got no shared_ptr for dJointID "
                 << id << "\n";
        }

    return joint;
}