About Store Forum Documentation Contact



Post Reply 
animateUpdateMatrix
Author Message
Ogniok Offline
Member

Post: #1
animateUpdateMatrix
I copied animateUpdateMatrix from BM, but it didn't work in my game. When I'm playing i get effect like this:

[Image: vejsd1d.jpg]

Function:

Code:
void Player::animateUpdateMatrix(Matrix &body_matrix)
{
   __super::animateUpdateMatrix(body_matrix); //Call default setting skeleton matrix

   Vec &desired_dir = cskel.getPoint("head").dir; //This is the desired weapon direction in world space

   if(Inv.slot[playerData.activeWeapon].valid()) //If has item
   {
      if(OrientP *point = cskel.findPoint("HandR"))
      {
          Vec current_dir = point->cross();                         //This is the current weapon direction in world space

          Matrix3 transform;
          transform.setRotation(current_dir, desired_dir, b_aim_r); //Create matrix which transforms current direction into desired direction

          cskel.transformInWorldSpace(sac.arm_ru, transform);       //Call this method to perform a world space transformation
      }
   }
}

When I'm not using animateUpdateMatrix function i get this:

[Image: 0zer7cw.jpg]

I want player to hold item just like in BM.
03-26-2010 08:14 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: animateUpdateMatrix
check the orientation of your SkelPoint hand compared to the one in BM
03-26-2010 08:16 PM
Find all posts by this user Quote this message in a reply
Ogniok Offline
Member

Post: #3
RE: animateUpdateMatrix
I've added this:

Code:
if(slot[playerData.activeWeapon].valid())
   {
      if(OrientP *point = owner.cskel.findPoint("HandR"))
      {
         ItemEC &item   = slot       [playerData.activeWeapon]();
         Matrix &matrix = slot_matrix[playerData.activeWeapon];

         item.matrix(Matrix().setPosDir(point->pos, point->dir, point->cross())); //Set new matrix
         //item.matrix().rotateZ(180);

         Vec vel, ang_vel;
         GetVel(vel, ang_vel, matrix, item.matrix()); //Calculate velocities between old and new matrixes

         item.setDrawingVelocities(vel, ang_vel); //Put the velocities to be used in motion blur drawing
         matrix = item.matrix(); //Store new matrix
      }
   }

To Inventory::update function and I get this:

[Image: l8jon46.jpg]
03-26-2010 08:32 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: animateUpdateMatrix
check it also in Mesh Editor (point orientation)
03-26-2010 09:32 PM
Find all posts by this user Quote this message in a reply
Ogniok Offline
Member

Post: #5
RE: animateUpdateMatrix
How I can do this?
03-26-2010 09:43 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #6
RE: animateUpdateMatrix
launch mesh editor skeleton mode
and check if the skeleton hand point orientation has the same directions as the one from latest version of BM (check also the tiny perpendicular line)
03-26-2010 11:53 PM
Find all posts by this user Quote this message in a reply
Ogniok Offline
Member

Post: #7
RE: animateUpdateMatrix
They are not the same. How I can set the same orientation in Human model and Commando Babe?
03-27-2010 12:06 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #8
RE: animateUpdateMatrix
editing is described in Mesh Editor documentation
Alt+RMB should rotate the point
03-27-2010 02:47 PM
Find all posts by this user Quote this message in a reply
Post Reply