Age | Commit message (Collapse) | Author |
|
- mult_m4_m4m4 -> mul_m4_m4m4
- mult_m3_m3m4 -> mul_m3_m3m4
these temporary names were used to avoid problems when argument order was switched.
|
|
|
|
Now copying a scene will also duplicate groups that consist entirely of objects
that are duplicated with the scene. The rigid body world will then also pointers
to these new groups.
|
|
Since we use the rigid body transform when transforming rigid bodies
things like parents and constraints add an offset because rigid body
transforms are in global space.
Now we just don't take rigid body transform into account on simulation
start frame so there are no problems when doing the initial setup.
The problem still exists when simulation is running of course.
To properly fix this we'd have to solve parenting and constratins while
taking rigid bodies into account before and after transform.
We'll have to see if it's really needed, would like to avoid it though.
|
|
- remove unneeded checks (poll checks editor is non-null)
- use booleans
- rename operator SEQUENCER_OT_gap_remove, _gap_insert
also quiet shadow warning in rigidbody.c (shadowing 'loc')
|
|
also correct odd indentation.
|
|
mingw.
also compiling without bullet needed a stub added.
|
|
Instead of flagging the rigid body world for frame update just call
BKE_rigidbody_do_simulation() recursively for all scenes.
This avoids having to constantly check if the simulation needs to be
updated.
|
|
The rigid body world could be rebuilt on start frame and one frame after
start frame. The latter was necessary sice animation playback usually
doesn't start at start frame.
This lead to different simulations depending on which frame the
simulaton was rebuilt when animation was involved.
Now we only rebuild the world on start frame.
This is actually tricky to do since, as mentioned above, animation
playback starts on second frame. To work around this we rebuild the
world before the actual update.
The alternative would be to rebuld the world on every simulation change
(like the other simulations do it) but this is an expensive operation
and would be too slow.
|
|
While it's not a good idea to create convex hull shapes from objects
with no volume, this makes them behave a little nicer.
Fixes [#34410] Planes with Rigid Body always keep distance to colliding objects
|
|
It's implemented as a separate constraint instead of adding properties
to the existing constraints.
Motors only apply linear and angular impulses and don't limit the
movement of rigid bodies, so it's best to use them in conjunction with
other constraints to limit the degrees of freedom.
Thanks to Markus Kasten (markus111) for the initial patch.
|
|
This is a pretty rare case that can be triggered by switching rigid body
and constraint groups before simulation was validated.
Code checked for existing physics objects but was missing else block.
|
|
In rare cases this would allow the simulation to run before being
initialized (if cache is baked and reading cache fails after undo or
loading a file).
|
|
BKE_object_where_is_calc_time_ex() so extra arg is at the end (loose convention for *_ex() funcs). also some style cleanup.
|
|
Since rigid bodies need their world to be be updated correctly we now
pass it alongside the parent scene in scene_update_tagged_recursive().
Add BKE_object_handle_update_ex() as well as other object functions
that take a RigidBodyWorld for this.
Ideally this shouldn't be needed but we'd have to restructure scene
handling for that. It's not a small taks however and definitely not
something that can be done before release.
Thanks to Campbell for review.
|
|
Now we flag the world for update on frame change and only call
BKE_rigidbody_do_simulation() when needed.
|
|
This was caused by multiple instantiations of the same basic problem. The
rigidbody handling code often assumed that "scene" pointers referred to the
scene where an object participating in the sim resided (and where the rigidbody
world for that sim lived). However, when dealing with background sets, "scene"
often only refers to the active scene, and not the set that the object actually
came from. Hence, the rigidbody code would often (wrongly) conclude that there
was nothing to do.
For example, we may have the following backgound set/scene chaining scenario:
"active" <-- ... <-- set i (rigidbody objects live here) <-- ... <-- set n
The fix here is a multi-part fix:
1) Moved sim-world calculation from BKE_scene_update_newframe() to
scene_update_tagged_recursive()
+ This is currently the only way that rigidbody sims in background sets will
get calculated, as part of the recursion
- These checks will get run on each update. <--- FIXME!!!
2) Tweaked depsgraph code so that when checking if there are any time-dependent
features on objects to tag for updating, the checking is done relative to the
scene that the object actually resides in (and not the active scene). Otherwise,
even if we recalculate the sim, the affected objects won't get tagged for
updating. This tagging is needed to actually flush the transforms out of the
RigidBodyObject structs (written by the sim/cache) and into the Object
transforms (obmat's)
3) Removed the requirement for rigidbody world to actually exist before we can
flush rigidbody transforms. In many cases, it should be sufficient to assume
that because the object with rigidbody data attached has been tagged for
updates, it should have updates to perform. Of course, we still check on this
data if we've got it, but that's only if the sim is in the active scene.
- TODO: if we have further problems, we should investigate passing the
"actual" scene down alongside the "active" scene for BKE_object_handle_update().
|
|
This will preserve constraint <-> rigid body realationships so
constraint setups aren't broken after duplication.
Based on a patch by Brandon Hechinger (jaggz), thanks.
|
|
|
|
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".
|
|
Fall back to using box shape in case creating shape from mesh fails.
|
|
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.
|
|
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.
|
|
|
|
|
|
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
|
|
|
|
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!
|
|
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).
|
|
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)
|
|
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.
|
|
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)
|
|
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)
|