blender/source/gameengine
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
..
BlenderRoutines Fix for bug #7753: after game engine drawing with vertex arrays, 2008-06-29 21:51:27 +00:00
Converter BGE logic patch: new "Add" mode for Ipo actuator, several corrections in state system. 2008-07-08 12:18:43 +00:00
Expressions bugfix - GameEngine PyObject methods did not all return when using dir(), because inherited methods were ignored, This made it incredibly annoying, not only having to search a C++ file to see what functions were available. but looking up methods inherited from other C++ classes. 2008-07-08 17:57:31 +00:00
GameLogic BGE logic patch: new "Add" mode for Ipo actuator, several corrections in state system. 2008-07-08 12:18:43 +00:00
GamePlayer Fix for bug #7753: after game engine drawing with vertex arrays, 2008-06-29 21:51:27 +00:00
Ketsji added a factor argument for aligning to vector, this isn't correct since it does linear interpolation of the vector and renormalizes. 2008-07-09 09:21:52 +00:00
Network Patch from GSR that a) fixes a whole bunch of GPL/BL license 2008-04-16 22:40:48 +00:00
Physics Fix BGE bug: dynamic-but-not-rigid objects are added as rigid body during the game. 2008-05-01 16:00:59 +00:00
PyDoc non user visible changes and small optimizations to the game engine pyapi as well as fixing some bugs. 2008-07-04 00:05:50 +00:00
Rasterizer Fix for bug #7753: after game engine drawing with vertex arrays, 2008-06-29 21:51:27 +00:00
SceneGraph BGE logic patch: new "Add" mode for Ipo actuator, several corrections in state system. 2008-07-08 12:18:43 +00:00
CMakeLists.txt Patch from GSR that a) fixes a whole bunch of GPL/BL license 2008-04-16 22:40:48 +00:00
Makefile Patch from GSR that a) fixes a whole bunch of GPL/BL license 2008-04-16 22:40:48 +00:00
SConscript == SCons == 2006-02-04 14:15:10 +00:00