About Store Forum Documentation Contact



Post Reply 
How to bend the characters upwards or downwards
Author Message
Rabishan Offline
Member

Post: #1
How to bend the characters upwards or downwards
hi guys,

we're trying to implement range attacks and having some problem implementing it. the main problem is the height position difference between the target and attacker. because of this the target is missed most of the times. to overcome this we used axisroll to bend(upwards or downwards) the character angle to aim the target

PHP Code:
AxisRoll a;
        
a.axis=Vec(0,-0.5f,0);
        
Players[0].cskel.getBone("c_spline02_jj").rot=a;
        
Players[0].cskel.updateMatrix(Players[0].cskel.matrix()) // update all matrixes
            
.updateVelocities();          // update all bone velocities 

at times it works well but sometimes it shows wierd behaviour[/code] as you can see in the videos.

http://www.youtube.com/watch?v=iHQ_oGDiK...e=youtu.be

http://www.youtube.com/watch?v=7K0ADwxYw...e=youtu.be

any suggestions to achieve bendings of the character in other ways.
thanks in advance.
(This post was last modified: 06-05-2012 12:12 PM by Rabishan.)
06-04-2012 12:54 PM
Find all posts by this user Quote this message in a reply
dylantan Offline
Member

Post: #2
RE: Range attack problems
Hi Guys, would you have any idea what went wrong with the code itself? Any help or advice would really be appreciated. We seriously stuck and no idea how to proceed further.
06-05-2012 01:46 AM
Visit this user's website Find all posts by this user Quote this message in a reply
SamNainocard Offline
Member

Post: #3
RE: Range attack problems
Not quite understand the question, do you mean changing Y axis (angle.y) to specified angle or code above make half of character disappear or something?
06-05-2012 11:58 AM
Find all posts by this user Quote this message in a reply
Rabishan Offline
Member

Post: #4
RE: How to bend the characters upwards or downwards
thanks for the reply and sorry the question was not clear enough. all we want to do is bend the character so it can aim the target in different heights. we used AxisRoll to bend the body bone but it doesnot behave properly.
(This post was last modified: 06-05-2012 12:17 PM by Rabishan.)
06-05-2012 12:16 PM
Find all posts by this user Quote this message in a reply
SamNainocard Offline
Member

Post: #5
RE: How to bend the characters upwards or downwards
According to wiki, AxisRoll should be use for facial, so try using Orient.

Try,
PHP Code:
Players[0].cskel.getBone("c_spline02_jj").orn.setDir(Vec(0, -0.5f0)); 
06-05-2012 12:40 PM
Find all posts by this user Quote this message in a reply
dylantan Offline
Member

Post: #6
RE: How to bend the characters upwards or downwards
Hi Sam, thank you for your help! Yes while it worked outright, it didnt work on our integrated code, therefore it gave us clue as what happened. Thank you! The problem with our code is with the animation function. Just have to replace the default animation function (since we use custom animation anyway). Hopefully this solve the problem.
06-06-2012 03:08 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply