I'm making a 3D Game with C++, Irrlicht(Graphics), and Newton(Physics). I decided to make my main.cpp code simple, and I have a game.cpp, main.cpp, main.h, and a game.h. I am trying to use the "CGame" class from my game.cpp... and it's having problems...
1>c:\documents and settings\billy\my documents\visual studio 2008\projects\irrfps\irrfps\main.cpp(4) : error C2259: 'CGame' : cannot instantiate abstract class
1> due to following members:
1> 'bool irr::IEventReceiver::OnEvent(const irr::SEvent &)' : is abstract
1> c:\irrlicht-1.5\include\ieventreceiver.h(351) : see declaration of 'irr::IEventReceiver::OnEvent'
I don't know what to use for a character, do people make the character in a 3D modeling program and animate it there too? Then when the character dies like in Halo 3, it turns into a ragdoll? Or GTA, the character is animated but then turns into a ragdoll when it's done...
My question is do people animate their character and turn it into a ragdoll when they want? Or do they make their character have the ragdolls joints and everything and animate it by moving the joints, and then just letting them go free when the character dies?
EDIT: I'm not asking about what most games do gameplay wise, I'm just saying for games that have ragdoll related deaths, how do they do it?
ibly31 wrote:My question is do people animate their character and turn it into a ragdoll when they want? Or do they make their character have the ragdolls joints and everything and animate it by moving the joints, and then just letting them go free when the character dies?
The latter, I believe.
Isaac Asimov wrote:Part of the inhumanity of the computer is that, once it is competently programmed and working smoothly, it is completely honest.
Oh, really? I was completely sure it'd be the first one. Well, does anyone here have irrlicht or newton experience that can point me in the rught direction?
ibly31 wrote:Oh, really? I was completely sure it'd be the first one. Well, does anyone here have irrlicht or newton experience that can point me in the rught direction?
Well.. they're sort of the same. I mean, ragdoll implies loose joints. Models usually have joints that you move. So... when they die, they go out of forced movement and go to free.
I realized the moment I fell into the fissure that the book would not be destroyed as I had planned.
Hmm, do you think they make the characters body out of joints and sticks and then apply the arm mesh and leg mesh and head mesh to it? That how i'd do it
Edit: I mean have a different mesh, and since each body part is its own bone, attach a mesh to each bone for graphixs purposes but still do collision using the low poly rectangle or cylinder bone. And by animating conpletely in an editor i mean like making a character with different animations you call like jump and walk. That would be really hard to turn into a ragdoll...
You change what has control over the model when it dies. When it's alive, use animations on the model. When it's dead, use ragdoll physics on the model (and usually they reduce the weight of the model so that it can be launched around and stuff).
I realized the moment I fell into the fissure that the book would not be destroyed as I had planned.
Ragdoll effects are used by basically turning each bone (or in some cases a set of bones) into it's own physics object (each one is a rigid body instance), rather than them going through keyframed animations. It's much harder to do than just having a death animation, but obviously more effective in a lot of cases. You are not playing an animation at all in the case of a ragdoll, as Marauder said, you are leaving the movement of these bones (joints) up to the physics system.
EDIT: In response to your last question, it seems like you're unsure about the whole animating (rigging and skinning) process. To clear a few things up, in most engines (as with Irrlicht I believe, in the small time I was looking into it), you have one file for the mesh. This file never changes, it's just your character model. You have another file for the skeleton, which contains all your animations. This skeleton consists of bones (referred to as joints by most API documentation), which are animated by keyframed movement. The skinning is what links the bones to the mesh, otherwise your character model will not animate at all. So, in the case of ragdolls, there is no animation call, but the skeleton is told to act like a bunch of linked rigid bodies by the physics engine. The skinning that links the model to the skeleton manipulates the character accordingly.
I have animated with blenser before and exported it, and like in an MD2 file you can call different animations with irrlicht, how do you apply the ragdoll physics once your character dies? Can you accees the armatures that you created inside the 3D modelling program?
The bottom line is that it's kind of a pain in the ass, and even if you get the basics working, making it so the character mesh doesn't clip into itself or the environment all over the place is even more complicated. You should only do this if you really want ragdolls.