[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [52340] trunk/blender/source/blender: BGE: The Step Height for a character physics controller is now set to 0.01, which means that Step Height can no longer be 0, which causes issues such as those noted in issue #33221, " KX_CharacterWrapper inconsistencies and error, " reported by Angus Hollands (agoose77).
Mitchell Stokes
mogurijin at gmail.com
Sun Nov 18 21:56:50 CET 2012
Revision: 52340
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=52340
Author: moguri
Date: 2012-11-18 20:56:50 +0000 (Sun, 18 Nov 2012)
Log Message:
-----------
BGE: The Step Height for a character physics controller is now set to 0.01, which means that Step Height can no longer be 0, which causes issues such as those noted in issue #33221, "KX_CharacterWrapper inconsistencies and error," reported by Angus Hollands (agoose77). I've also added a do_versions() fix that will give objects with 0 Step Height sane defaults. This means old files will now work better with character physics.
Modified Paths:
--------------
trunk/blender/source/blender/blenloader/intern/readfile.c
trunk/blender/source/blender/makesrna/intern/rna_object.c
Modified: trunk/blender/source/blender/blenloader/intern/readfile.c
===================================================================
--- trunk/blender/source/blender/blenloader/intern/readfile.c 2012-11-18 20:38:27 UTC (rev 52339)
+++ trunk/blender/source/blender/blenloader/intern/readfile.c 2012-11-18 20:56:50 UTC (rev 52340)
@@ -8364,6 +8364,17 @@
}
}
+ {
+ Object *ob;
+ for (ob = main->object.first; ob; ob = ob->id.next) {
+ if (ob->step_height == 0.0) {
+ ob->step_height = 0.150;
+ ob->jump_speed = 10.0;
+ ob->fall_speed = 55.0;
+ }
+ }
+ }
+
/* WATCH IT!!!: pointers from libdata have not been converted yet here! */
/* WATCH IT 2!: Userdef struct init has to be in editors/interface/resources.c! */
Modified: trunk/blender/source/blender/makesrna/intern/rna_object.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_object.c 2012-11-18 20:38:27 UTC (rev 52339)
+++ trunk/blender/source/blender/makesrna/intern/rna_object.c 2012-11-18 20:56:50 UTC (rev 52340)
@@ -1643,21 +1643,23 @@
RNA_def_property_range(prop, 0.0, 1000.0);
RNA_def_property_ui_text(prop, "Velocity Max", "Clamp velocity to this maximum speed");
+ /* Character physics */
prop = RNA_def_property(srna, "step_height", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "step_height");
- RNA_def_property_range(prop, 0.0, 1.0);
+ RNA_def_property_range(prop, 0.01, 1.0);
RNA_def_property_ui_text(prop, "Step Height", "Maximum height of steps the character can run over");
prop = RNA_def_property(srna, "jump_speed", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "jump_speed");
RNA_def_property_range(prop, 0.0, 1000.0);
- RNA_def_property_ui_text(prop, "Jump Force", "Upward velocity applied to the character when jumping (with the Motion actuator)");
+ RNA_def_property_ui_text(prop, "Jump Force", "Upward velocity applied to the character when jumping");
prop = RNA_def_property(srna, "fall_speed", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "fall_speed");
RNA_def_property_range(prop, 0.0, 1000.0);
RNA_def_property_ui_text(prop, "Fall Speed Max", "Maximum speed at which the character will fall");
+ /* Collision Masks */
prop = RNA_def_property(srna, "collision_group", PROP_BOOLEAN, PROP_LAYER_MEMBER);
RNA_def_property_boolean_sdna(prop, NULL, "col_group", 1);
RNA_def_property_array(prop, OB_MAX_COL_MASKS);
More information about the Bf-blender-cvs
mailing list