Quantcast

Jump to content

» «
Photo

set & get bone position

8 replies to this topic
Gian_Yagami
  • Gian_Yagami

    Peon

  • Members
  • Joined: 08 Nov 2011
  • None

#1

Posted 10 January 2018 - 04:04 AM

As the title said, please help.

ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union
  • Contribution Award [Mods]
    Helpfulness Awards [Mods]

#2

Posted 10 January 2018 - 04:37 PM

look here


Gian_Yagami
  • Gian_Yagami

    Peon

  • Members
  • Joined: 08 Nov 2011
  • None

#3

Posted 11 January 2018 - 02:59 PM

I've check it before. it just get offset, not setting.


ZAZ
  • ZAZ

    Kernlochbohrer

  • Feroci
  • Joined: 10 Jan 2005
  • European-Union
  • Contribution Award [Mods]
    Helpfulness Awards [Mods]

#4

Posted 11 January 2018 - 03:38 PM

what you wanna set bone position? it's given by charackter skeleton

do you wanna make an ingame animator?


Gian_Yagami
  • Gian_Yagami

    Peon

  • Members
  • Joined: 08 Nov 2011
  • None

#5

Posted 12 January 2018 - 03:41 AM

what you wanna set bone position? it's given by charackter skeleton
do you wanna make an ingame animator?


Yes, I wanna make Inverse kinematics. I've seen madleg's ragdoll used this method which hooking ped bone position into ragdoll physics process.

DK22Pac
  • DK22Pac

  • Feroci
  • Joined: 12 Apr 2009
  • Ukraine
  • Best Conversion 2017 Contribution [Liberty City Stories: PC]
    Best WIP Mod 2014 [Grand Theft Auto 3D Contribution]
    Contribution Award [Mods]
    Helpfulness Award [Mods]

#6

Posted 12 January 2018 - 01:06 PM Edited by DK22Pac, 12 January 2018 - 01:07 PM.

In case if you use plugin-sdk:
#include "plugin.h"
#include "common.h"
#include "CCoronas.h"

using namespace plugin;

class BonePosition {
public:
    BonePosition() {

        Events::gameProcessEvent += [] {

            CPed *playa = FindPlayerPed();

            if (playa) {

                RwV3d leftHand, rightHand;
                playa->GetBonePosition(leftHand, 25, true);
                playa->GetBonePosition(rightHand, 35, true);

                CVector leftPos, rightPos;
                leftPos.FromRwV3d(leftHand);
                rightPos.FromRwV3d(rightHand);

                CCoronas::RegisterCorona(reinterpret_cast<int>(playa), nullptr, 255, 0, 0, 255, leftPos, 0.2f, 100.0f,
                    CORONATYPE_SHINYSTAR, 0, false, false, 0, 0.0f, false, 0.1f, 0, 1.0f, false, false);
                CCoronas::RegisterCorona(reinterpret_cast<int>(playa) + 1, nullptr, 255, 0, 0, 255, rightPos, 0.2f, 100.0f,
                    CORONATYPE_SHINYSTAR, 0, false, false, 0, 0.0f, false, 0.1f, 0, 1.0f, false, false);
            }
        };
    }
} bonePosition;
  • Gian_Yagami, Jack and Sloth- like this

Gian_Yagami
  • Gian_Yagami

    Peon

  • Members
  • Joined: 08 Nov 2011
  • None

#7

Posted 12 January 2018 - 11:18 PM

In case if you use plugin-sdk:

#include "plugin.h"
#include "common.h"
#include "CCoronas.h"

using namespace plugin;

class BonePosition {
public:
    BonePosition() {

        Events::gameProcessEvent += [] {

            CPed *playa = FindPlayerPed();

            if (playa) {

                RwV3d leftHand, rightHand;
                playa->GetBonePosition(leftHand, 25, true);
                playa->GetBonePosition(rightHand, 35, true);

                CVector leftPos, rightPos;
                leftPos.FromRwV3d(leftHand);
                rightPos.FromRwV3d(rightHand);

                CCoronas::RegisterCorona(reinterpret_cast<int>(playa), nullptr, 255, 0, 0, 255, leftPos, 0.2f, 100.0f,
                    CORONATYPE_SHINYSTAR, 0, false, false, 0, 0.0f, false, 0.1f, 0, 1.0f, false, false);
                CCoronas::RegisterCorona(reinterpret_cast<int>(playa) + 1, nullptr, 255, 0, 0, 255, rightPos, 0.2f, 100.0f,
                    CORONATYPE_SHINYSTAR, 0, false, false, 0, 0.0f, false, 0.1f, 0, 1.0f, false, false);
            }
        };
    }
} bonePosition;

I am using your plugin sdk and I can't find a function to set bone. Similar things in CPedIK but that's only for set limb orientation.

 

Maybe I should change technique, hooking mesh bodypart instead bone animation.


DK22Pac
  • DK22Pac

  • Feroci
  • Joined: 12 Apr 2009
  • Ukraine
  • Best Conversion 2017 Contribution [Liberty City Stories: PC]
    Best WIP Mod 2014 [Grand Theft Auto 3D Contribution]
    Contribution Award [Mods]
    Helpfulness Award [Mods]

#8

Posted 18 January 2018 - 06:34 AM

How do you want to change a bone's 'position'? Do you want to place it at specific world coord or what?

Gian_Yagami
  • Gian_Yagami

    Peon

  • Members
  • Joined: 08 Nov 2011
  • None

#9

Posted 18 January 2018 - 12:48 PM

How do you want to change a bone's 'position'? Do you want to place it at specific world coord or what?

I want to make ragdoll physics with my inverse kinematics algorithm





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users