synched with trunk at revision 36569
[blender-staging.git] / source / blender / blenkernel / intern / sca.c
index 16cef67ea6d2c098c67435e2a193ff573cf9864f..ee410e75873a1a510ae9e0911e326220e08f7009 100644 (file)
@@ -396,6 +396,7 @@ void init_actuator(bActuator *act)
        bObjectActuator *oa;
        bRandomActuator *ra;
        bSoundActuator *sa;
+       bSteeringActuator *sta;
        
        if(act->data) MEM_freeN(act->data);
        act->data= NULL;
@@ -469,6 +470,16 @@ void init_actuator(bActuator *act)
        case ACT_ARMATURE:
                act->data = MEM_callocN(sizeof( bArmatureActuator ), "armature act");
                break;
+       case ACT_STEERING:
+               act->data = MEM_callocN(sizeof( bSteeringActuator), "steering act");
+               sta = act->data;
+               sta->acceleration = 3.f;
+               sta->turnspeed = 120.f;
+               sta->dist = 1.f;
+               sta->velocity= 3.f;
+               sta->flag = ACT_STEERING_AUTOMATICFACING;
+               sta->facingaxis = 1;
+               break;
        default:
                ; /* this is very severe... I cannot make any memory for this        */
                /* logic brick...                                                    */
@@ -594,6 +605,11 @@ void set_sca_new_poins_ob(Object *ob)
                                bPropertyActuator *pa= act->data;
                                ID_NEW(pa->ob);
                        }
+                       else if(act->type==ACT_STEERING) {
+                               bSteeringActuator *sta = act->data;
+                               ID_NEW(sta->navmesh);
+                               ID_NEW(sta->target);
+                       }
                }
                act= act->next;
        }