Code Search for Developers
 
 
  

DopeJoint.cpp from Project OGRE Lia Game (POGLI Game) at Krugle


Show DopeJoint.cpp syntax highlighted

#include "DopeJoint.h"
#include "DopeEntidad.h"

namespace Dope {

    //-------------------------------------------------------------------------
    Joint::Joint(Joint::JointType jtype) 
        : mType(jtype), mAnchor(Vector3::ZERO), mOdeJoint(NULL)
    {
        mAxes.first = Vector3::UNIT_X;
        mAxes.second = Vector3::UNIT_Z;

        // Subclasses must set attachment since mOdeJoint must be created
        
    }
    //-------------------------------------------------------------------------
    Joint::JointType Joint::getType(void)
    {
        return mType;
    }
    //-------------------------------------------------------------------------
    const Vector3& Joint::getAnchorPosition(void)
    {
        return mAnchor;
    }
    //-------------------------------------------------------------------------
    void Joint::setAttachments(Entidad* obj1, Entidad* obj2)
    {
        dBodyID b1, b2;
        b1 = b2 = 0;
        if (obj1)
        {
            assert(obj1->getOdeBody() && "Cannot attach objects which do not have ODE bodies.");
            b1 = obj1->getOdeBody()->id();
        }
        if (obj2)
        {
            assert(obj2->getOdeBody() && "Cannot attach objects which do not have ODE bodies.");
            b2 = obj2->getOdeBody()->id();
        }

        mOdeJoint->attach(b1, b2);
        mAttachedObjects.first = obj1;
        mAttachedObjects.second = obj2;

    }
    //-------------------------------------------------------------------------
    const std::pair<Entidad*, Entidad*>& 
    Joint::getAttachments(void)
    {
        return mAttachedObjects;
    }
    //-------------------------------------------------------------------------
    const std::pair<Vector3, Vector3>& 
    Joint::getAxes(void)
    {
        return mAxes;
    }
    //-------------------------------------------------------------------------



}




See more files for this project here

Project OGRE Lia Game (POGLI Game)

Video juego desarrollado en OGRE, multiplataforma (a nivel de codigo fuente). Proyecto desarrollado como tesis para la facultad de ingenieria, UNAM, Mexico

Project homepage: http://sourceforge.net/projects/tesis-h4l9k-jp
Programming language(s): C++
License: other

  DOPE.vcproj
  DopeCamara.cpp
  DopeDemo.cpp
  DopeEntidad.cpp
  DopeEscena.cpp
  DopeJP.cpp
  DopeJoint.cpp
  DopeJointSubtypes.cpp
  DopePlano.cpp
  Dope_demo.cbp
  Makefile