Commit graph

350 commits

Author SHA1 Message Date
PouleyKetchoupp cc39dca9f7 Rename Godot Physics classes from *SW to Godot*
Also moved MT physics server wrappers to the main servers folder, since
they don't have to be implementation specific.
2021-10-18 17:01:10 -07:00
Rémi Verschelde 7722048ed0
Merge pull request #53354 from reduz/remove-clipped-camera 2021-10-04 17:19:15 +02:00
reduz b11bb595d1 Remove ClippedCamera3D
* Usage was always confusing for users
* The ability to generate a pyramid shape was moved to Camera3D
* SpringArm3D now casts using the camera pyramid shape if no shape is supplied.
2021-10-04 10:46:49 -03:00
K. S. Ernest (iFire) Lee 1463fc889b GLTF for game templates.
Convert GLTF Document to use ImporterMeshInstance3D.

Add a GLTFDocument extension list and an extension for converting the importer mesh instance 3d to mesh instance 3d.

Use GLTF module when the editor tools are disabled.

Modified the render server to be less restrictive on matching blend arrays and have more logging.

Misc bugs with multimesh.

Always index the meshes.
2021-10-03 12:37:52 -07:00
PouleyKetchoupp 39f6ca96a3 Rename Joint2D and Joint3D files for consistency
Now matches the class names to be consistent between 2D and 3D and with
other node types.
2021-10-01 12:00:32 -07:00
Wilson E. Alvarez f3a564f9a5
Rename Listener2D/Listener3D to AudioListener2D/AudioListener3D 2021-09-16 17:51:51 -04:00
Camille Mohr-Daurat 3581b893ed
Merge pull request #52681 from nekomatata/rename-rigid-body
Rename RigidBody to RigidDynamicBody and SoftBody to SoftDynamicBody
2021-09-16 11:20:21 -07:00
PouleyKetchoupp 85819b199a Rename RigidBody to RigidDynamicBody and SoftBody to SoftDynamicBody 2021-09-16 09:55:20 -07:00
Camille Mohr-Daurat 1852afb6b0
Merge pull request #52679 from nekomatata/world-boundary-shape
Rename WorldMarginShape to WorldBoundaryShape
2021-09-15 16:02:40 -07:00
PouleyKetchoupp bb75aec8bc Rename WorldMarginShape to WorldBoundaryShape 2021-09-14 11:16:31 -07:00
Juan Linietsky d0a7eeaaff
Merge pull request #44844 from KoBeWi/hey_listen!_but_2d
Add Listener2D
2021-09-09 19:19:10 -03:00
PouleyKetchoupp 83baecdff0 Add AnimatableBody inherited from StaticBody for moving platforms
Instead of having a physics node named Static that can be either Static
or Kinematic, AnimatableBody is added again as a separate node:
-Inherited from StaticBody to make its usage clearer
-Still separated from CharacterBody to make its usage more focused

Properly implemented constant velocity for kinematic bodies in godot
physics servers (induced velocity without actually moving).

Also updated description for the different physics nodes to make their
usage clearer.
2021-08-31 18:14:32 -07:00
kobewi f2cb0a8d4b Add Listener2D 2021-08-31 16:53:14 +02:00
K. S. Ernest (iFire) Lee 90a35dac48
Merge pull request #51908 from bruvzg/msdf_fonts2
Make FontData importable resource. Add multi-channel SDF font rendering.
2021-08-27 08:51:37 -07:00
bruvzg 4c3f7d1290 Makes FontData importable resource.
Adds multi-channel SDF font texture generation and rendering support.
Adds per-font oversampling support.
Adds FontData import plugins (for dynamic fonts, BMFonts and monospaced image fonts), font texture cache pre-generation and loading.
Adds BMFont binary format and outline support.
2021-08-27 15:43:18 +03:00
PouleyKetchoupp 3d5dc80348 Rename RayShape to SeparationRayShape
Makes it clearer that it's used for special cases when picking a
collision shape.
2021-08-24 17:34:55 -07:00
PouleyKetchoupp 45c7af9862 Restore RayShape as a regular shape type
Partial revert from previously removing ray shapes completely, added
back as a shape type but without the specific character controller code.
2021-08-24 16:03:05 -07:00
reduz 5cecdfa8af Entirely removes BIND_VMETHOD in favor of GDVIRTUAL
* `_gui_input`, `_input`, `_unhandled_input` and `_unhandled_key_input` are now regular C++ virutal functions.
* Everything else converted to GDVIRTUAL
* BIND_VMETHOD is gone, always use the new syntax from now on.

