About Store Forum Documentation Contact



Post Reply 
Specified Ragdoll bone / Jiggle Bone
Author Message
SamNainocard Offline
Member

Post: #1
Specified Ragdoll bone / Jiggle Bone
I have a character with Tai (or perhaps hair or cloth) l but I don't want to animate the tail every animation, so I want to make those bone to be ragdoll and move on their own when character is animated.

But I can't figured how to make specified bone to be ragdoll while others are not.
11-02-2015 06:12 AM
Find all posts by this user Quote this message in a reply
Zervox Offline
Member

Post: #2
RE: Specified Ragdoll bone / Jiggle Bone
if the tail is a separate mesh it could probably be connected like an attachment, it would either use its own physics controller or the part could maybe be controlled through physics joints?
(This post was last modified: 11-02-2015 07:00 AM by Zervox.)
11-02-2015 07:00 AM
Find all posts by this user Quote this message in a reply
SamNainocard Offline
Member

Post: #3
RE: Specified Ragdoll bone / Jiggle Bone
So, separate tail from the mesh, then create tail mesh and actor in game with ragdoll enabled, and attached to bone point, right?
But it's look like a lot of work, is there another way?

Never used joint though.
(This post was last modified: 11-02-2015 08:32 AM by SamNainocard.)
11-02-2015 08:22 AM
Find all posts by this user Quote this message in a reply
Zervox Offline
Member

Post: #4
RE: Specified Ragdoll bone / Jiggle Bone
There is always other ways, sadly I do not know enough about this specific field. smile
I just figured I'd mention the methods that popped into my head first, haven't played with physics actors or ragdolls that much. but I'd bet there is someone else on this forum who has(hopefully they might read this and comment on it).
(This post was last modified: 11-02-2015 10:14 AM by Zervox.)
11-02-2015 10:13 AM
Find all posts by this user Quote this message in a reply
SamNainocard Offline
Member

Post: #5
RE: Specified Ragdoll bone / Jiggle Bone
I made a manual adjustment based on sac.body, it's may not good but I'm satisfied with the results, it doesn't affected by velocity though.

Code:
Mems<Vec2>     tails_angle;
flt            tails_y;

tails_angle[0].x+=AngleDelta(tails_angle[0].x, Angle(skel.bones[sac.body].matrix().z.xz())+PI_2);
tails_angle[0].x-=(1-anim.left_right*2)*anim.straight_strafe*anim.stop_move;
tails_angle[0].y+=AngleDelta(tails_angle[0].y, (tails_y-pos().y));
tails_y          =pos().y;
FREP(10)
{
   int bone_inx=skel.findBoneI(BONE_TAIL, 0, i);
   if(bone_inx>=0)
   {
      Int body_sign      =Sign(skel.skeleton()->bones[sac.body].perp.z);
      Flt tail_pitch     =tails_angle[i].y*body_sign;
          tail_pitch    *=1-anim.fly_full_body*anim.fly;
      Flt tail_pitch_part=tail_pitch/(i+1)+anim.fly;
      Flt tail_roll      =(tails_angle[Max(i-1, 0)].x-tails_angle[i].x);
      if(i>0) tail_roll+=(1-anim.stop_move)*Sin(Time.time())/(4*(i+1));  // tails move on their own naturally
      Clamp(tail_roll      , -PI/5 , PI/5);
      Clamp(tail_pitch_part, -PI/12, PI/8);
      Vec     v;
      Matrix3 m;
              
      v=skel.root.orn.cross(); if(!v.any())v.x=1; CHS(v.z);
      m.setRotate(v, tail_pitch_part*-body_sign).rotateY(tail_roll);
      skel.bones[bone_inx].orn*=m;
      AdjustValTime(tails_angle[i].x, tails_angle[Max(i-1, 0)].x, 0.0025  /(i+1+anim.stop_move*20000+Max(anim.b_turn_l, anim.b_turn_r)*500));
      AdjustValTime(tails_angle[i].y, tails_angle[Max(i-1, 0)].y, 0.000005/(i+1));
   }else break;
}
(This post was last modified: 11-03-2015 05:15 AM by SamNainocard.)
11-03-2015 05:00 AM
Find all posts by this user Quote this message in a reply
Post Reply