diff --git a/Tests/test_character.c b/Tests/test_character.c index f9327f9..2cf982d 100644 --- a/Tests/test_character.c +++ b/Tests/test_character.c @@ -638,8 +638,8 @@ void CharacterGroupMoveAndAnimate(float totalTimeSeconds,float frameTimeSeconds) const float animation_time=totalTimeSeconds*animation_speed; // good only for when 'animation_speed' is constant through all the animation time //static float animation_time=0;animation_time+=frameTimeSeconds*animation_speed; // good always - cha_mesh_instance_calculate_bone_space_pose_matrices_from_action(mi,CHA_ARMATURE_ACTION_NAME_FALL_DOWN,animation_time,additional_time_to_get_to_first_frame); - //cha_mesh_instance_calculate_bone_space_pose_matrices_from_action(mi,CHA_ARMATURE_ACTION_NAME_RUN_CYCLE,animation_time,additional_time_to_get_to_first_frame); + cha_mesh_instance_calculate_bone_space_pose_matrices_from_action(mi,CHA_ARMATURE_ACTION_NAME_FALL_DOWN,animation_time,additional_time_to_get_to_first_frame,0); + //cha_mesh_instance_calculate_bone_space_pose_matrices_from_action(mi,CHA_ARMATURE_ACTION_NAME_RUN_CYCLE,animation_time,additional_time_to_get_to_first_frame,0); } # endif @@ -650,7 +650,7 @@ void CharacterGroupMoveAndAnimate(float totalTimeSeconds,float frameTimeSeconds) static float animation_time = 0.f; animation_time+= (frameTimeSeconds)*character_animation_speed; cha_mesh_instance_calculate_bone_space_pose_matrices_from_action_ex(mi,CHA_ARMATURE_ACTION_NAME_CYCLE_RUN,animation_time,additional_time_to_get_to_first_frame,character_animation_walk_run_mix_in_0_1,CHA_ARMATURE_ACTION_NAME_CYCLE_WALK,0,-1,0);//CHA_BONE_MASK_ARMS_AND_HANDS); - //cha_mesh_instance_calculate_bone_space_pose_matrices_from_action(mi,CHA_ARMATURE_ACTION_NAME_CYCLE_WALK,animation_time,additional_time_to_get_to_first_frame); + //cha_mesh_instance_calculate_bone_space_pose_matrices_from_action(mi,CHA_ARMATURE_ACTION_NAME_CYCLE_WALK,animation_time,additional_time_to_get_to_first_frame,0); } # endif @@ -702,11 +702,13 @@ void CharacterGroupMoveAndAnimate(float totalTimeSeconds,float frameTimeSeconds) const struct cha_armature* armature = peter_mi->armature; /* all characters share the same armature */ int anim_idx = 0; CHA_ASSERT(armature); - if (anim_idxnum_actions && armature->num_actions>2) { + if (anim_idxnum_actions && armature->num_actions>4) { for (i=0;inum_instances;i++) { struct cha_character_instance* inst = &group->instances[i]; if (inst!=peter && inst!=mary) { - while (anim_idx==CHA_ARMATURE_ACTION_NAME_CYCLE_RUN || anim_idx==CHA_ARMATURE_ACTION_NAME_CYCLE_WALK) anim_idx=(anim_idx+1)%armature->num_actions; // we skip these (already shown by peter) + while (anim_idx==CHA_ARMATURE_ACTION_NAME_CYCLE_RUN || anim_idx==CHA_ARMATURE_ACTION_NAME_CYCLE_WALK // we skip these (already shown by peter) + || anim_idx==CHA_ARMATURE_ACTION_NAME_POSE_HANDS_OPEN || anim_idx==CHA_ARMATURE_ACTION_NAME_POSE_HANDS_CLOSED // we skip these (affect hands only, not very noticeable) + ) anim_idx=(anim_idx+1)%armature->num_actions; if (inst->active && !inst->culled) { struct cha_mesh_instance* mi = &inst->mesh_instances[CHA_MESH_NAME_BODY]; const struct cha_armature_action* action = &armature->actions[anim_idx]; @@ -717,7 +719,7 @@ void CharacterGroupMoveAndAnimate(float totalTimeSeconds,float frameTimeSeconds) //static float animation_time=0;animation_time+=frameTimeSeconds*animation_speed; // good always if (!action->looping && animation_time>repeat_time) animation_time=fmodf(animation_time,repeat_time); - cha_mesh_instance_calculate_bone_space_pose_matrices_from_action(mi,anim_idx,animation_time,additional_time_to_get_to_first_frame); + cha_mesh_instance_calculate_bone_space_pose_matrices_from_action(mi,anim_idx,animation_time,additional_time_to_get_to_first_frame,0); } ++anim_idx;anim_idx%=armature->num_actions; } diff --git a/Tests/test_character_standalone.c b/Tests/test_character_standalone.c index 10f4959..4ecf165 100644 --- a/Tests/test_character_standalone.c +++ b/Tests/test_character_standalone.c @@ -958,8 +958,8 @@ void CharacterGroupMoveAndAnimate(float totalTimeSeconds,float frameTimeSeconds) const float animation_time=totalTimeSeconds*animation_speed; // good only for when 'animation_speed' is constant through all the animation time //static float animation_time=0;animation_time+=frameTimeSeconds*animation_speed; // good always - cha_mesh_instance_calculate_bone_space_pose_matrices_from_action(mi,CHA_ARMATURE_ACTION_NAME_FALL_DOWN,animation_time,additional_time_to_get_to_first_frame); - //cha_mesh_instance_calculate_bone_space_pose_matrices_from_action(mi,CHA_ARMATURE_ACTION_NAME_RUN_CYCLE,animation_time,additional_time_to_get_to_first_frame); + cha_mesh_instance_calculate_bone_space_pose_matrices_from_action(mi,CHA_ARMATURE_ACTION_NAME_FALL_DOWN,animation_time,additional_time_to_get_to_first_frame,0); + //cha_mesh_instance_calculate_bone_space_pose_matrices_from_action(mi,CHA_ARMATURE_ACTION_NAME_RUN_CYCLE,animation_time,additional_time_to_get_to_first_frame,0); } # endif @@ -971,7 +971,7 @@ void CharacterGroupMoveAndAnimate(float totalTimeSeconds,float frameTimeSeconds) static float animation_time = 0.f; animation_time+= (frameTimeSeconds)*character_animation_speed; cha_mesh_instance_calculate_bone_space_pose_matrices_from_action_ex(mi,CHA_ARMATURE_ACTION_NAME_CYCLE_RUN,animation_time,additional_time_to_get_to_first_frame,character_animation_walk_run_mix_in_0_1,CHA_ARMATURE_ACTION_NAME_CYCLE_WALK,0,-1,0);//CHA_BONE_MASK_ARMS_AND_HANDS); - //cha_mesh_instance_calculate_bone_space_pose_matrices_from_action(mi,CHA_ARMATURE_ACTION_NAME_CYCLE_WALK,animation_time,additional_time_to_get_to_first_frame); + //cha_mesh_instance_calculate_bone_space_pose_matrices_from_action(mi,CHA_ARMATURE_ACTION_NAME_CYCLE_WALK,animation_time,additional_time_to_get_to_first_frame,0); } # endif @@ -1023,11 +1023,13 @@ void CharacterGroupMoveAndAnimate(float totalTimeSeconds,float frameTimeSeconds) const struct cha_armature* armature = peter_mi->armature; /* all characters share the same armature */ int anim_idx = 0; CHA_ASSERT(armature); - if (anim_idxnum_actions && armature->num_actions>2) { + if (anim_idxnum_actions && armature->num_actions>4) { for (i=0;inum_instances;i++) { struct cha_character_instance* inst = &group->instances[i]; if (inst!=peter && inst!=mary) { - while (anim_idx==CHA_ARMATURE_ACTION_NAME_CYCLE_RUN || anim_idx==CHA_ARMATURE_ACTION_NAME_CYCLE_WALK) anim_idx=(anim_idx+1)%armature->num_actions; // we skip these (already shown by peter) + while (anim_idx==CHA_ARMATURE_ACTION_NAME_CYCLE_RUN || anim_idx==CHA_ARMATURE_ACTION_NAME_CYCLE_WALK // we skip these (already shown by peter) + || anim_idx==CHA_ARMATURE_ACTION_NAME_POSE_HANDS_OPEN || anim_idx==CHA_ARMATURE_ACTION_NAME_POSE_HANDS_CLOSED // we skip these (affect hands only, not very noticeable) + ) anim_idx=(anim_idx+1)%armature->num_actions; if (inst->active && !inst->culled) { struct cha_mesh_instance* mi = &inst->mesh_instances[CHA_MESH_NAME_BODY]; const struct cha_armature_action* action = &armature->actions[anim_idx]; @@ -1038,7 +1040,7 @@ void CharacterGroupMoveAndAnimate(float totalTimeSeconds,float frameTimeSeconds) //static float animation_time=0;animation_time+=frameTimeSeconds*animation_speed; // good always if (!action->looping && animation_time>repeat_time) animation_time=fmodf(animation_time,repeat_time); - cha_mesh_instance_calculate_bone_space_pose_matrices_from_action(mi,anim_idx,animation_time,additional_time_to_get_to_first_frame); + cha_mesh_instance_calculate_bone_space_pose_matrices_from_action(mi,anim_idx,animation_time,additional_time_to_get_to_first_frame,0); } ++anim_idx;anim_idx%=armature->num_actions; } @@ -1066,7 +1068,7 @@ void CharacterGroupMoveAndAnimate(float totalTimeSeconds,float frameTimeSeconds) while (anim_idx==CHA_ARMATURE_ACTION_NAME_CYCLE_RUN || anim_idx==CHA_ARMATURE_ACTION_NAME_CYCLE_WALK) anim_idx=(anim_idx+1)%armature->num_actions; // we skip these (already shown by peter) if (inst->active && !inst->culled) { struct cha_mesh_instance* mi = &inst->mesh_instances[CHA_MESH_NAME_BODY]; - cha_mesh_instance_calculate_bone_space_pose_matrices_from_action(mi,anim_idx,animation_time,additional_time_to_get_to_first_frame); + cha_mesh_instance_calculate_bone_space_pose_matrices_from_action(mi,anim_idx,animation_time,additional_time_to_get_to_first_frame,0); } } } diff --git a/character.h b/character.h index af957b6..5964cdf 100644 --- a/character.h +++ b/character.h @@ -118,7 +118,7 @@ A POSSIBLE ROADMAP: #define CHARACTER_H_ #define CHA_VERSION "0.1 ALPHA" -#define CHA_VERSION_NUM 0003 +#define CHA_VERSION_NUM 0004 #ifndef CHA_API_INL # define CHA_API_INL __inline @@ -2968,6 +2968,7 @@ struct cha_mesh_instance { float* pose_matrices[4]; /* size = armature->num_bones*16. */ struct cha_mesh_instance_pose_data* pose_data; /* size = armature->num_bones */ unsigned pose_bone_mask; /* bone mask of the currently affected bones */ + unsigned pose_bone_exclude_mask; /* user can set/reset it, so that all animations do not affect these bones (handy e.g. when hand is grabbing something). Ignored in manual animations. */ /* skeletal animation stuff (if 'armature'!=NULL) */ float *verts,*norms; /* size=mesh->num_verts; buffer for the animated verts/norms */ @@ -3389,6 +3390,7 @@ float cha_mesh_instance_calculate_bone_space_pose_matrices_from_action_ex(struct float animation_time=0.f; int i,j,looping=0,is_first_loop = 0; int must_mix_with_another_action = 0; + bone_exclude_mask|=p->pose_bone_exclude_mask; // user can set/reset it CHA_ASSERT(armature && action_index>=0 && armature->num_actions>action_index); if (bone_start_idx<0) bone_start_idx=0; if (num_bones_to_process<0) num_bones_to_process=armature->num_bones-bone_start_idx; @@ -3541,8 +3543,8 @@ float cha_mesh_instance_calculate_bone_space_pose_matrices_from_action_ex(struct return animation_time; /* returns fmod(global_animation_time,action->max_frame_time) for looping animations */ } -CHA_API_INL float cha_mesh_instance_calculate_bone_space_pose_matrices_from_action(struct cha_mesh_instance* p,int action_index,float global_animation_time,float additional_time_to_get_to_first_frame) { - return cha_mesh_instance_calculate_bone_space_pose_matrices_from_action_ex(p,action_index,global_animation_time,additional_time_to_get_to_first_frame,1.f,-1,0,-1,0); +CHA_API_INL float cha_mesh_instance_calculate_bone_space_pose_matrices_from_action(struct cha_mesh_instance* p,int action_index,float global_animation_time,float additional_time_to_get_to_first_frame,unsigned bone_exclude_mask) { + return cha_mesh_instance_calculate_bone_space_pose_matrices_from_action_ex(p,action_index,global_animation_time,additional_time_to_get_to_first_frame,1.f,-1,0,-1,bone_exclude_mask); } void cha_mesh_instance_update_bone_matrix(struct cha_mesh_instance* p,int bone_idx,int recursive) { //p->pose_bone_mask = 0; /* well, this must be reset BEFORE calling this method (multiple times) */ @@ -4339,13 +4341,24 @@ void cha_character_group_init(struct cha_character_group* p,int num_men,int num_ } if (add_some_optional_meshes) { - const int has_hat = (mtl_idx%4==2)?1:0, has_glasses= (mtl_idx%3==1)?1:0, has_covid_mask = (mtl_idx%5==3)?1:0; + const int has_hat = (mtl_idx%4==2)?1:0, has_glasses= (mtl_idx%3==1)?1:0, has_covid_mask = (mtl_idx%5==3)?1:0, has_suitcase_right = ((mtl_idx%4==3)?1:0), has_suitcase_left = ((mtl_idx%9==4)?1:0); + struct cha_mesh_instance* mi = &inst->mesh_instances[CHA_MESH_NAME_BODY]; if (has_hat) inst->mesh_instances[CHA_MESH_NAME_HAT].active=1; if (has_glasses) inst->mesh_instances[CHA_MESH_NAME_GLASSES].active=1; if (has_covid_mask) { inst->mesh_instances[CHA_MESH_NAME_COVID_MASK].active=1; inst->mesh_instances[CHA_MESH_NAME_MOUTH].active=0; } + if (has_suitcase_right) { + inst->mesh_instances[CHA_MESH_NAME_SUITCASE_RIGHT].active=1; + cha_mesh_instance_calculate_bone_space_pose_matrices_from_action(mi,CHA_ARMATURE_ACTION_NAME_POSE_HANDS_CLOSED,10.f,0.f,CHA_BONE_MASK_HAND_L); + mi->pose_bone_exclude_mask|=CHA_BONE_MASK_HAND_R; + } + if (has_suitcase_left) { + inst->mesh_instances[CHA_MESH_NAME_SUITCASE_LEFT].active=1; + cha_mesh_instance_calculate_bone_space_pose_matrices_from_action(mi,CHA_ARMATURE_ACTION_NAME_POSE_HANDS_CLOSED,10.f,0.f,CHA_BONE_MASK_HAND_R); + mi->pose_bone_exclude_mask|=CHA_BONE_MASK_HAND_L; + } } @@ -4396,6 +4409,7 @@ CHA_API_DEF void Character_Init(void) { cha_mesh_init_hat(&gCharacterMeshes[CHA_MESH_NAME_HAT]); cha_mesh_init_glasses(&gCharacterMeshes[CHA_MESH_NAME_GLASSES]); cha_mesh_init_covid_mask(&gCharacterMeshes[CHA_MESH_NAME_COVID_MASK]); + cha_mesh_init_suitcases(&gCharacterMeshes[CHA_MESH_NAME_SUITCASE_RIGHT],&gCharacterMeshes[CHA_MESH_NAME_SUITCASE_LEFT]); cha_materials_init_names(&gMaterialNames); /* this doesn't need destruction */ diff --git a/character_inl.h b/character_inl.h index ba4ef75..6a4b09e 100644 --- a/character_inl.h +++ b/character_inl.h @@ -120,6 +120,8 @@ enum ChaArmatureActionNameEnum { CHA_ARMATURE_ACTION_NAME_CYCLE_WALK, CHA_ARMATURE_ACTION_NAME_FALL_DOWN, CHA_ARMATURE_ACTION_NAME_POSE_GRAB_WALL, + CHA_ARMATURE_ACTION_NAME_POSE_HANDS_CLOSED, + CHA_ARMATURE_ACTION_NAME_POSE_HANDS_OPEN, CHA_ARMATURE_ACTION_NAME_POSE_SIT_DOWN, CHA_ARMATURE_ACTION_NAME_POSE_STAND_UP, CHA_ARMATURE_ACTION_NAME_COUNT @@ -150,6 +152,8 @@ enum ChaMeshNameEnum { CHA_MESH_NAME_HAT, CHA_MESH_NAME_GLASSES, CHA_MESH_NAME_COVID_MASK, + CHA_MESH_NAME_SUITCASE_RIGHT, + CHA_MESH_NAME_SUITCASE_LEFT, CHA_MESH_NAME_COUNT }; enum ChaMeshNameMask { @@ -183,7 +187,7 @@ void cha_armature_init_body(struct cha_armature* p) { struct cha_armature_bone_space_data gBoneDataPairs[2*CHA_BONE_NAME_COUNT] = {{{0.f,0.00002f,0.00007f},{0.f,0.00002f,0.14329f},3.14159f,{-1.f,0.f,0.f,0.f,0.f,-0.f,1.f,0.f,0.f,1.f,0.f,0.f,0.f,0.f,0.f,1.f},{0}},{{0.f,0.00002f,0.00007f},{0.f,0.00002f,0.14329f},3.14159f,{-1.f,0.f,0.f,0.f,0.f,-0.f,1.f,0.f,0.f,1.f,0.f,0.f,0.f,0.00002f,0.00007f,1.f},{0}},{{0.f,0.36223f,0.00068f},{0.f,0.6443f,0.00068f},-3.14159f,{-1.f,-0.f,0.f,0.f,0.f,1.f,0.f,0.f,-0.f,0.f,-1.f,0.f,0.f,0.f,0.f,1.f},{0}},{{0.f,0.0007f,0.50551f},{0.f,0.0007f,0.78759f},0.f,{1.f,0.f,-0.f,0.f,0.f,0.f,1.f,0.f,0.f,-1.f,0.f,0.f,0.f,0.0007f,0.50551f,1.f},{0}},{{0.f,0.f,0.f},{-0.f,0.07168f,0.f},-0.f,{1.f,0.f,0.f,0.f,-0.f,1.f,0.f,0.f,-0.f,-0.f,1.f,0.f,0.f,0.f,0.f,1.f},{0}},{{0.f,0.0007f,0.78759f},{0.f,0.0007f,0.85928f},0.f,{1.f,0.f,-0.f,0.f,0.f,-0.f,1.f,0.f,0.f,-1.f,0.f,0.f,0.f,0.0007f,0.78759f,1.f},{0}},{{0.f,0.f,-0.f},{-0.f,0.07303f,-0.f},-0.f,{1.f,0.f,0.f,0.f,-0.f,1.f,-0.f,0.f,-0.f,0.f,1.f,0.f,0.f,0.f,0.f,1.f},{0}},{{0.f,0.0007f,0.85928f},{0.f,0.0007f,0.93231f},0.f,{1.f,-0.f,-0.f,0.f,0.f,0.f,1.f,0.f,0.f,-1.f,0.f,0.f,0.f,0.0007f,0.85928f,1.f},{0}},{{0.11228f,0.01784f,0.00081f},{0.26769f,0.01784f,0.00081f},3.14159f,{0.f,1.f,-0.f,0.f,1.f,0.f,0.f,0.f,0.f,-0.f,-1.f,0.f,0.f,0.f,0.f,1.f},{0}},{{0.11228f,-0.00011f,0.80543f},{0.26769f,-0.00011f,0.80543f},-1.5708f,{-0.f,0.f,1.f,0.f,1.f,-0.f,-0.f,0.f,0.f,1.f,-0.f,0.f,0.11228f,-0.00011f,0.80543f,1.f},{0}},{{0.f,0.f,0.f},{0.f,0.1574f,0.f},0.f,{1.f,-0.f,-0.f,0.f,0.f,1.f,0.f,0.f,0.f,-0.f,1.f,0.f,0.f,0.f,0.f,1.f},{0}},{{0.26769f,-0.00011f,0.80543f},{0.42508f,-0.00011f,0.80543f},-1.5708f,{-0.f,0.f,1.f,0.f,1.f,-0.f,0.f,0.f,0.f,1.f,-0.f,0.f,0.26769f,-0.00011f,0.80543f,1.f},{0}},{{0.f,0.f,0.f},{-0.f,0.03553f,-0.f},0.f,{1.f,-0.f,-0.f,0.f,-0.f,1.f,-0.f,0.f,0.f,0.f,1.f,0.f,0.f,0.f,0.f,1.f},{0}},{{0.42508f,-0.00011f,0.80543f},{0.46061f,-0.00011f,0.80543f},-1.5708f,{-0.f,-0.f,1.f,0.f,1.f,-0.f,0.f,0.f,0.f,1.f,0.f,0.f,0.42508f,-0.00011f,0.80543f,1.f},{0}},{{0.f,0.f,0.f},{-0.f,0.02538f,0.f},0.f,{1.f,0.f,-0.f,0.f,-0.f,1.f,0.f,0.f,0.f,-0.f,1.f,0.f,0.f,0.f,0.f,1.f},{0}},{{0.46061f,-0.00011f,0.80543f},{0.48599f,-0.00011f,0.80543f},-1.5708f,{-0.f,-0.f,1.f,0.f,1.f,-0.f,-0.f,0.f,0.f,1.f,0.f,0.f,0.46061f,-0.00011f,0.80543f,1.f},{0}},{{0.f,0.f,0.f},{0.f,0.02499f,-0.f},-0.f,{1.f,0.f,0.f,0.f,0.f,1.f,-0.f,0.f,-0.f,0.f,1.f,0.f,0.f,0.f,0.f,1.f},{0}},{{0.48599f,-0.00011f,0.80543f},{0.51098f,-0.00011f,0.80543f},-1.5708f,{0.f,0.f,1.f,0.f,1.f,-0.f,0.f,0.f,0.f,1.f,-0.f,0.f,0.48599f,-0.00011f,0.80543f,1.f},{0}},{{0.f,-0.01501f,-0.02473f},{0.f,0.00977f,-0.04066f},-0.f,{1.f,0.f,0.f,0.f,0.f,0.8413f,-0.54057f,0.f,-0.f,0.54057f,0.8413f,0.f,0.f,0.f,0.f,1.f},{0}},{{0.4456f,-0.02484f,0.80543f},{0.47039f,-0.04077f,0.80543f},-1.5708f,{0.f,0.f,1.f,0.f,0.8413f,-0.54057f,0.f,0.f,0.54057f,0.8413f,-0.f,0.f,0.4456f,-0.02484f,0.80543f,1.f},{0}},{{-0.11199f,0.01799f,0.00081f},{-0.2674f,0.01799f,0.00081f},-3.14159f,{-0.f,-1.f,0.f,0.f,-1.f,0.f,-0.f,0.f,0.f,-0.f,-1.f,0.f,0.f,0.f,0.f,1.f},{0}},{{-0.11199f,-0.00011f,0.80558f},{-0.2674f,-0.00011f,0.80558f},1.5708f,{0.f,-0.f,-1.f,0.f,-1.f,-0.f,0.f,0.f,-0.f,1.f,-0.f,0.f,-0.11199f,-0.00011f,0.80558f,1.f},{0}},{{0.f,0.f,0.f},{0.f,0.1574f,0.f},-0.f,{1.f,-0.f,0.f,0.f,0.f,1.f,0.f,0.f,-0.f,-0.f,1.f,0.f,0.f,0.f,0.f,1.f},{0}},{{-0.2674f,-0.00011f,0.80558f},{-0.4248f,-0.00011f,0.80558f},1.5708f,{0.f,0.f,-1.f,0.f,-1.f,-0.f,-0.f,0.f,-0.f,1.f,0.f,0.f,-0.2674f,-0.00011f,0.80558f,1.f},{0}},{{0.f,-0.f,0.f},{-0.f,0.03553f,-0.f},-0.f,{1.f,0.f,0.f,0.f,-0.f,1.f,-0.f,0.f,-0.f,0.f,1.f,0.f,0.f,0.f,0.f,1.f},{0}},{{-0.4248f,-0.00011f,0.80558f},{-0.46033f,-0.00011f,0.80558f},1.5708f,{0.f,0.f,-1.f,0.f,-1.f,-0.f,-0.f,0.f,-0.f,1.f,0.f,0.f,-0.4248f,-0.00011f,0.80558f,1.f},{0}},{{0.f,-0.f,0.f},{0.f,0.02538f,0.f},-0.f,{1.f,-0.f,-0.f,0.f,0.f,1.f,0.f,0.f,-0.f,-0.f,1.f,0.f,0.f,0.f,0.f,1.f},{0}},{{-0.46033f,-0.00011f,0.80558f},{-0.48571f,-0.00011f,0.80558f},1.5708f,{0.f,0.f,-1.f,0.f,-1.f,-0.f,0.f,0.f,-0.f,1.f,0.f,0.f,-0.46033f,-0.00011f,0.80558f,1.f},{0}},{{0.f,-0.f,0.f},{-0.f,0.02499f,-0.f},0.f,{1.f,-0.f,-0.f,0.f,-0.f,1.f,-0.f,0.f,0.f,0.f,1.f,0.f,0.f,0.f,0.f,1.f},{0}},{{-0.48571f,-0.00011f,0.80558f},{-0.5107f,-0.00011f,0.80558f},1.5708f,{0.f,-0.f,-1.f,0.f,-1.f,-0.f,0.f,0.f,-0.f,1.f,-0.f,0.f,-0.48571f,-0.00011f,0.80558f,1.f},{0}},{{-0.f,-0.01501f,-0.02473f},{-0.f,0.00977f,-0.04066f},0.f,{1.f,-0.f,-0.f,0.f,-0.f,0.8413f,-0.54057f,0.f,0.f,0.54057f,0.8413f,0.f,0.f,0.f,0.f,1.f},{0}},{{-0.44532f,-0.02484f,0.80558f},{-0.4701f,-0.04077f,0.80558f},1.5708f,{0.f,-0.f,-1.f,0.f,-0.8413f,-0.54057f,0.f,0.f,-0.54057f,0.8413f,-0.f,0.f,-0.44532f,-0.02484f,0.80558f,1.f},{0}},{{-0.05824f,0.3497f,0.00068f},{-0.05824f,0.10588f,0.00068f},-0.f,{-1.f,-0.f,0.f,0.f,0.f,-1.f,0.f,0.f,0.f,0.f,1.f,0.f,0.f,0.f,0.f,1.f},{0}},{{0.05824f,0.0007f,0.49298f},{0.05824f,0.0007f,0.24917f},0.f,{1.f,0.f,-0.f,0.f,-0.f,0.f,-1.f,0.f,0.f,1.f,0.f,0.f,0.05824f,0.0007f,0.49298f,1.f},{0}},{{0.f,0.f,0.f},{0.f,0.18803f,-0.f},0.f,{1.f,-0.f,0.f,0.f,0.f,1.f,-0.f,0.f,0.f,0.f,1.f,0.f,0.f,0.f,0.f,1.f},{0}},{{0.05824f,0.0007f,0.24917f},{0.05824f,0.0007f,0.06114f},0.f,{1.f,-0.f,-0.f,0.f,0.f,0.f,-1.f,0.f,0.f,1.f,-0.f,0.f,0.05824f,0.0007f,0.24917f,1.f},{0}},{{0.f,-0.f,0.f},{0.f,0.05071f,0.f},-0.f,{1.f,0.f,0.f,0.f,0.f,1.f,0.f,0.f,0.f,0.f,1.f,0.f,0.f,0.f,0.f,1.f},{0}},{{0.05824f,0.0007f,0.06114f},{0.05824f,0.0007f,0.01043f},0.f,{1.f,-0.f,-0.f,0.f,0.f,0.f,-1.f,0.f,0.f,1.f,-0.f,0.f,0.05824f,0.0007f,0.06114f,1.f},{0}},{{0.05824f,0.3497f,0.00068f},{0.05824f,0.10588f,0.00068f},-0.f,{-1.f,-0.f,0.f,0.f,0.f,-1.f,0.f,0.f,0.f,0.f,1.f,0.f,0.f,0.f,0.f,1.f},{0}},{{-0.05824f,0.0007f,0.49298f},{-0.05824f,0.0007f,0.24917f},0.f,{1.f,0.f,-0.f,0.f,-0.f,0.f,-1.f,0.f,0.f,1.f,0.f,0.f,-0.05824f,0.0007f,0.49298f,1.f},{0}},{{0.f,0.f,0.f},{0.f,0.18803f,-0.f},0.f,{1.f,-0.f,0.f,0.f,0.f,1.f,-0.f,0.f,0.f,0.f,1.f,0.f,0.f,0.f,0.f,1.f},{0}},{{-0.05824f,0.0007f,0.24917f},{-0.05824f,0.0007f,0.06114f},0.f,{1.f,-0.f,-0.f,0.f,0.f,0.f,-1.f,0.f,0.f,1.f,-0.f,0.f,-0.05824f,0.0007f,0.24917f,1.f},{0}},{{0.f,-0.f,0.f},{0.f,0.05071f,0.f},-0.f,{1.f,0.f,0.f,0.f,0.f,1.f,0.f,0.f,0.f,0.f,1.f,0.f,0.f,0.f,0.f,1.f},{0}},{{-0.05824f,0.0007f,0.06114f},{-0.05824f,0.0007f,0.01043f},0.f,{1.f,-0.f,-0.f,0.f,0.f,0.f,-1.f,0.f,0.f,1.f,-0.f,0.f,-0.05824f,0.0007f,0.06114f,1.f},{0}}}; const int gNumActions = CHA_ARMATURE_ACTION_NAME_COUNT; - const char* gActionNames[CHA_ARMATURE_ACTION_NAME_COUNT] = {"CycleRun","CycleWalk","FallDown","PoseGrabWall","PoseSitDown","PoseStandUp"}; + const char* gActionNames[CHA_ARMATURE_ACTION_NAME_COUNT] = {"CycleRun","CycleWalk","FallDown","PoseGrabWall","PoseHandsClosed","PoseHandsOpen","PoseSitDown","PoseStandUp"}; /* We support translational key frames for the first bone only (the root), and rotational key frames for all the bones (first bone included) @@ -194,10 +198,12 @@ void cha_armature_init_body(struct cha_armature* p) { 12,0,1,1,1,2,2,2,0,0,0,2,2,2,0,0,0,12,12,12,12,12,12, /* action 1; (CHA_ARMATURE_NUM_BONES+1) entries */ 7,7,4,5,5,6,4,1,1,1,1,6,4,1,1,1,1,6,6,5,6,6,5, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 0,0,0,0,0,0,0,1,1,1,1,0,0,1,1,1,1,0,0,0,0,0,0, + 0,0,0,0,0,0,0,1,1,1,1,0,0,1,1,1,1,0,0,0,0,0,0, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 }; - const struct cha_armature_action_key_frame gKeyFrames[353] = {{0.f,-0.01019f,0.f,0.f,1.f},{0.f,-0.03483f,0.f,0.f,3.f},{0.f,-0.0064f,0.f,0.f,5.f},{0.f,-0.00098f,0.f,0.f,7.f},{0.f,-0.00213f,0.f,0.f,9.f},{0.f,-0.00213f,0.f,0.f,11.f},{0.f,-0.00152f,0.f,0.f,13.f},{0.f,-0.0341f,0.f,0.f,15.f},{0.f,-0.00598f,0.f,0.f,17.f},{0.f,0.00591f,0.f,0.f,19.f},{0.f,-0.00103f,0.f,0.f,21.f},{0.f,-0.00076f,0.f,0.f,23.f},{0.09282f,0.f,0.f,0.99568f,1.f},{0.09545f,0.f,0.f,0.99543f,1.f},{-0.19006f,0.f,0.f,0.98177f,1.f},{0.00477f,-0.01701f,0.64472f,0.76421f,1.f},{0.16292f,0.1675f,0.6245f,0.74526f,13.f},{-0.34108f,-0.03019f,0.04362f,0.93854f,1.f},{-0.17312f,-0.0055f,0.04255f,0.98397f,13.f},{-0.04256f,-0.01358f,0.0425f,0.9981f,1.f},{-0.04409f,0.00394f,0.04292f,0.9981f,13.f},{0.16292f,-0.1675f,-0.6245f,0.74526f,1.f},{0.00477f,0.01701f,-0.64472f,0.76421f,13.f},{-0.17312f,0.0055f,-0.04255f,0.98397f,1.f},{-0.34108f,0.03019f,-0.04362f,0.93854f,13.f},{-0.04409f,-0.00394f,-0.04292f,0.9981f,1.f},{-0.04256f,0.01358f,-0.0425f,0.9981f,13.f},{0.063f,0.f,0.f,0.99801f,1.f},{-0.25782f,0.f,0.f,0.98716f,3.f},{-0.55118f,0.f,0.f,0.83439f,7.f},{-0.447f,0.f,0.f,0.89319f,9.f},{-0.26907f,0.f,0.f,0.96525f,11.f},{-0.15813f,0.f,0.f,0.98742f,13.f},{-0.23672f,0.f,0.f,0.97158f,15.f},{-0.06945f,0.f,0.f,0.997f,17.f},{0.12196f,0.f,0.f,0.99808f,19.f},{0.18043f,0.f,0.f,0.98359f,21.f},{0.18043f,0.f,0.f,0.98359f,23.f},{0.6715f,0.f,0.f,0.741f,1.f},{0.71658f,0.f,0.f,0.69751f,3.f},{0.69308f,0.f,0.f,0.72112f,7.f},{0.32719f,0.f,0.f,0.95742f,9.f},{0.12991f,0.f,0.f,0.99753f,11.f},{0.07023f,0.f,0.f,0.99753f,13.f},{0.37175f,0.f,0.f,0.92833f,15.f},{0.23008f,0.f,0.f,0.97408f,17.f},{0.16568f,0.f,0.f,0.98618f,19.f},{0.52145f,0.f,0.f,0.86127f,21.f},{0.52145f,0.f,0.f,0.85328f,23.f},{0.05735f,0.f,0.f,0.99835f,1.f},{0.05735f,0.f,0.f,0.99835f,3.f},{0.35576f,0.f,0.f,0.92118f,5.f},{-0.14457f,0.f,0.f,0.9999f,7.f},{0.01427f,0.f,0.f,0.9999f,9.f},{0.01427f,0.f,0.f,0.9999f,11.f},{-0.01061f,0.f,0.f,1.f,13.f},{-0.14935f,0.f,0.f,0.98878f,15.f},{-0.1258f,0.f,0.f,0.99201f,17.f},{-0.06949f,0.f,0.f,0.99476f,19.f},{0.11052f,0.f,0.f,0.99387f,21.f},{0.11052f,0.f,0.f,0.99387f,23.f},{-0.15813f,0.f,0.f,0.98742f,1.f},{-0.23672f,0.f,0.f,0.97158f,3.f},{0.11416f,0.f,0.f,0.99808f,7.f},{0.18043f,0.f,0.f,0.98359f,9.f},{0.18043f,0.f,0.f,0.98359f,11.f},{0.00729f,0.f,0.f,0.99801f,13.f},{-0.19358f,0.f,0.f,0.99078f,15.f},{-0.47636f,0.f,0.f,0.88963f,17.f},{-0.55118f,0.f,0.f,0.83439f,19.f},{-0.447f,0.f,0.f,0.89319f,21.f},{-0.33352f,0.f,0.f,0.94274f,23.f},{0.07023f,0.f,0.f,0.99753f,1.f},{0.37175f,0.f,0.f,0.92833f,3.f},{0.16568f,0.f,0.f,0.98618f,7.f},{0.52145f,0.f,0.f,0.86127f,9.f},{0.56241f,0.f,0.f,0.82476f,11.f},{0.70955f,0.f,0.f,0.71062f,13.f},{0.71658f,0.f,0.f,0.69751f,15.f},{0.71273f,0.f,0.f,0.70145f,17.f},{0.68716f,0.f,0.f,0.72702f,19.f},{0.32719f,0.f,0.f,0.95742f,21.f},{0.19879f,0.f,0.f,0.98004f,23.f},{0.00183f,0.f,0.f,1.f,1.f},{-0.14813f,0.f,0.f,0.98897f,3.f},{-0.126f,0.f,0.f,0.99169f,5.f},{-0.06953f,0.f,0.f,0.99476f,7.f},{0.11052f,0.f,0.f,0.99387f,9.f},{0.11052f,0.f,0.f,0.99387f,11.f},{0.05735f,0.f,0.f,0.99835f,13.f},{0.05735f,0.f,0.f,0.99835f,15.f},{0.36027f,0.f,0.f,0.93285f,17.f},{-0.14457f,0.f,0.f,0.9999f,19.f},{0.01427f,0.f,0.f,0.9999f,21.f},{0.01427f,0.f,0.f,0.9999f,23.f},{0.f,0.f,0.f,0.f,1.f},{0.f,0.f,0.f,0.f,3.f},{0.f,0.f,0.f,0.f,5.f},{0.f,0.f,0.f,0.f,7.f},{0.f,-0.00513f,0.f,0.f,9.f},{0.f,0.f,0.f,0.f,11.f},{0.f,0.f,0.f,0.f,13.f},{0.f,0.f,0.f,0.f,15.f},{0.f,0.f,0.f,0.f,17.f},{0.f,0.f,0.f,0.f,19.f},{0.f,-0.00428f,0.f,0.f,21.f},{0.f,0.f,0.f,0.f,23.f},{0.f,0.f,0.f,1.f,1.f},{0.03157f,0.f,0.f,0.9995f,1.f},{-0.00935f,0.f,0.f,0.99996f,1.f},{0.0055f,-0.01678f,0.67744f,0.73536f,1.f},{0.07374f,0.06806f,0.67342f,0.73242f,13.f},{-0.02385f,0.02728f,0.00065f,0.99934f,1.f},{-0.08962f,0.00903f,0.00081f,0.99594f,13.f},{-0.04256f,-0.01358f,0.0425f,0.9981f,1.f},{-0.04409f,0.00394f,0.04292f,0.9981f,13.f},{0.07374f,-0.06806f,-0.67342f,0.73242f,1.f},{0.0055f,0.01678f,-0.67744f,0.73536f,13.f},{-0.08962f,-0.00903f,-0.00081f,0.99594f,1.f},{-0.02385f,-0.02728f,-0.00065f,0.99934f,13.f},{-0.04409f,-0.00394f,-0.04292f,0.9981f,1.f},{-0.04256f,0.01358f,-0.0425f,0.9981f,13.f},{0.06242f,0.f,0.f,0.99805f,1.f},{-0.00482f,0.f,0.f,0.99959f,3.f},{-0.25293f,0.f,0.f,0.96748f,5.f},{-0.25293f,0.f,0.f,0.96748f,7.f},{-0.24622f,0.f,0.f,0.96921f,9.f},{-0.24622f,0.f,0.f,0.96921f,11.f},{-0.12053f,0.f,0.f,0.99394f,13.f},{-0.09043f,0.f,0.f,0.99587f,15.f},{-0.02205f,0.f,0.f,0.99962f,17.f},{0.05051f,0.f,0.f,0.99962f,19.f},{0.07911f,0.f,0.f,0.99706f,21.f},{0.08542f,0.f,0.f,0.99635f,23.f},{0.25276f,0.f,0.f,0.96753f,1.f},{0.55243f,0.f,0.f,0.84102f,3.f},{0.62282f,0.f,0.f,0.78236f,5.f},{0.38238f,0.f,0.f,0.92164f,7.f},{0.09115f,0.f,0.f,0.99628f,9.f},{0.07281f,0.f,0.f,0.99735f,11.f},{0.07281f,0.f,0.f,0.99735f,13.f},{0.09719f,0.f,0.f,0.99527f,15.f},{0.09719f,0.f,0.f,0.99527f,17.f},{0.07691f,0.f,0.f,0.99704f,19.f},{0.17513f,0.f,0.f,0.98509f,21.f},{0.20553f,0.f,0.f,0.97865f,23.f},{-0.18503f,0.f,0.f,0.98273f,1.f},{0.12619f,0.f,0.f,0.99506f,3.f},{0.02536f,0.f,0.f,0.99943f,5.f},{-0.03385f,0.f,0.f,0.99943f,7.f},{-0.03385f,0.f,0.f,0.99943f,9.f},{-0.03385f,0.f,0.f,0.99943f,11.f},{-0.0429f,0.f,0.f,0.99908f,13.f},{0.03384f,0.f,0.f,0.99943f,15.f},{-0.07949f,0.f,0.f,0.99777f,17.f},{-0.11193f,0.f,0.f,0.9937f,19.f},{-0.15198f,0.f,0.f,0.98838f,21.f},{-0.12377f,0.f,0.f,0.99231f,23.f},{-0.1472f,0.f,0.f,0.98911f,1.f},{-0.0904f,0.f,0.f,0.99519f,3.f},{-0.02189f,0.f,0.f,0.99646f,5.f},{0.05048f,0.f,0.f,0.99962f,7.f},{0.07911f,0.f,0.f,0.99706f,9.f},{0.08542f,0.f,0.f,0.99635f,11.f},{0.05137f,0.f,0.f,0.99868f,13.f},{-0.00482f,0.f,0.f,0.99959f,15.f},{-0.25293f,0.f,0.f,0.96748f,17.f},{-0.25293f,0.f,0.f,0.96748f,19.f},{-0.24622f,0.f,0.f,0.96921f,21.f},{-0.24622f,0.f,0.f,0.96921f,23.f},{0.07281f,0.f,0.f,0.99735f,1.f},{0.09713f,0.f,0.f,0.99513f,3.f},{0.09713f,0.f,0.f,0.9947f,5.f},{0.07691f,0.f,0.f,0.99704f,7.f},{0.15003f,0.f,0.f,0.98868f,9.f},{0.14835f,0.f,0.f,0.98893f,11.f},{0.38019f,0.f,0.f,0.92713f,13.f},{0.54019f,0.f,0.f,0.84465f,15.f},{0.62282f,0.f,0.f,0.78236f,17.f},{0.38238f,0.f,0.f,0.92164f,19.f},{0.09115f,0.f,0.f,0.99628f,21.f},{0.08617f,0.f,0.f,0.99628f,23.f},{-0.0429f,0.f,0.f,0.99908f,1.f},{0.03384f,0.f,0.f,0.99943f,3.f},{-0.07947f,0.f,0.f,0.99748f,5.f},{-0.12242f,0.f,0.f,0.99313f,7.f},{-0.20573f,0.f,0.f,0.97861f,9.f},{-0.11696f,0.f,0.f,0.99314f,11.f},{-0.09968f,0.f,0.f,0.99314f,13.f},{0.12619f,0.f,0.f,0.99201f,15.f},{0.02536f,0.f,0.f,0.99943f,17.f},{-0.03385f,0.f,0.f,0.99943f,19.f},{-0.03385f,0.f,0.f,0.99943f,21.f},{-0.03385f,0.f,0.f,0.99943f,23.f},{0.f,0.f,0.f,0.f,1.f},{0.f,-0.00536f,0.06255f,0.f,3.f},{0.f,-0.09777f,0.136f,0.f,5.f},{0.f,-0.11583f,0.10839f,0.f,7.f},{0.f,-0.04321f,0.16361f,0.f,9.f},{0.f,0.0469f,0.16361f,0.f,11.f},{0.f,0.05729f,0.16361f,0.f,13.f},{0.f,0.f,0.f,1.f,1.f},{0.12494f,0.f,0.f,0.9925f,3.f},{0.25768f,0.f,0.f,0.96599f,5.f},{0.49632f,0.f,0.f,0.8732f,7.f},{0.65771f,0.f,0.f,0.76216f,9.f},{0.69849f,0.f,0.f,0.72317f,11.f},{0.70489f,0.f,0.f,0.70932f,13.f},{0.f,0.f,0.f,1.f,1.f},{0.04362f,0.f,0.f,0.99905f,3.f},{-0.04362f,0.f,0.f,0.99905f,11.f},{0.f,0.f,0.f,1.f,13.f},{0.f,0.f,0.f,1.f,1.f},{0.1532f,0.f,0.f,0.98877f,7.f},{0.17903f,0.f,0.f,0.98384f,9.f},{0.00668f,0.f,0.f,0.99927f,11.f},{-0.03816f,0.f,0.f,0.99927f,13.f},{0.f,0.f,0.f,1.f,1.f},{0.03091f,0.f,0.f,0.99964f,7.f},{0.15347f,0.f,0.f,0.98815f,9.f},{0.06677f,0.f,0.f,0.99777f,11.f},{0.06677f,0.f,0.f,0.99777f,13.f},{0.f,0.f,0.64279f,0.76604f,1.f},{-0.25123f,-0.2994f,0.59886f,0.71369f,3.f},{-0.29681f,-0.35372f,0.57016f,0.67949f,5.f},{-0.18137f,-0.21614f,0.61442f,0.73223f,9.f},{-0.00217f,-0.00259f,0.64034f,0.76313f,11.f},{0.05602f,0.06676f,0.64034f,0.76313f,13.f},{0.f,0.f,0.f,1.f,1.f},{-0.17116f,-0.02927f,-0.00509f,0.98479f,3.f},{-0.11482f,-0.01942f,-0.00223f,0.99323f,9.f},{-0.08597f,-0.01433f,-0.00124f,0.99619f,13.f},{0.f,0.f,0.08716f,0.99619f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,-0.64279f,0.76604f,1.f},{-0.25123f,0.2994f,-0.59886f,0.71369f,3.f},{-0.29681f,0.35372f,-0.57016f,0.67949f,5.f},{-0.18137f,0.21614f,-0.61442f,0.73223f,9.f},{-0.00217f,0.00259f,-0.64034f,0.76313f,11.f},{0.05602f,-0.06676f,-0.64034f,0.76313f,13.f},{0.f,0.f,0.f,1.f,1.f},{-0.17116f,0.02927f,0.00509f,0.98479f,3.f},{-0.11482f,0.01942f,0.00223f,0.99323f,9.f},{-0.08597f,0.01433f,0.00124f,0.99619f,13.f},{0.f,0.f,-0.08716f,0.99619f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{-0.13768f,0.f,0.f,0.99239f,3.f},{-0.25882f,0.f,0.f,0.96593f,5.f},{-0.13622f,0.f,0.f,0.98956f,9.f},{0.f,0.f,0.f,1.f,11.f},{0.f,0.f,0.f,1.f,13.f},{0.f,0.f,0.f,1.f,1.f},{0.12105f,0.f,0.f,0.99323f,3.f},{0.17365f,0.f,0.f,0.98481f,5.f},{0.02241f,0.f,0.f,1.f,9.f},{0.f,0.f,0.f,1.f,11.f},{0.04362f,0.f,0.f,0.99905f,13.f},{0.f,0.f,0.f,1.f,1.f},{0.06063f,0.f,0.f,0.99831f,3.f},{0.08716f,0.f,0.f,0.99619f,5.f},{0.04362f,0.f,0.f,0.99905f,9.f},{0.04362f,0.f,0.f,0.99905f,13.f},{0.f,0.f,0.f,1.f,1.f},{-0.13768f,0.f,0.f,0.99239f,3.f},{-0.25882f,0.f,0.f,0.96593f,5.f},{-0.13622f,0.f,0.f,0.98956f,9.f},{0.f,0.f,0.f,1.f,11.f},{0.f,0.f,0.f,1.f,13.f},{0.f,0.f,0.f,1.f,1.f},{0.12105f,0.f,0.f,0.99323f,3.f},{0.17365f,0.f,0.f,0.98481f,5.f},{0.02241f,0.f,0.f,1.f,9.f},{0.f,0.f,0.f,1.f,11.f},{0.04362f,0.f,0.f,0.99905f,13.f},{0.f,0.f,0.f,1.f,1.f},{0.06063f,0.f,0.f,0.99831f,3.f},{0.08716f,0.f,0.f,0.99619f,5.f},{0.04362f,0.f,0.f,0.99905f,9.f},{0.04362f,0.f,0.f,0.99905f,13.f},{0.f,-0.00361f,0.04517f,0.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.13053f,0.f,0.f,0.99144f,1.f},{-0.04362f,0.f,0.f,0.99905f,1.f},{-0.08716f,0.f,0.f,0.99619f,1.f},{0.13692f,0.10707f,0.57044f,0.80274f,1.f},{-0.73494f,-0.05861f,-0.06405f,0.67255f,1.f},{-0.0414f,-0.30153f,-0.47533f,0.82549f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.13692f,-0.10707f,-0.57044f,0.80274f,1.f},{-0.73494f,0.05861f,0.06405f,0.67255f,1.f},{-0.0414f,0.30153f,0.47533f,0.82549f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{-0.12059f,-0.37941f,-0.04995f,0.91598f,1.f},{0.13053f,0.f,0.f,0.99144f,1.f},{0.f,0.f,0.f,1.f,1.f},{-0.12059f,0.37941f,0.04995f,0.91598f,1.f},{0.13053f,0.f,0.f,0.99144f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,-0.22202f,0.24101f,0.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{-0.0839f,-0.09999f,0.63729f,0.75949f,1.f},{-0.33795f,-0.0526f,-0.01892f,0.9395f,1.f},{0.f,0.f,0.08716f,0.99619f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{-0.0839f,0.09999f,-0.63729f,0.75949f,1.f},{-0.33795f,0.0526f,0.01892f,0.9395f,1.f},{0.f,0.f,-0.08716f,0.99619f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{-0.67495f,-0.03216f,-0.02947f,0.73658f,1.f},{0.67495f,0.03216f,0.02947f,0.73658f,1.f},{0.f,0.f,0.f,1.f,1.f},{-0.67495f,0.03216f,0.02947f,0.73658f,1.f},{0.67495f,-0.03216f,-0.02947f,0.73658f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,0.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.64279f,0.76604f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.08716f,0.99619f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,-0.64279f,0.76604f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,-0.08716f,0.99619f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f}}; + const struct cha_armature_action_key_frame gKeyFrames[369] = {{0.f,-0.01019f,0.f,0.f,1.f},{0.f,-0.03483f,0.f,0.f,3.f},{0.f,-0.0064f,0.f,0.f,5.f},{0.f,-0.00098f,0.f,0.f,7.f},{0.f,-0.00213f,0.f,0.f,9.f},{0.f,-0.00213f,0.f,0.f,11.f},{0.f,-0.00152f,0.f,0.f,13.f},{0.f,-0.0341f,0.f,0.f,15.f},{0.f,-0.00598f,0.f,0.f,17.f},{0.f,0.00591f,0.f,0.f,19.f},{0.f,-0.00103f,0.f,0.f,21.f},{0.f,-0.00076f,0.f,0.f,23.f},{0.09282f,0.f,0.f,0.99568f,1.f},{0.09545f,0.f,0.f,0.99543f,1.f},{-0.19006f,0.f,0.f,0.98177f,1.f},{0.00477f,-0.01701f,0.64472f,0.76421f,1.f},{0.16292f,0.1675f,0.6245f,0.74526f,13.f},{-0.34108f,-0.03019f,0.04362f,0.93854f,1.f},{-0.17312f,-0.0055f,0.04255f,0.98397f,13.f},{-0.04256f,-0.01358f,0.0425f,0.9981f,1.f},{-0.04409f,0.00394f,0.04292f,0.9981f,13.f},{0.16292f,-0.1675f,-0.6245f,0.74526f,1.f},{0.00477f,0.01701f,-0.64472f,0.76421f,13.f},{-0.17312f,0.0055f,-0.04255f,0.98397f,1.f},{-0.34108f,0.03019f,-0.04362f,0.93854f,13.f},{-0.04409f,-0.00394f,-0.04292f,0.9981f,1.f},{-0.04256f,0.01358f,-0.0425f,0.9981f,13.f},{0.063f,0.f,0.f,0.99801f,1.f},{-0.25782f,0.f,0.f,0.98716f,3.f},{-0.55118f,0.f,0.f,0.83439f,7.f},{-0.447f,0.f,0.f,0.89319f,9.f},{-0.26907f,0.f,0.f,0.96525f,11.f},{-0.15813f,0.f,0.f,0.98742f,13.f},{-0.23672f,0.f,0.f,0.97158f,15.f},{-0.06945f,0.f,0.f,0.997f,17.f},{0.12196f,0.f,0.f,0.99808f,19.f},{0.18043f,0.f,0.f,0.98359f,21.f},{0.18043f,0.f,0.f,0.98359f,23.f},{0.6715f,0.f,0.f,0.741f,1.f},{0.71658f,0.f,0.f,0.69751f,3.f},{0.69308f,0.f,0.f,0.72112f,7.f},{0.32719f,0.f,0.f,0.95742f,9.f},{0.12991f,0.f,0.f,0.99753f,11.f},{0.07023f,0.f,0.f,0.99753f,13.f},{0.37175f,0.f,0.f,0.92833f,15.f},{0.23008f,0.f,0.f,0.97408f,17.f},{0.16568f,0.f,0.f,0.98618f,19.f},{0.52145f,0.f,0.f,0.86127f,21.f},{0.52145f,0.f,0.f,0.85328f,23.f},{0.05735f,0.f,0.f,0.99835f,1.f},{0.05735f,0.f,0.f,0.99835f,3.f},{0.35576f,0.f,0.f,0.92118f,5.f},{-0.14457f,0.f,0.f,0.9999f,7.f},{0.01427f,0.f,0.f,0.9999f,9.f},{0.01427f,0.f,0.f,0.9999f,11.f},{-0.01061f,0.f,0.f,1.f,13.f},{-0.14935f,0.f,0.f,0.98878f,15.f},{-0.1258f,0.f,0.f,0.99201f,17.f},{-0.06949f,0.f,0.f,0.99476f,19.f},{0.11052f,0.f,0.f,0.99387f,21.f},{0.11052f,0.f,0.f,0.99387f,23.f},{-0.15813f,0.f,0.f,0.98742f,1.f},{-0.23672f,0.f,0.f,0.97158f,3.f},{0.11416f,0.f,0.f,0.99808f,7.f},{0.18043f,0.f,0.f,0.98359f,9.f},{0.18043f,0.f,0.f,0.98359f,11.f},{0.00729f,0.f,0.f,0.99801f,13.f},{-0.19358f,0.f,0.f,0.99078f,15.f},{-0.47636f,0.f,0.f,0.88963f,17.f},{-0.55118f,0.f,0.f,0.83439f,19.f},{-0.447f,0.f,0.f,0.89319f,21.f},{-0.33352f,0.f,0.f,0.94274f,23.f},{0.07023f,0.f,0.f,0.99753f,1.f},{0.37175f,0.f,0.f,0.92833f,3.f},{0.16568f,0.f,0.f,0.98618f,7.f},{0.52145f,0.f,0.f,0.86127f,9.f},{0.56241f,0.f,0.f,0.82476f,11.f},{0.70955f,0.f,0.f,0.71062f,13.f},{0.71658f,0.f,0.f,0.69751f,15.f},{0.71273f,0.f,0.f,0.70145f,17.f},{0.68716f,0.f,0.f,0.72702f,19.f},{0.32719f,0.f,0.f,0.95742f,21.f},{0.19879f,0.f,0.f,0.98004f,23.f},{0.00183f,0.f,0.f,1.f,1.f},{-0.14813f,0.f,0.f,0.98897f,3.f},{-0.126f,0.f,0.f,0.99169f,5.f},{-0.06953f,0.f,0.f,0.99476f,7.f},{0.11052f,0.f,0.f,0.99387f,9.f},{0.11052f,0.f,0.f,0.99387f,11.f},{0.05735f,0.f,0.f,0.99835f,13.f},{0.05735f,0.f,0.f,0.99835f,15.f},{0.36027f,0.f,0.f,0.93285f,17.f},{-0.14457f,0.f,0.f,0.9999f,19.f},{0.01427f,0.f,0.f,0.9999f,21.f},{0.01427f,0.f,0.f,0.9999f,23.f},{0.f,0.f,0.f,0.f,1.f},{0.f,0.f,0.f,0.f,3.f},{0.f,0.f,0.f,0.f,5.f},{0.f,0.f,0.f,0.f,7.f},{0.f,-0.00513f,0.f,0.f,9.f},{0.f,0.f,0.f,0.f,11.f},{0.f,0.f,0.f,0.f,13.f},{0.f,0.f,0.f,0.f,15.f},{0.f,0.f,0.f,0.f,17.f},{0.f,0.f,0.f,0.f,19.f},{0.f,-0.00428f,0.f,0.f,21.f},{0.f,0.f,0.f,0.f,23.f},{0.f,0.f,0.f,1.f,1.f},{0.03157f,0.f,0.f,0.9995f,1.f},{-0.00935f,0.f,0.f,0.99996f,1.f},{0.0055f,-0.01678f,0.67744f,0.73536f,1.f},{0.07374f,0.06806f,0.67342f,0.73242f,13.f},{-0.02385f,0.02728f,0.00065f,0.99934f,1.f},{-0.08962f,0.00903f,0.00081f,0.99594f,13.f},{-0.04256f,-0.01358f,0.0425f,0.9981f,1.f},{-0.04409f,0.00394f,0.04292f,0.9981f,13.f},{0.07374f,-0.06806f,-0.67342f,0.73242f,1.f},{0.0055f,0.01678f,-0.67744f,0.73536f,13.f},{-0.08962f,-0.00903f,-0.00081f,0.99594f,1.f},{-0.02385f,-0.02728f,-0.00065f,0.99934f,13.f},{-0.04409f,-0.00394f,-0.04292f,0.9981f,1.f},{-0.04256f,0.01358f,-0.0425f,0.9981f,13.f},{0.06242f,0.f,0.f,0.99805f,1.f},{-0.00482f,0.f,0.f,0.99959f,3.f},{-0.25293f,0.f,0.f,0.96748f,5.f},{-0.25293f,0.f,0.f,0.96748f,7.f},{-0.24622f,0.f,0.f,0.96921f,9.f},{-0.24622f,0.f,0.f,0.96921f,11.f},{-0.12053f,0.f,0.f,0.99394f,13.f},{-0.09043f,0.f,0.f,0.99587f,15.f},{-0.02205f,0.f,0.f,0.99962f,17.f},{0.05051f,0.f,0.f,0.99962f,19.f},{0.07911f,0.f,0.f,0.99706f,21.f},{0.08542f,0.f,0.f,0.99635f,23.f},{0.25276f,0.f,0.f,0.96753f,1.f},{0.55243f,0.f,0.f,0.84102f,3.f},{0.62282f,0.f,0.f,0.78236f,5.f},{0.38238f,0.f,0.f,0.92164f,7.f},{0.09115f,0.f,0.f,0.99628f,9.f},{0.07281f,0.f,0.f,0.99735f,11.f},{0.07281f,0.f,0.f,0.99735f,13.f},{0.09719f,0.f,0.f,0.99527f,15.f},{0.09719f,0.f,0.f,0.99527f,17.f},{0.07691f,0.f,0.f,0.99704f,19.f},{0.17513f,0.f,0.f,0.98509f,21.f},{0.20553f,0.f,0.f,0.97865f,23.f},{-0.18503f,0.f,0.f,0.98273f,1.f},{0.12619f,0.f,0.f,0.99506f,3.f},{0.02536f,0.f,0.f,0.99943f,5.f},{-0.03385f,0.f,0.f,0.99943f,7.f},{-0.03385f,0.f,0.f,0.99943f,9.f},{-0.03385f,0.f,0.f,0.99943f,11.f},{-0.0429f,0.f,0.f,0.99908f,13.f},{0.03384f,0.f,0.f,0.99943f,15.f},{-0.07949f,0.f,0.f,0.99777f,17.f},{-0.11193f,0.f,0.f,0.9937f,19.f},{-0.15198f,0.f,0.f,0.98838f,21.f},{-0.12377f,0.f,0.f,0.99231f,23.f},{-0.1472f,0.f,0.f,0.98911f,1.f},{-0.0904f,0.f,0.f,0.99519f,3.f},{-0.02189f,0.f,0.f,0.99646f,5.f},{0.05048f,0.f,0.f,0.99962f,7.f},{0.07911f,0.f,0.f,0.99706f,9.f},{0.08542f,0.f,0.f,0.99635f,11.f},{0.05137f,0.f,0.f,0.99868f,13.f},{-0.00482f,0.f,0.f,0.99959f,15.f},{-0.25293f,0.f,0.f,0.96748f,17.f},{-0.25293f,0.f,0.f,0.96748f,19.f},{-0.24622f,0.f,0.f,0.96921f,21.f},{-0.24622f,0.f,0.f,0.96921f,23.f},{0.07281f,0.f,0.f,0.99735f,1.f},{0.09713f,0.f,0.f,0.99513f,3.f},{0.09713f,0.f,0.f,0.9947f,5.f},{0.07691f,0.f,0.f,0.99704f,7.f},{0.15003f,0.f,0.f,0.98868f,9.f},{0.14835f,0.f,0.f,0.98893f,11.f},{0.38019f,0.f,0.f,0.92713f,13.f},{0.54019f,0.f,0.f,0.84465f,15.f},{0.62282f,0.f,0.f,0.78236f,17.f},{0.38238f,0.f,0.f,0.92164f,19.f},{0.09115f,0.f,0.f,0.99628f,21.f},{0.08617f,0.f,0.f,0.99628f,23.f},{-0.0429f,0.f,0.f,0.99908f,1.f},{0.03384f,0.f,0.f,0.99943f,3.f},{-0.07947f,0.f,0.f,0.99748f,5.f},{-0.12242f,0.f,0.f,0.99313f,7.f},{-0.20573f,0.f,0.f,0.97861f,9.f},{-0.11696f,0.f,0.f,0.99314f,11.f},{-0.09968f,0.f,0.f,0.99314f,13.f},{0.12619f,0.f,0.f,0.99201f,15.f},{0.02536f,0.f,0.f,0.99943f,17.f},{-0.03385f,0.f,0.f,0.99943f,19.f},{-0.03385f,0.f,0.f,0.99943f,21.f},{-0.03385f,0.f,0.f,0.99943f,23.f},{0.f,0.f,0.f,0.f,1.f},{0.f,-0.00536f,0.06255f,0.f,3.f},{0.f,-0.09777f,0.136f,0.f,5.f},{0.f,-0.11583f,0.10839f,0.f,7.f},{0.f,-0.04321f,0.16361f,0.f,9.f},{0.f,0.0469f,0.16361f,0.f,11.f},{0.f,0.05729f,0.16361f,0.f,13.f},{0.f,0.f,0.f,1.f,1.f},{0.12494f,0.f,0.f,0.9925f,3.f},{0.25768f,0.f,0.f,0.96599f,5.f},{0.49632f,0.f,0.f,0.8732f,7.f},{0.65771f,0.f,0.f,0.76216f,9.f},{0.69849f,0.f,0.f,0.72317f,11.f},{0.70489f,0.f,0.f,0.70932f,13.f},{0.f,0.f,0.f,1.f,1.f},{0.04362f,0.f,0.f,0.99905f,3.f},{-0.04362f,0.f,0.f,0.99905f,11.f},{0.f,0.f,0.f,1.f,13.f},{0.f,0.f,0.f,1.f,1.f},{0.1532f,0.f,0.f,0.98877f,7.f},{0.17903f,0.f,0.f,0.98384f,9.f},{0.00668f,0.f,0.f,0.99927f,11.f},{-0.03816f,0.f,0.f,0.99927f,13.f},{0.f,0.f,0.f,1.f,1.f},{0.03091f,0.f,0.f,0.99964f,7.f},{0.15347f,0.f,0.f,0.98815f,9.f},{0.06677f,0.f,0.f,0.99777f,11.f},{0.06677f,0.f,0.f,0.99777f,13.f},{0.f,0.f,0.64279f,0.76604f,1.f},{-0.25123f,-0.2994f,0.59886f,0.71369f,3.f},{-0.29681f,-0.35372f,0.57016f,0.67949f,5.f},{-0.18137f,-0.21614f,0.61442f,0.73223f,9.f},{-0.00217f,-0.00259f,0.64034f,0.76313f,11.f},{0.05602f,0.06676f,0.64034f,0.76313f,13.f},{0.f,0.f,0.f,1.f,1.f},{-0.17116f,-0.02927f,-0.00509f,0.98479f,3.f},{-0.11482f,-0.01942f,-0.00223f,0.99323f,9.f},{-0.08597f,-0.01433f,-0.00124f,0.99619f,13.f},{0.f,0.f,0.08716f,0.99619f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,-0.64279f,0.76604f,1.f},{-0.25123f,0.2994f,-0.59886f,0.71369f,3.f},{-0.29681f,0.35372f,-0.57016f,0.67949f,5.f},{-0.18137f,0.21614f,-0.61442f,0.73223f,9.f},{-0.00217f,0.00259f,-0.64034f,0.76313f,11.f},{0.05602f,-0.06676f,-0.64034f,0.76313f,13.f},{0.f,0.f,0.f,1.f,1.f},{-0.17116f,0.02927f,0.00509f,0.98479f,3.f},{-0.11482f,0.01942f,0.00223f,0.99323f,9.f},{-0.08597f,0.01433f,0.00124f,0.99619f,13.f},{0.f,0.f,-0.08716f,0.99619f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{-0.13768f,0.f,0.f,0.99239f,3.f},{-0.25882f,0.f,0.f,0.96593f,5.f},{-0.13622f,0.f,0.f,0.98956f,9.f},{0.f,0.f,0.f,1.f,11.f},{0.f,0.f,0.f,1.f,13.f},{0.f,0.f,0.f,1.f,1.f},{0.12105f,0.f,0.f,0.99323f,3.f},{0.17365f,0.f,0.f,0.98481f,5.f},{0.02241f,0.f,0.f,1.f,9.f},{0.f,0.f,0.f,1.f,11.f},{0.04362f,0.f,0.f,0.99905f,13.f},{0.f,0.f,0.f,1.f,1.f},{0.06063f,0.f,0.f,0.99831f,3.f},{0.08716f,0.f,0.f,0.99619f,5.f},{0.04362f,0.f,0.f,0.99905f,9.f},{0.04362f,0.f,0.f,0.99905f,13.f},{0.f,0.f,0.f,1.f,1.f},{-0.13768f,0.f,0.f,0.99239f,3.f},{-0.25882f,0.f,0.f,0.96593f,5.f},{-0.13622f,0.f,0.f,0.98956f,9.f},{0.f,0.f,0.f,1.f,11.f},{0.f,0.f,0.f,1.f,13.f},{0.f,0.f,0.f,1.f,1.f},{0.12105f,0.f,0.f,0.99323f,3.f},{0.17365f,0.f,0.f,0.98481f,5.f},{0.02241f,0.f,0.f,1.f,9.f},{0.f,0.f,0.f,1.f,11.f},{0.04362f,0.f,0.f,0.99905f,13.f},{0.f,0.f,0.f,1.f,1.f},{0.06063f,0.f,0.f,0.99831f,3.f},{0.08716f,0.f,0.f,0.99619f,5.f},{0.04362f,0.f,0.f,0.99905f,9.f},{0.04362f,0.f,0.f,0.99905f,13.f},{0.f,-0.00361f,0.04517f,0.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.13053f,0.f,0.f,0.99144f,1.f},{-0.04362f,0.f,0.f,0.99905f,1.f},{-0.08716f,0.f,0.f,0.99619f,1.f},{0.13692f,0.10707f,0.57044f,0.80274f,1.f},{-0.73494f,-0.05861f,-0.06405f,0.67255f,1.f},{-0.0414f,-0.30153f,-0.47533f,0.82549f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.13692f,-0.10707f,-0.57044f,0.80274f,1.f},{-0.73494f,0.05861f,0.06405f,0.67255f,1.f},{-0.0414f,0.30153f,0.47533f,0.82549f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{-0.12059f,-0.37941f,-0.04995f,0.91598f,1.f},{0.13053f,0.f,0.f,0.99144f,1.f},{0.f,0.f,0.f,1.f,1.f},{-0.12059f,0.37941f,0.04995f,0.91598f,1.f},{0.13053f,0.f,0.f,0.99144f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,-0.13053f,0.99144f,1.f},{0.f,0.f,0.5f,0.86603f,1.f},{0.f,0.f,0.70711f,0.70711f,1.f},{-0.02151f,-0.00407f,0.1858f,0.98234f,1.f},{0.f,0.f,0.13053f,0.99144f,1.f},{0.f,0.f,-0.5f,0.86603f,1.f},{0.f,0.f,-0.70711f,0.70711f,1.f},{-0.02151f,0.00407f,-0.1858f,0.98234f,1.f},{0.f,0.f,0.08716f,0.99619f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,-0.08716f,0.99619f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,-0.22202f,0.24101f,0.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{-0.0839f,-0.09999f,0.63729f,0.75949f,1.f},{-0.33795f,-0.0526f,-0.01892f,0.9395f,1.f},{0.f,0.f,0.08716f,0.99619f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{-0.0839f,0.09999f,-0.63729f,0.75949f,1.f},{-0.33795f,0.0526f,0.01892f,0.9395f,1.f},{0.f,0.f,-0.08716f,0.99619f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{-0.67495f,-0.03216f,-0.02947f,0.73658f,1.f},{0.67495f,0.03216f,0.02947f,0.73658f,1.f},{0.f,0.f,0.f,1.f,1.f},{-0.67495f,0.03216f,0.02947f,0.73658f,1.f},{0.67495f,-0.03216f,-0.02947f,0.73658f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,0.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.64279f,0.76604f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.08716f,0.99619f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,-0.64279f,0.76604f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,-0.08716f,0.99619f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f},{0.f,0.f,0.f,1.f,1.f}}; cha_armature_init(p,"armature_body",CHA_ARMATURE_NAME_BODY,gNumBones,gBoneNames,gBoneParents,gBoneSymmetry,gBoneDataPairs); cha_armature_add_actions(p,gNumActions,gActionNames,gNumKeyFrames,gKeyFrames,sizeof(gKeyFrames)/sizeof(gKeyFrames[0]),0.f); @@ -453,14 +459,51 @@ void cha_mesh_init_covid_mask(struct cha_mesh* p) { #undef CHA_COVID_MASK_NUM_INDS #undef CHA_COVID_MASK_NUM_MATERIALS - //float parent_offset_matrix[16] = {1.f,0.f,0.f,0.f, 0.f,1.f,0.f,0.f, 0.f,0.f,1.f,0.f, 0.f,0.f,0.f,1.f}; cha_mesh_init(p,"covid_mask",CHA_MESH_NAME_COVID_MASK,gCovidMaskVerts,gCovidMaskNumVerts,gCovidMaskInds,gCovidMaskNumInds); cha_mesh_add_mesh_parts(p,gCovidMaskNumMaterials,gCovidMaskMaterialIdx,gCovidMaskNumIndsPerMaterial); - cha_mesh_set_parent_mesh(p,CHA_MESH_NAME_HEAD,NULL/*parent_offset_matrix*/,NULL); + cha_mesh_set_parent_mesh(p,CHA_MESH_NAME_HEAD,NULL,NULL); p->inactive_by_default = 1; } +void cha_mesh_init_suitcases(struct cha_mesh* pr,struct cha_mesh* pl) { + /* suitcase */ + #define CHA_SUITCASE_NUM_MATERIALS 2 + const int gSuitcaseNumMaterials = CHA_SUITCASE_NUM_MATERIALS; + const int gSuitcaseMaterialIdx[CHA_SUITCASE_NUM_MATERIALS] = {CHA_MATERIAL_NAME_SHOES_BELT,CHA_MATERIAL_NAME_PUPIL}; + #define CHA_SUITCASE_NUM_INDS (324+72) + const int gSuitcaseNumInds = CHA_SUITCASE_NUM_INDS; + const int gSuitcaseNumIndsPerMaterial[CHA_SUITCASE_NUM_MATERIALS+1] = {0,324,(324+72)}; /* last must be CHA_SUITCASE_NUM_INDS */ + const unsigned short gSuitcaseInds[CHA_SUITCASE_NUM_INDS] = { + /* CHA_MATERIAL_NAME_SHOES_BELT */ 0,1,6,6,3,0,1,2,7,7,6,1,2,9,12,12,7,2,3,6,5,5,4,3,6,7,8,8,5,6,7,12,13,13,8,7,4,5,41,41,40,4,5,8,42,42,41,5,8,13,43,43,42,8,9,10,15,15,12,9,10,11,16,16,15,10,11,18,21,21,16,11,12,15,14,14,13,12,15,16,17,17,14,15,16,21,22,22,17,16,13,14,50,50,43,13,14,17,51,51,50,14,17,22,55,55,51,17,18,19,24,24,21,18,19,20,25,25,24,19,20,27,30,30,25,20,21,24,23,23,22,21,24,25,26,26,23,24,25,30,31,31,26,25,22,23,54,54,55,22,23,26,53,53,54,23,26,31,52,52,53,26,27,28,33,33,30,27,28,29,34,34,33,28,29,0,3,3,34,29,30,33,32,32,31,30,33,34,35,35,32,33,34,3,4,4,35,34,31,32,45,45,52,31,32,35,44,44,45,32,35,4,40,40,44,35,27,20,37,37,28,27,20,19,38,38,37,20,19,18,11,11,38,19,28,37,36,36,29,28,37,38,39,39,36,37,38,11,10,10,39,38,29,36,1,1,0,29,36,39,2,2,1,36,39,10,9,9,2,39,40,41,47,47,44,40,41,42,48,48,47,41,42,43,50,50,48,42,44,47,46,46,45,44,47,48,49,49,46,47,48,50,51,51,49,48,45,46,53,53,52,45,46,49,54,54,53,46,49,51,55,55,54,49, + /* CHA_MATERIAL_NAME_PUPIL */ 56,57,59,59,58,56,58,59,66,66,67,58,62,63,61,61,60,62,59,63,69,69,66,59,58,62,60,60,56,58,63,59,57,57,61,63,57,56,64,64,65,57,56,60,71,71,64,56,63,62,68,68,69,63,62,58,67,67,68,62,61,57,65,65,70,61,60,61,70,70,71,60 + }; + #define CHA_SUITCASE_NUM_VERTS 72 + const int gSuitcaseNumVerts = CHA_SUITCASE_NUM_VERTS; + const float gSuitcaseVerts[3*CHA_SUITCASE_NUM_VERTS] = {0.03116f,0.11366f,-0.18354f,0.0225f,0.115607f,-0.185487f,-0.0225f,0.115607f,-0.185487f,0.033107f,0.115607f,-0.17488f,0.033107f,0.115607f,-0.02488f,0.0225f,0.12f,-0.02488f,0.0225f,0.12f,-0.17488f,-0.0225f,0.12f,-0.17488f,-0.0225f,0.12f,-0.02488f,-0.03116f,0.11366f,-0.18354f,-0.033107f,0.105f,-0.185487f,-0.033107f,-0.105f,-0.185487f,-0.033107f,0.115607f,-0.17488f,-0.033107f,0.115607f,-0.02488f,-0.0375f,0.105f,-0.02488f,-0.0375f,0.105f,-0.17488f,-0.0375f,-0.105f,-0.17488f,-0.0375f,-0.105f,-0.02488f,-0.03116f,-0.11366f,-0.18354f,-0.0225f,-0.115607f,-0.185487f,0.0225f,-0.115607f,-0.185487f,-0.033107f,-0.115607f,-0.17488f,-0.033107f,-0.115607f,-0.02488f,-0.0225f,-0.12f,-0.02488f,-0.0225f,-0.12f,-0.17488f,0.0225f,-0.12f,-0.17488f,0.0225f,-0.12f,-0.02488f,0.03116f,-0.11366f,-0.18354f,0.033107f,-0.105f,-0.185487f,0.033107f,0.105f,-0.185487f,0.033107f,-0.115607f,-0.17488f,0.033107f,-0.115607f,-0.02488f,0.0375f,-0.105f,-0.02488f,0.0375f,-0.105f,-0.17488f,0.0375f,0.105f,-0.17488f,0.0375f,0.105f,-0.02488f,0.0225f,0.105f,-0.18988f,0.0225f,-0.105f,-0.18988f,-0.0225f,-0.105f,-0.18988f,-0.0225f,0.105f,-0.18988f,0.03116f,0.11366f,-0.01622f,0.0225f,0.115607f,-0.014274f,-0.0225f,0.115607f,-0.014274f,-0.03116f,0.11366f,-0.01622f,0.033107f,0.105f,-0.014274f,0.033107f,-0.105f,-0.014274f,0.0225f,-0.105f,-0.00988f,0.0225f,0.105f,-0.00988f,-0.0225f,0.105f,-0.00988f,-0.0225f,-0.105f,-0.00988f,-0.033107f,0.105f,-0.014274f,-0.033107f,-0.105f,-0.014274f,0.03116f,-0.11366f,-0.01622f,0.0225f,-0.115607f,-0.014274f,-0.0225f,-0.115607f,-0.014274f,-0.03116f,-0.11366f,-0.01622f,-0.006f,-0.0225f,0.00912f,-0.006f,-0.033f,0.02112f,-0.006f,0.0225f,0.00912f,-0.006f,0.033f,0.02112f,0.006f,-0.0225f,0.00912f,0.006f,-0.033f,0.02112f,0.006f,0.0225f,0.00912f,0.006f,0.033f,0.02112f,-0.006f,-0.022569f,-0.009802f,-0.006f,-0.032931f,-0.009802f,-0.006f,0.032931f,-0.009802f,-0.006f,0.022569f,-0.009802f,0.006f,0.022569f,-0.009802f,0.006f,0.032931f,-0.009802f,0.006f,-0.032931f,-0.009802f,0.006f,-0.022569f,-0.009802f}; + #undef CHA_SUITCASE_NUM_VERTS + #undef CHA_SUITCASE_NUM_INDS + #undef CHA_SUITCASE_NUM_MATERIALS + + //int i;//rot = {1.571,0.000,0.611}; + float parent_offset_matrix_r[16] = {1.f,0.f,0.f,0.f, 0.f,1.f,0.f,0.f, 0.f,0.f,1.f,0.f, 0.f,0.f,0.f,1.f}; + float parent_offset_matrix_l[16] = {1.f,0.f,0.f,0.f, 0.f,1.f,0.f,0.f, 0.f,0.f,1.f,0.f, 0.f,0.f,0.f,1.f}; + parent_offset_matrix_r[12]=-0.015f;parent_offset_matrix_r[13]=-0.025f; // y and z + chm_Mat4Rotatef(parent_offset_matrix_r,90.f,1.f,0.f,0.f);chm_Mat4Rotatef(parent_offset_matrix_r,90.f+15.f,0.f,1.f,0.f); + parent_offset_matrix_l[12]=0.015f;parent_offset_matrix_l[13]=-0.025f; + chm_Mat4Rotatef(parent_offset_matrix_l,90.f,1.f,0.f,0.f);chm_Mat4Rotatef(parent_offset_matrix_l,-90.f-15.f,0.f,1.f,0.f); + + cha_mesh_init(pr,"suitcase_r",CHA_MESH_NAME_SUITCASE_RIGHT,gSuitcaseVerts,gSuitcaseNumVerts,gSuitcaseInds,gSuitcaseNumInds); + cha_mesh_add_mesh_parts(pr,gSuitcaseNumMaterials,gSuitcaseMaterialIdx,gSuitcaseNumIndsPerMaterial); + cha_mesh_set_parent_bone(pr,CHA_MESH_NAME_BODY,CHA_BONE_NAME_HAND1_R,parent_offset_matrix_r,NULL); + + cha_mesh_init(pl,"suitcase_l",CHA_MESH_NAME_SUITCASE_LEFT,gSuitcaseVerts,gSuitcaseNumVerts,gSuitcaseInds,gSuitcaseNumInds); + cha_mesh_add_mesh_parts(pl,gSuitcaseNumMaterials,gSuitcaseMaterialIdx,gSuitcaseNumIndsPerMaterial); + cha_mesh_set_parent_bone(pl,CHA_MESH_NAME_BODY,CHA_BONE_NAME_HAND1_L,parent_offset_matrix_l,NULL); + + pr->inactive_by_default = pl->inactive_by_default = 1; +} + /* material names */ void cha_materials_init_names(struct cha_material_names* p) { const char* gMaterialNames[CHA_MATERIAL_NAME_COUNT] = {"hair","irid","lips","pupil","shoes-belt","skin","t-shirt","teeth","trousers","white_eye","z_glasses"};