diff options
author | Nick Samarin <nicks1987@bigmir.net> | 2010-06-12 01:13:59 +0400 |
---|---|---|
committer | Nick Samarin <nicks1987@bigmir.net> | 2010-06-12 01:13:59 +0400 |
commit | 147e8d01ebd7b04d81e2094669d8bc9b0f005f19 (patch) | |
tree | 12f7d8ab85c775e059b3f4b24042b6ace3d88574 /source/blender | |
parent | 12b33ca099c57ec793c09b188f6fa1ab2c08beaa (diff) |
- added acceleration and turn speed parameters for obstacle simulation
- added debug visualization for object velocities
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/sca.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_logic/logic_window.c | 3 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_actuator_types.h | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_actuator.c | 12 |
4 files changed, 21 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/sca.c b/source/blender/blenkernel/intern/sca.c index 80904c1b1e7..877669014bb 100644 --- a/source/blender/blenkernel/intern/sca.c +++ b/source/blender/blenkernel/intern/sca.c @@ -416,6 +416,7 @@ void init_actuator(bActuator *act) bObjectActuator *oa; bRandomActuator *ra; bSoundActuator *sa; + bSteeringActuator *sta; if(act->data) MEM_freeN(act->data); act->data= 0; @@ -491,6 +492,9 @@ void init_actuator(bActuator *act) break; case ACT_STEERING: act->data = MEM_callocN(sizeof( bSteeringActuator), "steering act"); + sta = act->data; + sta->acceleration = 3; + sta->turnspeed = 120; default: ; /* this is very severe... I cannot make any memory for this */ /* logic brick... */ diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c index 0c06ed74080..208b9aeabc0 100644 --- a/source/blender/editors/space_logic/logic_window.c +++ b/source/blender/editors/space_logic/logic_window.c @@ -4273,6 +4273,9 @@ static void draw_actuator_steering(uiLayout *layout, PointerRNA *ptr) row = uiLayoutRow(layout, 0); uiItemR(row, ptr, "distance", 0, NULL, 0); uiItemR(row, ptr, "velocity", 0, NULL, 0); + row = uiLayoutRow(layout, 0); + uiItemR(row, ptr, "acceleration", 0, NULL, 0); + uiItemR(row, ptr, "turnspeed", 0, NULL, 0); } diff --git a/source/blender/makesdna/DNA_actuator_types.h b/source/blender/makesdna/DNA_actuator_types.h index d3c37f7c6e3..89709948f50 100644 --- a/source/blender/makesdna/DNA_actuator_types.h +++ b/source/blender/makesdna/DNA_actuator_types.h @@ -219,6 +219,8 @@ typedef struct bSteeringActuator { int type; /* 0=seek, 1=flee, 2=path following */ float dist; float velocity; + float acceleration; + float turnspeed; struct Object *target; struct Object *navmesh; } bSteeringActuator; diff --git a/source/blender/makesrna/intern/rna_actuator.c b/source/blender/makesrna/intern/rna_actuator.c index 5f4b9e4c472..df3b59b54bc 100644 --- a/source/blender/makesrna/intern/rna_actuator.c +++ b/source/blender/makesrna/intern/rna_actuator.c @@ -1872,6 +1872,18 @@ static void rna_def_steering_actuator(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Velocity", "Velocity magnitude"); RNA_def_property_update(prop, NC_LOGIC, NULL); + prop= RNA_def_property(srna, "acceleration", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "acceleration"); + RNA_def_property_range(prop, 0.0, 1000.0); + RNA_def_property_ui_text(prop, "Acceleration", "Max acceleration"); + RNA_def_property_update(prop, NC_LOGIC, NULL); + + prop= RNA_def_property(srna, "turnspeed", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "turnspeed"); + RNA_def_property_range(prop, 0.0, 720.0); + RNA_def_property_ui_text(prop, "Turn speed", "Max turn speed"); + RNA_def_property_update(prop, NC_LOGIC, NULL); + prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "dist"); RNA_def_property_range(prop, 0.0, 1000.0); |