About Store Forum Documentation Contact



Post Reply 
[solved]collision shapes attached to the bones
Author Message
andrake Offline
Member

Post: #1
[solved]collision shapes attached to the bones
greeting i will try to make as in this video
http://www.youtube.com/watch?v=n51c_exT054

i mean:
turtle is animated and moving.
for some of bones there should be atached shapes(physical bodies) ..this shapes should moved with animated bones

shapes should be influence to another shapes at the scenes

how it can be done7
also all this i want to make by code...not via editor.

Game.ObjParamsPtr chr;
CSkeleton cskel;
Ragdoll ragdoll; // ragdoll
Actor aaa;
Shape shap;

void init_turtle()
{
chr=UID(UID(3369145794, 1253738886, 1137882274, 2587527294)); // load character
chr->mesh()->scale(TURTLE_SCALE);
chr->mesh()->skeleton()->move(START_TURTLEPOS);
chr->mesh()->move(START_TURTLEPOS);
cskel.create(chr->mesh()->skeleton(), 1.0);
cskel.skeleton().scale(Vec(1, 1, 1));
chr->mesh()->skeleton().setBoneShapes();


aaa.create(Box (0.1 , START_TURTLEPOS));



}

void update_turtle()
{
Matrix m; // matrix (matrix is a position + orientation)
m=cskel.findBone(8"DEF-thumb_03_R").matrix();
//aaa.pos(cskel.findBone(8"DEF-thumb_03_R").pos);
//m.move(START_TURTLEPOS);
aaa.matrix(m);
}



it not works because it move aaa to the root bone instead "DEF-thumb_03_R" bone

http://www.youtube.com/watch?v=TlR_tb1v0Ds or this video may be show better what i want to do

can be ragdool used for this purpose?
can be ragdool fully created via code? not using editor at all?
(This post was last modified: 10-23-2013 01:59 PM by andrake.)
10-22-2013 02:11 PM
Find all posts by this user Quote this message in a reply
andrake Offline
Member

Post: #2
RE: collision shapes attached to the bones
it was hard to understood and to make ...
Esenthel there should be somewhere comment that:
if you get matrix from animated bone then, to apply correctly this matrix to another object you should move this object to start bone position(before animation) and rotation should be also the same.

also in api there is not enought functions to make this without using OrientP.

fuuf ..hard day...but i am happy )
10-23-2013 01:59 PM
Find all posts by this user Quote this message in a reply
Post Reply