Creating `_gui_input` method and using the binder to register events will no longer work, simply override the virtual function now.
2021-08-23 08:10:13 -03:00
Paulb23 c13c738c88 Hide TextFile from the API 2021-08-18 17:56:23 +01:00
TwistedTwigleg 5ffed49907 New and improved IK system for Skeleton3D
This PR and commit adds a new IK system for 3D with the Skeleton3D node
that adds several new IK solvers, as well as additional changes and functionality
for making bone manipulation in Godot easier.

This work was sponsored by GSoC 2020 and TwistedTwigleg

Full list of changes:
* Adds a SkeletonModification3D resource
  * This resource is the base where all IK code is written and executed
* Adds a SkeletonModificationStack3D resource
  * This node oversees the execution of the modifications and acts as a bridge of sorts for the modifications to the Skeleton3D node
* Adds SkeletonModification3D resources for LookAt, CCDIK, FABRIK, Jiggle, and TwoBoneIK
  * Each modification is in it's own file
* Several changes to Skeletons, listed below:
  * Added local_pose_override, which acts just like global_pose_override but keeps bone-child relationships intract
    * So if you move a bone using local_pose_override, all of the bones that are children will also be moved. This is different than global_pose_override, which only affects the individual bone
  * Internally bones keep track of their children. This removes the need of a processing list, makes it possible to update just a few select bones at a time, and makes it easier to traverse down the bone chain
  * Additional functions added for converting from world transform to global poses, global poses to local poses, and all the same changes but backwards (local to global, global to world). This makes it much easier to work with bone transforms without needing to think too much about how to convert them.
  * New signal added, bone_pose_changed, that can be used to tell if a specific bone changed its transform. Needed for BoneAttachment3D
  * Added functions for getting the forward position of a bone
* BoneAttachment3D node refactored heavily
  * BoneAttachment3D node is now completely standalone in its functionality.
    * This makes the code easier and less interconnected, as well as allowing them to function properly without being direct children of Skeleton3D nodes
  * BoneAttachment3D now can be set either using the index or the bone name.
  * BoneAttachment3D nodes can now set the bone transform instead of just following it. This is disabled by default for compatibility
  * BoneAttachment3D now shows a warning when not configured correctly
* Added rotate_to_align function in Basis
* Added class reference documentation for all changes
2021-08-14 15:57:00 -04:00
Hugo Locurcio 8e3f71d750
Rename LineShape2D to WorldMarginShape2D
The new name makes it more obvious that it acts as an infinite plane,
and is consistent with its 3D counterpart (WorldMarginShape3D).
2021-08-14 03:12:13 +02:00
Rémi Verschelde f0e420e981
Merge pull request #51519 from Chaosus/vs_transform_operator
Changed `TransformMult` node to `TransformOp` in visual shaders
2021-08-13 14:44:14 +02:00
PouleyKetchoupp 989acbbe81 Uniformize layer names, script methods and documentation
- Back to 1-based layer names to make it clearer in editor UI
- Layer bit accessors are renamed to layer value and 1-based too
- Uniform errors and documentation in render and physics
- Fix a few remaining collision_layer used in place of collision_mask
2021-08-12 08:06:42 -07:00
Yuri Roubinsky 9cf158019d Changed TransformMult node to TransformOp in visual shaders 2021-08-11 22:05:04 +03:00
PouleyKetchoupp 4da3a87f7d Remove infinite inertia and ray shapes from CharacterBody
Infinite inertia:
Not needed anymore, since it's now possible to set one-directional
collision layers in order for characters to ignore rigid bodies, while
rigid bodies still collide with characters.

