__Armatures and deformation__

I noticed that the armature in the game engine dose not move the vertices. this is a real bummer. is there any way to find the “real” deformed xyz of a vertix of a deformed mesh?

I would realy like it if you could make an armature an actor and in the ‘bounds’ drop-down thing have a list of the child objects of the armature.

ANY chance of this happening?

no

because you can’t change the bounds of an object in python either

besides, why is it so important to you? [all other engines with similar things will have only bounding shapes of bones cause collisions, not the actual deformed mesh]

actualy, you can change the bounds of a object in python. when you edit the mesh (like with the ‘realtime water’ script), and the bounds is set to ‘polyheader’, the colision mesh changes. My idea was instead of modeling a bounds box, you could model a box for each bone, and they would move with the armature.

OK, SIMPLIFICATION:
the mesh in the game engine dose dot realy deform with the armature. the bounds box for my latest charactor for example:
http://blender.sixmonkeys.geek.nz/albums/Jordnak/bound.gif

in the game engine, it just dose a box around the ‘rest pose’.

To get the deformed vertex data, you’ll need to code something in Python like:

import Blender
from Blender import NMesh

mesh = NMesh.GetRawFromObject( 'object name here' )

You’ll need to refer to the online documentation for more info on accessing individual vertices, but this method gets you the deformed (and sub-surfaced if you’ve got that turned on) mesh of the specified object.

Though what you’d really want to do with this in a game…

thanks, i’ll test this out!

IE:
colision test with a sword, ‘real’ bound object…

Ah, collision testing.

For a game, you shouldn’t be testing the individual vertices of your mesh. There’s far too many. Instead, simplify the problem. For a straight sword, for example, you only need to track the tip and the pommel. The two vertices define a line segment. Anything that line segment intersects (within bounds) can be considered impacted by the sword. Testing a line (or cylindar) is much more efficient than testing 50-200 individual vertices. An axe or some other odd-shaped object might need only two or three segments.

The same method is convenient for the objects being impacted. Just as you armature your objects (such as a person) with what are basically just line segments, you can define bounding cylindars or boxes. That’d be something like:
2 per arm
2 per leg
1-2 per torso
1 per head
total: 10-11 impact objects instead of 200-500 vertices for even just a very low-poly mesh.

Unless you want to program ultra-physics where someone just gets a scratch from being grazed, an appropriatly defined collision skeleton is far more efficient and just as accurate for what you normally want to do in games. The overhead of maintaining the skeleton is overwhelmingly offset by the increase in speed.

Hope this helps.

yeah, that is what i was trying to say. have your model, that is rendered, and your ULTRA LOW poly model (boxes) that the colision is done with.

HOW do i do this?

Just the tip and pomel would be fine too, because i could have an empty at the tip, and a box at the pomel, and have the box track to the tip.

Yeah, sorry. I haven’t messed with the game engine. :expressionless: (My first response here was because I thought I was in another forum.) So I have no idea how you’d actually keep all the data together.

If you can parent empties to all the important points, then you can get their deformed positions in python and use standard line->cylindar math intersection routines for your collisions.

Sorry I can’t help further.