From 782f0b63829a2c257a6e2942c49882f7fe04c33c Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Wed, 11 Jan 2012 07:27:39 +0000 Subject: bge camera actuator: -X and -Y axis The camera actuator only allows to look the object from its front face. Given that Blender takes -Y as the default forward orientation, the current functionality doesn't let a camera to track an actor from behind. This patch allows for -X and -Y axis tracking. This way a camera over the shoulders of a character is possible (without resorting to rotate the mesh/armature original orientation. - patch reviewed by Campbell Barton, thanks --- source/blender/blenloader/intern/readfile.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index bb5682f4ebd..1f45be6848d 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -12941,7 +12941,23 @@ static void do_versions(FileData *fd, Library *lib, Main *main) /* put compatibility code here until next subversion bump */ { - + { + /* convert Camera Actuator values to defines */ + Object *ob; + bActuator *act; + for(ob = main->object.first; ob; ob= ob->id.next) { + for(act= ob->actuators.first; act; act= act->next) { + if (act->type == ACT_CAMERA) { + bCameraActuator *ba= act->data; + + if(ba->axis==(float) 'x') ba->axis=OB_POSX; + else if (ba->axis==(float)'y') ba->axis=OB_POSY; + /* don't do an if/else to avoid imediate subversion bump*/ +// ba->axis=((ba->axis == (float) 'x')?OB_POSX_X:OB_POSY); + } + } + } + } } /* WATCH IT!!!: pointers from libdata have not been converted yet here! */ -- cgit v1.2.3