Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   Related Pages  

/home/rdbrown/doxygen/cse125g1/src/modules/actor/Joint.cpp

00001 #include "Joint.h"
00002 #include "opengl.h"
00003 
00004 void BallJoint::Update()
00005 {
00006         //Matrix34 offs, rotate;
00007         Vector3 dofs(x.GetVal(),y.GetVal(),z.GetVal());
00008 
00009         local.FromEulers(dofs, Matrix34::EULER_XYZ);
00010 //      local.d.Set(offset.x,offset.y,offset.z);
00011         //offs.d.Set(offset.x,offset.y,offset.z);
00012 
00013         //local.Dot(offs, rotate);
00014 
00015         if(parent != NULL)
00016                 world.Dot(local, (parent->world));
00017         else
00018                 world.Dot(local, world);
00019 
00020         for(unsigned int i = 0; i < childObjects.size(); i++)
00021                 childObjects[i]->Update();
00022 }
00023 
00024 void BallJoint::Draw()
00025 {
00026         glPushMatrix();
00027         glMultMatrixf(world);
00028         glutWireCube(0.3);
00029         glPopMatrix();
00030 }
00031 void BallJoint::AttachObject(BallJoint *newObject)
00032 {
00033         childObjects.push_back(newObject);
00034         newObject->parent = this;
00035         //newObject->local.d.Subtract(world.d,newObject->world.d);
00036         // get the local matrix for the new object by transforming
00037         // its world matrix into bone space
00038         //Matrix34 transInto = world;
00039         //transInto.Inverse();
00040         //newObject->local.Dot(newObject->world,transInto);
00041 }

Generated on Thu Aug 18 16:03:09 2005 for Robin Hood: Thieves & Knights by doxygen1.2.18