Results 1 to 3 of 3

Thread: Attach joints to other joints programmatically

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    An update for the post above, i managed to correctly handle the sword's movement by commenting the "Syncronize" part and calculating the Matrix of the weapon's actor in the OnProgress event of the Cadencer



    Procedure TFormProgramma.AggiornaPosizioneArma(Sender: TObject; const deltaTime, newTime: Double);
    Var
    MatriceArma: TMatrix4f;
    Begin
    //if i simply use something like
    //Arma.Matrix := Actor.Skeleton.BoneByName('Weapon_R_Bone').GlobalM atrix;
    //the sword's hilt assumes the right rotation, but wrong position as it floats just
    //above the hand's bone, so i look for another bone as a reference for the right
    //coordinates: the Bip01_R_Finger0Nub seems to be the right choice
    MatriceArma[0] := Actor.Skeleton.BoneByName('Weapon_R_Bone').GlobalM atrix[0];
    MatriceArma[1] := Actor.Skeleton.BoneByName('Weapon_R_Bone').GlobalM atrix[1];
    MatriceArma[2] := Actor.Skeleton.BoneByName('Weapon_R_Bone').GlobalM atrix[2];
    MatriceArma[3] := Actor.Skeleton.BoneByName('Bip01_R_Finger0Nub').Gl obalMatrix[3];
    Arma.Matrix := MatriceArma;
    End;
    Sorry if my english sounds weird: it's not my primary language

  2. #2
    Looking good! Glad you worked it out...

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •