Commit Graph

115 Commits

Author SHA1 Message Date
296444e1dc style cleanup: some warnigs & spelling. 2013-02-06 14:02:19 +00:00
e9ef8d6eff rigidbody: Avoid always making passive objects kinematic
It's only needed when they're being transformed.
Also deactivate passive objects after transformation so they don't keep
acitvating deactivated objects.

Fixes issues with using "start deactivated".
2013-02-04 23:50:38 +00:00
ace88b6962 rigidbody: Fix [#34108] Rigid body with no polygons crashes blender
Fall back to using box shape in case creating shape from mesh fails.
2013-02-04 23:50:36 +00:00
ae27a548f8 rigidbody: Fix [#34106] Deleting an object with Bullet Constraint crashes Blender
Constraints are deleted before rigid bodies so need to check if constraint
exists in case both the constraint and ridid body are on the same object.
2013-02-04 23:50:31 +00:00
5489d5c2b5 rigidbody: Fix [#33971] Bullet Physics crash + patch
BKE_rigidbody_aftertrans_update() can be called before rigid body is
validated so check before updating physics_object.

Thanks to Antony Riakiotakis (psy-fi) for the initial patch.
2013-01-24 03:49:30 +00:00
c24777ee9e style cleanup 2013-01-23 23:42:18 +00:00
Lukas Toenne
6558a22b91 Fix for missing function stub when WITH_BULLET is disabled. 2013-01-23 14:55:41 +00:00
419ce840f9 rigidbody: Make rigid bodies kinematic during transformation
This allows moving rigid bodies on frame > startframe.
Also rigid bodies can now be picked up and trown around while the
simulation is running.

Note: There is a small glitch with cancelling tansform during simulation
but it's tricky to get rid of.

TODO: Avoid static-static collision warnings
2013-01-23 12:06:18 +00:00
69ddc5eb99 make bullet optional again 2013-01-23 07:26:39 +00:00
c48238fac6 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!
2013-01-23 05:57:01 +00:00
47c96081d0 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).
2013-01-23 05:56:56 +00:00
2d8637946b 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)
2013-01-23 05:56:44 +00:00
089cf12435 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.
2013-01-23 05:56:34 +00:00
fc377c17e3 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)
2013-01-23 05:56:27 +00:00
27601aaf01 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)
2013-01-23 05:56:22 +00:00