Ray shapes:
They were introduced as a work around to allow constant speed on slopes,
which is now possible with the new property in CharacterBody instead.
2021-08-10 12:10:26 -07:00
PouleyKetchoupp 7a0c210f9b Refactor layer property editor grid
- Now able to display up to 32 layers in physics (still 20 for render)
- Adjustable grid size to fit available space in dock
- Expansion icon to display more layers vertically
- Layer numbers in cells to help with selection
2021-07-30 11:19:50 -07:00
K. S. Ernest (iFire) Lee 2fa4b59f99
Merge pull request #50355 from Calinou/immediategeometry3d-remove-remains
Remove the remains of ImmediateGeometry3D
2021-07-27 00:54:23 -07:00
reduz 67e5715dbf Make Sky initialize shaders only once
* Create the shader on demand.
* Makes sure compilation happens only once, then shader is cached.
* Speeds up scene loading times.
* Speeds up editor initialization.
2021-07-21 09:23:51 -03:00
Rémi Verschelde 536825d004
Rename Curve3Texture to CurveXYZTexture
Neither name is a perfect match but `Curve3Texture` looked too similar to
`CurveTexture` and `Curve3D`, which made things confusing when picking a
texture type or browsing the API reference.
2021-07-14 00:30:58 +02:00
reduz 5ad4f26659 Implement the ability to disable classes
* This PR adds the ability to disable classes when building.
* For now it's only possible to do this via command like:
  `scons disable_classes=RayCast2D,Area3D`
* Eventually, a proper UI will be implemented to create a build config file to do this at large scale, as well as detect what is used in the project.
2021-07-13 09:25:14 -03:00
Yuri Roubinsky 9d4afa8b75
Merge pull request #50149 from Chaosus/vs_curve3d 2021-07-11 12:36:56 +03:00
Hugo Locurcio 161214d374
Remove the remains of ImmediateGeometry3D
ImmediateGeometry3D was recently removed in favor of the ImmediateMesh
resource.
2021-07-11 00:42:44 +02:00
PouleyKetchoupp ccac36a6e2 Remove unused PhysicsShapeQueryResult3D & PhysicsShapeQueryResult2D 2021-07-05 11:16:11 -07:00
Yuri Roubinsky 4cf2f79892 Added Curve3Texture to Visual Shaders 2021-07-04 12:21:19 +03:00
reduz d6893cb2e8 Implement Curve3Texture
* This was required by users in some scenarios, such as animating individual axes over time with a single texture.
* Examples: Shaders, Particles, etc.
* CurveTexture now defaults to RGB, can be changed to Red if needed, this allows to freely exchange them.
2021-07-03 12:11:01 -03:00
reduz 85cf99f28e Deprecate ImmediateGeometry
* Removed entirely from RenderingServer.
* Replaced by ImmediateMesh resource.
* ImmediateMesh replaces ImmediateGeometry, but could use more optimization in the future.
* Sprite3D and AnimatedSprite3D work again, ported from Godot 3.x (though a lot of work was needed to adapt them to Godot 4).
* RootMotionView works again.
* Polygon3D editor works again.
2021-06-30 14:14:41 -03:00
reduz b1d15c51bc Implement native extension system
* Deprecates GDNative in favor of a simpler, lower level interface.
* New extension system allows registering core engine classes.
* Simple header interface in gdnative_interace.h
2021-06-25 17:32:45 -03:00
Lightning_A e28fd07b2b Rename instance()->instantiate() when it's a verb 2021-06-19 20:49:18 -06:00
Rémi Verschelde 9c182b0f45
Merge pull request #41794 from KoBeWi/shiny_new_tweens 2021-06-20 00:35:28 +02:00
Tomasz Chabora 900b2e0fdc Complete rewrite of Tweens
* Tweens were changed from Node to RefCounted. New API is inspired by DOTween.
* Tweens are created and managed by SceneTree, similar to SceneTreeTimer, which makes them ultra cheap to use a lot.
* Animating with Tweens is done by creating sequences of Tweeners. You create them from code and they autostart by default (fire-and-forget).
* There are 4 Tweeners that cover the former Tween functionality: PropertyTweener, IntervalTweener, CallbackTweener and MethodTweener.
* The methods were simplified a lot. Long argument lists are replaced with chained calls on Tweens and Tweeners.
* Tweeners by default execute in sequence, so it's easy to create complex chained animations.
* You can bind a Tween to a node. Tween will be removed automatically when the bound node is freed.
2021-06-19 12:08:50 +02:00
reduz ab2456b740 Rename VisibilityNotifierXD to VisibleOnScreenNotifierXD
* Renames for 2D and 3D
* Class name was confusing, given both 2D and 3D have a "visible" property that is unrelated to actual on-screen visibility.
* New name makes it clear that this is about visibility on screen.
2021-06-16 22:01:39 -03:00
Yuri Roubinsky f632e36ae5 Continuation of work on visual particles system 2021-06-07 20:33:17 +03:00
Yuri Roubinsky b2d2822a39 Adds UVFunc for panning/scaling on UV's to VisualShader's. 2021-06-07 08:31:48 +03:00
Rémi Verschelde aa251c310a
Merge pull request #49325 from reduz/rename-gi-classes
Rename GI Classes
2021-06-06 09:50:06 +02:00
TwistedTwigleg 8aa3c2f091 New and improved IK system for Skeleton2D
This PR and commit adds a new IK system for 2D with the Skeleton2D node
that adds several new IK solvers, a way to control bones in a Skeleton2D
node similar to that in Skeleton3D. It also adds additional changes
and functionality.

