BGE: Some various changes to make moving the character physics type easier:

* Undoing the previous applyMovement() changes for characters. This was causing bugs for the Motion Actuator.
  * Creating a Character Motion type for the Motion Actuator with specific controls for characters. This includes moving, rotating and jumping.
  * Adding a KX_CharacterWrapper.walkDirection to set the character's direction and speed.

Note, this also resolves the following bugs:
[#33585] "Setting dLoc of motion actuator [0,0,0] via python won't stop object" reported by Manuel Bellersen (urfoex)
[#33503] "Character physics type won´t accept more than one motion anymore" reported by Mr Larodos
This commit is contained in:
2013-01-30 05:55:17 +00:00
parent 26ee2a1f79
commit 9191b783bb
16 changed files with 222 additions and 17 deletions

View File

@@ -1860,6 +1860,25 @@ static void draw_actuator_motion(uiLayout *layout, PointerRNA *ptr)
uiItemR(col, ptr, "integral_coefficient", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
uiItemR(col, ptr, "derivate_coefficient", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
break;
case ACT_OBJECT_CHARACTER:
split = uiLayoutSplit(layout, 0.9, FALSE);
row = uiLayoutRow(split, FALSE);
uiItemR(row, ptr, "offset_location", 0, NULL, ICON_NONE);
row = uiLayoutRow(split, TRUE);
uiItemR(row, ptr, "use_local_location", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
uiItemR(row, ptr, "use_add_character_location", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
split = uiLayoutSplit(layout, 0.9, FALSE);
row = uiLayoutRow(split, FALSE);
uiItemR(row, ptr, "offset_rotation", 0, NULL, ICON_NONE);
uiItemR(split, ptr, "use_local_rotation", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
split = uiLayoutSplit(layout, 0.9, FALSE);
row = uiLayoutRow(split, FALSE);
split = uiLayoutSplit(row, 0.7, FALSE);
uiItemL(split, "", ICON_NONE); /*Just use this for some spacing */
uiItemR(split, ptr, "use_character_jump", UI_ITEM_R_TOGGLE, NULL, ICON_NONE);
break;
}
}