Campbell Barton
60d099648c
added a factor argument for aligning to vector, this isn't correct since it does linear interpolation of the vector and renormalizes.
...
(can be improved to rotate correctly but for our use ist ok for now, would also be useful to have an argument to clamp the maximum rotation angle to get a constant rotation speed),
This will used to make franky upright when falling from an angle, to track to a surface when hanging onto a ledge and setting the glide pitch.
Without this rotation is instant and jerky.
currently this is done with Mathutils which isnt available in Blender Player.
def do_rotate_up(own):
own.alignAxisToVect([0,0,1], 2, 0.1)
replaces...
def do_rotate_up(own):
up_nor = Vector(0,0,1)
own_mat = Matrix(*own.getOrientation()).transpose()
own_up = up_nor * own_mat
ang = AngleBetweenVecs(own_up, up_nor)
if ang > 0.005:
# Set orientation
cross = CrossVecs(own_up, up_nor)
new_mat = own_mat * RotationMatrix(ang*0.1, 3, 'r', cross)
own.setOrientation(new_mat.transpose())
M source/gameengine/Ketsji/KX_GameObject.cpp
M source/gameengine/Ketsji/KX_GameObject.h
2008-07-09 09:21:52 +00:00
..
2008-07-01 16:43:46 +00:00
2008-06-17 10:27:34 +00:00
2008-06-17 10:27:34 +00:00
2008-06-17 10:27:34 +00:00
2008-06-17 10:27:34 +00:00
2008-07-01 16:43:46 +00:00
2006-04-11 05:57:30 +00:00
2008-06-17 10:27:34 +00:00
2007-01-13 08:30:08 +00:00
2008-06-17 10:27:34 +00:00
2008-06-17 10:27:34 +00:00
2008-06-17 10:27:34 +00:00
2008-06-24 19:37:43 +00:00
2008-06-24 19:37:43 +00:00
2008-07-01 16:43:46 +00:00
2008-05-24 08:34:04 +00:00
2008-05-07 22:32:45 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-07-04 08:14:50 +00:00
2008-07-04 08:14:50 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-05-01 16:00:59 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-07-09 09:21:52 +00:00
2008-07-09 09:21:52 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-06-24 19:37:43 +00:00
2008-07-08 12:18:43 +00:00
2008-07-08 12:18:43 +00:00
2008-07-08 12:18:43 +00:00
2008-07-08 12:18:43 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-06-17 10:27:34 +00:00
2008-04-16 22:40:48 +00:00
2008-06-17 10:06:38 +00:00
2008-06-17 10:06:38 +00:00
2008-05-12 21:12:10 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2006-01-06 15:29:11 +00:00
2006-01-06 03:46:54 +00:00
2008-07-01 16:43:46 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-07-04 08:14:50 +00:00
2008-06-22 14:23:57 +00:00
2008-07-04 08:14:50 +00:00
2008-04-19 21:09:40 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-07-04 08:14:50 +00:00
2008-07-04 08:14:50 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-07-08 12:18:43 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-07-01 16:43:46 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-07-01 16:43:46 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-07-04 19:00:56 +00:00
2008-04-16 22:40:48 +00:00
2008-06-22 14:23:57 +00:00
2008-04-16 22:40:48 +00:00
2008-06-18 09:06:51 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-07-04 08:14:50 +00:00
2008-06-22 14:23:57 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-06-25 14:09:15 +00:00
2008-06-25 14:09:15 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-07-08 12:18:43 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-06-14 17:12:49 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-06-22 14:23:57 +00:00
2008-06-22 14:23:57 +00:00
2006-11-21 00:53:40 +00:00
2008-06-24 19:37:43 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-07-08 22:43:44 +00:00
2008-04-16 22:40:48 +00:00
2008-07-04 08:14:50 +00:00
2008-06-22 14:23:57 +00:00
2008-07-01 05:16:08 +00:00
2008-04-26 20:41:25 +00:00
2008-07-01 16:43:46 +00:00
2006-02-21 07:08:23 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-04-16 22:40:48 +00:00
2008-06-17 10:27:34 +00:00
2008-06-17 10:27:34 +00:00