This work was sponsored by GSoC 2020 and TwistedTwigleg.

Full list of changes:
* Adds a SkeletonModifier2D resource
  * This resource is the base where all IK code is written and executed
  * Has a function for clamping angles, since it is so commonly used
  * Modifiers are unique when duplicated so it works with instancing
* Adds a SkeletonModifierStack2D resource
  * This resource manages a series of SkeletonModification2Ds
  * This is what the Skeleton2D directly interfaces with to make IK possible
* Adds SkeletonModifier2D resources for LookAt, CCDIK, FABRIK, Jiggle, and TwoBoneIK
  * Each modification is in its own file
  * There is also a SkeletonModifier2D resource that acts as a stack for using multiple stacks together
* Adds a PhysicalBone2D node
  * Works similar to the PhysicalBone3D node, but uses a RigidBody2D node
* Changes to Skeleton2D listed below:
  * Skeleton2D now holds a single SkeletonModificationStack2D for IK
  * Skeleton2D now has a local_pose_override, which overrides the Bone2D position similar to how the overrides work in Skeleton3D
* Changes to Bone2D listed below:
  * The default_length property has been changed to length. Length is the length of the bone to its child bone node
  * New bone_angle property, which is the angle the bone has to its first child bone node
  * Bone2D caches its transform when not modified by IK for IK interpolation purposes
  * Bone2D draws its own editor gizmo, though this is stated to change in the future
* Changes to CanvasItemEditor listed below:
  * Bone2D gizmo drawing code removed
  * The 2D IK code is removed. Now Bone2D is the only bone system for 2D
* Transform2D now has a looking_at function for rotating to face a position
* Two new node notifications: NOTIFICATION_EDITOR_PRE_SAVE and NOTIFICATION_EDITOR_POST_SAVE
  * These notifications only are called in the editor right before and after saving a scene
  * Needed for not saving the IK position when executing IK in the editor
* Documentation for all the changes listed above.
2021-06-05 15:19:51 -04:00
reduz 32625145c8 Rename GI Classes
* GIProbe is now VoxelGI
* BakedLightmap is now LightmapGI

As godot adds more ways to provide GI (as an example, SDFGI in 4.0), the different techniques (which have different pros/cons) need to be properly named to avoid confusion.
2021-06-05 09:28:56 -03:00
andriyDev 9f4bf5ec80 Deleted YSort, moved its functionality directly into Node2D.
YSort now has a compatibility alias to Node2D.
Updated TileMap to use the existing Node2D y_sort_enabled property instead
of its own property.
Updated Node2D doc to include the new y_sort_enabled member.
Updated TileMap doc to remove its mention of cell_y_sort.
Deleted YSort doc.
2021-06-05 00:55:25 -07:00
PouleyKetchoupp ba13d23140 KinematicBody split between new CharacterBody and PhysicsBody
PhysicsBody now has methods move_and_collide/test_move and needed
properties for these methods: safe margin, locked axes (3D only).

Moved collision_exceptions from StaticBody to PhysicsBody for 3D
(same as 2D, and conforms to documentation).

RigidBody doesn't have test_motion method anymore, it's now redundant
with PhysicsBody.test_move.
2021-06-04 11:40:36 -07:00
Aaron Franke bbd49dec23
Disable Skeleton3D when compiling without 3D
Make animation code not depend on Skeleton3D or even Node3D
2021-06-04 08:33:50 -04:00
Yuri Roubinsky f06db8b778 Added Billboard Node to Visual Shaders 2021-05-28 09:24:06 +03:00