Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2014-10-29Cleanup: warnings, typosCampbell Barton
2014-07-19Defines: replace ELEM3-16 with ELEM(...), that can take varargsCampbell Barton
2014-07-18Code cleanupCampbell Barton
2014-07-17Cleanup: dead codeCampbell Barton
2014-07-16Clean up of dead code.Bastien Montagne
dm can’t be NULL here (found by Coverity).
2014-07-11Fix T41019: Calculate Mass does not calculate actual volume.Lukas Tönne
This was a ToDo item, for mesh-based rigid body shapes (trimesh, convex) the operator was simply using the bounding box volume, which can grossly overestimate the volume and mass. Calculating the actual volume of a mesh is not so difficult after all, see e.g. http://research.microsoft.com/en-us/um/people/chazhang/publications/icip01_ChaZhang.pdf This patch also allows calculating the center-of-mass in the same way. This is currently unused, because the rigid body system assumes the CoM to be the same as the geometric object center. This is fine most of the time, adding such user settings for "center-of-mass offset" would also add quite a bit of complexity in user space, but it could be necessary at some point. A number of other physical properties could be calculated using the same principle, e.g. the moment of inertia.
2014-05-29Cleanup: Use doxy for more structured commentsCampbell Barton
2014-05-14Dirty fix for memory corruption in the rigid body API.Lukas Tönne
Problem happens when removing a rigid body reference in a constraint, and then jumping to the start frame right away. This will cause a full rebuild of the rigid body world. However, the btRigidBodys are removed before the constraints, and this leaves dangling pointers in the btTypedConstraints, which causes corruption when deleting those constraints later. Fix for now is to explicitly delete constraints in advance when rebuilding, while they still have valid btRigidBody pointers. Ultimately the whole memory management and ownership of Bullet data needs redesign. This is already happening in the particles_refactor branch and could be ported to master separately: https://developer.blender.org/diffusion/B/browse/particles_refactor/source/blender/blenkernel/intern/rigidbody.c
2014-05-12Fix crash removing objects rigid body constraintsCampbell Barton
2014-04-30Code cleanup: remove unused includesCampbell Barton
Opted to keep includes if they are used indirectly (even if removing is possible).
2014-04-01Code cleanup: remove TRUE/FALSE & WITH_BOOL_COMPAT defineCampbell Barton
2014-02-14Fix for crash caused by effectors doing precalculation //during// DAGLukas Tönne
updates. This file crashes on loading with NULL pointer access to curve_cache: {F77132} The pdInitEffectors function was amalgamating the simple collection of effector objects with an automatic precalculation for curve guides and the like. This precalculation requires object data that may not be available until the DAG has finished. Since for DAG dependencies only the list of effectors is required, added an argument to disable precalculation when collecting effectors.
2014-01-29Fix T38388: Creating a new scene with full copy sets rigidbody collision ↵Sergej Reich
shapes to box. Tweak world rebuilding logic, so it's not done before object data was updated.
2014-01-04Rigidbody: Code cleanupSergej Reich
Convert int to bool.
2013-12-30Code Cleanup: unused defines & styleCampbell Barton
2013-12-27Rigidbody: Code cleanupSergej Reich
Make some functions private. Remove unneeded nested if statements. Avoid mixing short and bool.
2013-12-26Rigidbody: Allow triangle mesh shapes to deform during simulationSergej Reich
Only supported when using the "Deform" mesh source.
2013-12-26Rigidbody: Use own structure to store mesh data for collision shapesSergej Reich
This gives us better access to the data and should also be faster to create.
2013-12-26Rigidbody: Add option to choose mesh source for collision shapesSergej Reich
The options are: Base: Base mesh Deform: shape keys and deform modifiers Final: All deformations and modifiers It would be nice to have a way of specifying where exactly in the modifier stack the collision shape is generated. However this is not staight forward since the rigid body simulation is not part of the modifier system and would require hacks to make it work.
2013-12-26Code Cleanup: remove object arg to CDDM_from_mesh mesh_create_derivedCampbell Barton
2013-10-31code cleanup: spellingCampbell Barton
2013-09-29Fix [#36847] If Force Field in Ridgid Body group, crash at first frame of ↵Bastien Montagne
animation on playback Not all objects in RB group actually have a "rigid body object", needs to be checked.
2013-07-21Fixes for recent Wlimit stuff, which makes strict gcc freak outSergey Sharybin
2013-07-21code cleanup: add break statements in switch ()'s, (even at the last case).Campbell Barton
2013-07-04rigidbody: Code clenupSergej Reich
Remove duplicate null check.
2013-07-04rigidbody: Remove constraint when removing one of it's objectsSergej Reich
This is not the nicest behaviour but trying to keep both bullet and blender side objects in sync breaks in this case. There might be a better soluion but this avoids crashes for now. Fixes: [#35995] Delete crash on specific scene (Physics)
2013-05-26BLI_math rename functions:Campbell Barton
- 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.
2013-04-25style cleanupCampbell Barton
2013-04-25Fix #34806: rigid body world settings were not copied with a full scene copy.Brecht Van Lommel
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.
2013-04-07rigidbody: Fix/workaround for transforming rigid bodies with parentsSergej Reich
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.
2013-03-27sequencer gapsCampbell Barton
- 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')
2013-03-15code cleanup: rename BKE_mesh_to_curve_ex --> BKE_mesh_to_curve_nurblist,Campbell Barton
also correct odd indentation.
2013-03-04code cleanup: unused vars in collada, preprocessor formatting & warning in ↵Campbell Barton
mingw. also compiling without bullet needed a stub added.
2013-03-03rigidbody: Revert to running simulation on frame updateSergej Reich
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.
2013-03-03rigidbody: Fix inconsistency with world rebuildingSergej Reich
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.
2013-02-25rigidbody: Don't embed collision margin if object has no volumeSergej Reich
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
2013-02-24rigidbody: Add motor constraintSergej Reich
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.
2013-02-20rigidbody: Properly handle constrained objects not having rigid bodiesSergej Reich
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.
2013-02-20rigidbody: Don't run simulation if cache is bakedSergej Reich
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).
2013-02-17code cleanup: change order of args in void ↵Campbell Barton
BKE_object_where_is_calc_time_ex() so extra arg is at the end (loose convention for *_ex() funcs). also some style cleanup.
2013-02-16rigidbody: Further fix for background scenesSergej Reich
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.
2013-02-16rigidbody: Avoid unnecessary simulation updatesSergej Reich
Now we flag the world for update on frame change and only call BKE_rigidbody_do_simulation() when needed.
2013-02-15Bugfix [#33970] Background Scene does not show animation of rigid body objectsJoshua Leung
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().
2013-02-09rigidbody: Relink constraints when duplicating objectsSergej Reich
This will preserve constraint <-> rigid body realationships so constraint setups aren't broken after duplication. Based on a patch by Brandon Hechinger (jaggz), thanks.
2013-02-06style cleanup: some warnigs & spelling.Campbell Barton
2013-02-05rigidbody: Avoid always making passive objects kinematicSergej Reich
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-05rigidbody: Fix [#34108] Rigid body with no polygons crashes blenderSergej Reich
Fall back to using box shape in case creating shape from mesh fails.
2013-02-05rigidbody: Fix [#34106] Deleting an object with Bullet Constraint crashes ↵Sergej Reich
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-01-24rigidbody: Fix [#33971] Bullet Physics crash + patchSergej Reich
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-24style cleanupCampbell Barton