math: Add functions to decompose transformation matrices

mat4_decompose() is similar to mat4_to_loc_rot_size() but returns
rotation as quaternion.
mat4_to_loc_quat() just returns location and rotation without size.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@54018 954f8c5b-7b00-dc11-b283-0030488c597c
rigidbody: Add rigidbody module

It's mostly a C API for bullet that interfaces nicely with blender.
It could act as a generic interface for rigid body simulations but right
now it's very specific to bullet.

TODO: Fix building without bullet.

Part of GSoC 2010 and 2012.
Authors: Joshua Leung (aligorith), Sergej Reich (sergof)

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@54019 954f8c5b-7b00-dc11-b283-0030488c597c
rigidbody: Add DNA/RNA/BKE infrastructure for the rigid body sim

This is just the basic structure, the simulation isn't hooked up yet.

Scenes get a pointer to a rigid body world that holds rigid body objects.
Objects get a pointer to a rigdid body object.

Both rigid body world and objects aren't used directly in the simulation
and only hold information to create the actual physics objects.

Physics objects are created when rigid body objects are validated.
In order to keep blender and bullet objects in sync care has to be taken
to either call appropriate set functions or flag objects for validation.

Part of GSoC 2010 and 2012.
Authors: Joshua Leung (aligorith), Sergej Reich (sergof)

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@54020 954f8c5b-7b00-dc11-b283-0030488c597c
rigidbody: Add force field support

Force fields work with rigid bodies just like they do with other simulations.

Increase min and max strength of force fields so they can influence heavy rigid
bodies.

TODO: Adjust force field strength based on the time step taken.

Part of GSoC 2010 and 2012.
Authors: Joshua Leung (aligorith), Sergej Reich (sergof)

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@54021 954f8c5b-7b00-dc11-b283-0030488c597c
rigidbody: Add point cache support

Add read/write/interpolate functions.

In order to get rigid body point cache id from object it's now required to pass the
scene to BKE_ptcache_ids_from_object().

Rigid body cache is drawn in the orange color of the bullet logo.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@54022 954f8c5b-7b00-dc11-b283-0030488c597c
rigidbody: Add rigid body simulation

Add operators to add/remove rigid body world and objects.
Add UI scripts.

The rigid body simulation works on scene level and overrides the
position/orientation of rigid bodies when active.
It does not deform meshes or generate data so there is no modifier.

Usage:
* Add rigid body world in the scene tab
* Create a group
* Add objects to the group
* Assign group to the rigid body world
* Play animation
For convenience the rigid body tools operators in the tools panel of the 3d view
will add a world, group and add objects to the group automatically so you only have
to press one button to add/remove rigid bodies to the simulation.

Part of GSoC 2010 and 2012.
Authors: Joshua Leung (aligorith), Sergej Reich (sergof)

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@54023 954f8c5b-7b00-dc11-b283-0030488c597c
rigidbody: Add "Copy Rigid Body Settings" and "Bake To Keyframes" operators

Based on a script by liero, thanks!

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@54024 954f8c5b-7b00-dc11-b283-0030488c597c
rigidbody: Add rigid body constraints

Constraints connect two rigid bodies.
Depending on which constraint is used different degrees of freedom
are limited, e.g. a hinge constraint only allows the objects to rotate
around a common axis.

Constraints are implemented as individual objects and bahave similar to
rigid bodies in terms of adding/removing/validating.

The position and orientation of the constraint object is the pivot point
of the constraint.

Constraints have their own group in the rigid body world.

To make connecting rigid bodies easier, there is a "Connect" operator that
creates an empty objects with a rigid body constraint connecting the selected
objects to active.

Currently the following constraints are implemented:
* Fixed
* Point
* Hinge
* Slider
* Piston
* Generic

Note: constraint limits aren't animatable yet).

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@54025 954f8c5b-7b00-dc11-b283-0030488c597c
rigidbody: Add generic spring constraint

Behaves like the generic constraint but has optional spring on each axis.

TODO: Add option to set rest length.

Patch by Markus Kasten (markus111), thanks!

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk/blender@54026 954f8c5b-7b00-dc11-b283-0030488c597c