summaryrefslogtreecommitdiff
path: root/scene/3d/physics_body.cpp
AgeCommit message (Collapse)Author
2020-03-05Add a new configuration warning to CollisionShapePierre Caye
In the case where a ConcavePolygonShape is used as a shape for a RigidBody in another mode than static, a configuration warning will appear in the editor.
2020-02-28Signals: Manually port most of remaining connect_compat usesRémi Verschelde
It's tedious work... Some can't be ported as they depend on private or protected methods of different classes, which is not supported by callable_mp (even if it's a class inherited by the current one).
2020-02-25Variant: Added 64-bit packed arrays, renamed Variant::REAL to FLOAT.Juan Linietsky
- Renames PackedIntArray to PackedInt32Array. - Renames PackedFloatArray to PackedFloat32Array. - Adds PackedInt64Array and PackedFloat64Array. - Renames Variant::REAL to Variant::FLOAT for consistency. Packed arrays are for storing large amount of data and creating stuff like meshes, buffers. textures, etc. Forcing them to be 64 is a huge waste of memory. That said, many users requested the ability to have 64 bits packed arrays for their games, so this is just an optional added type. For Variant, the float datatype is always 64 bits, and exposed as `float`. We still have `real_t` which is the datatype that can change from 32 to 64 bits depending on a compile flag (not entirely working right now, but that's the idea). It affects math related datatypes and code only. Neither Variant nor PackedArray make use of real_t, which is only intended for math precision, so the term is removed from there to keep only float.
2020-02-21Added StringName as a variant type.Juan Linietsky
Also changed all relevant properties defined manually to StringName.
2020-02-20Reworked signal connection system, added support for Callable and Signal ↵Juan Linietsky
objects and made them default.
2020-02-12Merge pull request #36145 from akien-mga/remove-deprecated-friction-bounceRémi Verschelde
Remove deprecated PhysicsBody friction and bounce parameters
2020-02-12ObjectID converted to a structure, fixes many bugs where used incorrectly as ↵Juan Linietsky
32 bits.
2020-02-12Remove deprecated PhysicsBody friction and bounce parametersRémi Verschelde
They were replaced in 3.1 by PhysicsMaterial properties via #12403.
2020-02-10- Integrated NavigationServer and Navigation2DServer.Andrea Catania
- Added Navigation Agents and Obstacles. - Integrated Collision Avoidance. This work has been kindly sponsored by IMVU.
2020-02-08Added feature to move physical bones with skeleton when not simulating physicsAndrea Catania
2020-01-15Fixes get_floor_normal() returning the user defined floor_normal.Marcel Admiraal
When there is no collision with a floor the get_floor_normal() function should return the zero vector to be consistent with get_floor_velocity(). Renames floor_normal to up_direction in all bindings. Updates the documentation of get_floor_normal() and get_floor_velocity() to make it clear when the values are valid. Updates the documentation for move_and_slide() and move_and_slide_with_snap() to use the new up_direction parameter name.
2020-01-10Added function to expose floor normal, useful to correctly calculate player ↵Andrea Catania
velocity. This work has been kindly sponsored by IMVU.
2020-01-05Don't update the floor_velocity with the current linear_velocity.Marcel Admiraal
Updating the floor velocity with the body's current linear velocity discards the velocity component provided by the body's angular rotation. Without the current contact point there is no way to calculate the current velocity component provided by the body's angular rotation therefore we need to use the velocity calculated at the time of the collision. Fixes #34807.
2020-01-01Update copyright statements to 2020Rémi Verschelde
Happy new year to the wonderful Godot community! We're starting a new decade with a well-established, non-profit, free and open source game engine, and tons of further improvements in the pipeline from hundreds of contributors. Godot will keep getting better, and we're looking forward to all the games that the community will keep developing and releasing with it.
2019-12-21Add a range property hint for the number of contacts reportedHugo Locurcio
This closes #34505.
2019-12-12Added apply_central_impulse to PhysicalBone classVitalii Shmorhun
2019-12-02Ensure move_and_slide() is consistent between the 2D and 3D versions.Marcel Admiraal
In the 3D version: - Partially revert #20908 that was reverted in the 2D version as part of #21653. This ensures that the Vector returned is always perpendicular to the surface collided with; and not the floor_normal Vector passed to the function when on a floor. - Include an update of the floor velocity before multiplying by the time delta, which was added to the 2D version as part of commit 13a8014. In the 2D version: - Use the Vector2.slide() function instead of Vector2.tangent() to adjust the amount of motion the stop_on_slope undoes to ensure that it is in the right direction. This is a implementation of the 3D approach from #30588. - Combine the !found_collision and motion == Vector2() checks for break. - Other minor formating changes to make the functions look identical. Also renamed some variables to align with their use.
2019-12-01Properly remove joint when a physical bone is removed from the scenePouleyKetchoupp
It was triggering a warning in bullet followed with a crash in some cases. WARNING: assert_no_constraints: A body with a joints is destroyed. Please check the implementation in order to destroy the joint before the body. At: modules/bullet/rigid_body_bullet.cpp:465
2019-11-07Merge pull request #30588 from Demiu/patch-1Rémi Verschelde
Fix 3D move_and_slide with stop_on_slope
2019-09-25Merge pull request #32051 from qarmin/some_error_explanationRémi Verschelde
Added some obvious errors explanations
2019-09-25Added some obvious errors explanationsqarmin
2019-09-23Merge pull request #32275 from godotengine/skin_supportRémi Verschelde
Added skin support and simplified APIs to override bone position + glTF 2.0 import fixes
2019-09-19Fix misc. source comment typosluz.paz
Found using `codespell -q 3 -S ./thirdparty,*.po -L ang,ba,cas,dof,doubleclick,fave,hist,leapyear,lod,nd,numer,ois,paket,seeked,sinc,switchs,te,uint -D ~/Projects/codespell/codespell_lib/data/dictionary.txt `
2019-09-18Added skin support and simplified APIs to override bone position.Juan Linietsky
2019-09-03Merge pull request #31476 from SoulForMachine/fix-move-and-slide-errorRémi Verschelde
Prevent move_and_slide() to generate an error.
2019-08-26Prevent move_and_slide() to generate an error.Milan Davidovic
When moving KinematicBody2D from one scene to another and not freeing the old scene, the first call to move_and_slide() in the new scene will generate an error because KinematicBody2D keeps internaly a RID on_floor_body of a body resource in the old scene which no more has a space assigned. To fix this, on_floor_body is set to empty RID in response to NOTIFICATION_ENTER_TREE notification of KinematicBody2D and KinematicBody. Also all other data related to move_and_slide() is reset: floor, ceiling, wall flags, colliders vector, floor_velocity. This fixes #31416.
2019-08-23Merge pull request #31014 from DavidSichma/kinematic_angleRémi Verschelde
Fix floor_max_angle comparison for impossible angles
2019-08-09Remove ERR_EXPLAIN from scene/* codeTomasz Chabora
2019-08-01Fix floor_max_angle comparison for impossible anglesDavid Sichma
2019-07-31Tweak Area and PhysicsBody damping setting hints for consistencyHugo Locurcio
This partially addresses #19182.
2019-07-15Change p_stop_on_slope in 3D move_and_slide_with_snapDemiu
2019-07-15Fix KinematicBody::move_and_slideDemiu
2019-07-09Improve the node configuration warning displayHugo Locurcio
- Refer to properties explicitly when possible - When multiple warnings are returned, always separate them by one blank line to make them easier to distinguish - Improve grammar and formatting
2019-06-27Add default values to the editor help, docs, and generated RSTBojidar Marinov
Also, make spacing of "=" in the editor help a bit more consistent. Closes #16086
2019-06-11Fix error macro calls not ending with semicolonRémi Verschelde
It's not necessary, but the vast majority of calls of error macros do have an ending semicolon, so it's best to be consistent. Most WARN_DEPRECATED calls did *not* have a semicolon, but there's no reason for them to be treated differently.
2019-05-02Merge pull request #27415 from aqnuep/kinematicbody_fixesRémi Verschelde
KinematicBody performance and quality improvements
2019-04-08Small fixes, mostly dupicated codeqarmin
2019-03-27KinematicBody performance and quality improvementsDaniel Rakos
With this change finally one can use compound collisions (like those created by Gridmaps) without serious performance issues. The previous KinematicBody code for Bullet was practically doing a whole bunch of unnecessary calculations. Gridmaps with fairly large octant sizes (in my case 32) can get up to 10000x speedup with this change (literally!). I expect the FPS demo to get a fair speedup as well. List of fixes and improvements: - Fixed a general bug in move_and_slide that affects both GodotPhysics and Bullet, where ray shapes would be ignored unless the stop_on_slope parameter is disabled. Not sure where that came from, but looking at the 2D physics code it was obvious there's a difference. - Enabled the dynamic AABB tree that Bullet uses to allow broadphase collision tests against individual shapes of compound shapes. This is crucial to get good performance with Gridmaps and in general improves the performance whenever a KinematicBody collides with compound collision shapes. - Added code to the broadphase collision detection code used by the Bullet module for KinematicBodies to also do broadphase on the sub-shapes of compound collision shapes. This is possible thanks to the dynamic AABB tree that was previously disabled and it's the change that provides the biggest performance boost. - Now broadphase test is only done once per KinematicBody in Bullet instead of once per each of its shapes which was completely unnecessary. - Fixed the way how the ray separation results are populated in Bullet which was completely broken previously, overwriting previous results and similar non-sense. - Fixed ray shapes for good now. Previously the margin set in the editor was not respected at all, and the KinematicBody code for ray separation was complete bogus, thus all previous attempts to fix it were mislead. - Fixed an obvious bug also in GodotPhysics where an out-of-bounds index was used in the ray result array. There are a whole set of other problems with the KinematicBody code of Bullet which cost performance and may cause unexpected behavior, but those are not addressed in this change (need to keep it "simple"). Not sure whether this fixes any outstanding Github issues but I wouldn't be surprised.
2019-03-03Fixed missing exclude raycast shapes arguments in snap, closes #25230Juan Linietsky
2019-02-23Ensure move and slide snap respects stop on slope, fixes #26180Juan Linietsky
2019-02-16Change snapping to only happen when the floor normal remains as floor, fixes ↵Juan Linietsky
#22312
2019-02-16Add a minimum treshold for acquiring rest contacts to avoid numerical ↵Juan Linietsky
precision issues. Fixes #25074
2019-02-16Make sure stop on slope can have a tiny bit of precision edge.Juan Linietsky
2019-01-24Fix PhysicsBody ignoring set_friction/bounce with default valueRémi Verschelde
The intent was to avoid creating a physics override to set a default value that doesn't make a difference, but as #22406 shows it can be necessary to set the default value *back* after an override was created to set a non-default value. Fixes #22406.
2019-01-01Update copyright statements to 2019Rémi Verschelde
Happy new year to the wonderful Godot community!
2018-11-22Fix 6DOF Physical Bone jointIvan Varesi
Adding angular and linear springs param to PhysicalBone joint type JOINT_TYPE_6DOF, using new 6DOF feautres implemented in sdfgeoff/godot@e149327. Typo correction lenear_equilibrium_point to linear_equilibrium_point.
2018-11-12Merge pull request #17530 from bojidar-bg/17516-detect-deltaRémi Verschelde
Make it possible to call move_and_slide from _process, even if it is not recommended
2018-11-12Merge pull request #23090 from DavidSichma/inconsistent-kinematicRémi Verschelde
Consistency in KinematicBody
2018-11-08Make it possible to call move_and_slide from _process, even if it is not ↵Bojidar Marinov
recommended Previously, it would reuse the _physics_process delta, causing it to move faster on faster framerates Fixes #17516
2018-11-08-Moved EditorDefaultValue to ClassDB, made it coreJuan Linietsky
-Removed one and zero hints for properties, replaced by default value