Sword movements mapped to mouse
by Joel Hargarten · in Torque Game Engine · 06/17/2007 (10:18 am) · 12 replies
Hey.
I want to make it so that when the left mouse button is held, you get complete freedom of movement with the sword you're carrying. Does anyone know how to do this or where to start? I guess what I need is just to have the right arm respond to the mouse. Any suggestions? Thanks.
I want to make it so that when the left mouse button is held, you get complete freedom of movement with the sword you're carrying. Does anyone know how to do this or where to start? I guess what I need is just to have the right arm respond to the mouse. Any suggestions? Thanks.
#2
06/20/2007 (9:00 am)
You could always pop on their forum and ask, or even their ICQ channel.
#3
06/20/2007 (1:00 pm)
Sounds like procedural animation to me. You know where you want to go, so you work out the inverse kinematics and then generate the animation on the fly. The question is, can the animation blender be readily adapted to do procedural (or at least slip frames in that you generated) or are you looking at writing from scratch?
#4
Now I can set the position of any node that I want using this:
Now I need to know how to get the coordinates of the mouse and temporarily detach the mouse from directing the camera. Any ideas?
06/24/2007 (5:54 pm)
Thanks for your comments so far. The tip on procedural animation led me to this: http://www.garagegames.com/mg/forums/result.thread.php?qt=33391Now I can set the position of any node that I want using this:
Point3F pos; pos = mShapeInstance->mNodeTransforms[11].getPosition(); pos.x = someCoordinate; pos.y = someCoordinate; pos.z = someCoordinate; mNodeTransforms[11].setPosition(pos);
Now I need to know how to get the coordinates of the mouse and temporarily detach the mouse from directing the camera. Any ideas?
#5
06/25/2007 (4:28 pm)
I'm doing all of this in the engine so far in player.cpp, can I tie this to the scripting side and control the on\off and the mouse movement there?
#6
07/03/2007 (10:47 am)
I can't find how to get the mouse coordinates from the engine side of things. Am I going about this wrong?
#7
I also need to be able to temporarily suspend the mouse's control of the camera while I move the sword around. This should be easy to do, can someone point me to where this is in the code?
07/06/2007 (6:58 pm)
No ideas? It seems like there is a trick to it that I'm not understanding yet. I've found a way to move the nodes that I need, I just have to be able to do it in real time along with the mouse movements. I guess I need help understanding how to communicate the mouse movements on the user scripting side to the server engine side where I can individually alter the nodes.I also need to be able to temporarily suspend the mouse's control of the camera while I move the sword around. This should be easy to do, can someone point me to where this is in the code?
#8
You can find the information on the mouse movement in the function Player::updateMove function, by referencing move->yaw and move->pitch.
However, did you know that Determinance is pretty modable? You can change almost anything about it. Come into our chatroom, #determinance on irc.maxgaming.net, and chat if you'd like.
Ian
--
Ian Hardingham
Mode 7 Games
07/07/2007 (3:01 am)
Hi Joel, I'm the designer and coder on Determinance.You can find the information on the mouse movement in the function Player::updateMove function, by referencing move->yaw and move->pitch.
However, did you know that Determinance is pretty modable? You can change almost anything about it. Come into our chatroom, #determinance on irc.maxgaming.net, and chat if you'd like.
Ian
--
Ian Hardingham
Mode 7 Games
#9
07/07/2007 (9:39 am)
Thanks for the info, this will help a lot, I've been trying to track down where that was. Determinance is a great game, its just one of those games that becomes addicting and you can't stop playing it. lol. But I'll be sure to drop by the chat room. Thanks again.
#10
07/11/2007 (1:05 pm)
Well, thanks to Ian I can get the coordinates for the mouse, but I'm still having trouble moving the arm correctly. When I use mNodeTransforms[11].setPosition(pos); it just seems to move the mesh and deform it rather than actually moving the bone. That, and I dont quite know where to call it. I need it somewhere where I can get the move->yaw coordinates, and also somewhere after it calls the sequence. Because I play an animation sequence such as 'run' or 'jump', but I need to override the movement just for the arm while keeping the rest of the sequence playing. This is starting to get a little complicated, any advice will be appreciated. Ian, I don't suppose that you ever considered putting together some kind of tutorial about moving the arm with the mouse?
#11
07/12/2007 (1:12 am)
Hey Ian, Is there any chance that you'd be willing to put the tech behind Determinance into a kit? What you have is exactly what I've been trying to do and this could save me a LOT of messing around with Jacobians. This kind of thing is not just limited to sword fighting and it could easily be a popular as the AFX. Heck, I can imagine a lot of people would combine it with AFX.
#12
Joel, I'm afraid it's not a hugely straightforward thing to do. If I were starting from scratch I'd try using a lot of blend animations rather than accessing the skeleton directly - although that's not how Determinance does it, it should get good results.
Ian
07/12/2007 (5:01 am)
David, the Determinance technology is a large part of the value of our company right now. Possibly in a year or so, when we've taken advantage of the business opportunities that are arising, we might consider releasing it as a kit.Joel, I'm afraid it's not a hugely straightforward thing to do. If I were starting from scratch I'd try using a lot of blend animations rather than accessing the skeleton directly - although that's not how Determinance does it, it should get good results.
Ian
Torque Owner Joel Hargarten