diff options
author | Mitchell Stokes <mogurijin@gmail.com> | 2011-07-26 10:10:05 +0400 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2011-07-26 10:10:05 +0400 |
commit | 1f65b3b1a8f5ccc54a794ed0d6f8cf2d3e2c5a36 (patch) | |
tree | 236c1d8475709b45962fd5efa901626a78fedbe0 /source/blender/makesdna | |
parent | 1e0e0ff5c4e88f2ee21c849b151a1899ae4c714f (diff) |
BGE Animations: Adding a new choice for vertex deformation for armatures, which can be found in the Armature's Skeleton panel by the Deform options. Before only Blender's armature_deform_verts() was used. Now users can choose a vertex deformation function that is optimized for the BGE. At the moment it is mostly a copy of armature_deform_verts() with various chunks of code removed, and the BLI_math code was replaced with Eigen2. In my test scene, the new function offered about a 40% improvement over armature_deform_verts() (17~19ms rasterizer to 11~12ms). The only current limitation that I'm aware of if that B-Bone segments are not supported in the BGE version, and I will probably leave it out. I would like to also limit the BGE version to 4 weights to make things easier for a GPU version, but this may just make things slower (sorting weights to find the top 4).
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r-- | source/blender/makesdna/DNA_armature_types.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/makesdna/DNA_armature_types.h b/source/blender/makesdna/DNA_armature_types.h index 808db1f4843..1675fdd3e90 100644 --- a/source/blender/makesdna/DNA_armature_types.h +++ b/source/blender/makesdna/DNA_armature_types.h @@ -96,7 +96,9 @@ typedef struct bArmature { void *sketch; /* sketch struct for etch-a-ton */ int flag; - int drawtype; + int drawtype; + int gevertdeformer; /* how vertex deformation is handled in the ge */ + int pad; short deformflag; short pathflag; @@ -140,6 +142,12 @@ typedef enum eArmature_Drawtype { ARM_WIRE } eArmature_Drawtype; +/* armature->gevertdeformer */ +typedef enum eArmature_VertDeformer { + ARM_VDEF_BLENDER, + ARM_VDEF_BGE_CPU +} eArmature_VertDeformer; + /* armature->deformflag */ typedef enum eArmature_DeformFlag { ARM_DEF_VGROUP = (1<<0), |