From b4ce7de1914ac79475f717865404554413f2eac8 Mon Sep 17 00:00:00 2001 From: Pierre-Thomas Meisels Date: Tue, 7 Nov 2023 19:39:52 +0100 Subject: [PATCH 1/4] enh(api-gen): generate kdoc from api json --- .../codegen/constants/JvmReservedMethods.kt | 3 +- .../kotlin/godot/codegen/generationEntry.kt | 5 +- .../godot/codegen/models/BuiltinClass.kt | 3 +- .../main/kotlin/godot/codegen/models/Class.kt | 6 +- .../kotlin/godot/codegen/models/Constant.kt | 3 +- .../godot/codegen/models/Constructor.kt | 3 +- .../kotlin/godot/codegen/models/EnumValue.kt | 6 +- .../kotlin/godot/codegen/models/Member.kt | 3 +- .../kotlin/godot/codegen/models/Method.kt | 3 +- .../kotlin/godot/codegen/models/Operator.kt | 4 +- .../kotlin/godot/codegen/models/Property.kt | 3 +- .../kotlin/godot/codegen/models/Signal.kt | 3 +- .../godot/codegen/models/UtilityFunction.kt | 4 +- .../codegen/models/enriched/EnrichedClass.kt | 4 +- .../models/enriched/EnrichedConstant.kt | 4 +- .../codegen/models/enriched/EnrichedMethod.kt | 4 +- .../models/enriched/EnrichedProperty.kt | 4 +- .../codegen/models/enriched/EnrichedSignal.kt | 4 +- .../codegen/repositories/IDocRepository.kt | 7 - .../repositories/impl/DocRepository.kt | 8 - .../codegen/services/impl/ClassService.kt | 3 +- .../services/impl/GenerationService.kt | 62 +- .../godot/codegen/traits/IDocumented.kt | 104 +++ .../src/main/kotlin/godot/docgen/DocGen.kt | 124 ---- .../main/kotlin/godot/docgen/docClasses.kt | 33 - .../main/kotlin/godot/docgen/rawXmlPojos.kt | 341 --------- .../main/kotlin/godot/gen/godot/AESContext.kt | 109 +-- .../main/kotlin/godot/gen/godot/AStar2D.kt | 239 +++---- .../main/kotlin/godot/gen/godot/AStar3D.kt | 303 +++----- .../kotlin/godot/gen/godot/AcceptDialog.kt | 48 +- .../godot/gen/godot/AnimatableBody2D.kt | 15 +- .../godot/gen/godot/AnimatableBody3D.kt | 18 +- .../godot/gen/godot/AnimatedSprite2D.kt | 82 +-- .../godot/gen/godot/AnimatedSprite3D.kt | 83 +-- .../kotlin/godot/gen/godot/AnimatedTexture.kt | 55 +- .../godot/gen/godot/AnimationLibrary.kt | 33 +- .../kotlin/godot/gen/godot/AnimationMixer.kt | 338 ++++----- .../godot/gen/godot/AnimationNodeAdd2.kt | 16 +- .../godot/gen/godot/AnimationNodeAdd3.kt | 16 +- .../godot/gen/godot/AnimationNodeAnimation.kt | 11 +- .../godot/gen/godot/AnimationNodeBlend2.kt | 12 +- .../godot/gen/godot/AnimationNodeBlend3.kt | 16 +- .../gen/godot/AnimationNodeBlendSpace1D.kt | 35 +- .../gen/godot/AnimationNodeBlendSpace2D.kt | 55 +- .../godot/gen/godot/AnimationNodeBlendTree.kt | 24 +- .../godot/gen/godot/AnimationNodeOneShot.kt | 99 +-- .../godot/gen/godot/AnimationNodeOutput.kt | 7 +- .../AnimationNodeStateMachinePlayback.kt | 57 +- .../AnimationNodeStateMachineTransition.kt | 63 +- .../godot/gen/godot/AnimationNodeSub2.kt | 22 +- .../godot/gen/godot/AnimationNodeSync.kt | 9 +- .../godot/gen/godot/AnimationNodeTimeSeek.kt | 46 +- .../gen/godot/AnimationNodeTransition.kt | 69 +- .../kotlin/godot/gen/godot/AnimationPlayer.kt | 140 ++-- .../godot/gen/godot/AnimationRootNode.kt | 17 +- .../kotlin/godot/gen/godot/AnimationTree.kt | 29 +- .../src/main/kotlin/godot/gen/godot/Area2D.kt | 202 +++--- .../src/main/kotlin/godot/gen/godot/Area3D.kt | 215 +++--- .../main/kotlin/godot/gen/godot/ArrayMesh.kt | 146 ++-- .../kotlin/godot/gen/godot/ArrayOccluder3D.kt | 27 +- .../godot/gen/godot/AspectRatioContainer.kt | 23 +- .../kotlin/godot/gen/godot/AtlasTexture.kt | 27 +- .../kotlin/godot/gen/godot/AudioBusLayout.kt | 5 +- .../kotlin/godot/gen/godot/AudioEffect.kt | 8 - .../godot/gen/godot/AudioEffectAmplify.kt | 8 +- .../gen/godot/AudioEffectBandLimitFilter.kt | 8 +- .../gen/godot/AudioEffectBandPassFilter.kt | 8 +- .../godot/gen/godot/AudioEffectCapture.kt | 31 +- .../godot/gen/godot/AudioEffectChorus.kt | 44 +- .../godot/gen/godot/AudioEffectCompressor.kt | 35 +- .../godot/gen/godot/AudioEffectDelay.kt | 17 +- .../godot/gen/godot/AudioEffectDistortion.kt | 33 +- .../kotlin/godot/gen/godot/AudioEffectEQ.kt | 12 +- .../kotlin/godot/gen/godot/AudioEffectEQ10.kt | 20 +- .../kotlin/godot/gen/godot/AudioEffectEQ21.kt | 31 +- .../kotlin/godot/gen/godot/AudioEffectEQ6.kt | 16 +- .../godot/gen/godot/AudioEffectFilter.kt | 20 - .../gen/godot/AudioEffectHighPassFilter.kt | 8 +- .../gen/godot/AudioEffectHighShelfFilter.kt | 7 +- .../godot/gen/godot/AudioEffectInstance.kt | 6 - .../godot/gen/godot/AudioEffectLimiter.kt | 19 +- .../gen/godot/AudioEffectLowPassFilter.kt | 8 +- .../gen/godot/AudioEffectLowShelfFilter.kt | 7 +- .../godot/gen/godot/AudioEffectNotchFilter.kt | 8 +- .../godot/gen/godot/AudioEffectPanner.kt | 5 - .../godot/gen/godot/AudioEffectPhaser.kt | 19 +- .../godot/gen/godot/AudioEffectRecord.kt | 22 +- .../godot/gen/godot/AudioEffectReverb.kt | 23 +- .../gen/godot/AudioEffectSpectrumAnalyzer.kt | 37 +- .../AudioEffectSpectrumAnalyzerInstance.kt | 6 - .../gen/godot/AudioEffectStereoEnhance.kt | 15 +- .../kotlin/godot/gen/godot/AudioListener2D.kt | 20 +- .../kotlin/godot/gen/godot/AudioListener3D.kt | 12 +- .../kotlin/godot/gen/godot/AudioStreamMP3.kt | 34 + .../godot/gen/godot/AudioStreamMicrophone.kt | 14 +- .../godot/gen/godot/AudioStreamOggVorbis.kt | 24 + .../gen/godot/AudioStreamPlaybackOggVorbis.kt | 8 + .../godot/AudioStreamPlaybackPolyphonic.kt | 34 +- .../gen/godot/AudioStreamPlaybackResampled.kt | 9 - .../godot/gen/godot/AudioStreamPlayer.kt | 31 +- .../godot/gen/godot/AudioStreamPlayer2D.kt | 46 +- .../godot/gen/godot/AudioStreamPlayer3D.kt | 81 ++- .../godot/gen/godot/AudioStreamPolyphonic.kt | 12 +- .../godot/gen/godot/AudioStreamRandomizer.kt | 21 +- .../kotlin/godot/gen/godot/BackBufferCopy.kt | 24 +- .../main/kotlin/godot/gen/godot/BaseButton.kt | 57 +- .../src/main/kotlin/godot/gen/godot/BitMap.kt | 36 +- .../src/main/kotlin/godot/gen/godot/Bone2D.kt | 53 +- .../godot/gen/godot/BoneAttachment3D.kt | 26 +- .../main/kotlin/godot/gen/godot/BoneMap.kt | 30 +- .../kotlin/godot/gen/godot/BoxContainer.kt | 25 +- .../main/kotlin/godot/gen/godot/BoxMesh.kt | 14 +- .../kotlin/godot/gen/godot/BoxOccluder3D.kt | 10 +- .../main/kotlin/godot/gen/godot/BoxShape3D.kt | 12 +- .../src/main/kotlin/godot/gen/godot/Button.kt | 80 +-- .../kotlin/godot/gen/godot/ButtonGroup.kt | 14 +- .../kotlin/godot/gen/godot/CPUParticles2D.kt | 148 ++-- .../kotlin/godot/gen/godot/CPUParticles3D.kt | 164 +++-- .../main/kotlin/godot/gen/godot/CSGBox3D.kt | 15 + .../kotlin/godot/gen/godot/CSGCombiner3D.kt | 12 + .../kotlin/godot/gen/godot/CSGCylinder3D.kt | 27 + .../main/kotlin/godot/gen/godot/CSGMesh3D.kt | 22 + .../kotlin/godot/gen/godot/CSGPolygon3D.kt | 100 +++ .../kotlin/godot/gen/godot/CSGPrimitive3D.kt | 13 + .../main/kotlin/godot/gen/godot/CSGShape3D.kt | 78 ++ .../kotlin/godot/gen/godot/CSGSphere3D.kt | 23 + .../main/kotlin/godot/gen/godot/CSGTorus3D.kt | 26 + .../kotlin/godot/gen/godot/CallbackTweener.kt | 20 +- .../main/kotlin/godot/gen/godot/Camera2D.kt | 153 ++-- .../main/kotlin/godot/gen/godot/Camera3D.kt | 196 +++-- .../godot/gen/godot/CameraAttributes.kt | 27 +- .../main/kotlin/godot/gen/godot/CameraFeed.kt | 10 +- .../kotlin/godot/gen/godot/CameraServer.kt | 26 +- .../kotlin/godot/gen/godot/CameraTexture.kt | 12 +- .../kotlin/godot/gen/godot/CanvasGroup.kt | 58 +- .../godot/gen/godot/CanvasItemMaterial.kt | 32 +- .../kotlin/godot/gen/godot/CanvasLayer.kt | 56 +- .../kotlin/godot/gen/godot/CanvasModulate.kt | 5 +- .../kotlin/godot/gen/godot/CapsuleMesh.kt | 4 +- .../kotlin/godot/gen/godot/CapsuleShape2D.kt | 9 +- .../kotlin/godot/gen/godot/CapsuleShape3D.kt | 12 +- .../kotlin/godot/gen/godot/CenterContainer.kt | 10 +- .../kotlin/godot/gen/godot/CharFXTransform.kt | 62 +- .../kotlin/godot/gen/godot/CharacterBody2D.kt | 206 ++++-- .../kotlin/godot/gen/godot/CharacterBody3D.kt | 188 +++-- .../main/kotlin/godot/gen/godot/CheckBox.kt | 15 +- .../kotlin/godot/gen/godot/CheckButton.kt | 11 +- .../kotlin/godot/gen/godot/CircleShape2D.kt | 9 +- .../main/kotlin/godot/gen/godot/ClassDB.kt | 63 +- .../kotlin/godot/gen/godot/ClockDirection.kt | 6 + .../main/kotlin/godot/gen/godot/CodeEdit.kt | 157 ++-- .../kotlin/godot/gen/godot/CodeHighlighter.kt | 28 +- .../godot/gen/godot/CollisionObject2D.kt | 150 ++-- .../godot/gen/godot/CollisionObject3D.kt | 126 ++-- .../godot/gen/godot/CollisionPolygon3D.kt | 20 +- .../godot/gen/godot/CollisionShape2D.kt | 28 +- .../godot/gen/godot/CollisionShape3D.kt | 17 +- .../kotlin/godot/gen/godot/ColorPicker.kt | 41 +- .../godot/gen/godot/ColorPickerButton.kt | 35 +- .../main/kotlin/godot/gen/godot/ColorRect.kt | 8 +- .../godot/gen/godot/CompressedTexture2D.kt | 28 +- .../godot/gen/godot/CompressedTexture3D.kt | 19 +- .../gen/godot/CompressedTextureLayered.kt | 8 +- .../godot/gen/godot/ConeTwistJoint3D.kt | 27 +- .../main/kotlin/godot/gen/godot/ConfigFile.kt | 209 +++--- .../godot/gen/godot/ConfirmationDialog.kt | 30 +- .../main/kotlin/godot/gen/godot/Container.kt | 33 +- .../godot/gen/godot/ConvexPolygonShape2D.kt | 34 +- .../godot/gen/godot/ConvexPolygonShape3D.kt | 28 +- .../src/main/kotlin/godot/gen/godot/Corner.kt | 12 + .../src/main/kotlin/godot/gen/godot/Crypto.kt | 163 ++--- .../main/kotlin/godot/gen/godot/CryptoKey.kt | 33 +- .../main/kotlin/godot/gen/godot/Cubemap.kt | 22 +- .../kotlin/godot/gen/godot/CubemapArray.kt | 25 +- .../src/main/kotlin/godot/gen/godot/Curve.kt | 47 +- .../main/kotlin/godot/gen/godot/Curve2D.kt | 133 ++-- .../main/kotlin/godot/gen/godot/Curve3D.kt | 137 ++-- .../kotlin/godot/gen/godot/CurveTexture.kt | 24 +- .../kotlin/godot/gen/godot/CurveXYZTexture.kt | 20 +- .../kotlin/godot/gen/godot/CylinderMesh.kt | 31 +- .../kotlin/godot/gen/godot/CylinderShape3D.kt | 16 +- .../godot/gen/godot/DampedSpringJoint2D.kt | 16 +- .../src/main/kotlin/godot/gen/godot/Decal.kt | 157 ++-- .../main/kotlin/godot/gen/godot/DirAccess.kt | 225 +++--- .../godot/gen/godot/DirectionalLight2D.kt | 22 +- .../godot/gen/godot/DirectionalLight3D.kt | 35 +- .../kotlin/godot/gen/godot/ENetConnection.kt | 153 ++++ .../godot/gen/godot/ENetMultiplayerPeer.kt | 60 ++ .../kotlin/godot/gen/godot/ENetPacketPeer.kt | 188 +++++ .../godot/gen/godot/EncodedObjectAsID.kt | 13 +- .../src/main/kotlin/godot/gen/godot/Engine.kt | 268 +++---- .../kotlin/godot/gen/godot/EngineDebugger.kt | 25 +- .../kotlin/godot/gen/godot/EngineProfiler.kt | 16 +- .../kotlin/godot/gen/godot/Environment.kt | 466 ++++++++---- .../src/main/kotlin/godot/gen/godot/Error.kt | 163 +++++ .../main/kotlin/godot/gen/godot/EulerOrder.kt | 24 + .../main/kotlin/godot/gen/godot/Expression.kt | 79 +- .../kotlin/godot/gen/godot/FastNoiseLite.kt | 176 +++++ .../kotlin/godot/gen/godot/FlowContainer.kt | 23 +- .../kotlin/godot/gen/godot/FogMaterial.kt | 44 +- .../main/kotlin/godot/gen/godot/FogVolume.kt | 63 +- .../kotlin/godot/gen/godot/FontVariation.kt | 87 +-- .../kotlin/godot/gen/godot/GDExtension.kt | 30 - .../godot/gen/godot/GDExtensionManager.kt | 36 - .../main/kotlin/godot/gen/godot/GDScript.kt | 16 + .../main/kotlin/godot/gen/godot/GLTFCamera.kt | 38 + .../kotlin/godot/gen/godot/GLTFDocument.kt | 85 +++ .../godot/gen/godot/GLTFDocumentExtension.kt | 139 ++++ .../main/kotlin/godot/gen/godot/GLTFLight.kt | 48 ++ .../main/kotlin/godot/gen/godot/GLTFNode.kt | 73 ++ .../godot/gen/godot/GLTFPhysicsShape.kt | 51 ++ .../kotlin/godot/gen/godot/GLTFSpecGloss.kt | 23 + .../kotlin/godot/gen/godot/GLTFTexture.kt | 8 + .../godot/gen/godot/GLTFTextureSampler.kt | 18 + .../gen/godot/GPUParticlesAttractor3D.kt | 42 +- .../gen/godot/GPUParticlesAttractorBox3D.kt | 12 +- .../godot/GPUParticlesAttractorSphere3D.kt | 16 +- .../GPUParticlesAttractorVectorField3D.kt | 23 +- .../gen/godot/GPUParticlesCollision3D.kt | 36 +- .../gen/godot/GPUParticlesCollisionBox3D.kt | 17 +- .../GPUParticlesCollisionHeightField3D.kt | 56 +- .../gen/godot/GPUParticlesCollisionSDF3D.kt | 63 +- .../godot/GPUParticlesCollisionSphere3D.kt | 17 +- .../main/kotlin/godot/gen/godot/GdjScript.kt | 10 + .../godot/gen/godot/Generic6DOFJoint3D.kt | 72 +- .../main/kotlin/godot/gen/godot/Geometry2D.kt | 181 +++-- .../main/kotlin/godot/gen/godot/Geometry3D.kt | 70 +- .../main/kotlin/godot/gen/godot/Gradient.kt | 54 +- .../godot/gen/godot/GradientTexture1D.kt | 16 +- .../godot/gen/godot/GradientTexture2D.kt | 34 +- .../kotlin/godot/gen/godot/GraphElement.kt | 20 +- .../main/kotlin/godot/gen/godot/GraphNode.kt | 118 +-- .../kotlin/godot/gen/godot/GridContainer.kt | 16 +- .../main/kotlin/godot/gen/godot/GridMap.kt | 165 +++++ .../kotlin/godot/gen/godot/GrooveJoint2D.kt | 12 +- .../kotlin/godot/gen/godot/HBoxContainer.kt | 8 +- .../kotlin/godot/gen/godot/HFlowContainer.kt | 9 +- .../kotlin/godot/gen/godot/HMACContext.kt | 68 +- .../main/kotlin/godot/gen/godot/HScrollBar.kt | 5 +- .../main/kotlin/godot/gen/godot/HSeparator.kt | 5 +- .../main/kotlin/godot/gen/godot/HSlider.kt | 5 +- .../kotlin/godot/gen/godot/HSplitContainer.kt | 9 +- .../kotlin/godot/gen/godot/HashingContext.kt | 71 +- .../godot/gen/godot/HeightMapShape3D.kt | 11 +- .../kotlin/godot/gen/godot/HingeJoint3D.kt | 15 +- .../godot/gen/godot/HorizontalAlignment.kt | 12 + .../src/main/kotlin/godot/gen/godot/IP.kt | 54 +- .../godot/gen/godot/ImageFormatLoader.kt | 6 +- .../gen/godot/ImageFormatLoaderExtension.kt | 17 +- .../kotlin/godot/gen/godot/ImageTexture.kt | 82 ++- .../kotlin/godot/gen/godot/ImageTexture3D.kt | 18 +- .../godot/gen/godot/ImageTextureLayered.kt | 23 +- .../godot/gen/godot/ImporterMeshInstance3D.kt | 33 - .../kotlin/godot/gen/godot/InlineAlignment.kt | 49 ++ .../main/kotlin/godot/gen/godot/InputEvent.kt | 79 +- .../godot/gen/godot/InputEventAction.kt | 21 +- .../godot/gen/godot/InputEventFromWindow.kt | 7 +- .../godot/gen/godot/InputEventGesture.kt | 14 +- .../godot/gen/godot/InputEventJoypadMotion.kt | 11 +- .../kotlin/godot/gen/godot/InputEventMouse.kt | 36 +- .../godot/gen/godot/InputEventMouseButton.kt | 14 +- .../godot/gen/godot/InputEventMouseMotion.kt | 32 +- .../godot/gen/godot/InputEventScreenDrag.kt | 15 +- .../godot/gen/godot/InputEventScreenTouch.kt | 8 +- .../godot/gen/godot/InputEventShortcut.kt | 9 +- .../gen/godot/InputEventWithModifiers.kt | 16 +- .../main/kotlin/godot/gen/godot/InputMap.kt | 43 +- .../godot/gen/godot/InstancePlaceholder.kt | 33 +- .../kotlin/godot/gen/godot/IntervalTweener.kt | 9 +- .../main/kotlin/godot/gen/godot/ItemList.kt | 117 +-- .../kotlin/godot/gen/godot/JNISingleton.kt | 11 +- .../src/main/kotlin/godot/gen/godot/JSON.kt | 184 ++--- .../main/kotlin/godot/gen/godot/JSONRPC.kt | 80 +-- .../main/kotlin/godot/gen/godot/JavaClass.kt | 3 - .../godot/gen/godot/JavaClassWrapper.kt | 6 - .../godot/gen/godot/JavaScriptBridge.kt | 67 +- .../godot/gen/godot/JavaScriptObject.kt | 60 +- .../main/kotlin/godot/gen/godot/Joint2D.kt | 17 +- .../main/kotlin/godot/gen/godot/Joint3D.kt | 11 +- .../main/kotlin/godot/gen/godot/JoyAxis.kt | 28 + .../main/kotlin/godot/gen/godot/JoyButton.kt | 82 +++ .../src/main/kotlin/godot/gen/godot/Key.kt | 580 +++++++++++++++ .../godot/gen/godot/KinematicCollision2D.kt | 22 +- .../godot/gen/godot/KinematicCollision3D.kt | 37 +- .../src/main/kotlin/godot/gen/godot/Label.kt | 53 +- .../main/kotlin/godot/gen/godot/Label3D.kt | 107 +-- .../kotlin/godot/gen/godot/LabelSettings.kt | 9 +- .../main/kotlin/godot/gen/godot/Light2D.kt | 55 +- .../kotlin/godot/gen/godot/LightmapGIData.kt | 13 +- .../kotlin/godot/gen/godot/LightmapProbe.kt | 12 +- .../kotlin/godot/gen/godot/Lightmapper.kt | 9 +- .../kotlin/godot/gen/godot/LightmapperRD.kt | 8 +- .../src/main/kotlin/godot/gen/godot/Line2D.kt | 87 ++- .../main/kotlin/godot/gen/godot/LinkButton.kt | 46 +- .../kotlin/godot/gen/godot/MIDIMessage.kt | 75 ++ .../kotlin/godot/gen/godot/MarginContainer.kt | 44 +- .../main/kotlin/godot/gen/godot/Marker2D.kt | 6 +- .../main/kotlin/godot/gen/godot/Marker3D.kt | 5 +- .../main/kotlin/godot/gen/godot/Marshalls.kt | 24 +- .../main/kotlin/godot/gen/godot/MenuBar.kt | 21 +- .../main/kotlin/godot/gen/godot/MenuButton.kt | 23 +- .../godot/MeshConvexDecompositionSettings.kt | 10 +- .../kotlin/godot/gen/godot/MeshDataTool.kt | 129 +--- .../kotlin/godot/gen/godot/MeshInstance2D.kt | 14 +- .../kotlin/godot/gen/godot/MeshInstance3D.kt | 72 +- .../kotlin/godot/gen/godot/MeshLibrary.kt | 25 +- .../kotlin/godot/gen/godot/MeshTexture.kt | 5 +- .../kotlin/godot/gen/godot/MethodTweener.kt | 20 +- .../kotlin/godot/gen/godot/MissingNode.kt | 9 +- .../kotlin/godot/gen/godot/MissingResource.kt | 9 +- .../godot/gen/godot/MobileVRInterface.kt | 38 + .../kotlin/godot/gen/godot/MouseButton.kt | 31 + .../kotlin/godot/gen/godot/MovieWriter.kt | 91 ++- .../main/kotlin/godot/gen/godot/MultiMesh.kt | 72 +- .../godot/gen/godot/MultiMeshInstance2D.kt | 12 +- .../godot/gen/godot/MultiMeshInstance3D.kt | 15 +- .../kotlin/godot/gen/godot/MultiplayerAPI.kt | 98 ++- .../kotlin/godot/gen/godot/MultiplayerPeer.kt | 79 +- .../gen/godot/MultiplayerPeerExtension.kt | 65 +- .../godot/gen/godot/MultiplayerSpawner.kt | 49 ++ .../gen/godot/MultiplayerSynchronizer.kt | 78 ++ .../src/main/kotlin/godot/gen/godot/Mutex.kt | 45 +- .../godot/gen/godot/NavigationAgent2D.kt | 198 ++++-- .../godot/gen/godot/NavigationAgent3D.kt | 216 ++++-- .../kotlin/godot/gen/godot/NavigationMesh.kt | 99 +-- .../gen/godot/NavigationMeshGenerator.kt | 69 +- .../NavigationMeshSourceGeometryData2D.kt | 2 - .../NavigationMeshSourceGeometryData3D.kt | 17 +- .../godot/gen/godot/NavigationObstacle2D.kt | 54 +- .../godot/gen/godot/NavigationObstacle3D.kt | 61 +- .../godot/NavigationPathQueryParameters2D.kt | 18 +- .../godot/NavigationPathQueryParameters3D.kt | 18 +- .../gen/godot/NavigationPathQueryResult2D.kt | 17 +- .../gen/godot/NavigationPathQueryResult3D.kt | 17 +- .../godot/gen/godot/NavigationPolygon.kt | 149 ++-- .../kotlin/godot/gen/godot/NinePatchRect.kt | 48 +- .../src/main/kotlin/godot/gen/godot/Node2D.kt | 66 +- .../kotlin/godot/gen/godot/Node3DGizmo.kt | 9 +- .../src/main/kotlin/godot/gen/godot/Noise.kt | 44 ++ .../kotlin/godot/gen/godot/NoiseTexture2D.kt | 69 ++ .../kotlin/godot/gen/godot/NoiseTexture3D.kt | 53 ++ .../kotlin/godot/gen/godot/ORMMaterial3D.kt | 9 +- .../main/kotlin/godot/gen/godot/Occluder3D.kt | 10 +- .../godot/gen/godot/OccluderInstance3D.kt | 90 ++- .../godot/gen/godot/OccluderPolygon2D.kt | 10 +- .../godot/gen/godot/OfflineMultiplayerPeer.kt | 10 +- .../godot/gen/godot/OggPacketSequence.kt | 16 + .../gen/godot/OggPacketSequencePlayback.kt | 12 + .../kotlin/godot/gen/godot/OmniLight3D.kt | 28 +- .../godot/gen/godot/OpenXRAPIExtension.kt | 63 ++ .../kotlin/godot/gen/godot/OpenXRAction.kt | 34 + .../kotlin/godot/gen/godot/OpenXRActionMap.kt | 49 ++ .../kotlin/godot/gen/godot/OpenXRActionSet.kt | 27 + .../godot/OpenXRExtensionWrapperExtension.kt | 75 ++ .../main/kotlin/godot/gen/godot/OpenXRHand.kt | 33 + .../kotlin/godot/gen/godot/OpenXRIPBinding.kt | 24 + .../gen/godot/OpenXRInteractionProfile.kt | 19 + .../godot/OpenXRInteractionProfileMetadata.kt | 40 ++ .../kotlin/godot/gen/godot/OpenXRInterface.kt | 188 +++++ .../godot/gen/godot/OptimizedTranslation.kt | 7 +- .../kotlin/godot/gen/godot/OptionButton.kt | 100 +-- .../kotlin/godot/gen/godot/Orientation.kt | 6 + .../godot/gen/godot/PackedDataContainer.kt | 53 +- .../godot/gen/godot/PackedDataContainerRef.kt | 47 +- .../kotlin/godot/gen/godot/PackedScene.kt | 119 +--- .../main/kotlin/godot/gen/godot/PacketPeer.kt | 32 +- .../kotlin/godot/gen/godot/PacketPeerDTLS.kt | 35 +- .../godot/gen/godot/PacketPeerExtension.kt | 9 - .../godot/gen/godot/PacketPeerStream.kt | 19 +- .../src/main/kotlin/godot/gen/godot/Panel.kt | 7 +- .../kotlin/godot/gen/godot/PanelContainer.kt | 8 +- .../godot/gen/godot/PanoramaSkyMaterial.kt | 17 +- .../godot/gen/godot/ParallaxBackground.kt | 41 +- .../src/main/kotlin/godot/gen/godot/Path2D.kt | 11 +- .../src/main/kotlin/godot/gen/godot/Path3D.kt | 11 +- .../kotlin/godot/gen/godot/PathFollow2D.kt | 37 +- .../kotlin/godot/gen/godot/PathFollow3D.kt | 48 +- .../kotlin/godot/gen/godot/Performance.kt | 202 +++--- .../kotlin/godot/gen/godot/PhysicalBone2D.kt | 40 +- .../kotlin/godot/gen/godot/PhysicalBone3D.kt | 81 +-- .../godot/gen/godot/PhysicalSkyMaterial.kt | 58 +- .../kotlin/godot/gen/godot/PhysicsBody2D.kt | 50 +- .../kotlin/godot/gen/godot/PhysicsBody3D.kt | 60 +- .../gen/godot/PhysicsDirectBodyState2D.kt | 79 +- .../gen/godot/PhysicsDirectBodyState3D.kt | 79 +- .../PhysicsDirectBodyState3DExtension.kt | 147 +--- .../gen/godot/PhysicsDirectSpaceState2D.kt | 89 ++- .../PhysicsDirectSpaceState2DExtension.kt | 13 +- .../gen/godot/PhysicsDirectSpaceState3D.kt | 90 +-- .../PhysicsDirectSpaceState3DExtension.kt | 16 +- .../kotlin/godot/gen/godot/PhysicsMaterial.kt | 13 +- .../godot/PhysicsPointQueryParameters2D.kt | 21 +- .../godot/PhysicsPointQueryParameters3D.kt | 17 +- .../gen/godot/PhysicsRayQueryParameters2D.kt | 33 +- .../gen/godot/PhysicsRayQueryParameters3D.kt | 35 +- .../kotlin/godot/gen/godot/PhysicsServer2D.kt | 672 +++++++++++------- .../godot/gen/godot/PhysicsServer2DManager.kt | 15 +- .../kotlin/godot/gen/godot/PhysicsServer3D.kt | 487 ++++++------- .../godot/gen/godot/PhysicsServer3DManager.kt | 15 +- .../PhysicsServer3DRenderingServerHandler.kt | 23 +- .../godot/PhysicsShapeQueryParameters2D.kt | 63 +- .../godot/PhysicsShapeQueryParameters3D.kt | 63 +- .../godot/PhysicsTestMotionParameters2D.kt | 31 +- .../godot/PhysicsTestMotionParameters3D.kt | 34 +- .../gen/godot/PhysicsTestMotionResult2D.kt | 19 +- .../gen/godot/PhysicsTestMotionResult3D.kt | 37 +- .../main/kotlin/godot/gen/godot/PinJoint2D.kt | 9 +- .../main/kotlin/godot/gen/godot/PinJoint3D.kt | 12 +- .../godot/gen/godot/PlaceholderCubemap.kt | 15 +- .../gen/godot/PlaceholderCubemapArray.kt | 16 +- .../godot/gen/godot/PlaceholderMaterial.kt | 13 +- .../kotlin/godot/gen/godot/PlaceholderMesh.kt | 13 +- .../godot/gen/godot/PlaceholderTexture2D.kt | 17 +- .../gen/godot/PlaceholderTexture2DArray.kt | 17 +- .../godot/gen/godot/PlaceholderTexture3D.kt | 17 +- .../gen/godot/PlaceholderTextureLayered.kt | 17 +- .../main/kotlin/godot/gen/godot/PlaneMesh.kt | 21 +- .../kotlin/godot/gen/godot/PointLight2D.kt | 10 +- .../main/kotlin/godot/gen/godot/PointMesh.kt | 16 +- .../main/kotlin/godot/gen/godot/Polygon2D.kt | 55 +- .../godot/gen/godot/PolygonOccluder3D.kt | 22 +- .../godot/gen/godot/PolygonPathFinder.kt | 27 - .../src/main/kotlin/godot/gen/godot/Popup.kt | 5 +- .../main/kotlin/godot/gen/godot/PopupPanel.kt | 6 +- .../gen/godot/PortableCompressedTexture2D.kt | 51 +- .../main/kotlin/godot/gen/godot/PrismMesh.kt | 7 +- .../kotlin/godot/gen/godot/ProgressBar.kt | 13 +- .../kotlin/godot/gen/godot/ProjectSettings.kt | 243 +++---- .../kotlin/godot/gen/godot/PropertyHint.kt | 207 ++++++ .../kotlin/godot/gen/godot/PropertyTweener.kt | 55 +- .../main/kotlin/godot/gen/godot/QuadMesh.kt | 10 +- .../kotlin/godot/gen/godot/QuadOccluder3D.kt | 11 +- .../godot/gen/godot/RDAttachmentFormat.kt | 4 +- .../godot/gen/godot/RDFramebufferPass.kt | 24 +- .../gen/godot/RDPipelineColorBlendState.kt | 8 +- .../RDPipelineColorBlendStateAttachment.kt | 140 ++-- .../gen/godot/RDPipelineMultisampleState.kt | 30 +- .../gen/godot/RDPipelineRasterizationState.kt | 28 +- .../godot/RDPipelineSpecializationConstant.kt | 16 +- .../kotlin/godot/gen/godot/RDSamplerState.kt | 44 +- .../kotlin/godot/gen/godot/RDShaderFile.kt | 15 +- .../kotlin/godot/gen/godot/RDShaderSPIRV.kt | 26 +- .../kotlin/godot/gen/godot/RDShaderSource.kt | 7 +- .../kotlin/godot/gen/godot/RDTextureFormat.kt | 10 +- .../kotlin/godot/gen/godot/RDTextureView.kt | 7 +- .../main/kotlin/godot/gen/godot/RDUniform.kt | 13 +- .../godot/gen/godot/RDVertexAttribute.kt | 19 +- .../src/main/kotlin/godot/gen/godot/Range.kt | 40 +- .../godot/gen/godot/RectangleShape2D.kt | 12 +- .../kotlin/godot/gen/godot/ReferenceRect.kt | 15 +- .../kotlin/godot/gen/godot/ReflectionProbe.kt | 129 ++-- .../src/main/kotlin/godot/gen/godot/RegEx.kt | 112 +++ .../main/kotlin/godot/gen/godot/RegExMatch.kt | 37 + .../godot/gen/godot/RemoteTransform2D.kt | 14 +- .../godot/gen/godot/RemoteTransform3D.kt | 14 +- .../godot/gen/godot/RenderSceneBuffers.kt | 10 +- .../godot/RenderSceneBuffersConfiguration.kt | 8 +- .../gen/godot/RenderSceneBuffersExtension.kt | 2 - .../godot/gen/godot/RenderSceneBuffersRD.kt | 34 +- .../godot/gen/godot/ResourceFormatLoader.kt | 80 +-- .../godot/gen/godot/ResourceFormatSaver.kt | 29 +- .../godot/gen/godot/ResourceImporter.kt | 12 +- .../godot/gen/godot/ResourcePreloader.kt | 22 +- .../kotlin/godot/gen/godot/ResourceUID.kt | 24 +- .../kotlin/godot/gen/godot/RibbonTrailMesh.kt | 21 +- .../kotlin/godot/gen/godot/RigidBody2D.kt | 320 +++++---- .../kotlin/godot/gen/godot/RigidBody3D.kt | 364 +++++----- .../kotlin/godot/gen/godot/RootMotionView.kt | 23 +- .../godot/gen/godot/SceneMultiplayer.kt | 104 +++ .../main/kotlin/godot/gen/godot/SceneState.kt | 84 ++- .../kotlin/godot/gen/godot/SceneTreeTimer.kt | 44 +- .../kotlin/godot/gen/godot/ScriptExtension.kt | 99 +-- .../kotlin/godot/gen/godot/ScriptLanguage.kt | 3 - .../gen/godot/ScriptLanguageExtension.kt | 234 +----- .../main/kotlin/godot/gen/godot/ScrollBar.kt | 8 +- .../kotlin/godot/gen/godot/ScrollContainer.kt | 99 +-- .../kotlin/godot/gen/godot/SegmentShape2D.kt | 5 +- .../main/kotlin/godot/gen/godot/Semaphore.kt | 28 +- .../godot/gen/godot/SeparationRayShape2D.kt | 11 +- .../godot/gen/godot/SeparationRayShape3D.kt | 11 +- .../main/kotlin/godot/gen/godot/Separator.kt | 5 +- .../src/main/kotlin/godot/gen/godot/Shader.kt | 41 +- .../godot/gen/godot/ShaderGlobalsOverride.kt | 21 +- .../kotlin/godot/gen/godot/ShaderInclude.kt | 13 +- .../kotlin/godot/gen/godot/ShaderMaterial.kt | 31 +- .../main/kotlin/godot/gen/godot/Shape2D.kt | 67 +- .../main/kotlin/godot/gen/godot/Shape3D.kt | 25 +- .../main/kotlin/godot/gen/godot/Shortcut.kt | 21 +- .../src/main/kotlin/godot/gen/godot/Side.kt | 12 + .../main/kotlin/godot/gen/godot/Skeleton2D.kt | 41 +- .../kotlin/godot/gen/godot/SkeletonIK3D.kt | 101 ++- .../godot/gen/godot/SkeletonModification2D.kt | 42 +- .../gen/godot/SkeletonModification2DCCDIK.kt | 66 +- .../gen/godot/SkeletonModification2DFABRIK.kt | 55 +- .../gen/godot/SkeletonModification2DJiggle.kt | 78 +- .../gen/godot/SkeletonModification2DLookAt.kt | 27 +- .../SkeletonModification2DPhysicalBones.kt | 35 +- .../SkeletonModification2DStackHolder.kt | 14 +- .../godot/SkeletonModification2DTwoBoneIK.kt | 47 +- .../gen/godot/SkeletonModificationStack2D.kt | 44 +- .../kotlin/godot/gen/godot/SkeletonProfile.kt | 91 +-- .../gen/godot/SkeletonProfileHumanoid.kt | 8 +- .../src/main/kotlin/godot/gen/godot/Skin.kt | 36 - .../kotlin/godot/gen/godot/SkinReference.kt | 9 - .../src/main/kotlin/godot/gen/godot/Sky.kt | 46 +- .../src/main/kotlin/godot/gen/godot/Slider.kt | 14 +- .../kotlin/godot/gen/godot/SliderJoint3D.kt | 21 +- .../main/kotlin/godot/gen/godot/SphereMesh.kt | 5 +- .../godot/gen/godot/SphereOccluder3D.kt | 11 +- .../kotlin/godot/gen/godot/SphereShape3D.kt | 12 +- .../kotlin/godot/gen/godot/SplitContainer.kt | 22 +- .../kotlin/godot/gen/godot/SpotLight3D.kt | 22 +- .../kotlin/godot/gen/godot/SpringArm3D.kt | 41 +- .../main/kotlin/godot/gen/godot/Sprite2D.kt | 61 +- .../main/kotlin/godot/gen/godot/Sprite3D.kt | 15 +- .../kotlin/godot/gen/godot/SpriteFrames.kt | 56 +- .../godot/gen/godot/StandardMaterial3D.kt | 9 +- .../kotlin/godot/gen/godot/StaticBody2D.kt | 28 +- .../kotlin/godot/gen/godot/StaticBody3D.kt | 34 +- .../main/kotlin/godot/gen/godot/StreamPeer.kt | 98 +-- .../godot/gen/godot/StreamPeerBuffer.kt | 16 +- .../godot/gen/godot/StreamPeerExtension.kt | 6 - .../kotlin/godot/gen/godot/StreamPeerGZIP.kt | 21 +- .../kotlin/godot/gen/godot/StreamPeerTCP.kt | 34 +- .../kotlin/godot/gen/godot/StreamPeerTLS.kt | 37 +- .../main/kotlin/godot/gen/godot/StyleBox.kt | 69 +- .../kotlin/godot/gen/godot/StyleBoxEmpty.kt | 5 +- .../kotlin/godot/gen/godot/StyleBoxFlat.kt | 122 ++-- .../kotlin/godot/gen/godot/StyleBoxLine.kt | 11 +- .../kotlin/godot/gen/godot/StyleBoxTexture.kt | 74 +- .../kotlin/godot/gen/godot/SubViewport.kt | 38 +- .../godot/gen/godot/SubViewportContainer.kt | 29 +- .../godot/gen/godot/SyntaxHighlighter.kt | 49 +- .../main/kotlin/godot/gen/godot/TCPServer.kt | 25 +- .../main/kotlin/godot/gen/godot/TLSOptions.kt | 54 +- .../src/main/kotlin/godot/gen/godot/TabBar.kt | 98 +-- .../main/kotlin/godot/gen/godot/TextLine.kt | 31 +- .../main/kotlin/godot/gen/godot/TextMesh.kt | 33 +- .../kotlin/godot/gen/godot/TextParagraph.kt | 49 +- .../godot/gen/godot/TextServerAdvanced.kt | 5 + .../kotlin/godot/gen/godot/TextServerDummy.kt | 32 +- .../godot/gen/godot/TextServerManager.kt | 19 +- .../main/kotlin/godot/gen/godot/Texture.kt | 5 +- .../kotlin/godot/gen/godot/Texture2DArray.kt | 19 +- .../godot/gen/godot/Texture2DArrayRD.kt | 5 +- .../kotlin/godot/gen/godot/Texture2DRD.kt | 7 +- .../kotlin/godot/gen/godot/Texture3DRD.kt | 7 +- .../kotlin/godot/gen/godot/TextureButton.kt | 46 +- .../godot/gen/godot/TextureCubemapArrayRD.kt | 5 +- .../godot/gen/godot/TextureCubemapRD.kt | 5 +- .../kotlin/godot/gen/godot/TextureLayered.kt | 43 +- .../godot/gen/godot/TextureLayeredRD.kt | 7 +- .../godot/gen/godot/TextureProgressBar.kt | 67 +- .../kotlin/godot/gen/godot/TextureRect.kt | 48 +- .../src/main/kotlin/godot/gen/godot/Theme.kt | 330 +++++---- .../main/kotlin/godot/gen/godot/ThemeDB.kt | 21 +- .../src/main/kotlin/godot/gen/godot/Thread.kt | 86 ++- .../main/kotlin/godot/gen/godot/TileData.kt | 68 +- .../kotlin/godot/gen/godot/TileMapPattern.kt | 16 +- .../main/kotlin/godot/gen/godot/TileSet.kt | 224 +++--- .../godot/gen/godot/TileSetAtlasSource.kt | 162 +++-- .../godot/TileSetScenesCollectionSource.kt | 31 +- .../kotlin/godot/gen/godot/TileSetSource.kt | 38 +- .../src/main/kotlin/godot/gen/godot/Timer.kt | 43 +- .../main/kotlin/godot/gen/godot/TorusMesh.kt | 4 +- .../godot/gen/godot/TouchScreenButton.kt | 26 +- .../kotlin/godot/gen/godot/Translation.kt | 21 +- .../godot/gen/godot/TranslationServer.kt | 47 +- .../src/main/kotlin/godot/gen/godot/Tree.kt | 249 ++++--- .../main/kotlin/godot/gen/godot/TreeItem.kt | 249 +++---- .../kotlin/godot/gen/godot/TriangleMesh.kt | 2 - .../kotlin/godot/gen/godot/TubeTrailMesh.kt | 30 +- .../main/kotlin/godot/gen/godot/Tweener.kt | 8 +- .../main/kotlin/godot/gen/godot/UDPServer.kt | 174 +---- .../src/main/kotlin/godot/gen/godot/UPNP.kt | 250 +++++++ .../main/kotlin/godot/gen/godot/UPNPDevice.kt | 69 ++ .../main/kotlin/godot/gen/godot/UndoRedo.kt | 217 ++---- .../kotlin/godot/gen/godot/VBoxContainer.kt | 8 +- .../kotlin/godot/gen/godot/VFlowContainer.kt | 9 +- .../main/kotlin/godot/gen/godot/VScrollBar.kt | 6 +- .../main/kotlin/godot/gen/godot/VSeparator.kt | 5 +- .../main/kotlin/godot/gen/godot/VSlider.kt | 6 +- .../kotlin/godot/gen/godot/VSplitContainer.kt | 9 +- .../kotlin/godot/gen/godot/VariantOperator.kt | 78 ++ .../kotlin/godot/gen/godot/VariantType.kt | 117 +++ .../kotlin/godot/gen/godot/VehicleBody3D.kt | 45 +- .../godot/gen/godot/VerticalAlignment.kt | 12 + .../godot/gen/godot/VideoStreamPlayback.kt | 33 +- .../godot/gen/godot/VideoStreamTheora.kt | 6 + .../kotlin/godot/gen/godot/ViewportTexture.kt | 24 +- .../godot/gen/godot/VisualInstance3D.kt | 63 +- .../kotlin/godot/gen/godot/VisualShader.kt | 34 +- .../godot/gen/godot/VisualShaderNode.kt | 43 +- .../gen/godot/VisualShaderNodeBillboard.kt | 8 +- .../godot/VisualShaderNodeBooleanConstant.kt | 5 +- .../godot/VisualShaderNodeBooleanParameter.kt | 2 - .../godot/gen/godot/VisualShaderNodeClamp.kt | 2 - .../godot/VisualShaderNodeColorConstant.kt | 9 +- .../gen/godot/VisualShaderNodeColorFunc.kt | 34 +- .../gen/godot/VisualShaderNodeColorOp.kt | 113 ++- .../godot/VisualShaderNodeColorParameter.kt | 2 - .../gen/godot/VisualShaderNodeComment.kt | 5 +- .../gen/godot/VisualShaderNodeCompare.kt | 19 +- .../gen/godot/VisualShaderNodeConstant.kt | 2 - .../gen/godot/VisualShaderNodeCubemap.kt | 16 +- .../godot/VisualShaderNodeCubemapParameter.kt | 5 +- .../gen/godot/VisualShaderNodeCurveTexture.kt | 2 - .../godot/VisualShaderNodeCurveXYZTexture.kt | 2 - .../godot/gen/godot/VisualShaderNodeCustom.kt | 152 ++-- .../godot/VisualShaderNodeDerivativeFunc.kt | 18 +- .../gen/godot/VisualShaderNodeDeterminant.kt | 2 - .../gen/godot/VisualShaderNodeDistanceFade.kt | 2 - .../gen/godot/VisualShaderNodeDotProduct.kt | 2 - .../gen/godot/VisualShaderNodeExpression.kt | 11 +- .../gen/godot/VisualShaderNodeFaceForward.kt | 7 +- .../godot/VisualShaderNodeFloatConstant.kt | 4 +- .../gen/godot/VisualShaderNodeFloatFunc.kt | 71 +- .../gen/godot/VisualShaderNodeFloatOp.kt | 11 +- .../godot/VisualShaderNodeFloatParameter.kt | 21 +- .../gen/godot/VisualShaderNodeFresnel.kt | 5 +- .../godot/VisualShaderNodeGlobalExpression.kt | 7 +- .../gen/godot/VisualShaderNodeGroupBase.kt | 23 +- .../godot/gen/godot/VisualShaderNodeIf.kt | 7 +- .../godot/gen/godot/VisualShaderNodeInput.kt | 14 +- .../gen/godot/VisualShaderNodeIntConstant.kt | 4 +- .../gen/godot/VisualShaderNodeIntFunc.kt | 8 +- .../godot/gen/godot/VisualShaderNodeIntOp.kt | 19 +- .../gen/godot/VisualShaderNodeIntParameter.kt | 20 +- .../godot/gen/godot/VisualShaderNodeIs.kt | 2 - .../godot/VisualShaderNodeLinearSceneDepth.kt | 2 - .../godot/gen/godot/VisualShaderNodeMix.kt | 2 - .../gen/godot/VisualShaderNodeMultiplyAdd.kt | 2 - .../gen/godot/VisualShaderNodeOuterProduct.kt | 7 +- .../godot/gen/godot/VisualShaderNodeOutput.kt | 5 +- .../gen/godot/VisualShaderNodeParameter.kt | 12 +- .../gen/godot/VisualShaderNodeParameterRef.kt | 5 +- .../VisualShaderNodeParticleAccelerator.kt | 8 +- .../VisualShaderNodeParticleBoxEmitter.kt | 5 +- .../VisualShaderNodeParticleConeVelocity.kt | 5 +- .../gen/godot/VisualShaderNodeParticleEmit.kt | 6 +- .../godot/VisualShaderNodeParticleEmitter.kt | 8 +- .../VisualShaderNodeParticleMeshEmitter.kt | 10 +- ...alShaderNodeParticleMultiplyByAxisAngle.kt | 5 +- .../godot/VisualShaderNodeParticleOutput.kt | 6 +- .../VisualShaderNodeParticleRandomness.kt | 5 +- .../VisualShaderNodeParticleRingEmitter.kt | 5 +- .../VisualShaderNodeParticleSphereEmitter.kt | 5 +- .../godot/VisualShaderNodeProximityFade.kt | 2 - .../gen/godot/VisualShaderNodeRandomRange.kt | 6 +- .../godot/gen/godot/VisualShaderNodeRemap.kt | 5 +- .../godot/VisualShaderNodeResizableBase.kt | 2 - .../godot/VisualShaderNodeRotationByAxis.kt | 5 +- .../gen/godot/VisualShaderNodeSDFRaymarch.kt | 2 - .../godot/VisualShaderNodeSDFToScreenUV.kt | 2 - .../gen/godot/VisualShaderNodeSample3D.kt | 2 - .../VisualShaderNodeScreenNormalWorldSpace.kt | 2 - .../godot/VisualShaderNodeScreenUVToSDF.kt | 5 +- .../gen/godot/VisualShaderNodeSmoothStep.kt | 6 +- .../godot/gen/godot/VisualShaderNodeStep.kt | 3 - .../godot/gen/godot/VisualShaderNodeSwitch.kt | 5 +- .../gen/godot/VisualShaderNodeTexture.kt | 22 +- .../godot/VisualShaderNodeTexture2DArray.kt | 5 +- ...VisualShaderNodeTexture2DArrayParameter.kt | 5 +- .../VisualShaderNodeTexture2DParameter.kt | 2 - .../gen/godot/VisualShaderNodeTexture3D.kt | 8 +- .../VisualShaderNodeTexture3DParameter.kt | 2 - ...sualShaderNodeTextureParameterTriplanar.kt | 5 +- .../gen/godot/VisualShaderNodeTextureSDF.kt | 2 - .../godot/VisualShaderNodeTextureSDFNormal.kt | 2 - .../godot/VisualShaderNodeTransformCompose.kt | 5 +- .../VisualShaderNodeTransformConstant.kt | 8 +- .../VisualShaderNodeTransformDecompose.kt | 5 +- .../godot/VisualShaderNodeTransformFunc.kt | 8 +- .../gen/godot/VisualShaderNodeTransformOp.kt | 2 - .../VisualShaderNodeTransformParameter.kt | 2 - .../godot/VisualShaderNodeTransformVecMult.kt | 11 +- .../gen/godot/VisualShaderNodeUIntConstant.kt | 2 - .../gen/godot/VisualShaderNodeUIntFunc.kt | 8 +- .../godot/gen/godot/VisualShaderNodeUIntOp.kt | 19 +- .../godot/VisualShaderNodeUIntParameter.kt | 8 +- .../godot/gen/godot/VisualShaderNodeUVFunc.kt | 11 +- .../gen/godot/VisualShaderNodeUVPolarCoord.kt | 5 +- .../gen/godot/VisualShaderNodeVarying.kt | 5 +- .../godot/VisualShaderNodeVaryingGetter.kt | 6 +- .../godot/VisualShaderNodeVaryingSetter.kt | 6 +- .../gen/godot/VisualShaderNodeVec2Constant.kt | 8 +- .../godot/VisualShaderNodeVec2Parameter.kt | 2 - .../gen/godot/VisualShaderNodeVec3Constant.kt | 8 +- .../godot/VisualShaderNodeVec3Parameter.kt | 2 - .../gen/godot/VisualShaderNodeVec4Constant.kt | 6 +- .../godot/VisualShaderNodeVec4Parameter.kt | 2 - .../gen/godot/VisualShaderNodeVectorBase.kt | 2 - .../godot/VisualShaderNodeVectorCompose.kt | 2 - .../godot/VisualShaderNodeVectorDecompose.kt | 5 +- .../godot/VisualShaderNodeVectorDistance.kt | 3 - .../gen/godot/VisualShaderNodeVectorFunc.kt | 8 +- .../gen/godot/VisualShaderNodeVectorLen.kt | 2 - .../gen/godot/VisualShaderNodeVectorOp.kt | 8 +- .../godot/VisualShaderNodeVectorRefract.kt | 5 +- .../VisualShaderNodeWorldPositionFromDepth.kt | 5 +- .../main/kotlin/godot/gen/godot/VoxelGI.kt | 80 ++- .../kotlin/godot/gen/godot/VoxelGIData.kt | 75 +- .../main/kotlin/godot/gen/godot/WeakRef.kt | 13 +- .../godot/gen/godot/WebRTCDataChannel.kt | 65 ++ .../godot/gen/godot/WebRTCMultiplayerPeer.kt | 61 ++ .../godot/gen/godot/WebRTCPeerConnection.kt | 179 +++++ .../gen/godot/WebSocketMultiplayerPeer.kt | 51 ++ .../kotlin/godot/gen/godot/WebSocketPeer.kt | 155 ++++ .../kotlin/godot/gen/godot/WebXRInterface.kt | 273 +++++++ .../godot/gen/godot/WorkerThreadPool.kt | 105 ++- .../main/kotlin/godot/gen/godot/World2D.kt | 19 +- .../main/kotlin/godot/gen/godot/World3D.kt | 18 +- .../godot/gen/godot/WorldBoundaryShape2D.kt | 21 +- .../godot/gen/godot/WorldBoundaryShape3D.kt | 11 +- .../godot/gen/godot/WorldEnvironment.kt | 22 +- .../kotlin/godot/gen/godot/X509Certificate.kt | 22 +- .../main/kotlin/godot/gen/godot/XMLParser.kt | 98 ++- .../main/kotlin/godot/gen/godot/XRAnchor3D.kt | 23 +- .../main/kotlin/godot/gen/godot/XRCamera3D.kt | 16 +- .../kotlin/godot/gen/godot/XRController3D.kt | 31 +- .../kotlin/godot/gen/godot/XRInterface.kt | 149 ++-- .../godot/gen/godot/XRInterfaceExtension.kt | 57 +- .../main/kotlin/godot/gen/godot/XRNode3D.kt | 33 +- .../src/main/kotlin/godot/gen/godot/XRPose.kt | 40 +- .../godot/gen/godot/XRPositionalTracker.kt | 47 +- .../main/kotlin/godot/gen/godot/XRServer.kt | 81 ++- .../main/kotlin/godot/gen/godot/ZIPPacker.kt | 44 ++ .../main/kotlin/godot/gen/godot/ZIPReader.kt | 32 + 728 files changed, 18700 insertions(+), 13856 deletions(-) delete mode 100644 kt/api-generator/src/main/kotlin/godot/codegen/repositories/IDocRepository.kt delete mode 100644 kt/api-generator/src/main/kotlin/godot/codegen/repositories/impl/DocRepository.kt create mode 100644 kt/api-generator/src/main/kotlin/godot/codegen/traits/IDocumented.kt delete mode 100644 kt/api-generator/src/main/kotlin/godot/docgen/DocGen.kt delete mode 100644 kt/api-generator/src/main/kotlin/godot/docgen/docClasses.kt delete mode 100644 kt/api-generator/src/main/kotlin/godot/docgen/rawXmlPojos.kt diff --git a/kt/api-generator/src/main/kotlin/godot/codegen/constants/JvmReservedMethods.kt b/kt/api-generator/src/main/kotlin/godot/codegen/constants/JvmReservedMethods.kt index f0d590074..5867c66ac 100644 --- a/kt/api-generator/src/main/kotlin/godot/codegen/constants/JvmReservedMethods.kt +++ b/kt/api-generator/src/main/kotlin/godot/codegen/constants/JvmReservedMethods.kt @@ -14,7 +14,8 @@ val jvmReservedMethods = listOf( hashCompatibility = listOf(), returnValue = null, returnType = null, - arguments = null + arguments = null, + documentation = null ), "" ) diff --git a/kt/api-generator/src/main/kotlin/godot/codegen/generationEntry.kt b/kt/api-generator/src/main/kotlin/godot/codegen/generationEntry.kt index f0561a8d4..89e112cec 100644 --- a/kt/api-generator/src/main/kotlin/godot/codegen/generationEntry.kt +++ b/kt/api-generator/src/main/kotlin/godot/codegen/generationEntry.kt @@ -11,19 +11,16 @@ import godot.codegen.repositories.* import godot.codegen.repositories.impl.* import godot.codegen.services.* import godot.codegen.services.impl.* -import godot.docgen.DocGen import godot.tools.common.constants.GENERATED_COMMENT import java.io.File fun File.generateApiFrom(jsonSource: File, docsDir: File? = null) { - val classDocs = docsDir?.let { DocGen.deserializeDoc(it) } ?: mapOf() val apiDescription = ObjectMapper().readValue(jsonSource, object : TypeReference() {}) val classRepository: ClassRepository = JsonClassRepository(apiDescription.classes.toEnriched()) val singletonRepository: SingletonRepository = JsonSingletonRepository(apiDescription.singletons.toEnriched()) val globalEnumRepository: GlobalEnumRepository = JsonGlobalEnumRepository(apiDescription.globalEnums.toEnriched()) val coreTypeEnumRepository: CoreTypeEnumRepository = KnownCoreTypeEnumRepository() - val docRepository: IDocRepository = DocRepository(classDocs) val nativeStructureRepository = NativeStructureRepository(apiDescription.nativeStructures.toEnriched()) val classGraphService: IClassGraphService = ClassGraphService(classRepository) @@ -33,7 +30,7 @@ fun File.generateApiFrom(jsonSource: File, docsDir: File? = null) { classGraphService ) val enumService: IEnumService = EnumService(globalEnumRepository, coreTypeEnumRepository, classService) - val generationService: IGenerationService = GenerationService(docRepository, classGraphService, enumService, nativeStructureRepository) + val generationService: IGenerationService = GenerationService(classGraphService, enumService, nativeStructureRepository) classService.findGetSetMethodsAndUpdateProperties() diff --git a/kt/api-generator/src/main/kotlin/godot/codegen/models/BuiltinClass.kt b/kt/api-generator/src/main/kotlin/godot/codegen/models/BuiltinClass.kt index e445c8fd6..a501e8e88 100644 --- a/kt/api-generator/src/main/kotlin/godot/codegen/models/BuiltinClass.kt +++ b/kt/api-generator/src/main/kotlin/godot/codegen/models/BuiltinClass.kt @@ -13,5 +13,6 @@ data class BuiltinClass @JsonCreator constructor ( @JsonProperty("members") val members: List?, @JsonProperty("constants") val constants: List?, @JsonProperty("enums") val enums: List?, - @JsonProperty("indexing_return_type") val indexingReturnType: String? + @JsonProperty("indexing_return_type") val indexingReturnType: String?, + @JsonProperty("documentation") val documentation: String? ) diff --git a/kt/api-generator/src/main/kotlin/godot/codegen/models/Class.kt b/kt/api-generator/src/main/kotlin/godot/codegen/models/Class.kt index cb7051e3d..dec94ce4c 100644 --- a/kt/api-generator/src/main/kotlin/godot/codegen/models/Class.kt +++ b/kt/api-generator/src/main/kotlin/godot/codegen/models/Class.kt @@ -13,7 +13,8 @@ data class Class @JsonCreator constructor ( @JsonProperty("methods") val methods : List?, @JsonProperty("properties") val properties: List?, @JsonProperty("constants") val constants: List?, - @JsonProperty("signals") val signals : List? + @JsonProperty("signals") val signals : List?, + @JsonProperty("documentation") val documentation: String? ) { fun copy(newName: String) = Class( newName, @@ -25,6 +26,7 @@ data class Class @JsonCreator constructor ( methods, properties, constants, - signals + signals, + documentation ) } \ No newline at end of file diff --git a/kt/api-generator/src/main/kotlin/godot/codegen/models/Constant.kt b/kt/api-generator/src/main/kotlin/godot/codegen/models/Constant.kt index 8ee95856b..0ac3fc994 100644 --- a/kt/api-generator/src/main/kotlin/godot/codegen/models/Constant.kt +++ b/kt/api-generator/src/main/kotlin/godot/codegen/models/Constant.kt @@ -7,5 +7,6 @@ import godot.codegen.traits.TypedTrait data class Constant @JsonCreator constructor( @JsonProperty("name") val name: String, @JsonProperty("type") val type: String?, - @JsonProperty("value") val value: String + @JsonProperty("value") val value: String, + @JsonProperty("documentation") val documentation: String? ) diff --git a/kt/api-generator/src/main/kotlin/godot/codegen/models/Constructor.kt b/kt/api-generator/src/main/kotlin/godot/codegen/models/Constructor.kt index c83817962..aaa8adaf6 100644 --- a/kt/api-generator/src/main/kotlin/godot/codegen/models/Constructor.kt +++ b/kt/api-generator/src/main/kotlin/godot/codegen/models/Constructor.kt @@ -5,5 +5,6 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Constructor @JsonCreator constructor ( @JsonProperty("index") val index : Int, - @JsonProperty("arguments") val arguments: List? + @JsonProperty("arguments") val arguments: List?, + @JsonProperty("documentation") val documentation: String? ) diff --git a/kt/api-generator/src/main/kotlin/godot/codegen/models/EnumValue.kt b/kt/api-generator/src/main/kotlin/godot/codegen/models/EnumValue.kt index b2ae85db3..bd73cf427 100644 --- a/kt/api-generator/src/main/kotlin/godot/codegen/models/EnumValue.kt +++ b/kt/api-generator/src/main/kotlin/godot/codegen/models/EnumValue.kt @@ -2,8 +2,10 @@ package godot.codegen.models import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty +import godot.codegen.traits.IDocumented data class EnumValue @JsonCreator constructor( @JsonProperty("name") val name : String, - @JsonProperty("value") val value : Long -) + @JsonProperty("value") val value : Long, + @JsonProperty("documentation") override val documentation: String? = null +) : IDocumented diff --git a/kt/api-generator/src/main/kotlin/godot/codegen/models/Member.kt b/kt/api-generator/src/main/kotlin/godot/codegen/models/Member.kt index 0f04f0b3d..c82870fdc 100644 --- a/kt/api-generator/src/main/kotlin/godot/codegen/models/Member.kt +++ b/kt/api-generator/src/main/kotlin/godot/codegen/models/Member.kt @@ -6,5 +6,6 @@ import godot.codegen.traits.TypedTrait data class Member @JsonCreator constructor( @JsonProperty("name") val name: String, - @JsonProperty("type") override val type: String + @JsonProperty("type") override val type: String, + @JsonProperty("documentation") val documentation: String? ) : TypedTrait diff --git a/kt/api-generator/src/main/kotlin/godot/codegen/models/Method.kt b/kt/api-generator/src/main/kotlin/godot/codegen/models/Method.kt index ec28d6f1d..6e830f9f5 100644 --- a/kt/api-generator/src/main/kotlin/godot/codegen/models/Method.kt +++ b/kt/api-generator/src/main/kotlin/godot/codegen/models/Method.kt @@ -13,5 +13,6 @@ data class Method @JsonCreator constructor( @JsonProperty("hash_compatibility") val hashCompatibility: List?, @JsonProperty("return_value") val returnValue : ReturnValue?, @JsonProperty("return_type") val returnType: String?, - @JsonProperty("arguments") val arguments : List? + @JsonProperty("arguments") val arguments : List?, + @JsonProperty("documentation") val documentation: String? ) diff --git a/kt/api-generator/src/main/kotlin/godot/codegen/models/Operator.kt b/kt/api-generator/src/main/kotlin/godot/codegen/models/Operator.kt index 537ae7e11..20acc9fd6 100644 --- a/kt/api-generator/src/main/kotlin/godot/codegen/models/Operator.kt +++ b/kt/api-generator/src/main/kotlin/godot/codegen/models/Operator.kt @@ -2,9 +2,11 @@ package godot.codegen.models import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty +import godot.codegen.traits.IDocumented data class Operator @JsonCreator constructor( @JsonProperty("name") val name : String, @JsonProperty("right_type") val rightType : String?, - @JsonProperty("return_type") val returnType : String + @JsonProperty("return_type") val returnType : String, + @JsonProperty("documentation") val documentation: String? ) diff --git a/kt/api-generator/src/main/kotlin/godot/codegen/models/Property.kt b/kt/api-generator/src/main/kotlin/godot/codegen/models/Property.kt index 941b9855e..305086327 100644 --- a/kt/api-generator/src/main/kotlin/godot/codegen/models/Property.kt +++ b/kt/api-generator/src/main/kotlin/godot/codegen/models/Property.kt @@ -9,5 +9,6 @@ data class Property @JsonCreator constructor( @JsonProperty("name") val name: String, @JsonProperty("setter") val setter: String?, @JsonProperty("getter") val getter: String, - @JsonProperty("index") val index: Int? + @JsonProperty("index") val index: Int?, + @JsonProperty("documentation") val documentation: String? ) : TypedTrait diff --git a/kt/api-generator/src/main/kotlin/godot/codegen/models/Signal.kt b/kt/api-generator/src/main/kotlin/godot/codegen/models/Signal.kt index 35a3bab11..72114f66a 100644 --- a/kt/api-generator/src/main/kotlin/godot/codegen/models/Signal.kt +++ b/kt/api-generator/src/main/kotlin/godot/codegen/models/Signal.kt @@ -5,5 +5,6 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Signal @JsonCreator constructor( @JsonProperty("name") val name: String, - @JsonProperty("arguments") val arguments: List? + @JsonProperty("arguments") val arguments: List?, + @JsonProperty("documentation") val documentation: String? ) diff --git a/kt/api-generator/src/main/kotlin/godot/codegen/models/UtilityFunction.kt b/kt/api-generator/src/main/kotlin/godot/codegen/models/UtilityFunction.kt index 21d502423..5e89202ed 100644 --- a/kt/api-generator/src/main/kotlin/godot/codegen/models/UtilityFunction.kt +++ b/kt/api-generator/src/main/kotlin/godot/codegen/models/UtilityFunction.kt @@ -2,6 +2,7 @@ package godot.codegen.models import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty +import godot.codegen.traits.IDocumented data class UtilityFunction @JsonCreator constructor ( @JsonProperty("name") val name : String, @@ -9,5 +10,6 @@ data class UtilityFunction @JsonCreator constructor ( @JsonProperty("category") val category : String, @JsonProperty("is_vararg") val isVararg : Boolean, @JsonProperty("hash") val hash : Long, - @JsonProperty("arguments") val arguments : List? + @JsonProperty("arguments") val arguments : List?, + @JsonProperty("documentation") val documentation: String? ) diff --git a/kt/api-generator/src/main/kotlin/godot/codegen/models/enriched/EnrichedClass.kt b/kt/api-generator/src/main/kotlin/godot/codegen/models/enriched/EnrichedClass.kt index 717d1a88d..782e0c7af 100644 --- a/kt/api-generator/src/main/kotlin/godot/codegen/models/enriched/EnrichedClass.kt +++ b/kt/api-generator/src/main/kotlin/godot/codegen/models/enriched/EnrichedClass.kt @@ -3,11 +3,12 @@ package godot.codegen.models.enriched import godot.codegen.models.ApiType import godot.codegen.models.Class import godot.codegen.models.custom.AdditionalImport +import godot.codegen.traits.IDocumented import godot.codegen.traits.TypedTrait import godot.tools.common.extensions.escapeUnderscore import java.util.* -class EnrichedClass(val internal: Class) : TypedTrait { +class EnrichedClass(val internal: Class) : TypedTrait, IDocumented { val constants= internal.constants?.toEnriched() ?: listOf() val signals = internal.signals?.toEnriched() ?: listOf() val name = internal.name.escapeUnderscore() @@ -16,6 +17,7 @@ class EnrichedClass(val internal: Class) : TypedTrait { val properties= internal.properties?.toEnriched() ?: listOf() val methods = internal.methods?.toEnriched(engineClassDBIndexName) ?: listOf() val apiType = ApiType.from(internal.apiType) + override val documentation = internal.documentation override val type = name diff --git a/kt/api-generator/src/main/kotlin/godot/codegen/models/enriched/EnrichedConstant.kt b/kt/api-generator/src/main/kotlin/godot/codegen/models/enriched/EnrichedConstant.kt index 5c78a6c94..c7dea3b08 100644 --- a/kt/api-generator/src/main/kotlin/godot/codegen/models/enriched/EnrichedConstant.kt +++ b/kt/api-generator/src/main/kotlin/godot/codegen/models/enriched/EnrichedConstant.kt @@ -2,10 +2,12 @@ package godot.codegen.models.enriched import godot.codegen.workarounds.sanitizeApiType import godot.codegen.models.Constant +import godot.codegen.traits.IDocumented import godot.codegen.traits.TypedTrait -class EnrichedConstant(val internal: Constant) : TypedTrait { +class EnrichedConstant(val internal: Constant) : TypedTrait, IDocumented { override val type = internal.type?.sanitizeApiType() ?: "int" + override val documentation = internal.documentation } fun List.toEnriched() = map { EnrichedConstant(it) } \ No newline at end of file diff --git a/kt/api-generator/src/main/kotlin/godot/codegen/models/enriched/EnrichedMethod.kt b/kt/api-generator/src/main/kotlin/godot/codegen/models/enriched/EnrichedMethod.kt index 2d51553c6..8253aeba9 100644 --- a/kt/api-generator/src/main/kotlin/godot/codegen/models/enriched/EnrichedMethod.kt +++ b/kt/api-generator/src/main/kotlin/godot/codegen/models/enriched/EnrichedMethod.kt @@ -5,13 +5,14 @@ import godot.codegen.extensions.isObjectSubClass import godot.codegen.models.Argument import godot.codegen.models.Method import godot.codegen.traits.CallableTrait +import godot.codegen.traits.IDocumented import godot.codegen.workarounds.sanitizeApiType import godot.tools.common.constants.Constraints import godot.tools.common.constants.GodotTypes import godot.tools.common.extensions.convertToCamelCase import java.util.* -class EnrichedMethod(val internal: Method, engineClassIndexName: String) : CallableTrait { +class EnrichedMethod(val internal: Method, engineClassIndexName: String) : CallableTrait, IDocumented { override val arguments = internal.arguments?.toEnriched() ?: listOf() override val isVararg = internal.isVararg val name: String @@ -35,6 +36,7 @@ class EnrichedMethod(val internal: Method, engineClassIndexName: String) : Calla override val type = internal.returnValue?.type?.sanitizeApiType() override val meta: String? = internal.returnValue?.meta override val nullable = isObjectSubClass() || type == GodotTypes.variant + override val documentation = internal.documentation } fun List.toEnriched(engineClassIndexName: String) = map { EnrichedMethod(it, engineClassIndexName) } diff --git a/kt/api-generator/src/main/kotlin/godot/codegen/models/enriched/EnrichedProperty.kt b/kt/api-generator/src/main/kotlin/godot/codegen/models/enriched/EnrichedProperty.kt index bace7a9df..b41d17de5 100644 --- a/kt/api-generator/src/main/kotlin/godot/codegen/models/enriched/EnrichedProperty.kt +++ b/kt/api-generator/src/main/kotlin/godot/codegen/models/enriched/EnrichedProperty.kt @@ -10,9 +10,10 @@ import godot.codegen.models.Argument import godot.codegen.models.Property import godot.codegen.traits.CallableTrait import godot.codegen.traits.CastableTrait +import godot.codegen.traits.IDocumented import godot.codegen.traits.NullableTrait -class EnrichedProperty(val internal: Property) : CastableTrait, NullableTrait { +class EnrichedProperty(val internal: Property) : CastableTrait, NullableTrait, IDocumented { val name = internal.name.replace("/", "_").convertToCamelCase() val getter = internal.getter.convertToCamelCase() val setter = internal.setter?.convertToCamelCase() @@ -48,6 +49,7 @@ class EnrichedProperty(val internal: Property) : CastableTrait, NullableTrait { override val nullable = isObjectSubClass() || type == GodotTypes.variant override val meta: String? get() = getterMethod?.meta + override val documentation = internal.documentation } fun List.toEnriched() = map { diff --git a/kt/api-generator/src/main/kotlin/godot/codegen/models/enriched/EnrichedSignal.kt b/kt/api-generator/src/main/kotlin/godot/codegen/models/enriched/EnrichedSignal.kt index 1c98a2d15..a8005153a 100644 --- a/kt/api-generator/src/main/kotlin/godot/codegen/models/enriched/EnrichedSignal.kt +++ b/kt/api-generator/src/main/kotlin/godot/codegen/models/enriched/EnrichedSignal.kt @@ -4,13 +4,15 @@ import godot.codegen.exceptions.TooManySignalArgument import godot.tools.common.extensions.convertToCamelCase import godot.tools.common.extensions.escapeKotlinReservedNames import godot.codegen.models.Signal +import godot.codegen.traits.IDocumented import godot.codegen.traits.TypedTrait import godot.tools.common.constants.Constraints -class EnrichedSignal(val internal: Signal) : TypedTrait { +class EnrichedSignal(val internal: Signal) : TypedTrait, IDocumented { val name = internal.name.convertToCamelCase().escapeKotlinReservedNames() val arguments = internal.arguments?.toEnriched() ?: listOf() override val type = "Signal${arguments.size}" + override val documentation = internal.documentation init{ if (arguments.size > Constraints.MAX_SIGNAL_ARG_COUNT) { diff --git a/kt/api-generator/src/main/kotlin/godot/codegen/repositories/IDocRepository.kt b/kt/api-generator/src/main/kotlin/godot/codegen/repositories/IDocRepository.kt deleted file mode 100644 index 1bd9ed692..000000000 --- a/kt/api-generator/src/main/kotlin/godot/codegen/repositories/IDocRepository.kt +++ /dev/null @@ -1,7 +0,0 @@ -package godot.codegen.repositories - -import godot.docgen.ClassDoc - -interface IDocRepository { - fun findByClassName(className: String): ClassDoc? -} \ No newline at end of file diff --git a/kt/api-generator/src/main/kotlin/godot/codegen/repositories/impl/DocRepository.kt b/kt/api-generator/src/main/kotlin/godot/codegen/repositories/impl/DocRepository.kt deleted file mode 100644 index 94e16a0aa..000000000 --- a/kt/api-generator/src/main/kotlin/godot/codegen/repositories/impl/DocRepository.kt +++ /dev/null @@ -1,8 +0,0 @@ -package godot.codegen.repositories.impl - -import godot.codegen.repositories.IDocRepository -import godot.docgen.ClassDoc - -class DocRepository(val rawData: Map) : IDocRepository { - override fun findByClassName(className: String) = rawData[className] -} \ No newline at end of file diff --git a/kt/api-generator/src/main/kotlin/godot/codegen/services/impl/ClassService.kt b/kt/api-generator/src/main/kotlin/godot/codegen/services/impl/ClassService.kt index 4aeddd879..779feb180 100644 --- a/kt/api-generator/src/main/kotlin/godot/codegen/services/impl/ClassService.kt +++ b/kt/api-generator/src/main/kotlin/godot/codegen/services/impl/ClassService.kt @@ -64,7 +64,8 @@ class ClassService( hashCompatibility = listOf(), returnValue = ReturnValue(returnType, null), returnType = null, - arguments = arguments + arguments = arguments, + documentation = null ), clazz.engineClassDBIndexName ) diff --git a/kt/api-generator/src/main/kotlin/godot/codegen/services/impl/GenerationService.kt b/kt/api-generator/src/main/kotlin/godot/codegen/services/impl/GenerationService.kt index 6b38fd094..e32cc1c38 100644 --- a/kt/api-generator/src/main/kotlin/godot/codegen/services/impl/GenerationService.kt +++ b/kt/api-generator/src/main/kotlin/godot/codegen/services/impl/GenerationService.kt @@ -18,13 +18,13 @@ import godot.codegen.models.enriched.isSameSignature import godot.codegen.models.enriched.toGetterCallable import godot.codegen.models.enriched.toSetterCallable import godot.codegen.poet.RegistrationFileSpec -import godot.codegen.repositories.IDocRepository import godot.codegen.repositories.INativeStructureRepository import godot.codegen.rpc.RpcFunctionMode import godot.codegen.services.IClassGraphService import godot.codegen.services.IEnumService import godot.codegen.services.IGenerationService import godot.codegen.traits.CallableTrait +import godot.codegen.traits.addKdoc import godot.tools.common.constants.CORE_TYPE_LOCAL_COPY import godot.tools.common.constants.CORE_TYPE_HELPER import godot.tools.common.constants.GENERATED_COMMENT @@ -45,7 +45,6 @@ import java.util.* private const val methodBindingsInnerClassName = "MethodBindings" class GenerationService( - private val docRepository: IDocRepository, private val classGraphService: IClassGraphService, private val enumService: IEnumService, private val nativeStructureRepository: INativeStructureRepository @@ -101,26 +100,9 @@ class GenerationService( .objectBuilder(methodBindingsInnerClassName) .addModifiers(KModifier.INTERNAL) - docRepository.findByClassName(name)?.let { classDoc -> - classTypeBuilder.addKdoc( - "%L", - buildString { - appendLine(classDoc.briefDescription) - appendLine() - if (classDoc.tutorialLinks.isNotEmpty()) { - appendLine("Tutorials:") - classDoc.tutorialLinks.forEach { - appendLine("[$it]($it)") - } - appendLine() - } - appendLine(classDoc.description) - }.replace(System.lineSeparator(), "\n") - .replace("/*", "/*") - ) - } - - classTypeBuilder.addAnnotation(GODOT_BASE_TYPE) + classTypeBuilder + .addKdoc(enrichedClass) + .addAnnotation(GODOT_BASE_TYPE) if (name == GodotKotlinJvmTypes.obj) { classTypeBuilder.superclass(KT_OBJECT) @@ -327,14 +309,7 @@ class GenerationService( TypeSpec.anonymousClassBuilder() .addSuperclassConstructorParameter("%L", value.value) .also { - val kDoc = if (containingClassName != null) { - docRepository.findByClassName(containingClassName)?.constants?.get(valueName)?.description - } else { - docRepository.findByClassName(enum.name)?.constants?.get(valueName)?.description - } - if (kDoc != null) { - it.addKdoc("%L", kDoc.replace("/*", "/*")) - } + it.addKdoc(value) } .build() ) @@ -360,14 +335,7 @@ class GenerationService( .addModifiers(KModifier.CONST, KModifier.FINAL) .initializer("%L", constant.internal.value) .also { - val kDoc = if (containingClassName != null) { - docRepository.findByClassName(containingClassName)?.constants?.get(constantName)?.description - } else { - docRepository.findByClassName("@GlobalScope")?.constants?.get(constantName)?.description - } - if (kDoc != null) { - it.addKdoc("%L", kDoc.replace("/*", "/*")) - } + it.addKdoc(constant) } .build() } @@ -404,6 +372,7 @@ class GenerationService( signal.name, signalClass.typeName ) + .addKdoc(signal) if (arguments.isEmpty()) { builder.delegate( @@ -419,10 +388,6 @@ class GenerationService( MemberName(signalPackage, "signal") ) } - val kDoc = docRepository.findByClassName(containingClassName)?.signals?.get(signal.internal.name)?.description - if (kDoc != null) { - builder.addKdoc("%L", kDoc.replace("/*", "/*")) - } return builder.build() } @@ -568,11 +533,7 @@ class GenerationService( propertySpecBuilder.addAnnotation(CORE_TYPE_LOCAL_COPY) } - val kDoc = - docRepository.findByClassName(enrichedClass.name)?.properties?.get(property.internal.name)?.description - if (kDoc != null) { - propertySpecBuilder.addKdoc("%L", kDoc.replace("/*", "/*")) - } + propertySpecBuilder.addKdoc(property) return propertySpecBuilder.build() } @@ -609,7 +570,7 @@ class GenerationService( ).apply { val kDoc = buildString { val propertyKdoc = - docRepository.findByClassName(enrichedClass.name)?.properties?.get(property.internal.name)?.description + property.sanitizedDocumentation if (propertyKdoc != null) { appendLine(propertyKdoc.replace("/*", "/*")) appendLine() @@ -689,10 +650,7 @@ class GenerationService( generatedFunBuilder.generateCodeBlock(enrichedClass, method, callArgumentsAsString, isStatic) - val kDoc = docRepository.findByClassName(enrichedClass.name)?.functions?.get(method.internal.name)?.description - if (kDoc != null) { - generatedFunBuilder.addKdoc("%L", kDoc.replace("/*", "/*")) - } + generatedFunBuilder.addKdoc(method) for (jvmReservedMethod in jvmReservedMethods) { if (method.isSameSignature(jvmReservedMethod) && !method.internal.isVirtual) { diff --git a/kt/api-generator/src/main/kotlin/godot/codegen/traits/IDocumented.kt b/kt/api-generator/src/main/kotlin/godot/codegen/traits/IDocumented.kt new file mode 100644 index 000000000..357309bf0 --- /dev/null +++ b/kt/api-generator/src/main/kotlin/godot/codegen/traits/IDocumented.kt @@ -0,0 +1,104 @@ +package godot.codegen.traits + +import com.squareup.kotlinpoet.FunSpec +import com.squareup.kotlinpoet.PropertySpec +import com.squareup.kotlinpoet.TypeSpec +import godot.tools.common.extensions.convertToCamelCase + +private val titlesToSanitize = arrayOf( + "member", + "method" +) + +private val tagsToSanitize = arrayOf( + "code" to "`", + "i" to "*", + "b" to "**" +) + +private val languages = arrayOf( + "gdscript", + "csharp" +) + +interface IDocumented { + val documentation: String? + + val sanitizedDocumentation: String? + get() { + var unicodeString = documentation + ?.replace("/*", "/*") + ?.replace("%", "%") + ?.replace("*/", "*\") + ?.replace(System.lineSeparator(), "\n") + + for (title in titlesToSanitize) { + val regex = Regex("\\[($title\\s)(\\S+)(\\])") + + var matchResult = unicodeString?.let { regex.find(it) } + while (matchResult != null) { + val titleRange = matchResult.groups[1]!!.range + val contentRange = matchResult.groups[2]!!.range + val content = unicodeString!!.substring(contentRange).convertToCamelCase() + unicodeString = unicodeString + .replaceRange(contentRange, content) + .removeRange(titleRange) + matchResult = unicodeString.let { regex.find(it) } + } + } + + for (tag in tagsToSanitize) { + val regex = Regex("(\\[${tag.first}\\])((?:(?!\\[\\/${tag.first}\\]|\\[${tag.first}\\]).)*)(\\[\\/${tag.first}\\])") + + var matchResult = unicodeString?.let { regex.find(it) } + while (matchResult != null) { + val endTagRange = matchResult.groups[3]!!.range + val beginTagRange = matchResult.groups[1]!!.range + unicodeString = unicodeString!! + .replaceRange(endTagRange, tag.second) + .replaceRange(beginTagRange, tag.second) + matchResult = unicodeString.let { regex.find(it) } + } + } + + unicodeString = unicodeString + ?.replace("[codeblocks]", "") + ?.replace("[/codeblocks]", "") + + for (language in languages) { + unicodeString = unicodeString + ?.replace("[$language]", "$language:\n```$language") + ?.replace("[/$language]", "```") + } + + return unicodeString + } +} + +//TODO: Use Documentable interface from poet when upgrading kotlin poet. +fun TypeSpec.Builder.addKdoc(documented: IDocumented): TypeSpec.Builder { + val documentation = documented.sanitizedDocumentation + return if (documentation.isNullOrEmpty()) { + this + } else { + this.addKdoc(documentation) + } +} + +fun PropertySpec.Builder.addKdoc(documented: IDocumented): PropertySpec.Builder { + val documentation = documented.sanitizedDocumentation + return if (documentation.isNullOrEmpty()) { + this + } else { + this.addKdoc(documentation) + } +} + +fun FunSpec.Builder.addKdoc(documented: IDocumented): FunSpec.Builder { + val documentation = documented.sanitizedDocumentation + return if (documentation.isNullOrEmpty()) { + this + } else { + this.addKdoc(documentation) + } +} \ No newline at end of file diff --git a/kt/api-generator/src/main/kotlin/godot/docgen/DocGen.kt b/kt/api-generator/src/main/kotlin/godot/docgen/DocGen.kt deleted file mode 100644 index 8180f3703..000000000 --- a/kt/api-generator/src/main/kotlin/godot/docgen/DocGen.kt +++ /dev/null @@ -1,124 +0,0 @@ -package godot.docgen - -import com.fasterxml.jackson.core.JsonParser -import com.fasterxml.jackson.databind.DeserializationContext -import com.fasterxml.jackson.databind.ObjectMapper -import com.fasterxml.jackson.databind.deser.DeserializationProblemHandler -import com.fasterxml.jackson.databind.deser.ValueInstantiator -import com.fasterxml.jackson.dataformat.xml.XmlMapper -import java.io.File - - -object DocGen { - fun deserializeDoc(docsDir: File): Map { - val xmlMapper: ObjectMapper = XmlMapper().apply { - addHandler(object : DeserializationProblemHandler() { - /** - * Needed for empty tags with tabs and new lines as they are not considered empty by jackson - * and throw an error when trying to parse them - * - * Example: - * ```xml - * - * - * ``` - */ - override fun handleMissingInstantiator( - ctxt: DeserializationContext?, - instClass: Class<*>?, - valueInsta: ValueInstantiator?, - p: JsonParser?, - msg: String? - ): Any? { - val value = p?.valueAsString?.trim() - // ignore "empty" elements - if (value?.isEmpty() == true) { - return null - } - return super.handleMissingInstantiator(ctxt, instClass, valueInsta, p, msg) - } - }) - } - - return docsDir - .walkTopDown() - .filter { it.isFile && it.extension == "xml" } - .map { - //better have no doc for one class that to have a crash an no classes at all - try { - xmlMapper.readValue(it.readText(), RawClassDoc::class.java) - } catch (e: Throwable) { - System.err.println("Could not parse doc: ${it.absolutePath}! Please submit a bugreport with this error and the following stacktrace to: https://github.com/utopia-rise/godot-kotlin-jvm/issues") - e.printStackTrace() - null - } - } - .toList() - .filterNotNull() - .map(::mapClass) - .map { it.name to it } - .toMap() - } - - private fun mapClass(rawClassDoc: RawClassDoc): ClassDoc { - return ClassDoc( - rawClassDoc.name, - rawClassDoc.briefDescription, - rawClassDoc.description, - rawClassDoc.tutorials?.links ?: listOf(), - rawClassDoc - .methods - ?.methods - ?.map(::mapMethod) - ?.map { it.name to it } - ?.toMap() ?: mapOf(), - rawClassDoc - .members - ?.members - ?.map(::mapMember) - ?.map { it.name to it } - ?.toMap() ?: mapOf(), - rawClassDoc - .signals - ?.signals - ?.map(::mapSignal) - ?.map { it.name to it } - ?.toMap() ?: mapOf(), - rawClassDoc - .constants - ?.constants - ?.map(::mapConstant) - ?.map { it.name to it } - ?.toMap() ?: mapOf() - ) - } - - private fun mapMethod(rawMethodDoc: RawMethodDoc): FunctionDoc { - return FunctionDoc( - rawMethodDoc.name, - rawMethodDoc.description - ) - } - - private fun mapMember(rawMemberDoc: RawMemberDoc): PropertyDoc { - return PropertyDoc( - rawMemberDoc.name, - rawMemberDoc.description - ) - } - - private fun mapSignal(rawSignalDoc: RawSignalDoc): SignalDoc { - return SignalDoc( - rawSignalDoc.name, - rawSignalDoc.description - ) - } - - private fun mapConstant(rawConstantDoc: RawConstantDoc): ConstantDoc { - return ConstantDoc( - rawConstantDoc.name, - rawConstantDoc.enum, - rawConstantDoc.description - ) - } -} diff --git a/kt/api-generator/src/main/kotlin/godot/docgen/docClasses.kt b/kt/api-generator/src/main/kotlin/godot/docgen/docClasses.kt deleted file mode 100644 index 910e66ab5..000000000 --- a/kt/api-generator/src/main/kotlin/godot/docgen/docClasses.kt +++ /dev/null @@ -1,33 +0,0 @@ -package godot.docgen - -data class ClassDoc( - val name: String, - val briefDescription: String, - val description: String, - val tutorialLinks: List, - val functions: Map, - val properties: Map, - val signals: Map, - val constants: Map -) - -data class FunctionDoc( - val name: String, - val description: String -) - -data class PropertyDoc( - val name: String, - val description: String -) - -data class SignalDoc( - val name: String, - val description: String -) - -data class ConstantDoc( - val name: String, - val enum: String, - val description: String -) diff --git a/kt/api-generator/src/main/kotlin/godot/docgen/rawXmlPojos.kt b/kt/api-generator/src/main/kotlin/godot/docgen/rawXmlPojos.kt deleted file mode 100644 index 030e42981..000000000 --- a/kt/api-generator/src/main/kotlin/godot/docgen/rawXmlPojos.kt +++ /dev/null @@ -1,341 +0,0 @@ -package godot.docgen - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlText -import godot.tools.common.extensions.convertToCamelCase - -@JsonIgnoreProperties(ignoreUnknown = true) -open class RawClassDoc { - var name: String = "" - var inherits: String = "" - - @JacksonXmlProperty(localName = "brief_description") - var briefDescription: String = "" - get() = field.getFormattedDescription() - var description: String = "" - get() = field.getFormattedDescription() - - @JacksonXmlProperty(localName = "tutorials") - var tutorials: TutorialContainer? = null - var methods: MethodContainer? = null - var members: MemberContainer? = null - var signals: SignalsContainer? = null - var constants: ConstantsContainer? = null -} - -@JsonIgnoreProperties(ignoreUnknown = true) -open class TutorialContainer { - @JacksonXmlElementWrapper(useWrapping = false) - @JacksonXmlProperty(localName = "link") - var links: List = listOf() -} - -@JsonIgnoreProperties(ignoreUnknown = true) -open class MethodContainer { - @JacksonXmlElementWrapper(useWrapping = false) - @JacksonXmlProperty(localName = "method") - var methods: List = listOf() -} - -@JsonIgnoreProperties(ignoreUnknown = true) -open class RawMethodDoc { - var name: String = "" - - @JacksonXmlProperty(localName = "return") - var returnType: ReturnContainer? = null - - @JacksonXmlElementWrapper(useWrapping = false) - @JacksonXmlProperty(localName = "argument") - var arguments: List = listOf() - var description: String = "" - get() = field.getFormattedDescription() -} - -@JsonIgnoreProperties(ignoreUnknown = true) -open class ReturnContainer { - var type: String = "" -} - -@JsonIgnoreProperties(ignoreUnknown = true) -open class RawArgumentDoc { - var index: String = "" - var name: String = "" - var type: String = "" -} - -@JsonIgnoreProperties(ignoreUnknown = true) -open class MemberContainer { - @JacksonXmlElementWrapper(useWrapping = false) - @JacksonXmlProperty(localName = "member") - var members: List = listOf() -} - -@JsonIgnoreProperties(ignoreUnknown = true) -open class RawMemberDoc { - var name: String = "" - var type: String = "" - var setter = "" - var getter = "" - var default = "" - - @JacksonXmlText - var description: String = "" - get() = field.getFormattedDescription() -} - -@JsonIgnoreProperties(ignoreUnknown = true) -open class SignalsContainer { - @JacksonXmlElementWrapper(useWrapping = false) - @JacksonXmlProperty(localName = "signal") - var signals: List = listOf() -} - -@JsonIgnoreProperties(ignoreUnknown = true) -open class RawSignalDoc { - var name: String = "" - var description: String = "" - get() = field.getFormattedDescription() - - @JacksonXmlElementWrapper(useWrapping = false) - @JacksonXmlProperty(localName = "argument") - var arguments: List = listOf() -} - -@JsonIgnoreProperties(ignoreUnknown = true) -open class ConstantsContainer { - @JacksonXmlElementWrapper(useWrapping = false) - @JacksonXmlProperty(localName = "constant") - var constants: List = listOf() -} - -@JsonIgnoreProperties(ignoreUnknown = true) -open class RawConstantDoc { - var name: String = "" - var value: String = "" - var enum: String = "" - - @JacksonXmlText - var description: String = "" - get() = field.getFormattedDescription() -} - -//order important! As we expect some things already replaced in the regexes at the bottom to keep them simpler -private fun String.getFormattedDescription(): String = trim() - .replace("[i]", "*") - .replace("[/i]", "*") - .replace("[b]", "**") - .replace("[/b]", "**") - .replace("[u]", "") - .replace("[/u]", "") - .replace("[s]", "~~") - .replace("[/s]", "~~") - .replace("[code]", "`") - .replace("[/code]", "`") - .replace("[codeblock]", "```") - .replace("[/codeblock]", "```") - .replaceUrls() - .replaceCodeReferences() - .replaceClassReferences() - .replaceNewLines() - .replaceInvalidCommentSequences() - .replace(" ", "·") //so kotlin poet does not break where we don't want it - - -/** - * Replaces wrong comment characters sequence to avoid invalid comment syntax. - */ -fun String.replaceInvalidCommentSequences(): String = this.replace("*/", "* / ").replace("/*", "/ *") - -/** - * Replaces new line chars with two new line chars so they are rendered on an new line in kdoc - * - * Does not replace newLines in codeblocks - */ -private fun String.replaceNewLines(): String { - var tmpString = this - val originalCodeBlocks = "```(.|\\n)+?(?=```)```".toRegex(RegexOption.DOT_MATCHES_ALL) - .findAll(this) - .map { it.value } - .toList() - - tmpString = tmpString.replace("\n", "\n\n").replace("\t", "") - "```(.|\\n)+?(?=```)```".toRegex(RegexOption.DOT_MATCHES_ALL) - .findAll(tmpString) - .map { it.value } - .forEachIndexed { index, blockToReplace -> - tmpString = tmpString.replace(blockToReplace, originalCodeBlocks[index]) - } - return tmpString -} - -fun String.replaceUrls(): String { - var tmpString = this - //example: [url=http://www.pcg-random.org/]PCG32[/url] - "\\[url=.+?(?=])].+?(?=\\[/url])\\[/url]".toRegex() - .findAll(tmpString) //extract all urls with the pattern of the above example from the string - .map { it.value } - .map { oldBBCodeUrl -> - //extract actual url from the match: http://www.pcg-random.org/ in the case of [url=http://www.pcg-random.org/]PCG32[/url] - val url = "(?<=\\[url=).+?(?=])".toRegex().find(oldBBCodeUrl)?.value - //extract text from the match: PCG32 in the case of [url=http://www.pcg-random.org/]PCG32[/url] - val text = "(?<=]).+?(?=\\[/)".toRegex().find(oldBBCodeUrl)?.value - oldBBCodeUrl to "[$text]($url)" - } - .forEach { (oldUrlFormat, newUrlFormat) -> - tmpString = tmpString.replace(oldUrlFormat, newUrlFormat) - } - - return tmpString -} - -private fun String.replaceCodeReferences(): String { - var tmpString = this - //properties - //example: [member size] - "\\[member .+?(?=])]".toRegex() - .findAll(tmpString) - .map { it.value } - .map { oldPropertyReference -> - //extracts property name from match. example: size in the case of [member size] - val propertyName = "(?<=\\[member ).+?(?=])".toRegex().find(oldPropertyReference)?.value - oldPropertyReference to propertyName?.convertToCamelCase() - } - .filter { it.second != null } - .forEach { (oldPropertyReference, newPropertyReference) -> - tmpString = tmpString.replace(oldPropertyReference, "[$newPropertyReference]") //nulls already filtered - } - - //signals - //example: [signal pressed] - "\\[signal .+?(?=])]".toRegex() - .findAll(tmpString) - .map { it.value } - .map { oldSignalReference -> - //extracts signal name from match. example: pressed in the case of [signal pressed] - val signalName = "(?<=\\[signal ).+?(?=])".toRegex().find(oldSignalReference)?.value - oldSignalReference to signalName?.convertToCamelCase() - } - .filter { it.second != null } - .forEach { (oldSignalReference, newSignalReference) -> - tmpString = tmpString.replace(oldSignalReference, "[$newSignalReference]") //nulls already filtered - } - - //signals - //example: [constant MODE_OPEN_FILE] - "\\[constant .+?(?=])]".toRegex() - .findAll(tmpString) - .map { it.value } - .map { oldConstantReference -> - //extracts constant name from match. example: MODE_OPEN_FILE in the case of [constant MODE_OPEN_FILE] - val constantName = "(?<=\\[constant ).+?(?=])".toRegex().find(oldConstantReference)?.value - oldConstantReference to constantName - } - .filter { it.second != null } - .forEach { (oldConstantReference, newConstantReference) -> - tmpString = tmpString.replace(oldConstantReference, "[$newConstantReference]") //nulls already filtered - } - - //functions - //example: [method get_node] - "\\[method .+?(?=])]".toRegex() - .findAll(tmpString) - .map { it.value } - .map { oldFunctionReference -> - //extracts function name from match. example: get_node in the case of [method get_node] - val functionName = "(?<=\\[method ).+?(?=])".toRegex().find(oldFunctionReference)?.value - oldFunctionReference to functionName?.convertToCamelCase() - } - .filter { it.second != null } - .forEach { (oldFunctionReference, newFunctionReference) -> - tmpString = tmpString.replace(oldFunctionReference, "[$newFunctionReference]") //nulls already filtered - } - - //parameters - //example: [param right] - "\\[param .+?(?=])]".toRegex() - .findAll(tmpString) - .map { it.value } - .map { oldParameterReference -> - //extracts parameter name from match. example: right in the case of [param right] - val parameterName = "(?<=\\[param ).+?(?=])".toRegex().find(oldParameterReference)?.value - oldParameterReference to parameterName?.convertToCamelCase() - } - .filter { it.second != null } - .forEach { (oldParameterReference, newParameterReference) -> - tmpString = tmpString.replace(oldParameterReference, "[$newParameterReference]") //nulls already filtered - } - - return tmpString -} - -private fun String.replaceClassReferences(): String { - var tmpString = this - //examples: [Object], [Object.get] - //matches capitalized string in [] - "(?<=\\[)[A-Z].+?(?=])".toRegex() - .findAll(tmpString) - .map { it.value } - .map { oldClassReference -> - oldClassReference to if (oldClassReference.matches("^[A-Z]+(?:_[A-Z]+)*\$".toRegex())) { - oldClassReference //no class ref. its a constant. Not handled in regex to keep it simpler - } else { - oldClassReference.setPackagePath() - } - } - .forEach { (oldClassReference, newClassReference) -> - tmpString = tmpString.replace("[$oldClassReference]", "[$newClassReference]") - } - return tmpString -} - -private fun String.setPackagePath(): String { - return if (this.matches("^[A-Z]+(?:_[A-Z]+)*\$".toRegex())) { - this //no class ref. its a constant. Not handled in regex to keep it simpler - } else { - when(this) { - "Vector2", - "Rect2", - "Vector3", - "Transform2D", - "Plane", - "Quat", - "AABB", - "Basis", - "Transform", - "Color", - "NodePath", - "RID", - "Dictionary", - "PoolByteArray", - "PoolIntArray", - "PoolRealArray", - "PoolStringArray", - "PoolColorArray", - "PoolVector2Array", - "PoolVector3Array", - "VariantArray", - "ObjectArray", - "EnumArray", - "BoolVariantArray", - "IntVariantArray", - "RealVariantArray", - "StringVariantArray", - "AABBArray", - "BasisArray", - "ColorArray", - "NodePathArray", - "PlaneArray", - "QuatArray", - "Rect2Array", - "RIDArray", - "Transform2DArray", - "TransformArray", - "Vector2Array", - "Vector3Array" -> "godot.core.$this" - "Variant" -> this // we don't have a variant class anymore - else -> "godot.${this.replace("@GDScript", "GD")}" - } - } -} diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AESContext.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AESContext.kt index fab4cfc47..2f95d7f5b 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AESContext.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AESContext.kt @@ -23,149 +23,81 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * Provides access to AES encryption/decryption of raw data. - * - * This class holds the context information required for encryption and decryption operations with AES (Advanced Encryption Standard). Both AES-ECB and AES-CBC modes are supported. - * - * [codeblocks] - * - * [gdscript] + * This class holds the context information required for encryption and decryption operations with + * AES (Advanced Encryption Standard). Both AES-ECB and AES-CBC modes are supported. * + * gdscript: + * ```gdscript * extends Node * - * - * * var aes = AESContext.new() * - * - * * func _ready(): - * * var key = "My secret key!!!" # Key must be either 16 or 32 bytes. - * - * var data = "My secret text!!" # Data size must be multiple of 16 bytes, apply padding if needed. - * + * var data = "My secret text!!" # Data size must be multiple of 16 bytes, apply padding if + * needed. * # Encrypt ECB - * * aes.start(AESContext.MODE_ECB_ENCRYPT, key.to_utf8_buffer()) - * * var encrypted = aes.update(data.to_utf8_buffer()) - * * aes.finish() - * * # Decrypt ECB - * * aes.start(AESContext.MODE_ECB_DECRYPT, key.to_utf8_buffer()) - * * var decrypted = aes.update(encrypted) - * * aes.finish() - * * # Check ECB - * * assert(decrypted == data.to_utf8_buffer()) * - * - * * var iv = "My secret iv!!!!" # IV must be of exactly 16 bytes. - * * # Encrypt CBC - * * aes.start(AESContext.MODE_CBC_ENCRYPT, key.to_utf8_buffer(), iv.to_utf8_buffer()) - * * encrypted = aes.update(data.to_utf8_buffer()) - * * aes.finish() - * * # Decrypt CBC - * * aes.start(AESContext.MODE_CBC_DECRYPT, key.to_utf8_buffer(), iv.to_utf8_buffer()) - * * decrypted = aes.update(encrypted) - * * aes.finish() - * * # Check CBC - * * assert(decrypted == data.to_utf8_buffer()) - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * using Godot; - * * using System.Diagnostics; * - * - * * public partial class MyNode : Node - * * { - * * private AesContext _aes = new AesContext(); * - * - * * public override void _Ready() - * * { - * * string key = "My secret key!!!"; // Key must be either 16 or 32 bytes. - * - * string data = "My secret text!!"; // Data size must be multiple of 16 bytes, apply padding if needed. - * + * string data = "My secret text!!"; // Data size must be multiple of 16 bytes, apply + * padding if needed. * // Encrypt ECB - * * _aes.Start(AesContext.Mode.EcbEncrypt, key.ToUtf8Buffer()); - * * byte[] encrypted = _aes.Update(data.ToUtf8Buffer()); - * * _aes.Finish(); - * * // Decrypt ECB - * * _aes.Start(AesContext.Mode.EcbDecrypt, key.ToUtf8Buffer()); - * * byte[] decrypted = _aes.Update(encrypted); - * * _aes.Finish(); - * * // Check ECB - * * Debug.Assert(decrypted == data.ToUtf8Buffer()); * - * - * * string iv = "My secret iv!!!!"; // IV must be of exactly 16 bytes. - * * // Encrypt CBC - * * _aes.Start(AesContext.Mode.EcbEncrypt, key.ToUtf8Buffer(), iv.ToUtf8Buffer()); - * * encrypted = _aes.Update(data.ToUtf8Buffer()); - * * _aes.Finish(); - * * // Decrypt CBC - * * _aes.Start(AesContext.Mode.EcbDecrypt, key.ToUtf8Buffer(), iv.ToUtf8Buffer()); - * * decrypted = _aes.Update(encrypted); - * * _aes.Finish(); - * * // Check CBC - * * Debug.Assert(decrypted == data.ToUtf8Buffer()); - * * } - * * } - * - * [/csharp] - * - * [/codeblocks] + * ``` */ @GodotBaseType public open class AESContext : RefCounted() { @@ -175,7 +107,9 @@ public open class AESContext : RefCounted() { } /** - * Start the AES context in the given [mode]. A [key] of either 16 or 32 bytes must always be provided, while an [iv] (initialization vector) of exactly 16 bytes, is only needed when [mode] is either [MODE_CBC_ENCRYPT] or [MODE_CBC_DECRYPT]. + * Start the AES context in the given [param mode]. A [param key] of either 16 or 32 bytes must + * always be provided, while an [param iv] (initialization vector) of exactly 16 bytes, is only + * needed when [param mode] is either [constant MODE_CBC_ENCRYPT] or [constant MODE_CBC_DECRYPT]. */ @JvmOverloads public fun start( @@ -189,9 +123,9 @@ public open class AESContext : RefCounted() { } /** - * Run the desired operation for this AES context. Will return a [godot.PackedByteArray] containing the result of encrypting (or decrypting) the given [src]. See [start] for mode of operation. - * - * **Note:** The size of [src] must be a multiple of 16. Apply some padding if needed. + * Run the desired operation for this AES context. Will return a [PackedByteArray] containing the + * result of encrypting (or decrypting) the given [param src]. See [start] for mode of operation. + * **Note:** The size of [param src] must be a multiple of 16. Apply some padding if needed. */ public fun update(src: PackedByteArray): PackedByteArray { TransferContext.writeArguments(PACKED_BYTE_ARRAY to src) @@ -200,9 +134,10 @@ public open class AESContext : RefCounted() { } /** - * Get the current IV state for this context (IV gets updated when calling [update]). You normally don't need this function. - * - * **Note:** This function only makes sense when the context is started with [MODE_CBC_ENCRYPT] or [MODE_CBC_DECRYPT]. + * Get the current IV state for this context (IV gets updated when calling [update]). You normally + * don't need this function. + * **Note:** This function only makes sense when the context is started with [constant + * MODE_CBC_ENCRYPT] or [constant MODE_CBC_DECRYPT]. */ public fun getIvState(): PackedByteArray { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AStar2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AStar2D.kt index 7100b64d1..20abdedee 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AStar2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AStar2D.kt @@ -31,11 +31,10 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * An implementation of A* for finding the shortest path between two vertices on a connected graph in 2D space. - * - * An implementation of the A* algorithm, used to find the shortest path between two vertices on a connected graph in 2D space. - * - * See [godot.AStar3D] for a more thorough explanation on how to use this class. [godot.AStar2D] is a wrapper for [godot.AStar3D] that enforces 2D coordinates. + * An implementation of the A* algorithm, used to find the shortest path between two vertices on a + * connected graph in 2D space. + * See [AStar3D] for a more thorough explanation on how to use this class. [AStar2D] is a wrapper + * for [AStar3D] that enforces 2D coordinates. */ @GodotBaseType public open class AStar2D : RefCounted() { @@ -46,8 +45,7 @@ public open class AStar2D : RefCounted() { /** * Called when estimating the cost between a point and the path's ending point. - * - * Note that this function is hidden in the default [godot.AStar2D] class. + * Note that this function is hidden in the default [AStar2D] class. */ public open fun _estimateCost(fromId: Long, toId: Long): Float { throw NotImplementedError("_estimate_cost is not implemented for AStar2D") @@ -55,8 +53,7 @@ public open class AStar2D : RefCounted() { /** * Called when computing the cost between two connected points. - * - * Note that this function is hidden in the default [godot.AStar2D] class. + * Note that this function is hidden in the default [AStar2D] class. */ public open fun _computeCost(fromId: Long, toId: Long): Float { throw NotImplementedError("_compute_cost is not implemented for AStar2D") @@ -72,31 +69,25 @@ public open class AStar2D : RefCounted() { } /** - * Adds a new point at the given position with the given identifier. The [id] must be 0 or larger, and the [weightScale] must be 0.0 or greater. - * - * The [weightScale] is multiplied by the result of [_computeCost] when determining the overall cost of traveling across a segment from a neighboring point to this point. Thus, all else being equal, the algorithm prefers points with lower [weightScale]s to form a path. - * - * [codeblocks] - * - * [gdscript] - * + * Adds a new point at the given position with the given identifier. The [param id] must be 0 or + * larger, and the [param weight_scale] must be 0.0 or greater. + * The [param weight_scale] is multiplied by the result of [_computeCost] when determining the + * overall cost of traveling across a segment from a neighboring point to this point. Thus, all else + * being equal, the algorithm prefers points with lower [param weight_scale]s to form a path. + * + * gdscript: + * ```gdscript * var astar = AStar2D.new() - * * astar.add_point(1, Vector2(1, 0), 4) # Adds the point (1, 0) with weight_scale 4 and id 1 - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * var astar = new AStar2D(); - * * astar.AddPoint(1, new Vector2(1, 0), 4); // Adds the point (1, 0) with weight_scale 4 and id 1 + * ``` * - * [/csharp] - * - * [/codeblocks] - * - * If there already exists a point for the given [id], its position and weight scale are updated to the given values. + * If there already exists a point for the given [param id], its position and weight scale are + * updated to the given values. */ @JvmOverloads public fun addPoint( @@ -109,7 +100,7 @@ public open class AStar2D : RefCounted() { } /** - * Returns the position of the point associated with the given [id]. + * Returns the position of the point associated with the given [param id]. */ public fun getPointPosition(id: Long): Vector2 { TransferContext.writeArguments(LONG to id) @@ -118,7 +109,7 @@ public open class AStar2D : RefCounted() { } /** - * Sets the [position] for the point with the given [id]. + * Sets the [param position] for the point with the given [param id]. */ public fun setPointPosition(id: Long, position: Vector2): Unit { TransferContext.writeArguments(LONG to id, VECTOR2 to position) @@ -126,7 +117,7 @@ public open class AStar2D : RefCounted() { } /** - * Returns the weight scale of the point associated with the given [id]. + * Returns the weight scale of the point associated with the given [param id]. */ public fun getPointWeightScale(id: Long): Float { TransferContext.writeArguments(LONG to id) @@ -135,7 +126,9 @@ public open class AStar2D : RefCounted() { } /** - * Sets the [weightScale] for the point with the given [id]. The [weightScale] is multiplied by the result of [_computeCost] when determining the overall cost of traveling across a segment from a neighboring point to this point. + * Sets the [param weight_scale] for the point with the given [param id]. The [param weight_scale] + * is multiplied by the result of [_computeCost] when determining the overall cost of traveling + * across a segment from a neighboring point to this point. */ public fun setPointWeightScale(id: Long, weightScale: Float): Unit { TransferContext.writeArguments(LONG to id, DOUBLE to weightScale.toDouble()) @@ -143,7 +136,7 @@ public open class AStar2D : RefCounted() { } /** - * Removes the point associated with the given [id] from the points pool. + * Removes the point associated with the given [param id] from the points pool. */ public fun removePoint(id: Long): Unit { TransferContext.writeArguments(LONG to id) @@ -151,7 +144,7 @@ public open class AStar2D : RefCounted() { } /** - * Returns whether a point associated with the given [id] exists. + * Returns whether a point associated with the given [param id] exists. */ public fun hasPoint(id: Long): Boolean { TransferContext.writeArguments(LONG to id) @@ -162,57 +155,32 @@ public open class AStar2D : RefCounted() { /** * Returns an array with the IDs of the points that form the connection with the given point. * - * [codeblocks] - * - * [gdscript] - * + * gdscript: + * ```gdscript * var astar = AStar2D.new() - * * astar.add_point(1, Vector2(0, 0)) - * * astar.add_point(2, Vector2(0, 1)) - * * astar.add_point(3, Vector2(1, 1)) - * * astar.add_point(4, Vector2(2, 0)) * - * - * * astar.connect_points(1, 2, true) - * * astar.connect_points(1, 3, true) * - * - * * var neighbors = astar.get_point_connections(1) # Returns [2, 3] - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * var astar = new AStar2D(); - * * astar.AddPoint(1, new Vector2(0, 0)); - * * astar.AddPoint(2, new Vector2(0, 1)); - * * astar.AddPoint(3, new Vector2(1, 1)); - * * astar.AddPoint(4, new Vector2(2, 0)); * - * - * * astar.ConnectPoints(1, 2, true); - * * astar.ConnectPoints(1, 3, true); * - * - * * int[] neighbors = astar.GetPointConnections(1); // Returns [2, 3] - * - * [/csharp] - * - * [/codeblocks] + * ``` */ public fun getPointConnections(id: Long): PackedInt64Array { TransferContext.writeArguments(LONG to id) @@ -230,7 +198,8 @@ public open class AStar2D : RefCounted() { } /** - * Disables or enables the specified point for pathfinding. Useful for making a temporary obstacle. + * Disables or enables the specified point for pathfinding. Useful for making a temporary + * obstacle. */ @JvmOverloads public fun setPointDisabled(id: Long, disabled: Boolean = true): Unit { @@ -248,35 +217,23 @@ public open class AStar2D : RefCounted() { } /** - * Creates a segment between the given points. If [bidirectional] is `false`, only movement from [id] to [toId] is allowed, not the reverse direction. - * - * [codeblocks] - * - * [gdscript] + * Creates a segment between the given points. If [param bidirectional] is `false`, only movement + * from [param id] to [param to_id] is allowed, not the reverse direction. * + * gdscript: + * ```gdscript * var astar = AStar2D.new() - * * astar.add_point(1, Vector2(1, 1)) - * * astar.add_point(2, Vector2(0, 5)) - * * astar.connect_points(1, 2, false) - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * var astar = new AStar2D(); - * * astar.AddPoint(1, new Vector2(1, 1)); - * * astar.AddPoint(2, new Vector2(0, 5)); - * * astar.ConnectPoints(1, 2, false); - * - * [/csharp] - * - * [/codeblocks] + * ``` */ @JvmOverloads public fun connectPoints( @@ -289,7 +246,9 @@ public open class AStar2D : RefCounted() { } /** - * Deletes the segment between the given points. If [bidirectional] is `false`, only movement from [id] to [toId] is prevented, and a unidirectional segment possibly remains. + * Deletes the segment between the given points. If [param bidirectional] is `false`, only + * movement from [param id] to [param to_id] is prevented, and a unidirectional segment possibly + * remains. */ @JvmOverloads public fun disconnectPoints( @@ -302,7 +261,9 @@ public open class AStar2D : RefCounted() { } /** - * Returns whether there is a connection/segment between the given points. If [bidirectional] is `false`, returns whether movement from [id] to [toId] is possible through this segment. + * Returns whether there is a connection/segment between the given points. If [param + * bidirectional] is `false`, returns whether movement from [param id] to [param to_id] is possible + * through this segment. */ @JvmOverloads public fun arePointsConnected( @@ -325,7 +286,8 @@ public open class AStar2D : RefCounted() { } /** - * Returns the capacity of the structure backing the points, useful in conjunction with [reserveSpace]. + * Returns the capacity of the structure backing the points, useful in conjunction with + * [reserveSpace]. */ public fun getPointCapacity(): Long { TransferContext.writeArguments() @@ -334,7 +296,9 @@ public open class AStar2D : RefCounted() { } /** - * Reserves space internally for [numNodes] points, useful if you're adding a known large number of points at once, such as points on a grid. New capacity must be greater or equals to old capacity. + * Reserves space internally for [param num_nodes] points, useful if you're adding a known large + * number of points at once, such as points on a grid. New capacity must be greater or equals to old + * capacity. */ public fun reserveSpace(numNodes: Long): Unit { TransferContext.writeArguments(LONG to numNodes) @@ -350,9 +314,10 @@ public open class AStar2D : RefCounted() { } /** - * Returns the ID of the closest point to [toPosition], optionally taking disabled points into account. Returns `-1` if there are no points in the points pool. - * - * **Note:** If several points are the closest to [toPosition], the one with the smallest ID will be returned, ensuring a deterministic result. + * Returns the ID of the closest point to [param to_position], optionally taking disabled points + * into account. Returns `-1` if there are no points in the points pool. + * **Note:** If several points are the closest to [param to_position], the one with the smallest + * ID will be returned, ensuring a deterministic result. */ @JvmOverloads public fun getClosestPoint(toPosition: Vector2, includeDisabled: Boolean = false): Long { @@ -362,41 +327,28 @@ public open class AStar2D : RefCounted() { } /** - * Returns the closest position to [toPosition] that resides inside a segment between two connected points. - * - * [codeblocks] - * - * [gdscript] + * Returns the closest position to [param to_position] that resides inside a segment between two + * connected points. * + * gdscript: + * ```gdscript * var astar = AStar2D.new() - * * astar.add_point(1, Vector2(0, 0)) - * * astar.add_point(2, Vector2(0, 5)) - * * astar.connect_points(1, 2) - * * var res = astar.get_closest_position_in_segment(Vector2(3, 3)) # Returns (0, 3) - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * var astar = new AStar2D(); - * * astar.AddPoint(1, new Vector2(0, 0)); - * * astar.AddPoint(2, new Vector2(0, 5)); - * * astar.ConnectPoints(1, 2); - * * Vector2 res = astar.GetClosestPositionInSegment(new Vector2(3, 3)); // Returns (0, 3) + * ``` * - * [/csharp] - * - * [/codeblocks] - * - * The result is in the segment that goes from `y = 0` to `y = 5`. It's the closest position in the segment to the given point. + * The result is in the segment that goes from `y = 0` to `y = 5`. It's the closest position in + * the segment to the given point. */ public fun getClosestPositionInSegment(toPosition: Vector2): Vector2 { TransferContext.writeArguments(VECTOR2 to toPosition) @@ -405,9 +357,10 @@ public open class AStar2D : RefCounted() { } /** - * Returns an array with the points that are in the path found by AStar2D between the given points. The array is ordered from the starting point to the ending point of the path. - * - * **Note:** This method is not thread-safe. If called from a [godot.Thread], it will return an empty [godot.PackedVector2Array] and will print an error message. + * Returns an array with the points that are in the path found by AStar2D between the given + * points. The array is ordered from the starting point to the ending point of the path. + * **Note:** This method is not thread-safe. If called from a [Thread], it will return an empty + * [PackedVector2Array] and will print an error message. */ public fun getPointPath(fromId: Long, toId: Long): PackedVector2Array { TransferContext.writeArguments(LONG to fromId, LONG to toId) @@ -416,67 +369,41 @@ public open class AStar2D : RefCounted() { } /** - * Returns an array with the IDs of the points that form the path found by AStar2D between the given points. The array is ordered from the starting point to the ending point of the path. - * - * [codeblocks] - * - * [gdscript] + * Returns an array with the IDs of the points that form the path found by AStar2D between the + * given points. The array is ordered from the starting point to the ending point of the path. * + * gdscript: + * ```gdscript * var astar = AStar2D.new() - * * astar.add_point(1, Vector2(0, 0)) - * * astar.add_point(2, Vector2(0, 1), 1) # Default weight is 1 - * * astar.add_point(3, Vector2(1, 1)) - * * astar.add_point(4, Vector2(2, 0)) * - * - * * astar.connect_points(1, 2, false) - * * astar.connect_points(2, 3, false) - * * astar.connect_points(4, 3, false) - * * astar.connect_points(1, 4, false) * - * - * * var res = astar.get_id_path(1, 3) # Returns [1, 2, 3] - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * var astar = new AStar2D(); - * * astar.AddPoint(1, new Vector2(0, 0)); - * * astar.AddPoint(2, new Vector2(0, 1), 1); // Default weight is 1 - * * astar.AddPoint(3, new Vector2(1, 1)); - * * astar.AddPoint(4, new Vector2(2, 0)); * - * - * * astar.ConnectPoints(1, 2, false); - * * astar.ConnectPoints(2, 3, false); - * * astar.ConnectPoints(4, 3, false); - * * astar.ConnectPoints(1, 4, false); - * * int[] res = astar.GetIdPath(1, 3); // Returns [1, 2, 3] + * ``` * - * [/csharp] - * - * [/codeblocks] - * - * If you change the 2nd point's weight to 3, then the result will be `[1, 4, 3]` instead, because now even though the distance is longer, it's "easier" to get through point 4 than through point 2. + * If you change the 2nd point's weight to 3, then the result will be `[1, 4, 3]` instead, because + * now even though the distance is longer, it's "easier" to get through point 4 than through point 2. */ public fun getIdPath(fromId: Long, toId: Long): PackedInt64Array { TransferContext.writeArguments(LONG to fromId, LONG to toId) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AStar3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AStar3D.kt index 5d1c307a5..367eb0f45 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AStar3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AStar3D.kt @@ -31,69 +31,55 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * An implementation of A* for finding the shortest path between two vertices on a connected graph in 3D space. - * - * A* (A star) is a computer algorithm used in pathfinding and graph traversal, the process of plotting short paths among vertices (points), passing through a given set of edges (segments). It enjoys widespread use due to its performance and accuracy. Godot's A* implementation uses points in 3D space and Euclidean distances by default. - * - * You must add points manually with [addPoint] and create segments manually with [connectPoints]. Once done, you can test if there is a path between two points with the [arePointsConnected] function, get a path containing indices by [getIdPath], or one containing actual coordinates with [getPointPath]. - * - * It is also possible to use non-Euclidean distances. To do so, create a class that extends [godot.AStar3D] and override methods [_computeCost] and [_estimateCost]. Both take two indices and return a length, as is shown in the following example. - * - * [codeblocks] - * - * [gdscript] - * + * A* (A star) is a computer algorithm used in pathfinding and graph traversal, the process of + * plotting short paths among vertices (points), passing through a given set of edges (segments). It + * enjoys widespread use due to its performance and accuracy. Godot's A* implementation uses points in + * 3D space and Euclidean distances by default. + * You must add points manually with [addPoint] and create segments manually with [connectPoints]. + * Once done, you can test if there is a path between two points with the [arePointsConnected] + * function, get a path containing indices by [getIdPath], or one containing actual coordinates with + * [getPointPath]. + * It is also possible to use non-Euclidean distances. To do so, create a class that extends + * [AStar3D] and override methods [_computeCost] and [_estimateCost]. Both take two indices and return + * a length, as is shown in the following example. + * + * gdscript: + * ```gdscript * class MyAStar: - * * extends AStar3D * - * - * * func _compute_cost(u, v): - * * return abs(u - v) * - * - * * func _estimate_cost(u, v): - * * return min(0, abs(u - v) - 1) - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * public partial class MyAStar : AStar3D - * * { - * * public override float _ComputeCost(long fromId, long toId) - * * { - * * return Mathf.Abs((int)(fromId - toId)); - * * } * - * - * * public override float _EstimateCost(long fromId, long toId) - * * { - * * return Mathf.Min(0, Mathf.Abs((int)(fromId - toId)) - 1); - * * } - * * } - * - * [/csharp] - * - * [/codeblocks] - * - * [_estimateCost] should return a lower bound of the distance, i.e. `_estimate_cost(u, v) <= _compute_cost(u, v)`. This serves as a hint to the algorithm because the custom [_computeCost] might be computation-heavy. If this is not the case, make [_estimateCost] return the same value as [_computeCost] to provide the algorithm with the most accurate information. - * - * If the default [_estimateCost] and [_computeCost] methods are used, or if the supplied [_estimateCost] method returns a lower bound of the cost, then the paths returned by A* will be the lowest-cost paths. Here, the cost of a path equals the sum of the [_computeCost] results of all segments in the path multiplied by the `weight_scale`s of the endpoints of the respective segments. If the default methods are used and the `weight_scale`s of all points are set to `1.0`, then this equals the sum of Euclidean distances of all segments in the path. + * ``` + * + * [_estimateCost] should return a lower bound of the distance, i.e. `_estimate_cost(u, v) <= + * _compute_cost(u, v)`. This serves as a hint to the algorithm because the custom [_computeCost] might + * be computation-heavy. If this is not the case, make [_estimateCost] return the same value as + * [_computeCost] to provide the algorithm with the most accurate information. + * If the default [_estimateCost] and [_computeCost] methods are used, or if the supplied + * [_estimateCost] method returns a lower bound of the cost, then the paths returned by A* will be the + * lowest-cost paths. Here, the cost of a path equals the sum of the [_computeCost] results of all + * segments in the path multiplied by the `weight_scale`s of the endpoints of the respective segments. + * If the default methods are used and the `weight_scale`s of all points are set to `1.0`, then this + * equals the sum of Euclidean distances of all segments in the path. */ @GodotBaseType public open class AStar3D : RefCounted() { @@ -104,8 +90,7 @@ public open class AStar3D : RefCounted() { /** * Called when estimating the cost between a point and the path's ending point. - * - * Note that this function is hidden in the default [godot.AStar3D] class. + * Note that this function is hidden in the default [AStar3D] class. */ public open fun _estimateCost(fromId: Long, toId: Long): Float { throw NotImplementedError("_estimate_cost is not implemented for AStar3D") @@ -113,8 +98,7 @@ public open class AStar3D : RefCounted() { /** * Called when computing the cost between two connected points. - * - * Note that this function is hidden in the default [godot.AStar3D] class. + * Note that this function is hidden in the default [AStar3D] class. */ public open fun _computeCost(fromId: Long, toId: Long): Float { throw NotImplementedError("_compute_cost is not implemented for AStar3D") @@ -130,31 +114,26 @@ public open class AStar3D : RefCounted() { } /** - * Adds a new point at the given position with the given identifier. The [id] must be 0 or larger, and the [weightScale] must be 0.0 or greater. - * - * The [weightScale] is multiplied by the result of [_computeCost] when determining the overall cost of traveling across a segment from a neighboring point to this point. Thus, all else being equal, the algorithm prefers points with lower [weightScale]s to form a path. - * - * [codeblocks] - * - * [gdscript] - * + * Adds a new point at the given position with the given identifier. The [param id] must be 0 or + * larger, and the [param weight_scale] must be 0.0 or greater. + * The [param weight_scale] is multiplied by the result of [_computeCost] when determining the + * overall cost of traveling across a segment from a neighboring point to this point. Thus, all else + * being equal, the algorithm prefers points with lower [param weight_scale]s to form a path. + * + * gdscript: + * ```gdscript * var astar = AStar3D.new() - * * astar.add_point(1, Vector3(1, 0, 0), 4) # Adds the point (1, 0, 0) with weight_scale 4 and id 1 - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * var astar = new AStar3D(); + * astar.AddPoint(1, new Vector3(1, 0, 0), 4); // Adds the point (1, 0, 0) with weight_scale 4 and + * id 1 + * ``` * - * astar.AddPoint(1, new Vector3(1, 0, 0), 4); // Adds the point (1, 0, 0) with weight_scale 4 and id 1 - * - * [/csharp] - * - * [/codeblocks] - * - * If there already exists a point for the given [id], its position and weight scale are updated to the given values. + * If there already exists a point for the given [param id], its position and weight scale are + * updated to the given values. */ @JvmOverloads public fun addPoint( @@ -167,7 +146,7 @@ public open class AStar3D : RefCounted() { } /** - * Returns the position of the point associated with the given [id]. + * Returns the position of the point associated with the given [param id]. */ public fun getPointPosition(id: Long): Vector3 { TransferContext.writeArguments(LONG to id) @@ -176,7 +155,7 @@ public open class AStar3D : RefCounted() { } /** - * Sets the [position] for the point with the given [id]. + * Sets the [param position] for the point with the given [param id]. */ public fun setPointPosition(id: Long, position: Vector3): Unit { TransferContext.writeArguments(LONG to id, VECTOR3 to position) @@ -184,7 +163,7 @@ public open class AStar3D : RefCounted() { } /** - * Returns the weight scale of the point associated with the given [id]. + * Returns the weight scale of the point associated with the given [param id]. */ public fun getPointWeightScale(id: Long): Float { TransferContext.writeArguments(LONG to id) @@ -193,7 +172,9 @@ public open class AStar3D : RefCounted() { } /** - * Sets the [weightScale] for the point with the given [id]. The [weightScale] is multiplied by the result of [_computeCost] when determining the overall cost of traveling across a segment from a neighboring point to this point. + * Sets the [param weight_scale] for the point with the given [param id]. The [param weight_scale] + * is multiplied by the result of [_computeCost] when determining the overall cost of traveling + * across a segment from a neighboring point to this point. */ public fun setPointWeightScale(id: Long, weightScale: Float): Unit { TransferContext.writeArguments(LONG to id, DOUBLE to weightScale.toDouble()) @@ -201,7 +182,7 @@ public open class AStar3D : RefCounted() { } /** - * Removes the point associated with the given [id] from the points pool. + * Removes the point associated with the given [param id] from the points pool. */ public fun removePoint(id: Long): Unit { TransferContext.writeArguments(LONG to id) @@ -209,7 +190,7 @@ public open class AStar3D : RefCounted() { } /** - * Returns whether a point associated with the given [id] exists. + * Returns whether a point associated with the given [param id] exists. */ public fun hasPoint(id: Long): Boolean { TransferContext.writeArguments(LONG to id) @@ -220,55 +201,31 @@ public open class AStar3D : RefCounted() { /** * Returns an array with the IDs of the points that form the connection with the given point. * - * [codeblocks] - * - * [gdscript] - * + * gdscript: + * ```gdscript * var astar = AStar3D.new() - * * astar.add_point(1, Vector3(0, 0, 0)) - * * astar.add_point(2, Vector3(0, 1, 0)) - * * astar.add_point(3, Vector3(1, 1, 0)) - * * astar.add_point(4, Vector3(2, 0, 0)) * - * - * * astar.connect_points(1, 2, true) - * * astar.connect_points(1, 3, true) * - * - * * var neighbors = astar.get_point_connections(1) # Returns [2, 3] - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * var astar = new AStar3D(); - * * astar.AddPoint(1, new Vector3(0, 0, 0)); - * * astar.AddPoint(2, new Vector3(0, 1, 0)); - * * astar.AddPoint(3, new Vector3(1, 1, 0)); - * * astar.AddPoint(4, new Vector3(2, 0, 0)); - * * astar.ConnectPoints(1, 2, true); - * * astar.ConnectPoints(1, 3, true); * - * - * * int[] neighbors = astar.GetPointConnections(1); // Returns [2, 3] - * - * [/csharp] - * - * [/codeblocks] + * ``` */ public fun getPointConnections(id: Long): PackedInt64Array { TransferContext.writeArguments(LONG to id) @@ -286,7 +243,8 @@ public open class AStar3D : RefCounted() { } /** - * Disables or enables the specified point for pathfinding. Useful for making a temporary obstacle. + * Disables or enables the specified point for pathfinding. Useful for making a temporary + * obstacle. */ @JvmOverloads public fun setPointDisabled(id: Long, disabled: Boolean = true): Unit { @@ -304,35 +262,23 @@ public open class AStar3D : RefCounted() { } /** - * Creates a segment between the given points. If [bidirectional] is `false`, only movement from [id] to [toId] is allowed, not the reverse direction. - * - * [codeblocks] - * - * [gdscript] + * Creates a segment between the given points. If [param bidirectional] is `false`, only movement + * from [param id] to [param to_id] is allowed, not the reverse direction. * + * gdscript: + * ```gdscript * var astar = AStar3D.new() - * * astar.add_point(1, Vector3(1, 1, 0)) - * * astar.add_point(2, Vector3(0, 5, 0)) - * * astar.connect_points(1, 2, false) - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * var astar = new AStar3D(); - * * astar.AddPoint(1, new Vector3(1, 1, 0)); - * * astar.AddPoint(2, new Vector3(0, 5, 0)); - * * astar.ConnectPoints(1, 2, false); - * - * [/csharp] - * - * [/codeblocks] + * ``` */ @JvmOverloads public fun connectPoints( @@ -345,7 +291,9 @@ public open class AStar3D : RefCounted() { } /** - * Deletes the segment between the given points. If [bidirectional] is `false`, only movement from [id] to [toId] is prevented, and a unidirectional segment possibly remains. + * Deletes the segment between the given points. If [param bidirectional] is `false`, only + * movement from [param id] to [param to_id] is prevented, and a unidirectional segment possibly + * remains. */ @JvmOverloads public fun disconnectPoints( @@ -358,7 +306,9 @@ public open class AStar3D : RefCounted() { } /** - * Returns whether the two given points are directly connected by a segment. If [bidirectional] is `false`, returns whether movement from [id] to [toId] is possible through this segment. + * Returns whether the two given points are directly connected by a segment. If [param + * bidirectional] is `false`, returns whether movement from [param id] to [param to_id] is possible + * through this segment. */ @JvmOverloads public fun arePointsConnected( @@ -381,7 +331,8 @@ public open class AStar3D : RefCounted() { } /** - * Returns the capacity of the structure backing the points, useful in conjunction with [reserveSpace]. + * Returns the capacity of the structure backing the points, useful in conjunction with + * [reserveSpace]. */ public fun getPointCapacity(): Long { TransferContext.writeArguments() @@ -390,7 +341,9 @@ public open class AStar3D : RefCounted() { } /** - * Reserves space internally for [numNodes] points. Useful if you're adding a known large number of points at once, such as points on a grid. New capacity must be greater or equals to old capacity. + * Reserves space internally for [param num_nodes] points. Useful if you're adding a known large + * number of points at once, such as points on a grid. New capacity must be greater or equals to old + * capacity. */ public fun reserveSpace(numNodes: Long): Unit { TransferContext.writeArguments(LONG to numNodes) @@ -406,9 +359,10 @@ public open class AStar3D : RefCounted() { } /** - * Returns the ID of the closest point to [toPosition], optionally taking disabled points into account. Returns `-1` if there are no points in the points pool. - * - * **Note:** If several points are the closest to [toPosition], the one with the smallest ID will be returned, ensuring a deterministic result. + * Returns the ID of the closest point to [param to_position], optionally taking disabled points + * into account. Returns `-1` if there are no points in the points pool. + * **Note:** If several points are the closest to [param to_position], the one with the smallest + * ID will be returned, ensuring a deterministic result. */ @JvmOverloads public fun getClosestPoint(toPosition: Vector3, includeDisabled: Boolean = false): Long { @@ -418,41 +372,28 @@ public open class AStar3D : RefCounted() { } /** - * Returns the closest position to [toPosition] that resides inside a segment between two connected points. - * - * [codeblocks] - * - * [gdscript] + * Returns the closest position to [param to_position] that resides inside a segment between two + * connected points. * + * gdscript: + * ```gdscript * var astar = AStar3D.new() - * * astar.add_point(1, Vector3(0, 0, 0)) - * * astar.add_point(2, Vector3(0, 5, 0)) - * * astar.connect_points(1, 2) - * * var res = astar.get_closest_position_in_segment(Vector3(3, 3, 0)) # Returns (0, 3, 0) - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * var astar = new AStar3D(); - * * astar.AddPoint(1, new Vector3(0, 0, 0)); - * * astar.AddPoint(2, new Vector3(0, 5, 0)); - * * astar.ConnectPoints(1, 2); - * * Vector3 res = astar.GetClosestPositionInSegment(new Vector3(3, 3, 0)); // Returns (0, 3, 0) + * ``` * - * [/csharp] - * - * [/codeblocks] - * - * The result is in the segment that goes from `y = 0` to `y = 5`. It's the closest position in the segment to the given point. + * The result is in the segment that goes from `y = 0` to `y = 5`. It's the closest position in + * the segment to the given point. */ public fun getClosestPositionInSegment(toPosition: Vector3): Vector3 { TransferContext.writeArguments(VECTOR3 to toPosition) @@ -461,9 +402,10 @@ public open class AStar3D : RefCounted() { } /** - * Returns an array with the points that are in the path found by AStar3D between the given points. The array is ordered from the starting point to the ending point of the path. - * - * **Note:** This method is not thread-safe. If called from a [godot.Thread], it will return an empty [godot.PackedVector3Array] and will print an error message. + * Returns an array with the points that are in the path found by AStar3D between the given + * points. The array is ordered from the starting point to the ending point of the path. + * **Note:** This method is not thread-safe. If called from a [Thread], it will return an empty + * [PackedVector3Array] and will print an error message. */ public fun getPointPath(fromId: Long, toId: Long): PackedVector3Array { TransferContext.writeArguments(LONG to fromId, LONG to toId) @@ -472,65 +414,40 @@ public open class AStar3D : RefCounted() { } /** - * Returns an array with the IDs of the points that form the path found by AStar3D between the given points. The array is ordered from the starting point to the ending point of the path. - * - * [codeblocks] - * - * [gdscript] + * Returns an array with the IDs of the points that form the path found by AStar3D between the + * given points. The array is ordered from the starting point to the ending point of the path. * + * gdscript: + * ```gdscript * var astar = AStar3D.new() - * * astar.add_point(1, Vector3(0, 0, 0)) - * * astar.add_point(2, Vector3(0, 1, 0), 1) # Default weight is 1 - * * astar.add_point(3, Vector3(1, 1, 0)) - * * astar.add_point(4, Vector3(2, 0, 0)) * - * - * * astar.connect_points(1, 2, false) - * * astar.connect_points(2, 3, false) - * * astar.connect_points(4, 3, false) - * * astar.connect_points(1, 4, false) * - * - * * var res = astar.get_id_path(1, 3) # Returns [1, 2, 3] - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * var astar = new AStar3D(); - * * astar.AddPoint(1, new Vector3(0, 0, 0)); - * * astar.AddPoint(2, new Vector3(0, 1, 0), 1); // Default weight is 1 - * * astar.AddPoint(3, new Vector3(1, 1, 0)); - * * astar.AddPoint(4, new Vector3(2, 0, 0)); - * * astar.ConnectPoints(1, 2, false); - * * astar.ConnectPoints(2, 3, false); - * * astar.ConnectPoints(4, 3, false); - * * astar.ConnectPoints(1, 4, false); - * * int[] res = astar.GetIdPath(1, 3); // Returns [1, 2, 3] + * ``` * - * [/csharp] - * - * [/codeblocks] - * - * If you change the 2nd point's weight to 3, then the result will be `[1, 4, 3]` instead, because now even though the distance is longer, it's "easier" to get through point 4 than through point 2. + * If you change the 2nd point's weight to 3, then the result will be `[1, 4, 3]` instead, because + * now even though the distance is longer, it's "easier" to get through point 4 than through point 2. */ public fun getIdPath(fromId: Long, toId: Long): PackedInt64Array { TransferContext.writeArguments(LONG to fromId, LONG to toId) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AcceptDialog.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AcceptDialog.kt index 4684bfc52..570b134c6 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AcceptDialog.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AcceptDialog.kt @@ -26,9 +26,9 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * A base dialog used for user notification. - * - * The default use of [godot.AcceptDialog] is to allow it to only be accepted or closed, with the same result. However, the [confirmed] and [canceled] signals allow to make the two actions different, and the [addButton] method allows to add custom buttons and actions. + * The default use of [AcceptDialog] is to allow it to only be accepted or closed, with the same + * result. However, the [signal confirmed] and [signal canceled] signals allow to make the two actions + * different, and the [addButton] method allows to add custom buttons and actions. */ @GodotBaseType public open class AcceptDialog : Window() { @@ -76,9 +76,14 @@ public open class AcceptDialog : Window() { } /** - * If `true`, the dialog is hidden when the OK button is pressed. You can set it to `false` if you want to do e.g. input validation when receiving the [confirmed] signal, and handle hiding the dialog in your own logic. - * - * **Note:** Some nodes derived from this class can have a different default value, and potentially their own built-in logic overriding this setting. For example [godot.FileDialog] defaults to `false`, and has its own input validation code that is called when you press OK, which eventually hides the dialog if the input is valid. As such, this property can't be used in [godot.FileDialog] to disable hiding the dialog when pressing OK. + * If `true`, the dialog is hidden when the OK button is pressed. You can set it to `false` if you + * want to do e.g. input validation when receiving the [signal confirmed] signal, and handle hiding + * the dialog in your own logic. + * **Note:** Some nodes derived from this class can have a different default value, and + * potentially their own built-in logic overriding this setting. For example [FileDialog] defaults to + * `false`, and has its own input validation code that is called when you press OK, which eventually + * hides the dialog if the input is valid. As such, this property can't be used in [FileDialog] to + * disable hiding the dialog when pressing OK. */ public var dialogHideOnOk: Boolean get() { @@ -92,7 +97,7 @@ public open class AcceptDialog : Window() { } /** - * If `true`, the dialog will be hidden when the escape key ([KEY_ESCAPE]) is pressed. + * If `true`, the dialog will be hidden when the escape key ([constant KEY_ESCAPE]) is pressed. */ public var dialogCloseOnEscape: Boolean get() { @@ -125,9 +130,9 @@ public open class AcceptDialog : Window() { } /** - * Returns the OK [godot.Button] instance. - * - * **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [godot.CanvasItem.visible] property. + * Returns the OK [Button] instance. + * **Warning:** This is a required internal node, removing and freeing it may cause a crash. If + * you wish to hide it or any of its children, use their [CanvasItem.visible] property. */ public fun getOkButton(): Button? { TransferContext.writeArguments() @@ -137,8 +142,8 @@ public open class AcceptDialog : Window() { /** * Returns the label used for built-in text. - * - * **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [godot.CanvasItem.visible] property. + * **Warning:** This is a required internal node, removing and freeing it may cause a crash. If + * you wish to hide it or any of its children, use their [CanvasItem.visible] property. */ public fun getLabel(): Label? { TransferContext.writeArguments() @@ -147,10 +152,9 @@ public open class AcceptDialog : Window() { } /** - * Adds a button with label [text] and a custom [action] to the dialog and returns the created button. [action] will be passed to the [customAction] signal when pressed. - * - * If `true`, [right] will place the button to the right of any sibling buttons. - * + * Adds a button with label [param text] and a custom [param action] to the dialog and returns the + * created button. [param action] will be passed to the [signal custom_action] signal when pressed. + * If `true`, [param right] will place the button to the right of any sibling buttons. * You can use [removeButton] method to remove a button created with this method from the dialog. */ @JvmOverloads @@ -165,8 +169,8 @@ public open class AcceptDialog : Window() { } /** - * Adds a button with label [name] and a cancel action to the dialog and returns the created button. - * + * Adds a button with label [param name] and a cancel action to the dialog and returns the created + * button. * You can use [removeButton] method to remove a button created with this method from the dialog. */ public fun addCancelButton(name: String): Button? { @@ -176,7 +180,10 @@ public open class AcceptDialog : Window() { } /** - * Removes the [button] from the dialog. Does NOT free the [button]. The [button] must be a [godot.Button] added with [addButton] or [addCancelButton] method. After removal, pressing the [button] will no longer emit this dialog's [customAction] or [canceled] signals. + * Removes the [param button] from the dialog. Does NOT free the [param button]. The [param + * button] must be a [Button] added with [addButton] or [addCancelButton] method. After removal, + * pressing the [param button] will no longer emit this dialog's [signal custom_action] or [signal + * canceled] signals. */ public fun removeButton(button: Control): Unit { TransferContext.writeArguments(OBJECT to button) @@ -184,7 +191,8 @@ public open class AcceptDialog : Window() { } /** - * Registers a [godot.LineEdit] in the dialog. When the enter key is pressed, the dialog will be accepted. + * Registers a [LineEdit] in the dialog. When the enter key is pressed, the dialog will be + * accepted. */ public fun registerTextEnter(lineEdit: Control): Unit { TransferContext.writeArguments(OBJECT to lineEdit) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimatableBody2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimatableBody2D.kt index e16d65ccd..cdfd9d426 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimatableBody2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimatableBody2D.kt @@ -17,16 +17,19 @@ import kotlin.Int import kotlin.Suppress /** - * A 2D physics body that can't be moved by external forces. When moved manually, it affects other bodies in its path. - * - * An animatable 2D physics body. It can't be moved by external forces or contacts, but can be moved manually by other means such as code, [godot.AnimationMixer]s (with [godot.AnimationMixer.callbackModeProcess] set to [godot.AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_PHYSICS]), and [godot.RemoteTransform2D]. - * - * When [godot.AnimatableBody2D] is moved, its linear and angular velocity are estimated and used to affect other physics bodies in its path. This makes it useful for moving platforms, doors, and other moving objects. + * An animatable 2D physics body. It can't be moved by external forces or contacts, but can be moved + * manually by other means such as code, [AnimationMixer]s (with [AnimationMixer.callbackModeProcess] + * set to [constant AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_PHYSICS]), and [RemoteTransform2D]. + * When [AnimatableBody2D] is moved, its linear and angular velocity are estimated and used to + * affect other physics bodies in its path. This makes it useful for moving platforms, doors, and other + * moving objects. */ @GodotBaseType public open class AnimatableBody2D : StaticBody2D() { /** - * If `true`, the body's movement will be synchronized to the physics frame. This is useful when animating movement via [godot.AnimationPlayer], for example on moving platforms. Do **not** use together with [godot.PhysicsBody2D.moveAndCollide]. + * If `true`, the body's movement will be synchronized to the physics frame. This is useful when + * animating movement via [AnimationPlayer], for example on moving platforms. Do **not** use together + * with [PhysicsBody2D.moveAndCollide]. */ public var syncToPhysics: Boolean get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimatableBody3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimatableBody3D.kt index def4971c3..f31dd653b 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimatableBody3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimatableBody3D.kt @@ -17,19 +17,19 @@ import kotlin.Int import kotlin.Suppress /** - * A 3D physics body that can't be moved by external forces. When moved manually, it affects other bodies in its path. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/676](https://godotengine.org/asset-library/asset/676) - * - * An animatable 3D physics body. It can't be moved by external forces or contacts, but can be moved manually by other means such as code, [godot.AnimationMixer]s (with [godot.AnimationMixer.callbackModeProcess] set to [godot.AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_PHYSICS]), and [godot.RemoteTransform3D]. - * - * When [godot.AnimatableBody3D] is moved, its linear and angular velocity are estimated and used to affect other physics bodies in its path. This makes it useful for moving platforms, doors, and other moving objects. + * An animatable 3D physics body. It can't be moved by external forces or contacts, but can be moved + * manually by other means such as code, [AnimationMixer]s (with [AnimationMixer.callbackModeProcess] + * set to [constant AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_PHYSICS]), and [RemoteTransform3D]. + * When [AnimatableBody3D] is moved, its linear and angular velocity are estimated and used to + * affect other physics bodies in its path. This makes it useful for moving platforms, doors, and other + * moving objects. */ @GodotBaseType public open class AnimatableBody3D : StaticBody3D() { /** - * If `true`, the body's movement will be synchronized to the physics frame. This is useful when animating movement via [godot.AnimationPlayer], for example on moving platforms. Do **not** use together with [godot.PhysicsBody3D.moveAndCollide]. + * If `true`, the body's movement will be synchronized to the physics frame. This is useful when + * animating movement via [AnimationPlayer], for example on moving platforms. Do **not** use together + * with [PhysicsBody3D.moveAndCollide]. */ public var syncToPhysics: Boolean get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimatedSprite2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimatedSprite2D.kt index f0fa0ab24..621b5c57c 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimatedSprite2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimatedSprite2D.kt @@ -35,12 +35,10 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * Sprite node that contains multiple textures as frames to play for animation. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/515](https://godotengine.org/asset-library/asset/515) - * - * [godot.AnimatedSprite2D] is similar to the [godot.Sprite2D] node, except it carries multiple textures as animation frames. Animations are created using a [godot.SpriteFrames] resource, which allows you to import image files (or a folder containing said files) to provide the animation frames for the sprite. The [godot.SpriteFrames] resource can be configured in the editor via the SpriteFrames bottom panel. + * [AnimatedSprite2D] is similar to the [Sprite2D] node, except it carries multiple textures as + * animation frames. Animations are created using a [SpriteFrames] resource, which allows you to import + * image files (or a folder containing said files) to provide the animation frames for the sprite. The + * [SpriteFrames] resource can be configured in the editor via the SpriteFrames bottom panel. */ @GodotBaseType public open class AnimatedSprite2D : Node2D() { @@ -65,12 +63,14 @@ public open class AnimatedSprite2D : Node2D() { public val animationLooped: Signal0 by signal() /** - * Emitted when the animation reaches the end, or the start if it is played in reverse. When the animation finishes, it pauses the playback. + * Emitted when the animation reaches the end, or the start if it is played in reverse. When the + * animation finishes, it pauses the playback. */ public val animationFinished: Signal0 by signal() /** - * The [godot.SpriteFrames] resource containing the animation(s). Allows you the option to load, edit, clear, make unique and save the states of the [godot.SpriteFrames] resource. + * The [SpriteFrames] resource containing the animation(s). Allows you the option to load, edit, + * clear, make unique and save the states of the [SpriteFrames] resource. */ public var spriteFrames: SpriteFrames? get() { @@ -84,7 +84,8 @@ public open class AnimatedSprite2D : Node2D() { } /** - * The current animation from the [spriteFrames] resource. If this value is changed, the [frame] counter and the [frameProgress] are reset. + * The current animation from the [spriteFrames] resource. If this value is changed, the [frame] + * counter and the [frameProgress] are reset. */ public var animation: StringName get() { @@ -112,7 +113,8 @@ public open class AnimatedSprite2D : Node2D() { } /** - * The displayed animation frame's index. Setting this property also resets [frameProgress]. If this is not desired, use [setFrameAndProgress]. + * The displayed animation frame's index. Setting this property also resets [frameProgress]. If + * this is not desired, use [setFrameAndProgress]. */ public var frame: Int get() { @@ -126,7 +128,8 @@ public open class AnimatedSprite2D : Node2D() { } /** - * The progress value between `0.0` and `1.0` until the current frame transitions to the next frame. If the animation is playing backwards, the value transitions from `1.0` to `0.0`. + * The progress value between `0.0` and `1.0` until the current frame transitions to the next + * frame. If the animation is playing backwards, the value transitions from `1.0` to `0.0`. */ public var frameProgress: Float get() { @@ -140,9 +143,10 @@ public open class AnimatedSprite2D : Node2D() { } /** - * The speed scaling ratio. For example, if this value is `1`, then the animation plays at normal speed. If it's `0.5`, then it plays at half speed. If it's `2`, then it plays at double speed. - * - * If set to a negative value, the animation is played in reverse. If set to `0`, the animation will not advance. + * The speed scaling ratio. For example, if this value is `1`, then the animation plays at normal + * speed. If it's `0.5`, then it plays at half speed. If it's `2`, then it plays at double speed. + * If set to a negative value, the animation is played in reverse. If set to `0`, the animation + * will not advance. */ public var speedScale: Float get() { @@ -242,7 +246,8 @@ public open class AnimatedSprite2D : Node2D() { /** - * Returns `true` if an animation is currently playing (even if [speedScale] and/or `custom_speed` are `0`). + * Returns `true` if an animation is currently playing (even if [speedScale] and/or `custom_speed` + * are `0`). */ public fun isPlaying(): Boolean { TransferContext.writeArguments() @@ -251,9 +256,11 @@ public open class AnimatedSprite2D : Node2D() { } /** - * Plays the animation with key [name]. If [customSpeed] is negative and [fromEnd] is `true`, the animation will play backwards (which is equivalent to calling [playBackwards]). - * - * If this method is called with that same animation [name], or with no [name] parameter, the assigned animation will resume playing if it was paused. + * Plays the animation with key [param name]. If [param custom_speed] is negative and [param + * from_end] is `true`, the animation will play backwards (which is equivalent to calling + * [playBackwards]). + * If this method is called with that same animation [param name], or with no [param name] + * parameter, the assigned animation will resume playing if it was paused. */ @JvmOverloads public fun play( @@ -266,9 +273,9 @@ public open class AnimatedSprite2D : Node2D() { } /** - * Plays the animation with key [name] in reverse. - * - * This method is a shorthand for [play] with `custom_speed = -1.0` and `from_end = true`, so see its description for more information. + * Plays the animation with key [param name] in reverse. + * This method is a shorthand for [play] with `custom_speed = -1.0` and `from_end = true`, so see + * its description for more information. */ @JvmOverloads public fun playBackwards(name: StringName = StringName("")): Unit { @@ -277,8 +284,9 @@ public open class AnimatedSprite2D : Node2D() { } /** - * Pauses the currently playing animation. The [frame] and [frameProgress] will be kept and calling [play] or [playBackwards] without arguments will resume the animation from the current playback position. - * + * Pauses the currently playing animation. The [frame] and [frameProgress] will be kept and + * calling [play] or [playBackwards] without arguments will resume the animation from the current + * playback position. * See also [stop]. */ public fun pause(): Unit { @@ -287,7 +295,8 @@ public open class AnimatedSprite2D : Node2D() { } /** - * Stops the currently playing animation. The animation position is reset to `0` and the `custom_speed` is reset to `1.0`. See also [pause]. + * Stops the currently playing animation. The animation position is reset to `0` and the + * `custom_speed` is reset to `1.0`. See also [pause]. */ public fun stop(): Unit { TransferContext.writeArguments() @@ -295,29 +304,19 @@ public open class AnimatedSprite2D : Node2D() { } /** - * The setter of [frame] resets the [frameProgress] to `0.0` implicitly, but this method avoids that. - * + * The setter of [frame] resets the [frameProgress] to `0.0` implicitly, but this method avoids + * that. * This is useful when you want to carry over the current [frameProgress] to another [frame]. - * * **Example:** * - * [codeblocks] - * - * [gdscript] - * + * gdscript: + * ```gdscript * # Change the animation with keeping the frame index and progress. - * * var current_frame = animated_sprite.get_frame() - * * var current_progress = animated_sprite.get_frame_progress() - * * animated_sprite.play("walk_another_skin") - * * animated_sprite.set_frame_and_progress(current_frame, current_progress) - * - * [/gdscript] - * - * [/codeblocks] + * ``` */ public fun setFrameAndProgress(frame: Int, progress: Float): Unit { TransferContext.writeArguments(LONG to frame.toLong(), DOUBLE to progress.toDouble()) @@ -325,8 +324,9 @@ public open class AnimatedSprite2D : Node2D() { } /** - * Returns the actual playing speed of current animation or `0` if not playing. This speed is the [speedScale] property multiplied by `custom_speed` argument specified when calling the [play] method. - * + * Returns the actual playing speed of current animation or `0` if not playing. This speed is the + * [speedScale] property multiplied by `custom_speed` argument specified when calling the [play] + * method. * Returns a negative value if the current animation is playing backwards. */ public fun getPlayingSpeed(): Float { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimatedSprite3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimatedSprite3D.kt index ce4fa93c6..83619fc66 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimatedSprite3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimatedSprite3D.kt @@ -31,12 +31,11 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * 2D sprite node in 3D world, that can use multiple 2D textures for animation. - * - * Tutorials: - * [$DOCS_URL/tutorials/2d/2d_sprite_animation.html]($DOCS_URL/tutorials/2d/2d_sprite_animation.html) - * - * [godot.AnimatedSprite3D] is similar to the [godot.Sprite3D] node, except it carries multiple textures as animation [spriteFrames]. Animations are created using a [godot.SpriteFrames] resource, which allows you to import image files (or a folder containing said files) to provide the animation frames for the sprite. The [godot.SpriteFrames] resource can be configured in the editor via the SpriteFrames bottom panel. + * [AnimatedSprite3D] is similar to the [Sprite3D] node, except it carries multiple textures as + * animation [spriteFrames]. Animations are created using a [SpriteFrames] resource, which allows you + * to import image files (or a folder containing said files) to provide the animation frames for the + * sprite. The [SpriteFrames] resource can be configured in the editor via the SpriteFrames bottom + * panel. */ @GodotBaseType public open class AnimatedSprite3D : SpriteBase3D() { @@ -61,12 +60,14 @@ public open class AnimatedSprite3D : SpriteBase3D() { public val animationLooped: Signal0 by signal() /** - * Emitted when the animation reaches the end, or the start if it is played in reverse. When the animation finishes, it pauses the playback. + * Emitted when the animation reaches the end, or the start if it is played in reverse. When the + * animation finishes, it pauses the playback. */ public val animationFinished: Signal0 by signal() /** - * The [godot.SpriteFrames] resource containing the animation(s). Allows you the option to load, edit, clear, make unique and save the states of the [godot.SpriteFrames] resource. + * The [SpriteFrames] resource containing the animation(s). Allows you the option to load, edit, + * clear, make unique and save the states of the [SpriteFrames] resource. */ public var spriteFrames: SpriteFrames? get() { @@ -80,7 +81,8 @@ public open class AnimatedSprite3D : SpriteBase3D() { } /** - * The current animation from the [spriteFrames] resource. If this value is changed, the [frame] counter and the [frameProgress] are reset. + * The current animation from the [spriteFrames] resource. If this value is changed, the [frame] + * counter and the [frameProgress] are reset. */ public var animation: StringName get() { @@ -108,7 +110,8 @@ public open class AnimatedSprite3D : SpriteBase3D() { } /** - * The displayed animation frame's index. Setting this property also resets [frameProgress]. If this is not desired, use [setFrameAndProgress]. + * The displayed animation frame's index. Setting this property also resets [frameProgress]. If + * this is not desired, use [setFrameAndProgress]. */ public var frame: Int get() { @@ -122,7 +125,8 @@ public open class AnimatedSprite3D : SpriteBase3D() { } /** - * The progress value between `0.0` and `1.0` until the current frame transitions to the next frame. If the animation is playing backwards, the value transitions from `1.0` to `0.0`. + * The progress value between `0.0` and `1.0` until the current frame transitions to the next + * frame. If the animation is playing backwards, the value transitions from `1.0` to `0.0`. */ public var frameProgress: Float get() { @@ -136,9 +140,10 @@ public open class AnimatedSprite3D : SpriteBase3D() { } /** - * The speed scaling ratio. For example, if this value is `1`, then the animation plays at normal speed. If it's `0.5`, then it plays at half speed. If it's `2`, then it plays at double speed. - * - * If set to a negative value, the animation is played in reverse. If set to `0`, the animation will not advance. + * The speed scaling ratio. For example, if this value is `1`, then the animation plays at normal + * speed. If it's `0.5`, then it plays at half speed. If it's `2`, then it plays at double speed. + * If set to a negative value, the animation is played in reverse. If set to `0`, the animation + * will not advance. */ public var speedScale: Float get() { @@ -157,7 +162,8 @@ public open class AnimatedSprite3D : SpriteBase3D() { } /** - * Returns `true` if an animation is currently playing (even if [speedScale] and/or `custom_speed` are `0`). + * Returns `true` if an animation is currently playing (even if [speedScale] and/or `custom_speed` + * are `0`). */ public fun isPlaying(): Boolean { TransferContext.writeArguments() @@ -166,9 +172,11 @@ public open class AnimatedSprite3D : SpriteBase3D() { } /** - * Plays the animation with key [name]. If [customSpeed] is negative and [fromEnd] is `true`, the animation will play backwards (which is equivalent to calling [playBackwards]). - * - * If this method is called with that same animation [name], or with no [name] parameter, the assigned animation will resume playing if it was paused. + * Plays the animation with key [param name]. If [param custom_speed] is negative and [param + * from_end] is `true`, the animation will play backwards (which is equivalent to calling + * [playBackwards]). + * If this method is called with that same animation [param name], or with no [param name] + * parameter, the assigned animation will resume playing if it was paused. */ @JvmOverloads public fun play( @@ -181,9 +189,9 @@ public open class AnimatedSprite3D : SpriteBase3D() { } /** - * Plays the animation with key [name] in reverse. - * - * This method is a shorthand for [play] with `custom_speed = -1.0` and `from_end = true`, so see its description for more information. + * Plays the animation with key [param name] in reverse. + * This method is a shorthand for [play] with `custom_speed = -1.0` and `from_end = true`, so see + * its description for more information. */ @JvmOverloads public fun playBackwards(name: StringName = StringName("")): Unit { @@ -192,8 +200,9 @@ public open class AnimatedSprite3D : SpriteBase3D() { } /** - * Pauses the currently playing animation. The [frame] and [frameProgress] will be kept and calling [play] or [playBackwards] without arguments will resume the animation from the current playback position. - * + * Pauses the currently playing animation. The [frame] and [frameProgress] will be kept and + * calling [play] or [playBackwards] without arguments will resume the animation from the current + * playback position. * See also [stop]. */ public fun pause(): Unit { @@ -202,7 +211,8 @@ public open class AnimatedSprite3D : SpriteBase3D() { } /** - * Stops the currently playing animation. The animation position is reset to `0` and the `custom_speed` is reset to `1.0`. See also [pause]. + * Stops the currently playing animation. The animation position is reset to `0` and the + * `custom_speed` is reset to `1.0`. See also [pause]. */ public fun stop(): Unit { TransferContext.writeArguments() @@ -210,29 +220,19 @@ public open class AnimatedSprite3D : SpriteBase3D() { } /** - * The setter of [frame] resets the [frameProgress] to `0.0` implicitly, but this method avoids that. - * + * The setter of [frame] resets the [frameProgress] to `0.0` implicitly, but this method avoids + * that. * This is useful when you want to carry over the current [frameProgress] to another [frame]. - * * **Example:** * - * [codeblocks] - * - * [gdscript] - * + * gdscript: + * ```gdscript * # Change the animation with keeping the frame index and progress. - * * var current_frame = animated_sprite.get_frame() - * * var current_progress = animated_sprite.get_frame_progress() - * * animated_sprite.play("walk_another_skin") - * * animated_sprite.set_frame_and_progress(current_frame, current_progress) - * - * [/gdscript] - * - * [/codeblocks] + * ``` */ public fun setFrameAndProgress(frame: Int, progress: Float): Unit { TransferContext.writeArguments(LONG to frame.toLong(), DOUBLE to progress.toDouble()) @@ -240,8 +240,9 @@ public open class AnimatedSprite3D : SpriteBase3D() { } /** - * Returns the actual playing speed of current animation or `0` if not playing. This speed is the [speedScale] property multiplied by `custom_speed` argument specified when calling the [play] method. - * + * Returns the actual playing speed of current animation or `0` if not playing. This speed is the + * [speedScale] property multiplied by `custom_speed` argument specified when calling the [play] + * method. * Returns a negative value if the current animation is playing backwards. */ public fun getPlayingSpeed(): Float { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimatedTexture.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimatedTexture.kt index 3e94c74fa..b9a661710 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimatedTexture.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimatedTexture.kt @@ -24,24 +24,26 @@ import kotlin.Suppress import kotlin.Unit /** - * Proxy texture for simple frame-based animations. - * - * [godot.AnimatedTexture] is a resource format for frame-based animations, where multiple textures can be chained automatically with a predefined delay for each frame. Unlike [godot.AnimationPlayer] or [godot.AnimatedSprite2D], it isn't a [godot.Node], but has the advantage of being usable anywhere a [godot.Texture2D] resource can be used, e.g. in a [godot.TileSet]. - * - * The playback of the animation is controlled by the [speedScale] property, as well as each frame's duration (see [setFrameDuration]). The animation loops, i.e. it will restart at frame 0 automatically after playing the last frame. - * - * [godot.AnimatedTexture] currently requires all frame textures to have the same size, otherwise the bigger ones will be cropped to match the smallest one. - * - * **Note:** AnimatedTexture doesn't support using [godot.AtlasTexture]s. Each frame needs to be a separate [godot.Texture2D]. - * + * [AnimatedTexture] is a resource format for frame-based animations, where multiple textures can be + * chained automatically with a predefined delay for each frame. Unlike [AnimationPlayer] or + * [AnimatedSprite2D], it isn't a [Node], but has the advantage of being usable anywhere a [Texture2D] + * resource can be used, e.g. in a [TileSet]. + * The playback of the animation is controlled by the [speedScale] property, as well as each frame's + * duration (see [setFrameDuration]). The animation loops, i.e. it will restart at frame 0 + * automatically after playing the last frame. + * [AnimatedTexture] currently requires all frame textures to have the same size, otherwise the + * bigger ones will be cropped to match the smallest one. + * **Note:** AnimatedTexture doesn't support using [AtlasTexture]s. Each frame needs to be a + * separate [Texture2D]. * **Warning:** The current implementation is not efficient for the modern renderers. - * * *Deprecated.* This class is deprecated, and might be removed in a future release. */ @GodotBaseType public open class AnimatedTexture : Texture2D() { /** - * Number of frames to use in the animation. While you can create the frames independently with [setFrameTexture], you need to set this value for the animation to take new frames into account. The maximum number of frames is [MAX_FRAMES]. + * Number of frames to use in the animation. While you can create the frames independently with + * [setFrameTexture], you need to set this value for the animation to take new frames into account. + * The maximum number of frames is [constant MAX_FRAMES]. */ public var frames: Int get() { @@ -55,7 +57,8 @@ public open class AnimatedTexture : Texture2D() { } /** - * Sets the currently visible frame of the texture. Setting this frame while playing resets the current frame time, so the newly selected frame plays for its whole configured frame duration. + * Sets the currently visible frame of the texture. Setting this frame while playing resets the + * current frame time, so the newly selected frame plays for its whole configured frame duration. */ public var currentFrame: Int get() { @@ -69,7 +72,8 @@ public open class AnimatedTexture : Texture2D() { } /** - * If `true`, the animation will pause where it currently is (i.e. at [currentFrame]). The animation will continue from where it was paused when changing this property to `false`. + * If `true`, the animation will pause where it currently is (i.e. at [currentFrame]). The + * animation will continue from where it was paused when changing this property to `false`. */ public var pause: Boolean get() { @@ -83,7 +87,8 @@ public open class AnimatedTexture : Texture2D() { } /** - * If `true`, the animation will only play once and will not loop back to the first frame after reaching the end. Note that reaching the end will not set [pause] to `true`. + * If `true`, the animation will only play once and will not loop back to the first frame after + * reaching the end. Note that reaching the end will not set [pause] to `true`. */ public var oneShot: Boolean get() { @@ -97,7 +102,8 @@ public open class AnimatedTexture : Texture2D() { } /** - * The animation speed is multiplied by this value. If set to a negative value, the animation is played in reverse. + * The animation speed is multiplied by this value. If set to a negative value, the animation is + * played in reverse. */ public var speedScale: Float get() { @@ -116,9 +122,10 @@ public open class AnimatedTexture : Texture2D() { } /** - * Assigns a [godot.Texture2D] to the given frame. Frame IDs start at 0, so the first frame has ID 0, and the last frame of the animation has ID [frames] - 1. - * - * You can define any number of textures up to [MAX_FRAMES], but keep in mind that only frames from 0 to [frames] - 1 will be part of the animation. + * Assigns a [Texture2D] to the given frame. Frame IDs start at 0, so the first frame has ID 0, + * and the last frame of the animation has ID [frames] - 1. + * You can define any number of textures up to [constant MAX_FRAMES], but keep in mind that only + * frames from 0 to [frames] - 1 will be part of the animation. */ public fun setFrameTexture(frame: Int, texture: Texture2D): Unit { TransferContext.writeArguments(LONG to frame.toLong(), OBJECT to texture) @@ -126,7 +133,7 @@ public open class AnimatedTexture : Texture2D() { } /** - * Returns the given frame's [godot.Texture2D]. + * Returns the given frame's [Texture2D]. */ public fun getFrameTexture(frame: Int): Texture2D? { TransferContext.writeArguments(LONG to frame.toLong()) @@ -135,7 +142,8 @@ public open class AnimatedTexture : Texture2D() { } /** - * Sets the duration of any given [frame]. The final duration is affected by the [speedScale]. If set to `0`, the frame is skipped during playback. + * Sets the duration of any given [param frame]. The final duration is affected by the + * [speedScale]. If set to `0`, the frame is skipped during playback. */ public fun setFrameDuration(frame: Int, duration: Float): Unit { TransferContext.writeArguments(LONG to frame.toLong(), DOUBLE to duration.toDouble()) @@ -143,7 +151,7 @@ public open class AnimatedTexture : Texture2D() { } /** - * Returns the given [frame]'s duration, in seconds. + * Returns the given [param frame]'s duration, in seconds. */ public fun getFrameDuration(frame: Int): Float { TransferContext.writeArguments(LONG to frame.toLong()) @@ -153,7 +161,8 @@ public open class AnimatedTexture : Texture2D() { public companion object { /** - * The maximum number of frames supported by [godot.AnimatedTexture]. If you need more frames in your animation, use [godot.AnimationPlayer] or [godot.AnimatedSprite2D]. + * The maximum number of frames supported by [AnimatedTexture]. If you need more frames in your + * animation, use [AnimationPlayer] or [AnimatedSprite2D]. */ public final const val MAX_FRAMES: Long = 256 } diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationLibrary.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationLibrary.kt index 9464ccea4..29b7b9af9 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationLibrary.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationLibrary.kt @@ -29,34 +29,30 @@ import kotlin.Suppress import kotlin.Unit /** - * Container for [godot.Animation] resources. - * - * Tutorials: - * [$DOCS_URL/tutorials/animation/index.html]($DOCS_URL/tutorials/animation/index.html) - * - * An animation library stores a set of animations accessible through [godot.StringName] keys, for use with [godot.AnimationPlayer] nodes. + * An animation library stores a set of animations accessible through [StringName] keys, for use + * with [AnimationPlayer] nodes. */ @GodotBaseType public open class AnimationLibrary : Resource() { /** - * Emitted when an [godot.Animation] is added, under the key [name]. + * Emitted when an [Animation] is added, under the key [param name]. */ public val animationAdded: Signal1 by signal("name") /** - * Emitted when an [godot.Animation] stored with the key [name] is removed. + * Emitted when an [Animation] stored with the key [param name] is removed. */ public val animationRemoved: Signal1 by signal("name") /** - * Emitted when the key for an [godot.Animation] is changed, from [name] to [toName]. + * Emitted when the key for an [Animation] is changed, from [param name] to [param to_name]. */ public val animationRenamed: Signal2 by signal("name", "toName") /** - * Emitted when there's a change in one of the animations, e.g. tracks are added, moved or have changed paths. [name] is the key of the animation that was changed. - * - * See also [godot.Resource.changed], which this acts as a relay for. + * Emitted when there's a change in one of the animations, e.g. tracks are added, moved or have + * changed paths. [param name] is the key of the animation that was changed. + * See also [signal Resource.changed], which this acts as a relay for. */ public val animationChanged: Signal1 by signal("name") @@ -66,7 +62,7 @@ public open class AnimationLibrary : Resource() { } /** - * Adds the [animation] to the library, accessible by the key [name]. + * Adds the [param animation] to the library, accessible by the key [param name]. */ public fun addAnimation(name: StringName, animation: Animation): GodotError { TransferContext.writeArguments(STRING_NAME to name, OBJECT to animation) @@ -75,7 +71,7 @@ public open class AnimationLibrary : Resource() { } /** - * Removes the [godot.Animation] with the key [name]. + * Removes the [Animation] with the key [param name]. */ public fun removeAnimation(name: StringName): Unit { TransferContext.writeArguments(STRING_NAME to name) @@ -83,7 +79,7 @@ public open class AnimationLibrary : Resource() { } /** - * Changes the key of the [godot.Animation] associated with the key [name] to [newname]. + * Changes the key of the [Animation] associated with the key [param name] to [param newname]. */ public fun renameAnimation(name: StringName, newname: StringName): Unit { TransferContext.writeArguments(STRING_NAME to name, STRING_NAME to newname) @@ -91,7 +87,7 @@ public open class AnimationLibrary : Resource() { } /** - * Returns `true` if the library stores an [godot.Animation] with [name] as the key. + * Returns `true` if the library stores an [Animation] with [param name] as the key. */ public fun hasAnimation(name: StringName): Boolean { TransferContext.writeArguments(STRING_NAME to name) @@ -100,7 +96,8 @@ public open class AnimationLibrary : Resource() { } /** - * Returns the [godot.Animation] with the key [name]. If the animation does not exist, `null` is returned and an error is logged. + * Returns the [Animation] with the key [param name]. If the animation does not exist, `null` is + * returned and an error is logged. */ public fun getAnimation(name: StringName): Animation? { TransferContext.writeArguments(STRING_NAME to name) @@ -109,7 +106,7 @@ public open class AnimationLibrary : Resource() { } /** - * Returns the keys for the [godot.Animation]s stored in the library. + * Returns the keys for the [Animation]s stored in the library. */ public fun getAnimationList(): VariantArray { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationMixer.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationMixer.kt index eeeef15aa..b3b3488f0 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationMixer.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationMixer.kt @@ -41,16 +41,16 @@ import kotlin.Suppress import kotlin.Unit /** - * Base class for [godot.AnimationPlayer] and [godot.AnimationTree]. - * - * Base class for [godot.AnimationPlayer] and [godot.AnimationTree] to manage animation lists. It also has general properties and methods for playback and blending. - * - * After instantiating the playback information data within the extended class, the blending is processed by the [godot.AnimationMixer]. + * Base class for [AnimationPlayer] and [AnimationTree] to manage animation lists. It also has + * general properties and methods for playback and blending. + * After instantiating the playback information data within the extended class, the blending is + * processed by the [AnimationMixer]. */ @GodotBaseType public open class AnimationMixer internal constructor() : Node() { /** - * Editor only. Notifies when the property have been updated to update dummy [godot.AnimationPlayer] in animation player editor. + * Editor only. Notifies when the property have been updated to update dummy [AnimationPlayer] in + * animation player editor. */ public val mixerUpdated: Signal0 by signal() @@ -66,7 +66,6 @@ public open class AnimationMixer internal constructor() : Node() { /** * Notifies when an animation finished playing. - * * **Note:** This signal is not emitted if an animation is looping. */ public val animationFinished: Signal1 by signal("animName") @@ -77,12 +76,13 @@ public open class AnimationMixer internal constructor() : Node() { public val animationStarted: Signal1 by signal("animName") /** - * Notifies when the caches have been cleared, either automatically, or manually via [clearCaches]. + * Notifies when the caches have been cleared, either automatically, or manually via + * [clearCaches]. */ public val cachesCleared: Signal0 by signal() /** - * If `true`, the [godot.AnimationMixer] will be processing. + * If `true`, the [AnimationMixer] will be processing. */ public var active: Boolean get() { @@ -96,17 +96,20 @@ public open class AnimationMixer internal constructor() : Node() { } /** - * If `true`, the blending uses the deterministic algorithm. The total weight is not normalized and the result is accumulated with an initial value (`0` or a `"RESET"` animation if present). - * - * This means that if the total amount of blending is `0.0`, the result is equal to the `"RESET"` animation. - * - * If the number of tracks between the blended animations is different, the animation with the missing track is treated as if it had the initial value. - * - * If `false`, The blend does not use the deterministic algorithm. The total weight is normalized and always `1.0`. If the number of tracks between the blended animations is different, nothing is done about the animation that is missing a track. - * - * **Note:** In [godot.AnimationTree], the blending with [godot.AnimationNodeAdd2], [godot.AnimationNodeAdd3], [godot.AnimationNodeSub2] or the weight greater than `1.0` may produce unexpected results. - * - * For example, if [godot.AnimationNodeAdd2] blends two nodes with the amount `1.0`, then total weight is `2.0` but it will be normalized to make the total amount `1.0` and the result will be equal to [godot.AnimationNodeBlend2] with the amount `0.5`. + * If `true`, the blending uses the deterministic algorithm. The total weight is not normalized + * and the result is accumulated with an initial value (`0` or a `"RESET"` animation if present). + * This means that if the total amount of blending is `0.0`, the result is equal to the `"RESET"` + * animation. + * If the number of tracks between the blended animations is different, the animation with the + * missing track is treated as if it had the initial value. + * If `false`, The blend does not use the deterministic algorithm. The total weight is normalized + * and always `1.0`. If the number of tracks between the blended animations is different, nothing is + * done about the animation that is missing a track. + * **Note:** In [AnimationTree], the blending with [AnimationNodeAdd2], [AnimationNodeAdd3], + * [AnimationNodeSub2] or the weight greater than `1.0` may produce unexpected results. + * For example, if [AnimationNodeAdd2] blends two nodes with the amount `1.0`, then total weight + * is `2.0` but it will be normalized to make the total amount `1.0` and the result will be equal to + * [AnimationNodeBlend2] with the amount `0.5`. */ public var deterministic: Boolean get() { @@ -120,9 +123,11 @@ public open class AnimationMixer internal constructor() : Node() { } /** - * This is used by the editor. If set to `true`, the scene will be saved with the effects of the reset animation (the animation with the key `"RESET"`) applied as if it had been seeked to time 0, with the editor keeping the values that the scene had before saving. - * - * This makes it more convenient to preview and edit animations in the editor, as changes to the scene will not be saved as long as they are set in the reset animation. + * This is used by the editor. If set to `true`, the scene will be saved with the effects of the + * reset animation (the animation with the key `"RESET"`) applied as if it had been seeked to time 0, + * with the editor keeping the values that the scene had before saving. + * This makes it more convenient to preview and edit animations in the editor, as changes to the + * scene will not be saved as long as they are set in the reset animation. */ public var resetOnSave: Boolean get() { @@ -150,9 +155,15 @@ public open class AnimationMixer internal constructor() : Node() { } /** - * The path to the Animation track used for root motion. Paths must be valid scene-tree paths to a node, and must be specified starting from the parent node of the node that will reproduce the animation. To specify a track that controls properties or bones, append its name after the path, separated by `":"`. For example, `"character/skeleton:ankle"` or `"character/mesh:transform/local"`. - * - * If the track has type [godot.Animation.TYPE_POSITION_3D], [godot.Animation.TYPE_ROTATION_3D] or [godot.Animation.TYPE_SCALE_3D] the transformation will be canceled visually, and the animation will appear to stay in place. See also [getRootMotionPosition], [getRootMotionRotation], [getRootMotionScale] and [godot.RootMotionView]. + * The path to the Animation track used for root motion. Paths must be valid scene-tree paths to a + * node, and must be specified starting from the parent node of the node that will reproduce the + * animation. To specify a track that controls properties or bones, append its name after the path, + * separated by `":"`. For example, `"character/skeleton:ankle"` or + * `"character/mesh:transform/local"`. + * If the track has type [constant Animation.TYPE_POSITION_3D], [constant + * Animation.TYPE_ROTATION_3D] or [constant Animation.TYPE_SCALE_3D] the transformation will be + * canceled visually, and the animation will appear to stay in place. See also + * [getRootMotionPosition], [getRootMotionRotation], [getRootMotionScale] and [RootMotionView]. */ public var rootMotionTrack: NodePath get() { @@ -167,8 +178,8 @@ public open class AnimationMixer internal constructor() : Node() { /** * The number of possible simultaneous sounds for each of the assigned AudioStreamPlayers. - * - * For example, if this value is `32` and the animation has two audio tracks, the two [godot.AudioStreamPlayer]s assigned can play simultaneously up to `32` voices each. + * For example, if this value is `32` and the animation has two audio tracks, the two + * [AudioStreamPlayer]s assigned can play simultaneously up to `32` voices each. */ public var audioMaxPolyphony: Int get() { @@ -228,7 +239,7 @@ public open class AnimationMixer internal constructor() : Node() { } /** - * Adds [library] to the animation player, under the key [name]. + * Adds [param library] to the animation player, under the key [param name]. */ public fun addAnimationLibrary(name: StringName, library: AnimationLibrary): GodotError { TransferContext.writeArguments(STRING_NAME to name, OBJECT to library) @@ -237,7 +248,7 @@ public open class AnimationMixer internal constructor() : Node() { } /** - * Removes the [godot.AnimationLibrary] associated with the key [name]. + * Removes the [AnimationLibrary] associated with the key [param name]. */ public fun removeAnimationLibrary(name: StringName): Unit { TransferContext.writeArguments(STRING_NAME to name) @@ -245,7 +256,7 @@ public open class AnimationMixer internal constructor() : Node() { } /** - * Moves the [godot.AnimationLibrary] associated with the key [name] to the key [newname]. + * Moves the [AnimationLibrary] associated with the key [param name] to the key [param newname]. */ public fun renameAnimationLibrary(name: StringName, newname: StringName): Unit { TransferContext.writeArguments(STRING_NAME to name, STRING_NAME to newname) @@ -253,7 +264,7 @@ public open class AnimationMixer internal constructor() : Node() { } /** - * Returns `true` if the [godot.AnimationPlayer] stores an [godot.AnimationLibrary] with key [name]. + * Returns `true` if the [AnimationPlayer] stores an [AnimationLibrary] with key [param name]. */ public fun hasAnimationLibrary(name: StringName): Boolean { TransferContext.writeArguments(STRING_NAME to name) @@ -262,9 +273,8 @@ public open class AnimationMixer internal constructor() : Node() { } /** - * Returns the first [godot.AnimationLibrary] with key [name] or `null` if not found. - * - * To get the [godot.AnimationPlayer]'s global animation library, use `get_animation_library("")`. + * Returns the first [AnimationLibrary] with key [param name] or `null` if not found. + * To get the [AnimationPlayer]'s global animation library, use `get_animation_library("")`. */ public fun getAnimationLibrary(name: StringName): AnimationLibrary? { TransferContext.writeArguments(STRING_NAME to name) @@ -282,7 +292,7 @@ public open class AnimationMixer internal constructor() : Node() { } /** - * Returns `true` if the [godot.AnimationPlayer] stores an [godot.Animation] with key [name]. + * Returns `true` if the [AnimationPlayer] stores an [Animation] with key [param name]. */ public fun hasAnimation(name: StringName): Boolean { TransferContext.writeArguments(STRING_NAME to name) @@ -291,7 +301,8 @@ public open class AnimationMixer internal constructor() : Node() { } /** - * Returns the [godot.Animation] with the key [name]. If the animation does not exist, `null` is returned and an error is logged. + * Returns the [Animation] with the key [param name]. If the animation does not exist, `null` is + * returned and an error is logged. */ public fun getAnimation(name: StringName): Animation? { TransferContext.writeArguments(STRING_NAME to name) @@ -309,63 +320,41 @@ public open class AnimationMixer internal constructor() : Node() { } /** - * Retrieve the motion delta of position with the [rootMotionTrack] as a [godot.core.Vector3] that can be used elsewhere. - * - * If [rootMotionTrack] is not a path to a track of type [godot.Animation.TYPE_POSITION_3D], returns `Vector3(0, 0, 0)`. - * - * See also [rootMotionTrack] and [godot.RootMotionView]. - * - * The most basic example is applying position to [godot.CharacterBody3D]: - * - * [codeblocks] - * - * [gdscript] + * Retrieve the motion delta of position with the [rootMotionTrack] as a [Vector3] that can be + * used elsewhere. + * If [rootMotionTrack] is not a path to a track of type [constant Animation.TYPE_POSITION_3D], + * returns `Vector3(0, 0, 0)`. + * See also [rootMotionTrack] and [RootMotionView]. + * The most basic example is applying position to [CharacterBody3D]: * + * gdscript: + * ```gdscript * var current_rotation: Quaternion * - * - * * func _process(delta): - * * if Input.is_action_just_pressed("animate"): - * * current_rotation = get_quaternion() - * * state_machine.travel("Animate") - * - * var velocity: Vector3 = current_rotation * animation_tree.get_root_motion_position() / delta - * + * var velocity: Vector3 = current_rotation * animation_tree.get_root_motion_position() / + * delta * set_velocity(velocity) - * * move_and_slide() + * ``` * - * [/gdscript] - * - * [/codeblocks] - * - * By using this in combination with [getRootMotionPositionAccumulator], you can apply the root motion position more correctly to account for the rotation of the node. - * - * [codeblocks] - * - * [gdscript] + * By using this in combination with [getRootMotionPositionAccumulator], you can apply the root + * motion position more correctly to account for the rotation of the node. * + * gdscript: + * ```gdscript * func _process(delta): - * * if Input.is_action_just_pressed("animate"): - * * state_machine.travel("Animate") - * * set_quaternion(get_quaternion() * animation_tree.get_root_motion_rotation()) - * - * var velocity: Vector3 = (animation_tree.get_root_motion_rotation_accumulator().inverse() * get_quaternion()) * animation_tree.get_root_motion_position() / delta - * + * var velocity: Vector3 = (animation_tree.get_root_motion_rotation_accumulator().inverse() * + * get_quaternion()) * animation_tree.get_root_motion_position() / delta * set_velocity(velocity) - * * move_and_slide() - * - * [/gdscript] - * - * [/codeblocks] + * ``` */ public fun getRootMotionPosition(): Vector3 { TransferContext.writeArguments() @@ -374,29 +363,20 @@ public open class AnimationMixer internal constructor() : Node() { } /** - * Retrieve the motion delta of rotation with the [rootMotionTrack] as a [godot.Quaternion] that can be used elsewhere. - * - * If [rootMotionTrack] is not a path to a track of type [godot.Animation.TYPE_ROTATION_3D], returns `Quaternion(0, 0, 0, 1)`. - * - * See also [rootMotionTrack] and [godot.RootMotionView]. - * - * The most basic example is applying rotation to [godot.CharacterBody3D]: - * - * [codeblocks] - * - * [gdscript] + * Retrieve the motion delta of rotation with the [rootMotionTrack] as a [Quaternion] that can be + * used elsewhere. + * If [rootMotionTrack] is not a path to a track of type [constant Animation.TYPE_ROTATION_3D], + * returns `Quaternion(0, 0, 0, 1)`. + * See also [rootMotionTrack] and [RootMotionView]. + * The most basic example is applying rotation to [CharacterBody3D]: * + * gdscript: + * ```gdscript * func _process(delta): - * * if Input.is_action_just_pressed("animate"): - * * state_machine.travel("Animate") - * * set_quaternion(get_quaternion() * animation_tree.get_root_motion_rotation()) - * - * [/gdscript] - * - * [/codeblocks] + * ``` */ public fun getRootMotionRotation(): Quaternion { TransferContext.writeArguments() @@ -405,41 +385,26 @@ public open class AnimationMixer internal constructor() : Node() { } /** - * Retrieve the motion delta of scale with the [rootMotionTrack] as a [godot.core.Vector3] that can be used elsewhere. - * - * If [rootMotionTrack] is not a path to a track of type [godot.Animation.TYPE_SCALE_3D], returns `Vector3(0, 0, 0)`. - * - * See also [rootMotionTrack] and [godot.RootMotionView]. - * - * The most basic example is applying scale to [godot.CharacterBody3D]: - * - * [codeblocks] - * - * [gdscript] + * Retrieve the motion delta of scale with the [rootMotionTrack] as a [Vector3] that can be used + * elsewhere. + * If [rootMotionTrack] is not a path to a track of type [constant Animation.TYPE_SCALE_3D], + * returns `Vector3(0, 0, 0)`. + * See also [rootMotionTrack] and [RootMotionView]. + * The most basic example is applying scale to [CharacterBody3D]: * + * gdscript: + * ```gdscript * var current_scale: Vector3 = Vector3(1, 1, 1) - * * var scale_accum: Vector3 = Vector3(1, 1, 1) * - * - * * func _process(delta): - * * if Input.is_action_just_pressed("animate"): - * * current_scale = get_scale() - * * scale_accum = Vector3(1, 1, 1) - * * state_machine.travel("Animate") - * * scale_accum += animation_tree.get_root_motion_scale() - * * set_scale(current_scale * scale_accum) - * - * [/gdscript] - * - * [/codeblocks] + * ``` */ public fun getRootMotionScale(): Vector3 { TransferContext.writeArguments() @@ -448,39 +413,30 @@ public open class AnimationMixer internal constructor() : Node() { } /** - * Retrieve the blended value of the position tracks with the [rootMotionTrack] as a [godot.core.Vector3] that can be used elsewhere. - * + * Retrieve the blended value of the position tracks with the [rootMotionTrack] as a [Vector3] + * that can be used elsewhere. * This is useful in cases where you want to respect the initial key values of the animation. + * For example, if an animation with only one key `Vector3(0, 0, 0)` is played in the previous + * frame and then an animation with only one key `Vector3(1, 0, 1)` is played in the next frame, the + * difference can be calculated as follows: * - * For example, if an animation with only one key `Vector3(0, 0, 0)` is played in the previous frame and then an animation with only one key `Vector3(1, 0, 1)` is played in the next frame, the difference can be calculated as follows: - * - * [codeblocks] - * - * [gdscript] - * + * gdscript: + * ```gdscript * var prev_root_motion_position_accumulator: Vector3 * - * - * * func _process(delta): - * * if Input.is_action_just_pressed("animate"): - * * state_machine.travel("Animate") - * - * var current_root_motion_position_accumulator: Vector3 = animation_tree.get_root_motion_position_accumulator() - * - * var difference: Vector3 = current_root_motion_position_accumulator - prev_root_motion_position_accumulator - * + * var current_root_motion_position_accumulator: Vector3 = + * animation_tree.get_root_motion_position_accumulator() + * var difference: Vector3 = current_root_motion_position_accumulator - + * prev_root_motion_position_accumulator * prev_root_motion_position_accumulator = current_root_motion_position_accumulator - * * transform.origin += difference + * ``` * - * [/gdscript] - * - * [/codeblocks] - * - * However, if the animation loops, an unintended discrete change may occur, so this is only useful for some simple use cases. + * However, if the animation loops, an unintended discrete change may occur, so this is only + * useful for some simple use cases. */ public fun getRootMotionPositionAccumulator(): Vector3 { TransferContext.writeArguments() @@ -489,41 +445,33 @@ public open class AnimationMixer internal constructor() : Node() { } /** - * Retrieve the blended value of the rotation tracks with the [rootMotionTrack] as a [godot.Quaternion] that can be used elsewhere. - * - * This is necessary to apply the root motion position correctly, taking rotation into account. See also [getRootMotionPosition]. - * - * Also, this is useful in cases where you want to respect the initial key values of the animation. - * - * For example, if an animation with only one key `Quaternion(0, 0, 0, 1)` is played in the previous frame and then an animation with only one key `Quaternion(0, 0.707, 0, 0.707)` is played in the next frame, the difference can be calculated as follows: - * - * [codeblocks] - * - * [gdscript] + * Retrieve the blended value of the rotation tracks with the [rootMotionTrack] as a [Quaternion] + * that can be used elsewhere. + * This is necessary to apply the root motion position correctly, taking rotation into account. + * See also [getRootMotionPosition]. + * Also, this is useful in cases where you want to respect the initial key values of the + * animation. + * For example, if an animation with only one key `Quaternion(0, 0, 0, 1)` is played in the + * previous frame and then an animation with only one key `Quaternion(0, 0.707, 0, 0.707)` is played + * in the next frame, the difference can be calculated as follows: * + * gdscript: + * ```gdscript * var prev_root_motion_rotation_accumulator: Quaternion * - * - * * func _process(delta): - * * if Input.is_action_just_pressed("animate"): - * * state_machine.travel("Animate") - * - * var current_root_motion_rotation_accumulator: Quaternion = animation_tree.get_root_motion_Quaternion_accumulator() - * - * var difference: Quaternion = prev_root_motion_rotation_accumulator.inverse() * current_root_motion_rotation_accumulator - * + * var current_root_motion_rotation_accumulator: Quaternion = + * animation_tree.get_root_motion_Quaternion_accumulator() + * var difference: Quaternion = prev_root_motion_rotation_accumulator.inverse() * + * current_root_motion_rotation_accumulator * prev_root_motion_rotation_accumulator = current_root_motion_rotation_accumulator - * * transform.basis *= difference + * ``` * - * [/gdscript] - * - * [/codeblocks] - * - * However, if the animation loops, an unintended discrete change may occur, so this is only useful for some simple use cases. + * However, if the animation loops, an unintended discrete change may occur, so this is only + * useful for some simple use cases. */ public fun getRootMotionRotationAccumulator(): Quaternion { TransferContext.writeArguments() @@ -533,37 +481,29 @@ public open class AnimationMixer internal constructor() : Node() { } /** - * Retrieve the blended value of the scale tracks with the [rootMotionTrack] as a [godot.core.Vector3] that can be used elsewhere. - * - * For example, if an animation with only one key `Vector3(1, 1, 1)` is played in the previous frame and then an animation with only one key `Vector3(2, 2, 2)` is played in the next frame, the difference can be calculated as follows: - * - * [codeblocks] - * - * [gdscript] + * Retrieve the blended value of the scale tracks with the [rootMotionTrack] as a [Vector3] that + * can be used elsewhere. + * For example, if an animation with only one key `Vector3(1, 1, 1)` is played in the previous + * frame and then an animation with only one key `Vector3(2, 2, 2)` is played in the next frame, the + * difference can be calculated as follows: * + * gdscript: + * ```gdscript * var prev_root_motion_scale_accumulator: Vector3 * - * - * * func _process(delta): - * * if Input.is_action_just_pressed("animate"): - * * state_machine.travel("Animate") - * - * var current_root_motion_scale_accumulator: Vector3 = animation_tree.get_root_motion_scale_accumulator() - * - * var difference: Vector3 = current_root_motion_scale_accumulator - prev_root_motion_scale_accumulator - * + * var current_root_motion_scale_accumulator: Vector3 = + * animation_tree.get_root_motion_scale_accumulator() + * var difference: Vector3 = current_root_motion_scale_accumulator - + * prev_root_motion_scale_accumulator * prev_root_motion_scale_accumulator = current_root_motion_scale_accumulator - * * transform.basis = transform.basis.scaled(difference) + * ``` * - * [/gdscript] - * - * [/codeblocks] - * - * However, if the animation loops, an unintended discrete change may occur, so this is only useful for some simple use cases. + * However, if the animation loops, an unintended discrete change may occur, so this is only + * useful for some simple use cases. */ public fun getRootMotionScaleAccumulator(): Vector3 { TransferContext.writeArguments() @@ -572,7 +512,8 @@ public open class AnimationMixer internal constructor() : Node() { } /** - * [godot.AnimationMixer] caches animated nodes. It may not notice if a node disappears; [clearCaches] forces it to update the cache again. + * [AnimationMixer] caches animated nodes. It may not notice if a node disappears; [clearCaches] + * forces it to update the cache again. */ public fun clearCaches(): Unit { TransferContext.writeArguments() @@ -588,7 +529,7 @@ public open class AnimationMixer internal constructor() : Node() { } /** - * Returns the key of [animation] or an empty [godot.StringName] if not found. + * Returns the key of [param animation] or an empty [StringName] if not found. */ public fun findAnimation(animation: Animation): StringName { TransferContext.writeArguments(OBJECT to animation) @@ -597,7 +538,8 @@ public open class AnimationMixer internal constructor() : Node() { } /** - * Returns the key for the [godot.AnimationLibrary] that contains [animation] or an empty [godot.StringName] if not found. + * Returns the key for the [AnimationLibrary] that contains [param animation] or an empty + * [StringName] if not found. */ public fun findAnimationLibrary(animation: Animation): StringName { TransferContext.writeArguments(OBJECT to animation) @@ -609,11 +551,13 @@ public open class AnimationMixer internal constructor() : Node() { id: Long, ) { /** - * Process animation during physics frames (see [godot.Node.NOTIFICATION_INTERNAL_PHYSICS_PROCESS]). This is especially useful when animating physics bodies. + * Process animation during physics frames (see [constant + * Node.NOTIFICATION_INTERNAL_PHYSICS_PROCESS]). This is especially useful when animating physics + * bodies. */ ANIMATION_CALLBACK_MODE_PROCESS_PHYSICS(0), /** - * Process animation during process frames (see [godot.Node.NOTIFICATION_INTERNAL_PROCESS]). + * Process animation during process frames (see [constant Node.NOTIFICATION_INTERNAL_PROCESS]). */ ANIMATION_CALLBACK_MODE_PROCESS_IDLE(1), /** @@ -636,7 +580,9 @@ public open class AnimationMixer internal constructor() : Node() { id: Long, ) { /** - * Batch method calls during the animation process, then do the calls after events are processed. This avoids bugs involving deleting nodes or modifying the AnimationPlayer while playing. + * Batch method calls during the animation process, then do the calls after events are + * processed. This avoids bugs involving deleting nodes or modifying the AnimationPlayer while + * playing. */ ANIMATION_CALLBACK_MODE_METHOD_DEFERRED(0), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeAdd2.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeAdd2.kt index 2bec1db0d..5ab6c60ef 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeAdd2.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeAdd2.kt @@ -12,16 +12,12 @@ import kotlin.Int import kotlin.Suppress /** - * Blends two animations additively inside of an [godot.AnimationNodeBlendTree]. - * - * Tutorials: - * [$DOCS_URL/tutorials/animation/animation_tree.html]($DOCS_URL/tutorials/animation/animation_tree.html) - * - * A resource to add to an [godot.AnimationNodeBlendTree]. Blends two animations additively based on the amount value. - * - * If the amount is greater than `1.0`, the animation connected to "in" port is blended with the amplified animation connected to "add" port. - * - * If the amount is less than `0.0`, the animation connected to "in" port is blended with the inverted animation connected to "add" port. + * A resource to add to an [AnimationNodeBlendTree]. Blends two animations additively based on the + * amount value. + * If the amount is greater than `1.0`, the animation connected to "in" port is blended with the + * amplified animation connected to "add" port. + * If the amount is less than `0.0`, the animation connected to "in" port is blended with the + * inverted animation connected to "add" port. */ @GodotBaseType public open class AnimationNodeAdd2 : AnimationNodeSync() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeAdd3.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeAdd3.kt index c2b3139e9..c35fa8bbf 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeAdd3.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeAdd3.kt @@ -12,22 +12,14 @@ import kotlin.Int import kotlin.Suppress /** - * Blends two of three animations additively inside of an [godot.AnimationNodeBlendTree]. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/678](https://godotengine.org/asset-library/asset/678) - * - * A resource to add to an [godot.AnimationNodeBlendTree]. Blends two animations out of three additively out of three based on the amount value. - * + * A resource to add to an [AnimationNodeBlendTree]. Blends two animations out of three additively + * out of three based on the amount value. * This animation node has three inputs: - * * - The base animation to add to - * * - A "-add" animation to blend with when the blend amount is negative - * * - A "+add" animation to blend with when the blend amount is positive - * - * If the absolute value of the amount is greater than `1.0`, the animation connected to "in" port is blended with the amplified animation connected to "-add"/"+add" port. + * If the absolute value of the amount is greater than `1.0`, the animation connected to "in" port + * is blended with the amplified animation connected to "-add"/"+add" port. */ @GodotBaseType public open class AnimationNodeAdd3 : AnimationNodeSync() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeAnimation.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeAnimation.kt index d3426bc5d..970055467 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeAnimation.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeAnimation.kt @@ -20,17 +20,14 @@ import kotlin.Long import kotlin.Suppress /** - * An input animation for an [godot.AnimationNodeBlendTree]. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/678](https://godotengine.org/asset-library/asset/678) - * - * A resource to add to an [godot.AnimationNodeBlendTree]. Only has one output port using the [animation] property. Used as an input for [godot.AnimationNode]s that blend animations together. + * A resource to add to an [AnimationNodeBlendTree]. Only has one output port using the [animation] + * property. Used as an input for [AnimationNode]s that blend animations together. */ @GodotBaseType public open class AnimationNodeAnimation : AnimationRootNode() { /** - * Animation to use as an output. It is one of the animations provided by [godot.AnimationTree.animPlayer]. + * Animation to use as an output. It is one of the animations provided by + * [AnimationTree.animPlayer]. */ public var animation: StringName get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeBlend2.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeBlend2.kt index 6718a8cf0..46d26bdeb 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeBlend2.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeBlend2.kt @@ -12,14 +12,10 @@ import kotlin.Int import kotlin.Suppress /** - * Blends two animations linearly inside of an [godot.AnimationNodeBlendTree]. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/678](https://godotengine.org/asset-library/asset/678) - * - * A resource to add to an [godot.AnimationNodeBlendTree]. Blends two animations linearly based on the amount value. - * - * In general, the blend value should be in the `[0.0, 1.0]` range. Values outside of this range can blend amplified or inverted animations, however, [godot.AnimationNodeAdd2] works better for this purpose. + * A resource to add to an [AnimationNodeBlendTree]. Blends two animations linearly based on the + * amount value. + * In general, the blend value should be in the `[0.0, 1.0]` range. Values outside of this range can + * blend amplified or inverted animations, however, [AnimationNodeAdd2] works better for this purpose. */ @GodotBaseType public open class AnimationNodeBlend2 : AnimationNodeSync() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeBlend3.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeBlend3.kt index 040092f03..bd14f787d 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeBlend3.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeBlend3.kt @@ -12,22 +12,14 @@ import kotlin.Int import kotlin.Suppress /** - * Blends two of three animations linearly inside of an [godot.AnimationNodeBlendTree]. - * - * Tutorials: - * [$DOCS_URL/tutorials/animation/animation_tree.html]($DOCS_URL/tutorials/animation/animation_tree.html) - * - * A resource to add to an [godot.AnimationNodeBlendTree]. Blends two animations out of three linearly out of three based on the amount value. - * + * A resource to add to an [AnimationNodeBlendTree]. Blends two animations out of three linearly out + * of three based on the amount value. * This animation node has three inputs: - * * - The base animation to blend with - * * - A "-blend" animation to blend with when the blend amount is negative value - * * - A "+blend" animation to blend with when the blend amount is positive value - * - * In general, the blend value should be in the `[-1.0, 1.0]` range. Values outside of this range can blend amplified animations, however, [godot.AnimationNodeAdd3] works better for this purpose. + * In general, the blend value should be in the `[-1.0, 1.0]` range. Values outside of this range + * can blend amplified animations, however, [AnimationNodeAdd3] works better for this purpose. */ @GodotBaseType public open class AnimationNodeBlend3 : AnimationNodeSync() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeBlendSpace1D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeBlendSpace1D.kt index 223ecfecd..c982aab5d 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeBlendSpace1D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeBlendSpace1D.kt @@ -27,15 +27,10 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * A set of [godot.AnimationRootNode]s placed on a virtual axis, crossfading between the two adjacent ones. Used by [godot.AnimationTree]. - * - * Tutorials: - * [$DOCS_URL/tutorials/animation/animation_tree.html]($DOCS_URL/tutorials/animation/animation_tree.html) - * - * A resource used by [godot.AnimationNodeBlendTree]. - * - * [godot.AnimationNodeBlendSpace1D] represents a virtual axis on which any type of [godot.AnimationRootNode]s can be added using [addBlendPoint]. Outputs the linear blend of the two [godot.AnimationRootNode]s adjacent to the current value. - * + * A resource used by [AnimationNodeBlendTree]. + * [AnimationNodeBlendSpace1D] represents a virtual axis on which any type of [AnimationRootNode]s + * can be added using [addBlendPoint]. Outputs the linear blend of the two [AnimationRootNode]s + * adjacent to the current value. * You can set the extents of the axis with [minSpace] and [maxSpace]. */ @GodotBaseType @@ -112,7 +107,6 @@ public open class AnimationNodeBlendSpace1D : AnimationRootNode() { /** * If `false`, the blended animations' frame are stopped when the blend value is `0`. - * * If `true`, forcing the blended animations to advance frame. */ public var sync: Boolean @@ -132,7 +126,10 @@ public open class AnimationNodeBlendSpace1D : AnimationRootNode() { } /** - * Adds a new point that represents a [node] on the virtual axis at a given position set by [pos]. You can insert it at a specific index using the [atIndex] argument. If you use the default value for [atIndex], the point is inserted at the end of the blend points array. + * Adds a new point that represents a [param node] on the virtual axis at a given position set by + * [param pos]. You can insert it at a specific index using the [param at_index] argument. If you use + * the default value for [param at_index], the point is inserted at the end of the blend points + * array. */ @JvmOverloads public fun addBlendPoint( @@ -145,7 +142,7 @@ public open class AnimationNodeBlendSpace1D : AnimationRootNode() { } /** - * Updates the position of the point at index [point] on the blend axis. + * Updates the position of the point at index [param point] on the blend axis. */ public fun setBlendPointPosition(point: Int, pos: Float): Unit { TransferContext.writeArguments(LONG to point.toLong(), DOUBLE to pos.toDouble()) @@ -153,7 +150,7 @@ public open class AnimationNodeBlendSpace1D : AnimationRootNode() { } /** - * Returns the position of the point at index [point]. + * Returns the position of the point at index [param point]. */ public fun getBlendPointPosition(point: Int): Float { TransferContext.writeArguments(LONG to point.toLong()) @@ -162,7 +159,7 @@ public open class AnimationNodeBlendSpace1D : AnimationRootNode() { } /** - * Changes the [godot.AnimationNode] referenced by the point at index [point]. + * Changes the [AnimationNode] referenced by the point at index [param point]. */ public fun setBlendPointNode(point: Int, node: AnimationRootNode): Unit { TransferContext.writeArguments(LONG to point.toLong(), OBJECT to node) @@ -170,7 +167,7 @@ public open class AnimationNodeBlendSpace1D : AnimationRootNode() { } /** - * Returns the [godot.AnimationNode] referenced by the point at index [point]. + * Returns the [AnimationNode] referenced by the point at index [param point]. */ public fun getBlendPointNode(point: Int): AnimationRootNode? { TransferContext.writeArguments(LONG to point.toLong()) @@ -179,7 +176,7 @@ public open class AnimationNodeBlendSpace1D : AnimationRootNode() { } /** - * Removes the point at index [point] from the blend axis. + * Removes the point at index [param point] from the blend axis. */ public fun removeBlendPoint(point: Int): Unit { TransferContext.writeArguments(LONG to point.toLong()) @@ -203,11 +200,13 @@ public open class AnimationNodeBlendSpace1D : AnimationRootNode() { */ BLEND_MODE_INTERPOLATED(0), /** - * The blend space plays the animation of the animation node which blending position is closest to. Useful for frame-by-frame 2D animations. + * The blend space plays the animation of the animation node which blending position is closest + * to. Useful for frame-by-frame 2D animations. */ BLEND_MODE_DISCRETE(1), /** - * Similar to [BLEND_MODE_DISCRETE], but starts the new animation at the last animation's playback position. + * Similar to [constant BLEND_MODE_DISCRETE], but starts the new animation at the last + * animation's playback position. */ BLEND_MODE_DISCRETE_CARRY(2), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeBlendSpace2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeBlendSpace2D.kt index 0a7901424..11bb4a994 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeBlendSpace2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeBlendSpace2D.kt @@ -30,26 +30,26 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * A set of [godot.AnimationRootNode]s placed on 2D coordinates, crossfading between the three adjacent ones. Used by [godot.AnimationTree]. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/678](https://godotengine.org/asset-library/asset/678) - * - * A resource used by [godot.AnimationNodeBlendTree]. - * - * [godot.AnimationNodeBlendSpace1D] represents a virtual 2D space on which [godot.AnimationRootNode]s are placed. Outputs the linear blend of the three adjacent animations using a [godot.core.Vector2] weight. Adjacent in this context means the three [godot.AnimationRootNode]s making up the triangle that contains the current value. - * - * You can add vertices to the blend space with [addBlendPoint] and automatically triangulate it by setting [autoTriangles] to `true`. Otherwise, use [addTriangle] and [removeTriangle] to triangulate the blend space by hand. + * A resource used by [AnimationNodeBlendTree]. + * [AnimationNodeBlendSpace1D] represents a virtual 2D space on which [AnimationRootNode]s are + * placed. Outputs the linear blend of the three adjacent animations using a [Vector2] weight. Adjacent + * in this context means the three [AnimationRootNode]s making up the triangle that contains the + * current value. + * You can add vertices to the blend space with [addBlendPoint] and automatically triangulate it by + * setting [autoTriangles] to `true`. Otherwise, use [addTriangle] and [removeTriangle] to triangulate + * the blend space by hand. */ @GodotBaseType public open class AnimationNodeBlendSpace2D : AnimationRootNode() { /** - * Emitted every time the blend space's triangles are created, removed, or when one of their vertices changes position. + * Emitted every time the blend space's triangles are created, removed, or when one of their + * vertices changes position. */ public val trianglesUpdated: Signal0 by signal() /** - * If `true`, the blend space is triangulated automatically. The mesh updates every time you add or remove points with [addBlendPoint] and [removeBlendPoint]. + * If `true`, the blend space is triangulated automatically. The mesh updates every time you add + * or remove points with [addBlendPoint] and [removeBlendPoint]. */ public var autoTriangles: Boolean get() { @@ -151,7 +151,6 @@ public open class AnimationNodeBlendSpace2D : AnimationRootNode() { /** * If `false`, the blended animations' frame are stopped when the blend value is `0`. - * * If `true`, forcing the blended animations to advance frame. */ public var sync: Boolean @@ -243,7 +242,9 @@ public open class AnimationNodeBlendSpace2D : AnimationRootNode() { /** - * Adds a new point that represents a [node] at the position set by [pos]. You can insert it at a specific index using the [atIndex] argument. If you use the default value for [atIndex], the point is inserted at the end of the blend points array. + * Adds a new point that represents a [param node] at the position set by [param pos]. You can + * insert it at a specific index using the [param at_index] argument. If you use the default value + * for [param at_index], the point is inserted at the end of the blend points array. */ @JvmOverloads public fun addBlendPoint( @@ -256,7 +257,7 @@ public open class AnimationNodeBlendSpace2D : AnimationRootNode() { } /** - * Updates the position of the point at index [point] on the blend axis. + * Updates the position of the point at index [param point] on the blend axis. */ public fun setBlendPointPosition(point: Int, pos: Vector2): Unit { TransferContext.writeArguments(LONG to point.toLong(), VECTOR2 to pos) @@ -264,7 +265,7 @@ public open class AnimationNodeBlendSpace2D : AnimationRootNode() { } /** - * Returns the position of the point at index [point]. + * Returns the position of the point at index [param point]. */ public fun getBlendPointPosition(point: Int): Vector2 { TransferContext.writeArguments(LONG to point.toLong()) @@ -273,7 +274,7 @@ public open class AnimationNodeBlendSpace2D : AnimationRootNode() { } /** - * Changes the [godot.AnimationNode] referenced by the point at index [point]. + * Changes the [AnimationNode] referenced by the point at index [param point]. */ public fun setBlendPointNode(point: Int, node: AnimationRootNode): Unit { TransferContext.writeArguments(LONG to point.toLong(), OBJECT to node) @@ -281,7 +282,7 @@ public open class AnimationNodeBlendSpace2D : AnimationRootNode() { } /** - * Returns the [godot.AnimationRootNode] referenced by the point at index [point]. + * Returns the [AnimationRootNode] referenced by the point at index [param point]. */ public fun getBlendPointNode(point: Int): AnimationRootNode? { TransferContext.writeArguments(LONG to point.toLong()) @@ -290,7 +291,7 @@ public open class AnimationNodeBlendSpace2D : AnimationRootNode() { } /** - * Removes the point at index [point] from the blend space. + * Removes the point at index [param point] from the blend space. */ public fun removeBlendPoint(point: Int): Unit { TransferContext.writeArguments(LONG to point.toLong()) @@ -307,7 +308,10 @@ public open class AnimationNodeBlendSpace2D : AnimationRootNode() { } /** - * Creates a new triangle using three points [x], [y], and [z]. Triangles can overlap. You can insert the triangle at a specific index using the [atIndex] argument. If you use the default value for [atIndex], the point is inserted at the end of the blend points array. + * Creates a new triangle using three points [param x], [param y], and [param z]. Triangles can + * overlap. You can insert the triangle at a specific index using the [param at_index] argument. If + * you use the default value for [param at_index], the point is inserted at the end of the blend + * points array. */ @JvmOverloads public fun addTriangle( @@ -321,7 +325,8 @@ public open class AnimationNodeBlendSpace2D : AnimationRootNode() { } /** - * Returns the position of the point at index [point] in the triangle of index [triangle]. + * Returns the position of the point at index [param point] in the triangle of index [param + * triangle]. */ public fun getTrianglePoint(triangle: Int, point: Int): Int { TransferContext.writeArguments(LONG to triangle.toLong(), LONG to point.toLong()) @@ -330,7 +335,7 @@ public open class AnimationNodeBlendSpace2D : AnimationRootNode() { } /** - * Removes the triangle at index [triangle] from the blend space. + * Removes the triangle at index [param triangle] from the blend space. */ public fun removeTriangle(triangle: Int): Unit { TransferContext.writeArguments(LONG to triangle.toLong()) @@ -354,11 +359,13 @@ public open class AnimationNodeBlendSpace2D : AnimationRootNode() { */ BLEND_MODE_INTERPOLATED(0), /** - * The blend space plays the animation of the animation node which blending position is closest to. Useful for frame-by-frame 2D animations. + * The blend space plays the animation of the animation node which blending position is closest + * to. Useful for frame-by-frame 2D animations. */ BLEND_MODE_DISCRETE(1), /** - * Similar to [BLEND_MODE_DISCRETE], but starts the new animation at the last animation's playback position. + * Similar to [constant BLEND_MODE_DISCRETE], but starts the new animation at the last + * animation's playback position. */ BLEND_MODE_DISCRETE_CARRY(2), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeBlendTree.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeBlendTree.kt index dd4b491c0..95e44e92e 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeBlendTree.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeBlendTree.kt @@ -30,14 +30,10 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * A sub-tree of many type [godot.AnimationNode]s used for complex animations. Used by [godot.AnimationTree]. - * - * Tutorials: - * [$DOCS_URL/tutorials/animation/animation_tree.html]($DOCS_URL/tutorials/animation/animation_tree.html) - * - * This animation node may contain a sub-tree of any other type animation nodes, such as [godot.AnimationNodeTransition], [godot.AnimationNodeBlend2], [godot.AnimationNodeBlend3], [godot.AnimationNodeOneShot], etc. This is one of the most commonly used animation node roots. - * - * An [godot.AnimationNodeOutput] node named `output` is created by default. + * This animation node may contain a sub-tree of any other type animation nodes, such as + * [AnimationNodeTransition], [AnimationNodeBlend2], [AnimationNodeBlend3], [AnimationNodeOneShot], + * etc. This is one of the most commonly used animation node roots. + * An [AnimationNodeOutput] node named `output` is created by default. */ @GodotBaseType public open class AnimationNodeBlendTree : AnimationRootNode() { @@ -91,7 +87,8 @@ public open class AnimationNodeBlendTree : AnimationRootNode() { /** - * Adds an [godot.AnimationNode] at the given [position]. The [name] is used to identify the created sub animation node later. + * Adds an [AnimationNode] at the given [param position]. The [param name] is used to identify the + * created sub animation node later. */ @JvmOverloads public fun addNode( @@ -104,7 +101,7 @@ public open class AnimationNodeBlendTree : AnimationRootNode() { } /** - * Returns the sub animation node with the specified [name]. + * Returns the sub animation node with the specified [param name]. */ public fun getNode(name: StringName): AnimationNode? { TransferContext.writeArguments(STRING_NAME to name) @@ -129,7 +126,7 @@ public open class AnimationNodeBlendTree : AnimationRootNode() { } /** - * Returns `true` if a sub animation node with specified [name] exists. + * Returns `true` if a sub animation node with specified [param name] exists. */ public fun hasNode(name: StringName): Boolean { TransferContext.writeArguments(STRING_NAME to name) @@ -138,7 +135,8 @@ public open class AnimationNodeBlendTree : AnimationRootNode() { } /** - * Connects the output of an [godot.AnimationNode] as input for another [godot.AnimationNode], at the input port specified by [inputIndex]. + * Connects the output of an [AnimationNode] as input for another [AnimationNode], at the input + * port specified by [param input_index]. */ public fun connectNode( inputNode: StringName, @@ -166,7 +164,7 @@ public open class AnimationNodeBlendTree : AnimationRootNode() { } /** - * Returns the position of the sub animation node with the specified [name]. + * Returns the position of the sub animation node with the specified [param name]. */ public fun getNodePosition(name: StringName): Vector2 { TransferContext.writeArguments(STRING_NAME to name) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeOneShot.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeOneShot.kt index fbee438f6..6ab41559e 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeOneShot.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeOneShot.kt @@ -22,102 +22,58 @@ import kotlin.Long import kotlin.Suppress /** - * Plays an animation once in an [godot.AnimationNodeBlendTree]. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/678](https://godotengine.org/asset-library/asset/678) - * - * A resource to add to an [godot.AnimationNodeBlendTree]. This animation node will execute a sub-animation and return once it finishes. Blend times for fading in and out can be customized, as well as filters. - * - * After setting the request and changing the animation playback, the one-shot node automatically clears the request on the next process frame by setting its `request` value to [ONE_SHOT_REQUEST_NONE]. - * - * [codeblocks] - * - * [gdscript] - * + * A resource to add to an [AnimationNodeBlendTree]. This animation node will execute a + * sub-animation and return once it finishes. Blend times for fading in and out can be customized, as + * well as filters. + * After setting the request and changing the animation playback, the one-shot node automatically + * clears the request on the next process frame by setting its `request` value to [constant + * ONE_SHOT_REQUEST_NONE]. + * + * gdscript: + * ```gdscript * # Play child animation connected to "shot" port. - * * animation_tree.set("parameters/OneShot/request", AnimationNodeOneShot.ONE_SHOT_REQUEST_FIRE) - * * # Alternative syntax (same result as above). - * * animation_tree["parameters/OneShot/request"] = AnimationNodeOneShot.ONE_SHOT_REQUEST_FIRE * - * - * * # Abort child animation connected to "shot" port. - * * animation_tree.set("parameters/OneShot/request", AnimationNodeOneShot.ONE_SHOT_REQUEST_ABORT) - * * # Alternative syntax (same result as above). - * * animation_tree["parameters/OneShot/request"] = AnimationNodeOneShot.ONE_SHOT_REQUEST_ABORT * - * - * * # Abort child animation with fading out connected to "shot" port. - * * animation_tree.set("parameters/OneShot/request", AnimationNodeOneShot.ONE_SHOT_REQUEST_FADE_OUT) - * * # Alternative syntax (same result as above). - * * animation_tree["parameters/OneShot/request"] = AnimationNodeOneShot.ONE_SHOT_REQUEST_FADE_OUT * - * - * * # Get current state (read-only). - * * animation_tree.get("parameters/OneShot/active") - * * # Alternative syntax (same result as above). - * * animation_tree["parameters/OneShot/active"] * - * - * * # Get current internal state (read-only). - * * animation_tree.get("parameters/OneShot/internal_active") - * * # Alternative syntax (same result as above). - * * animation_tree["parameters/OneShot/internal_active"] - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * // Play child animation connected to "shot" port. - * * animationTree.Set("parameters/OneShot/request", (int)AnimationNodeOneShot.OneShotRequest.Fire); * - * - * * // Abort child animation connected to "shot" port. - * * animationTree.Set("parameters/OneShot/request", (int)AnimationNodeOneShot.OneShotRequest.Abort); * - * - * * // Abort child animation with fading out connected to "shot" port. - * - * animationTree.Set("parameters/OneShot/request", (int)AnimationNodeOneShot.OneShotRequest.FadeOut); - * - * + * animationTree.Set("parameters/OneShot/request", + * (int)AnimationNodeOneShot.OneShotRequest.FadeOut); * * // Get current state (read-only). - * * animationTree.Get("parameters/OneShot/active"); * - * - * * // Get current internal state (read-only). - * * animationTree.Get("parameters/OneShot/internal_active"); - * - * [/csharp] - * - * [/codeblocks] + * ``` */ @GodotBaseType public open class AnimationNodeOneShot : AnimationNodeSync() { @@ -136,7 +92,8 @@ public open class AnimationNodeOneShot : AnimationNodeSync() { } /** - * The fade-in duration. For example, setting this to `1.0` for a 5 second length animation will produce a cross-fade that starts at 0 second and ends at 1 second during the animation. + * The fade-in duration. For example, setting this to `1.0` for a 5 second length animation will + * produce a cross-fade that starts at 0 second and ends at 1 second during the animation. */ public var fadeinTime: Double get() { @@ -150,7 +107,8 @@ public open class AnimationNodeOneShot : AnimationNodeSync() { } /** - * Determines how cross-fading between animations is eased. If empty, the transition will be linear. + * Determines how cross-fading between animations is eased. If empty, the transition will be + * linear. */ public var fadeinCurve: Curve? get() { @@ -164,7 +122,8 @@ public open class AnimationNodeOneShot : AnimationNodeSync() { } /** - * The fade-out duration. For example, setting this to `1.0` for a 5 second length animation will produce a cross-fade that starts at 4 second and ends at 5 second during the animation. + * The fade-out duration. For example, setting this to `1.0` for a 5 second length animation will + * produce a cross-fade that starts at 4 second and ends at 5 second during the animation. */ public var fadeoutTime: Double get() { @@ -178,7 +137,8 @@ public open class AnimationNodeOneShot : AnimationNodeSync() { } /** - * Determines how cross-fading between animations is eased. If empty, the transition will be linear. + * Determines how cross-fading between animations is eased. If empty, the transition will be + * linear. */ public var fadeoutCurve: Curve? get() { @@ -193,8 +153,10 @@ public open class AnimationNodeOneShot : AnimationNodeSync() { /** * If `true`, the sub-animation will restart automatically after finishing. - * - * In other words, to start auto restarting, the animation must be played once with the [ONE_SHOT_REQUEST_FIRE] request. The [ONE_SHOT_REQUEST_ABORT] request stops the auto restarting, but it does not disable the [autorestart] itself. So, the [ONE_SHOT_REQUEST_FIRE] request will start auto restarting again. + * In other words, to start auto restarting, the animation must be played once with the [constant + * ONE_SHOT_REQUEST_FIRE] request. The [constant ONE_SHOT_REQUEST_ABORT] request stops the auto + * restarting, but it does not disable the [autorestart] itself. So, the [constant + * ONE_SHOT_REQUEST_FIRE] request will start auto restarting again. */ public var autorestart: Boolean get() { @@ -222,7 +184,8 @@ public open class AnimationNodeOneShot : AnimationNodeSync() { } /** - * If [autorestart] is `true`, a random additional delay (in seconds) between 0 and this value will be added to [autorestartDelay]. + * If [autorestart] is `true`, a random additional delay (in seconds) between 0 and this value + * will be added to [autorestartDelay]. */ public var autorestartRandomDelay: Double get() { @@ -275,11 +238,11 @@ public open class AnimationNodeOneShot : AnimationNodeSync() { id: Long, ) { /** - * Blends two animations. See also [godot.AnimationNodeBlend2]. + * Blends two animations. See also [AnimationNodeBlend2]. */ MIX_MODE_BLEND(0), /** - * Blends two animations additively. See also [godot.AnimationNodeAdd2]. + * Blends two animations additively. See also [AnimationNodeAdd2]. */ MIX_MODE_ADD(1), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeOutput.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeOutput.kt index 0d50f448f..cb7c35902 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeOutput.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeOutput.kt @@ -12,12 +12,7 @@ import kotlin.Int import kotlin.Suppress /** - * The animation output node of an [godot.AnimationNodeBlendTree]. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/678](https://godotengine.org/asset-library/asset/678) - * - * A node created automatically in an [godot.AnimationNodeBlendTree] that outputs the final animation. + * A node created automatically in an [AnimationNodeBlendTree] that outputs the final animation. */ @GodotBaseType public open class AnimationNodeOutput : AnimationNode() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeStateMachinePlayback.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeStateMachinePlayback.kt index 801e85b21..30287e6e4 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeStateMachinePlayback.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeStateMachinePlayback.kt @@ -26,34 +26,21 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * Provides playback control for an [godot.AnimationNodeStateMachine]. - * - * Tutorials: - * [$DOCS_URL/tutorials/animation/animation_tree.html]($DOCS_URL/tutorials/animation/animation_tree.html) - * - * Allows control of [godot.AnimationTree] state machines created with [godot.AnimationNodeStateMachine]. Retrieve with `$AnimationTree.get("parameters/playback")`. - * + * Allows control of [AnimationTree] state machines created with [AnimationNodeStateMachine]. + * Retrieve with `$AnimationTree.get("parameters/playback")`. * **Example:** * - * [codeblocks] - * - * [gdscript] - * + * gdscript: + * ```gdscript * var state_machine = $AnimationTree.get("parameters/playback") - * * state_machine.travel("some_state") - * - * [/gdscript] - * - * [csharp] - * - * var stateMachine = GetNode("AnimationTree").Get("parameters/playback").As(); - * + * ``` + * csharp: + * ```csharp + * var stateMachine = + * GetNode("AnimationTree").Get("parameters/playback").As(); * stateMachine.Travel("some_state"); - * - * [/csharp] - * - * [/codeblocks] + * ``` */ @GodotBaseType public open class AnimationNodeStateMachinePlayback : Resource() { @@ -64,10 +51,10 @@ public open class AnimationNodeStateMachinePlayback : Resource() { /** * Transitions from the current state to another one, following the shortest path. - * - * If the path does not connect from the current state, the animation will play after the state teleports. - * - * If [resetOnTeleport] is `true`, the animation is played from the beginning when the travel cause a teleportation. + * If the path does not connect from the current state, the animation will play after the state + * teleports. + * If [param reset_on_teleport] is `true`, the animation is played from the beginning when the + * travel cause a teleportation. */ @JvmOverloads public fun travel(toNode: StringName, resetOnTeleport: Boolean = true): Unit { @@ -77,8 +64,7 @@ public open class AnimationNodeStateMachinePlayback : Resource() { /** * Starts playing the given animation. - * - * If [reset] is `true`, the animation is played from the beginning. + * If [param reset] is `true`, the animation is played from the beginning. */ @JvmOverloads public fun start(node: StringName, reset: Boolean = true): Unit { @@ -87,7 +73,8 @@ public open class AnimationNodeStateMachinePlayback : Resource() { } /** - * If there is a next path by travel or auto advance, immediately transitions from the current state to the next state. + * If there is a next path by travel or auto advance, immediately transitions from the current + * state to the next state. */ public fun next(): Unit { TransferContext.writeArguments() @@ -113,8 +100,8 @@ public open class AnimationNodeStateMachinePlayback : Resource() { /** * Returns the currently playing animation state. - * - * **Note:** When using a cross-fade, the current state changes to the next state immediately after the cross-fade begins. + * **Note:** When using a cross-fade, the current state changes to the next state immediately + * after the cross-fade begins. */ public fun getCurrentNode(): StringName { TransferContext.writeArguments() @@ -133,8 +120,10 @@ public open class AnimationNodeStateMachinePlayback : Resource() { /** * Returns the current state length. - * - * **Note:** It is possible that any [godot.AnimationRootNode] can be nodes as well as animations. This means that there can be multiple animations within a single state. Which animation length has priority depends on the nodes connected inside it. Also, if a transition does not reset, the remaining length at that point will be returned. + * **Note:** It is possible that any [AnimationRootNode] can be nodes as well as animations. This + * means that there can be multiple animations within a single state. Which animation length has + * priority depends on the nodes connected inside it. Also, if a transition does not reset, the + * remaining length at that point will be returned. */ public fun getCurrentLength(): Float { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeStateMachineTransition.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeStateMachineTransition.kt index e67e29f6f..73770dd75 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeStateMachineTransition.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeStateMachineTransition.kt @@ -29,13 +29,8 @@ import kotlin.String import kotlin.Suppress /** - * A transition within an [godot.AnimationNodeStateMachine] connecting two [godot.AnimationRootNode]s. - * - * Tutorials: - * [$DOCS_URL/tutorials/animation/animation_tree.html]($DOCS_URL/tutorials/animation/animation_tree.html) - * - * The path generated when using [godot.AnimationNodeStateMachinePlayback.travel] is limited to the nodes connected by [godot.AnimationNodeStateMachineTransition]. - * + * The path generated when using [AnimationNodeStateMachinePlayback.travel] is limited to the nodes + * connected by [AnimationNodeStateMachineTransition]. * You can set the timing and conditions of the transition in detail. */ @GodotBaseType @@ -88,7 +83,9 @@ public open class AnimationNodeStateMachineTransition : Resource() { } /** - * Lower priority transitions are preferred when travelling through the tree via [godot.AnimationNodeStateMachinePlayback.travel] or [advanceMode] is set to [ADVANCE_MODE_AUTO]. + * Lower priority transitions are preferred when travelling through the tree via + * [AnimationNodeStateMachinePlayback.travel] or [advanceMode] is set to [constant + * ADVANCE_MODE_AUTO]. */ public var priority: Int get() { @@ -116,7 +113,9 @@ public open class AnimationNodeStateMachineTransition : Resource() { } /** - * Determines whether the transition should disabled, enabled when using [godot.AnimationNodeStateMachinePlayback.travel], or traversed automatically if the [advanceCondition] and [advanceExpression] checks are true (if assigned). + * Determines whether the transition should disabled, enabled when using + * [AnimationNodeStateMachinePlayback.travel], or traversed automatically if the [advanceCondition] + * and [advanceExpression] checks are true (if assigned). */ public var advanceMode: AdvanceMode get() { @@ -130,23 +129,21 @@ public open class AnimationNodeStateMachineTransition : Resource() { } /** - * Turn on auto advance when this condition is set. The provided name will become a boolean parameter on the [godot.AnimationTree] that can be controlled from code (see [godot.Using AnimationTree]($DOCS_URL/tutorials/animation/animation_tree.html#controlling-from-code)). For example, if [godot.AnimationTree.treeRoot] is an [godot.AnimationNodeStateMachine] and [advanceCondition] is set to `"idle"`: - * - * [codeblocks] - * - * [gdscript] + * Turn on auto advance when this condition is set. The provided name will become a boolean + * parameter on the [AnimationTree] that can be controlled from code (see + * [url=$DOCS_URL/tutorials/animation/animation_tree.html#controlling-from-code]Using + * AnimationTree[/url]). For example, if [AnimationTree.treeRoot] is an [AnimationNodeStateMachine] + * and [advanceCondition] is set to `"idle"`: * + * gdscript: + * ```gdscript * $animation_tree.set("parameters/conditions/idle", is_on_floor and (linear_velocity.x == 0)) - * - * [/gdscript] - * - * [csharp] - * - * GetNode("animation_tree").Set("parameters/conditions/idle", IsOnFloor && (LinearVelocity.X == 0)); - * - * [/csharp] - * - * [/codeblocks] + * ``` + * csharp: + * ```csharp + * GetNode("animation_tree").Set("parameters/conditions/idle", IsOnFloor && + * (LinearVelocity.X == 0)); + * ``` */ public var advanceCondition: StringName get() { @@ -160,7 +157,9 @@ public open class AnimationNodeStateMachineTransition : Resource() { } /** - * Use an expression as a condition for state machine transitions. It is possible to create complex animation advance conditions for switching between states and gives much greater flexibility for creating complex state machines by directly interfacing with the script code. + * Use an expression as a condition for state machine transitions. It is possible to create + * complex animation advance conditions for switching between states and gives much greater + * flexibility for creating complex state machines by directly interfacing with the script code. */ public var advanceExpression: String get() { @@ -182,15 +181,18 @@ public open class AnimationNodeStateMachineTransition : Resource() { id: Long, ) { /** - * Switch to the next state immediately. The current state will end and blend into the beginning of the new one. + * Switch to the next state immediately. The current state will end and blend into the beginning + * of the new one. */ SWITCH_MODE_IMMEDIATE(0), /** - * Switch to the next state immediately, but will seek the new state to the playback position of the old state. + * Switch to the next state immediately, but will seek the new state to the playback position of + * the old state. */ SWITCH_MODE_SYNC(1), /** - * Wait for the current state playback to end, then switch to the beginning of the next state animation. + * Wait for the current state playback to end, then switch to the beginning of the next state + * animation. */ SWITCH_MODE_AT_END(2), ; @@ -213,11 +215,12 @@ public open class AnimationNodeStateMachineTransition : Resource() { */ ADVANCE_MODE_DISABLED(0), /** - * Only use this transition during [godot.AnimationNodeStateMachinePlayback.travel]. + * Only use this transition during [AnimationNodeStateMachinePlayback.travel]. */ ADVANCE_MODE_ENABLED(1), /** - * Automatically use this transition if the [advanceCondition] and [advanceExpression] checks are true (if assigned). + * Automatically use this transition if the [advanceCondition] and [advanceExpression] checks + * are true (if assigned). */ ADVANCE_MODE_AUTO(2), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeSub2.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeSub2.kt index a3254c59f..36d5bc467 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeSub2.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeSub2.kt @@ -12,18 +12,16 @@ import kotlin.Int import kotlin.Suppress /** - * Blends two animations subtractively inside of an [godot.AnimationNodeBlendTree]. - * - * Tutorials: - * [$DOCS_URL/tutorials/animation/animation_tree.html]($DOCS_URL/tutorials/animation/animation_tree.html) - * - * A resource to add to an [godot.AnimationNodeBlendTree]. Blends two animations subtractively based on the amount value. - * - * This animation node is usually used for pre-calculation to cancel out any extra poses from the animation for the "add" animation source in [godot.AnimationNodeAdd2] or [godot.AnimationNodeAdd3]. - * - * In general, the blend value should be in the `[0.0, 1.0]` range, but values outside of this range can be used for amplified or inverted animations. - * - * **Note:** This calculation is different from using a negative value in [godot.AnimationNodeAdd2], since the transformation matrices do not satisfy the commutative law. [godot.AnimationNodeSub2] multiplies the transformation matrix of the inverted animation from the left side, while negative [godot.AnimationNodeAdd2] multiplies it from the right side. + * A resource to add to an [AnimationNodeBlendTree]. Blends two animations subtractively based on + * the amount value. + * This animation node is usually used for pre-calculation to cancel out any extra poses from the + * animation for the "add" animation source in [AnimationNodeAdd2] or [AnimationNodeAdd3]. + * In general, the blend value should be in the `[0.0, 1.0]` range, but values outside of this range + * can be used for amplified or inverted animations. + * **Note:** This calculation is different from using a negative value in [AnimationNodeAdd2], since + * the transformation matrices do not satisfy the commutative law. [AnimationNodeSub2] multiplies the + * transformation matrix of the inverted animation from the left side, while negative + * [AnimationNodeAdd2] multiplies it from the right side. */ @GodotBaseType public open class AnimationNodeSub2 : AnimationNodeSync() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeSync.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeSync.kt index 64b40ccf3..1715a23f1 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeSync.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeSync.kt @@ -17,18 +17,13 @@ import kotlin.Int import kotlin.Suppress /** - * Base class for [godot.AnimationNode]s with more than two input ports that must be synchronized. - * - * Tutorials: - * [$DOCS_URL/tutorials/animation/animation_tree.html]($DOCS_URL/tutorials/animation/animation_tree.html) - * - * An animation node used to combine, mix, or blend two or more animations together while keeping them synchronized within an [godot.AnimationTree]. + * An animation node used to combine, mix, or blend two or more animations together while keeping + * them synchronized within an [AnimationTree]. */ @GodotBaseType public open class AnimationNodeSync : AnimationNode() { /** * If `false`, the blended animations' frame are stopped when the blend value is `0`. - * * If `true`, forcing the blended animations to advance frame. */ public var sync: Boolean diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeTimeSeek.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeTimeSeek.kt index df97c0346..fcf193c44 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeTimeSeek.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeTimeSeek.kt @@ -12,54 +12,32 @@ import kotlin.Int import kotlin.Suppress /** - * A time-seeking animation node used in [godot.AnimationTree]. - * - * Tutorials: - * [$DOCS_URL/tutorials/animation/animation_tree.html]($DOCS_URL/tutorials/animation/animation_tree.html) - * - * This animation node can be used to cause a seek command to happen to any sub-children of the animation graph. Use to play an [godot.Animation] from the start or a certain playback position inside the [godot.AnimationNodeBlendTree]. - * - * After setting the time and changing the animation playback, the time seek node automatically goes into sleep mode on the next process frame by setting its `seek_request` value to `-1.0`. - * - * [codeblocks] - * - * [gdscript] - * + * This animation node can be used to cause a seek command to happen to any sub-children of the + * animation graph. Use to play an [Animation] from the start or a certain playback position inside the + * [AnimationNodeBlendTree]. + * After setting the time and changing the animation playback, the time seek node automatically goes + * into sleep mode on the next process frame by setting its `seek_request` value to `-1.0`. + * + * gdscript: + * ```gdscript * # Play child animation from the start. - * * animation_tree.set("parameters/TimeSeek/seek_request", 0.0) - * * # Alternative syntax (same result as above). - * * animation_tree["parameters/TimeSeek/seek_request"] = 0.0 * - * - * * # Play child animation from 12 second timestamp. - * * animation_tree.set("parameters/TimeSeek/seek_request", 12.0) - * * # Alternative syntax (same result as above). - * * animation_tree["parameters/TimeSeek/seek_request"] = 12.0 - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * // Play child animation from the start. - * * animationTree.Set("parameters/TimeSeek/seek_request", 0.0); * - * - * * // Play child animation from 12 second timestamp. - * * animationTree.Set("parameters/TimeSeek/seek_request", 12.0); - * - * [/csharp] - * - * [/codeblocks] + * ``` */ @GodotBaseType public open class AnimationNodeTimeSeek : AnimationNode() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeTransition.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeTransition.kt index fe38db4f3..95ae4e6dd 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeTransition.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationNodeTransition.kt @@ -23,72 +23,41 @@ import kotlin.Unit import kotlin.jvm.JvmName /** - * A transition within an [godot.AnimationTree] connecting two [godot.AnimationNode]s. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/678](https://godotengine.org/asset-library/asset/678) - * - * Simple state machine for cases which don't require a more advanced [godot.AnimationNodeStateMachine]. Animations can be connected to the inputs and transition times can be specified. - * - * After setting the request and changing the animation playback, the transition node automatically clears the request on the next process frame by setting its `transition_request` value to empty. - * - * **Note:** When using a cross-fade, `current_state` and `current_index` change to the next state immediately after the cross-fade begins. - * - * [codeblocks] - * - * [gdscript] - * + * Simple state machine for cases which don't require a more advanced [AnimationNodeStateMachine]. + * Animations can be connected to the inputs and transition times can be specified. + * After setting the request and changing the animation playback, the transition node automatically + * clears the request on the next process frame by setting its `transition_request` value to empty. + * **Note:** When using a cross-fade, `current_state` and `current_index` change to the next state + * immediately after the cross-fade begins. + * + * gdscript: + * ```gdscript * # Play child animation connected to "state_2" port. - * * animation_tree.set("parameters/Transition/transition_request", "state_2") - * * # Alternative syntax (same result as above). - * * animation_tree["parameters/Transition/transition_request"] = "state_2" * - * - * * # Get current state name (read-only). - * * animation_tree.get("parameters/Transition/current_state") - * * # Alternative syntax (same result as above). - * * animation_tree["parameters/Transition/current_state"] * - * - * * # Get current state index (read-only). - * * animation_tree.get("parameters/Transition/current_index") - * * # Alternative syntax (same result as above). - * * animation_tree["parameters/Transition/current_index"] - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * // Play child animation connected to "state_2" port. - * * animationTree.Set("parameters/Transition/transition_request", "state_2"); * - * - * * // Get current state name (read-only). - * * animationTree.Get("parameters/Transition/current_state"); * - * - * * // Get current state index (read-only). - * * animationTree.Get("parameters/Transition/current_index"); - * - * [/csharp] - * - * [/codeblocks] + * ``` */ @GodotBaseType public open class AnimationNodeTransition : AnimationNodeSync() { @@ -107,7 +76,8 @@ public open class AnimationNodeTransition : AnimationNodeSync() { } /** - * Determines how cross-fading between animations is eased. If empty, the transition will be linear. + * Determines how cross-fading between animations is eased. If empty, the transition will be + * linear. */ public var xfadeCurve: Curve? get() { @@ -121,7 +91,8 @@ public open class AnimationNodeTransition : AnimationNodeSync() { } /** - * If `true`, allows transition to the self state. When the reset option is enabled in input, the animation is restarted. If `false`, nothing happens on the transition to the self state. + * If `true`, allows transition to the self state. When the reset option is enabled in input, the + * animation is restarted. If `false`, nothing happens on the transition to the self state. */ public var allowTransitionToSelf: Boolean get() { @@ -151,7 +122,9 @@ public open class AnimationNodeTransition : AnimationNodeSync() { } /** - * Enables or disables auto-advance for the given [input] index. If enabled, state changes to the next input after playing the animation once. If enabled for the last input state, it loops to the first. + * Enables or disables auto-advance for the given [param input] index. If enabled, state changes + * to the next input after playing the animation once. If enabled for the last input state, it loops + * to the first. */ public fun setInputAsAutoAdvance(input: Int, enable: Boolean): Unit { TransferContext.writeArguments(LONG to input.toLong(), BOOL to enable) @@ -159,7 +132,7 @@ public open class AnimationNodeTransition : AnimationNodeSync() { } /** - * Returns `true` if auto-advance is enabled for the given [input] index. + * Returns `true` if auto-advance is enabled for the given [param input] index. */ public fun isInputSetAsAutoAdvance(input: Int): Boolean { TransferContext.writeArguments(LONG to input.toLong()) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationPlayer.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationPlayer.kt index 554996216..43fb11d9d 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationPlayer.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationPlayer.kt @@ -35,17 +35,15 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * A node used for animation playback. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/678](https://godotengine.org/asset-library/asset/678) - * - * An animation player is used for general-purpose playback of animations. It contains a dictionary of [godot.AnimationLibrary] resources and custom blend times between animation transitions. - * - * Some methods and properties use a single key to reference an animation directly. These keys are formatted as the key for the library, followed by a forward slash, then the key for the animation within the library, for example `"movement/run"`. If the library's key is an empty string (known as the default library), the forward slash is omitted, being the same key used by the library. - * - * [godot.AnimationPlayer] is better-suited than [godot.Tween] for more complex animations, for example ones with non-trivial timings. It can also be used over [godot.Tween] if the animation track editor is more convenient than doing it in code. - * + * An animation player is used for general-purpose playback of animations. It contains a dictionary + * of [AnimationLibrary] resources and custom blend times between animation transitions. + * Some methods and properties use a single key to reference an animation directly. These keys are + * formatted as the key for the library, followed by a forward slash, then the key for the animation + * within the library, for example `"movement/run"`. If the library's key is an empty string (known as + * the default library), the forward slash is omitted, being the same key used by the library. + * [AnimationPlayer] is better-suited than [Tween] for more complex animations, for example ones + * with non-trivial timings. It can also be used over [Tween] if the animation track editor is more + * convenient than doing it in code. * Updating the target properties of animations occurs at the process frame. */ @GodotBaseType @@ -56,16 +54,20 @@ public open class AnimationPlayer : AnimationMixer() { public val currentAnimationChanged: Signal1 by signal("name") /** - * Emitted when a queued animation plays after the previous animation finished. See also [godot.AnimationPlayer.queue]. - * - * **Note:** The signal is not emitted when the animation is changed via [godot.AnimationPlayer.play] or by an [godot.AnimationTree]. + * Emitted when a queued animation plays after the previous animation finished. See also + * [AnimationPlayer.queue]. + * **Note:** The signal is not emitted when the animation is changed via [AnimationPlayer.play] or + * by an [AnimationTree]. */ public val animationChanged: Signal2 by signal("oldName", "newName") /** - * The key of the currently playing animation. If no animation is playing, the property's value is an empty string. Changing this value does not restart the animation. See [play] for more information on playing animations. - * - * **Note:** While this property appears in the Inspector, it's not meant to be edited, and it's not saved in the scene. This property is mainly used to get the currently playing animation, and internally for animation playback tracks. For more information, see [godot.Animation]. + * The key of the currently playing animation. If no animation is playing, the property's value is + * an empty string. Changing this value does not restart the animation. See [play] for more + * information on playing animations. + * **Note:** While this property appears in the Inspector, it's not meant to be edited, and it's + * not saved in the scene. This property is mainly used to get the currently playing animation, and + * internally for animation playback tracks. For more information, see [Animation]. */ public var currentAnimation: String get() { @@ -79,7 +81,8 @@ public open class AnimationPlayer : AnimationMixer() { } /** - * If playing, the current animation's key, otherwise, the animation last played. When set, this changes the animation, but will not play it unless already playing. See also [currentAnimation]. + * If playing, the current animation's key, otherwise, the animation last played. When set, this + * changes the animation, but will not play it unless already playing. See also [currentAnimation]. */ public var assignedAnimation: String get() { @@ -141,9 +144,10 @@ public open class AnimationPlayer : AnimationMixer() { } /** - * The speed scaling ratio. For example, if this value is `1`, then the animation plays at normal speed. If it's `0.5`, then it plays at half speed. If it's `2`, then it plays at double speed. - * - * If set to a negative value, the animation is played in reverse. If set to `0`, the animation will not advance. + * The speed scaling ratio. For example, if this value is `1`, then the animation plays at normal + * speed. If it's `0.5`, then it plays at half speed. If it's `2`, then it plays at double speed. + * If set to a negative value, the animation is played in reverse. If set to `0`, the animation + * will not advance. */ public var speedScale: Float get() { @@ -157,9 +161,11 @@ public open class AnimationPlayer : AnimationMixer() { } /** - * If `true` and the engine is running in Movie Maker mode (see [godot.MovieWriter]), exits the engine with [godot.SceneTree.quit] as soon as an animation is done playing in this [godot.AnimationPlayer]. A message is printed when the engine quits for this reason. - * - * **Note:** This obeys the same logic as the [godot.AnimationMixer.animationFinished] signal, so it will not quit the engine if the animation is set to be looping. + * If `true` and the engine is running in Movie Maker mode (see [MovieWriter]), exits the engine + * with [SceneTree.quit] as soon as an animation is done playing in this [AnimationPlayer]. A message + * is printed when the engine quits for this reason. + * **Note:** This obeys the same logic as the [signal AnimationMixer.animation_finished] signal, + * so it will not quit the engine if the animation is set to be looping. */ public var movieQuitOnFinish: Boolean get() { @@ -178,7 +184,8 @@ public open class AnimationPlayer : AnimationMixer() { } /** - * Triggers the [animationTo] animation when the [animationFrom] animation completes. + * Triggers the [param animation_to] animation when the [param animation_from] animation + * completes. */ public fun animationSetNext(animationFrom: StringName, animationTo: StringName): Unit { TransferContext.writeArguments(STRING_NAME to animationFrom, STRING_NAME to animationTo) @@ -186,7 +193,8 @@ public open class AnimationPlayer : AnimationMixer() { } /** - * Returns the key of the animation which is queued to play after the [animationFrom] animation. + * Returns the key of the animation which is queued to play after the [param animation_from] + * animation. */ public fun animationGetNext(animationFrom: StringName): StringName { TransferContext.writeArguments(STRING_NAME to animationFrom) @@ -216,13 +224,17 @@ public open class AnimationPlayer : AnimationMixer() { } /** - * Plays the animation with key [name]. Custom blend times and speed can be set. - * - * The [fromEnd] option only affects when switching to a new animation track, or if the same track but at the start or end. It does not affect resuming playback that was paused in the middle of an animation. If [customSpeed] is negative and [fromEnd] is `true`, the animation will play backwards (which is equivalent to calling [playBackwards]). - * - * The [godot.AnimationPlayer] keeps track of its current or last played animation with [assignedAnimation]. If this method is called with that same animation [name], or with no [name] parameter, the assigned animation will resume playing if it was paused. - * - * **Note:** The animation will be updated the next time the [godot.AnimationPlayer] is processed. If other variables are updated at the same time this is called, they may be updated too early. To perform the update immediately, call `advance(0)`. + * Plays the animation with key [param name]. Custom blend times and speed can be set. + * The [param from_end] option only affects when switching to a new animation track, or if the + * same track but at the start or end. It does not affect resuming playback that was paused in the + * middle of an animation. If [param custom_speed] is negative and [param from_end] is `true`, the + * animation will play backwards (which is equivalent to calling [playBackwards]). + * The [AnimationPlayer] keeps track of its current or last played animation with + * [assignedAnimation]. If this method is called with that same animation [param name], or with no + * [param name] parameter, the assigned animation will resume playing if it was paused. + * **Note:** The animation will be updated the next time the [AnimationPlayer] is processed. If + * other variables are updated at the same time this is called, they may be updated too early. To + * perform the update immediately, call `advance(0)`. */ @JvmOverloads public fun play( @@ -236,9 +248,9 @@ public open class AnimationPlayer : AnimationMixer() { } /** - * Plays the animation with key [name] in reverse. - * - * This method is a shorthand for [play] with `custom_speed = -1.0` and `from_end = true`, so see its description for more information. + * Plays the animation with key [param name] in reverse. + * This method is a shorthand for [play] with `custom_speed = -1.0` and `from_end = true`, so see + * its description for more information. */ @JvmOverloads public fun playBackwards(name: StringName = StringName(""), customBlend: Double = -1.0): Unit { @@ -247,8 +259,9 @@ public open class AnimationPlayer : AnimationMixer() { } /** - * Pauses the currently playing animation. The [currentAnimationPosition] will be kept and calling [play] or [playBackwards] without arguments or with the same animation name as [assignedAnimation] will resume the animation. - * + * Pauses the currently playing animation. The [currentAnimationPosition] will be kept and calling + * [play] or [playBackwards] without arguments or with the same animation name as [assignedAnimation] + * will resume the animation. * See also [stop]. */ public fun pause(): Unit { @@ -257,10 +270,9 @@ public open class AnimationPlayer : AnimationMixer() { } /** - * Stops the currently playing animation. The animation position is reset to `0` and the `custom_speed` is reset to `1.0`. See also [pause]. - * - * If [keepState] is `true`, the animation state is not updated visually. - * + * Stops the currently playing animation. The animation position is reset to `0` and the + * `custom_speed` is reset to `1.0`. See also [pause]. + * If [param keep_state] is `true`, the animation state is not updated visually. * **Note:** The method / audio / animation playback tracks will not be processed by this method. */ @JvmOverloads @@ -270,7 +282,8 @@ public open class AnimationPlayer : AnimationMixer() { } /** - * Returns `true` if an animation is currently playing (even if [speedScale] and/or `custom_speed` are `0`). + * Returns `true` if an animation is currently playing (even if [speedScale] and/or `custom_speed` + * are `0`). */ public fun isPlaying(): Boolean { TransferContext.writeArguments() @@ -280,8 +293,8 @@ public open class AnimationPlayer : AnimationMixer() { /** * Queues an animation for playback once the current one is done. - * - * **Note:** If a looped animation is currently playing, the queued animation will never play unless the looped animation is stopped somehow. + * **Note:** If a looped animation is currently playing, the queued animation will never play + * unless the looped animation is stopped somehow. */ public fun queue(name: StringName): Unit { TransferContext.writeArguments(STRING_NAME to name) @@ -306,8 +319,9 @@ public open class AnimationPlayer : AnimationMixer() { } /** - * Returns the actual playing speed of current animation or `0` if not playing. This speed is the [speedScale] property multiplied by `custom_speed` argument specified when calling the [play] method. - * + * Returns the actual playing speed of current animation or `0` if not playing. This speed is the + * [speedScale] property multiplied by `custom_speed` argument specified when calling the [play] + * method. * Returns a negative value if the current animation is playing backwards. */ public fun getPlayingSpeed(): Float { @@ -317,11 +331,14 @@ public open class AnimationPlayer : AnimationMixer() { } /** - * Seeks the animation to the [seconds] point in time (in seconds). If [update] is `true`, the animation updates too, otherwise it updates at process time. Events between the current frame and [seconds] are skipped. - * - * If [updateOnly] is true, the method / audio / animation playback tracks will not be processed. - * - * **Note:** Seeking to the end of the animation doesn't emit [godot.AnimationMixer.animationFinished]. If you want to skip animation and emit the signal, use [godot.AnimationMixer.advance]. + * Seeks the animation to the [param seconds] point in time (in seconds). If [param update] is + * `true`, the animation updates too, otherwise it updates at process time. Events between the + * current frame and [param seconds] are skipped. + * If [param update_only] is true, the method / audio / animation playback tracks will not be + * processed. + * **Note:** Seeking to the end of the animation doesn't emit [signal + * AnimationMixer.animation_finished]. If you want to skip animation and emit the signal, use + * [AnimationMixer.advance]. */ @JvmOverloads public fun seek( @@ -368,7 +385,7 @@ public open class AnimationPlayer : AnimationMixer() { } /** - * For backward compatibility. See [godot.AnimationMixer.rootNode]. + * For backward compatibility. See [AnimationMixer.rootNode]. */ public fun setRoot(path: NodePath): Unit { TransferContext.writeArguments(NODE_PATH to path) @@ -376,7 +393,7 @@ public open class AnimationPlayer : AnimationMixer() { } /** - * For backward compatibility. See [godot.AnimationMixer.rootNode]. + * For backward compatibility. See [AnimationMixer.rootNode]. */ public fun getRoot(): NodePath { TransferContext.writeArguments() @@ -388,15 +405,18 @@ public open class AnimationPlayer : AnimationMixer() { id: Long, ) { /** - * For backward compatibility. See [godot.AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_PHYSICS]. + * For backward compatibility. See [constant + * AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_PHYSICS]. */ ANIMATION_PROCESS_PHYSICS(0), /** - * For backward compatibility. See [godot.AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_IDLE]. + * For backward compatibility. See [constant + * AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_IDLE]. */ ANIMATION_PROCESS_IDLE(1), /** - * For backward compatibility. See [godot.AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_MANUAL]. + * For backward compatibility. See [constant + * AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_MANUAL]. */ ANIMATION_PROCESS_MANUAL(2), ; @@ -415,11 +435,13 @@ public open class AnimationPlayer : AnimationMixer() { id: Long, ) { /** - * For backward compatibility. See [godot.AnimationMixer.ANIMATION_CALLBACK_MODE_METHOD_DEFERRED]. + * For backward compatibility. See [constant + * AnimationMixer.ANIMATION_CALLBACK_MODE_METHOD_DEFERRED]. */ ANIMATION_METHOD_CALL_DEFERRED(0), /** - * For backward compatibility. See [godot.AnimationMixer.ANIMATION_CALLBACK_MODE_METHOD_IMMEDIATE]. + * For backward compatibility. See [constant + * AnimationMixer.ANIMATION_CALLBACK_MODE_METHOD_IMMEDIATE]. */ ANIMATION_METHOD_CALL_IMMEDIATE(1), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationRootNode.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationRootNode.kt index aa87e67f6..e288258a7 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationRootNode.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationRootNode.kt @@ -12,14 +12,15 @@ import kotlin.Int import kotlin.Suppress /** - * Base class for [godot.AnimationNode]s that hold one or multiple composite animations. Usually used for [godot.AnimationTree.treeRoot]. - * - * Tutorials: - * [$DOCS_URL/tutorials/animation/animation_tree.html]($DOCS_URL/tutorials/animation/animation_tree.html) - * - * [godot.AnimationRootNode] is a base class for [godot.AnimationNode]s that hold a complete animation. A complete animation refers to the output of an [godot.AnimationNodeOutput] in an [godot.AnimationNodeBlendTree] or the output of another [godot.AnimationRootNode]. Used for [godot.AnimationTree.treeRoot] or in other [godot.AnimationRootNode]s. - * - * Examples of built-in root nodes include [godot.AnimationNodeBlendTree] (allows blending nodes between each other using various modes), [godot.AnimationNodeStateMachine] (allows to configure blending and transitions between nodes using a state machine pattern), [godot.AnimationNodeBlendSpace2D] (allows linear blending between **three** [godot.AnimationNode]s), [godot.AnimationNodeBlendSpace1D] (allows linear blending only between **two** [godot.AnimationNode]s). + * [AnimationRootNode] is a base class for [AnimationNode]s that hold a complete animation. A + * complete animation refers to the output of an [AnimationNodeOutput] in an [AnimationNodeBlendTree] + * or the output of another [AnimationRootNode]. Used for [AnimationTree.treeRoot] or in other + * [AnimationRootNode]s. + * Examples of built-in root nodes include [AnimationNodeBlendTree] (allows blending nodes between + * each other using various modes), [AnimationNodeStateMachine] (allows to configure blending and + * transitions between nodes using a state machine pattern), [AnimationNodeBlendSpace2D] (allows linear + * blending between **three** [AnimationNode]s), [AnimationNodeBlendSpace1D] (allows linear blending + * only between **two** [AnimationNode]s). */ @GodotBaseType public open class AnimationRootNode : AnimationNode() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationTree.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationTree.kt index 3726c24c3..33afc2990 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationTree.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AnimationTree.kt @@ -24,14 +24,11 @@ import kotlin.Suppress import kotlin.Unit /** - * A node used for advanced animation transitions in an [godot.AnimationPlayer]. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/678](https://godotengine.org/asset-library/asset/678) - * - * A node used for advanced animation transitions in an [godot.AnimationPlayer]. - * - * **Note:** When linked with an [godot.AnimationPlayer], several properties and methods of the corresponding [godot.AnimationPlayer] will not function as expected. Playback and transitions should be handled using only the [godot.AnimationTree] and its constituent [godot.AnimationNode](s). The [godot.AnimationPlayer] node should be used solely for adding, deleting, and editing animations. + * A node used for advanced animation transitions in an [AnimationPlayer]. + * **Note:** When linked with an [AnimationPlayer], several properties and methods of the + * corresponding [AnimationPlayer] will not function as expected. Playback and transitions should be + * handled using only the [AnimationTree] and its constituent [AnimationNode](s). The [AnimationPlayer] + * node should be used solely for adding, deleting, and editing animations. */ @GodotBaseType public open class AnimationTree : AnimationMixer() { @@ -41,7 +38,7 @@ public open class AnimationTree : AnimationMixer() { public val animationPlayerChanged: Signal0 by signal() /** - * The root animation node of this [godot.AnimationTree]. See [godot.AnimationRootNode]. + * The root animation node of this [AnimationTree]. See [AnimationRootNode]. */ public var treeRoot: AnimationRootNode? get() { @@ -55,7 +52,8 @@ public open class AnimationTree : AnimationMixer() { } /** - * The path to the [godot.Node] used to evaluate the [godot.AnimationNode] [godot.Expression] if one is not explicitly specified internally. + * The path to the [Node] used to evaluate the [AnimationNode] [Expression] if one is not + * explicitly specified internally. */ public var advanceExpressionBaseNode: NodePath get() { @@ -69,7 +67,7 @@ public open class AnimationTree : AnimationMixer() { } /** - * The path to the [godot.AnimationPlayer] used for animating. + * The path to the [AnimationPlayer] used for animating. */ public var animPlayer: NodePath get() { @@ -108,15 +106,18 @@ public open class AnimationTree : AnimationMixer() { id: Long, ) { /** - * For backward compatibility. See [godot.AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_PHYSICS]. + * For backward compatibility. See [constant + * AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_PHYSICS]. */ ANIMATION_PROCESS_PHYSICS(0), /** - * For backward compatibility. See [godot.AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_IDLE]. + * For backward compatibility. See [constant + * AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_IDLE]. */ ANIMATION_PROCESS_IDLE(1), /** - * For backward compatibility. See [godot.AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_MANUAL]. + * For backward compatibility. See [constant + * AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_MANUAL]. */ ANIMATION_PROCESS_MANUAL(2), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Area2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Area2D.kt index cf13f12c1..ecae83c05 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Area2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Area2D.kt @@ -36,106 +36,96 @@ import kotlin.Suppress import kotlin.Unit /** - * A region of 2D space that detects other [godot.CollisionObject2D]s entering or exiting it. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/120](https://godotengine.org/asset-library/asset/120) - * - * [godot.Area2D] is a region of 2D space defined by one or multiple [godot.CollisionShape2D] or [godot.CollisionPolygon2D] child nodes. It detects when other [godot.CollisionObject2D]s enter or exit it, and it also keeps track of which collision objects haven't exited it yet (i.e. which one are overlapping it). - * - * This node can also locally alter or override physics parameters (gravity, damping) and route audio to custom audio buses. + * [Area2D] is a region of 2D space defined by one or multiple [CollisionShape2D] or + * [CollisionPolygon2D] child nodes. It detects when other [CollisionObject2D]s enter or exit it, and + * it also keeps track of which collision objects haven't exited it yet (i.e. which one are overlapping + * it). + * This node can also locally alter or override physics parameters (gravity, damping) and route + * audio to custom audio buses. */ @GodotBaseType public open class Area2D : CollisionObject2D() { /** - * Emitted when a [godot.Shape2D] of the received [body] enters a shape of this area. [body] can be a [godot.PhysicsBody2D] or a [godot.TileMap]. [godot.TileMap]s are detected if their [godot.TileSet] has collision shapes configured. Requires [monitoring] to be set to `true`. - * - * [localShapeIndex] and [bodyShapeIndex] contain indices of the interacting shapes from this area and the interacting body, respectively. [bodyRid] contains the [RID] of the body. These values can be used with the [godot.PhysicsServer2D]. - * - * **Example of getting the** [godot.CollisionShape2D] **node from the shape index:** - * - * [codeblocks] - * - * [gdscript] - * + * Emitted when a [Shape2D] of the received [param body] enters a shape of this area. [param body] + * can be a [PhysicsBody2D] or a [TileMap]. [TileMap]s are detected if their [TileSet] has collision + * shapes configured. Requires [monitoring] to be set to `true`. + * [param local_shape_index] and [param body_shape_index] contain indices of the interacting + * shapes from this area and the interacting body, respectively. [param body_rid] contains the [RID] + * of the body. These values can be used with the [PhysicsServer2D]. + * **Example of getting the** [CollisionShape2D] **node from the shape index:** + * + * gdscript: + * ```gdscript * var body_shape_owner = body.shape_find_owner(body_shape_index) - * * var body_shape_node = body.shape_owner_get_owner(body_shape_owner) * - * - * * var local_shape_owner = shape_find_owner(local_shape_index) - * * var local_shape_node = shape_owner_get_owner(local_shape_owner) - * - * [/gdscript] - * - * [/codeblocks] + * ``` */ public val bodyShapeEntered: Signal4 by signal("bodyRid", "body", "bodyShapeIndex", "localShapeIndex") /** - * Emitted when a [godot.Shape2D] of the received [body] exits a shape of this area. [body] can be a [godot.PhysicsBody2D] or a [godot.TileMap]. [godot.TileMap]s are detected if their [godot.TileSet] has collision shapes configured. Requires [monitoring] to be set to `true`. - * - * See also [bodyShapeEntered]. + * Emitted when a [Shape2D] of the received [param body] exits a shape of this area. [param body] + * can be a [PhysicsBody2D] or a [TileMap]. [TileMap]s are detected if their [TileSet] has collision + * shapes configured. Requires [monitoring] to be set to `true`. + * See also [signal body_shape_entered]. */ public val bodyShapeExited: Signal4 by signal("bodyRid", "body", "bodyShapeIndex", "localShapeIndex") /** - * Emitted when the received [body] enters this area. [body] can be a [godot.PhysicsBody2D] or a [godot.TileMap]. [godot.TileMap]s are detected if their [godot.TileSet] has collision shapes configured. Requires [monitoring] to be set to `true`. + * Emitted when the received [param body] enters this area. [param body] can be a [PhysicsBody2D] + * or a [TileMap]. [TileMap]s are detected if their [TileSet] has collision shapes configured. + * Requires [monitoring] to be set to `true`. */ public val bodyEntered: Signal1 by signal("body") /** - * Emitted when the received [body] exits this area. [body] can be a [godot.PhysicsBody2D] or a [godot.TileMap]. [godot.TileMap]s are detected if their [godot.TileSet] has collision shapes configured. Requires [monitoring] to be set to `true`. + * Emitted when the received [param body] exits this area. [param body] can be a [PhysicsBody2D] + * or a [TileMap]. [TileMap]s are detected if their [TileSet] has collision shapes configured. + * Requires [monitoring] to be set to `true`. */ public val bodyExited: Signal1 by signal("body") /** - * Emitted when a [godot.Shape2D] of the received [area] enters a shape of this area. Requires [monitoring] to be set to `true`. - * - * [localShapeIndex] and [areaShapeIndex] contain indices of the interacting shapes from this area and the other area, respectively. [areaRid] contains the [RID] of the other area. These values can be used with the [godot.PhysicsServer2D]. - * - * **Example of getting the** [godot.CollisionShape2D] **node from the shape index:** - * - * [codeblocks] - * - * [gdscript] - * + * Emitted when a [Shape2D] of the received [param area] enters a shape of this area. Requires + * [monitoring] to be set to `true`. + * [param local_shape_index] and [param area_shape_index] contain indices of the interacting + * shapes from this area and the other area, respectively. [param area_rid] contains the [RID] of the + * other area. These values can be used with the [PhysicsServer2D]. + * **Example of getting the** [CollisionShape2D] **node from the shape index:** + * + * gdscript: + * ```gdscript * var other_shape_owner = area.shape_find_owner(area_shape_index) - * * var other_shape_node = area.shape_owner_get_owner(other_shape_owner) * - * - * * var local_shape_owner = shape_find_owner(local_shape_index) - * * var local_shape_node = shape_owner_get_owner(local_shape_owner) - * - * [/gdscript] - * - * [/codeblocks] + * ``` */ public val areaShapeEntered: Signal4 by signal("areaRid", "area", "areaShapeIndex", "localShapeIndex") /** - * Emitted when a [godot.Shape2D] of the received [area] exits a shape of this area. Requires [monitoring] to be set to `true`. - * - * See also [areaShapeEntered]. + * Emitted when a [Shape2D] of the received [param area] exits a shape of this area. Requires + * [monitoring] to be set to `true`. + * See also [signal area_shape_entered]. */ public val areaShapeExited: Signal4 by signal("areaRid", "area", "areaShapeIndex", "localShapeIndex") /** - * Emitted when the received [area] enters this area. Requires [monitoring] to be set to `true`. + * Emitted when the received [param area] enters this area. Requires [monitoring] to be set to + * `true`. */ public val areaEntered: Signal1 by signal("area") /** - * Emitted when the received [area] exits this area. Requires [monitoring] to be set to `true`. + * Emitted when the received [param area] exits this area. Requires [monitoring] to be set to + * `true`. */ public val areaExited: Signal1 by signal("area") @@ -168,7 +158,8 @@ public open class Area2D : CollisionObject2D() { } /** - * The area's priority. Higher priority areas are processed first. The [godot.World2D]'s physics is always processed last, after all areas. + * The area's priority. Higher priority areas are processed first. The [World2D]'s physics is + * always processed last, after all areas. */ public var priority: Int get() { @@ -182,7 +173,8 @@ public open class Area2D : CollisionObject2D() { } /** - * Override mode for gravity calculations within this area. See [enum SpaceOverride] for possible values. + * Override mode for gravity calculations within this area. See [enum SpaceOverride] for possible + * values. */ public var gravitySpaceOverride: SpaceOverride get() { @@ -196,7 +188,8 @@ public open class Area2D : CollisionObject2D() { } /** - * If `true`, gravity is calculated from a point (set via [gravityPointCenter]). See also [gravitySpaceOverride]. + * If `true`, gravity is calculated from a point (set via [gravityPointCenter]). See also + * [gravitySpaceOverride]. */ public var gravityPoint: Boolean get() { @@ -210,9 +203,13 @@ public open class Area2D : CollisionObject2D() { } /** - * The distance at which the gravity strength is equal to [gravity]. For example, on a planet 100 pixels in radius with a surface gravity of 4.0 px/s², set the [gravity] to 4.0 and the unit distance to 100.0. The gravity will have falloff according to the inverse square law, so in the example, at 200 pixels from the center the gravity will be 1.0 px/s² (twice the distance, 1/4th the gravity), at 50 pixels it will be 16.0 px/s² (half the distance, 4x the gravity), and so on. - * - * The above is true only when the unit distance is a positive number. When this is set to 0.0, the gravity will be constant regardless of distance. + * The distance at which the gravity strength is equal to [gravity]. For example, on a planet 100 + * pixels in radius with a surface gravity of 4.0 px/s², set the [gravity] to 4.0 and the unit + * distance to 100.0. The gravity will have falloff according to the inverse square law, so in the + * example, at 200 pixels from the center the gravity will be 1.0 px/s² (twice the distance, 1/4th + * the gravity), at 50 pixels it will be 16.0 px/s² (half the distance, 4x the gravity), and so on. + * The above is true only when the unit distance is a positive number. When this is set to 0.0, + * the gravity will be constant regardless of distance. */ public var gravityPointUnitDistance: Float get() { @@ -256,7 +253,8 @@ public open class Area2D : CollisionObject2D() { } /** - * The area's gravity intensity (in pixels per second squared). This value multiplies the gravity direction. This is useful to alter the force of gravity without altering its direction. + * The area's gravity intensity (in pixels per second squared). This value multiplies the gravity + * direction. This is useful to alter the force of gravity without altering its direction. */ public var gravity: Float get() { @@ -270,7 +268,8 @@ public open class Area2D : CollisionObject2D() { } /** - * Override mode for linear damping calculations within this area. See [enum SpaceOverride] for possible values. + * Override mode for linear damping calculations within this area. See [enum SpaceOverride] for + * possible values. */ public var linearDampSpaceOverride: SpaceOverride get() { @@ -284,9 +283,9 @@ public open class Area2D : CollisionObject2D() { } /** - * The rate at which objects stop moving in this area. Represents the linear velocity lost per second. - * - * See [godot.ProjectSettings.physics/2d/defaultLinearDamp] for more details about damping. + * The rate at which objects stop moving in this area. Represents the linear velocity lost per + * second. + * See [ProjectSettings.physics/2d/defaultLinearDamp] for more details about damping. */ public var linearDamp: Float get() { @@ -300,7 +299,8 @@ public open class Area2D : CollisionObject2D() { } /** - * Override mode for angular damping calculations within this area. See [enum SpaceOverride] for possible values. + * Override mode for angular damping calculations within this area. See [enum SpaceOverride] for + * possible values. */ public var angularDampSpaceOverride: SpaceOverride get() { @@ -314,9 +314,9 @@ public open class Area2D : CollisionObject2D() { } /** - * The rate at which objects stop spinning in this area. Represents the angular velocity lost per second. - * - * See [godot.ProjectSettings.physics/2d/defaultAngularDamp] for more details about damping. + * The rate at which objects stop spinning in this area. Represents the angular velocity lost per + * second. + * See [ProjectSettings.physics/2d/defaultAngularDamp] for more details about damping. */ public var angularDamp: Float get() { @@ -413,9 +413,12 @@ public open class Area2D : CollisionObject2D() { /** - * Returns a list of intersecting [godot.PhysicsBody2D]s and [godot.TileMap]s. The overlapping body's [godot.CollisionObject2D.collisionLayer] must be part of this area's [godot.CollisionObject2D.collisionMask] in order to be detected. - * - * For performance reasons (collisions are all processed at the same time) this list is modified once during the physics step, not immediately after objects are moved. Consider using signals instead. + * Returns a list of intersecting [PhysicsBody2D]s and [TileMap]s. The overlapping body's + * [CollisionObject2D.collisionLayer] must be part of this area's [CollisionObject2D.collisionMask] + * in order to be detected. + * For performance reasons (collisions are all processed at the same time) this list is modified + * once during the physics step, not immediately after objects are moved. Consider using signals + * instead. */ public fun getOverlappingBodies(): VariantArray { TransferContext.writeArguments() @@ -424,9 +427,12 @@ public open class Area2D : CollisionObject2D() { } /** - * Returns a list of intersecting [godot.Area2D]s. The overlapping area's [godot.CollisionObject2D.collisionLayer] must be part of this area's [godot.CollisionObject2D.collisionMask] in order to be detected. - * - * For performance reasons (collisions are all processed at the same time) this list is modified once during the physics step, not immediately after objects are moved. Consider using signals instead. + * Returns a list of intersecting [Area2D]s. The overlapping area's + * [CollisionObject2D.collisionLayer] must be part of this area's [CollisionObject2D.collisionMask] + * in order to be detected. + * For performance reasons (collisions are all processed at the same time) this list is modified + * once during the physics step, not immediately after objects are moved. Consider using signals + * instead. */ public fun getOverlappingAreas(): VariantArray { TransferContext.writeArguments() @@ -435,9 +441,12 @@ public open class Area2D : CollisionObject2D() { } /** - * Returns `true` if intersecting any [godot.PhysicsBody2D]s or [godot.TileMap]s, otherwise returns `false`. The overlapping body's [godot.CollisionObject2D.collisionLayer] must be part of this area's [godot.CollisionObject2D.collisionMask] in order to be detected. - * - * For performance reasons (collisions are all processed at the same time) the list of overlapping bodies is modified once during the physics step, not immediately after objects are moved. Consider using signals instead. + * Returns `true` if intersecting any [PhysicsBody2D]s or [TileMap]s, otherwise returns `false`. + * The overlapping body's [CollisionObject2D.collisionLayer] must be part of this area's + * [CollisionObject2D.collisionMask] in order to be detected. + * For performance reasons (collisions are all processed at the same time) the list of overlapping + * bodies is modified once during the physics step, not immediately after objects are moved. Consider + * using signals instead. */ public fun hasOverlappingBodies(): Boolean { TransferContext.writeArguments() @@ -446,9 +455,12 @@ public open class Area2D : CollisionObject2D() { } /** - * Returns `true` if intersecting any [godot.Area2D]s, otherwise returns `false`. The overlapping area's [godot.CollisionObject2D.collisionLayer] must be part of this area's [godot.CollisionObject2D.collisionMask] in order to be detected. - * - * For performance reasons (collisions are all processed at the same time) the list of overlapping areas is modified once during the physics step, not immediately after objects are moved. Consider using signals instead. + * Returns `true` if intersecting any [Area2D]s, otherwise returns `false`. The overlapping area's + * [CollisionObject2D.collisionLayer] must be part of this area's [CollisionObject2D.collisionMask] + * in order to be detected. + * For performance reasons (collisions are all processed at the same time) the list of overlapping + * areas is modified once during the physics step, not immediately after objects are moved. Consider + * using signals instead. */ public fun hasOverlappingAreas(): Boolean { TransferContext.writeArguments() @@ -457,11 +469,13 @@ public open class Area2D : CollisionObject2D() { } /** - * Returns `true` if the given physics body intersects or overlaps this [godot.Area2D], `false` otherwise. - * - * **Note:** The result of this test is not immediate after moving objects. For performance, list of overlaps is updated once per frame and before the physics step. Consider using signals instead. - * - * The [body] argument can either be a [godot.PhysicsBody2D] or a [godot.TileMap] instance. While TileMaps are not physics bodies themselves, they register their tiles with collision shapes as a virtual physics body. + * Returns `true` if the given physics body intersects or overlaps this [Area2D], `false` + * otherwise. + * **Note:** The result of this test is not immediate after moving objects. For performance, list + * of overlaps is updated once per frame and before the physics step. Consider using signals instead. + * The [param body] argument can either be a [PhysicsBody2D] or a [TileMap] instance. While + * TileMaps are not physics bodies themselves, they register their tiles with collision shapes as a + * virtual physics body. */ public fun overlapsBody(body: Node): Boolean { TransferContext.writeArguments(OBJECT to body) @@ -470,9 +484,10 @@ public open class Area2D : CollisionObject2D() { } /** - * Returns `true` if the given [godot.Area2D] intersects or overlaps this [godot.Area2D], `false` otherwise. - * - * **Note:** The result of this test is not immediate after moving objects. For performance, the list of overlaps is updated once per frame and before the physics step. Consider using signals instead. + * Returns `true` if the given [Area2D] intersects or overlaps this [Area2D], `false` otherwise. + * **Note:** The result of this test is not immediate after moving objects. For performance, the + * list of overlaps is updated once per frame and before the physics step. Consider using signals + * instead. */ public fun overlapsArea(area: Node): Boolean { TransferContext.writeArguments(OBJECT to area) @@ -488,11 +503,13 @@ public open class Area2D : CollisionObject2D() { */ SPACE_OVERRIDE_DISABLED(0), /** - * This area adds its gravity/damping values to whatever has been calculated so far (in [priority] order). + * This area adds its gravity/damping values to whatever has been calculated so far (in + * [priority] order). */ SPACE_OVERRIDE_COMBINE(1), /** - * This area adds its gravity/damping values to whatever has been calculated so far (in [priority] order), ignoring any lower priority areas. + * This area adds its gravity/damping values to whatever has been calculated so far (in + * [priority] order), ignoring any lower priority areas. */ SPACE_OVERRIDE_COMBINE_REPLACE(2), /** @@ -500,7 +517,8 @@ public open class Area2D : CollisionObject2D() { */ SPACE_OVERRIDE_REPLACE(3), /** - * This area replaces any gravity/damping calculated so far (in [priority] order), but keeps calculating the rest of the areas. + * This area replaces any gravity/damping calculated so far (in [priority] order), but keeps + * calculating the rest of the areas. */ SPACE_OVERRIDE_REPLACE_COMBINE(4), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Area3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Area3D.kt index 481b89c3f..c63d2dfbe 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Area3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Area3D.kt @@ -38,108 +38,102 @@ import kotlin.Suppress import kotlin.Unit /** - * A region of 3D space that detects other [godot.CollisionObject3D]s entering or exiting it. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/127](https://godotengine.org/asset-library/asset/127) - * - * [godot.Area3D] is a region of 3D space defined by one or multiple [godot.CollisionShape3D] or [godot.CollisionPolygon3D] child nodes. It detects when other [godot.CollisionObject3D]s enter or exit it, and it also keeps track of which collision objects haven't exited it yet (i.e. which one are overlapping it). - * - * This node can also locally alter or override physics parameters (gravity, damping) and route audio to custom audio buses. - * - * **Warning:** Using a [godot.ConcavePolygonShape3D] inside a [godot.CollisionShape3D] child of this node (created e.g. by using the **Create Trimesh Collision Sibling** option in the **Mesh** menu that appears when selecting a [godot.MeshInstance3D] node) may give unexpected results, since this collision shape is hollow. If this is not desired, it has to be split into multiple [godot.ConvexPolygonShape3D]s or primitive shapes like [godot.BoxShape3D], or in some cases it may be replaceable by a [godot.CollisionPolygon3D]. + * [Area3D] is a region of 3D space defined by one or multiple [CollisionShape3D] or + * [CollisionPolygon3D] child nodes. It detects when other [CollisionObject3D]s enter or exit it, and + * it also keeps track of which collision objects haven't exited it yet (i.e. which one are overlapping + * it). + * This node can also locally alter or override physics parameters (gravity, damping) and route + * audio to custom audio buses. + * **Warning:** Using a [ConcavePolygonShape3D] inside a [CollisionShape3D] child of this node + * (created e.g. by using the **Create Trimesh Collision Sibling** option in the **Mesh** menu that + * appears when selecting a [MeshInstance3D] node) may give unexpected results, since this collision + * shape is hollow. If this is not desired, it has to be split into multiple [ConvexPolygonShape3D]s or + * primitive shapes like [BoxShape3D], or in some cases it may be replaceable by a + * [CollisionPolygon3D]. */ @GodotBaseType public open class Area3D : CollisionObject3D() { /** - * Emitted when a [godot.Shape3D] of the received [body] enters a shape of this area. [body] can be a [godot.PhysicsBody3D] or a [godot.GridMap]. [godot.GridMap]s are detected if their [godot.MeshLibrary] has collision shapes configured. Requires [monitoring] to be set to `true`. - * - * [localShapeIndex] and [bodyShapeIndex] contain indices of the interacting shapes from this area and the interacting body, respectively. [bodyRid] contains the [RID] of the body. These values can be used with the [godot.PhysicsServer3D]. - * - * **Example of getting the** [godot.CollisionShape3D] **node from the shape index:** - * - * [codeblocks] - * - * [gdscript] + * Emitted when a [Shape3D] of the received [param body] enters a shape of this area. [param body] + * can be a [PhysicsBody3D] or a [GridMap]. [GridMap]s are detected if their [MeshLibrary] has + * collision shapes configured. Requires [monitoring] to be set to `true`. + * [param local_shape_index] and [param body_shape_index] contain indices of the interacting + * shapes from this area and the interacting body, respectively. [param body_rid] contains the [RID] + * of the body. These values can be used with the [PhysicsServer3D]. + * **Example of getting the** [CollisionShape3D] **node from the shape index:** * + * gdscript: + * ```gdscript * var body_shape_owner = body.shape_find_owner(body_shape_index) - * * var body_shape_node = body.shape_owner_get_owner(body_shape_owner) * - * - * * var local_shape_owner = shape_find_owner(local_shape_index) - * * var local_shape_node = shape_owner_get_owner(local_shape_owner) - * - * [/gdscript] - * - * [/codeblocks] + * ``` */ public val bodyShapeEntered: Signal4 by signal("bodyRid", "body", "bodyShapeIndex", "localShapeIndex") /** - * Emitted when a [godot.Shape3D] of the received [body] exits a shape of this area. [body] can be a [godot.PhysicsBody3D] or a [godot.GridMap]. [godot.GridMap]s are detected if their [godot.MeshLibrary] has collision shapes configured. Requires [monitoring] to be set to `true`. - * - * See also [bodyShapeEntered]. + * Emitted when a [Shape3D] of the received [param body] exits a shape of this area. [param body] + * can be a [PhysicsBody3D] or a [GridMap]. [GridMap]s are detected if their [MeshLibrary] has + * collision shapes configured. Requires [monitoring] to be set to `true`. + * See also [signal body_shape_entered]. */ public val bodyShapeExited: Signal4 by signal("bodyRid", "body", "bodyShapeIndex", "localShapeIndex") /** - * Emitted when the received [body] enters this area. [body] can be a [godot.PhysicsBody3D] or a [godot.GridMap]. [godot.GridMap]s are detected if their [godot.MeshLibrary] has collision shapes configured. Requires [monitoring] to be set to `true`. + * Emitted when the received [param body] enters this area. [param body] can be a [PhysicsBody3D] + * or a [GridMap]. [GridMap]s are detected if their [MeshLibrary] has collision shapes configured. + * Requires [monitoring] to be set to `true`. */ public val bodyEntered: Signal1 by signal("body") /** - * Emitted when the received [body] exits this area. [body] can be a [godot.PhysicsBody3D] or a [godot.GridMap]. [godot.GridMap]s are detected if their [godot.MeshLibrary] has collision shapes configured. Requires [monitoring] to be set to `true`. + * Emitted when the received [param body] exits this area. [param body] can be a [PhysicsBody3D] + * or a [GridMap]. [GridMap]s are detected if their [MeshLibrary] has collision shapes configured. + * Requires [monitoring] to be set to `true`. */ public val bodyExited: Signal1 by signal("body") /** - * Emitted when a [godot.Shape3D] of the received [area] enters a shape of this area. Requires [monitoring] to be set to `true`. - * - * [localShapeIndex] and [areaShapeIndex] contain indices of the interacting shapes from this area and the other area, respectively. [areaRid] contains the [RID] of the other area. These values can be used with the [godot.PhysicsServer3D]. - * - * **Example of getting the** [godot.CollisionShape3D] **node from the shape index:** - * - * [codeblocks] - * - * [gdscript] + * Emitted when a [Shape3D] of the received [param area] enters a shape of this area. Requires + * [monitoring] to be set to `true`. + * [param local_shape_index] and [param area_shape_index] contain indices of the interacting + * shapes from this area and the other area, respectively. [param area_rid] contains the [RID] of the + * other area. These values can be used with the [PhysicsServer3D]. + * **Example of getting the** [CollisionShape3D] **node from the shape index:** * + * gdscript: + * ```gdscript * var other_shape_owner = area.shape_find_owner(area_shape_index) - * * var other_shape_node = area.shape_owner_get_owner(other_shape_owner) * - * - * * var local_shape_owner = shape_find_owner(local_shape_index) - * * var local_shape_node = shape_owner_get_owner(local_shape_owner) - * - * [/gdscript] - * - * [/codeblocks] + * ``` */ public val areaShapeEntered: Signal4 by signal("areaRid", "area", "areaShapeIndex", "localShapeIndex") /** - * Emitted when a [godot.Shape3D] of the received [area] exits a shape of this area. Requires [monitoring] to be set to `true`. - * - * See also [areaShapeEntered]. + * Emitted when a [Shape3D] of the received [param area] exits a shape of this area. Requires + * [monitoring] to be set to `true`. + * See also [signal area_shape_entered]. */ public val areaShapeExited: Signal4 by signal("areaRid", "area", "areaShapeIndex", "localShapeIndex") /** - * Emitted when the received [area] enters this area. Requires [monitoring] to be set to `true`. + * Emitted when the received [param area] enters this area. Requires [monitoring] to be set to + * `true`. */ public val areaEntered: Signal1 by signal("area") /** - * Emitted when the received [area] exits this area. Requires [monitoring] to be set to `true`. + * Emitted when the received [param area] exits this area. Requires [monitoring] to be set to + * `true`. */ public val areaExited: Signal1 by signal("area") @@ -172,7 +166,8 @@ public open class Area3D : CollisionObject3D() { } /** - * The area's priority. Higher priority areas are processed first. The [godot.World3D]'s physics is always processed last, after all areas. + * The area's priority. Higher priority areas are processed first. The [World3D]'s physics is + * always processed last, after all areas. */ public var priority: Int get() { @@ -186,7 +181,8 @@ public open class Area3D : CollisionObject3D() { } /** - * Override mode for gravity calculations within this area. See [enum SpaceOverride] for possible values. + * Override mode for gravity calculations within this area. See [enum SpaceOverride] for possible + * values. */ public var gravitySpaceOverride: SpaceOverride get() { @@ -200,7 +196,8 @@ public open class Area3D : CollisionObject3D() { } /** - * If `true`, gravity is calculated from a point (set via [gravityPointCenter]). See also [gravitySpaceOverride]. + * If `true`, gravity is calculated from a point (set via [gravityPointCenter]). See also + * [gravitySpaceOverride]. */ public var gravityPoint: Boolean get() { @@ -214,9 +211,13 @@ public open class Area3D : CollisionObject3D() { } /** - * The distance at which the gravity strength is equal to [gravity]. For example, on a planet 100 meters in radius with a surface gravity of 4.0 m/s², set the [gravity] to 4.0 and the unit distance to 100.0. The gravity will have falloff according to the inverse square law, so in the example, at 200 meters from the center the gravity will be 1.0 m/s² (twice the distance, 1/4th the gravity), at 50 meters it will be 16.0 m/s² (half the distance, 4x the gravity), and so on. - * - * The above is true only when the unit distance is a positive number. When this is set to 0.0, the gravity will be constant regardless of distance. + * The distance at which the gravity strength is equal to [gravity]. For example, on a planet 100 + * meters in radius with a surface gravity of 4.0 m/s², set the [gravity] to 4.0 and the unit + * distance to 100.0. The gravity will have falloff according to the inverse square law, so in the + * example, at 200 meters from the center the gravity will be 1.0 m/s² (twice the distance, 1/4th the + * gravity), at 50 meters it will be 16.0 m/s² (half the distance, 4x the gravity), and so on. + * The above is true only when the unit distance is a positive number. When this is set to 0.0, + * the gravity will be constant regardless of distance. */ public var gravityPointUnitDistance: Float get() { @@ -260,7 +261,8 @@ public open class Area3D : CollisionObject3D() { } /** - * The area's gravity intensity (in meters per second squared). This value multiplies the gravity direction. This is useful to alter the force of gravity without altering its direction. + * The area's gravity intensity (in meters per second squared). This value multiplies the gravity + * direction. This is useful to alter the force of gravity without altering its direction. */ public var gravity: Float get() { @@ -274,7 +276,8 @@ public open class Area3D : CollisionObject3D() { } /** - * Override mode for linear damping calculations within this area. See [enum SpaceOverride] for possible values. + * Override mode for linear damping calculations within this area. See [enum SpaceOverride] for + * possible values. */ public var linearDampSpaceOverride: SpaceOverride get() { @@ -288,9 +291,9 @@ public open class Area3D : CollisionObject3D() { } /** - * The rate at which objects stop moving in this area. Represents the linear velocity lost per second. - * - * See [godot.ProjectSettings.physics/3d/defaultLinearDamp] for more details about damping. + * The rate at which objects stop moving in this area. Represents the linear velocity lost per + * second. + * See [ProjectSettings.physics/3d/defaultLinearDamp] for more details about damping. */ public var linearDamp: Float get() { @@ -304,7 +307,8 @@ public open class Area3D : CollisionObject3D() { } /** - * Override mode for angular damping calculations within this area. See [enum SpaceOverride] for possible values. + * Override mode for angular damping calculations within this area. See [enum SpaceOverride] for + * possible values. */ public var angularDampSpaceOverride: SpaceOverride get() { @@ -318,9 +322,9 @@ public open class Area3D : CollisionObject3D() { } /** - * The rate at which objects stop spinning in this area. Represents the angular velocity lost per second. - * - * See [godot.ProjectSettings.physics/3d/defaultAngularDamp] for more details about damping. + * The rate at which objects stop spinning in this area. Represents the angular velocity lost per + * second. + * See [ProjectSettings.physics/3d/defaultAngularDamp] for more details about damping. */ public var angularDamp: Float get() { @@ -362,7 +366,9 @@ public open class Area3D : CollisionObject3D() { } /** - * The [godot.Node3D] which is used to specify the direction and origin of an area-specific wind force. The direction is opposite to the z-axis of the [godot.Node3D]'s local transform, and its origin is the origin of the [godot.Node3D]'s local transform. + * The [Node3D] which is used to specify the direction and origin of an area-specific wind force. + * The direction is opposite to the z-axis of the [Node3D]'s local transform, and its origin is the + * origin of the [Node3D]'s local transform. */ public var windSourcePath: NodePath get() { @@ -432,7 +438,8 @@ public open class Area3D : CollisionObject3D() { } /** - * The degree to which this area applies reverb to its associated audio. Ranges from `0` to `1` with `0.1` precision. + * The degree to which this area applies reverb to its associated audio. Ranges from `0` to `1` + * with `0.1` precision. */ public var reverbBusAmount: Float get() { @@ -446,7 +453,8 @@ public open class Area3D : CollisionObject3D() { } /** - * The degree to which this area's reverb is a uniform effect. Ranges from `0` to `1` with `0.1` precision. + * The degree to which this area's reverb is a uniform effect. Ranges from `0` to `1` with `0.1` + * precision. */ public var reverbBusUniformity: Float get() { @@ -515,9 +523,12 @@ public open class Area3D : CollisionObject3D() { /** - * Returns a list of intersecting [godot.PhysicsBody3D]s and [godot.GridMap]s. The overlapping body's [godot.CollisionObject3D.collisionLayer] must be part of this area's [godot.CollisionObject3D.collisionMask] in order to be detected. - * - * For performance reasons (collisions are all processed at the same time) this list is modified once during the physics step, not immediately after objects are moved. Consider using signals instead. + * Returns a list of intersecting [PhysicsBody3D]s and [GridMap]s. The overlapping body's + * [CollisionObject3D.collisionLayer] must be part of this area's [CollisionObject3D.collisionMask] + * in order to be detected. + * For performance reasons (collisions are all processed at the same time) this list is modified + * once during the physics step, not immediately after objects are moved. Consider using signals + * instead. */ public fun getOverlappingBodies(): VariantArray { TransferContext.writeArguments() @@ -526,9 +537,12 @@ public open class Area3D : CollisionObject3D() { } /** - * Returns a list of intersecting [godot.Area3D]s. The overlapping area's [godot.CollisionObject3D.collisionLayer] must be part of this area's [godot.CollisionObject3D.collisionMask] in order to be detected. - * - * For performance reasons (collisions are all processed at the same time) this list is modified once during the physics step, not immediately after objects are moved. Consider using signals instead. + * Returns a list of intersecting [Area3D]s. The overlapping area's + * [CollisionObject3D.collisionLayer] must be part of this area's [CollisionObject3D.collisionMask] + * in order to be detected. + * For performance reasons (collisions are all processed at the same time) this list is modified + * once during the physics step, not immediately after objects are moved. Consider using signals + * instead. */ public fun getOverlappingAreas(): VariantArray { TransferContext.writeArguments() @@ -537,9 +551,12 @@ public open class Area3D : CollisionObject3D() { } /** - * Returns `true` if intersecting any [godot.PhysicsBody3D]s or [godot.GridMap]s, otherwise returns `false`. The overlapping body's [godot.CollisionObject3D.collisionLayer] must be part of this area's [godot.CollisionObject3D.collisionMask] in order to be detected. - * - * For performance reasons (collisions are all processed at the same time) the list of overlapping bodies is modified once during the physics step, not immediately after objects are moved. Consider using signals instead. + * Returns `true` if intersecting any [PhysicsBody3D]s or [GridMap]s, otherwise returns `false`. + * The overlapping body's [CollisionObject3D.collisionLayer] must be part of this area's + * [CollisionObject3D.collisionMask] in order to be detected. + * For performance reasons (collisions are all processed at the same time) the list of overlapping + * bodies is modified once during the physics step, not immediately after objects are moved. Consider + * using signals instead. */ public fun hasOverlappingBodies(): Boolean { TransferContext.writeArguments() @@ -548,9 +565,12 @@ public open class Area3D : CollisionObject3D() { } /** - * Returns `true` if intersecting any [godot.Area3D]s, otherwise returns `false`. The overlapping area's [godot.CollisionObject3D.collisionLayer] must be part of this area's [godot.CollisionObject3D.collisionMask] in order to be detected. - * - * For performance reasons (collisions are all processed at the same time) the list of overlapping areas is modified once during the physics step, not immediately after objects are moved. Consider using signals instead. + * Returns `true` if intersecting any [Area3D]s, otherwise returns `false`. The overlapping area's + * [CollisionObject3D.collisionLayer] must be part of this area's [CollisionObject3D.collisionMask] + * in order to be detected. + * For performance reasons (collisions are all processed at the same time) the list of overlapping + * areas is modified once during the physics step, not immediately after objects are moved. Consider + * using signals instead. */ public fun hasOverlappingAreas(): Boolean { TransferContext.writeArguments() @@ -559,11 +579,13 @@ public open class Area3D : CollisionObject3D() { } /** - * Returns `true` if the given physics body intersects or overlaps this [godot.Area3D], `false` otherwise. - * - * **Note:** The result of this test is not immediate after moving objects. For performance, list of overlaps is updated once per frame and before the physics step. Consider using signals instead. - * - * The [body] argument can either be a [godot.PhysicsBody3D] or a [godot.GridMap] instance. While GridMaps are not physics body themselves, they register their tiles with collision shapes as a virtual physics body. + * Returns `true` if the given physics body intersects or overlaps this [Area3D], `false` + * otherwise. + * **Note:** The result of this test is not immediate after moving objects. For performance, list + * of overlaps is updated once per frame and before the physics step. Consider using signals instead. + * The [param body] argument can either be a [PhysicsBody3D] or a [GridMap] instance. While + * GridMaps are not physics body themselves, they register their tiles with collision shapes as a + * virtual physics body. */ public fun overlapsBody(body: Node): Boolean { TransferContext.writeArguments(OBJECT to body) @@ -572,9 +594,9 @@ public open class Area3D : CollisionObject3D() { } /** - * Returns `true` if the given [godot.Area3D] intersects or overlaps this [godot.Area3D], `false` otherwise. - * - * **Note:** The result of this test is not immediate after moving objects. For performance, list of overlaps is updated once per frame and before the physics step. Consider using signals instead. + * Returns `true` if the given [Area3D] intersects or overlaps this [Area3D], `false` otherwise. + * **Note:** The result of this test is not immediate after moving objects. For performance, list + * of overlaps is updated once per frame and before the physics step. Consider using signals instead. */ public fun overlapsArea(area: Node): Boolean { TransferContext.writeArguments(OBJECT to area) @@ -590,11 +612,13 @@ public open class Area3D : CollisionObject3D() { */ SPACE_OVERRIDE_DISABLED(0), /** - * This area adds its gravity/damping values to whatever has been calculated so far (in [priority] order). + * This area adds its gravity/damping values to whatever has been calculated so far (in + * [priority] order). */ SPACE_OVERRIDE_COMBINE(1), /** - * This area adds its gravity/damping values to whatever has been calculated so far (in [priority] order), ignoring any lower priority areas. + * This area adds its gravity/damping values to whatever has been calculated so far (in + * [priority] order), ignoring any lower priority areas. */ SPACE_OVERRIDE_COMBINE_REPLACE(2), /** @@ -602,7 +626,8 @@ public open class Area3D : CollisionObject3D() { */ SPACE_OVERRIDE_REPLACE(3), /** - * This area replaces any gravity/damping calculated so far (in [priority] order), but keeps calculating the rest of the areas. + * This area replaces any gravity/damping calculated so far (in [priority] order), but keeps + * calculating the rest of the areas. */ SPACE_OVERRIDE_REPLACE_COMBINE(4), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ArrayMesh.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ArrayMesh.kt index a9305437a..e7fbe2371 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ArrayMesh.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ArrayMesh.kt @@ -41,96 +41,52 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * [godot.Mesh] type that provides utility for constructing a surface from arrays. - * - * Tutorials: - * [$DOCS_URL/tutorials/3d/procedural_geometry/arraymesh.html]($DOCS_URL/tutorials/3d/procedural_geometry/arraymesh.html) - * - * The [godot.ArrayMesh] is used to construct a [godot.Mesh] by specifying the attributes as arrays. - * + * The [ArrayMesh] is used to construct a [Mesh] by specifying the attributes as arrays. * The most basic example is the creation of a single triangle: * - * [codeblocks] - * - * [gdscript] - * + * gdscript: + * ```gdscript * var vertices = PackedVector3Array() - * * vertices.push_back(Vector3(0, 1, 0)) - * * vertices.push_back(Vector3(1, 0, 0)) - * * vertices.push_back(Vector3(0, 0, 1)) * - * - * * # Initialize the ArrayMesh. - * * var arr_mesh = ArrayMesh.new() - * * var arrays = [] - * * arrays.resize(Mesh.ARRAY_MAX) - * - * arrays[godot.Mesh.ARRAY_VERTEX] = vertices - * - * + * arrays[Mesh.ARRAY_VERTEX] = vertices * * # Create the Mesh. - * * arr_mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, arrays) - * * var m = MeshInstance3D.new() - * * m.mesh = arr_mesh - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * var vertices = new Vector3[] - * * { - * * new Vector3(0, 1, 0), - * * new Vector3(1, 0, 0), - * * new Vector3(0, 0, 1), - * * }; * - * - * * // Initialize the ArrayMesh. - * * var arrMesh = new ArrayMesh(); - * * var arrays = new Godot.Collections.Array(); - * * arrays.Resize((int)Mesh.ArrayType.Max); - * * arrays[(int)Mesh.ArrayType.Vertex] = vertices; * - * - * * // Create the Mesh. - * * arrMesh.AddSurfaceFromArrays(Mesh.PrimitiveType.Triangles, arrays); - * * var m = new MeshInstance3D(); - * * m.Mesh = arrMesh; + * ``` * - * [/csharp] - * - * [/codeblocks] - * - * The [godot.MeshInstance3D] is ready to be added to the [godot.SceneTree] to be shown. - * - * See also [godot.ImmediateMesh], [godot.MeshDataTool] and [godot.SurfaceTool] for procedural geometry generation. - * - * **Note:** Godot uses clockwise [winding order](https://learnopengl.com/Advanced-OpenGL/Face-culling) for front faces of triangle primitive modes. + * The [MeshInstance3D] is ready to be added to the [SceneTree] to be shown. + * See also [ImmediateMesh], [MeshDataTool] and [SurfaceTool] for procedural geometry generation. + * **Note:** Godot uses clockwise [url=https://learnopengl.com/Advanced-OpenGL/Face-culling]winding + * order[/url] for front faces of triangle primitive modes. */ @GodotBaseType public open class ArrayMesh : Mesh() { @@ -149,7 +105,8 @@ public open class ArrayMesh : Mesh() { } /** - * Overrides the [AABB] with one defined by user for use with frustum culling. Especially useful to avoid unexpected culling when using a shader to offset vertices. + * Overrides the [AABB] with one defined by user for use with frustum culling. Especially useful + * to avoid unexpected culling when using a shader to offset vertices. */ @CoreTypeLocalCopy public var customAabb: AABB @@ -165,7 +122,9 @@ public open class ArrayMesh : Mesh() { } /** - * An optional mesh which is used for rendering shadows and can be used for the depth prepass. Can be used to increase performance of shadow rendering by using a mesh that only contains vertex position data (without normals, UVs, colors, etc.). + * An optional mesh which is used for rendering shadows and can be used for the depth prepass. Can + * be used to increase performance of shadow rendering by using a mesh that only contains vertex + * position data (without normals, UVs, colors, etc.). */ public var shadowMesh: ArrayMesh? get() { @@ -184,7 +143,8 @@ public open class ArrayMesh : Mesh() { } /** - * Overrides the [AABB] with one defined by user for use with frustum culling. Especially useful to avoid unexpected culling when using a shader to offset vertices. + * Overrides the [AABB] with one defined by user for use with frustum culling. Especially useful + * to avoid unexpected culling when using a shader to offset vertices. * * This is a helper function to make dealing with local copies easier. * @@ -208,7 +168,8 @@ public open class ArrayMesh : Mesh() { /** - * Adds name for a blend shape that will be added with [addSurfaceFromArrays]. Must be called before surface is added. + * Adds name for a blend shape that will be added with [addSurfaceFromArrays]. Must be called + * before surface is added. */ public fun addBlendShape(name: StringName): Unit { TransferContext.writeArguments(STRING_NAME to name) @@ -216,7 +177,7 @@ public open class ArrayMesh : Mesh() { } /** - * Returns the number of blend shapes that the [godot.ArrayMesh] holds. + * Returns the number of blend shapes that the [ArrayMesh] holds. */ public fun getBlendShapeCount(): Int { TransferContext.writeArguments() @@ -242,7 +203,7 @@ public open class ArrayMesh : Mesh() { } /** - * Removes all blend shapes from this [godot.ArrayMesh]. + * Removes all blend shapes from this [ArrayMesh]. */ public fun clearBlendShapes(): Unit { TransferContext.writeArguments() @@ -250,18 +211,31 @@ public open class ArrayMesh : Mesh() { } /** - * Creates a new surface. [godot.Mesh.getSurfaceCount] will become the `surf_idx` for this new surface. - * - * Surfaces are created to be rendered using a [primitive], which may be any of the values defined in [enum Mesh.PrimitiveType]. - * - * The [arrays] argument is an array of arrays. Each of the [godot.Mesh.ARRAY_MAX] elements contains an array with some of the mesh data for this surface as described by the corresponding member of [enum Mesh.ArrayType] or `null` if it is not used by the surface. For example, `arrays[0]` is the array of vertices. That first vertex sub-array is always required; the others are optional. Adding an index array puts this surface into "index mode" where the vertex and other arrays become the sources of data and the index array defines the vertex order. All sub-arrays must have the same length as the vertex array (or be an exact multiple of the vertex array's length, when multiple elements of a sub-array correspond to a single vertex) or be empty, except for [godot.Mesh.ARRAY_INDEX] if it is used. - * - * The [blendShapes] argument is an array of vertex data for each blend shape. Each element is an array of the same structure as [arrays], but [godot.Mesh.ARRAY_VERTEX], [godot.Mesh.ARRAY_NORMAL], and [godot.Mesh.ARRAY_TANGENT] are set if and only if they are set in [arrays] and all other entries are `null`. - * - * The [lods] argument is a dictionary with [float] keys and [godot.PackedInt32Array] values. Each entry in the dictionary represents a LOD level of the surface, where the value is the [godot.Mesh.ARRAY_INDEX] array to use for the LOD level and the key is roughly proportional to the distance at which the LOD stats being used. I.e., increasing the key of a LOD also increases the distance that the objects has to be from the camera before the LOD is used. - * - * The [flags] argument is the bitwise or of, as required: One value of [enum Mesh.ArrayCustomFormat] left shifted by `ARRAY_FORMAT_CUSTOMn_SHIFT` for each custom channel in use, [godot.Mesh.ARRAY_FLAG_USE_DYNAMIC_UPDATE], [godot.Mesh.ARRAY_FLAG_USE_8_BONE_WEIGHTS], or [godot.Mesh.ARRAY_FLAG_USES_EMPTY_VERTEX_ARRAY]. - * + * Creates a new surface. [Mesh.getSurfaceCount] will become the `surf_idx` for this new surface. + * Surfaces are created to be rendered using a [param primitive], which may be any of the values + * defined in [enum Mesh.PrimitiveType]. + * The [param arrays] argument is an array of arrays. Each of the [constant Mesh.ARRAY_MAX] + * elements contains an array with some of the mesh data for this surface as described by the + * corresponding member of [enum Mesh.ArrayType] or `null` if it is not used by the surface. For + * example, `arrays[0]` is the array of vertices. That first vertex sub-array is always required; the + * others are optional. Adding an index array puts this surface into "index mode" where the vertex + * and other arrays become the sources of data and the index array defines the vertex order. All + * sub-arrays must have the same length as the vertex array (or be an exact multiple of the vertex + * array's length, when multiple elements of a sub-array correspond to a single vertex) or be empty, + * except for [constant Mesh.ARRAY_INDEX] if it is used. + * The [param blend_shapes] argument is an array of vertex data for each blend shape. Each element + * is an array of the same structure as [param arrays], but [constant Mesh.ARRAY_VERTEX], [constant + * Mesh.ARRAY_NORMAL], and [constant Mesh.ARRAY_TANGENT] are set if and only if they are set in + * [param arrays] and all other entries are `null`. + * The [param lods] argument is a dictionary with [float] keys and [PackedInt32Array] values. Each + * entry in the dictionary represents a LOD level of the surface, where the value is the [constant + * Mesh.ARRAY_INDEX] array to use for the LOD level and the key is roughly proportional to the + * distance at which the LOD stats being used. I.e., increasing the key of a LOD also increases the + * distance that the objects has to be from the camera before the LOD is used. + * The [param flags] argument is the bitwise or of, as required: One value of [enum + * Mesh.ArrayCustomFormat] left shifted by `ARRAY_FORMAT_CUSTOMn_SHIFT` for each custom channel in + * use, [constant Mesh.ARRAY_FLAG_USE_DYNAMIC_UPDATE], [constant Mesh.ARRAY_FLAG_USE_8_BONE_WEIGHTS], + * or [constant Mesh.ARRAY_FLAG_USES_EMPTY_VERTEX_ARRAY]. * **Note:** When using indices, it is recommended to only use points, lines, or triangles. */ @JvmOverloads @@ -277,16 +251,13 @@ public open class ArrayMesh : Mesh() { } /** - * Removes all surfaces from this [godot.ArrayMesh]. + * Removes all surfaces from this [ArrayMesh]. */ public fun clearSurfaces(): Unit { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.clearSurfacesPtr, NIL) } - /** - * - */ public fun surfaceUpdateVertexRegion( surfIdx: Int, offset: Int, @@ -296,9 +267,6 @@ public open class ArrayMesh : Mesh() { TransferContext.callMethod(rawPtr, MethodBindings.surfaceUpdateVertexRegionPtr, NIL) } - /** - * - */ public fun surfaceUpdateAttributeRegion( surfIdx: Int, offset: Int, @@ -308,9 +276,6 @@ public open class ArrayMesh : Mesh() { TransferContext.callMethod(rawPtr, MethodBindings.surfaceUpdateAttributeRegionPtr, NIL) } - /** - * - */ public fun surfaceUpdateSkinRegion( surfIdx: Int, offset: Int, @@ -321,7 +286,8 @@ public open class ArrayMesh : Mesh() { } /** - * Returns the length in vertices of the vertex array in the requested surface (see [addSurfaceFromArrays]). + * Returns the length in vertices of the vertex array in the requested surface (see + * [addSurfaceFromArrays]). */ public fun surfaceGetArrayLen(surfIdx: Int): Int { TransferContext.writeArguments(LONG to surfIdx.toLong()) @@ -330,7 +296,8 @@ public open class ArrayMesh : Mesh() { } /** - * Returns the length in indices of the index array in the requested surface (see [addSurfaceFromArrays]). + * Returns the length in indices of the index array in the requested surface (see + * [addSurfaceFromArrays]). */ public fun surfaceGetArrayIndexLen(surfIdx: Int): Int { TransferContext.writeArguments(LONG to surfIdx.toLong()) @@ -357,7 +324,8 @@ public open class ArrayMesh : Mesh() { } /** - * Returns the index of the first surface with this name held within this [godot.ArrayMesh]. If none are found, -1 is returned. + * Returns the index of the first surface with this name held within this [ArrayMesh]. If none are + * found, -1 is returned. */ public fun surfaceFindByName(name: String): Int { TransferContext.writeArguments(STRING to name) @@ -383,7 +351,7 @@ public open class ArrayMesh : Mesh() { } /** - * Regenerates tangents for each of the [godot.ArrayMesh]'s surfaces. + * Regenerates tangents for each of the [ArrayMesh]'s surfaces. */ public fun regenNormalMaps(): Unit { TransferContext.writeArguments() @@ -391,7 +359,7 @@ public open class ArrayMesh : Mesh() { } /** - * Performs a UV unwrap on the [godot.ArrayMesh] to prepare the mesh for lightmapping. + * Performs a UV unwrap on the [ArrayMesh] to prepare the mesh for lightmapping. */ public fun lightmapUnwrap(transform: Transform3D, texelSize: Float): GodotError { TransferContext.writeArguments(TRANSFORM3D to transform, DOUBLE to texelSize.toDouble()) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ArrayOccluder3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ArrayOccluder3D.kt index 07713a7a0..dd69762d0 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ArrayOccluder3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ArrayOccluder3D.kt @@ -22,21 +22,17 @@ import kotlin.Unit import kotlin.jvm.JvmName /** - * 3D polygon shape for use with occlusion culling in [godot.OccluderInstance3D]. - * - * Tutorials: - * [$DOCS_URL/tutorials/3d/occlusion_culling.html]($DOCS_URL/tutorials/3d/occlusion_culling.html) - * - * [godot.ArrayOccluder3D] stores an arbitrary 3D polygon shape that can be used by the engine's occlusion culling system. This is analogous to [godot.ArrayMesh], but for occluders. - * - * See [godot.OccluderInstance3D]'s documentation for instructions on setting up occlusion culling. + * [ArrayOccluder3D] stores an arbitrary 3D polygon shape that can be used by the engine's occlusion + * culling system. This is analogous to [ArrayMesh], but for occluders. + * See [OccluderInstance3D]'s documentation for instructions on setting up occlusion culling. */ @GodotBaseType public open class ArrayOccluder3D : Occluder3D() { /** * The occluder's vertex positions in local 3D coordinates. - * - * **Note:** The occluder is always updated after setting this value. If creating occluders procedurally, consider using [setArrays] instead to avoid updating the occluder twice when it's created. + * **Note:** The occluder is always updated after setting this value. If creating occluders + * procedurally, consider using [setArrays] instead to avoid updating the occluder twice when it's + * created. */ public var vertices: PackedVector3Array @JvmName("getVertices_prop") @@ -47,9 +43,11 @@ public open class ArrayOccluder3D : Occluder3D() { } /** - * The occluder's index position. Indices determine which points from the [vertices] array should be drawn, and in which order. - * - * **Note:** The occluder is always updated after setting this value. If creating occluders procedurally, consider using [setArrays] instead to avoid updating the occluder twice when it's created. + * The occluder's index position. Indices determine which points from the [vertices] array should + * be drawn, and in which order. + * **Note:** The occluder is always updated after setting this value. If creating occluders + * procedurally, consider using [setArrays] instead to avoid updating the occluder twice when it's + * created. */ public var indices: PackedInt32Array @JvmName("getIndices_prop") @@ -65,7 +63,8 @@ public open class ArrayOccluder3D : Occluder3D() { } /** - * Sets [indices] and [vertices], while updating the final occluder only once after both values are set. + * Sets [indices] and [vertices], while updating the final occluder only once after both values + * are set. */ public fun setArrays(vertices: PackedVector3Array, indices: PackedInt32Array): Unit { TransferContext.writeArguments(PACKED_VECTOR3_ARRAY to vertices, PACKED_INT_32_ARRAY to indices) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AspectRatioContainer.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AspectRatioContainer.kt index f5fdbc3ab..11c16d260 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AspectRatioContainer.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AspectRatioContainer.kt @@ -21,17 +21,15 @@ import kotlin.Long import kotlin.Suppress /** - * A container that preserves the proportions of its child controls. - * - * Tutorials: - * [$DOCS_URL/tutorials/ui/gui_containers.html]($DOCS_URL/tutorials/ui/gui_containers.html) - * - * A container type that arranges its child controls in a way that preserves their proportions automatically when the container is resized. Useful when a container has a dynamic size and the child nodes must adjust their sizes accordingly without losing their aspect ratios. + * A container type that arranges its child controls in a way that preserves their proportions + * automatically when the container is resized. Useful when a container has a dynamic size and the + * child nodes must adjust their sizes accordingly without losing their aspect ratios. */ @GodotBaseType public open class AspectRatioContainer : Container() { /** - * The aspect ratio to enforce on child controls. This is the width divided by the height. The ratio depends on the [stretchMode]. + * The aspect ratio to enforce on child controls. This is the width divided by the height. The + * ratio depends on the [stretchMode]. */ public var ratio: Float get() { @@ -103,13 +101,16 @@ public open class AspectRatioContainer : Container() { */ STRETCH_HEIGHT_CONTROLS_WIDTH(1), /** - * The bounding rectangle of child controls is automatically adjusted to fit inside the container while keeping the aspect ratio. + * The bounding rectangle of child controls is automatically adjusted to fit inside the + * container while keeping the aspect ratio. */ STRETCH_FIT(2), /** - * The width and height of child controls is automatically adjusted to make their bounding rectangle cover the entire area of the container while keeping the aspect ratio. - * - * When the bounding rectangle of child controls exceed the container's size and [godot.Control.clipContents] is enabled, this allows to show only the container's area restricted by its own bounding rectangle. + * The width and height of child controls is automatically adjusted to make their bounding + * rectangle cover the entire area of the container while keeping the aspect ratio. + * When the bounding rectangle of child controls exceed the container's size and + * [Control.clipContents] is enabled, this allows to show only the container's area restricted by + * its own bounding rectangle. */ STRETCH_COVER(3), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AtlasTexture.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AtlasTexture.kt index c93be98b5..8a640cd89 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AtlasTexture.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AtlasTexture.kt @@ -23,18 +23,18 @@ import kotlin.Suppress import kotlin.Unit /** - * A texture that crops out part of another Texture2D. - * - * [godot.Texture2D] resource that draws only part of its [atlas] texture, as defined by the [region]. An additional [margin] can also be set, which is useful for small adjustments. - * - * Multiple [godot.AtlasTexture] resources can be cropped from the same [atlas]. Packing many smaller textures into a singular large texture helps to optimize video memory costs and render calls. - * - * **Note:** [godot.AtlasTexture] cannot be used in an [godot.AnimatedTexture], and may not tile properly in nodes such as [godot.TextureRect], when inside other [godot.AtlasTexture] resources. + * [Texture2D] resource that draws only part of its [atlas] texture, as defined by the [region]. An + * additional [margin] can also be set, which is useful for small adjustments. + * Multiple [AtlasTexture] resources can be cropped from the same [atlas]. Packing many smaller + * textures into a singular large texture helps to optimize video memory costs and render calls. + * **Note:** [AtlasTexture] cannot be used in an [AnimatedTexture], and may not tile properly in + * nodes such as [TextureRect], when inside other [AtlasTexture] resources. */ @GodotBaseType public open class AtlasTexture : Texture2D() { /** - * The texture that contains the atlas. Can be any type inheriting from [godot.Texture2D], including another [godot.AtlasTexture]. + * The texture that contains the atlas. Can be any type inheriting from [Texture2D], including + * another [AtlasTexture]. */ public var atlas: Texture2D? get() { @@ -63,7 +63,9 @@ public open class AtlasTexture : Texture2D() { } /** - * The margin around the [region]. Useful for small adjustments. If the [godot.Rect2.size] of this property ("w" and "h" in the editor) is set, the drawn texture is resized to fit within the margin. + * The margin around the [region]. Useful for small adjustments. If the [Rect2.size] of this + * property ("w" and "h" in the editor) is set, the drawn texture is resized to fit within the + * margin. */ @CoreTypeLocalCopy public var margin: Rect2 @@ -78,7 +80,8 @@ public open class AtlasTexture : Texture2D() { } /** - * If `true`, the area outside of the [region] is clipped to avoid bleeding of the surrounding texture pixels. + * If `true`, the area outside of the [region] is clipped to avoid bleeding of the surrounding + * texture pixels. */ public var filterClip: Boolean get() { @@ -121,7 +124,9 @@ public open class AtlasTexture : Texture2D() { /** - * The margin around the [region]. Useful for small adjustments. If the [godot.Rect2.size] of this property ("w" and "h" in the editor) is set, the drawn texture is resized to fit within the margin. + * The margin around the [region]. Useful for small adjustments. If the [Rect2.size] of this + * property ("w" and "h" in the editor) is set, the drawn texture is resized to fit within the + * margin. * * This is a helper function to make dealing with local copies easier. * diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioBusLayout.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioBusLayout.kt index 68aacee24..0afc93b8d 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioBusLayout.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioBusLayout.kt @@ -12,9 +12,8 @@ import kotlin.Int import kotlin.Suppress /** - * Stores information about the audio buses. - * - * Stores position, muting, solo, bypass, effects, effect position, volume, and the connections between buses. See [godot.AudioServer] for usage. + * Stores position, muting, solo, bypass, effects, effect position, volume, and the connections + * between buses. See [AudioServer] for usage. */ @GodotBaseType public open class AudioBusLayout : Resource() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffect.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffect.kt index bf864b0bb..f147895b5 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffect.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffect.kt @@ -15,11 +15,6 @@ import kotlin.NotImplementedError import kotlin.Suppress /** - * Audio effect for audio. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/527](https://godotengine.org/asset-library/asset/527) - * * Base resource for audio bus. Applies an audio effect on the bus that the resource is applied on. */ @GodotBaseType @@ -29,9 +24,6 @@ public open class AudioEffect : Resource() { return true } - /** - * - */ public open fun _instantiate(): AudioEffectInstance? { throw NotImplementedError("_instantiate is not implemented for AudioEffect") } diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectAmplify.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectAmplify.kt index 47f89b7e5..514e31c7e 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectAmplify.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectAmplify.kt @@ -19,17 +19,13 @@ import kotlin.Int import kotlin.Suppress /** - * Adds an amplifying audio effect to an audio bus. - * - * Tutorials: - * [$DOCS_URL/tutorials/audio/audio_buses.html]($DOCS_URL/tutorials/audio/audio_buses.html) - * * Increases or decreases the volume being routed through the audio bus. */ @GodotBaseType public open class AudioEffectAmplify : AudioEffect() { /** - * Amount of amplification in decibels. Positive values make the sound louder, negative values make it quieter. Value can range from -80 to 24. + * Amount of amplification in decibels. Positive values make the sound louder, negative values + * make it quieter. Value can range from -80 to 24. */ public var volumeDb: Float get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectBandLimitFilter.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectBandLimitFilter.kt index 57471f3f6..e3c898a8f 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectBandLimitFilter.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectBandLimitFilter.kt @@ -12,12 +12,8 @@ import kotlin.Int import kotlin.Suppress /** - * Adds a band limit filter to the audio bus. - * - * Tutorials: - * [$DOCS_URL/tutorials/audio/audio_buses.html]($DOCS_URL/tutorials/audio/audio_buses.html) - * - * Limits the frequencies in a range around the [godot.AudioEffectFilter.cutoffHz] and allows frequencies outside of this range to pass. + * Limits the frequencies in a range around the [AudioEffectFilter.cutoffHz] and allows frequencies + * outside of this range to pass. */ @GodotBaseType public open class AudioEffectBandLimitFilter : AudioEffectFilter() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectBandPassFilter.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectBandPassFilter.kt index d1adb68d0..dacf33a02 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectBandPassFilter.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectBandPassFilter.kt @@ -12,12 +12,8 @@ import kotlin.Int import kotlin.Suppress /** - * Adds a band pass filter to the audio bus. - * - * Tutorials: - * [$DOCS_URL/tutorials/audio/audio_buses.html]($DOCS_URL/tutorials/audio/audio_buses.html) - * - * Attenuates the frequencies inside of a range around the [godot.AudioEffectFilter.cutoffHz] and cuts frequencies outside of this band. + * Attenuates the frequencies inside of a range around the [AudioEffectFilter.cutoffHz] and cuts + * frequencies outside of this band. */ @GodotBaseType public open class AudioEffectBandPassFilter : AudioEffectFilter() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectCapture.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectCapture.kt index acfdf81c8..787b7b32d 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectCapture.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectCapture.kt @@ -25,21 +25,21 @@ import kotlin.Suppress import kotlin.Unit /** - * Captures audio from an audio bus in real-time. - * - * Tutorials: - * [https://github.com/godotengine/godot-demo-projects/tree/master/audio/mic_record](https://github.com/godotengine/godot-demo-projects/tree/master/audio/mic_record) - * - * AudioEffectCapture is an AudioEffect which copies all audio frames from the attached audio effect bus into its internal ring buffer. - * - * Application code should consume these audio frames from this ring buffer using [getBuffer] and process it as needed, for example to capture data from an [godot.AudioStreamMicrophone], implement application-defined effects, or to transmit audio over the network. When capturing audio data from a microphone, the format of the samples will be stereo 32-bit floating point PCM. - * - * **Note:** [godot.ProjectSettings.audio/driver/enableInput] must be `true` for audio input to work. See also that setting's description for caveats related to permissions and operating system privacy settings. + * AudioEffectCapture is an AudioEffect which copies all audio frames from the attached audio effect + * bus into its internal ring buffer. + * Application code should consume these audio frames from this ring buffer using [getBuffer] and + * process it as needed, for example to capture data from an [AudioStreamMicrophone], implement + * application-defined effects, or to transmit audio over the network. When capturing audio data from a + * microphone, the format of the samples will be stereo 32-bit floating point PCM. + * **Note:** [ProjectSettings.audio/driver/enableInput] must be `true` for audio input to work. See + * also that setting's description for caveats related to permissions and operating system privacy + * settings. */ @GodotBaseType public open class AudioEffectCapture : AudioEffect() { /** - * Length of the internal ring buffer, in seconds. Setting the buffer length will have no effect if already initialized. + * Length of the internal ring buffer, in seconds. Setting the buffer length will have no effect + * if already initialized. */ public var bufferLength: Float get() { @@ -58,7 +58,8 @@ public open class AudioEffectCapture : AudioEffect() { } /** - * Returns `true` if at least [frames] audio frames are available to read in the internal ring buffer. + * Returns `true` if at least [param frames] audio frames are available to read in the internal + * ring buffer. */ public fun canGetBuffer(frames: Int): Boolean { TransferContext.writeArguments(LONG to frames.toLong()) @@ -67,9 +68,9 @@ public open class AudioEffectCapture : AudioEffect() { } /** - * Gets the next [frames] audio samples from the internal ring buffer. - * - * Returns a [godot.PackedVector2Array] containing exactly [frames] audio samples if available, or an empty [godot.PackedVector2Array] if insufficient data was available. + * Gets the next [param frames] audio samples from the internal ring buffer. + * Returns a [PackedVector2Array] containing exactly [param frames] audio samples if available, or + * an empty [PackedVector2Array] if insufficient data was available. */ public fun getBuffer(frames: Int): PackedVector2Array { TransferContext.writeArguments(LONG to frames.toLong()) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectChorus.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectChorus.kt index b86803458..8c519da7c 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectChorus.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectChorus.kt @@ -22,12 +22,8 @@ import kotlin.Suppress import kotlin.Unit /** - * Adds a chorus audio effect. - * - * Tutorials: - * [$DOCS_URL/tutorials/audio/audio_buses.html]($DOCS_URL/tutorials/audio/audio_buses.html) - * - * Adds a chorus audio effect. The effect applies a filter with voices to duplicate the audio source and manipulate it through the filter. + * Adds a chorus audio effect. The effect applies a filter with voices to duplicate the audio source + * and manipulate it through the filter. */ @GodotBaseType public open class AudioEffectChorus : AudioEffect() { @@ -78,102 +74,66 @@ public open class AudioEffectChorus : AudioEffect() { return true } - /** - * - */ public fun setVoiceDelayMs(voiceIdx: Int, delayMs: Float): Unit { TransferContext.writeArguments(LONG to voiceIdx.toLong(), DOUBLE to delayMs.toDouble()) TransferContext.callMethod(rawPtr, MethodBindings.setVoiceDelayMsPtr, NIL) } - /** - * - */ public fun getVoiceDelayMs(voiceIdx: Int): Float { TransferContext.writeArguments(LONG to voiceIdx.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.getVoiceDelayMsPtr, DOUBLE) return (TransferContext.readReturnValue(DOUBLE, false) as Double).toFloat() } - /** - * - */ public fun setVoiceRateHz(voiceIdx: Int, rateHz: Float): Unit { TransferContext.writeArguments(LONG to voiceIdx.toLong(), DOUBLE to rateHz.toDouble()) TransferContext.callMethod(rawPtr, MethodBindings.setVoiceRateHzPtr, NIL) } - /** - * - */ public fun getVoiceRateHz(voiceIdx: Int): Float { TransferContext.writeArguments(LONG to voiceIdx.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.getVoiceRateHzPtr, DOUBLE) return (TransferContext.readReturnValue(DOUBLE, false) as Double).toFloat() } - /** - * - */ public fun setVoiceDepthMs(voiceIdx: Int, depthMs: Float): Unit { TransferContext.writeArguments(LONG to voiceIdx.toLong(), DOUBLE to depthMs.toDouble()) TransferContext.callMethod(rawPtr, MethodBindings.setVoiceDepthMsPtr, NIL) } - /** - * - */ public fun getVoiceDepthMs(voiceIdx: Int): Float { TransferContext.writeArguments(LONG to voiceIdx.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.getVoiceDepthMsPtr, DOUBLE) return (TransferContext.readReturnValue(DOUBLE, false) as Double).toFloat() } - /** - * - */ public fun setVoiceLevelDb(voiceIdx: Int, levelDb: Float): Unit { TransferContext.writeArguments(LONG to voiceIdx.toLong(), DOUBLE to levelDb.toDouble()) TransferContext.callMethod(rawPtr, MethodBindings.setVoiceLevelDbPtr, NIL) } - /** - * - */ public fun getVoiceLevelDb(voiceIdx: Int): Float { TransferContext.writeArguments(LONG to voiceIdx.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.getVoiceLevelDbPtr, DOUBLE) return (TransferContext.readReturnValue(DOUBLE, false) as Double).toFloat() } - /** - * - */ public fun setVoiceCutoffHz(voiceIdx: Int, cutoffHz: Float): Unit { TransferContext.writeArguments(LONG to voiceIdx.toLong(), DOUBLE to cutoffHz.toDouble()) TransferContext.callMethod(rawPtr, MethodBindings.setVoiceCutoffHzPtr, NIL) } - /** - * - */ public fun getVoiceCutoffHz(voiceIdx: Int): Float { TransferContext.writeArguments(LONG to voiceIdx.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.getVoiceCutoffHzPtr, DOUBLE) return (TransferContext.readReturnValue(DOUBLE, false) as Double).toFloat() } - /** - * - */ public fun setVoicePan(voiceIdx: Int, pan: Float): Unit { TransferContext.writeArguments(LONG to voiceIdx.toLong(), DOUBLE to pan.toDouble()) TransferContext.callMethod(rawPtr, MethodBindings.setVoicePanPtr, NIL) } - /** - * - */ public fun getVoicePan(voiceIdx: Int): Float { TransferContext.writeArguments(LONG to voiceIdx.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.getVoicePanPtr, DOUBLE) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectCompressor.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectCompressor.kt index 07856850a..ef5dcbd65 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectCompressor.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectCompressor.kt @@ -21,23 +21,16 @@ import kotlin.Int import kotlin.Suppress /** - * Adds a compressor audio effect to an audio bus. - * - * Reduces sounds that exceed a certain threshold level, smooths out the dynamics and increases the overall volume. - * - * Tutorials: - * [$DOCS_URL/tutorials/audio/audio_buses.html]($DOCS_URL/tutorials/audio/audio_buses.html) - * - * Dynamic range compressor reduces the level of the sound when the amplitude goes over a certain threshold in Decibels. One of the main uses of a compressor is to increase the dynamic range by clipping as little as possible (when sound goes over 0dB). - * + * Dynamic range compressor reduces the level of the sound when the amplitude goes over a certain + * threshold in Decibels. One of the main uses of a compressor is to increase the dynamic range by + * clipping as little as possible (when sound goes over 0dB). * Compressor has many uses in the mix: - * - * - In the Master bus to compress the whole output (although an [godot.AudioEffectLimiter] is probably better). - * + * - In the Master bus to compress the whole output (although an [AudioEffectLimiter] is probably + * better). * - In voice channels to ensure they sound as balanced as possible. - * - * - Sidechained. This can reduce the sound level sidechained with another audio bus for threshold detection. This technique is common in video game mixing to the level of music and SFX while voices are being heard. - * + * - Sidechained. This can reduce the sound level sidechained with another audio bus for threshold + * detection. This technique is common in video game mixing to the level of music and SFX while voices + * are being heard. * - Accentuates transients by using a wider attack, making effects sound more punchy. */ @GodotBaseType @@ -57,7 +50,8 @@ public open class AudioEffectCompressor : AudioEffect() { } /** - * Amount of compression applied to the audio once it passes the threshold level. The higher the ratio, the more the loud parts of the audio will be compressed. Value can range from 1 to 48. + * Amount of compression applied to the audio once it passes the threshold level. The higher the + * ratio, the more the loud parts of the audio will be compressed. Value can range from 1 to 48. */ public var ratio: Float get() { @@ -85,7 +79,8 @@ public open class AudioEffectCompressor : AudioEffect() { } /** - * Compressor's reaction time when the signal exceeds the threshold, in microseconds. Value can range from 20 to 2000. + * Compressor's reaction time when the signal exceeds the threshold, in microseconds. Value can + * range from 20 to 2000. */ public var attackUs: Float get() { @@ -99,7 +94,8 @@ public open class AudioEffectCompressor : AudioEffect() { } /** - * Compressor's delay time to stop reducing the signal after the signal level falls below the threshold, in milliseconds. Value can range from 20 to 2000. + * Compressor's delay time to stop reducing the signal after the signal level falls below the + * threshold, in milliseconds. Value can range from 20 to 2000. */ public var releaseMs: Float get() { @@ -113,7 +109,8 @@ public open class AudioEffectCompressor : AudioEffect() { } /** - * Balance between original signal and effect signal. Value can range from 0 (totally dry) to 1 (totally wet). + * Balance between original signal and effect signal. Value can range from 0 (totally dry) to 1 + * (totally wet). */ public var mix: Float get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectDelay.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectDelay.kt index b671274cb..008a4da9e 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectDelay.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectDelay.kt @@ -20,19 +20,15 @@ import kotlin.Int import kotlin.Suppress /** - * Adds a delay audio effect to an audio bus. Plays input signal back after a period of time. - * - * Two tap delay and feedback options. - * - * Tutorials: - * [$DOCS_URL/tutorials/audio/audio_buses.html]($DOCS_URL/tutorials/audio/audio_buses.html) - * - * Plays input signal back after a period of time. The delayed signal may be played back multiple times to create the sound of a repeating, decaying echo. Delay effects range from a subtle echo effect to a pronounced blending of previous sounds with new sounds. + * Plays input signal back after a period of time. The delayed signal may be played back multiple + * times to create the sound of a repeating, decaying echo. Delay effects range from a subtle echo + * effect to a pronounced blending of previous sounds with new sounds. */ @GodotBaseType public open class AudioEffectDelay : AudioEffect() { /** - * Output percent of original sound. At 0, only delayed sounds are output. Value can range from 0 to 1. + * Output percent of original sound. At 0, only delayed sounds are output. Value can range from 0 + * to 1. */ public var dry: Float get() { @@ -200,7 +196,8 @@ public open class AudioEffectDelay : AudioEffect() { } /** - * Low-pass filter for feedback, in Hz. Frequencies below this value are filtered out of the source signal. + * Low-pass filter for feedback, in Hz. Frequencies below this value are filtered out of the + * source signal. */ public var feedbackLowpass: Float get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectDistortion.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectDistortion.kt index 52ec98e2e..42b32b73e 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectDistortion.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectDistortion.kt @@ -21,16 +21,10 @@ import kotlin.Long import kotlin.Suppress /** - * Adds a distortion audio effect to an Audio bus. - * - * Modifies the sound to make it distorted. - * - * Tutorials: - * [$DOCS_URL/tutorials/audio/audio_buses.html]($DOCS_URL/tutorials/audio/audio_buses.html) - * * Different types are available: clip, tan, lo-fi (bit crushing), overdrive, or waveshape. - * - * By distorting the waveform the frequency content changes, which will often make the sound "crunchy" or "abrasive". For games, it can simulate sound coming from some saturated device or speaker very efficiently. + * By distorting the waveform the frequency content changes, which will often make the sound + * "crunchy" or "abrasive". For games, it can simulate sound coming from some saturated device or + * speaker very efficiently. */ @GodotBaseType public open class AudioEffectDistortion : AudioEffect() { @@ -49,7 +43,8 @@ public open class AudioEffectDistortion : AudioEffect() { } /** - * Increases or decreases the volume before the effect, in decibels. Value can range from -60 to 60. + * Increases or decreases the volume before the effect, in decibels. Value can range from -60 to + * 60. */ public var preGain: Float get() { @@ -63,7 +58,8 @@ public open class AudioEffectDistortion : AudioEffect() { } /** - * High-pass filter, in Hz. Frequencies higher than this value will not be affected by the distortion. Value can range from 1 to 20000. + * High-pass filter, in Hz. Frequencies higher than this value will not be affected by the + * distortion. Value can range from 1 to 20000. */ public var keepHfHz: Float get() { @@ -91,7 +87,8 @@ public open class AudioEffectDistortion : AudioEffect() { } /** - * Increases or decreases the volume after the effect, in decibels. Value can range from -80 to 24. + * Increases or decreases the volume after the effect, in decibels. Value can range from -80 to + * 24. */ public var postGain: Float get() { @@ -116,20 +113,20 @@ public open class AudioEffectDistortion : AudioEffect() { * Digital distortion effect which cuts off peaks at the top and bottom of the waveform. */ MODE_CLIP(0), - /** - * - */ MODE_ATAN(1), /** - * Low-resolution digital distortion effect (bit depth reduction). You can use it to emulate the sound of early digital audio devices. + * Low-resolution digital distortion effect (bit depth reduction). You can use it to emulate the + * sound of early digital audio devices. */ MODE_LOFI(2), /** - * Emulates the warm distortion produced by a field effect transistor, which is commonly used in solid-state musical instrument amplifiers. The [drive] property has no effect in this mode. + * Emulates the warm distortion produced by a field effect transistor, which is commonly used in + * solid-state musical instrument amplifiers. The [drive] property has no effect in this mode. */ MODE_OVERDRIVE(3), /** - * Waveshaper distortions are used mainly by electronic musicians to achieve an extra-abrasive sound. + * Waveshaper distortions are used mainly by electronic musicians to achieve an extra-abrasive + * sound. */ MODE_WAVESHAPE(4), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectEQ.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectEQ.kt index 918baa386..0bcbbfb3d 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectEQ.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectEQ.kt @@ -22,14 +22,10 @@ import kotlin.Suppress import kotlin.Unit /** - * Base class for audio equalizers. Gives you control over frequencies. - * - * Use it to create a custom equalizer if [godot.AudioEffectEQ6], [godot.AudioEffectEQ10] or [godot.AudioEffectEQ21] don't fit your needs. - * - * Tutorials: - * [$DOCS_URL/tutorials/audio/audio_buses.html]($DOCS_URL/tutorials/audio/audio_buses.html) - * - * AudioEffectEQ gives you control over frequencies. Use it to compensate for existing deficiencies in audio. AudioEffectEQs are useful on the Master bus to completely master a mix and give it more character. They are also useful when a game is run on a mobile device, to adjust the mix to that kind of speakers (it can be added but disabled when headphones are plugged). + * AudioEffectEQ gives you control over frequencies. Use it to compensate for existing deficiencies + * in audio. AudioEffectEQs are useful on the Master bus to completely master a mix and give it more + * character. They are also useful when a game is run on a mobile device, to adjust the mix to that + * kind of speakers (it can be added but disabled when headphones are plugged). */ @GodotBaseType public open class AudioEffectEQ : AudioEffect() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectEQ10.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectEQ10.kt index b701887de..d3ffb34c7 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectEQ10.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectEQ10.kt @@ -12,36 +12,18 @@ import kotlin.Int import kotlin.Suppress /** - * Adds a 10-band equalizer audio effect to an Audio bus. Gives you control over frequencies from 31 Hz to 16000 Hz. - * - * Each frequency can be modulated between -60/+24 dB. - * - * Tutorials: - * [$DOCS_URL/tutorials/audio/audio_buses.html]($DOCS_URL/tutorials/audio/audio_buses.html) - * * Frequency bands: - * * Band 1: 31 Hz - * * Band 2: 62 Hz - * * Band 3: 125 Hz - * * Band 4: 250 Hz - * * Band 5: 500 Hz - * * Band 6: 1000 Hz - * * Band 7: 2000 Hz - * * Band 8: 4000 Hz - * * Band 9: 8000 Hz - * * Band 10: 16000 Hz - * - * See also [godot.AudioEffectEQ], [godot.AudioEffectEQ6], [godot.AudioEffectEQ21]. + * See also [AudioEffectEQ], [AudioEffectEQ6], [AudioEffectEQ21]. */ @GodotBaseType public open class AudioEffectEQ10 : AudioEffectEQ() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectEQ21.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectEQ21.kt index d5959e292..9d7b60111 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectEQ21.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectEQ21.kt @@ -12,58 +12,29 @@ import kotlin.Int import kotlin.Suppress /** - * Adds a 21-band equalizer audio effect to an Audio bus. Gives you control over frequencies from 22 Hz to 22000 Hz. - * - * Each frequency can be modulated between -60/+24 dB. - * - * Tutorials: - * [$DOCS_URL/tutorials/audio/audio_buses.html]($DOCS_URL/tutorials/audio/audio_buses.html) - * * Frequency bands: - * * Band 1: 22 Hz - * * Band 2: 32 Hz - * * Band 3: 44 Hz - * * Band 4: 63 Hz - * * Band 5: 90 Hz - * * Band 6: 125 Hz - * * Band 7: 175 Hz - * * Band 8: 250 Hz - * * Band 9: 350 Hz - * * Band 10: 500 Hz - * * Band 11: 700 Hz - * * Band 12: 1000 Hz - * * Band 13: 1400 Hz - * * Band 14: 2000 Hz - * * Band 15: 2800 Hz - * * Band 16: 4000 Hz - * * Band 17: 5600 Hz - * * Band 18: 8000 Hz - * * Band 19: 11000 Hz - * * Band 20: 16000 Hz - * * Band 21: 22000 Hz - * - * See also [godot.AudioEffectEQ], [godot.AudioEffectEQ6], [godot.AudioEffectEQ10]. + * See also [AudioEffectEQ], [AudioEffectEQ6], [AudioEffectEQ10]. */ @GodotBaseType public open class AudioEffectEQ21 : AudioEffectEQ() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectEQ6.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectEQ6.kt index 51e1592ec..8bfedb6b9 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectEQ6.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectEQ6.kt @@ -12,28 +12,14 @@ import kotlin.Int import kotlin.Suppress /** - * Adds a 6-band equalizer audio effect to an audio bus. Gives you control over frequencies from 32 Hz to 10000 Hz. - * - * Each frequency can be modulated between -60/+24 dB. - * - * Tutorials: - * [$DOCS_URL/tutorials/audio/audio_buses.html]($DOCS_URL/tutorials/audio/audio_buses.html) - * * Frequency bands: - * * Band 1: 32 Hz - * * Band 2: 100 Hz - * * Band 3: 320 Hz - * * Band 4: 1000 Hz - * * Band 5: 3200 Hz - * * Band 6: 10000 Hz - * - * See also [godot.AudioEffectEQ], [godot.AudioEffectEQ10], [godot.AudioEffectEQ21]. + * See also [AudioEffectEQ], [AudioEffectEQ10], [AudioEffectEQ21]. */ @GodotBaseType public open class AudioEffectEQ6 : AudioEffectEQ() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectFilter.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectFilter.kt index d44fa1f84..ee983e40d 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectFilter.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectFilter.kt @@ -21,11 +21,6 @@ import kotlin.Long import kotlin.Suppress /** - * Adds a filter to the audio bus. - * - * Tutorials: - * [$DOCS_URL/tutorials/audio/audio_buses.html]($DOCS_URL/tutorials/audio/audio_buses.html) - * * Allows frequencies other than the [cutoffHz] to pass. */ @GodotBaseType @@ -72,9 +67,6 @@ public open class AudioEffectFilter : AudioEffect() { TransferContext.callMethod(rawPtr, MethodBindings.setGainPtr, NIL) } - /** - * - */ public var db: FilterDB get() { TransferContext.writeArguments() @@ -94,21 +86,9 @@ public open class AudioEffectFilter : AudioEffect() { public enum class FilterDB( id: Long, ) { - /** - * - */ FILTER_6DB(0), - /** - * - */ FILTER_12DB(1), - /** - * - */ FILTER_18DB(2), - /** - * - */ FILTER_24DB(3), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectHighPassFilter.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectHighPassFilter.kt index ebe94bc53..de7cd048b 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectHighPassFilter.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectHighPassFilter.kt @@ -12,12 +12,8 @@ import kotlin.Int import kotlin.Suppress /** - * Adds a high-pass filter to the audio bus. - * - * Tutorials: - * [$DOCS_URL/tutorials/audio/audio_buses.html]($DOCS_URL/tutorials/audio/audio_buses.html) - * - * Cuts frequencies lower than the [godot.AudioEffectFilter.cutoffHz] and allows higher frequencies to pass. + * Cuts frequencies lower than the [AudioEffectFilter.cutoffHz] and allows higher frequencies to + * pass. */ @GodotBaseType public open class AudioEffectHighPassFilter : AudioEffectFilter() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectHighShelfFilter.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectHighShelfFilter.kt index cfa9840b3..9e10a3e64 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectHighShelfFilter.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectHighShelfFilter.kt @@ -12,12 +12,7 @@ import kotlin.Int import kotlin.Suppress /** - * Adds a high-shelf filter to the audio bus. - * - * Tutorials: - * [$DOCS_URL/tutorials/audio/audio_buses.html]($DOCS_URL/tutorials/audio/audio_buses.html) - * - * Reduces all frequencies above the [godot.AudioEffectFilter.cutoffHz]. + * Reduces all frequencies above the [AudioEffectFilter.cutoffHz]. */ @GodotBaseType public open class AudioEffectHighShelfFilter : AudioEffectFilter() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectInstance.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectInstance.kt index 05f8cc975..7b08f675e 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectInstance.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectInstance.kt @@ -14,9 +14,6 @@ import kotlin.Int import kotlin.NotImplementedError import kotlin.Suppress -/** - * - */ @GodotBaseType public open class AudioEffectInstance : RefCounted() { public override fun new(scriptIndex: Int): Boolean { @@ -24,9 +21,6 @@ public open class AudioEffectInstance : RefCounted() { return true } - /** - * - */ public open fun _processSilence(): Boolean { throw NotImplementedError("_process_silence is not implemented for AudioEffectInstance") } diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectLimiter.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectLimiter.kt index c501b0237..b250ddbf9 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectLimiter.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectLimiter.kt @@ -19,14 +19,11 @@ import kotlin.Int import kotlin.Suppress /** - * Adds a soft-clip limiter audio effect to an Audio bus. - * - * Tutorials: - * [$DOCS_URL/tutorials/audio/audio_buses.html]($DOCS_URL/tutorials/audio/audio_buses.html) - * - * A limiter is similar to a compressor, but it's less flexible and designed to disallow sound going over a given dB threshold. Adding one in the Master bus is always recommended to reduce the effects of clipping. - * - * Soft clipping starts to reduce the peaks a little below the threshold level and progressively increases its effect as the input level increases such that the threshold is never exceeded. + * A limiter is similar to a compressor, but it's less flexible and designed to disallow sound going + * over a given dB threshold. Adding one in the Master bus is always recommended to reduce the effects + * of clipping. + * Soft clipping starts to reduce the peaks a little below the threshold level and progressively + * increases its effect as the input level increases such that the threshold is never exceeded. */ @GodotBaseType public open class AudioEffectLimiter : AudioEffect() { @@ -45,7 +42,8 @@ public open class AudioEffectLimiter : AudioEffect() { } /** - * Threshold from which the limiter begins to be active, in decibels. Value can range from -30 to 0. + * Threshold from which the limiter begins to be active, in decibels. Value can range from -30 to + * 0. */ public var thresholdDb: Float get() { @@ -72,9 +70,6 @@ public open class AudioEffectLimiter : AudioEffect() { TransferContext.callMethod(rawPtr, MethodBindings.setSoftClipDbPtr, NIL) } - /** - * - */ public var softClipRatio: Float get() { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectLowPassFilter.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectLowPassFilter.kt index 7c13549c2..e87a66c95 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectLowPassFilter.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectLowPassFilter.kt @@ -12,12 +12,8 @@ import kotlin.Int import kotlin.Suppress /** - * Adds a low-pass filter to the audio bus. - * - * Tutorials: - * [$DOCS_URL/tutorials/audio/audio_buses.html]($DOCS_URL/tutorials/audio/audio_buses.html) - * - * Cuts frequencies higher than the [godot.AudioEffectFilter.cutoffHz] and allows lower frequencies to pass. + * Cuts frequencies higher than the [AudioEffectFilter.cutoffHz] and allows lower frequencies to + * pass. */ @GodotBaseType public open class AudioEffectLowPassFilter : AudioEffectFilter() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectLowShelfFilter.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectLowShelfFilter.kt index f5193ae03..0a2fb53b8 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectLowShelfFilter.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectLowShelfFilter.kt @@ -12,12 +12,7 @@ import kotlin.Int import kotlin.Suppress /** - * Adds a low-shelf filter to the audio bus. - * - * Tutorials: - * [$DOCS_URL/tutorials/audio/audio_buses.html]($DOCS_URL/tutorials/audio/audio_buses.html) - * - * Reduces all frequencies below the [godot.AudioEffectFilter.cutoffHz]. + * Reduces all frequencies below the [AudioEffectFilter.cutoffHz]. */ @GodotBaseType public open class AudioEffectLowShelfFilter : AudioEffectFilter() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectNotchFilter.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectNotchFilter.kt index 8b2adcb2c..48df3a38d 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectNotchFilter.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectNotchFilter.kt @@ -12,12 +12,8 @@ import kotlin.Int import kotlin.Suppress /** - * Adds a notch filter to the Audio bus. - * - * Tutorials: - * [$DOCS_URL/tutorials/audio/audio_buses.html]($DOCS_URL/tutorials/audio/audio_buses.html) - * - * Attenuates frequencies in a narrow band around the [godot.AudioEffectFilter.cutoffHz] and cuts frequencies outside of this range. + * Attenuates frequencies in a narrow band around the [AudioEffectFilter.cutoffHz] and cuts + * frequencies outside of this range. */ @GodotBaseType public open class AudioEffectNotchFilter : AudioEffectFilter() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectPanner.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectPanner.kt index 16f62559d..c5c869574 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectPanner.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectPanner.kt @@ -19,11 +19,6 @@ import kotlin.Int import kotlin.Suppress /** - * Adds a panner audio effect to an audio bus. Pans sound left or right. - * - * Tutorials: - * [$DOCS_URL/tutorials/audio/audio_buses.html]($DOCS_URL/tutorials/audio/audio_buses.html) - * * Determines how much of an audio signal is sent to the left and right buses. */ @GodotBaseType diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectPhaser.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectPhaser.kt index ab837af80..31b494a6d 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectPhaser.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectPhaser.kt @@ -19,19 +19,14 @@ import kotlin.Int import kotlin.Suppress /** - * Adds a phaser audio effect to an audio bus. - * - * Combines the original signal with a copy that is slightly out of phase with the original. - * - * Tutorials: - * [$DOCS_URL/tutorials/audio/audio_buses.html]($DOCS_URL/tutorials/audio/audio_buses.html) - * - * Combines phase-shifted signals with the original signal. The movement of the phase-shifted signals is controlled using a low-frequency oscillator. + * Combines phase-shifted signals with the original signal. The movement of the phase-shifted + * signals is controlled using a low-frequency oscillator. */ @GodotBaseType public open class AudioEffectPhaser : AudioEffect() { /** - * Determines the minimum frequency affected by the LFO modulations, in Hz. Value can range from 10 to 10000. + * Determines the minimum frequency affected by the LFO modulations, in Hz. Value can range from + * 10 to 10000. */ public var rangeMinHz: Float get() { @@ -45,7 +40,8 @@ public open class AudioEffectPhaser : AudioEffect() { } /** - * Determines the maximum frequency affected by the LFO modulations, in Hz. Value can range from 10 to 10000. + * Determines the maximum frequency affected by the LFO modulations, in Hz. Value can range from + * 10 to 10000. */ public var rangeMaxHz: Float get() { @@ -87,7 +83,8 @@ public open class AudioEffectPhaser : AudioEffect() { } /** - * Governs how high the filter frequencies sweep. Low value will primarily affect bass frequencies. High value can sweep high into the treble. Value can range from 0.1 to 4. + * Governs how high the filter frequencies sweep. Low value will primarily affect bass + * frequencies. High value can sweep high into the treble. Value can range from 0.1 to 4. */ public var depth: Float get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectRecord.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectRecord.kt index 11d510d90..64588cdc9 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectRecord.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectRecord.kt @@ -21,21 +21,18 @@ import kotlin.Suppress import kotlin.Unit /** - * Audio effect used for recording the sound from an audio bus. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/527](https://godotengine.org/asset-library/asset/527) - * - * Allows the user to record the sound from an audio bus. This can include all audio output by Godot when used on the "Master" audio bus. - * - * Can be used (with an [godot.AudioStreamMicrophone]) to record from a microphone. - * - * It sets and gets the format in which the audio file will be recorded (8-bit, 16-bit, or compressed). It checks whether or not the recording is active, and if it is, records the sound. It then returns the recorded sample. + * Allows the user to record the sound from an audio bus. This can include all audio output by Godot + * when used on the "Master" audio bus. + * Can be used (with an [AudioStreamMicrophone]) to record from a microphone. + * It sets and gets the format in which the audio file will be recorded (8-bit, 16-bit, or + * compressed). It checks whether or not the recording is active, and if it is, records the sound. It + * then returns the recorded sample. */ @GodotBaseType public open class AudioEffectRecord : AudioEffect() { /** - * Specifies the format in which the sample will be recorded. See [enum AudioStreamWAV.Format] for available formats. + * Specifies the format in which the sample will be recorded. See [enum AudioStreamWAV.Format] for + * available formats. */ public var format: AudioStreamWAV.Format get() { @@ -54,7 +51,8 @@ public open class AudioEffectRecord : AudioEffect() { } /** - * If `true`, the sound will be recorded. Note that restarting the recording will remove the previously recorded sample. + * If `true`, the sound will be recorded. Note that restarting the recording will remove the + * previously recorded sample. */ public fun setRecordingActive(record: Boolean): Unit { TransferContext.writeArguments(BOOL to record) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectReverb.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectReverb.kt index 4ea8cef07..09bc5876f 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectReverb.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectReverb.kt @@ -19,17 +19,14 @@ import kotlin.Int import kotlin.Suppress /** - * Adds a reverberation audio effect to an Audio bus. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/678](https://godotengine.org/asset-library/asset/678) - * - * Simulates the sound of acoustic environments such as rooms, concert halls, caverns, or an open spaces. + * Simulates the sound of acoustic environments such as rooms, concert halls, caverns, or an open + * spaces. */ @GodotBaseType public open class AudioEffectReverb : AudioEffect() { /** - * Time between the original signal and the early reflections of the reverb signal, in milliseconds. + * Time between the original signal and the early reflections of the reverb signal, in + * milliseconds. */ public var predelayMsec: Float get() { @@ -85,7 +82,8 @@ public open class AudioEffectReverb : AudioEffect() { } /** - * Widens or narrows the stereo image of the reverb tail. 1 means fully widens. Value can range from 0 to 1. + * Widens or narrows the stereo image of the reverb tail. 1 means fully widens. Value can range + * from 0 to 1. */ public var spread: Float get() { @@ -99,7 +97,8 @@ public open class AudioEffectReverb : AudioEffect() { } /** - * High-pass filter passes signals with a frequency higher than a certain cutoff frequency and attenuates signals with frequencies lower than the cutoff frequency. Value can range from 0 to 1. + * High-pass filter passes signals with a frequency higher than a certain cutoff frequency and + * attenuates signals with frequencies lower than the cutoff frequency. Value can range from 0 to 1. */ public var hipass: Float get() { @@ -113,7 +112,8 @@ public open class AudioEffectReverb : AudioEffect() { } /** - * Output percent of original sound. At 0, only modified sound is outputted. Value can range from 0 to 1. + * Output percent of original sound. At 0, only modified sound is outputted. Value can range from + * 0 to 1. */ public var dry: Float get() { @@ -127,7 +127,8 @@ public open class AudioEffectReverb : AudioEffect() { } /** - * Output percent of modified sound. At 0, only original sound is outputted. Value can range from 0 to 1. + * Output percent of modified sound. At 0, only original sound is outputted. Value can range from + * 0 to 1. */ public var wet: Float get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectSpectrumAnalyzer.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectSpectrumAnalyzer.kt index 808df2285..e8cd2dab4 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectSpectrumAnalyzer.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectSpectrumAnalyzer.kt @@ -21,19 +21,15 @@ import kotlin.Long import kotlin.Suppress /** - * Audio effect that can be used for real-time audio visualizations. - * - * Tutorials: - * [https://godotengine.org/article/godot-32-will-get-new-audio-features](https://godotengine.org/article/godot-32-will-get-new-audio-features) - * - * This audio effect does not affect sound output, but can be used for real-time audio visualizations. - * - * See also [godot.AudioStreamGenerator] for procedurally generating sounds. + * This audio effect does not affect sound output, but can be used for real-time audio + * visualizations. + * See also [AudioStreamGenerator] for procedurally generating sounds. */ @GodotBaseType public open class AudioEffectSpectrumAnalyzer : AudioEffect() { /** - * The length of the buffer to keep (in seconds). Higher values keep data around for longer, but require more memory. + * The length of the buffer to keep (in seconds). Higher values keep data around for longer, but + * require more memory. */ public var bufferLength: Float get() { @@ -46,9 +42,6 @@ public open class AudioEffectSpectrumAnalyzer : AudioEffect() { TransferContext.callMethod(rawPtr, MethodBindings.setBufferLengthPtr, NIL) } - /** - * - */ public var tapBackPos: Float get() { TransferContext.writeArguments() @@ -61,7 +54,10 @@ public open class AudioEffectSpectrumAnalyzer : AudioEffect() { } /** - * The size of the [godot.Fast Fourier transform](https://en.wikipedia.org/wiki/Fast_Fourier_transform) buffer. Higher values smooth out the spectrum analysis over time, but have greater latency. The effects of this higher latency are especially noticeable with sudden amplitude changes. + * The size of the [url=https://en.wikipedia.org/wiki/Fast_Fourier_transform]Fast Fourier + * transform[/url] buffer. Higher values smooth out the spectrum analysis over time, but have greater + * latency. The effects of this higher latency are especially noticeable with sudden amplitude + * changes. */ public var fftSize: FFTSize get() { @@ -83,23 +79,28 @@ public open class AudioEffectSpectrumAnalyzer : AudioEffect() { id: Long, ) { /** - * Use a buffer of 256 samples for the Fast Fourier transform. Lowest latency, but least stable over time. + * Use a buffer of 256 samples for the Fast Fourier transform. Lowest latency, but least stable + * over time. */ FFT_SIZE_256(0), /** - * Use a buffer of 512 samples for the Fast Fourier transform. Low latency, but less stable over time. + * Use a buffer of 512 samples for the Fast Fourier transform. Low latency, but less stable over + * time. */ FFT_SIZE_512(1), /** - * Use a buffer of 1024 samples for the Fast Fourier transform. This is a compromise between latency and stability over time. + * Use a buffer of 1024 samples for the Fast Fourier transform. This is a compromise between + * latency and stability over time. */ FFT_SIZE_1024(2), /** - * Use a buffer of 2048 samples for the Fast Fourier transform. High latency, but stable over time. + * Use a buffer of 2048 samples for the Fast Fourier transform. High latency, but stable over + * time. */ FFT_SIZE_2048(3), /** - * Use a buffer of 4096 samples for the Fast Fourier transform. Highest latency, but most stable over time. + * Use a buffer of 4096 samples for the Fast Fourier transform. Highest latency, but most stable + * over time. */ FFT_SIZE_4096(4), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectSpectrumAnalyzerInstance.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectSpectrumAnalyzerInstance.kt index 5351fab69..cce628872 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectSpectrumAnalyzerInstance.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectSpectrumAnalyzerInstance.kt @@ -21,9 +21,6 @@ import kotlin.Long import kotlin.Suppress import kotlin.jvm.JvmOverloads -/** - * - */ @GodotBaseType public open class AudioEffectSpectrumAnalyzerInstance internal constructor() : AudioEffectInstance() { @@ -32,9 +29,6 @@ public open class AudioEffectSpectrumAnalyzerInstance internal constructor() : A return true } - /** - * - */ @JvmOverloads public fun getMagnitudeForFrequencyRange( fromHz: Float, diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectStereoEnhance.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectStereoEnhance.kt index a532c06a7..583268f61 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectStereoEnhance.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioEffectStereoEnhance.kt @@ -19,17 +19,14 @@ import kotlin.Int import kotlin.Suppress /** - * An audio effect that can be used to adjust the intensity of stereo panning. - * - * Tutorials: - * [$DOCS_URL/tutorials/audio/audio_buses.html]($DOCS_URL/tutorials/audio/audio_buses.html) - * * An audio effect that can be used to adjust the intensity of stereo panning. */ @GodotBaseType public open class AudioEffectStereoEnhance : AudioEffect() { /** - * Values greater than 1.0 increase intensity of any panning on audio passing through this effect, whereas values less than 1.0 will decrease the panning intensity. A value of 0.0 will downmix audio to mono. + * Values greater than 1.0 increase intensity of any panning on audio passing through this effect, + * whereas values less than 1.0 will decrease the panning intensity. A value of 0.0 will downmix + * audio to mono. */ public var panPullout: Float get() { @@ -42,9 +39,6 @@ public open class AudioEffectStereoEnhance : AudioEffect() { TransferContext.callMethod(rawPtr, MethodBindings.setPanPulloutPtr, NIL) } - /** - * - */ public var timePulloutMs: Float get() { TransferContext.writeArguments() @@ -56,9 +50,6 @@ public open class AudioEffectStereoEnhance : AudioEffect() { TransferContext.callMethod(rawPtr, MethodBindings.setTimePulloutPtr, NIL) } - /** - * - */ public var surround: Float get() { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioListener2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioListener2D.kt index 41407552f..073cfbb3e 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioListener2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioListener2D.kt @@ -18,11 +18,11 @@ import kotlin.Suppress import kotlin.Unit /** - * Overrides the location sounds are heard from. - * - * Once added to the scene tree and enabled using [makeCurrent], this node will override the location sounds are heard from. Only one [godot.AudioListener2D] can be current. Using [makeCurrent] will disable the previous [godot.AudioListener2D]. - * - * If there is no active [godot.AudioListener2D] in the current [godot.Viewport], center of the screen will be used as a hearing point for the audio. [godot.AudioListener2D] needs to be inside [godot.SceneTree] to function. + * Once added to the scene tree and enabled using [makeCurrent], this node will override the + * location sounds are heard from. Only one [AudioListener2D] can be current. Using [makeCurrent] will + * disable the previous [AudioListener2D]. + * If there is no active [AudioListener2D] in the current [Viewport], center of the screen will be + * used as a hearing point for the audio. [AudioListener2D] needs to be inside [SceneTree] to function. */ @GodotBaseType public open class AudioListener2D : Node2D() { @@ -32,9 +32,9 @@ public open class AudioListener2D : Node2D() { } /** - * Makes the [godot.AudioListener2D] active, setting it as the hearing point for the sounds. If there is already another active [godot.AudioListener2D], it will be disabled. - * - * This method will have no effect if the [godot.AudioListener2D] is not added to [godot.SceneTree]. + * Makes the [AudioListener2D] active, setting it as the hearing point for the sounds. If there is + * already another active [AudioListener2D], it will be disabled. + * This method will have no effect if the [AudioListener2D] is not added to [SceneTree]. */ public fun makeCurrent(): Unit { TransferContext.writeArguments() @@ -42,7 +42,7 @@ public open class AudioListener2D : Node2D() { } /** - * Disables the [godot.AudioListener2D]. If it's not set as current, this method will have no effect. + * Disables the [AudioListener2D]. If it's not set as current, this method will have no effect. */ public fun clearCurrent(): Unit { TransferContext.writeArguments() @@ -50,7 +50,7 @@ public open class AudioListener2D : Node2D() { } /** - * Returns `true` if this [godot.AudioListener2D] is currently active. + * Returns `true` if this [AudioListener2D] is currently active. */ public fun isCurrent(): Boolean { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioListener3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioListener3D.kt index 38555aaa2..ff0f98b1a 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioListener3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioListener3D.kt @@ -20,9 +20,9 @@ import kotlin.Suppress import kotlin.Unit /** - * Overrides the location sounds are heard from. - * - * Once added to the scene tree and enabled using [makeCurrent], this node will override the location sounds are heard from. This can be used to listen from a location different from the [godot.Camera3D]. + * Once added to the scene tree and enabled using [makeCurrent], this node will override the + * location sounds are heard from. This can be used to listen from a location different from the + * [Camera3D]. */ @GodotBaseType public open class AudioListener3D : Node3D() { @@ -49,8 +49,8 @@ public open class AudioListener3D : Node3D() { /** * Returns `true` if the listener was made current using [makeCurrent], `false` otherwise. - * - * **Note:** There may be more than one AudioListener3D marked as "current" in the scene tree, but only the one that was made current last will be used. + * **Note:** There may be more than one AudioListener3D marked as "current" in the scene tree, but + * only the one that was made current last will be used. */ public fun isCurrent(): Boolean { TransferContext.writeArguments() @@ -59,7 +59,7 @@ public open class AudioListener3D : Node3D() { } /** - * Returns the listener's global orthonormalized [godot.Transform3D]. + * Returns the listener's global orthonormalized [Transform3D]. */ public fun getListenerTransform(): Transform3D { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamMP3.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamMP3.kt index 889ad23fa..2d330456f 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamMP3.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamMP3.kt @@ -22,8 +22,36 @@ import kotlin.Int import kotlin.Long import kotlin.Suppress +/** + * MP3 audio stream driver. See [data] if you want to load an MP3 file at run-time. + */ @GodotBaseType public open class AudioStreamMP3 : AudioStream() { + /** + * Contains the audio data in bytes. + * You can load a file without having to import it beforehand using the code snippet below. Keep + * in mind that this snippet loads the whole file into memory and may not be ideal for huge files + * (hundreds of megabytes or more). + * + * gdscript: + * ```gdscript + * func load_mp3(path): + * var file = FileAccess.open(path, FileAccess.READ) + * var sound = AudioStreamMP3.new() + * sound.data = file.get_buffer(file.get_length()) + * return sound + * ``` + * csharp: + * ```csharp + * public AudioStreamMP3 LoadMP3(string path) + * { + * using var file = FileAccess.Open(path, FileAccess.ModeFlags.Read); + * var sound = new AudioStreamMP3(); + * sound.Data = file.GetBuffer(file.GetLength()); + * return sound; + * } + * ``` + */ public var `data`: PackedByteArray get() { TransferContext.writeArguments() @@ -68,6 +96,9 @@ public open class AudioStreamMP3 : AudioStream() { TransferContext.callMethod(rawPtr, MethodBindings.setBarBeatsPtr, NIL) } + /** + * If `true`, the stream will automatically loop when it reaches the end. + */ public var loop: Boolean get() { TransferContext.writeArguments() @@ -79,6 +110,9 @@ public open class AudioStreamMP3 : AudioStream() { TransferContext.callMethod(rawPtr, MethodBindings.setLoopPtr, NIL) } + /** + * Time in seconds at which the stream starts after being looped. + */ public var loopOffset: Double get() { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamMicrophone.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamMicrophone.kt index a868d7216..3ce33951f 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamMicrophone.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamMicrophone.kt @@ -12,14 +12,12 @@ import kotlin.Int import kotlin.Suppress /** - * Plays real-time audio input data. - * - * Tutorials: - * [https://github.com/godotengine/godot-demo-projects/tree/master/audio/mic_record](https://github.com/godotengine/godot-demo-projects/tree/master/audio/mic_record) - * - * When used directly in an [godot.AudioStreamPlayer] node, [godot.AudioStreamMicrophone] plays back microphone input in real-time. This can be used in conjunction with [godot.AudioEffectCapture] to process the data or save it. - * - * **Note:** [godot.ProjectSettings.audio/driver/enableInput] must be `true` for audio input to work. See also that setting's description for caveats related to permissions and operating system privacy settings. + * When used directly in an [AudioStreamPlayer] node, [AudioStreamMicrophone] plays back microphone + * input in real-time. This can be used in conjunction with [AudioEffectCapture] to process the data or + * save it. + * **Note:** [ProjectSettings.audio/driver/enableInput] must be `true` for audio input to work. See + * also that setting's description for caveats related to permissions and operating system privacy + * settings. */ @GodotBaseType public open class AudioStreamMicrophone : AudioStream() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamOggVorbis.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamOggVorbis.kt index 9cb7deebe..86991846e 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamOggVorbis.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamOggVorbis.kt @@ -25,8 +25,17 @@ import kotlin.Long import kotlin.String import kotlin.Suppress +/** + * The AudioStreamOggVorbis class is a specialized [AudioStream] for handling Ogg Vorbis file + * formats. It offers functionality for loading and playing back Ogg Vorbis files, as well as managing + * looping and other playback properties. This class is part of the audio stream system, which also + * supports WAV files through the [AudioStreamWAV] class. + */ @GodotBaseType public open class AudioStreamOggVorbis : AudioStream() { + /** + * Contains the raw Ogg data for this stream. + */ public var packetSequence: OggPacketSequence? get() { TransferContext.writeArguments() @@ -71,6 +80,10 @@ public open class AudioStreamOggVorbis : AudioStream() { TransferContext.callMethod(rawPtr, MethodBindings.setBarBeatsPtr, NIL) } + /** + * If `true`, the audio will play again from the specified [loopOffset] once it is done playing. + * Useful for ambient sounds and background music. + */ public var loop: Boolean get() { TransferContext.writeArguments() @@ -82,6 +95,9 @@ public open class AudioStreamOggVorbis : AudioStream() { TransferContext.callMethod(rawPtr, MethodBindings.setLoopPtr, NIL) } + /** + * Time in seconds at which the stream starts after being looped. + */ public var loopOffset: Double get() { TransferContext.writeArguments() @@ -99,12 +115,20 @@ public open class AudioStreamOggVorbis : AudioStream() { } public companion object { + /** + * Creates a new AudioStreamOggVorbis instance from the given buffer. The buffer must contain + * Ogg Vorbis data. + */ public fun loadFromBuffer(buffer: PackedByteArray): AudioStreamOggVorbis? { TransferContext.writeArguments(PACKED_BYTE_ARRAY to buffer) TransferContext.callMethod(0, MethodBindings.loadFromBufferPtr, OBJECT) return (TransferContext.readReturnValue(OBJECT, true) as AudioStreamOggVorbis?) } + /** + * Creates a new AudioStreamOggVorbis instance from the given file path. The file must be in Ogg + * Vorbis format. + */ public fun loadFromFile(path: String): AudioStreamOggVorbis? { TransferContext.writeArguments(STRING to path) TransferContext.callMethod(0, MethodBindings.loadFromFilePtr, OBJECT) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamPlaybackOggVorbis.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamPlaybackOggVorbis.kt index a31bd6c4c..de8c6d4e7 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamPlaybackOggVorbis.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamPlaybackOggVorbis.kt @@ -11,6 +11,14 @@ import kotlin.Boolean import kotlin.Int import kotlin.Suppress +/** + * Imports Autodesk FBX 3D scenes by way of converting them to glTF 2.0 using the FBX2glTF command + * line tool. + * The location of the FBX2glTF binary is set via the `filesystem/import/fbx/fbx2gltf_path` editor + * setting. + * This importer is only used if [ProjectSettings.filesystem/import/fbx/enabled] is enabled, + * otherwise `.fbx` files present in the project folder are not imported. + */ @GodotBaseType public open class AudioStreamPlaybackOggVorbis : AudioStreamPlaybackResampled() { public override fun new(scriptIndex: Int): Boolean { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamPlaybackPolyphonic.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamPlaybackPolyphonic.kt index 7eb9a1ff0..68a9efc48 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamPlaybackPolyphonic.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamPlaybackPolyphonic.kt @@ -24,9 +24,10 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * Playback instance for [godot.AudioStreamPolyphonic]. - * - * Playback instance for [godot.AudioStreamPolyphonic]. After setting the `stream` property of [godot.AudioStreamPlayer], [godot.AudioStreamPlayer2D], or [godot.AudioStreamPlayer3D], the playback instance can be obtained by calling [godot.AudioStreamPlayer.getStreamPlayback], [godot.AudioStreamPlayer2D.getStreamPlayback] or [godot.AudioStreamPlayer3D.getStreamPlayback] methods. + * Playback instance for [AudioStreamPolyphonic]. After setting the `stream` property of + * [AudioStreamPlayer], [AudioStreamPlayer2D], or [AudioStreamPlayer3D], the playback instance can be + * obtained by calling [AudioStreamPlayer.getStreamPlayback], [AudioStreamPlayer2D.getStreamPlayback] + * or [AudioStreamPlayer3D.getStreamPlayback] methods. */ @GodotBaseType public open class AudioStreamPlaybackPolyphonic internal constructor() : AudioStreamPlayback() { @@ -36,13 +37,14 @@ public open class AudioStreamPlaybackPolyphonic internal constructor() : AudioSt } /** - * Play an [godot.AudioStream] at a given offset, volume and pitch scale. Playback starts immediately. - * - * The return value is a unique integer ID that is associated to this playback stream and which can be used to control it. - * - * This ID becomes invalid when the stream ends (if it does not loop), when the [godot.AudioStreamPlaybackPolyphonic] is stopped, or when [stopStream] is called. - * - * This function returns [INVALID_ID] if the amount of streams currently playing equals [godot.AudioStreamPolyphonic.polyphony]. If you need a higher amount of maximum polyphony, raise this value. + * Play an [AudioStream] at a given offset, volume and pitch scale. Playback starts immediately. + * The return value is a unique integer ID that is associated to this playback stream and which + * can be used to control it. + * This ID becomes invalid when the stream ends (if it does not loop), when the + * [AudioStreamPlaybackPolyphonic] is stopped, or when [stopStream] is called. + * This function returns [constant INVALID_ID] if the amount of streams currently playing equals + * [AudioStreamPolyphonic.polyphony]. If you need a higher amount of maximum polyphony, raise this + * value. */ @JvmOverloads public fun playStream( @@ -57,7 +59,8 @@ public open class AudioStreamPlaybackPolyphonic internal constructor() : AudioSt } /** - * Change the stream volume (in db). The [stream] argument is an integer ID returned by [playStream]. + * Change the stream volume (in db). The [param stream] argument is an integer ID returned by + * [playStream]. */ public fun setStreamVolume(stream: Long, volumeDb: Float): Unit { TransferContext.writeArguments(LONG to stream, DOUBLE to volumeDb.toDouble()) @@ -65,7 +68,8 @@ public open class AudioStreamPlaybackPolyphonic internal constructor() : AudioSt } /** - * Change the stream pitch scale. The [stream] argument is an integer ID returned by [playStream]. + * Change the stream pitch scale. The [param stream] argument is an integer ID returned by + * [playStream]. */ public fun setStreamPitchScale(stream: Long, pitchScale: Float): Unit { TransferContext.writeArguments(LONG to stream, DOUBLE to pitchScale.toDouble()) @@ -73,7 +77,8 @@ public open class AudioStreamPlaybackPolyphonic internal constructor() : AudioSt } /** - * Return true whether the stream associated with an integer ID is still playing. Check [playStream] for information on when this ID becomes invalid. + * Return true whether the stream associated with an integer ID is still playing. Check + * [playStream] for information on when this ID becomes invalid. */ public fun isStreamPlaying(stream: Long): Boolean { TransferContext.writeArguments(LONG to stream) @@ -82,7 +87,8 @@ public open class AudioStreamPlaybackPolyphonic internal constructor() : AudioSt } /** - * Stop a stream. The [stream] argument is an integer ID returned by [playStream], which becomes invalid after calling this function. + * Stop a stream. The [param stream] argument is an integer ID returned by [playStream], which + * becomes invalid after calling this function. */ public fun stopStream(stream: Long): Unit { TransferContext.writeArguments(LONG to stream) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamPlaybackResampled.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamPlaybackResampled.kt index 611358ba7..d210ca3f3 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamPlaybackResampled.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamPlaybackResampled.kt @@ -18,9 +18,6 @@ import kotlin.NotImplementedError import kotlin.Suppress import kotlin.Unit -/** - * - */ @GodotBaseType public open class AudioStreamPlaybackResampled : AudioStreamPlayback() { public override fun new(scriptIndex: Int): Boolean { @@ -28,16 +25,10 @@ public open class AudioStreamPlaybackResampled : AudioStreamPlayback() { return true } - /** - * - */ public open fun _getStreamSamplingRate(): Float { throw NotImplementedError("_get_stream_sampling_rate is not implemented for AudioStreamPlaybackResampled") } - /** - * - */ public fun beginResample(): Unit { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.beginResamplePtr, NIL) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamPlayer.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamPlayer.kt index ea763dae9..b28cc8b00 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamPlayer.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamPlayer.kt @@ -29,14 +29,9 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * Plays back audio non-positionally. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/528](https://godotengine.org/asset-library/asset/528) - * * Plays an audio stream non-positionally. - * - * To play audio positionally, use [godot.AudioStreamPlayer2D] or [godot.AudioStreamPlayer3D] instead of [godot.AudioStreamPlayer]. + * To play audio positionally, use [AudioStreamPlayer2D] or [AudioStreamPlayer3D] instead of + * [AudioStreamPlayer]. */ @GodotBaseType public open class AudioStreamPlayer : Node() { @@ -46,7 +41,7 @@ public open class AudioStreamPlayer : Node() { public val finished: Signal0 by signal() /** - * The [godot.AudioStream] object to be played. + * The [AudioStream] object to be played. */ public var stream: AudioStream? get() { @@ -126,7 +121,8 @@ public open class AudioStreamPlayer : Node() { } /** - * If the audio configuration has more than two speakers, this sets the target channels. See [enum MixTarget] constants. + * If the audio configuration has more than two speakers, this sets the target channels. See [enum + * MixTarget] constants. */ public var mixTarget: MixTarget get() { @@ -140,7 +136,8 @@ public open class AudioStreamPlayer : Node() { } /** - * The maximum number of sounds this node can play at the same time. Playing additional sounds after this value is reached will cut off the oldest sounds. + * The maximum number of sounds this node can play at the same time. Playing additional sounds + * after this value is reached will cut off the oldest sounds. */ public var maxPolyphony: Int get() { @@ -155,8 +152,10 @@ public open class AudioStreamPlayer : Node() { /** * Bus on which this audio is playing. - * - * **Note:** When setting this property, keep in mind that no validation is performed to see if the given name matches an existing bus. This is because audio bus layouts might be loaded after this property is set. If this given name can't be resolved at runtime, it will fall back to `"Master"`. + * **Note:** When setting this property, keep in mind that no validation is performed to see if + * the given name matches an existing bus. This is because audio bus layouts might be loaded after + * this property is set. If this given name can't be resolved at runtime, it will fall back to + * `"Master"`. */ public var bus: StringName get() { @@ -175,7 +174,7 @@ public open class AudioStreamPlayer : Node() { } /** - * Plays the audio from the given [fromPosition], in seconds. + * Plays the audio from the given [param from_position], in seconds. */ @JvmOverloads public fun play(fromPosition: Float = 0.0f): Unit { @@ -200,7 +199,7 @@ public open class AudioStreamPlayer : Node() { } /** - * Returns the position in the [godot.AudioStream] in seconds. + * Returns the position in the [AudioStream] in seconds. */ public fun getPlaybackPosition(): Float { TransferContext.writeArguments() @@ -209,7 +208,7 @@ public open class AudioStreamPlayer : Node() { } /** - * Returns whether the [godot.AudioStreamPlayer] can return the [godot.AudioStreamPlayback] object or not. + * Returns whether the [AudioStreamPlayer] can return the [AudioStreamPlayback] object or not. */ public fun hasStreamPlayback(): Boolean { TransferContext.writeArguments() @@ -218,7 +217,7 @@ public open class AudioStreamPlayer : Node() { } /** - * Returns the [godot.AudioStreamPlayback] object associated with this [godot.AudioStreamPlayer]. + * Returns the [AudioStreamPlayback] object associated with this [AudioStreamPlayer]. */ public fun getStreamPlayback(): AudioStreamPlayback? { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamPlayer2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamPlayer2D.kt index 2888eb022..8c6c54176 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamPlayer2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamPlayer2D.kt @@ -29,18 +29,13 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * Plays positional sound in 2D space. - * - * Tutorials: - * [$DOCS_URL/tutorials/audio/audio_streams.html]($DOCS_URL/tutorials/audio/audio_streams.html) - * * Plays audio that is attenuated with distance to the listener. - * - * By default, audio is heard from the screen center. This can be changed by adding an [godot.AudioListener2D] node to the scene and enabling it by calling [godot.AudioListener2D.makeCurrent] on it. - * - * See also [godot.AudioStreamPlayer] to play a sound non-positionally. - * - * **Note:** Hiding an [godot.AudioStreamPlayer2D] node does not disable its audio output. To temporarily disable an [godot.AudioStreamPlayer2D]'s audio output, set [volumeDb] to a very low value like `-100` (which isn't audible to human hearing). + * By default, audio is heard from the screen center. This can be changed by adding an + * [AudioListener2D] node to the scene and enabling it by calling [AudioListener2D.makeCurrent] on it. + * See also [AudioStreamPlayer] to play a sound non-positionally. + * **Note:** Hiding an [AudioStreamPlayer2D] node does not disable its audio output. To temporarily + * disable an [AudioStreamPlayer2D]'s audio output, set [volumeDb] to a very low value like `-100` + * (which isn't audible to human hearing). */ @GodotBaseType public open class AudioStreamPlayer2D : Node2D() { @@ -50,7 +45,7 @@ public open class AudioStreamPlayer2D : Node2D() { public val finished: Signal0 by signal() /** - * The [godot.AudioStream] object to be played. + * The [AudioStream] object to be played. */ public var stream: AudioStream? get() { @@ -158,7 +153,8 @@ public open class AudioStreamPlayer2D : Node2D() { } /** - * The maximum number of sounds this node can play at the same time. Playing additional sounds after this value is reached will cut off the oldest sounds. + * The maximum number of sounds this node can play at the same time. Playing additional sounds + * after this value is reached will cut off the oldest sounds. */ public var maxPolyphony: Int get() { @@ -172,7 +168,9 @@ public open class AudioStreamPlayer2D : Node2D() { } /** - * Scales the panning strength for this node by multiplying the base [godot.ProjectSettings.audio/general/2dPanningStrength] with this factor. Higher values will pan audio from left to right more dramatically than lower values. + * Scales the panning strength for this node by multiplying the base + * [ProjectSettings.audio/general/2dPanningStrength] with this factor. Higher values will pan audio + * from left to right more dramatically than lower values. */ public var panningStrength: Float get() { @@ -187,8 +185,10 @@ public open class AudioStreamPlayer2D : Node2D() { /** * Bus on which this audio is playing. - * - * **Note:** When setting this property, keep in mind that no validation is performed to see if the given name matches an existing bus. This is because audio bus layouts might be loaded after this property is set. If this given name can't be resolved at runtime, it will fall back to `"Master"`. + * **Note:** When setting this property, keep in mind that no validation is performed to see if + * the given name matches an existing bus. This is because audio bus layouts might be loaded after + * this property is set. If this given name can't be resolved at runtime, it will fall back to + * `"Master"`. */ public var bus: StringName get() { @@ -202,7 +202,10 @@ public open class AudioStreamPlayer2D : Node2D() { } /** - * Determines which [godot.Area2D] layers affect the sound for reverb and audio bus effects. Areas can be used to redirect [godot.AudioStream]s so that they play in a certain audio bus. An example of how you might use this is making a "water" area so that sounds played in the water are redirected through an audio bus to make them sound like they are being played underwater. + * Determines which [Area2D] layers affect the sound for reverb and audio bus effects. Areas can + * be used to redirect [AudioStream]s so that they play in a certain audio bus. An example of how you + * might use this is making a "water" area so that sounds played in the water are redirected through + * an audio bus to make them sound like they are being played underwater. */ public var areaMask: Long get() { @@ -221,7 +224,8 @@ public open class AudioStreamPlayer2D : Node2D() { } /** - * Queues the audio to play on the next physics frame, from the given position [fromPosition], in seconds. + * Queues the audio to play on the next physics frame, from the given position [param + * from_position], in seconds. */ @JvmOverloads public fun play(fromPosition: Float = 0.0f): Unit { @@ -246,7 +250,7 @@ public open class AudioStreamPlayer2D : Node2D() { } /** - * Returns the position in the [godot.AudioStream]. + * Returns the position in the [AudioStream]. */ public fun getPlaybackPosition(): Float { TransferContext.writeArguments() @@ -255,7 +259,7 @@ public open class AudioStreamPlayer2D : Node2D() { } /** - * Returns whether the [godot.AudioStreamPlayer] can return the [godot.AudioStreamPlayback] object or not. + * Returns whether the [AudioStreamPlayer] can return the [AudioStreamPlayback] object or not. */ public fun hasStreamPlayback(): Boolean { TransferContext.writeArguments() @@ -264,7 +268,7 @@ public open class AudioStreamPlayer2D : Node2D() { } /** - * Returns the [godot.AudioStreamPlayback] object associated with this [godot.AudioStreamPlayer2D]. + * Returns the [AudioStreamPlayback] object associated with this [AudioStreamPlayer2D]. */ public fun getStreamPlayback(): AudioStreamPlayback? { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamPlayer3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamPlayer3D.kt index 180845348..ac1adffd4 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamPlayer3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamPlayer3D.kt @@ -29,18 +29,16 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * Plays positional sound in 3D space. - * - * Tutorials: - * [$DOCS_URL/tutorials/audio/audio_streams.html]($DOCS_URL/tutorials/audio/audio_streams.html) - * - * Plays audio with positional sound effects, based on the relative position of the audio listener. Positional effects include distance attenuation, directionality, and the Doppler effect. For greater realism, a low-pass filter is applied to distant sounds. This can be disabled by setting [attenuationFilterCutoffHz] to `20500`. - * - * By default, audio is heard from the camera position. This can be changed by adding an [godot.AudioListener3D] node to the scene and enabling it by calling [godot.AudioListener3D.makeCurrent] on it. - * - * See also [godot.AudioStreamPlayer] to play a sound non-positionally. - * - * **Note:** Hiding an [godot.AudioStreamPlayer3D] node does not disable its audio output. To temporarily disable an [godot.AudioStreamPlayer3D]'s audio output, set [volumeDb] to a very low value like `-100` (which isn't audible to human hearing). + * Plays audio with positional sound effects, based on the relative position of the audio listener. + * Positional effects include distance attenuation, directionality, and the Doppler effect. For greater + * realism, a low-pass filter is applied to distant sounds. This can be disabled by setting + * [attenuationFilterCutoffHz] to `20500`. + * By default, audio is heard from the camera position. This can be changed by adding an + * [AudioListener3D] node to the scene and enabling it by calling [AudioListener3D.makeCurrent] on it. + * See also [AudioStreamPlayer] to play a sound non-positionally. + * **Note:** Hiding an [AudioStreamPlayer3D] node does not disable its audio output. To temporarily + * disable an [AudioStreamPlayer3D]'s audio output, set [volumeDb] to a very low value like `-100` + * (which isn't audible to human hearing). */ @GodotBaseType public open class AudioStreamPlayer3D : Node3D() { @@ -50,7 +48,7 @@ public open class AudioStreamPlayer3D : Node3D() { public val finished: Signal0 by signal() /** - * The [godot.AudioStream] resource to be played. + * The [AudioStream] resource to be played. */ public var stream: AudioStream? get() { @@ -64,7 +62,8 @@ public open class AudioStreamPlayer3D : Node3D() { } /** - * Decides if audio should get quieter with distance linearly, quadratically, logarithmically, or not be affected by distance, effectively disabling attenuation. + * Decides if audio should get quieter with distance linearly, quadratically, logarithmically, or + * not be affected by distance, effectively disabling attenuation. */ public var attenuationModel: AttenuationModel get() { @@ -92,7 +91,8 @@ public open class AudioStreamPlayer3D : Node3D() { } /** - * The factor for the attenuation effect. Higher values make the sound audible over a larger distance. + * The factor for the attenuation effect. Higher values make the sound audible over a larger + * distance. */ public var unitSize: Float get() { @@ -172,7 +172,11 @@ public open class AudioStreamPlayer3D : Node3D() { } /** - * The distance past which the sound can no longer be heard at all. Only has an effect if set to a value greater than `0.0`. [maxDistance] works in tandem with [unitSize]. However, unlike [unitSize] whose behavior depends on the [attenuationModel], [maxDistance] always works in a linear fashion. This can be used to prevent the [godot.AudioStreamPlayer3D] from requiring audio mixing when the listener is far away, which saves CPU resources. + * The distance past which the sound can no longer be heard at all. Only has an effect if set to a + * value greater than `0.0`. [maxDistance] works in tandem with [unitSize]. However, unlike + * [unitSize] whose behavior depends on the [attenuationModel], [maxDistance] always works in a + * linear fashion. This can be used to prevent the [AudioStreamPlayer3D] from requiring audio mixing + * when the listener is far away, which saves CPU resources. */ public var maxDistance: Float get() { @@ -186,7 +190,8 @@ public open class AudioStreamPlayer3D : Node3D() { } /** - * The maximum number of sounds this node can play at the same time. Playing additional sounds after this value is reached will cut off the oldest sounds. + * The maximum number of sounds this node can play at the same time. Playing additional sounds + * after this value is reached will cut off the oldest sounds. */ public var maxPolyphony: Int get() { @@ -200,7 +205,9 @@ public open class AudioStreamPlayer3D : Node3D() { } /** - * Scales the panning strength for this node by multiplying the base [godot.ProjectSettings.audio/general/3dPanningStrength] with this factor. Higher values will pan audio from left to right more dramatically than lower values. + * Scales the panning strength for this node by multiplying the base + * [ProjectSettings.audio/general/3dPanningStrength] with this factor. Higher values will pan audio + * from left to right more dramatically than lower values. */ public var panningStrength: Float get() { @@ -215,8 +222,10 @@ public open class AudioStreamPlayer3D : Node3D() { /** * The bus on which this audio is playing. - * - * **Note:** When setting this property, keep in mind that no validation is performed to see if the given name matches an existing bus. This is because audio bus layouts might be loaded after this property is set. If this given name can't be resolved at runtime, it will fall back to `"Master"`. + * **Note:** When setting this property, keep in mind that no validation is performed to see if + * the given name matches an existing bus. This is because audio bus layouts might be loaded after + * this property is set. If this given name can't be resolved at runtime, it will fall back to + * `"Master"`. */ public var bus: StringName get() { @@ -230,7 +239,10 @@ public open class AudioStreamPlayer3D : Node3D() { } /** - * Determines which [godot.Area3D] layers affect the sound for reverb and audio bus effects. Areas can be used to redirect [godot.AudioStream]s so that they play in a certain audio bus. An example of how you might use this is making a "water" area so that sounds played in the water are redirected through an audio bus to make them sound like they are being played underwater. + * Determines which [Area3D] layers affect the sound for reverb and audio bus effects. Areas can + * be used to redirect [AudioStream]s so that they play in a certain audio bus. An example of how you + * might use this is making a "water" area so that sounds played in the water are redirected through + * an audio bus to make them sound like they are being played underwater. */ public var areaMask: Long get() { @@ -272,7 +284,8 @@ public open class AudioStreamPlayer3D : Node3D() { } /** - * Attenuation factor used if listener is outside of [emissionAngleDegrees] and [emissionAngleEnabled] is set, in decibels. + * Attenuation factor used if listener is outside of [emissionAngleDegrees] and + * [emissionAngleEnabled] is set, in decibels. */ public var emissionAngleFilterAttenuationDb: Float get() { @@ -287,7 +300,9 @@ public open class AudioStreamPlayer3D : Node3D() { } /** - * The cutoff frequency of the attenuation low-pass filter, in Hz. A sound above this frequency is attenuated more than a sound below this frequency. To disable this effect, set this to `20500` as this frequency is above the human hearing limit. + * The cutoff frequency of the attenuation low-pass filter, in Hz. A sound above this frequency is + * attenuated more than a sound below this frequency. To disable this effect, set this to `20500` as + * this frequency is above the human hearing limit. */ public var attenuationFilterCutoffHz: Float get() { @@ -334,7 +349,8 @@ public open class AudioStreamPlayer3D : Node3D() { } /** - * Queues the audio to play on the next physics frame, from the given position [fromPosition], in seconds. + * Queues the audio to play on the next physics frame, from the given position [param + * from_position], in seconds. */ @JvmOverloads public fun play(fromPosition: Float = 0.0f): Unit { @@ -359,7 +375,7 @@ public open class AudioStreamPlayer3D : Node3D() { } /** - * Returns the position in the [godot.AudioStream]. + * Returns the position in the [AudioStream]. */ public fun getPlaybackPosition(): Float { TransferContext.writeArguments() @@ -368,7 +384,7 @@ public open class AudioStreamPlayer3D : Node3D() { } /** - * Returns whether the [godot.AudioStreamPlayer] can return the [godot.AudioStreamPlayback] object or not. + * Returns whether the [AudioStreamPlayer] can return the [AudioStreamPlayback] object or not. */ public fun hasStreamPlayback(): Boolean { TransferContext.writeArguments() @@ -377,7 +393,7 @@ public open class AudioStreamPlayer3D : Node3D() { } /** - * Returns the [godot.AudioStreamPlayback] object associated with this [godot.AudioStreamPlayer3D]. + * Returns the [AudioStreamPlayback] object associated with this [AudioStreamPlayer3D]. */ public fun getStreamPlayback(): AudioStreamPlayback? { TransferContext.writeArguments() @@ -401,7 +417,10 @@ public open class AudioStreamPlayer3D : Node3D() { */ ATTENUATION_LOGARITHMIC(2), /** - * No attenuation of loudness according to distance. The sound will still be heard positionally, unlike an [godot.AudioStreamPlayer]. [ATTENUATION_DISABLED] can be combined with a [maxDistance] value greater than `0.0` to achieve linear attenuation clamped to a sphere of a defined size. + * No attenuation of loudness according to distance. The sound will still be heard positionally, + * unlike an [AudioStreamPlayer]. [constant ATTENUATION_DISABLED] can be combined with a + * [maxDistance] value greater than `0.0` to achieve linear attenuation clamped to a sphere of a + * defined size. */ ATTENUATION_DISABLED(3), ; @@ -424,11 +443,13 @@ public open class AudioStreamPlayer3D : Node3D() { */ DOPPLER_TRACKING_DISABLED(0), /** - * Executes doppler tracking during process frames (see [godot.Node.NOTIFICATION_INTERNAL_PROCESS]). + * Executes doppler tracking during process frames (see [constant + * Node.NOTIFICATION_INTERNAL_PROCESS]). */ DOPPLER_TRACKING_IDLE_STEP(1), /** - * Executes doppler tracking during physics frames (see [godot.Node.NOTIFICATION_INTERNAL_PHYSICS_PROCESS]). + * Executes doppler tracking during physics frames (see [constant + * Node.NOTIFICATION_INTERNAL_PHYSICS_PROCESS]). */ DOPPLER_TRACKING_PHYSICS_STEP(2), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamPolyphonic.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamPolyphonic.kt index b32661ddf..4978e2284 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamPolyphonic.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamPolyphonic.kt @@ -18,11 +18,13 @@ import kotlin.Long import kotlin.Suppress /** - * AudioStream that lets the user play custom streams at any time from code, simultaneously using a single player. - * - * AudioStream that lets the user play custom streams at any time from code, simultaneously using a single player. - * - * Playback control is done via the [godot.AudioStreamPlaybackPolyphonic] instance set inside the player, which can be obtained via [godot.AudioStreamPlayer.getStreamPlayback], [godot.AudioStreamPlayer2D.getStreamPlayback] or [godot.AudioStreamPlayer3D.getStreamPlayback] methods. Obtaining the playback instance is only valid after the `stream` property is set as an [godot.AudioStreamPolyphonic] in those players. + * AudioStream that lets the user play custom streams at any time from code, simultaneously using a + * single player. + * Playback control is done via the [AudioStreamPlaybackPolyphonic] instance set inside the player, + * which can be obtained via [AudioStreamPlayer.getStreamPlayback], + * [AudioStreamPlayer2D.getStreamPlayback] or [AudioStreamPlayer3D.getStreamPlayback] methods. + * Obtaining the playback instance is only valid after the `stream` property is set as an + * [AudioStreamPolyphonic] in those players. */ @GodotBaseType public open class AudioStreamPolyphonic : AudioStream() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamRandomizer.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamRandomizer.kt index b13c3d365..db5e57cae 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamRandomizer.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamRandomizer.kt @@ -24,9 +24,8 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * Wraps a pool of audio streams with pitch and volume shifting. - * - * Picks a random AudioStream from the pool, depending on the playback mode, and applies random pitch shifting and volume shifting during playback. + * Picks a random AudioStream from the pool, depending on the playback mode, and applies random + * pitch shifting and volume shifting during playback. */ @GodotBaseType public open class AudioStreamRandomizer : AudioStream() { @@ -92,7 +91,8 @@ public open class AudioStreamRandomizer : AudioStream() { } /** - * Insert a stream at the specified index. If the index is less than zero, the insertion occurs at the end of the underlying pool. + * Insert a stream at the specified index. If the index is less than zero, the insertion occurs at + * the end of the underlying pool. */ @JvmOverloads public fun addStream( @@ -138,7 +138,8 @@ public open class AudioStreamRandomizer : AudioStream() { } /** - * Set the probability weight of the stream at the specified index. The higher this value, the more likely that the randomizer will choose this stream during random playback modes. + * Set the probability weight of the stream at the specified index. The higher this value, the + * more likely that the randomizer will choose this stream during random playback modes. */ public fun setStreamProbabilityWeight(index: Int, weight: Float): Unit { TransferContext.writeArguments(LONG to index.toLong(), DOUBLE to weight.toDouble()) @@ -158,15 +159,19 @@ public open class AudioStreamRandomizer : AudioStream() { id: Long, ) { /** - * Pick a stream at random according to the probability weights chosen for each stream, but avoid playing the same stream twice in a row whenever possible. If only 1 sound is present in the pool, the same sound will always play, effectively allowing repeats to occur. + * Pick a stream at random according to the probability weights chosen for each stream, but + * avoid playing the same stream twice in a row whenever possible. If only 1 sound is present in + * the pool, the same sound will always play, effectively allowing repeats to occur. */ PLAYBACK_RANDOM_NO_REPEATS(0), /** - * Pick a stream at random according to the probability weights chosen for each stream. If only 1 sound is present in the pool, the same sound will always play. + * Pick a stream at random according to the probability weights chosen for each stream. If only + * 1 sound is present in the pool, the same sound will always play. */ PLAYBACK_RANDOM(1), /** - * Play streams in the order they appear in the stream pool. If only 1 sound is present in the pool, the same sound will always play. + * Play streams in the order they appear in the stream pool. If only 1 sound is present in the + * pool, the same sound will always play. */ PLAYBACK_SEQUENTIAL(2), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/BackBufferCopy.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/BackBufferCopy.kt index a164688b3..a924a4c59 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/BackBufferCopy.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/BackBufferCopy.kt @@ -23,11 +23,14 @@ import kotlin.Suppress import kotlin.Unit /** - * A node that copies a region of the screen to a buffer for access in shader code. - * - * Node for back-buffering the currently-displayed screen. The region defined in the [godot.BackBufferCopy] node is buffered with the content of the screen it covers, or the entire screen according to the [copyMode]. It can be accessed in shader scripts using the screen texture (i.e. a uniform sampler with `hint_screen_texture`). - * - * **Note:** Since this node inherits from [godot.Node2D] (and not [godot.Control]), anchors and margins won't apply to child [godot.Control]-derived nodes. This can be problematic when resizing the window. To avoid this, add [godot.Control]-derived nodes as *siblings* to the [godot.BackBufferCopy] node instead of adding them as children. + * Node for back-buffering the currently-displayed screen. The region defined in the + * [BackBufferCopy] node is buffered with the content of the screen it covers, or the entire screen + * according to the [copyMode]. It can be accessed in shader scripts using the screen texture (i.e. a + * uniform sampler with `hint_screen_texture`). + * **Note:** Since this node inherits from [Node2D] (and not [Control]), anchors and margins won't + * apply to child [Control]-derived nodes. This can be problematic when resizing the window. To avoid + * this, add [Control]-derived nodes as *siblings* to the [BackBufferCopy] node instead of adding them + * as children. */ @GodotBaseType public open class BackBufferCopy : Node2D() { @@ -46,7 +49,7 @@ public open class BackBufferCopy : Node2D() { } /** - * The area covered by the [godot.BackBufferCopy]. Only used if [copyMode] is [COPY_MODE_RECT]. + * The area covered by the [BackBufferCopy]. Only used if [copyMode] is [constant COPY_MODE_RECT]. */ @CoreTypeLocalCopy public var rect: Rect2 @@ -66,7 +69,7 @@ public open class BackBufferCopy : Node2D() { } /** - * The area covered by the [godot.BackBufferCopy]. Only used if [copyMode] is [COPY_MODE_RECT]. + * The area covered by the [BackBufferCopy]. Only used if [copyMode] is [constant COPY_MODE_RECT]. * * This is a helper function to make dealing with local copies easier. * @@ -93,15 +96,16 @@ public open class BackBufferCopy : Node2D() { id: Long, ) { /** - * Disables the buffering mode. This means the [godot.BackBufferCopy] node will directly use the portion of screen it covers. + * Disables the buffering mode. This means the [BackBufferCopy] node will directly use the + * portion of screen it covers. */ COPY_MODE_DISABLED(0), /** - * [godot.BackBufferCopy] buffers a rectangular region. + * [BackBufferCopy] buffers a rectangular region. */ COPY_MODE_RECT(1), /** - * [godot.BackBufferCopy] buffers the entire screen. + * [BackBufferCopy] buffers the entire screen. */ COPY_MODE_VIEWPORT(2), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/BaseButton.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/BaseButton.kt index 97dd29056..b2f1fc829 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/BaseButton.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/BaseButton.kt @@ -25,16 +25,15 @@ import kotlin.Suppress import kotlin.Unit /** - * Abstract base class for GUI buttons. - * - * [godot.BaseButton] is an abstract base class for GUI buttons. It doesn't display anything by itself. + * [BaseButton] is an abstract base class for GUI buttons. It doesn't display anything by itself. */ @GodotBaseType public open class BaseButton : Control() { /** - * Emitted when the button is toggled or pressed. This is on [buttonDown] if [actionMode] is [ACTION_MODE_BUTTON_PRESS] and on [buttonUp] otherwise. - * - * If you need to know the button's pressed state (and [toggleMode] is active), use [toggled] instead. + * Emitted when the button is toggled or pressed. This is on [signal button_down] if [actionMode] + * is [constant ACTION_MODE_BUTTON_PRESS] and on [signal button_up] otherwise. + * If you need to know the button's pressed state (and [toggleMode] is active), use [signal + * toggled] instead. */ public val pressed: Signal0 by signal() @@ -49,7 +48,8 @@ public open class BaseButton : Control() { public val buttonDown: Signal0 by signal() /** - * Emitted when the button was just toggled between pressed and normal states (only if [toggleMode] is active). The new state is contained in the [toggledOn] argument. + * Emitted when the button was just toggled between pressed and normal states (only if + * [toggleMode] is active). The new state is contained in the [param toggled_on] argument. */ public val toggled: Signal1 by signal("toggledOn") @@ -68,7 +68,8 @@ public open class BaseButton : Control() { } /** - * If `true`, the button is in toggle mode. Makes the button flip state between pressed and unpressed each time its area is clicked. + * If `true`, the button is in toggle mode. Makes the button flip state between pressed and + * unpressed each time its area is clicked. */ public var toggleMode: Boolean get() { @@ -82,9 +83,10 @@ public open class BaseButton : Control() { } /** - * If `true`, the button's state is pressed. Means the button is pressed down or toggled (if [toggleMode] is active). Only works if [toggleMode] is `true`. - * - * **Note:** Setting [buttonPressed] will result in [toggled] to be emitted. If you want to change the pressed state without emitting that signal, use [setPressedNoSignal]. + * If `true`, the button's state is pressed. Means the button is pressed down or toggled (if + * [toggleMode] is active). Only works if [toggleMode] is `true`. + * **Note:** Setting [buttonPressed] will result in [signal toggled] to be emitted. If you want to + * change the pressed state without emitting that signal, use [setPressedNoSignal]. */ public var buttonPressed: Boolean get() { @@ -113,8 +115,8 @@ public open class BaseButton : Control() { /** * Binary mask to choose which mouse buttons this button will respond to. - * - * To allow both left-click and right-click, use `MOUSE_BUTTON_MASK_LEFT | MOUSE_BUTTON_MASK_RIGHT`. + * To allow both left-click and right-click, use `MOUSE_BUTTON_MASK_LEFT | + * MOUSE_BUTTON_MASK_RIGHT`. */ public var buttonMask: MouseButtonMask get() { @@ -128,9 +130,10 @@ public open class BaseButton : Control() { } /** - * If `true`, the button stays pressed when moving the cursor outside the button while pressing it. - * - * **Note:** This property only affects the button's visual appearance. Signals will be emitted at the same moment regardless of this property's value. + * If `true`, the button stays pressed when moving the cursor outside the button while pressing + * it. + * **Note:** This property only affects the button's visual appearance. Signals will be emitted at + * the same moment regardless of this property's value. */ public var keepPressedOutside: Boolean get() { @@ -144,9 +147,8 @@ public open class BaseButton : Control() { } /** - * The [godot.ButtonGroup] associated with the button. Not to be confused with node groups. - * - * **Note:** The button will be configured as a radio button if a [godot.ButtonGroup] is assigned to it. + * The [ButtonGroup] associated with the button. Not to be confused with node groups. + * **Note:** The button will be configured as a radio button if a [ButtonGroup] is assigned to it. */ public var buttonGroup: ButtonGroup? get() { @@ -160,7 +162,7 @@ public open class BaseButton : Control() { } /** - * [godot.Shortcut] associated to the button. + * [Shortcut] associated to the button. */ public var shortcut: Shortcut? get() { @@ -174,7 +176,8 @@ public open class BaseButton : Control() { } /** - * If `true`, the button will highlight for a short amount of time when its shortcut is activated. If `false` and [toggleMode] is `false`, the shortcut will activate without any visual feedback. + * If `true`, the button will highlight for a short amount of time when its shortcut is activated. + * If `false` and [toggleMode] is `false`, the shortcut will activate without any visual feedback. */ public var shortcutFeedback: Boolean get() { @@ -207,7 +210,8 @@ public open class BaseButton : Control() { } /** - * Called when the button is pressed. If you need to know the button's pressed state (and [toggleMode] is active), use [_toggled] instead. + * Called when the button is pressed. If you need to know the button's pressed state (and + * [toggleMode] is active), use [_toggled] instead. */ public open fun _pressed(): Unit { } @@ -219,8 +223,9 @@ public open class BaseButton : Control() { } /** - * Changes the [buttonPressed] state of the button, without emitting [toggled]. Use when you just want to change the state of the button without sending the pressed event (e.g. when initializing scene). Only works if [toggleMode] is `true`. - * + * Changes the [buttonPressed] state of the button, without emitting [signal toggled]. Use when + * you just want to change the state of the button without sending the pressed event (e.g. when + * initializing scene). Only works if [toggleMode] is `true`. * **Note:** This method doesn't unpress other buttons in [buttonGroup]. */ public fun setPressedNoSignal(pressed: Boolean): Unit { @@ -238,7 +243,9 @@ public open class BaseButton : Control() { } /** - * Returns the visual state used to draw the button. This is useful mainly when implementing your own draw code by either overriding _draw() or connecting to "draw" signal. The visual state of the button is defined by the [enum DrawMode] enum. + * Returns the visual state used to draw the button. This is useful mainly when implementing your + * own draw code by either overriding _draw() or connecting to "draw" signal. The visual state of the + * button is defined by the [enum DrawMode] enum. */ public fun getDrawMode(): DrawMode { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/BitMap.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/BitMap.kt index e404c00eb..be6afdc3f 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/BitMap.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/BitMap.kt @@ -31,9 +31,8 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * Boolean matrix. - * - * A two-dimensional array of boolean values, can be used to efficiently store a binary matrix (every matrix element takes only one bit) and query the values using natural cartesian coordinates. + * A two-dimensional array of boolean values, can be used to efficiently store a binary matrix + * (every matrix element takes only one bit) and query the values using natural cartesian coordinates. */ @GodotBaseType public open class BitMap : Resource() { @@ -51,7 +50,9 @@ public open class BitMap : Resource() { } /** - * Creates a bitmap that matches the given image dimensions, every element of the bitmap is set to `false` if the alpha value of the image at that position is equal to [threshold] or less, and `true` in other case. + * Creates a bitmap that matches the given image dimensions, every element of the bitmap is set to + * `false` if the alpha value of the image at that position is equal to [param threshold] or less, + * and `true` in other case. */ @JvmOverloads public fun createFromImageAlpha(image: Image, threshold: Float = 0.1f): Unit { @@ -124,7 +125,7 @@ public open class BitMap : Resource() { } /** - * Resizes the image to [newSize]. + * Resizes the image to [param new_size]. */ public fun resize(newSize: Vector2i): Unit { TransferContext.writeArguments(VECTOR2I to newSize) @@ -132,7 +133,10 @@ public open class BitMap : Resource() { } /** - * Applies morphological dilation or erosion to the bitmap. If [pixels] is positive, dilation is applied to the bitmap. If [pixels] is negative, erosion is applied to the bitmap. [rect] defines the area where the morphological operation is applied. Pixels located outside the [rect] are unaffected by [growMask]. + * Applies morphological dilation or erosion to the bitmap. If [param pixels] is positive, + * dilation is applied to the bitmap. If [param pixels] is negative, erosion is applied to the + * bitmap. [param rect] defines the area where the morphological operation is applied. Pixels located + * outside the [param rect] are unaffected by [growMask]. */ public fun growMask(pixels: Int, rect: Rect2i): Unit { TransferContext.writeArguments(LONG to pixels.toLong(), RECT2I to rect) @@ -140,7 +144,9 @@ public open class BitMap : Resource() { } /** - * Returns an image of the same size as the bitmap and with a [enum Image.Format] of type [godot.Image.FORMAT_L8]. `true` bits of the bitmap are being converted into white pixels, and `false` bits into black. + * Returns an image of the same size as the bitmap and with a [enum Image.Format] of type + * [constant Image.FORMAT_L8]. `true` bits of the bitmap are being converted into white pixels, and + * `false` bits into black. */ public fun convertToImage(): Image? { TransferContext.writeArguments() @@ -149,15 +155,15 @@ public open class BitMap : Resource() { } /** - * Creates an [godot.Array] of polygons covering a rectangular portion of the bitmap. It uses a marching squares algorithm, followed by Ramer-Douglas-Peucker (RDP) reduction of the number of vertices. Each polygon is described as a [godot.PackedVector2Array] of its vertices. - * + * Creates an [Array] of polygons covering a rectangular portion of the bitmap. It uses a marching + * squares algorithm, followed by Ramer-Douglas-Peucker (RDP) reduction of the number of vertices. + * Each polygon is described as a [PackedVector2Array] of its vertices. * To get polygons covering the whole bitmap, pass: - * - * ``` - * Rect2(Vector2(), get_size()) - * ``` - * - * [epsilon] is passed to RDP to control how accurately the polygons cover the bitmap: a lower [epsilon] corresponds to more points in the polygons. + * [codeblock] + * Rect2(Vector2(), get_size()) + * [/codeblock] + * [param epsilon] is passed to RDP to control how accurately the polygons cover the bitmap: a + * lower [param epsilon] corresponds to more points in the polygons. */ @JvmOverloads public fun opaqueToPolygons(rect: Rect2i, epsilon: Float = 2.0f): diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Bone2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Bone2D.kt index 387d07655..e1ff0f204 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Bone2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Bone2D.kt @@ -27,20 +27,20 @@ import kotlin.Suppress import kotlin.Unit /** - * A joint used with [godot.Skeleton2D] to control and animate other nodes. - * - * A hierarchy of [godot.Bone2D]s can be bound to a [godot.Skeleton2D] to control and animate other [godot.Node2D] nodes. - * - * You can use [godot.Bone2D] and [godot.Skeleton2D] nodes to animate 2D meshes created with the [godot.Polygon2D] UV editor. - * - * Each bone has a [rest] transform that you can reset to with [applyRest]. These rest poses are relative to the bone's parent. - * - * If in the editor, you can set the rest pose of an entire skeleton using a menu option, from the code, you need to iterate over the bones to set their individual rest poses. + * A hierarchy of [Bone2D]s can be bound to a [Skeleton2D] to control and animate other [Node2D] + * nodes. + * You can use [Bone2D] and [Skeleton2D] nodes to animate 2D meshes created with the [Polygon2D] UV + * editor. + * Each bone has a [rest] transform that you can reset to with [applyRest]. These rest poses are + * relative to the bone's parent. + * If in the editor, you can set the rest pose of an entire skeleton using a menu option, from the + * code, you need to iterate over the bones to set their individual rest poses. */ @GodotBaseType public open class Bone2D : Node2D() { /** - * Rest transform of the bone. You can reset the node's transforms to this value using [applyRest]. + * Rest transform of the bone. You can reset the node's transforms to this value using + * [applyRest]. */ @CoreTypeLocalCopy public var rest: Transform2D @@ -60,7 +60,8 @@ public open class Bone2D : Node2D() { } /** - * Rest transform of the bone. You can reset the node's transforms to this value using [applyRest]. + * Rest transform of the bone. You can reset the node's transforms to this value using + * [applyRest]. * * This is a helper function to make dealing with local copies easier. * @@ -92,7 +93,8 @@ public open class Bone2D : Node2D() { } /** - * Returns the node's [rest] [godot.core.Transform2D] if it doesn't have a parent, or its rest pose relative to its parent. + * Returns the node's [rest] [Transform2D] if it doesn't have a parent, or its rest pose relative + * to its parent. */ public fun getSkeletonRest(): Transform2D { TransferContext.writeArguments() @@ -101,7 +103,7 @@ public open class Bone2D : Node2D() { } /** - * Returns the node's index as part of the entire skeleton. See [godot.Skeleton2D]. + * Returns the node's index as part of the entire skeleton. See [Skeleton2D]. */ public fun getIndexInSkeleton(): Int { TransferContext.writeArguments() @@ -110,7 +112,9 @@ public open class Bone2D : Node2D() { } /** - * When set to `true`, the [godot.Bone2D] node will attempt to automatically calculate the bone angle and length using the first child [godot.Bone2D] node, if one exists. If none exist, the [godot.Bone2D] cannot automatically calculate these values and will print a warning. + * When set to `true`, the [Bone2D] node will attempt to automatically calculate the bone angle + * and length using the first child [Bone2D] node, if one exists. If none exist, the [Bone2D] cannot + * automatically calculate these values and will print a warning. */ public fun setAutocalculateLengthAndAngle(autoCalculate: Boolean): Unit { TransferContext.writeArguments(BOOL to autoCalculate) @@ -118,7 +122,9 @@ public open class Bone2D : Node2D() { } /** - * Returns whether this [godot.Bone2D] is going to autocalculate its length and bone angle using its first [godot.Bone2D] child node, if one exists. If there are no [godot.Bone2D] children, then it cannot autocalculate these values and will print a warning. + * Returns whether this [Bone2D] is going to autocalculate its length and bone angle using its + * first [Bone2D] child node, if one exists. If there are no [Bone2D] children, then it cannot + * autocalculate these values and will print a warning. */ public fun getAutocalculateLengthAndAngle(): Boolean { TransferContext.writeArguments() @@ -127,7 +133,7 @@ public open class Bone2D : Node2D() { } /** - * Sets the length of the bone in the [godot.Bone2D]. + * Sets the length of the bone in the [Bone2D]. */ public fun setLength(length: Float): Unit { TransferContext.writeArguments(DOUBLE to length.toDouble()) @@ -135,7 +141,7 @@ public open class Bone2D : Node2D() { } /** - * Returns the length of the bone in the [godot.Bone2D] node. + * Returns the length of the bone in the [Bone2D] node. */ public fun getLength(): Float { TransferContext.writeArguments() @@ -144,9 +150,10 @@ public open class Bone2D : Node2D() { } /** - * Sets the bone angle for the [godot.Bone2D]. This is typically set to the rotation from the [godot.Bone2D] to a child [godot.Bone2D] node. - * - * **Note:** This is different from the [godot.Bone2D]'s rotation. The bone's angle is the rotation of the bone shown by the gizmo, which is unaffected by the [godot.Bone2D]'s [godot.Node2D.transform]. + * Sets the bone angle for the [Bone2D]. This is typically set to the rotation from the [Bone2D] + * to a child [Bone2D] node. + * **Note:** This is different from the [Bone2D]'s rotation. The bone's angle is the rotation of + * the bone shown by the gizmo, which is unaffected by the [Bone2D]'s [Node2D.transform]. */ public fun setBoneAngle(angle: Float): Unit { TransferContext.writeArguments(DOUBLE to angle.toDouble()) @@ -154,9 +161,9 @@ public open class Bone2D : Node2D() { } /** - * Returns the angle of the bone in the [godot.Bone2D]. - * - * **Note:** This is different from the [godot.Bone2D]'s rotation. The bone's angle is the rotation of the bone shown by the gizmo, which is unaffected by the [godot.Bone2D]'s [godot.Node2D.transform]. + * Returns the angle of the bone in the [Bone2D]. + * **Note:** This is different from the [Bone2D]'s rotation. The bone's angle is the rotation of + * the bone shown by the gizmo, which is unaffected by the [Bone2D]'s [Node2D.transform]. */ public fun getBoneAngle(): Float { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/BoneAttachment3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/BoneAttachment3D.kt index fa49fd0f5..a16804544 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/BoneAttachment3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/BoneAttachment3D.kt @@ -24,9 +24,9 @@ import kotlin.Suppress import kotlin.Unit /** - * А node that dynamically copies or overrides the 3D transform of a bone in its parent [godot.Skeleton3D]. - * - * This node selects a bone in a [godot.Skeleton3D] and attaches to it. This means that the [godot.BoneAttachment3D] node will either dynamically copy or override the 3D transform of the selected bone. + * This node selects a bone in a [Skeleton3D] and attaches to it. This means that the + * [BoneAttachment3D] node will either dynamically copy or override the 3D transform of the selected + * bone. */ @GodotBaseType public open class BoneAttachment3D : Node3D() { @@ -59,7 +59,9 @@ public open class BoneAttachment3D : Node3D() { } /** - * Whether the BoneAttachment3D node will override the bone pose of the bone it is attached to. When set to `true`, the BoneAttachment3D node can change the pose of the bone. When set to `false`, the BoneAttachment3D will always be set to the bone's transform. + * Whether the BoneAttachment3D node will override the bone pose of the bone it is attached to. + * When set to `true`, the BoneAttachment3D node can change the pose of the bone. When set to + * `false`, the BoneAttachment3D will always be set to the bone's transform. */ public var overridePose: Boolean get() { @@ -78,7 +80,9 @@ public open class BoneAttachment3D : Node3D() { } /** - * A function that is called automatically when the [godot.Skeleton3D] the BoneAttachment3D node is using has a bone that has changed its pose. This function is where the BoneAttachment3D node updates its position so it is correctly bound when it is *not* set to override the bone pose. + * A function that is called automatically when the [Skeleton3D] the BoneAttachment3D node is + * using has a bone that has changed its pose. This function is where the BoneAttachment3D node + * updates its position so it is correctly bound when it is *not* set to override the bone pose. */ public fun onBonePoseUpdate(boneIndex: Int): Unit { TransferContext.writeArguments(LONG to boneIndex.toLong()) @@ -86,7 +90,9 @@ public open class BoneAttachment3D : Node3D() { } /** - * Sets whether the BoneAttachment3D node will use an external [godot.Skeleton3D] node rather than attempting to use its parent node as the [godot.Skeleton3D]. When set to `true`, the BoneAttachment3D node will use the external [godot.Skeleton3D] node set in [setExternalSkeleton]. + * Sets whether the BoneAttachment3D node will use an external [Skeleton3D] node rather than + * attempting to use its parent node as the [Skeleton3D]. When set to `true`, the BoneAttachment3D + * node will use the external [Skeleton3D] node set in [setExternalSkeleton]. */ public fun setUseExternalSkeleton(useExternalSkeleton: Boolean): Unit { TransferContext.writeArguments(BOOL to useExternalSkeleton) @@ -94,7 +100,8 @@ public open class BoneAttachment3D : Node3D() { } /** - * Returns whether the BoneAttachment3D node is using an external [godot.Skeleton3D] rather than attempting to use its parent node as the [godot.Skeleton3D]. + * Returns whether the BoneAttachment3D node is using an external [Skeleton3D] rather than + * attempting to use its parent node as the [Skeleton3D]. */ public fun getUseExternalSkeleton(): Boolean { TransferContext.writeArguments() @@ -103,7 +110,8 @@ public open class BoneAttachment3D : Node3D() { } /** - * Sets the [godot.core.NodePath] to the external skeleton that the BoneAttachment3D node should use. See [setUseExternalSkeleton] to enable the external [godot.Skeleton3D] node. + * Sets the [NodePath] to the external skeleton that the BoneAttachment3D node should use. See + * [setUseExternalSkeleton] to enable the external [Skeleton3D] node. */ public fun setExternalSkeleton(externalSkeleton: NodePath): Unit { TransferContext.writeArguments(NODE_PATH to externalSkeleton) @@ -111,7 +119,7 @@ public open class BoneAttachment3D : Node3D() { } /** - * Returns the [godot.core.NodePath] to the external [godot.Skeleton3D] node, if one has been set. + * Returns the [NodePath] to the external [Skeleton3D] node, if one has been set. */ public fun getExternalSkeleton(): NodePath { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/BoneMap.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/BoneMap.kt index 3a7c606e1..77f70fbd6 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/BoneMap.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/BoneMap.kt @@ -22,29 +22,27 @@ import kotlin.Suppress import kotlin.Unit /** - * Describes a mapping of bone names for retargeting [godot.Skeleton3D] into common names defined by a [godot.SkeletonProfile]. - * - * Tutorials: - * [$DOCS_URL/tutorials/assets_pipeline/retargeting_3d_skeletons.html]($DOCS_URL/tutorials/assets_pipeline/retargeting_3d_skeletons.html) - * - * This class contains a dictionary that uses a list of bone names in [godot.SkeletonProfile] as key names. - * - * By assigning the actual [godot.Skeleton3D] bone name as the key value, it maps the [godot.Skeleton3D] to the [godot.SkeletonProfile]. + * This class contains a dictionary that uses a list of bone names in [SkeletonProfile] as key + * names. + * By assigning the actual [Skeleton3D] bone name as the key value, it maps the [Skeleton3D] to the + * [SkeletonProfile]. */ @GodotBaseType public open class BoneMap : Resource() { /** - * This signal is emitted when change the key value in the [godot.BoneMap]. This is used to validate mapping and to update [godot.BoneMap] editor. + * This signal is emitted when change the key value in the [BoneMap]. This is used to validate + * mapping and to update [BoneMap] editor. */ public val boneMapUpdated: Signal0 by signal() /** - * This signal is emitted when change the value in profile or change the reference of profile. This is used to update key names in the [godot.BoneMap] and to redraw the [godot.BoneMap] editor. + * This signal is emitted when change the value in profile or change the reference of profile. + * This is used to update key names in the [BoneMap] and to redraw the [BoneMap] editor. */ public val profileUpdated: Signal0 by signal() /** - * A [godot.SkeletonProfile] of the mapping target. Key names in the [godot.BoneMap] are synchronized with it. + * A [SkeletonProfile] of the mapping target. Key names in the [BoneMap] are synchronized with it. */ public var profile: SkeletonProfile? get() { @@ -63,8 +61,7 @@ public open class BoneMap : Resource() { } /** - * Returns a skeleton bone name is mapped to [profileBoneName]. - * + * Returns a skeleton bone name is mapped to [param profile_bone_name]. * In the retargeting process, the returned bone name is the bone name of the source skeleton. */ public fun getSkeletonBoneName(profileBoneName: StringName): StringName { @@ -74,8 +71,7 @@ public open class BoneMap : Resource() { } /** - * Maps a skeleton bone name to [profileBoneName]. - * + * Maps a skeleton bone name to [param profile_bone_name]. * In the retargeting process, the setting bone name is the bone name of the source skeleton. */ public fun setSkeletonBoneName(profileBoneName: StringName, skeletonBoneName: StringName): Unit { @@ -84,8 +80,8 @@ public open class BoneMap : Resource() { } /** - * Returns a profile bone name having [skeletonBoneName]. If not found, an empty [godot.StringName] will be returned. - * + * Returns a profile bone name having [param skeleton_bone_name]. If not found, an empty + * [StringName] will be returned. * In the retargeting process, the returned bone name is the bone name of the target skeleton. */ public fun findProfileBoneName(skeletonBoneName: StringName): StringName { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/BoxContainer.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/BoxContainer.kt index c30f0b282..2fc437b8f 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/BoxContainer.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/BoxContainer.kt @@ -20,17 +20,14 @@ import kotlin.Long import kotlin.Suppress /** - * A container that arranges its child controls horizontally or vertically. - * - * Tutorials: - * [$DOCS_URL/tutorials/ui/gui_containers.html]($DOCS_URL/tutorials/ui/gui_containers.html) - * - * A container that arranges its child controls horizontally or vertically, rearranging them automatically when their minimum size changes. + * A container that arranges its child controls horizontally or vertically, rearranging them + * automatically when their minimum size changes. */ @GodotBaseType public open class BoxContainer : Container() { /** - * The alignment of the container's children (must be one of [ALIGNMENT_BEGIN], [ALIGNMENT_CENTER], or [ALIGNMENT_END]). + * The alignment of the container's children (must be one of [constant ALIGNMENT_BEGIN], [constant + * ALIGNMENT_CENTER], or [constant ALIGNMENT_END]). */ public var alignment: AlignmentMode get() { @@ -44,9 +41,8 @@ public open class BoxContainer : Container() { } /** - * If `true`, the [godot.BoxContainer] will arrange its children vertically, rather than horizontally. - * - * Can't be changed when using [godot.HBoxContainer] and [godot.VBoxContainer]. + * If `true`, the [BoxContainer] will arrange its children vertically, rather than horizontally. + * Can't be changed when using [HBoxContainer] and [VBoxContainer]. */ public var vertical: Boolean get() { @@ -65,7 +61,8 @@ public open class BoxContainer : Container() { } /** - * Adds a [godot.Control] node to the box as a spacer. If [begin] is `true`, it will insert the [godot.Control] node in front of all other children. + * Adds a [Control] node to the box as a spacer. If [param begin] is `true`, it will insert the + * [Control] node in front of all other children. */ public fun addSpacer(begin: Boolean): Control? { TransferContext.writeArguments(BOOL to begin) @@ -77,7 +74,8 @@ public open class BoxContainer : Container() { id: Long, ) { /** - * The child controls will be arranged at the beginning of the container, i.e. top if orientation is vertical, left if orientation is horizontal (right for RTL layout). + * The child controls will be arranged at the beginning of the container, i.e. top if + * orientation is vertical, left if orientation is horizontal (right for RTL layout). */ ALIGNMENT_BEGIN(0), /** @@ -85,7 +83,8 @@ public open class BoxContainer : Container() { */ ALIGNMENT_CENTER(1), /** - * The child controls will be arranged at the end of the container, i.e. bottom if orientation is vertical, right if orientation is horizontal (left for RTL layout). + * The child controls will be arranged at the end of the container, i.e. bottom if orientation + * is vertical, right if orientation is horizontal (left for RTL layout). */ ALIGNMENT_END(2), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/BoxMesh.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/BoxMesh.kt index f20af6918..b35523dd5 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/BoxMesh.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/BoxMesh.kt @@ -23,13 +23,13 @@ import kotlin.Suppress import kotlin.Unit /** - * Generate an axis-aligned box [godot.PrimitiveMesh]. - * - * Generate an axis-aligned box [godot.PrimitiveMesh]. - * - * The box's UV layout is arranged in a 3×2 layout that allows texturing each face individually. To apply the same texture on all faces, change the material's UV property to `Vector3(3, 2, 1)`. This is equivalent to adding `UV *= vec2(3.0, 2.0)` in a vertex shader. - * - * **Note:** When using a large textured [godot.BoxMesh] (e.g. as a floor), you may stumble upon UV jittering issues depending on the camera angle. To solve this, increase [subdivideDepth], [subdivideHeight] and [subdivideWidth] until you no longer notice UV jittering. + * Generate an axis-aligned box [PrimitiveMesh]. + * The box's UV layout is arranged in a 3×2 layout that allows texturing each face individually. To + * apply the same texture on all faces, change the material's UV property to `Vector3(3, 2, 1)`. This + * is equivalent to adding `UV *= vec2(3.0, 2.0)` in a vertex shader. + * **Note:** When using a large textured [BoxMesh] (e.g. as a floor), you may stumble upon UV + * jittering issues depending on the camera angle. To solve this, increase [subdivideDepth], + * [subdivideHeight] and [subdivideWidth] until you no longer notice UV jittering. */ @GodotBaseType public open class BoxMesh : PrimitiveMesh() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/BoxOccluder3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/BoxOccluder3D.kt index f22dc5e15..223d7fd1a 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/BoxOccluder3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/BoxOccluder3D.kt @@ -21,14 +21,8 @@ import kotlin.Suppress import kotlin.Unit /** - * Cuboid shape for use with occlusion culling in [godot.OccluderInstance3D]. - * - * Tutorials: - * [$DOCS_URL/tutorials/3d/occlusion_culling.html]($DOCS_URL/tutorials/3d/occlusion_culling.html) - * - * [godot.BoxOccluder3D] stores a cuboid shape that can be used by the engine's occlusion culling system. - * - * See [godot.OccluderInstance3D]'s documentation for instructions on setting up occlusion culling. + * [BoxOccluder3D] stores a cuboid shape that can be used by the engine's occlusion culling system. + * See [OccluderInstance3D]'s documentation for instructions on setting up occlusion culling. */ @GodotBaseType public open class BoxOccluder3D : Occluder3D() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/BoxShape3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/BoxShape3D.kt index f1a5b5360..9e69f09a6 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/BoxShape3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/BoxShape3D.kt @@ -21,14 +21,10 @@ import kotlin.Suppress import kotlin.Unit /** - * A 3D box shape used for physics collision. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/125](https://godotengine.org/asset-library/asset/125) - * - * A 3D box shape, intended for use in physics. Usually used to provide a shape for a [godot.CollisionShape3D]. - * - * **Performance:** [godot.BoxShape3D] is fast to check collisions against. It is faster than [godot.CapsuleShape3D] and [godot.CylinderShape3D], but slower than [godot.SphereShape3D]. + * A 3D box shape, intended for use in physics. Usually used to provide a shape for a + * [CollisionShape3D]. + * **Performance:** [BoxShape3D] is fast to check collisions against. It is faster than + * [CapsuleShape3D] and [CylinderShape3D], but slower than [SphereShape3D]. */ @GodotBaseType public open class BoxShape3D : Shape3D() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Button.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Button.kt index d76a802b6..85ef8fe6a 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Button.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Button.kt @@ -22,70 +22,41 @@ import kotlin.String import kotlin.Suppress /** - * A themed button that can contain text and an icon. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/677](https://godotengine.org/asset-library/asset/677) - * - * [godot.Button] is the standard themed button. It can contain text and an icon, and it will display them according to the current [godot.Theme]. - * + * [Button] is the standard themed button. It can contain text and an icon, and it will display them + * according to the current [Theme]. * **Example of creating a button and assigning an action when pressed by code:** * - * [codeblocks] - * - * [gdscript] - * + * gdscript: + * ```gdscript * func _ready(): - * * var button = Button.new() - * * button.text = "Click me" - * * button.pressed.connect(self._button_pressed) - * * add_child(button) * - * - * * func _button_pressed(): - * * print("Hello world!") - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * public override void _Ready() - * * { - * * var button = new Button(); - * * button.Text = "Click me"; - * * button.Pressed += ButtonPressed; - * * AddChild(button); - * * } * - * - * * private void ButtonPressed() - * * { - * * GD.Print("Hello world!"); - * * } + * ``` * - * [/csharp] - * - * [/codeblocks] - * - * See also [godot.BaseButton] which contains common properties and methods associated with this node. - * - * **Note:** Buttons do not interpret touch input and therefore don't support multitouch, since mouse emulation can only press one button at a given time. Use [godot.TouchScreenButton] for buttons that trigger gameplay movement or actions. + * See also [BaseButton] which contains common properties and methods associated with this node. + * **Note:** Buttons do not interpret touch input and therefore don't support multitouch, since + * mouse emulation can only press one button at a given time. Use [TouchScreenButton] for buttons that + * trigger gameplay movement or actions. */ @GodotBaseType public open class Button : BaseButton() { @@ -105,8 +76,8 @@ public open class Button : BaseButton() { /** * Button's icon, if text is present the icon will be placed before the text. - * - * To edit margin and spacing of the icon, use [theme_item h_separation] theme property and `content_margin_*` properties of the used [godot.StyleBox]es. + * To edit margin and spacing of the icon, use [theme_item h_separation] theme property and + * `content_margin_*` properties of the used [StyleBox]es. */ public var icon: Texture2D? get() { @@ -134,7 +105,8 @@ public open class Button : BaseButton() { } /** - * Text alignment policy for the button's text, use one of the [enum HorizontalAlignment] constants. + * Text alignment policy for the button's text, use one of the [enum HorizontalAlignment] + * constants. */ public var alignment: HorizontalAlignment get() { @@ -148,7 +120,8 @@ public open class Button : BaseButton() { } /** - * Sets the clipping behavior when the text exceeds the node's bounding rectangle. See [enum TextServer.OverrunBehavior] for a description of all modes. + * Sets the clipping behavior when the text exceeds the node's bounding rectangle. See [enum + * TextServer.OverrunBehavior] for a description of all modes. */ public var textOverrunBehavior: TextServer.OverrunBehavior get() { @@ -162,7 +135,8 @@ public open class Button : BaseButton() { } /** - * When this property is enabled, text that is too large to fit the button is clipped, when disabled the Button will always be wide enough to hold the text. + * When this property is enabled, text that is too large to fit the button is clipped, when + * disabled the Button will always be wide enough to hold the text. */ public var clipText: Boolean get() { @@ -176,7 +150,9 @@ public open class Button : BaseButton() { } /** - * Specifies if the icon should be aligned horizontally to the left, right, or center of a button. Uses the same [enum HorizontalAlignment] constants as the text alignment. If centered horizontally and vertically, text will draw on top of the icon. + * Specifies if the icon should be aligned horizontally to the left, right, or center of a button. + * Uses the same [enum HorizontalAlignment] constants as the text alignment. If centered horizontally + * and vertically, text will draw on top of the icon. */ public var iconAlignment: HorizontalAlignment get() { @@ -190,7 +166,9 @@ public open class Button : BaseButton() { } /** - * Specifies if the icon should be aligned vertically to the top, bottom, or center of a button. Uses the same [enum VerticalAlignment] constants as the text alignment. If centered horizontally and vertically, text will draw on top of the icon. + * Specifies if the icon should be aligned vertically to the top, bottom, or center of a button. + * Uses the same [enum VerticalAlignment] constants as the text alignment. If centered horizontally + * and vertically, text will draw on top of the icon. */ public var verticalIconAlignment: VerticalAlignment get() { @@ -204,7 +182,8 @@ public open class Button : BaseButton() { } /** - * When enabled, the button's icon will expand/shrink to fit the button's size while keeping its aspect. See also [theme_item icon_max_width]. + * When enabled, the button's icon will expand/shrink to fit the button's size while keeping its + * aspect. See also [theme_item icon_max_width]. */ public var expandIcon: Boolean get() { @@ -232,7 +211,8 @@ public open class Button : BaseButton() { } /** - * Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead. + * Language code used for line-breaking and text shaping algorithms, if left empty current locale + * is used instead. */ public var language: String get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ButtonGroup.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ButtonGroup.kt index e4719e86a..40c97d5c7 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ButtonGroup.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ButtonGroup.kt @@ -22,11 +22,10 @@ import kotlin.Int import kotlin.Suppress /** - * A group of buttons that doesn't allow more than one button to be pressed at a time. - * - * A group of [godot.BaseButton]-derived buttons. The buttons in a [godot.ButtonGroup] are treated like radio buttons: No more than one button can be pressed at a time. Some types of buttons (such as [godot.CheckBox]) may have a special appearance in this state. - * - * Every member of a [godot.ButtonGroup] should have [godot.BaseButton.toggleMode] set to `true`. + * A group of [BaseButton]-derived buttons. The buttons in a [ButtonGroup] are treated like radio + * buttons: No more than one button can be pressed at a time. Some types of buttons (such as + * [CheckBox]) may have a special appearance in this state. + * Every member of a [ButtonGroup] should have [BaseButton.toggleMode] set to `true`. */ @GodotBaseType public open class ButtonGroup : Resource() { @@ -36,7 +35,7 @@ public open class ButtonGroup : Resource() { public val pressed: Signal1 by signal("button") /** - * If `true`, it is possible to unpress all buttons in this [godot.ButtonGroup]. + * If `true`, it is possible to unpress all buttons in this [ButtonGroup]. */ public var allowUnpress: Boolean get() { @@ -64,7 +63,8 @@ public open class ButtonGroup : Resource() { } /** - * Returns an [godot.Array] of [godot.Button]s who have this as their [godot.ButtonGroup] (see [godot.BaseButton.buttonGroup]). + * Returns an [Array] of [Button]s who have this as their [ButtonGroup] (see + * [BaseButton.buttonGroup]). */ public fun getButtons(): VariantArray { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CPUParticles2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CPUParticles2D.kt index 55d4b8169..b532471cb 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CPUParticles2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CPUParticles2D.kt @@ -36,24 +36,23 @@ import kotlin.Suppress import kotlin.Unit /** - * A CPU-based 2D particle emitter. - * - * Tutorials: - * [$DOCS_URL/tutorials/2d/particle_systems_2d.html]($DOCS_URL/tutorials/2d/particle_systems_2d.html) - * * CPU-based 2D particle node used to create a variety of particle systems and effects. - * - * See also [godot.GPUParticles2D], which provides the same functionality with hardware acceleration, but may not run on older devices. + * See also [GPUParticles2D], which provides the same functionality with hardware acceleration, but + * may not run on older devices. */ @GodotBaseType public open class CPUParticles2D : Node2D() { /** - * Emitted when all active particles have finished processing. When [oneShot] is disabled, particles will process continuously, so this is never emitted. + * Emitted when all active particles have finished processing. When [oneShot] is disabled, + * particles will process continuously, so this is never emitted. */ public val finished: Signal0 by signal() /** - * If `true`, particles are being emitted. [emitting] can be used to start and stop particles from emitting. However, if [oneShot] is `true` setting [emitting] to `true` will not restart the emission cycle until after all active particles finish processing. You can use the [finished] signal to be notified once all active particles finish processing. + * If `true`, particles are being emitted. [emitting] can be used to start and stop particles from + * emitting. However, if [oneShot] is `true` setting [emitting] to `true` will not restart the + * emission cycle until after all active particles finish processing. You can use the [signal + * finished] signal to be notified once all active particles finish processing. */ public var emitting: Boolean get() { @@ -95,7 +94,8 @@ public open class CPUParticles2D : Node2D() { } /** - * If `true`, only one emission cycle occurs. If set `true` during a cycle, emission will stop at the cycle's end. + * If `true`, only one emission cycle occurs. If set `true` during a cycle, emission will stop at + * the cycle's end. */ public var oneShot: Boolean get() { @@ -123,7 +123,8 @@ public open class CPUParticles2D : Node2D() { } /** - * Particle system's running speed scaling ratio. A value of `0` can be used to pause the particles. + * Particle system's running speed scaling ratio. A value of `0` can be used to pause the + * particles. */ public var speedScale: Double get() { @@ -137,7 +138,8 @@ public open class CPUParticles2D : Node2D() { } /** - * How rapidly particles in an emission cycle are emitted. If greater than `0`, there will be a gap in emissions before the next cycle begins. + * How rapidly particles in an emission cycle are emitted. If greater than `0`, there will be a + * gap in emissions before the next cycle begins. */ public var explosiveness: Float get() { @@ -179,7 +181,9 @@ public open class CPUParticles2D : Node2D() { } /** - * The particle system's frame rate is fixed to a value. For example, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the simulation of the particle system itself. + * The particle system's frame rate is fixed to a value. For example, changing the value to 2 will + * make the particles render at 2 frames per second. Note this does not slow down the simulation of + * the particle system itself. */ public var fixedFps: Int get() { @@ -193,7 +197,8 @@ public open class CPUParticles2D : Node2D() { } /** - * If `true`, results in fractional delta calculation which has a smoother particles display effect. + * If `true`, results in fractional delta calculation which has a smoother particles display + * effect. */ public var fractDelta: Boolean get() { @@ -207,7 +212,10 @@ public open class CPUParticles2D : Node2D() { } /** - * If `true`, particles use the parent node's coordinate space (known as local coordinates). This will cause particles to move and rotate along the [godot.CPUParticles2D] node (and its parents) when it is moved or rotated. If `false`, particles use global coordinates; they will not move or rotate along the [godot.CPUParticles2D] node (and its parents) when it is moved or rotated. + * If `true`, particles use the parent node's coordinate space (known as local coordinates). This + * will cause particles to move and rotate along the [CPUParticles2D] node (and its parents) when it + * is moved or rotated. If `false`, particles use global coordinates; they will not move or rotate + * along the [CPUParticles2D] node (and its parents) when it is moved or rotated. */ public var localCoords: Boolean get() { @@ -263,7 +271,7 @@ public open class CPUParticles2D : Node2D() { } /** - * The sphere's radius if [emissionShape] is set to [EMISSION_SHAPE_SPHERE]. + * The sphere's radius if [emissionShape] is set to [constant EMISSION_SHAPE_SPHERE]. */ public var emissionSphereRadius: Float get() { @@ -277,7 +285,7 @@ public open class CPUParticles2D : Node2D() { } /** - * The rectangle's extents if [emissionShape] is set to [EMISSION_SHAPE_RECTANGLE]. + * The rectangle's extents if [emissionShape] is set to [constant EMISSION_SHAPE_RECTANGLE]. */ @CoreTypeLocalCopy public var emissionRectExtents: Vector2 @@ -292,7 +300,8 @@ public open class CPUParticles2D : Node2D() { } /** - * Sets the initial positions to spawn particles when using [EMISSION_SHAPE_POINTS] or [EMISSION_SHAPE_DIRECTED_POINTS]. + * Sets the initial positions to spawn particles when using [constant EMISSION_SHAPE_POINTS] or + * [constant EMISSION_SHAPE_DIRECTED_POINTS]. */ public var emissionPoints: PackedVector2Array get() { @@ -306,7 +315,8 @@ public open class CPUParticles2D : Node2D() { } /** - * Sets the direction the particles will be emitted in when using [EMISSION_SHAPE_DIRECTED_POINTS]. + * Sets the direction the particles will be emitted in when using [constant + * EMISSION_SHAPE_DIRECTED_POINTS]. */ public var emissionNormals: PackedVector2Array get() { @@ -320,7 +330,8 @@ public open class CPUParticles2D : Node2D() { } /** - * Sets the [godot.core.Color]s to modulate particles by when using [EMISSION_SHAPE_POINTS] or [EMISSION_SHAPE_DIRECTED_POINTS]. + * Sets the [Color]s to modulate particles by when using [constant EMISSION_SHAPE_POINTS] or + * [constant EMISSION_SHAPE_DIRECTED_POINTS]. */ public var emissionColors: PackedColorArray get() { @@ -406,7 +417,8 @@ public open class CPUParticles2D : Node2D() { } /** - * Maximum initial velocity magnitude for each particle. Direction comes from [direction] and [spread]. + * Maximum initial velocity magnitude for each particle. Direction comes from [direction] and + * [spread]. */ public var initialVelocityMax: Float get() { @@ -434,7 +446,8 @@ public open class CPUParticles2D : Node2D() { } /** - * Maximum initial angular velocity (rotation speed) applied to each particle in *degrees* per second. + * Maximum initial angular velocity (rotation speed) applied to each particle in *degrees* per + * second. */ public var angularVelocityMax: Float get() { @@ -448,7 +461,7 @@ public open class CPUParticles2D : Node2D() { } /** - * Each particle's angular velocity will vary along this [godot.Curve]. + * Each particle's angular velocity will vary along this [Curve]. */ public var angularVelocityCurve: Curve? get() { @@ -476,7 +489,8 @@ public open class CPUParticles2D : Node2D() { } /** - * Maximum orbital velocity applied to each particle. Makes the particles circle around origin. Specified in number of full rotations around origin per second. + * Maximum orbital velocity applied to each particle. Makes the particles circle around origin. + * Specified in number of full rotations around origin per second. */ public var orbitVelocityMax: Float get() { @@ -490,7 +504,7 @@ public open class CPUParticles2D : Node2D() { } /** - * Each particle's orbital velocity will vary along this [godot.Curve]. + * Each particle's orbital velocity will vary along this [Curve]. */ public var orbitVelocityCurve: Curve? get() { @@ -532,7 +546,7 @@ public open class CPUParticles2D : Node2D() { } /** - * Each particle's linear acceleration will vary along this [godot.Curve]. + * Each particle's linear acceleration will vary along this [Curve]. */ public var linearAccelCurve: Curve? get() { @@ -560,7 +574,8 @@ public open class CPUParticles2D : Node2D() { } /** - * Maximum radial acceleration applied to each particle. Makes particle accelerate away from the origin or towards it if negative. + * Maximum radial acceleration applied to each particle. Makes particle accelerate away from the + * origin or towards it if negative. */ public var radialAccelMax: Float get() { @@ -574,7 +589,7 @@ public open class CPUParticles2D : Node2D() { } /** - * Each particle's radial acceleration will vary along this [godot.Curve]. + * Each particle's radial acceleration will vary along this [Curve]. */ public var radialAccelCurve: Curve? get() { @@ -602,7 +617,8 @@ public open class CPUParticles2D : Node2D() { } /** - * Maximum tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion. + * Maximum tangential acceleration applied to each particle. Tangential acceleration is + * perpendicular to the particle's velocity giving the particles a swirling motion. */ public var tangentialAccelMax: Float get() { @@ -616,7 +632,7 @@ public open class CPUParticles2D : Node2D() { } /** - * Each particle's tangential acceleration will vary along this [godot.Curve]. + * Each particle's tangential acceleration will vary along this [Curve]. */ public var tangentialAccelCurve: Curve? get() { @@ -644,7 +660,8 @@ public open class CPUParticles2D : Node2D() { } /** - * The maximum rate at which particles lose velocity. For example value of `100` means that the particle will go from `100` velocity to `0` in `1` second. + * The maximum rate at which particles lose velocity. For example value of `100` means that the + * particle will go from `100` velocity to `0` in `1` second. */ public var dampingMax: Float get() { @@ -658,7 +675,7 @@ public open class CPUParticles2D : Node2D() { } /** - * Damping will vary along this [godot.Curve]. + * Damping will vary along this [Curve]. */ public var dampingCurve: Curve? get() { @@ -700,7 +717,7 @@ public open class CPUParticles2D : Node2D() { } /** - * Each particle's rotation will be animated along this [godot.Curve]. + * Each particle's rotation will be animated along this [Curve]. */ public var angleCurve: Curve? get() { @@ -742,7 +759,7 @@ public open class CPUParticles2D : Node2D() { } /** - * Each particle's scale will vary along this [godot.Curve]. + * Each particle's scale will vary along this [Curve]. */ public var scaleAmountCurve: Curve? get() { @@ -756,7 +773,8 @@ public open class CPUParticles2D : Node2D() { } /** - * If `true`, the scale curve will be split into x and y components. See [scaleCurveX] and [scaleCurveY]. + * If `true`, the scale curve will be split into x and y components. See [scaleCurveX] and + * [scaleCurveY]. */ public var splitScale: Boolean get() { @@ -770,8 +788,7 @@ public open class CPUParticles2D : Node2D() { } /** - * Each particle's horizontal scale will vary along this [godot.Curve]. - * + * Each particle's horizontal scale will vary along this [Curve]. * [splitScale] must be enabled. */ public var scaleCurveX: Curve? @@ -786,8 +803,7 @@ public open class CPUParticles2D : Node2D() { } /** - * Each particle's vertical scale will vary along this [godot.Curve]. - * + * Each particle's vertical scale will vary along this [Curve]. * [splitScale] must be enabled. */ public var scaleCurveY: Curve? @@ -817,7 +833,7 @@ public open class CPUParticles2D : Node2D() { } /** - * Each particle's color will vary along this [godot.Gradient] (multiplied with [color]). + * Each particle's color will vary along this [Gradient] (multiplied with [color]). */ public var colorRamp: Gradient? get() { @@ -831,7 +847,8 @@ public open class CPUParticles2D : Node2D() { } /** - * Each particle's initial color will vary along this [godot.GradientTexture1D] (multiplied with [color]). + * Each particle's initial color will vary along this [GradientTexture1D] (multiplied with + * [color]). */ public var colorInitialRamp: Gradient? get() { @@ -873,7 +890,7 @@ public open class CPUParticles2D : Node2D() { } /** - * Each particle's hue will vary along this [godot.Curve]. + * Each particle's hue will vary along this [Curve]. */ public var hueVariationCurve: Curve? get() { @@ -901,9 +918,10 @@ public open class CPUParticles2D : Node2D() { } /** - * Maximum particle animation speed. Animation speed of `1` means that the particles will make full `0` to `1` offset cycle during lifetime, `2` means `2` cycles etc. - * - * With animation speed greater than `1`, remember to enable [godot.CanvasItemMaterial.particlesAnimLoop] property if you want the animation to repeat. + * Maximum particle animation speed. Animation speed of `1` means that the particles will make + * full `0` to `1` offset cycle during lifetime, `2` means `2` cycles etc. + * With animation speed greater than `1`, remember to enable + * [CanvasItemMaterial.particlesAnimLoop] property if you want the animation to repeat. */ public var animSpeedMax: Float get() { @@ -917,7 +935,7 @@ public open class CPUParticles2D : Node2D() { } /** - * Each particle's animation speed will vary along this [godot.Curve]. + * Each particle's animation speed will vary along this [Curve]. */ public var animSpeedCurve: Curve? get() { @@ -945,7 +963,8 @@ public open class CPUParticles2D : Node2D() { } /** - * Maximum animation offset that corresponds to frame index in the texture. `0` is the first frame, `1` is the last one. See [godot.CanvasItemMaterial.particlesAnimation]. + * Maximum animation offset that corresponds to frame index in the texture. `0` is the first + * frame, `1` is the last one. See [CanvasItemMaterial.particlesAnimation]. */ public var animOffsetMax: Float get() { @@ -959,7 +978,7 @@ public open class CPUParticles2D : Node2D() { } /** - * Each particle's animation offset will vary along this [godot.Curve]. + * Each particle's animation offset will vary along this [Curve]. */ public var animOffsetCurve: Curve? get() { @@ -978,7 +997,7 @@ public open class CPUParticles2D : Node2D() { } /** - * The rectangle's extents if [emissionShape] is set to [EMISSION_SHAPE_RECTANGLE]. + * The rectangle's extents if [emissionShape] is set to [constant EMISSION_SHAPE_RECTANGLE]. * * This is a helper function to make dealing with local copies easier. * @@ -1083,7 +1102,8 @@ public open class CPUParticles2D : Node2D() { } /** - * Sets this node's properties to match a given [godot.GPUParticles2D] node with an assigned [godot.ParticleProcessMaterial]. + * Sets this node's properties to match a given [GPUParticles2D] node with an assigned + * [ParticleProcessMaterial]. */ public fun convertFromParticles(particles: Node): Unit { TransferContext.writeArguments(OBJECT to particles) @@ -1117,27 +1137,33 @@ public open class CPUParticles2D : Node2D() { id: Long, ) { /** - * Use with [setParamMin], [setParamMax], and [setParamCurve] to set initial velocity properties. + * Use with [setParamMin], [setParamMax], and [setParamCurve] to set initial velocity + * properties. */ PARAM_INITIAL_LINEAR_VELOCITY(0), /** - * Use with [setParamMin], [setParamMax], and [setParamCurve] to set angular velocity properties. + * Use with [setParamMin], [setParamMax], and [setParamCurve] to set angular velocity + * properties. */ PARAM_ANGULAR_VELOCITY(1), /** - * Use with [setParamMin], [setParamMax], and [setParamCurve] to set orbital velocity properties. + * Use with [setParamMin], [setParamMax], and [setParamCurve] to set orbital velocity + * properties. */ PARAM_ORBIT_VELOCITY(2), /** - * Use with [setParamMin], [setParamMax], and [setParamCurve] to set linear acceleration properties. + * Use with [setParamMin], [setParamMax], and [setParamCurve] to set linear acceleration + * properties. */ PARAM_LINEAR_ACCEL(3), /** - * Use with [setParamMin], [setParamMax], and [setParamCurve] to set radial acceleration properties. + * Use with [setParamMin], [setParamMax], and [setParamCurve] to set radial acceleration + * properties. */ PARAM_RADIAL_ACCEL(4), /** - * Use with [setParamMin], [setParamMax], and [setParamCurve] to set tangential acceleration properties. + * Use with [setParamMin], [setParamMax], and [setParamCurve] to set tangential acceleration + * properties. */ PARAM_TANGENTIAL_ACCEL(5), /** @@ -1161,7 +1187,8 @@ public open class CPUParticles2D : Node2D() { */ PARAM_ANIM_SPEED(10), /** - * Use with [setParamMin], [setParamMax], and [setParamCurve] to set animation offset properties. + * Use with [setParamMin], [setParamMax], and [setParamCurve] to set animation offset + * properties. */ PARAM_ANIM_OFFSET(11), /** @@ -1231,11 +1258,14 @@ public open class CPUParticles2D : Node2D() { */ EMISSION_SHAPE_RECTANGLE(3), /** - * Particles will be emitted at a position chosen randomly among [emissionPoints]. Particle color will be modulated by [emissionColors]. + * Particles will be emitted at a position chosen randomly among [emissionPoints]. Particle + * color will be modulated by [emissionColors]. */ EMISSION_SHAPE_POINTS(4), /** - * Particles will be emitted at a position chosen randomly among [emissionPoints]. Particle velocity and rotation will be set based on [emissionNormals]. Particle color will be modulated by [emissionColors]. + * Particles will be emitted at a position chosen randomly among [emissionPoints]. Particle + * velocity and rotation will be set based on [emissionNormals]. Particle color will be modulated + * by [emissionColors]. */ EMISSION_SHAPE_DIRECTED_POINTS(5), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CPUParticles3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CPUParticles3D.kt index 5ae4009f9..d66b4205e 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CPUParticles3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CPUParticles3D.kt @@ -36,24 +36,23 @@ import kotlin.Suppress import kotlin.Unit /** - * A CPU-based 3D particle emitter. - * - * Tutorials: - * [$DOCS_URL/tutorials/3d/particles/index.html]($DOCS_URL/tutorials/3d/particles/index.html) - * * CPU-based 3D particle node used to create a variety of particle systems and effects. - * - * See also [godot.GPUParticles3D], which provides the same functionality with hardware acceleration, but may not run on older devices. + * See also [GPUParticles3D], which provides the same functionality with hardware acceleration, but + * may not run on older devices. */ @GodotBaseType public open class CPUParticles3D : GeometryInstance3D() { /** - * Emitted when all active particles have finished processing. When [oneShot] is disabled, particles will process continuously, so this is never emitted. + * Emitted when all active particles have finished processing. When [oneShot] is disabled, + * particles will process continuously, so this is never emitted. */ public val finished: Signal0 by signal() /** - * If `true`, particles are being emitted. [emitting] can be used to start and stop particles from emitting. However, if [oneShot] is `true` setting [emitting] to `true` will not restart the emission cycle until after all active particles finish processing. You can use the [finished] signal to be notified once all active particles finish processing. + * If `true`, particles are being emitted. [emitting] can be used to start and stop particles from + * emitting. However, if [oneShot] is `true` setting [emitting] to `true` will not restart the + * emission cycle until after all active particles finish processing. You can use the [signal + * finished] signal to be notified once all active particles finish processing. */ public var emitting: Boolean get() { @@ -95,7 +94,8 @@ public open class CPUParticles3D : GeometryInstance3D() { } /** - * If `true`, only one emission cycle occurs. If set `true` during a cycle, emission will stop at the cycle's end. + * If `true`, only one emission cycle occurs. If set `true` during a cycle, emission will stop at + * the cycle's end. */ public var oneShot: Boolean get() { @@ -123,7 +123,8 @@ public open class CPUParticles3D : GeometryInstance3D() { } /** - * Particle system's running speed scaling ratio. A value of `0` can be used to pause the particles. + * Particle system's running speed scaling ratio. A value of `0` can be used to pause the + * particles. */ public var speedScale: Double get() { @@ -137,7 +138,8 @@ public open class CPUParticles3D : GeometryInstance3D() { } /** - * How rapidly particles in an emission cycle are emitted. If greater than `0`, there will be a gap in emissions before the next cycle begins. + * How rapidly particles in an emission cycle are emitted. If greater than `0`, there will be a + * gap in emissions before the next cycle begins. */ public var explosiveness: Float get() { @@ -179,7 +181,9 @@ public open class CPUParticles3D : GeometryInstance3D() { } /** - * The particle system's frame rate is fixed to a value. For example, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the particle system itself. + * The particle system's frame rate is fixed to a value. For example, changing the value to 2 will + * make the particles render at 2 frames per second. Note this does not slow down the particle system + * itself. */ public var fixedFps: Int get() { @@ -193,7 +197,8 @@ public open class CPUParticles3D : GeometryInstance3D() { } /** - * If `true`, results in fractional delta calculation which has a smoother particles display effect. + * If `true`, results in fractional delta calculation which has a smoother particles display + * effect. */ public var fractDelta: Boolean get() { @@ -207,7 +212,10 @@ public open class CPUParticles3D : GeometryInstance3D() { } /** - * If `true`, particles use the parent node's coordinate space (known as local coordinates). This will cause particles to move and rotate along the [godot.CPUParticles3D] node (and its parents) when it is moved or rotated. If `false`, particles use global coordinates; they will not move or rotate along the [godot.CPUParticles3D] node (and its parents) when it is moved or rotated. + * If `true`, particles use the parent node's coordinate space (known as local coordinates). This + * will cause particles to move and rotate along the [CPUParticles3D] node (and its parents) when it + * is moved or rotated. If `false`, particles use global coordinates; they will not move or rotate + * along the [CPUParticles3D] node (and its parents) when it is moved or rotated. */ public var localCoords: Boolean get() { @@ -235,7 +243,7 @@ public open class CPUParticles3D : GeometryInstance3D() { } /** - * The [godot.Mesh] used for each particle. If `null`, particles will be spheres. + * The [Mesh] used for each particle. If `null`, particles will be spheres. */ public var mesh: Mesh? get() { @@ -263,7 +271,7 @@ public open class CPUParticles3D : GeometryInstance3D() { } /** - * The sphere's radius if [enum EmissionShape] is set to [EMISSION_SHAPE_SPHERE]. + * The sphere's radius if [enum EmissionShape] is set to [constant EMISSION_SHAPE_SPHERE]. */ public var emissionSphereRadius: Float get() { @@ -277,7 +285,7 @@ public open class CPUParticles3D : GeometryInstance3D() { } /** - * The rectangle's extents if [emissionShape] is set to [EMISSION_SHAPE_BOX]. + * The rectangle's extents if [emissionShape] is set to [constant EMISSION_SHAPE_BOX]. */ @CoreTypeLocalCopy public var emissionBoxExtents: Vector3 @@ -292,7 +300,8 @@ public open class CPUParticles3D : GeometryInstance3D() { } /** - * Sets the initial positions to spawn particles when using [EMISSION_SHAPE_POINTS] or [EMISSION_SHAPE_DIRECTED_POINTS]. + * Sets the initial positions to spawn particles when using [constant EMISSION_SHAPE_POINTS] or + * [constant EMISSION_SHAPE_DIRECTED_POINTS]. */ public var emissionPoints: PackedVector3Array get() { @@ -306,7 +315,8 @@ public open class CPUParticles3D : GeometryInstance3D() { } /** - * Sets the direction the particles will be emitted in when using [EMISSION_SHAPE_DIRECTED_POINTS]. + * Sets the direction the particles will be emitted in when using [constant + * EMISSION_SHAPE_DIRECTED_POINTS]. */ public var emissionNormals: PackedVector3Array get() { @@ -320,9 +330,12 @@ public open class CPUParticles3D : GeometryInstance3D() { } /** - * Sets the [godot.core.Color]s to modulate particles by when using [EMISSION_SHAPE_POINTS] or [EMISSION_SHAPE_DIRECTED_POINTS]. - * - * **Note:** [emissionColors] multiplies the particle mesh's vertex colors. To have a visible effect on a [godot.BaseMaterial3D], [godot.BaseMaterial3D.vertexColorUseAsAlbedo] *must* be `true`. For a [godot.ShaderMaterial], `ALBEDO *= COLOR.rgb;` must be inserted in the shader's `fragment()` function. Otherwise, [emissionColors] will have no visible effect. + * Sets the [Color]s to modulate particles by when using [constant EMISSION_SHAPE_POINTS] or + * [constant EMISSION_SHAPE_DIRECTED_POINTS]. + * **Note:** [emissionColors] multiplies the particle mesh's vertex colors. To have a visible + * effect on a [BaseMaterial3D], [BaseMaterial3D.vertexColorUseAsAlbedo] *must* be `true`. For a + * [ShaderMaterial], `ALBEDO *= COLOR.rgb;` must be inserted in the shader's `fragment()` function. + * Otherwise, [emissionColors] will have no visible effect. */ public var emissionColors: PackedColorArray get() { @@ -336,7 +349,7 @@ public open class CPUParticles3D : GeometryInstance3D() { } /** - * The axis of the ring when using the emitter [EMISSION_SHAPE_RING]. + * The axis of the ring when using the emitter [constant EMISSION_SHAPE_RING]. */ @CoreTypeLocalCopy public var emissionRingAxis: Vector3 @@ -351,7 +364,7 @@ public open class CPUParticles3D : GeometryInstance3D() { } /** - * The height of the ring when using the emitter [EMISSION_SHAPE_RING]. + * The height of the ring when using the emitter [constant EMISSION_SHAPE_RING]. */ public var emissionRingHeight: Float get() { @@ -365,7 +378,7 @@ public open class CPUParticles3D : GeometryInstance3D() { } /** - * The radius of the ring when using the emitter [EMISSION_SHAPE_RING]. + * The radius of the ring when using the emitter [constant EMISSION_SHAPE_RING]. */ public var emissionRingRadius: Float get() { @@ -379,7 +392,7 @@ public open class CPUParticles3D : GeometryInstance3D() { } /** - * The inner radius of the ring when using the emitter [EMISSION_SHAPE_RING]. + * The inner radius of the ring when using the emitter [constant EMISSION_SHAPE_RING]. */ public var emissionRingInnerRadius: Float get() { @@ -450,7 +463,8 @@ public open class CPUParticles3D : GeometryInstance3D() { } /** - * Each particle's initial direction range from `+spread` to `-spread` degrees. Applied to X/Z plane and Y/Z planes. + * Each particle's initial direction range from `+spread` to `-spread` degrees. Applied to X/Z + * plane and Y/Z planes. */ public var spread: Float get() { @@ -521,7 +535,8 @@ public open class CPUParticles3D : GeometryInstance3D() { } /** - * Minimum initial angular velocity (rotation speed) applied to each particle in *degrees* per second. + * Minimum initial angular velocity (rotation speed) applied to each particle in *degrees* per + * second. */ public var angularVelocityMin: Float get() { @@ -535,7 +550,8 @@ public open class CPUParticles3D : GeometryInstance3D() { } /** - * Maximum initial angular velocity (rotation speed) applied to each particle in *degrees* per second. + * Maximum initial angular velocity (rotation speed) applied to each particle in *degrees* per + * second. */ public var angularVelocityMax: Float get() { @@ -549,7 +565,8 @@ public open class CPUParticles3D : GeometryInstance3D() { } /** - * Each particle's angular velocity (rotation speed) will vary along this [godot.Curve] over its lifetime. + * Each particle's angular velocity (rotation speed) will vary along this [Curve] over its + * lifetime. */ public var angularVelocityCurve: Curve? get() { @@ -591,7 +608,7 @@ public open class CPUParticles3D : GeometryInstance3D() { } /** - * Each particle's orbital velocity will vary along this [godot.Curve]. + * Each particle's orbital velocity will vary along this [Curve]. */ public var orbitVelocityCurve: Curve? get() { @@ -633,7 +650,7 @@ public open class CPUParticles3D : GeometryInstance3D() { } /** - * Each particle's linear acceleration will vary along this [godot.Curve]. + * Each particle's linear acceleration will vary along this [Curve]. */ public var linearAccelCurve: Curve? get() { @@ -675,7 +692,7 @@ public open class CPUParticles3D : GeometryInstance3D() { } /** - * Each particle's radial acceleration will vary along this [godot.Curve]. + * Each particle's radial acceleration will vary along this [Curve]. */ public var radialAccelCurve: Curve? get() { @@ -717,7 +734,7 @@ public open class CPUParticles3D : GeometryInstance3D() { } /** - * Each particle's tangential acceleration will vary along this [godot.Curve]. + * Each particle's tangential acceleration will vary along this [Curve]. */ public var tangentialAccelCurve: Curve? get() { @@ -759,7 +776,7 @@ public open class CPUParticles3D : GeometryInstance3D() { } /** - * Damping will vary along this [godot.Curve]. + * Damping will vary along this [Curve]. */ public var dampingCurve: Curve? get() { @@ -801,7 +818,7 @@ public open class CPUParticles3D : GeometryInstance3D() { } /** - * Each particle's rotation will be animated along this [godot.Curve]. + * Each particle's rotation will be animated along this [Curve]. */ public var angleCurve: Curve? get() { @@ -843,7 +860,7 @@ public open class CPUParticles3D : GeometryInstance3D() { } /** - * Each particle's scale will vary along this [godot.Curve]. + * Each particle's scale will vary along this [Curve]. */ public var scaleAmountCurve: Curve? get() { @@ -914,8 +931,10 @@ public open class CPUParticles3D : GeometryInstance3D() { /** * Each particle's initial color. - * - * **Note:** [color] multiplies the particle mesh's vertex colors. To have a visible effect on a [godot.BaseMaterial3D], [godot.BaseMaterial3D.vertexColorUseAsAlbedo] *must* be `true`. For a [godot.ShaderMaterial], `ALBEDO *= COLOR.rgb;` must be inserted in the shader's `fragment()` function. Otherwise, [color] will have no visible effect. + * **Note:** [color] multiplies the particle mesh's vertex colors. To have a visible effect on a + * [BaseMaterial3D], [BaseMaterial3D.vertexColorUseAsAlbedo] *must* be `true`. For a + * [ShaderMaterial], `ALBEDO *= COLOR.rgb;` must be inserted in the shader's `fragment()` function. + * Otherwise, [color] will have no visible effect. */ @CoreTypeLocalCopy public var color: Color @@ -930,9 +949,12 @@ public open class CPUParticles3D : GeometryInstance3D() { } /** - * Each particle's color will vary along this [godot.GradientTexture1D] over its lifetime (multiplied with [color]). - * - * **Note:** [colorRamp] multiplies the particle mesh's vertex colors. To have a visible effect on a [godot.BaseMaterial3D], [godot.BaseMaterial3D.vertexColorUseAsAlbedo] *must* be `true`. For a [godot.ShaderMaterial], `ALBEDO *= COLOR.rgb;` must be inserted in the shader's `fragment()` function. Otherwise, [colorRamp] will have no visible effect. + * Each particle's color will vary along this [GradientTexture1D] over its lifetime (multiplied + * with [color]). + * **Note:** [colorRamp] multiplies the particle mesh's vertex colors. To have a visible effect on + * a [BaseMaterial3D], [BaseMaterial3D.vertexColorUseAsAlbedo] *must* be `true`. For a + * [ShaderMaterial], `ALBEDO *= COLOR.rgb;` must be inserted in the shader's `fragment()` function. + * Otherwise, [colorRamp] will have no visible effect. */ public var colorRamp: Gradient? get() { @@ -946,9 +968,12 @@ public open class CPUParticles3D : GeometryInstance3D() { } /** - * Each particle's initial color will vary along this [godot.GradientTexture1D] (multiplied with [color]). - * - * **Note:** [colorInitialRamp] multiplies the particle mesh's vertex colors. To have a visible effect on a [godot.BaseMaterial3D], [godot.BaseMaterial3D.vertexColorUseAsAlbedo] *must* be `true`. For a [godot.ShaderMaterial], `ALBEDO *= COLOR.rgb;` must be inserted in the shader's `fragment()` function. Otherwise, [colorInitialRamp] will have no visible effect. + * Each particle's initial color will vary along this [GradientTexture1D] (multiplied with + * [color]). + * **Note:** [colorInitialRamp] multiplies the particle mesh's vertex colors. To have a visible + * effect on a [BaseMaterial3D], [BaseMaterial3D.vertexColorUseAsAlbedo] *must* be `true`. For a + * [ShaderMaterial], `ALBEDO *= COLOR.rgb;` must be inserted in the shader's `fragment()` function. + * Otherwise, [colorInitialRamp] will have no visible effect. */ public var colorInitialRamp: Gradient? get() { @@ -990,7 +1015,7 @@ public open class CPUParticles3D : GeometryInstance3D() { } /** - * Each particle's hue will vary along this [godot.Curve]. + * Each particle's hue will vary along this [Curve]. */ public var hueVariationCurve: Curve? get() { @@ -1032,7 +1057,7 @@ public open class CPUParticles3D : GeometryInstance3D() { } /** - * Each particle's animation speed will vary along this [godot.Curve]. + * Each particle's animation speed will vary along this [Curve]. */ public var animSpeedCurve: Curve? get() { @@ -1074,7 +1099,7 @@ public open class CPUParticles3D : GeometryInstance3D() { } /** - * Each particle's animation offset will vary along this [godot.Curve]. + * Each particle's animation offset will vary along this [Curve]. */ public var animOffsetCurve: Curve? get() { @@ -1093,7 +1118,7 @@ public open class CPUParticles3D : GeometryInstance3D() { } /** - * The rectangle's extents if [emissionShape] is set to [EMISSION_SHAPE_BOX]. + * The rectangle's extents if [emissionShape] is set to [constant EMISSION_SHAPE_BOX]. * * This is a helper function to make dealing with local copies easier. * @@ -1118,7 +1143,7 @@ public open class CPUParticles3D : GeometryInstance3D() { /** - * The axis of the ring when using the emitter [EMISSION_SHAPE_RING]. + * The axis of the ring when using the emitter [constant EMISSION_SHAPE_RING]. * * This is a helper function to make dealing with local copies easier. * @@ -1192,8 +1217,10 @@ public open class CPUParticles3D : GeometryInstance3D() { /** * Each particle's initial color. - * - * **Note:** [color] multiplies the particle mesh's vertex colors. To have a visible effect on a [godot.BaseMaterial3D], [godot.BaseMaterial3D.vertexColorUseAsAlbedo] *must* be `true`. For a [godot.ShaderMaterial], `ALBEDO *= COLOR.rgb;` must be inserted in the shader's `fragment()` function. Otherwise, [color] will have no visible effect. + * **Note:** [color] multiplies the particle mesh's vertex colors. To have a visible effect on a + * [BaseMaterial3D], [BaseMaterial3D.vertexColorUseAsAlbedo] *must* be `true`. For a + * [ShaderMaterial], `ALBEDO *= COLOR.rgb;` must be inserted in the shader's `fragment()` function. + * Otherwise, [color] will have no visible effect. * * This is a helper function to make dealing with local copies easier. * @@ -1225,7 +1252,8 @@ public open class CPUParticles3D : GeometryInstance3D() { } /** - * Sets this node's properties to match a given [godot.GPUParticles3D] node with an assigned [godot.ParticleProcessMaterial]. + * Sets this node's properties to match a given [GPUParticles3D] node with an assigned + * [ParticleProcessMaterial]. */ public fun convertFromParticles(particles: Node): Unit { TransferContext.writeArguments(OBJECT to particles) @@ -1263,27 +1291,33 @@ public open class CPUParticles3D : GeometryInstance3D() { id: Long, ) { /** - * Use with [setParamMin], [setParamMax], and [setParamCurve] to set initial velocity properties. + * Use with [setParamMin], [setParamMax], and [setParamCurve] to set initial velocity + * properties. */ PARAM_INITIAL_LINEAR_VELOCITY(0), /** - * Use with [setParamMin], [setParamMax], and [setParamCurve] to set angular velocity properties. + * Use with [setParamMin], [setParamMax], and [setParamCurve] to set angular velocity + * properties. */ PARAM_ANGULAR_VELOCITY(1), /** - * Use with [setParamMin], [setParamMax], and [setParamCurve] to set orbital velocity properties. + * Use with [setParamMin], [setParamMax], and [setParamCurve] to set orbital velocity + * properties. */ PARAM_ORBIT_VELOCITY(2), /** - * Use with [setParamMin], [setParamMax], and [setParamCurve] to set linear acceleration properties. + * Use with [setParamMin], [setParamMax], and [setParamCurve] to set linear acceleration + * properties. */ PARAM_LINEAR_ACCEL(3), /** - * Use with [setParamMin], [setParamMax], and [setParamCurve] to set radial acceleration properties. + * Use with [setParamMin], [setParamMax], and [setParamCurve] to set radial acceleration + * properties. */ PARAM_RADIAL_ACCEL(4), /** - * Use with [setParamMin], [setParamMax], and [setParamCurve] to set tangential acceleration properties. + * Use with [setParamMin], [setParamMax], and [setParamCurve] to set tangential acceleration + * properties. */ PARAM_TANGENTIAL_ACCEL(5), /** @@ -1307,7 +1341,8 @@ public open class CPUParticles3D : GeometryInstance3D() { */ PARAM_ANIM_SPEED(10), /** - * Use with [setParamMin], [setParamMax], and [setParamCurve] to set animation offset properties. + * Use with [setParamMin], [setParamMax], and [setParamCurve] to set animation offset + * properties. */ PARAM_ANIM_OFFSET(11), /** @@ -1377,11 +1412,14 @@ public open class CPUParticles3D : GeometryInstance3D() { */ EMISSION_SHAPE_BOX(3), /** - * Particles will be emitted at a position chosen randomly among [emissionPoints]. Particle color will be modulated by [emissionColors]. + * Particles will be emitted at a position chosen randomly among [emissionPoints]. Particle + * color will be modulated by [emissionColors]. */ EMISSION_SHAPE_POINTS(4), /** - * Particles will be emitted at a position chosen randomly among [emissionPoints]. Particle velocity and rotation will be set based on [emissionNormals]. Particle color will be modulated by [emissionColors]. + * Particles will be emitted at a position chosen randomly among [emissionPoints]. Particle + * velocity and rotation will be set based on [emissionNormals]. Particle color will be modulated + * by [emissionColors]. */ EMISSION_SHAPE_DIRECTED_POINTS(5), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CSGBox3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CSGBox3D.kt index a178db1b5..ef7d7b8e7 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CSGBox3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CSGBox3D.kt @@ -21,8 +21,18 @@ import kotlin.Int import kotlin.Suppress import kotlin.Unit +/** + * This node allows you to create a box for use with the CSG system. + * **Note:** CSG nodes are intended to be used for level prototyping. Creating CSG nodes has a + * significant CPU cost compared to creating a [MeshInstance3D] with a [PrimitiveMesh]. Moving a CSG + * node within another CSG node also has a significant CPU cost, so it should be avoided during + * gameplay. + */ @GodotBaseType public open class CSGBox3D : CSGPrimitive3D() { + /** + * The box's width, height and depth. + */ @CoreTypeLocalCopy public var size: Vector3 get() { @@ -35,6 +45,9 @@ public open class CSGBox3D : CSGPrimitive3D() { TransferContext.callMethod(rawPtr, MethodBindings.setSizePtr, NIL) } + /** + * The material used to render the box. + */ public var material: Material? get() { TransferContext.writeArguments() @@ -52,6 +65,8 @@ public open class CSGBox3D : CSGPrimitive3D() { } /** + * The box's width, height and depth. + * * This is a helper function to make dealing with local copies easier. * * For more information, see our diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CSGCombiner3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CSGCombiner3D.kt index 08804399c..7f57f1b11 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CSGCombiner3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CSGCombiner3D.kt @@ -11,6 +11,18 @@ import kotlin.Boolean import kotlin.Int import kotlin.Suppress +/** + * For complex arrangements of shapes, it is sometimes needed to add structure to your CSG nodes. + * The CSGCombiner3D node allows you to create this structure. The node encapsulates the result of the + * CSG operations of its children. In this way, it is possible to do operations on one set of shapes + * that are children of one CSGCombiner3D node, and a set of separate operations on a second set of + * shapes that are children of a second CSGCombiner3D node, and then do an operation that takes the two + * end results as its input to create the final shape. + * **Note:** CSG nodes are intended to be used for level prototyping. Creating CSG nodes has a + * significant CPU cost compared to creating a [MeshInstance3D] with a [PrimitiveMesh]. Moving a CSG + * node within another CSG node also has a significant CPU cost, so it should be avoided during + * gameplay. + */ @GodotBaseType public open class CSGCombiner3D : CSGShape3D() { public override fun new(scriptIndex: Int): Boolean { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CSGCylinder3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CSGCylinder3D.kt index 908a9d549..902e73592 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CSGCylinder3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CSGCylinder3D.kt @@ -22,8 +22,18 @@ import kotlin.Int import kotlin.Long import kotlin.Suppress +/** + * This node allows you to create a cylinder (or cone) for use with the CSG system. + * **Note:** CSG nodes are intended to be used for level prototyping. Creating CSG nodes has a + * significant CPU cost compared to creating a [MeshInstance3D] with a [PrimitiveMesh]. Moving a CSG + * node within another CSG node also has a significant CPU cost, so it should be avoided during + * gameplay. + */ @GodotBaseType public open class CSGCylinder3D : CSGPrimitive3D() { + /** + * The radius of the cylinder. + */ public var radius: Float get() { TransferContext.writeArguments() @@ -35,6 +45,9 @@ public open class CSGCylinder3D : CSGPrimitive3D() { TransferContext.callMethod(rawPtr, MethodBindings.setRadiusPtr, NIL) } + /** + * The height of the cylinder. + */ public var height: Float get() { TransferContext.writeArguments() @@ -46,6 +59,10 @@ public open class CSGCylinder3D : CSGPrimitive3D() { TransferContext.callMethod(rawPtr, MethodBindings.setHeightPtr, NIL) } + /** + * The number of sides of the cylinder, the higher this number the more detail there will be in + * the cylinder. + */ public var sides: Int get() { TransferContext.writeArguments() @@ -57,6 +74,9 @@ public open class CSGCylinder3D : CSGPrimitive3D() { TransferContext.callMethod(rawPtr, MethodBindings.setSidesPtr, NIL) } + /** + * If `true` a cone is created, the [radius] will only apply to one side. + */ public var cone: Boolean get() { TransferContext.writeArguments() @@ -68,6 +88,10 @@ public open class CSGCylinder3D : CSGPrimitive3D() { TransferContext.callMethod(rawPtr, MethodBindings.setConePtr, NIL) } + /** + * If `true` the normals of the cylinder are set to give a smooth effect making the cylinder seem + * rounded. If `false` the cylinder will have a flat shaded look. + */ public var smoothFaces: Boolean get() { TransferContext.writeArguments() @@ -79,6 +103,9 @@ public open class CSGCylinder3D : CSGPrimitive3D() { TransferContext.callMethod(rawPtr, MethodBindings.setSmoothFacesPtr, NIL) } + /** + * The material used to render the cylinder. + */ public var material: Material? get() { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CSGMesh3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CSGMesh3D.kt index 413038043..0e0fecf83 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CSGMesh3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CSGMesh3D.kt @@ -16,8 +16,27 @@ import kotlin.Boolean import kotlin.Int import kotlin.Suppress +/** + * This CSG node allows you to use any mesh resource as a CSG shape, provided it is closed, does not + * self-intersect, does not contain internal faces and has no edges that connect to more than two + * faces. See also [CSGPolygon3D] for drawing 2D extruded polygons to be used as CSG nodes. + * **Note:** CSG nodes are intended to be used for level prototyping. Creating CSG nodes has a + * significant CPU cost compared to creating a [MeshInstance3D] with a [PrimitiveMesh]. Moving a CSG + * node within another CSG node also has a significant CPU cost, so it should be avoided during + * gameplay. + */ @GodotBaseType public open class CSGMesh3D : CSGPrimitive3D() { + /** + * The [Mesh] resource to use as a CSG shape. + * **Note:** When using an [ArrayMesh], all vertex attributes except [constant Mesh.ARRAY_VERTEX], + * [constant Mesh.ARRAY_NORMAL] and [constant Mesh.ARRAY_TEX_UV] are left unused. Only [constant + * Mesh.ARRAY_VERTEX] and [constant Mesh.ARRAY_TEX_UV] will be passed to the GPU. + * [constant Mesh.ARRAY_NORMAL] is only used to determine which faces require the use of flat + * shading. By default, CSGMesh will ignore the mesh's vertex normals, recalculate them for each + * vertex and use a smooth shader. If a flat shader is required for a face, ensure that all vertex + * normals of the face are approximately equal. + */ public var mesh: Mesh? get() { TransferContext.writeArguments() @@ -29,6 +48,9 @@ public open class CSGMesh3D : CSGPrimitive3D() { TransferContext.callMethod(rawPtr, MethodBindings.setMeshPtr, NIL) } + /** + * The [Material] used in drawing the CSG shape. + */ public var material: Material? get() { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CSGPolygon3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CSGPolygon3D.kt index 37953774e..20fd3a0bd 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CSGPolygon3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CSGPolygon3D.kt @@ -26,8 +26,22 @@ import kotlin.Int import kotlin.Long import kotlin.Suppress +/** + * An array of 2D points is extruded to quickly and easily create a variety of 3D meshes. See also + * [CSGMesh3D] for using 3D meshes as CSG nodes. + * **Note:** CSG nodes are intended to be used for level prototyping. Creating CSG nodes has a + * significant CPU cost compared to creating a [MeshInstance3D] with a [PrimitiveMesh]. Moving a CSG + * node within another CSG node also has a significant CPU cost, so it should be avoided during + * gameplay. + */ @GodotBaseType public open class CSGPolygon3D : CSGPrimitive3D() { + /** + * The point array that defines the 2D polygon that is extruded. This can be a convex or concave + * polygon with 3 or more points. The polygon must *not* have any intersecting edges. Otherwise, + * triangulation will fail and no mesh will be generated. + * **Note:** If only 1 or 2 points are defined in [polygon], no mesh will be generated. + */ public var polygon: PackedVector2Array get() { TransferContext.writeArguments() @@ -39,6 +53,9 @@ public open class CSGPolygon3D : CSGPrimitive3D() { TransferContext.callMethod(rawPtr, MethodBindings.setPolygonPtr, NIL) } + /** + * The [mode] used to extrude the [polygon]. + */ public var mode: Mode get() { TransferContext.writeArguments() @@ -50,6 +67,9 @@ public open class CSGPolygon3D : CSGPrimitive3D() { TransferContext.callMethod(rawPtr, MethodBindings.setModePtr, NIL) } + /** + * When [mode] is [constant MODE_DEPTH], the depth of the extrusion. + */ public var depth: Float get() { TransferContext.writeArguments() @@ -61,6 +81,10 @@ public open class CSGPolygon3D : CSGPrimitive3D() { TransferContext.callMethod(rawPtr, MethodBindings.setDepthPtr, NIL) } + /** + * When [mode] is [constant MODE_SPIN], the total number of degrees the [polygon] is rotated when + * extruding. + */ public var spinDegrees: Float get() { TransferContext.writeArguments() @@ -72,6 +96,9 @@ public open class CSGPolygon3D : CSGPrimitive3D() { TransferContext.callMethod(rawPtr, MethodBindings.setSpinDegreesPtr, NIL) } + /** + * When [mode] is [constant MODE_SPIN], the number of extrusions made. + */ public var spinSides: Int get() { TransferContext.writeArguments() @@ -83,6 +110,10 @@ public open class CSGPolygon3D : CSGPrimitive3D() { TransferContext.callMethod(rawPtr, MethodBindings.setSpinSidesPtr, NIL) } + /** + * When [mode] is [constant MODE_PATH], the location of the [Path3D] object used to extrude the + * [polygon]. + */ public var pathNode: NodePath get() { TransferContext.writeArguments() @@ -94,6 +125,10 @@ public open class CSGPolygon3D : CSGPrimitive3D() { TransferContext.callMethod(rawPtr, MethodBindings.setPathNodePtr, NIL) } + /** + * When [mode] is [constant MODE_PATH], this will determine if the interval should be by distance + * ([constant PATH_INTERVAL_DISTANCE]) or subdivision fractions ([constant PATH_INTERVAL_SUBDIVIDE]). + */ public var pathIntervalType: PathIntervalType get() { TransferContext.writeArguments() @@ -105,6 +140,9 @@ public open class CSGPolygon3D : CSGPrimitive3D() { TransferContext.callMethod(rawPtr, MethodBindings.setPathIntervalTypePtr, NIL) } + /** + * When [mode] is [constant MODE_PATH], the path interval or ratio of path points to extrusions. + */ public var pathInterval: Float get() { TransferContext.writeArguments() @@ -116,6 +154,10 @@ public open class CSGPolygon3D : CSGPrimitive3D() { TransferContext.callMethod(rawPtr, MethodBindings.setPathIntervalPtr, NIL) } + /** + * When [mode] is [constant MODE_PATH], extrusions that are less than this angle, will be merged + * together to reduce polygon count. + */ public var pathSimplifyAngle: Float get() { TransferContext.writeArguments() @@ -127,6 +169,10 @@ public open class CSGPolygon3D : CSGPrimitive3D() { TransferContext.callMethod(rawPtr, MethodBindings.setPathSimplifyAnglePtr, NIL) } + /** + * When [mode] is [constant MODE_PATH], the [enum PathRotation] method used to rotate the + * [polygon] as it is extruded. + */ public var pathRotation: PathRotation get() { TransferContext.writeArguments() @@ -138,6 +184,10 @@ public open class CSGPolygon3D : CSGPrimitive3D() { TransferContext.callMethod(rawPtr, MethodBindings.setPathRotationPtr, NIL) } + /** + * When [mode] is [constant MODE_PATH], if `true` the [Transform3D] of the [CSGPolygon3D] is used + * as the starting point for the extrusions, not the [Transform3D] of the [pathNode]. + */ public var pathLocal: Boolean get() { TransferContext.writeArguments() @@ -149,6 +199,11 @@ public open class CSGPolygon3D : CSGPrimitive3D() { TransferContext.callMethod(rawPtr, MethodBindings.setPathLocalPtr, NIL) } + /** + * When [mode] is [constant MODE_PATH], by default, the top half of the [material] is stretched + * along the entire length of the extruded shape. If `false` the top half of the material is repeated + * every step of the extrusion. + */ public var pathContinuousU: Boolean get() { TransferContext.writeArguments() @@ -160,6 +215,11 @@ public open class CSGPolygon3D : CSGPrimitive3D() { TransferContext.callMethod(rawPtr, MethodBindings.setPathContinuousUPtr, NIL) } + /** + * When [mode] is [constant MODE_PATH], this is the distance along the path, in meters, the + * texture coordinates will tile. When set to 0, texture coordinates will match geometry exactly with + * no tiling. + */ public var pathUDistance: Float get() { TransferContext.writeArguments() @@ -171,6 +231,10 @@ public open class CSGPolygon3D : CSGPrimitive3D() { TransferContext.callMethod(rawPtr, MethodBindings.setPathUDistancePtr, NIL) } + /** + * When [mode] is [constant MODE_PATH], if `true` the ends of the path are joined, by adding an + * extrusion between the last and first points of the path. + */ public var pathJoined: Boolean get() { TransferContext.writeArguments() @@ -182,6 +246,9 @@ public open class CSGPolygon3D : CSGPrimitive3D() { TransferContext.callMethod(rawPtr, MethodBindings.setPathJoinedPtr, NIL) } + /** + * If `true`, applies smooth shading to the extrusions. + */ public var smoothFaces: Boolean get() { TransferContext.writeArguments() @@ -193,6 +260,11 @@ public open class CSGPolygon3D : CSGPrimitive3D() { TransferContext.callMethod(rawPtr, MethodBindings.setSmoothFacesPtr, NIL) } + /** + * Material to use for the resulting mesh. The UV maps the top half of the material to the + * extruded shape (U along the length of the extrusions and V around the outline of the [polygon]), + * the bottom-left quarter to the front end face, and the bottom-right quarter to the back end face. + */ public var material: Material? get() { TransferContext.writeArguments() @@ -212,8 +284,17 @@ public open class CSGPolygon3D : CSGPrimitive3D() { public enum class Mode( id: Long, ) { + /** + * The [polygon] shape is extruded along the negative Z axis. + */ MODE_DEPTH(0), + /** + * The [polygon] shape is extruded by rotating it around the Y axis. + */ MODE_SPIN(1), + /** + * The [polygon] shape is extruded along the [Path3D] specified in [pathNode]. + */ MODE_PATH(2), ; @@ -230,8 +311,19 @@ public open class CSGPolygon3D : CSGPrimitive3D() { public enum class PathRotation( id: Long, ) { + /** + * The [polygon] shape is not rotated. + * **Note:** Requires the path Z coordinates to continually decrease to ensure viable shapes. + */ PATH_ROTATION_POLYGON(0), + /** + * The [polygon] shape is rotated along the path, but it is not rotated around the path axis. + * **Note:** Requires the path Z coordinates to continually decrease to ensure viable shapes. + */ PATH_ROTATION_PATH(1), + /** + * The [polygon] shape follows the path and its rotations around the path axis. + */ PATH_ROTATION_PATH_FOLLOW(2), ; @@ -248,7 +340,15 @@ public open class CSGPolygon3D : CSGPrimitive3D() { public enum class PathIntervalType( id: Long, ) { + /** + * When [mode] is set to [constant MODE_PATH], [pathInterval] will determine the distance, in + * meters, each interval of the path will extrude. + */ PATH_INTERVAL_DISTANCE(0), + /** + * When [mode] is set to [constant MODE_PATH], [pathInterval] will subdivide the polygons along + * the path. + */ PATH_INTERVAL_SUBDIVIDE(1), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CSGPrimitive3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CSGPrimitive3D.kt index c4a523269..b76c73da0 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CSGPrimitive3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CSGPrimitive3D.kt @@ -16,8 +16,21 @@ import kotlin.Boolean import kotlin.Int import kotlin.Suppress +/** + * Parent class for various CSG primitives. It contains code and functionality that is common + * between them. It cannot be used directly. Instead use one of the various classes that inherit from + * it. + * **Note:** CSG nodes are intended to be used for level prototyping. Creating CSG nodes has a + * significant CPU cost compared to creating a [MeshInstance3D] with a [PrimitiveMesh]. Moving a CSG + * node within another CSG node also has a significant CPU cost, so it should be avoided during + * gameplay. + */ @GodotBaseType public open class CSGPrimitive3D internal constructor() : CSGShape3D() { + /** + * If set, the order of the vertices in each triangle are reversed resulting in the backside of + * the mesh being drawn. + */ public var flipFaces: Boolean get() { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CSGShape3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CSGShape3D.kt index 3e609a080..a1f8add4e 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CSGShape3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CSGShape3D.kt @@ -25,8 +25,19 @@ import kotlin.Long import kotlin.Suppress import kotlin.Unit +/** + * This is the CSG base class that provides CSG operation support to the various CSG nodes in Godot. + * **Note:** CSG nodes are intended to be used for level prototyping. Creating CSG nodes has a + * significant CPU cost compared to creating a [MeshInstance3D] with a [PrimitiveMesh]. Moving a CSG + * node within another CSG node also has a significant CPU cost, so it should be avoided during + * gameplay. + */ @GodotBaseType public open class CSGShape3D internal constructor() : GeometryInstance3D() { + /** + * The operation that is performed on this shape. This is ignored for the first CSG child node as + * the operation is between this node and the previous child of this nodes parent. + */ public var operation: Operation get() { TransferContext.writeArguments() @@ -38,6 +49,10 @@ public open class CSGShape3D internal constructor() : GeometryInstance3D() { TransferContext.callMethod(rawPtr, MethodBindings.setOperationPtr, NIL) } + /** + * Snap makes the mesh vertices snap to a given distance so that the faces of two meshes can be + * perfectly aligned. A lower value results in greater precision but may be harder to adjust. + */ public var snap: Float get() { TransferContext.writeArguments() @@ -49,6 +64,10 @@ public open class CSGShape3D internal constructor() : GeometryInstance3D() { TransferContext.callMethod(rawPtr, MethodBindings.setSnapPtr, NIL) } + /** + * Calculate tangents for the CSG shape which allows the use of normal maps. This is only applied + * on the root shape, this setting is ignored on any child. + */ public var calculateTangents: Boolean get() { TransferContext.writeArguments() @@ -60,6 +79,11 @@ public open class CSGShape3D internal constructor() : GeometryInstance3D() { TransferContext.callMethod(rawPtr, MethodBindings.setCalculateTangentsPtr, NIL) } + /** + * Adds a collision shape to the physics engine for our CSG shape. This will always act like a + * static body. Note that the collision shape is still active even if the CSG shape itself is hidden. + * See also [collisionMask] and [collisionPriority]. + */ public var useCollision: Boolean get() { TransferContext.writeArguments() @@ -71,6 +95,16 @@ public open class CSGShape3D internal constructor() : GeometryInstance3D() { TransferContext.callMethod(rawPtr, MethodBindings.setUseCollisionPtr, NIL) } + /** + * The physics layers this area is in. + * Collidable objects can exist in any of 32 different layers. These layers work like a tagging + * system, and are not visual. A collidable can use these layers to select with which objects it can + * collide, using the collision_mask property. + * A contact is detected if object A is in any of the layers that object B scans, or object B is + * in any layer scanned by object A. See + * [url=$DOCS_URL/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision + * layers and masks[/url] in the documentation for more information. + */ public var collisionLayer: Long get() { TransferContext.writeArguments() @@ -82,6 +116,12 @@ public open class CSGShape3D internal constructor() : GeometryInstance3D() { TransferContext.callMethod(rawPtr, MethodBindings.setCollisionLayerPtr, NIL) } + /** + * The physics layers this CSG shape scans for collisions. Only effective if [useCollision] is + * `true`. See + * [url=$DOCS_URL/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision + * layers and masks[/url] in the documentation for more information. + */ public var collisionMask: Long get() { TransferContext.writeArguments() @@ -93,6 +133,12 @@ public open class CSGShape3D internal constructor() : GeometryInstance3D() { TransferContext.callMethod(rawPtr, MethodBindings.setCollisionMaskPtr, NIL) } + /** + * The priority used to solve colliding when occurring penetration. Only effective if + * [useCollision] is `true`. The higher the priority is, the lower the penetration into the object + * will be. This can for example be used to prevent the player from breaking through the boundaries + * of a level. + */ public var collisionPriority: Float get() { TransferContext.writeArguments() @@ -109,34 +155,57 @@ public open class CSGShape3D internal constructor() : GeometryInstance3D() { return true } + /** + * Returns `true` if this is a root shape and is thus the object that is rendered. + */ public fun isRootShape(): Boolean { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.isRootShapePtr, BOOL) return (TransferContext.readReturnValue(BOOL, false) as Boolean) } + /** + * Based on [param value], enables or disables the specified layer in the [collisionMask], given a + * [param layer_number] between 1 and 32. + */ public fun setCollisionMaskValue(layerNumber: Int, `value`: Boolean): Unit { TransferContext.writeArguments(LONG to layerNumber.toLong(), BOOL to value) TransferContext.callMethod(rawPtr, MethodBindings.setCollisionMaskValuePtr, NIL) } + /** + * Returns whether or not the specified layer of the [collisionMask] is enabled, given a [param + * layer_number] between 1 and 32. + */ public fun getCollisionMaskValue(layerNumber: Int): Boolean { TransferContext.writeArguments(LONG to layerNumber.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.getCollisionMaskValuePtr, BOOL) return (TransferContext.readReturnValue(BOOL, false) as Boolean) } + /** + * Based on [param value], enables or disables the specified layer in the [collisionLayer], given + * a [param layer_number] between 1 and 32. + */ public fun setCollisionLayerValue(layerNumber: Int, `value`: Boolean): Unit { TransferContext.writeArguments(LONG to layerNumber.toLong(), BOOL to value) TransferContext.callMethod(rawPtr, MethodBindings.setCollisionLayerValuePtr, NIL) } + /** + * Returns whether or not the specified layer of the [collisionLayer] is enabled, given a [param + * layer_number] between 1 and 32. + */ public fun getCollisionLayerValue(layerNumber: Int): Boolean { TransferContext.writeArguments(LONG to layerNumber.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.getCollisionLayerValuePtr, BOOL) return (TransferContext.readReturnValue(BOOL, false) as Boolean) } + /** + * Returns an [Array] with two elements, the first is the [Transform3D] of this node and the + * second is the root [Mesh] of this node. Only works when this node is the root shape. + */ public fun getMeshes(): VariantArray { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getMeshesPtr, ARRAY) @@ -146,8 +215,17 @@ public open class CSGShape3D internal constructor() : GeometryInstance3D() { public enum class Operation( id: Long, ) { + /** + * Geometry of both primitives is merged, intersecting geometry is removed. + */ OPERATION_UNION(0), + /** + * Only intersecting geometry remains, the rest is removed. + */ OPERATION_INTERSECTION(1), + /** + * The second shape is subtracted from the first, leaving a dent with its shape. + */ OPERATION_SUBTRACTION(2), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CSGSphere3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CSGSphere3D.kt index aa1c4d504..fb85b292b 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CSGSphere3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CSGSphere3D.kt @@ -22,8 +22,18 @@ import kotlin.Int import kotlin.Long import kotlin.Suppress +/** + * This node allows you to create a sphere for use with the CSG system. + * **Note:** CSG nodes are intended to be used for level prototyping. Creating CSG nodes has a + * significant CPU cost compared to creating a [MeshInstance3D] with a [PrimitiveMesh]. Moving a CSG + * node within another CSG node also has a significant CPU cost, so it should be avoided during + * gameplay. + */ @GodotBaseType public open class CSGSphere3D : CSGPrimitive3D() { + /** + * Radius of the sphere. + */ public var radius: Float get() { TransferContext.writeArguments() @@ -35,6 +45,9 @@ public open class CSGSphere3D : CSGPrimitive3D() { TransferContext.callMethod(rawPtr, MethodBindings.setRadiusPtr, NIL) } + /** + * Number of vertical slices for the sphere. + */ public var radialSegments: Int get() { TransferContext.writeArguments() @@ -46,6 +59,9 @@ public open class CSGSphere3D : CSGPrimitive3D() { TransferContext.callMethod(rawPtr, MethodBindings.setRadialSegmentsPtr, NIL) } + /** + * Number of horizontal slices for the sphere. + */ public var rings: Int get() { TransferContext.writeArguments() @@ -57,6 +73,10 @@ public open class CSGSphere3D : CSGPrimitive3D() { TransferContext.callMethod(rawPtr, MethodBindings.setRingsPtr, NIL) } + /** + * If `true` the normals of the sphere are set to give a smooth effect making the sphere seem + * rounded. If `false` the sphere will have a flat shaded look. + */ public var smoothFaces: Boolean get() { TransferContext.writeArguments() @@ -68,6 +88,9 @@ public open class CSGSphere3D : CSGPrimitive3D() { TransferContext.callMethod(rawPtr, MethodBindings.setSmoothFacesPtr, NIL) } + /** + * The material used to render the sphere. + */ public var material: Material? get() { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CSGTorus3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CSGTorus3D.kt index 7521f33b9..6756bfa34 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CSGTorus3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CSGTorus3D.kt @@ -22,8 +22,18 @@ import kotlin.Int import kotlin.Long import kotlin.Suppress +/** + * This node allows you to create a torus for use with the CSG system. + * **Note:** CSG nodes are intended to be used for level prototyping. Creating CSG nodes has a + * significant CPU cost compared to creating a [MeshInstance3D] with a [PrimitiveMesh]. Moving a CSG + * node within another CSG node also has a significant CPU cost, so it should be avoided during + * gameplay. + */ @GodotBaseType public open class CSGTorus3D : CSGPrimitive3D() { + /** + * The inner radius of the torus. + */ public var innerRadius: Float get() { TransferContext.writeArguments() @@ -35,6 +45,9 @@ public open class CSGTorus3D : CSGPrimitive3D() { TransferContext.callMethod(rawPtr, MethodBindings.setInnerRadiusPtr, NIL) } + /** + * The outer radius of the torus. + */ public var outerRadius: Float get() { TransferContext.writeArguments() @@ -46,6 +59,9 @@ public open class CSGTorus3D : CSGPrimitive3D() { TransferContext.callMethod(rawPtr, MethodBindings.setOuterRadiusPtr, NIL) } + /** + * The number of slices the torus is constructed of. + */ public var sides: Int get() { TransferContext.writeArguments() @@ -57,6 +73,9 @@ public open class CSGTorus3D : CSGPrimitive3D() { TransferContext.callMethod(rawPtr, MethodBindings.setSidesPtr, NIL) } + /** + * The number of edges each ring of the torus is constructed of. + */ public var ringSides: Int get() { TransferContext.writeArguments() @@ -68,6 +87,10 @@ public open class CSGTorus3D : CSGPrimitive3D() { TransferContext.callMethod(rawPtr, MethodBindings.setRingSidesPtr, NIL) } + /** + * If `true` the normals of the torus are set to give a smooth effect making the torus seem + * rounded. If `false` the torus will have a flat shaded look. + */ public var smoothFaces: Boolean get() { TransferContext.writeArguments() @@ -79,6 +102,9 @@ public open class CSGTorus3D : CSGPrimitive3D() { TransferContext.callMethod(rawPtr, MethodBindings.setSmoothFacesPtr, NIL) } + /** + * The material used to render the torus. + */ public var material: Material? get() { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CallbackTweener.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CallbackTweener.kt index 68de8b878..8188a7490 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CallbackTweener.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CallbackTweener.kt @@ -18,13 +18,11 @@ import kotlin.Int import kotlin.Suppress /** - * Calls the specified method after optional delay. - * - * [godot.CallbackTweener] is used to call a method in a tweening sequence. See [godot.Tween.tweenCallback] for more usage information. - * + * [CallbackTweener] is used to call a method in a tweening sequence. See [Tween.tweenCallback] for + * more usage information. * The tweener will finish automatically if the callback's target object is freed. - * - * **Note:** [godot.Tween.tweenCallback] is the only correct way to create [godot.CallbackTweener]. Any [godot.CallbackTweener] created manually will not function correctly. + * **Note:** [Tween.tweenCallback] is the only correct way to create [CallbackTweener]. Any + * [CallbackTweener] created manually will not function correctly. */ @GodotBaseType public open class CallbackTweener : Tweener() { @@ -35,13 +33,11 @@ public open class CallbackTweener : Tweener() { /** * Makes the callback call delayed by given time in seconds. - * * **Example:** - * - * ``` - * var tween = get_tree().create_tween() - * tween.tween_callback(queue_free).set_delay(2) #this will call queue_free() after 2 seconds - * ``` + * [codeblock] + * var tween = get_tree().create_tween() + * tween.tween_callback(queue_free).set_delay(2) #this will call queue_free() after 2 seconds + * [/codeblock] */ public fun setDelay(delay: Double): CallbackTweener? { TransferContext.writeArguments(DOUBLE to delay) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Camera2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Camera2D.kt index 98e72ce7d..cced5b142 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Camera2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Camera2D.kt @@ -28,23 +28,26 @@ import kotlin.Suppress import kotlin.Unit /** - * Camera node for 2D scenes. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/110](https://godotengine.org/asset-library/asset/110) - * - * Camera node for 2D scenes. It forces the screen (current layer) to scroll following this node. This makes it easier (and faster) to program scrollable scenes than manually changing the position of [godot.CanvasItem]-based nodes. - * - * Cameras register themselves in the nearest [godot.Viewport] node (when ascending the tree). Only one camera can be active per viewport. If no viewport is available ascending the tree, the camera will register in the global viewport. - * - * This node is intended to be a simple helper to get things going quickly, but more functionality may be desired to change how the camera works. To make your own custom camera node, inherit it from [godot.Node2D] and change the transform of the canvas by setting [godot.Viewport.canvasTransform] in [godot.Viewport] (you can obtain the current [godot.Viewport] by using [godot.Node.getViewport]). - * - * Note that the [godot.Camera2D] node's `position` doesn't represent the actual position of the screen, which may differ due to applied smoothing or limits. You can use [getScreenCenterPosition] to get the real position. + * Camera node for 2D scenes. It forces the screen (current layer) to scroll following this node. + * This makes it easier (and faster) to program scrollable scenes than manually changing the position + * of [CanvasItem]-based nodes. + * Cameras register themselves in the nearest [Viewport] node (when ascending the tree). Only one + * camera can be active per viewport. If no viewport is available ascending the tree, the camera will + * register in the global viewport. + * This node is intended to be a simple helper to get things going quickly, but more functionality + * may be desired to change how the camera works. To make your own custom camera node, inherit it from + * [Node2D] and change the transform of the canvas by setting [Viewport.canvasTransform] in [Viewport] + * (you can obtain the current [Viewport] by using [Node.getViewport]). + * Note that the [Camera2D] node's `position` doesn't represent the actual position of the screen, + * which may differ due to applied smoothing or limits. You can use [getScreenCenterPosition] to get + * the real position. */ @GodotBaseType public open class Camera2D : Node2D() { /** - * The camera's relative offset. Useful for looking around or camera shake animations. The offsetted camera can go past the limits defined in [limitTop], [limitBottom], [limitLeft] and [limitRight]. + * The camera's relative offset. Useful for looking around or camera shake animations. The + * offsetted camera can go past the limits defined in [limitTop], [limitBottom], [limitLeft] and + * [limitRight]. */ @CoreTypeLocalCopy public var offset: Vector2 @@ -73,7 +76,8 @@ public open class Camera2D : Node2D() { } /** - * If `true`, the camera's rendered view is not affected by its [godot.Node2D.rotation] and [godot.Node2D.globalRotation]. + * If `true`, the camera's rendered view is not affected by its [Node2D.rotation] and + * [Node2D.globalRotation]. */ public var ignoreRotation: Boolean get() { @@ -87,9 +91,11 @@ public open class Camera2D : Node2D() { } /** - * Controls whether the camera can be active or not. If `true`, the [godot.Camera2D] will become the main camera when it enters the scene tree and there is no active camera currently (see [godot.Viewport.getCamera2d]). - * - * When the camera is currently active and [enabled] is set to `false`, the next enabled [godot.Camera2D] in the scene tree will become active. + * Controls whether the camera can be active or not. If `true`, the [Camera2D] will become the + * main camera when it enters the scene tree and there is no active camera currently (see + * [Viewport.getCamera2d]). + * When the camera is currently active and [enabled] is set to `false`, the next enabled + * [Camera2D] in the scene tree will become active. */ public var enabled: Boolean get() { @@ -103,9 +109,16 @@ public open class Camera2D : Node2D() { } /** - * The camera's zoom. A zoom of `Vector(2, 2)` doubles the size seen in the viewport. A zoom of `Vector(0.5, 0.5)` halves the size seen in the viewport. - * - * **Note:** [godot.FontFile.oversampling] does *not* take [godot.Camera2D] zoom into account. This means that zooming in/out will cause bitmap fonts and rasterized (non-MSDF) dynamic fonts to appear blurry or pixelated unless the font is part of a [godot.CanvasLayer] that makes it ignore camera zoom. To ensure text remains crisp regardless of zoom, you can enable MSDF font rendering by enabling [godot.ProjectSettings.gui/theme/defaultFontMultichannelSignedDistanceField] (applies to the default project font only), or enabling **Multichannel Signed Distance Field** in the import options of a DynamicFont for custom fonts. On system fonts, [godot.SystemFont.multichannelSignedDistanceField] can be enabled in the inspector. + * The camera's zoom. A zoom of `Vector(2, 2)` doubles the size seen in the viewport. A zoom of + * `Vector(0.5, 0.5)` halves the size seen in the viewport. + * **Note:** [FontFile.oversampling] does *not* take [Camera2D] zoom into account. This means that + * zooming in/out will cause bitmap fonts and rasterized (non-MSDF) dynamic fonts to appear blurry or + * pixelated unless the font is part of a [CanvasLayer] that makes it ignore camera zoom. To ensure + * text remains crisp regardless of zoom, you can enable MSDF font rendering by enabling + * [ProjectSettings.gui/theme/defaultFontMultichannelSignedDistanceField] (applies to the default + * project font only), or enabling **Multichannel Signed Distance Field** in the import options of a + * DynamicFont for custom fonts. On system fonts, [SystemFont.multichannelSignedDistanceField] can be + * enabled in the inspector. */ @CoreTypeLocalCopy public var zoom: Vector2 @@ -120,7 +133,8 @@ public open class Camera2D : Node2D() { } /** - * The custom [godot.Viewport] node attached to the [godot.Camera2D]. If `null` or not a [godot.Viewport], uses the default viewport instead. + * The custom [Viewport] node attached to the [Camera2D]. If `null` or not a [Viewport], uses the + * default viewport instead. */ public var customViewport: Node? get() { @@ -148,7 +162,8 @@ public open class Camera2D : Node2D() { } /** - * Left scroll limit in pixels. The camera stops moving when reaching this value, but [offset] can push the view past the limit. + * Left scroll limit in pixels. The camera stops moving when reaching this value, but [offset] can + * push the view past the limit. */ public var limitLeft: Int get() { @@ -162,7 +177,8 @@ public open class Camera2D : Node2D() { } /** - * Top scroll limit in pixels. The camera stops moving when reaching this value, but [offset] can push the view past the limit. + * Top scroll limit in pixels. The camera stops moving when reaching this value, but [offset] can + * push the view past the limit. */ public var limitTop: Int get() { @@ -176,7 +192,8 @@ public open class Camera2D : Node2D() { } /** - * Right scroll limit in pixels. The camera stops moving when reaching this value, but [offset] can push the view past the limit. + * Right scroll limit in pixels. The camera stops moving when reaching this value, but [offset] + * can push the view past the limit. */ public var limitRight: Int get() { @@ -190,7 +207,8 @@ public open class Camera2D : Node2D() { } /** - * Bottom scroll limit in pixels. The camera stops moving when reaching this value, but [offset] can push the view past the limit. + * Bottom scroll limit in pixels. The camera stops moving when reaching this value, but [offset] + * can push the view past the limit. */ public var limitBottom: Int get() { @@ -205,10 +223,9 @@ public open class Camera2D : Node2D() { /** * If `true`, the camera smoothly stops when reaches its limits. - * * This property has no effect if [positionSmoothingEnabled] is `false`. - * - * **Note:** To immediately update the camera's position to be within limits without smoothing, even with this setting enabled, invoke [resetSmoothing]. + * **Note:** To immediately update the camera's position to be within limits without smoothing, + * even with this setting enabled, invoke [resetSmoothing]. */ public var limitSmoothed: Boolean get() { @@ -222,7 +239,8 @@ public open class Camera2D : Node2D() { } /** - * If `true`, the camera's view smoothly moves towards its target position at [positionSmoothingSpeed]. + * If `true`, the camera's view smoothly moves towards its target position at + * [positionSmoothingSpeed]. */ public var positionSmoothingEnabled: Boolean get() { @@ -236,7 +254,8 @@ public open class Camera2D : Node2D() { } /** - * Speed in pixels per second of the camera's smoothing effect when [positionSmoothingEnabled] is `true`. + * Speed in pixels per second of the camera's smoothing effect when [positionSmoothingEnabled] is + * `true`. */ public var positionSmoothingSpeed: Float get() { @@ -250,8 +269,8 @@ public open class Camera2D : Node2D() { } /** - * If `true`, the camera's view smoothly rotates, via asymptotic smoothing, to align with its target rotation at [rotationSmoothingSpeed]. - * + * If `true`, the camera's view smoothly rotates, via asymptotic smoothing, to align with its + * target rotation at [rotationSmoothingSpeed]. * **Note:** This property has no effect if [ignoreRotation] is `true`. */ public var rotationSmoothingEnabled: Boolean @@ -266,7 +285,8 @@ public open class Camera2D : Node2D() { } /** - * The angular, asymptotic speed of the camera's rotation smoothing effect when [rotationSmoothingEnabled] is `true`. + * The angular, asymptotic speed of the camera's rotation smoothing effect when + * [rotationSmoothingEnabled] is `true`. */ public var rotationSmoothingSpeed: Float get() { @@ -280,7 +300,8 @@ public open class Camera2D : Node2D() { } /** - * If `true`, the camera only moves when reaching the horizontal (left and right) drag margins. If `false`, the camera moves horizontally regardless of margins. + * If `true`, the camera only moves when reaching the horizontal (left and right) drag margins. If + * `false`, the camera moves horizontally regardless of margins. */ public var dragHorizontalEnabled: Boolean get() { @@ -294,7 +315,8 @@ public open class Camera2D : Node2D() { } /** - * If `true`, the camera only moves when reaching the vertical (top and bottom) drag margins. If `false`, the camera moves vertically regardless of the drag margins. + * If `true`, the camera only moves when reaching the vertical (top and bottom) drag margins. If + * `false`, the camera moves vertically regardless of the drag margins. */ public var dragVerticalEnabled: Boolean get() { @@ -308,9 +330,11 @@ public open class Camera2D : Node2D() { } /** - * The relative horizontal drag offset of the camera between the right (`-1`) and left (`1`) drag margins. - * - * **Note:** Used to set the initial horizontal drag offset; determine the current offset; or force the current offset. It's not automatically updated when [dragHorizontalEnabled] is `true` or the drag margins are changed. + * The relative horizontal drag offset of the camera between the right (`-1`) and left (`1`) drag + * margins. + * **Note:** Used to set the initial horizontal drag offset; determine the current offset; or + * force the current offset. It's not automatically updated when [dragHorizontalEnabled] is `true` or + * the drag margins are changed. */ public var dragHorizontalOffset: Float get() { @@ -324,9 +348,11 @@ public open class Camera2D : Node2D() { } /** - * The relative vertical drag offset of the camera between the bottom (`-1`) and top (`1`) drag margins. - * - * **Note:** Used to set the initial vertical drag offset; determine the current offset; or force the current offset. It's not automatically updated when [dragVerticalEnabled] is `true` or the drag margins are changed. + * The relative vertical drag offset of the camera between the bottom (`-1`) and top (`1`) drag + * margins. + * **Note:** Used to set the initial vertical drag offset; determine the current offset; or force + * the current offset. It's not automatically updated when [dragVerticalEnabled] is `true` or the + * drag margins are changed. */ public var dragVerticalOffset: Float get() { @@ -340,7 +366,8 @@ public open class Camera2D : Node2D() { } /** - * Left margin needed to drag the camera. A value of `1` makes the camera move only when reaching the left edge of the screen. + * Left margin needed to drag the camera. A value of `1` makes the camera move only when reaching + * the left edge of the screen. */ public var dragLeftMargin: Float get() { @@ -354,7 +381,8 @@ public open class Camera2D : Node2D() { } /** - * Top margin needed to drag the camera. A value of `1` makes the camera move only when reaching the top edge of the screen. + * Top margin needed to drag the camera. A value of `1` makes the camera move only when reaching + * the top edge of the screen. */ public var dragTopMargin: Float get() { @@ -368,7 +396,8 @@ public open class Camera2D : Node2D() { } /** - * Right margin needed to drag the camera. A value of `1` makes the camera move only when reaching the right edge of the screen. + * Right margin needed to drag the camera. A value of `1` makes the camera move only when reaching + * the right edge of the screen. */ public var dragRightMargin: Float get() { @@ -382,7 +411,8 @@ public open class Camera2D : Node2D() { } /** - * Bottom margin needed to drag the camera. A value of `1` makes the camera move only when reaching the bottom edge of the screen. + * Bottom margin needed to drag the camera. A value of `1` makes the camera move only when + * reaching the bottom edge of the screen. */ public var dragBottomMargin: Float get() { @@ -443,7 +473,9 @@ public open class Camera2D : Node2D() { } /** - * The camera's relative offset. Useful for looking around or camera shake animations. The offsetted camera can go past the limits defined in [limitTop], [limitBottom], [limitLeft] and [limitRight]. + * The camera's relative offset. Useful for looking around or camera shake animations. The + * offsetted camera can go past the limits defined in [limitTop], [limitBottom], [limitLeft] and + * [limitRight]. * * This is a helper function to make dealing with local copies easier. * @@ -467,9 +499,16 @@ public open class Camera2D : Node2D() { /** - * The camera's zoom. A zoom of `Vector(2, 2)` doubles the size seen in the viewport. A zoom of `Vector(0.5, 0.5)` halves the size seen in the viewport. - * - * **Note:** [godot.FontFile.oversampling] does *not* take [godot.Camera2D] zoom into account. This means that zooming in/out will cause bitmap fonts and rasterized (non-MSDF) dynamic fonts to appear blurry or pixelated unless the font is part of a [godot.CanvasLayer] that makes it ignore camera zoom. To ensure text remains crisp regardless of zoom, you can enable MSDF font rendering by enabling [godot.ProjectSettings.gui/theme/defaultFontMultichannelSignedDistanceField] (applies to the default project font only), or enabling **Multichannel Signed Distance Field** in the import options of a DynamicFont for custom fonts. On system fonts, [godot.SystemFont.multichannelSignedDistanceField] can be enabled in the inspector. + * The camera's zoom. A zoom of `Vector(2, 2)` doubles the size seen in the viewport. A zoom of + * `Vector(0.5, 0.5)` halves the size seen in the viewport. + * **Note:** [FontFile.oversampling] does *not* take [Camera2D] zoom into account. This means that + * zooming in/out will cause bitmap fonts and rasterized (non-MSDF) dynamic fonts to appear blurry or + * pixelated unless the font is part of a [CanvasLayer] that makes it ignore camera zoom. To ensure + * text remains crisp regardless of zoom, you can enable MSDF font rendering by enabling + * [ProjectSettings.gui/theme/defaultFontMultichannelSignedDistanceField] (applies to the default + * project font only), or enabling **Multichannel Signed Distance Field** in the import options of a + * DynamicFont for custom fonts. On system fonts, [SystemFont.multichannelSignedDistanceField] can be + * enabled in the inspector. * * This is a helper function to make dealing with local copies easier. * @@ -493,7 +532,7 @@ public open class Camera2D : Node2D() { /** - * Forces this [godot.Camera2D] to become the current active one. [enabled] must be `true`. + * Forces this [Camera2D] to become the current active one. [enabled] must be `true`. */ public fun makeCurrent(): Unit { TransferContext.writeArguments() @@ -501,7 +540,7 @@ public open class Camera2D : Node2D() { } /** - * Returns `true` if this [godot.Camera2D] is the active camera (see [godot.Viewport.getCamera2d]). + * Returns `true` if this [Camera2D] is the active camera (see [Viewport.getCamera2d]). */ public fun isCurrent(): Boolean { TransferContext.writeArguments() @@ -511,8 +550,9 @@ public open class Camera2D : Node2D() { /** * Returns this camera's target position, in global coordinates. - * - * **Note:** The returned value is not the same as [godot.Node2D.globalPosition], as it is affected by the drag properties. It is also not the same as the current position if [positionSmoothingEnabled] is `true` (see [getScreenCenterPosition]). + * **Note:** The returned value is not the same as [Node2D.globalPosition], as it is affected by + * the drag properties. It is also not the same as the current position if [positionSmoothingEnabled] + * is `true` (see [getScreenCenterPosition]). */ public fun getTargetPosition(): Vector2 { TransferContext.writeArguments() @@ -522,7 +562,6 @@ public open class Camera2D : Node2D() { /** * Returns the center of the screen from this camera's point of view, in global coordinates. - * * **Note:** The exact targeted position of the camera may be different. See [getTargetPosition]. */ public fun getScreenCenterPosition(): Vector2 { @@ -541,7 +580,6 @@ public open class Camera2D : Node2D() { /** * Sets the camera's position immediately to its current smoothing destination. - * * This method has no effect if [positionSmoothingEnabled] is `false`. */ public fun resetSmoothing(): Unit { @@ -584,11 +622,12 @@ public open class Camera2D : Node2D() { id: Long, ) { /** - * The camera updates during physics frames (see [godot.Node.NOTIFICATION_INTERNAL_PHYSICS_PROCESS]). + * The camera updates during physics frames (see [constant + * Node.NOTIFICATION_INTERNAL_PHYSICS_PROCESS]). */ CAMERA2D_PROCESS_PHYSICS(0), /** - * The camera updates during process frames (see [godot.Node.NOTIFICATION_INTERNAL_PROCESS]). + * The camera updates during process frames (see [constant Node.NOTIFICATION_INTERNAL_PROCESS]). */ CAMERA2D_PROCESS_IDLE(1), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Camera3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Camera3D.kt index ed16f5f48..0d79779e7 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Camera3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Camera3D.kt @@ -40,17 +40,17 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * Camera node, displays from a point of view. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/678](https://godotengine.org/asset-library/asset/678) - * - * [godot.Camera3D] is a special node that displays what is visible from its current location. Cameras register themselves in the nearest [godot.Viewport] node (when ascending the tree). Only one camera can be active per viewport. If no viewport is available ascending the tree, the camera will register in the global viewport. In other words, a camera just provides 3D display capabilities to a [godot.Viewport], and, without one, a scene registered in that [godot.Viewport] (or higher viewports) can't be displayed. + * [Camera3D] is a special node that displays what is visible from its current location. Cameras + * register themselves in the nearest [Viewport] node (when ascending the tree). Only one camera can be + * active per viewport. If no viewport is available ascending the tree, the camera will register in the + * global viewport. In other words, a camera just provides 3D display capabilities to a [Viewport], + * and, without one, a scene registered in that [Viewport] (or higher viewports) can't be displayed. */ @GodotBaseType public open class Camera3D : Node3D() { /** - * The axis to lock during [fov]/[size] adjustments. Can be either [KEEP_WIDTH] or [KEEP_HEIGHT]. + * The axis to lock during [fov]/[size] adjustments. Can be either [constant KEEP_WIDTH] or + * [constant KEEP_HEIGHT]. */ public var keepAspect: KeepAspect get() { @@ -64,13 +64,18 @@ public open class Camera3D : Node3D() { } /** - * The culling mask that describes which [godot.VisualInstance3D.layers] are rendered by this camera. By default, all 20 user-visible layers are rendered. - * - * **Note:** Since the [cullMask] allows for 32 layers to be stored in total, there are an additional 12 layers that are only used internally by the engine and aren't exposed in the editor. Setting [cullMask] using a script allows you to toggle those reserved layers, which can be useful for editor plugins. - * + * The culling mask that describes which [VisualInstance3D.layers] are rendered by this camera. By + * default, all 20 user-visible layers are rendered. + * **Note:** Since the [cullMask] allows for 32 layers to be stored in total, there are an + * additional 12 layers that are only used internally by the engine and aren't exposed in the editor. + * Setting [cullMask] using a script allows you to toggle those reserved layers, which can be useful + * for editor plugins. * To adjust [cullMask] more easily using a script, use [getCullMaskValue] and [setCullMaskValue]. - * - * **Note:** [godot.VoxelGI], SDFGI and [godot.LightmapGI] will always take all layers into account to determine what contributes to global illumination. If this is an issue, set [godot.GeometryInstance3D.giMode] to [godot.GeometryInstance3D.GI_MODE_DISABLED] for meshes and [godot.Light3D.lightBakeMode] to [godot.Light3D.BAKE_DISABLED] for lights to exclude them from global illumination. + * **Note:** [VoxelGI], SDFGI and [LightmapGI] will always take all layers into account to + * determine what contributes to global illumination. If this is an issue, set + * [GeometryInstance3D.giMode] to [constant GeometryInstance3D.GI_MODE_DISABLED] for meshes and + * [Light3D.lightBakeMode] to [constant Light3D.BAKE_DISABLED] for lights to exclude them from global + * illumination. */ public var cullMask: Long get() { @@ -84,7 +89,7 @@ public open class Camera3D : Node3D() { } /** - * The [godot.Environment] to use for this camera. + * The [Environment] to use for this camera. */ public var environment: Environment? get() { @@ -98,7 +103,7 @@ public open class Camera3D : Node3D() { } /** - * The [godot.CameraAttributes] to use for this camera. + * The [CameraAttributes] to use for this camera. */ public var attributes: Material? get() { @@ -140,7 +145,9 @@ public open class Camera3D : Node3D() { } /** - * If not [DOPPLER_TRACKING_DISABLED], this camera will simulate the [godot.Doppler effect](https://en.wikipedia.org/wiki/Doppler_effect) for objects changed in particular `_process` methods. See [enum DopplerTracking] for possible values. + * If not [constant DOPPLER_TRACKING_DISABLED], this camera will simulate the + * [url=https://en.wikipedia.org/wiki/Doppler_effect]Doppler effect[/url] for objects changed in + * particular `_process` methods. See [enum DopplerTracking] for possible values. */ public var dopplerTracking: DopplerTracking get() { @@ -154,7 +161,8 @@ public open class Camera3D : Node3D() { } /** - * The camera's projection mode. In [PROJECTION_PERSPECTIVE] mode, objects' Z distance from the camera's local space scales their perceived size. + * The camera's projection mode. In [constant PROJECTION_PERSPECTIVE] mode, objects' Z distance + * from the camera's local space scales their perceived size. */ public var projection: ProjectionType get() { @@ -168,9 +176,10 @@ public open class Camera3D : Node3D() { } /** - * If `true`, the ancestor [godot.Viewport] is currently using this camera. - * - * If multiple cameras are in the scene, one will always be made current. For example, if two [godot.Camera3D] nodes are present in the scene and only one is current, setting one camera's [current] to `false` will cause the other camera to be made current. + * If `true`, the ancestor [Viewport] is currently using this camera. + * If multiple cameras are in the scene, one will always be made current. For example, if two + * [Camera3D] nodes are present in the scene and only one is current, setting one camera's [current] + * to `false` will cause the other camera to be made current. */ public var current: Boolean get() { @@ -184,16 +193,13 @@ public open class Camera3D : Node3D() { } /** - * The camera's field of view angle (in degrees). Only applicable in perspective mode. Since [keepAspect] locks one axis, [fov] sets the other axis' field of view angle. - * - * For reference, the default vertical field of view value (`75.0`) is equivalent to a horizontal FOV of: - * + * The camera's field of view angle (in degrees). Only applicable in perspective mode. Since + * [keepAspect] locks one axis, [fov] sets the other axis' field of view angle. + * For reference, the default vertical field of view value (`75.0`) is equivalent to a horizontal + * FOV of: * - ~91.31 degrees in a 4:3 viewport - * * - ~101.67 degrees in a 16:10 viewport - * * - ~107.51 degrees in a 16:9 viewport - * * - ~121.63 degrees in a 21:9 viewport */ public var fov: Float @@ -208,7 +214,8 @@ public open class Camera3D : Node3D() { } /** - * The camera's size in meters measured as the diameter of the width or height, depending on [keepAspect]. Only applicable in orthogonal and frustum modes. + * The camera's size in meters measured as the diameter of the width or height, depending on + * [keepAspect]. Only applicable in orthogonal and frustum modes. */ public var size: Float get() { @@ -222,9 +229,9 @@ public open class Camera3D : Node3D() { } /** - * The camera's frustum offset. This can be changed from the default to create "tilted frustum" effects such as [godot.Y-shearing](https://zdoom.org/wiki/Y-shearing). - * - * **Note:** Only effective if [projection] is [PROJECTION_FRUSTUM]. + * The camera's frustum offset. This can be changed from the default to create "tilted frustum" + * effects such as [url=https://zdoom.org/wiki/Y-shearing]Y-shearing[/url]. + * **Note:** Only effective if [projection] is [constant PROJECTION_FRUSTUM]. */ @CoreTypeLocalCopy public var frustumOffset: Vector2 @@ -239,7 +246,9 @@ public open class Camera3D : Node3D() { } /** - * The distance to the near culling boundary for this camera relative to its local Z axis. Lower values allow the camera to see objects more up close to its origin, at the cost of lower precision across the *entire* range. Values lower than the default can lead to increased Z-fighting. + * The distance to the near culling boundary for this camera relative to its local Z axis. Lower + * values allow the camera to see objects more up close to its origin, at the cost of lower precision + * across the *entire* range. Values lower than the default can lead to increased Z-fighting. */ public var near: Float get() { @@ -253,7 +262,9 @@ public open class Camera3D : Node3D() { } /** - * The distance to the far culling boundary for this camera relative to its local Z axis. Higher values allow the camera to see further away, while decreasing [far] can improve performance if it results in objects being partially or fully culled. + * The distance to the far culling boundary for this camera relative to its local Z axis. Higher + * values allow the camera to see further away, while decreasing [far] can improve performance if it + * results in objects being partially or fully culled. */ public var far: Float get() { @@ -272,9 +283,9 @@ public open class Camera3D : Node3D() { } /** - * The camera's frustum offset. This can be changed from the default to create "tilted frustum" effects such as [godot.Y-shearing](https://zdoom.org/wiki/Y-shearing). - * - * **Note:** Only effective if [projection] is [PROJECTION_FRUSTUM]. + * The camera's frustum offset. This can be changed from the default to create "tilted frustum" + * effects such as [url=https://zdoom.org/wiki/Y-shearing]Y-shearing[/url]. + * **Note:** Only effective if [projection] is [constant PROJECTION_FRUSTUM]. * * This is a helper function to make dealing with local copies easier. * @@ -298,7 +309,9 @@ public open class Camera3D : Node3D() { /** - * Returns a normal vector in world space, that is the result of projecting a point on the [godot.Viewport] rectangle by the inverse camera projection. This is useful for casting rays in the form of (origin, normal) for object intersection or picking. + * Returns a normal vector in world space, that is the result of projecting a point on the + * [Viewport] rectangle by the inverse camera projection. This is useful for casting rays in the form + * of (origin, normal) for object intersection or picking. */ public fun projectRayNormal(screenPoint: Vector2): Vector3 { TransferContext.writeArguments(VECTOR2 to screenPoint) @@ -307,7 +320,8 @@ public open class Camera3D : Node3D() { } /** - * Returns a normal vector from the screen point location directed along the camera. Orthogonal cameras are normalized. Perspective cameras account for perspective, screen width/height, etc. + * Returns a normal vector from the screen point location directed along the camera. Orthogonal + * cameras are normalized. Perspective cameras account for perspective, screen width/height, etc. */ public fun projectLocalRayNormal(screenPoint: Vector2): Vector3 { TransferContext.writeArguments(VECTOR2 to screenPoint) @@ -316,7 +330,9 @@ public open class Camera3D : Node3D() { } /** - * Returns a 3D position in world space, that is the result of projecting a point on the [godot.Viewport] rectangle by the inverse camera projection. This is useful for casting rays in the form of (origin, normal) for object intersection or picking. + * Returns a 3D position in world space, that is the result of projecting a point on the + * [Viewport] rectangle by the inverse camera projection. This is useful for casting rays in the form + * of (origin, normal) for object intersection or picking. */ public fun projectRayOrigin(screenPoint: Vector2): Vector3 { TransferContext.writeArguments(VECTOR2 to screenPoint) @@ -325,16 +341,17 @@ public open class Camera3D : Node3D() { } /** - * Returns the 2D coordinate in the [godot.Viewport] rectangle that maps to the given 3D point in world space. - * - * **Note:** When using this to position GUI elements over a 3D viewport, use [isPositionBehind] to prevent them from appearing if the 3D point is behind the camera: - * - * ``` - * # This code block is part of a script that inherits from Node3D. - * # `control` is a reference to a node inheriting from Control. - * control.visible = not get_viewport().get_camera_3d().is_position_behind(global_transform.origin) - * control.position = get_viewport().get_camera_3d().unproject_position(global_transform.origin) - * ``` + * Returns the 2D coordinate in the [Viewport] rectangle that maps to the given 3D point in world + * space. + * **Note:** When using this to position GUI elements over a 3D viewport, use [isPositionBehind] + * to prevent them from appearing if the 3D point is behind the camera: + * [codeblock] + * # This code block is part of a script that inherits from Node3D. + * # `control` is a reference to a node inheriting from Control. + * control.visible = not + * get_viewport().get_camera_3d().is_position_behind(global_transform.origin) + * control.position = get_viewport().get_camera_3d().unproject_position(global_transform.origin) + * [/codeblock] */ public fun unprojectPosition(worldPoint: Vector3): Vector2 { TransferContext.writeArguments(VECTOR3 to worldPoint) @@ -343,8 +360,10 @@ public open class Camera3D : Node3D() { } /** - * Returns `true` if the given position is behind the camera (the blue part of the linked diagram). [godot.See this diagram](https://raw.githubusercontent.com/godotengine/godot-docs/master/img/camera3d_position_frustum.png) for an overview of position query methods. - * + * Returns `true` if the given position is behind the camera (the blue part of the linked + * diagram). + * [url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/camera3d_position_frustum.png]See + * this diagram[/url] for an overview of position query methods. * **Note:** A position which returns `false` may still be outside the camera's field of view. */ public fun isPositionBehind(worldPoint: Vector3): Boolean { @@ -354,7 +373,9 @@ public open class Camera3D : Node3D() { } /** - * Returns the 3D point in world space that maps to the given 2D coordinate in the [godot.Viewport] rectangle on a plane that is the given [zDepth] distance into the scene away from the camera. + * Returns the 3D point in world space that maps to the given 2D coordinate in the [Viewport] + * rectangle on a plane that is the given [param z_depth] distance into the scene away from the + * camera. */ public fun projectPosition(screenPoint: Vector2, zDepth: Float): Vector3 { TransferContext.writeArguments(VECTOR2 to screenPoint, DOUBLE to zDepth.toDouble()) @@ -363,7 +384,9 @@ public open class Camera3D : Node3D() { } /** - * Sets the camera projection to perspective mode (see [PROJECTION_PERSPECTIVE]), by specifying a [fov] (field of view) angle in degrees, and the [zNear] and [zFar] clip planes in world space units. + * Sets the camera projection to perspective mode (see [constant PROJECTION_PERSPECTIVE]), by + * specifying a [param fov] (field of view) angle in degrees, and the [param z_near] and [param + * z_far] clip planes in world space units. */ public fun setPerspective( fov: Float, @@ -375,7 +398,9 @@ public open class Camera3D : Node3D() { } /** - * Sets the camera projection to orthogonal mode (see [PROJECTION_ORTHOGONAL]), by specifying a [size], and the [zNear] and [zFar] clip planes in world space units. (As a hint, 2D games often use this projection, with values specified in pixels.) + * Sets the camera projection to orthogonal mode (see [constant PROJECTION_ORTHOGONAL]), by + * specifying a [param size], and the [param z_near] and [param z_far] clip planes in world space + * units. (As a hint, 2D games often use this projection, with values specified in pixels.) */ public fun setOrthogonal( size: Float, @@ -387,7 +412,9 @@ public open class Camera3D : Node3D() { } /** - * Sets the camera projection to frustum mode (see [PROJECTION_FRUSTUM]), by specifying a [size], an [offset], and the [zNear] and [zFar] clip planes in world space units. See also [frustumOffset]. + * Sets the camera projection to frustum mode (see [constant PROJECTION_FRUSTUM]), by specifying a + * [param size], an [param offset], and the [param z_near] and [param z_far] clip planes in world + * space units. See also [frustumOffset]. */ public fun setFrustum( size: Float, @@ -400,7 +427,8 @@ public open class Camera3D : Node3D() { } /** - * Makes this camera the current camera for the [godot.Viewport] (see class description). If the camera node is outside the scene tree, it will attempt to become current once it's added. + * Makes this camera the current camera for the [Viewport] (see class description). If the camera + * node is outside the scene tree, it will attempt to become current once it's added. */ public fun makeCurrent(): Unit { TransferContext.writeArguments() @@ -408,7 +436,8 @@ public open class Camera3D : Node3D() { } /** - * If this is the current camera, remove it from being current. If [enableNext] is `true`, request to make the next camera current, if any. + * If this is the current camera, remove it from being current. If [param enable_next] is `true`, + * request to make the next camera current, if any. */ @JvmOverloads public fun clearCurrent(enableNext: Boolean = true): Unit { @@ -417,7 +446,9 @@ public open class Camera3D : Node3D() { } /** - * Returns the transform of the camera plus the vertical ([vOffset]) and horizontal ([hOffset]) offsets; and any other adjustments made to the position and orientation of the camera by subclassed cameras such as [godot.XRCamera3D]. + * Returns the transform of the camera plus the vertical ([vOffset]) and horizontal ([hOffset]) + * offsets; and any other adjustments made to the position and orientation of the camera by + * subclassed cameras such as [XRCamera3D]. */ public fun getCameraTransform(): Transform3D { TransferContext.writeArguments() @@ -426,7 +457,8 @@ public open class Camera3D : Node3D() { } /** - * Returns the projection matrix that this camera uses to render to its associated viewport. The camera must be part of the scene tree to function. + * Returns the projection matrix that this camera uses to render to its associated viewport. The + * camera must be part of the scene tree to function. */ public fun getCameraProjection(): Projection { TransferContext.writeArguments() @@ -435,7 +467,8 @@ public open class Camera3D : Node3D() { } /** - * Returns the camera's frustum planes in world space units as an array of [godot.core.Plane]s in the following order: near, far, left, top, right, bottom. Not to be confused with [frustumOffset]. + * Returns the camera's frustum planes in world space units as an array of [Plane]s in the + * following order: near, far, left, top, right, bottom. Not to be confused with [frustumOffset]. */ public fun getFrustum(): VariantArray { TransferContext.writeArguments() @@ -444,7 +477,10 @@ public open class Camera3D : Node3D() { } /** - * Returns `true` if the given position is inside the camera's frustum (the green part of the linked diagram). [godot.See this diagram](https://raw.githubusercontent.com/godotengine/godot-docs/master/img/camera3d_position_frustum.png) for an overview of position query methods. + * Returns `true` if the given position is inside the camera's frustum (the green part of the + * linked diagram). + * [url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/camera3d_position_frustum.png]See + * this diagram[/url] for an overview of position query methods. */ public fun isPositionInFrustum(worldPoint: Vector3): Boolean { TransferContext.writeArguments(VECTOR3 to worldPoint) @@ -453,7 +489,7 @@ public open class Camera3D : Node3D() { } /** - * Returns the camera's RID from the [godot.RenderingServer]. + * Returns the camera's RID from the [RenderingServer]. */ public fun getCameraRid(): RID { TransferContext.writeArguments() @@ -462,7 +498,8 @@ public open class Camera3D : Node3D() { } /** - * Returns the RID of a pyramid shape encompassing the camera's view frustum, ignoring the camera's near plane. The tip of the pyramid represents the position of the camera. + * Returns the RID of a pyramid shape encompassing the camera's view frustum, ignoring the + * camera's near plane. The tip of the pyramid represents the position of the camera. */ public fun getPyramidShapeRid(): RID { TransferContext.writeArguments() @@ -471,7 +508,8 @@ public open class Camera3D : Node3D() { } /** - * Based on [value], enables or disables the specified layer in the [cullMask], given a [layerNumber] between 1 and 20. + * Based on [param value], enables or disables the specified layer in the [cullMask], given a + * [param layer_number] between 1 and 20. */ public fun setCullMaskValue(layerNumber: Int, `value`: Boolean): Unit { TransferContext.writeArguments(LONG to layerNumber.toLong(), BOOL to value) @@ -479,7 +517,8 @@ public open class Camera3D : Node3D() { } /** - * Returns whether or not the specified layer of the [cullMask] is enabled, given a [layerNumber] between 1 and 20. + * Returns whether or not the specified layer of the [cullMask] is enabled, given a [param + * layer_number] between 1 and 20. */ public fun getCullMaskValue(layerNumber: Int): Boolean { TransferContext.writeArguments(LONG to layerNumber.toLong()) @@ -495,11 +534,13 @@ public open class Camera3D : Node3D() { */ PROJECTION_PERSPECTIVE(0), /** - * Orthogonal projection, also known as orthographic projection. Objects remain the same size on the screen no matter how far away they are. + * Orthogonal projection, also known as orthographic projection. Objects remain the same size on + * the screen no matter how far away they are. */ PROJECTION_ORTHOGONAL(1), /** - * Frustum projection. This mode allows adjusting [frustumOffset] to create "tilted frustum" effects. + * Frustum projection. This mode allows adjusting [frustumOffset] to create "tilted frustum" + * effects. */ PROJECTION_FRUSTUM(2), ; @@ -518,11 +559,15 @@ public open class Camera3D : Node3D() { id: Long, ) { /** - * Preserves the horizontal aspect ratio; also known as Vert- scaling. This is usually the best option for projects running in portrait mode, as taller aspect ratios will benefit from a wider vertical FOV. + * Preserves the horizontal aspect ratio; also known as Vert- scaling. This is usually the best + * option for projects running in portrait mode, as taller aspect ratios will benefit from a wider + * vertical FOV. */ KEEP_WIDTH(0), /** - * Preserves the vertical aspect ratio; also known as Hor+ scaling. This is usually the best option for projects running in landscape mode, as wider aspect ratios will automatically benefit from a wider horizontal FOV. + * Preserves the vertical aspect ratio; also known as Hor+ scaling. This is usually the best + * option for projects running in landscape mode, as wider aspect ratios will automatically benefit + * from a wider horizontal FOV. */ KEEP_HEIGHT(1), ; @@ -541,15 +586,22 @@ public open class Camera3D : Node3D() { id: Long, ) { /** - * Disables [godot.Doppler effect](https://en.wikipedia.org/wiki/Doppler_effect) simulation (default). + * Disables [url=https://en.wikipedia.org/wiki/Doppler_effect]Doppler effect[/url] simulation + * (default). */ DOPPLER_TRACKING_DISABLED(0), /** - * Simulate [godot.Doppler effect](https://en.wikipedia.org/wiki/Doppler_effect) by tracking positions of objects that are changed in `_process`. Changes in the relative velocity of this camera compared to those objects affect how audio is perceived (changing the audio's [godot.AudioStreamPlayer3D.pitchScale]). + * Simulate [url=https://en.wikipedia.org/wiki/Doppler_effect]Doppler effect[/url] by tracking + * positions of objects that are changed in `_process`. Changes in the relative velocity of this + * camera compared to those objects affect how audio is perceived (changing the audio's + * [AudioStreamPlayer3D.pitchScale]). */ DOPPLER_TRACKING_IDLE_STEP(1), /** - * Simulate [godot.Doppler effect](https://en.wikipedia.org/wiki/Doppler_effect) by tracking positions of objects that are changed in `_physics_process`. Changes in the relative velocity of this camera compared to those objects affect how audio is perceived (changing the audio's [godot.AudioStreamPlayer3D.pitchScale]). + * Simulate [url=https://en.wikipedia.org/wiki/Doppler_effect]Doppler effect[/url] by tracking + * positions of objects that are changed in `_physics_process`. Changes in the relative velocity of + * this camera compared to those objects affect how audio is perceived (changing the audio's + * [AudioStreamPlayer3D.pitchScale]). */ DOPPLER_TRACKING_PHYSICS_STEP(2), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CameraAttributes.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CameraAttributes.kt index a2237c3c4..874192d79 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CameraAttributes.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CameraAttributes.kt @@ -20,20 +20,22 @@ import kotlin.Int import kotlin.Suppress /** - * Parent class for camera settings. - * * Controls camera-specific attributes such as depth of field and exposure override. - * - * When used in a [godot.WorldEnvironment] it provides default settings for exposure, auto-exposure, and depth of field that will be used by all cameras without their own [godot.CameraAttributes], including the editor camera. When used in a [godot.Camera3D] it will override any [godot.CameraAttributes] set in the [godot.WorldEnvironment]. When used in [godot.VoxelGI] or [godot.LightmapGI], only the exposure settings will be used. - * - * See also [godot.Environment] for general 3D environment settings. - * - * This is a pure virtual class that is inherited by [godot.CameraAttributesPhysical] and [godot.CameraAttributesPractical]. + * When used in a [WorldEnvironment] it provides default settings for exposure, auto-exposure, and + * depth of field that will be used by all cameras without their own [CameraAttributes], including the + * editor camera. When used in a [Camera3D] it will override any [CameraAttributes] set in the + * [WorldEnvironment]. When used in [VoxelGI] or [LightmapGI], only the exposure settings will be used. + * See also [Environment] for general 3D environment settings. + * This is a pure virtual class that is inherited by [CameraAttributesPhysical] and + * [CameraAttributesPractical]. */ @GodotBaseType public open class CameraAttributes : Resource() { /** - * Sensitivity of camera sensors, measured in ISO. A higher sensitivity results in a brighter image. Only available when [godot.ProjectSettings.rendering/lightsAndShadows/usePhysicalLightUnits] is enabled. When [autoExposureEnabled] this can be used as a method of exposure compensation, doubling the value will increase the exposure value (measured in EV100) by 1 stop. + * Sensitivity of camera sensors, measured in ISO. A higher sensitivity results in a brighter + * image. Only available when [ProjectSettings.rendering/lightsAndShadows/usePhysicalLightUnits] is + * enabled. When [autoExposureEnabled] this can be used as a method of exposure compensation, + * doubling the value will increase the exposure value (measured in EV100) by 1 stop. */ public var exposureSensitivity: Float get() { @@ -61,7 +63,9 @@ public open class CameraAttributes : Resource() { } /** - * If `true`, enables the tonemapping auto exposure mode of the scene renderer. If `true`, the renderer will automatically determine the exposure setting to adapt to the scene's illumination and the observed light. + * If `true`, enables the tonemapping auto exposure mode of the scene renderer. If `true`, the + * renderer will automatically determine the exposure setting to adapt to the scene's illumination + * and the observed light. */ public var autoExposureEnabled: Boolean get() { @@ -89,7 +93,8 @@ public open class CameraAttributes : Resource() { } /** - * The speed of the auto exposure effect. Affects the time needed for the camera to perform auto exposure. + * The speed of the auto exposure effect. Affects the time needed for the camera to perform auto + * exposure. */ public var autoExposureSpeed: Float get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CameraFeed.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CameraFeed.kt index 30f82209d..fe3603ead 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CameraFeed.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CameraFeed.kt @@ -26,11 +26,11 @@ import kotlin.Suppress import kotlin.Unit /** - * A camera feed gives you access to a single physical camera attached to your device. - * - * A camera feed gives you access to a single physical camera attached to your device. When enabled, Godot will start capturing frames from the camera which can then be used. See also [godot.CameraServer]. - * - * **Note:** Many cameras will return YCbCr images which are split into two textures and need to be combined in a shader. Godot does this automatically for you if you set the environment to show the camera image in the background. + * A camera feed gives you access to a single physical camera attached to your device. When enabled, + * Godot will start capturing frames from the camera which can then be used. See also [CameraServer]. + * **Note:** Many cameras will return YCbCr images which are split into two textures and need to be + * combined in a shader. Godot does this automatically for you if you set the environment to show the + * camera image in the background. */ @GodotBaseType public open class CameraFeed : RefCounted() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CameraServer.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CameraServer.kt index b42fc9467..fefe901f8 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CameraServer.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CameraServer.kt @@ -24,23 +24,21 @@ import kotlin.Suppress import kotlin.Unit /** - * Server keeping track of different cameras accessible in Godot. - * - * The [godot.CameraServer] keeps track of different cameras accessible in Godot. These are external cameras such as webcams or the cameras on your phone. - * + * The [CameraServer] keeps track of different cameras accessible in Godot. These are external + * cameras such as webcams or the cameras on your phone. * It is notably used to provide AR modules with a video feed from the camera. - * - * **Note:** This class is currently only implemented on macOS and iOS. On other platforms, no [godot.CameraFeed]s will be available. + * **Note:** This class is currently only implemented on macOS and iOS. On other platforms, no + * [CameraFeed]s will be available. */ @GodotBaseType public object CameraServer : Object() { /** - * Emitted when a [godot.CameraFeed] is added (e.g. a webcam is plugged in). + * Emitted when a [CameraFeed] is added (e.g. a webcam is plugged in). */ public val cameraFeedAdded: Signal1 by signal("id") /** - * Emitted when a [godot.CameraFeed] is removed (e.g. a webcam is unplugged). + * Emitted when a [CameraFeed] is removed (e.g. a webcam is unplugged). */ public val cameraFeedRemoved: Signal1 by signal("id") @@ -50,7 +48,7 @@ public object CameraServer : Object() { } /** - * Returns the [godot.CameraFeed] corresponding to the camera with the given [index]. + * Returns the [CameraFeed] corresponding to the camera with the given [param index]. */ public fun getFeed(index: Int): CameraFeed? { TransferContext.writeArguments(LONG to index.toLong()) @@ -59,7 +57,7 @@ public object CameraServer : Object() { } /** - * Returns the number of [godot.CameraFeed]s registered. + * Returns the number of [CameraFeed]s registered. */ public fun getFeedCount(): Int { TransferContext.writeArguments() @@ -68,7 +66,7 @@ public object CameraServer : Object() { } /** - * Returns an array of [godot.CameraFeed]s. + * Returns an array of [CameraFeed]s. */ public fun feeds(): VariantArray { TransferContext.writeArguments() @@ -77,7 +75,7 @@ public object CameraServer : Object() { } /** - * Adds the camera [feed] to the camera server. + * Adds the camera [param feed] to the camera server. */ public fun addFeed(feed: CameraFeed): Unit { TransferContext.writeArguments(OBJECT to feed) @@ -85,7 +83,7 @@ public object CameraServer : Object() { } /** - * Removes the specified camera [feed]. + * Removes the specified camera [param feed]. */ public fun removeFeed(feed: CameraFeed): Unit { TransferContext.writeArguments(OBJECT to feed) @@ -100,7 +98,7 @@ public object CameraServer : Object() { */ FEED_RGBA_IMAGE(0), /** - * The [godot.YCbCr](https://en.wikipedia.org/wiki/YCbCr) camera image. + * The [url=https://en.wikipedia.org/wiki/YCbCr]YCbCr[/url] camera image. */ FEED_YCBCR_IMAGE(0), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CameraTexture.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CameraTexture.kt index 7ebbfe2bf..e83424962 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CameraTexture.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CameraTexture.kt @@ -19,16 +19,13 @@ import kotlin.Long import kotlin.Suppress /** - * Texture provided by a [godot.CameraFeed]. - * - * This texture gives access to the camera texture provided by a [godot.CameraFeed]. - * + * This texture gives access to the camera texture provided by a [CameraFeed]. * **Note:** Many cameras supply YCbCr images which need to be converted in a shader. */ @GodotBaseType public open class CameraTexture : Texture2D() { /** - * The ID of the [godot.CameraFeed] for which we want to display the image. + * The ID of the [CameraFeed] for which we want to display the image. */ public var cameraFeedId: Int get() { @@ -42,7 +39,8 @@ public open class CameraTexture : Texture2D() { } /** - * Which image within the [godot.CameraFeed] we want access to, important if the camera image is split in a Y and CbCr component. + * Which image within the [CameraFeed] we want access to, important if the camera image is split + * in a Y and CbCr component. */ public var whichFeed: CameraServer.FeedImage get() { @@ -56,7 +54,7 @@ public open class CameraTexture : Texture2D() { } /** - * Convenience property that gives access to the active property of the [godot.CameraFeed]. + * Convenience property that gives access to the active property of the [CameraFeed]. */ public var cameraIsActive: Boolean get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CanvasGroup.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CanvasGroup.kt index 9f5be167f..8a0bb3c5a 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CanvasGroup.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CanvasGroup.kt @@ -20,35 +20,40 @@ import kotlin.Int import kotlin.Suppress /** - * Merges several 2D nodes into a single draw operation. + * Child [CanvasItem] nodes of a [CanvasGroup] are drawn as a single object. It allows to e.g. draw + * overlapping translucent 2D nodes without blending (set [CanvasItem.selfModulate] property of + * [CanvasGroup] to achieve this effect). + * **Note:** The [CanvasGroup] uses a custom shader to read from the backbuffer to draw its + * children. Assigning a [Material] to the [CanvasGroup] overrides the builtin shader. To duplicate the + * behavior of the builtin shader in a custom [Shader] use the following: + * [codeblock] + * shader_type canvas_item; + * render_mode unshaded; * - * Child [godot.CanvasItem] nodes of a [godot.CanvasGroup] are drawn as a single object. It allows to e.g. draw overlapping translucent 2D nodes without blending (set [godot.CanvasItem.selfModulate] property of [godot.CanvasGroup] to achieve this effect). + * uniform sampler2D screen_texture : hint_screen_texture, repeat_disable, filter_nearest; * - * **Note:** The [godot.CanvasGroup] uses a custom shader to read from the backbuffer to draw its children. Assigning a [godot.Material] to the [godot.CanvasGroup] overrides the builtin shader. To duplicate the behavior of the builtin shader in a custom [godot.Shader] use the following: + * void fragment() { + * vec4 c = textureLod(screen_texture, SCREEN_UV, 0.0); * - * ``` - * shader_type canvas_item; - * render_mode unshaded; + * if (c.a > 0.0001) { + * c.rgb /= c.a; + * } * - * uniform sampler2D screen_texture : hint_screen_texture, repeat_disable, filter_nearest; - * - * void fragment() { - * vec4 c = textureLod(screen_texture, SCREEN_UV, 0.0); - * - * if (c.a > 0.0001) { - * c.rgb /= c.a; - * } - * - * COLOR *= c; - * } - * ``` - * - * **Note:** Since [godot.CanvasGroup] and [godot.CanvasItem.clipChildren] both utilize the backbuffer, children of a [godot.CanvasGroup] who have their [godot.CanvasItem.clipChildren] set to anything other than [godot.CanvasItem.CLIP_CHILDREN_DISABLED] will not function correctly. + * COLOR *= c; + * } + * [/codeblock] + * **Note:** Since [CanvasGroup] and [CanvasItem.clipChildren] both utilize the backbuffer, children + * of a [CanvasGroup] who have their [CanvasItem.clipChildren] set to anything other than [constant + * CanvasItem.CLIP_CHILDREN_DISABLED] will not function correctly. */ @GodotBaseType public open class CanvasGroup : Node2D() { /** - * Sets the size of a margin used to expand the drawable rect of this [godot.CanvasGroup]. The size of the [godot.CanvasGroup] is determined by fitting a rect around its children then expanding that rect by [fitMargin]. This increases both the backbuffer area used and the area covered by the [godot.CanvasGroup] both of which can reduce performance. This should be kept as small as possible and should only be expanded when an increased size is needed (e.g. for custom shader effects). + * Sets the size of a margin used to expand the drawable rect of this [CanvasGroup]. The size of + * the [CanvasGroup] is determined by fitting a rect around its children then expanding that rect by + * [fitMargin]. This increases both the backbuffer area used and the area covered by the + * [CanvasGroup] both of which can reduce performance. This should be kept as small as possible and + * should only be expanded when an increased size is needed (e.g. for custom shader effects). */ public var fitMargin: Float get() { @@ -62,7 +67,12 @@ public open class CanvasGroup : Node2D() { } /** - * Sets the size of the margin used to expand the clearing rect of this [godot.CanvasGroup]. This expands the area of the backbuffer that will be used by the [godot.CanvasGroup]. A smaller margin will reduce the area of the backbuffer used which can increase performance, however if [useMipmaps] is enabled, a small margin may result in mipmap errors at the edge of the [godot.CanvasGroup]. Accordingly, this should be left as small as possible, but should be increased if artifacts appear along the edges of the canvas group. + * Sets the size of the margin used to expand the clearing rect of this [CanvasGroup]. This + * expands the area of the backbuffer that will be used by the [CanvasGroup]. A smaller margin will + * reduce the area of the backbuffer used which can increase performance, however if [useMipmaps] is + * enabled, a small margin may result in mipmap errors at the edge of the [CanvasGroup]. Accordingly, + * this should be left as small as possible, but should be increased if artifacts appear along the + * edges of the canvas group. */ public var clearMargin: Float get() { @@ -76,7 +86,9 @@ public open class CanvasGroup : Node2D() { } /** - * If `true`, calculates mipmaps for the backbuffer before drawing the [godot.CanvasGroup] so that mipmaps can be used in a custom [godot.ShaderMaterial] attached to the [godot.CanvasGroup]. Generating mipmaps has a performance cost so this should not be enabled unless required. + * If `true`, calculates mipmaps for the backbuffer before drawing the [CanvasGroup] so that + * mipmaps can be used in a custom [ShaderMaterial] attached to the [CanvasGroup]. Generating mipmaps + * has a performance cost so this should not be enabled unless required. */ public var useMipmaps: Boolean get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CanvasItemMaterial.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CanvasItemMaterial.kt index ab7f2944c..7e471e4dc 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CanvasItemMaterial.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CanvasItemMaterial.kt @@ -19,9 +19,9 @@ import kotlin.Long import kotlin.Suppress /** - * A material for [godot.CanvasItem]s. - * - * [godot.CanvasItemMaterial]s provide a means of modifying the textures associated with a CanvasItem. They specialize in describing blend and lighting behaviors for textures. Use a [godot.ShaderMaterial] to more fully customize a material's interactions with a [godot.CanvasItem]. + * [CanvasItemMaterial]s provide a means of modifying the textures associated with a CanvasItem. + * They specialize in describing blend and lighting behaviors for textures. Use a [ShaderMaterial] to + * more fully customize a material's interactions with a [CanvasItem]. */ @GodotBaseType public open class CanvasItemMaterial : Material() { @@ -54,9 +54,11 @@ public open class CanvasItemMaterial : Material() { } /** - * If `true`, enable spritesheet-based animation features when assigned to [godot.GPUParticles2D] and [godot.CPUParticles2D] nodes. The [godot.ParticleProcessMaterial.animSpeedMax] or [godot.CPUParticles2D.animSpeedMax] should also be set to a positive value for the animation to play. - * - * This property (and other `particles_anim_*` properties that depend on it) has no effect on other types of nodes. + * If `true`, enable spritesheet-based animation features when assigned to [GPUParticles2D] and + * [CPUParticles2D] nodes. The [ParticleProcessMaterial.animSpeedMax] or + * [CPUParticles2D.animSpeedMax] should also be set to a positive value for the animation to play. + * This property (and other `particles_anim_*` properties that depend on it) has no effect on + * other types of nodes. */ public var particlesAnimation: Boolean get() { @@ -70,9 +72,10 @@ public open class CanvasItemMaterial : Material() { } /** - * The number of columns in the spritesheet assigned as [godot.Texture2D] for a [godot.GPUParticles2D] or [godot.CPUParticles2D]. - * - * **Note:** This property is only used and visible in the editor if [particlesAnimation] is `true`. + * The number of columns in the spritesheet assigned as [Texture2D] for a [GPUParticles2D] or + * [CPUParticles2D]. + * **Note:** This property is only used and visible in the editor if [particlesAnimation] is + * `true`. */ public var particlesAnimHFrames: Int get() { @@ -86,9 +89,10 @@ public open class CanvasItemMaterial : Material() { } /** - * The number of rows in the spritesheet assigned as [godot.Texture2D] for a [godot.GPUParticles2D] or [godot.CPUParticles2D]. - * - * **Note:** This property is only used and visible in the editor if [particlesAnimation] is `true`. + * The number of rows in the spritesheet assigned as [Texture2D] for a [GPUParticles2D] or + * [CPUParticles2D]. + * **Note:** This property is only used and visible in the editor if [particlesAnimation] is + * `true`. */ public var particlesAnimVFrames: Int get() { @@ -103,8 +107,8 @@ public open class CanvasItemMaterial : Material() { /** * If `true`, the particles animation will loop. - * - * **Note:** This property is only used and visible in the editor if [particlesAnimation] is `true`. + * **Note:** This property is only used and visible in the editor if [particlesAnimation] is + * `true`. */ public var particlesAnimLoop: Boolean get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CanvasLayer.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CanvasLayer.kt index c78a90977..99f5d943b 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CanvasLayer.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CanvasLayer.kt @@ -34,18 +34,20 @@ import kotlin.Suppress import kotlin.Unit /** - * A node used for independent rendering of objects within a 2D scene. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/515](https://godotengine.org/asset-library/asset/515) - * - * [godot.CanvasItem]-derived nodes that are direct or indirect children of a [godot.CanvasLayer] will be drawn in that layer. The layer is a numeric index that defines the draw order. The default 2D scene renders with index `0`, so a [godot.CanvasLayer] with index `-1` will be drawn below, and a [godot.CanvasLayer] with index `1` will be drawn above. This order will hold regardless of the [godot.CanvasItem.zIndex] of the nodes within each layer. - * - * [godot.CanvasLayer]s can be hidden and they can also optionally follow the viewport. This makes them useful for HUDs like health bar overlays (on layers `1` and higher) or backgrounds (on layers `-1` and lower). - * - * **Note:** Embedded [godot.Window]s are placed on layer `1024`. [godot.CanvasItem]s on layers `1025` and higher appear in front of embedded windows. - * - * **Note:** Each [godot.CanvasLayer] is drawn on one specific [godot.Viewport] and cannot be shared between multiple [godot.Viewport]s, see [customViewport]. When using multiple [godot.Viewport]s, for example in a split-screen game, you need create an individual [godot.CanvasLayer] for each [godot.Viewport] you want it to be drawn on. + * [CanvasItem]-derived nodes that are direct or indirect children of a [CanvasLayer] will be drawn + * in that layer. The layer is a numeric index that defines the draw order. The default 2D scene + * renders with index `0`, so a [CanvasLayer] with index `-1` will be drawn below, and a [CanvasLayer] + * with index `1` will be drawn above. This order will hold regardless of the [CanvasItem.zIndex] of + * the nodes within each layer. + * [CanvasLayer]s can be hidden and they can also optionally follow the viewport. This makes them + * useful for HUDs like health bar overlays (on layers `1` and higher) or backgrounds (on layers `-1` + * and lower). + * **Note:** Embedded [Window]s are placed on layer `1024`. [CanvasItem]s on layers `1025` and + * higher appear in front of embedded windows. + * **Note:** Each [CanvasLayer] is drawn on one specific [Viewport] and cannot be shared between + * multiple [Viewport]s, see [customViewport]. When using multiple [Viewport]s, for example in a + * split-screen game, you need create an individual [CanvasLayer] for each [Viewport] you want it to be + * drawn on. */ @GodotBaseType public open class CanvasLayer : Node() { @@ -56,8 +58,9 @@ public open class CanvasLayer : Node() { /** * Layer index for draw order. Lower values are drawn behind higher values. - * - * **Note:** If multiple CanvasLayers have the same layer index, [godot.CanvasItem] children of one CanvasLayer are drawn behind the [godot.CanvasItem] children of the other CanvasLayer. Which CanvasLayer is drawn in front is non-deterministic. + * **Note:** If multiple CanvasLayers have the same layer index, [CanvasItem] children of one + * CanvasLayer are drawn behind the [CanvasItem] children of the other CanvasLayer. Which CanvasLayer + * is drawn in front is non-deterministic. */ public var layer: Int get() { @@ -71,9 +74,9 @@ public open class CanvasLayer : Node() { } /** - * If `false`, any [godot.CanvasItem] under this [godot.CanvasLayer] will be hidden. - * - * Unlike [godot.CanvasItem.visible], visibility of a [godot.CanvasLayer] isn't propagated to underlying layers. + * If `false`, any [CanvasItem] under this [CanvasLayer] will be hidden. + * Unlike [CanvasItem.visible], visibility of a [CanvasLayer] isn't propagated to underlying + * layers. */ public var visible: Boolean get() { @@ -146,7 +149,8 @@ public open class CanvasLayer : Node() { } /** - * The custom [godot.Viewport] node assigned to the [godot.CanvasLayer]. If `null`, uses the default viewport instead. + * The custom [Viewport] node assigned to the [CanvasLayer]. If `null`, uses the default viewport + * instead. */ public var customViewport: Node? get() { @@ -160,8 +164,8 @@ public open class CanvasLayer : Node() { } /** - * If enabled, the [godot.CanvasLayer] will use the viewport's transform, so it will move when camera moves instead of being anchored in a fixed position on the screen. - * + * If enabled, the [CanvasLayer] will use the viewport's transform, so it will move when camera + * moves instead of being anchored in a fixed position on the screen. * Together with [followViewportScale] it can be used for a pseudo 3D effect. */ public var followViewportEnabled: Boolean @@ -176,7 +180,8 @@ public open class CanvasLayer : Node() { } /** - * Scales the layer when using [followViewportEnabled]. Layers moving into the foreground should have increasing scales, while layers moving into the background should have decreasing scales. + * Scales the layer when using [followViewportEnabled]. Layers moving into the foreground should + * have increasing scales, while layers moving into the background should have decreasing scales. */ public var followViewportScale: Float get() { @@ -267,7 +272,8 @@ public open class CanvasLayer : Node() { /** - * Shows any [godot.CanvasItem] under this [godot.CanvasLayer]. This is equivalent to setting [visible] to `true`. + * Shows any [CanvasItem] under this [CanvasLayer]. This is equivalent to setting [visible] to + * `true`. */ public fun show(): Unit { TransferContext.writeArguments() @@ -275,7 +281,8 @@ public open class CanvasLayer : Node() { } /** - * Hides any [godot.CanvasItem] under this [godot.CanvasLayer]. This is equivalent to setting [visible] to `false`. + * Hides any [CanvasItem] under this [CanvasLayer]. This is equivalent to setting [visible] to + * `false`. */ public fun hide(): Unit { TransferContext.writeArguments() @@ -283,7 +290,8 @@ public open class CanvasLayer : Node() { } /** - * Returns the transform from the [godot.CanvasLayer]s coordinate system to the [godot.Viewport]s coordinate system. + * Returns the transform from the [CanvasLayer]s coordinate system to the [Viewport]s coordinate + * system. */ public fun getFinalTransform(): Transform2D { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CanvasModulate.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CanvasModulate.kt index df2f8859e..5aec96991 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CanvasModulate.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CanvasModulate.kt @@ -21,9 +21,8 @@ import kotlin.Suppress import kotlin.Unit /** - * A node that applies a color tint to a canvas. - * - * [godot.CanvasModulate] applies a color tint to all nodes on a canvas. Only one can be used to tint a canvas, but [godot.CanvasLayer]s can be used to render things independently. + * [CanvasModulate] applies a color tint to all nodes on a canvas. Only one can be used to tint a + * canvas, but [CanvasLayer]s can be used to render things independently. */ @GodotBaseType public open class CanvasModulate : Node2D() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CapsuleMesh.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CapsuleMesh.kt index 1ea022029..2f0af0611 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CapsuleMesh.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CapsuleMesh.kt @@ -21,9 +21,7 @@ import kotlin.Long import kotlin.Suppress /** - * Class representing a capsule-shaped [godot.PrimitiveMesh]. - * - * Class representing a capsule-shaped [godot.PrimitiveMesh]. + * Class representing a capsule-shaped [PrimitiveMesh]. */ @GodotBaseType public open class CapsuleMesh : PrimitiveMesh() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CapsuleShape2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CapsuleShape2D.kt index f30945f5b..f548a26cb 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CapsuleShape2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CapsuleShape2D.kt @@ -19,11 +19,10 @@ import kotlin.Int import kotlin.Suppress /** - * A 2D capsule shape used for physics collision. - * - * A 2D capsule shape, intended for use in physics. Usually used to provide a shape for a [godot.CollisionShape2D]. - * - * **Performance:** [godot.CapsuleShape2D] is fast to check collisions against, but it is slower than [godot.RectangleShape2D] and [godot.CircleShape2D]. + * A 2D capsule shape, intended for use in physics. Usually used to provide a shape for a + * [CollisionShape2D]. + * **Performance:** [CapsuleShape2D] is fast to check collisions against, but it is slower than + * [RectangleShape2D] and [CircleShape2D]. */ @GodotBaseType public open class CapsuleShape2D : Shape2D() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CapsuleShape3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CapsuleShape3D.kt index 3c799b918..86c3fc078 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CapsuleShape3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CapsuleShape3D.kt @@ -19,14 +19,10 @@ import kotlin.Int import kotlin.Suppress /** - * A 3D capsule shape used for physics collision. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/675](https://godotengine.org/asset-library/asset/675) - * - * A 3D capsule shape, intended for use in physics. Usually used to provide a shape for a [godot.CollisionShape3D]. - * - * **Performance:** [godot.CapsuleShape3D] is fast to check collisions against. It is faster than [godot.CylinderShape3D], but slower than [godot.SphereShape3D] and [godot.BoxShape3D]. + * A 3D capsule shape, intended for use in physics. Usually used to provide a shape for a + * [CollisionShape3D]. + * **Performance:** [CapsuleShape3D] is fast to check collisions against. It is faster than + * [CylinderShape3D], but slower than [SphereShape3D] and [BoxShape3D]. */ @GodotBaseType public open class CapsuleShape3D : Shape3D() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CenterContainer.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CenterContainer.kt index b70fa345c..78ba41447 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CenterContainer.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CenterContainer.kt @@ -17,17 +17,13 @@ import kotlin.Int import kotlin.Suppress /** - * A container that keeps child controls in its center. - * - * Tutorials: - * [$DOCS_URL/tutorials/ui/gui_containers.html]($DOCS_URL/tutorials/ui/gui_containers.html) - * - * [godot.CenterContainer] is a container that keeps all of its child controls in its center at their minimum size. + * [CenterContainer] is a container that keeps all of its child controls in its center at their + * minimum size. */ @GodotBaseType public open class CenterContainer : Container() { /** - * If `true`, centers children relative to the [godot.CenterContainer]'s top left corner. + * If `true`, centers children relative to the [CenterContainer]'s top left corner. */ public var useTopLeft: Boolean get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CharFXTransform.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CharFXTransform.kt index 5aa91906b..0bc4e4fdc 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CharFXTransform.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CharFXTransform.kt @@ -37,17 +37,15 @@ import kotlin.Suppress import kotlin.Unit /** - * Controls how an individual character will be displayed in a [godot.RichTextEffect]. - * - * Tutorials: - * [https://github.com/Eoin-ONeill-Yokai/Godot-Rich-Text-Effect-Test-Project](https://github.com/Eoin-ONeill-Yokai/Godot-Rich-Text-Effect-Test-Project) - * - * By setting various properties on this object, you can control how individual characters will be displayed in a [godot.RichTextEffect]. + * By setting various properties on this object, you can control how individual characters will be + * displayed in a [RichTextEffect]. */ @GodotBaseType public open class CharFXTransform : RefCounted() { /** - * The current transform of the current glyph. It can be overridden (for example, by driving the position and rotation from a curve). You can also alter the existing value to apply transforms on top of other effects. + * The current transform of the current glyph. It can be overridden (for example, by driving the + * position and rotation from a curve). You can also alter the existing value to apply transforms on + * top of other effects. */ @CoreTypeLocalCopy public var transform: Transform2D @@ -62,7 +60,8 @@ public open class CharFXTransform : RefCounted() { } /** - * Absolute character range in the string, corresponding to the glyph. Setting this property won't affect drawing. + * Absolute character range in the string, corresponding to the glyph. Setting this property won't + * affect drawing. */ @CoreTypeLocalCopy public var range: Vector2i @@ -77,9 +76,10 @@ public open class CharFXTransform : RefCounted() { } /** - * The time elapsed since the [godot.RichTextLabel] was added to the scene tree (in seconds). Time stops when the [godot.RichTextLabel] is paused (see [godot.Node.processMode]). Resets when the text in the [godot.RichTextLabel] is changed. - * - * **Note:** Time still passes while the [godot.RichTextLabel] is hidden. + * The time elapsed since the [RichTextLabel] was added to the scene tree (in seconds). Time stops + * when the [RichTextLabel] is paused (see [Node.processMode]). Resets when the text in the + * [RichTextLabel] is changed. + * **Note:** Time still passes while the [RichTextLabel] is hidden. */ public var elapsedTime: Double get() { @@ -93,7 +93,9 @@ public open class CharFXTransform : RefCounted() { } /** - * If `true`, the character will be drawn. If `false`, the character will be hidden. Characters around hidden characters will reflow to take the space of hidden characters. If this is not desired, set their [color] to `Color(1, 1, 1, 0)` instead. + * If `true`, the character will be drawn. If `false`, the character will be hidden. Characters + * around hidden characters will reflow to take the space of hidden characters. If this is not + * desired, set their [color] to `Color(1, 1, 1, 0)` instead. */ public var visible: Boolean get() { @@ -107,7 +109,8 @@ public open class CharFXTransform : RefCounted() { } /** - * If `true`, FX transform is called for outline drawing. Setting this property won't affect drawing. + * If `true`, FX transform is called for outline drawing. Setting this property won't affect + * drawing. */ public var outline: Boolean get() { @@ -151,13 +154,16 @@ public open class CharFXTransform : RefCounted() { } /** - * Contains the arguments passed in the opening BBCode tag. By default, arguments are strings; if their contents match a type such as [bool], [int] or [float], they will be converted automatically. Color codes in the form `#rrggbb` or `#rgb` will be converted to an opaque [godot.core.Color]. String arguments may not contain spaces, even if they're quoted. If present, quotes will also be present in the final string. - * - * For example, the opening BBCode tag `[example foo=hello bar=true baz=42 color=#ffffff]` will map to the following [godot.core.Dictionary]: - * - * ``` - * {"foo": "hello", "bar": true, "baz": 42, "color": Color(1, 1, 1, 1)} - * ``` + * Contains the arguments passed in the opening BBCode tag. By default, arguments are strings; if + * their contents match a type such as [bool], [int] or [float], they will be converted + * automatically. Color codes in the form `#rrggbb` or `#rgb` will be converted to an opaque [Color]. + * String arguments may not contain spaces, even if they're quoted. If present, quotes will also be + * present in the final string. + * For example, the opening BBCode tag `[example foo=hello bar=true baz=42 color=#ffffff]` will + * map to the following [Dictionary]: + * [codeblock] + * {"foo": "hello", "bar": true, "baz": 42, "color": Color(1, 1, 1, 1)} + * [/codeblock] */ public var env: Dictionary get() { @@ -185,7 +191,8 @@ public open class CharFXTransform : RefCounted() { } /** - * Number of glyphs in the grapheme cluster. This value is set in the first glyph of a cluster. Setting this property won't affect drawing. + * Number of glyphs in the grapheme cluster. This value is set in the first glyph of a cluster. + * Setting this property won't affect drawing. */ public var glyphCount: Int get() { @@ -199,7 +206,8 @@ public open class CharFXTransform : RefCounted() { } /** - * Glyph flags. See [enum TextServer.GraphemeFlag] for more info. Setting this property won't affect drawing. + * Glyph flags. See [enum TextServer.GraphemeFlag] for more info. Setting this property won't + * affect drawing. */ public var glyphFlags: Int get() { @@ -213,7 +221,8 @@ public open class CharFXTransform : RefCounted() { } /** - * The character offset of the glyph, relative to the current [godot.RichTextEffect] custom block. Setting this property won't affect drawing. + * The character offset of the glyph, relative to the current [RichTextEffect] custom block. + * Setting this property won't affect drawing. */ public var relativeIndex: Int get() { @@ -246,7 +255,9 @@ public open class CharFXTransform : RefCounted() { } /** - * The current transform of the current glyph. It can be overridden (for example, by driving the position and rotation from a curve). You can also alter the existing value to apply transforms on top of other effects. + * The current transform of the current glyph. It can be overridden (for example, by driving the + * position and rotation from a curve). You can also alter the existing value to apply transforms on + * top of other effects. * * This is a helper function to make dealing with local copies easier. * @@ -270,7 +281,8 @@ public open class CharFXTransform : RefCounted() { /** - * Absolute character range in the string, corresponding to the glyph. Setting this property won't affect drawing. + * Absolute character range in the string, corresponding to the glyph. Setting this property won't + * affect drawing. * * This is a helper function to make dealing with local copies easier. * diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CharacterBody2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CharacterBody2D.kt index 4841cd1f0..099581b3a 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CharacterBody2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CharacterBody2D.kt @@ -29,19 +29,21 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * A 2D physics body specialized for characters moved by script. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/120](https://godotengine.org/asset-library/asset/120) - * - * [godot.CharacterBody2D] is a specialized class for physics bodies that are meant to be user-controlled. They are not affected by physics at all, but they affect other physics bodies in their path. They are mainly used to provide high-level API to move objects with wall and slope detection ([moveAndSlide] method) in addition to the general collision detection provided by [godot.PhysicsBody2D.moveAndCollide]. This makes it useful for highly configurable physics bodies that must move in specific ways and collide with the world, as is often the case with user-controlled characters. - * - * For game objects that don't require complex movement or collision detection, such as moving platforms, [godot.AnimatableBody2D] is simpler to configure. + * [CharacterBody2D] is a specialized class for physics bodies that are meant to be user-controlled. + * They are not affected by physics at all, but they affect other physics bodies in their path. They + * are mainly used to provide high-level API to move objects with wall and slope detection + * ([moveAndSlide] method) in addition to the general collision detection provided by + * [PhysicsBody2D.moveAndCollide]. This makes it useful for highly configurable physics bodies that + * must move in specific ways and collide with the world, as is often the case with user-controlled + * characters. + * For game objects that don't require complex movement or collision detection, such as moving + * platforms, [AnimatableBody2D] is simpler to configure. */ @GodotBaseType public open class CharacterBody2D : PhysicsBody2D() { /** - * Sets the motion mode which defines the behavior of [moveAndSlide]. See [enum MotionMode] constants for available modes. + * Sets the motion mode which defines the behavior of [moveAndSlide]. See [enum MotionMode] + * constants for available modes. */ public var motionMode: MotionMode get() { @@ -55,7 +57,10 @@ public open class CharacterBody2D : PhysicsBody2D() { } /** - * Vector pointing upwards, used to determine what is a wall and what is a floor (or a ceiling) when calling [moveAndSlide]. Defaults to [godot.Vector2.UP]. As the vector will be normalized it can't be equal to [godot.Vector2.ZERO], if you want all collisions to be reported as walls, consider using [MOTION_MODE_FLOATING] as [motionMode]. + * Vector pointing upwards, used to determine what is a wall and what is a floor (or a ceiling) + * when calling [moveAndSlide]. Defaults to [constant Vector2.UP]. As the vector will be normalized + * it can't be equal to [constant Vector2.ZERO], if you want all collisions to be reported as walls, + * consider using [constant MOTION_MODE_FLOATING] as [motionMode]. */ @CoreTypeLocalCopy public var upDirection: Vector2 @@ -85,7 +90,8 @@ public open class CharacterBody2D : PhysicsBody2D() { } /** - * If `true`, during a jump against the ceiling, the body will slide, if `false` it will be stopped and will fall vertically. + * If `true`, during a jump against the ceiling, the body will slide, if `false` it will be + * stopped and will fall vertically. */ public var slideOnCeiling: Boolean get() { @@ -99,7 +105,8 @@ public open class CharacterBody2D : PhysicsBody2D() { } /** - * Maximum number of times the body can change direction before it stops when calling [moveAndSlide]. + * Maximum number of times the body can change direction before it stops when calling + * [moveAndSlide]. */ public var maxSlides: Int get() { @@ -113,7 +120,9 @@ public open class CharacterBody2D : PhysicsBody2D() { } /** - * Minimum angle (in radians) where the body is allowed to slide when it encounters a slope. The default value equals 15 degrees. This property only affects movement when [motionMode] is [MOTION_MODE_FLOATING]. + * Minimum angle (in radians) where the body is allowed to slide when it encounters a slope. The + * default value equals 15 degrees. This property only affects movement when [motionMode] is + * [constant MOTION_MODE_FLOATING]. */ public var wallMinSlideAngle: Float get() { @@ -127,8 +136,8 @@ public open class CharacterBody2D : PhysicsBody2D() { } /** - * If `true`, the body will not slide on slopes when calling [moveAndSlide] when the body is standing still. - * + * If `true`, the body will not slide on slopes when calling [moveAndSlide] when the body is + * standing still. * If `false`, the body will slide on floor's slopes when [velocity] applies a downward force. */ public var floorStopOnSlope: Boolean @@ -143,9 +152,10 @@ public open class CharacterBody2D : PhysicsBody2D() { } /** - * If `false` (by default), the body will move faster on downward slopes and slower on upward slopes. - * - * If `true`, the body will always move at the same speed on the ground no matter the slope. Note that you need to use [floorSnapLength] to stick along a downward slope at constant speed. + * If `false` (by default), the body will move faster on downward slopes and slower on upward + * slopes. + * If `true`, the body will always move at the same speed on the ground no matter the slope. Note + * that you need to use [floorSnapLength] to stick along a downward slope at constant speed. */ public var floorConstantSpeed: Boolean get() { @@ -159,7 +169,8 @@ public open class CharacterBody2D : PhysicsBody2D() { } /** - * If `true`, the body will be able to move on the floor only. This option avoids to be able to walk on walls, it will however allow to slide down along them. + * If `true`, the body will be able to move on the floor only. This option avoids to be able to + * walk on walls, it will however allow to slide down along them. */ public var floorBlockOnWall: Boolean get() { @@ -173,7 +184,8 @@ public open class CharacterBody2D : PhysicsBody2D() { } /** - * Maximum angle (in radians) where a slope is still considered a floor (or a ceiling), rather than a wall, when calling [moveAndSlide]. The default value equals 45 degrees. + * Maximum angle (in radians) where a slope is still considered a floor (or a ceiling), rather + * than a wall, when calling [moveAndSlide]. The default value equals 45 degrees. */ public var floorMaxAngle: Float get() { @@ -187,9 +199,14 @@ public open class CharacterBody2D : PhysicsBody2D() { } /** - * Sets a snapping distance. When set to a value different from `0.0`, the body is kept attached to slopes when calling [moveAndSlide]. The snapping vector is determined by the given distance along the opposite direction of the [upDirection]. - * - * As long as the snapping vector is in contact with the ground and the body moves against [upDirection], the body will remain attached to the surface. Snapping is not applied if the body moves along [upDirection], meaning it contains vertical rising velocity, so it will be able to detach from the ground when jumping or when the body is pushed up by something. If you want to apply a snap without taking into account the velocity, use [applyFloorSnap]. + * Sets a snapping distance. When set to a value different from `0.0`, the body is kept attached + * to slopes when calling [moveAndSlide]. The snapping vector is determined by the given distance + * along the opposite direction of the [upDirection]. + * As long as the snapping vector is in contact with the ground and the body moves against + * [upDirection], the body will remain attached to the surface. Snapping is not applied if the body + * moves along [upDirection], meaning it contains vertical rising velocity, so it will be able to + * detach from the ground when jumping or when the body is pushed up by something. If you want to + * apply a snap without taking into account the velocity, use [applyFloorSnap]. */ public var floorSnapLength: Float get() { @@ -203,7 +220,9 @@ public open class CharacterBody2D : PhysicsBody2D() { } /** - * Sets the behavior to apply when you leave a moving platform. By default, to be physically accurate, when you leave the last platform velocity is applied. See [enum PlatformOnLeave] constants for available behavior. + * Sets the behavior to apply when you leave a moving platform. By default, to be physically + * accurate, when you leave the last platform velocity is applied. See [enum PlatformOnLeave] + * constants for available behavior. */ public var platformOnLeave: PlatformOnLeave get() { @@ -217,7 +236,9 @@ public open class CharacterBody2D : PhysicsBody2D() { } /** - * Collision layers that will be included for detecting floor bodies that will act as moving platforms to be followed by the [godot.CharacterBody2D]. By default, all floor bodies are detected and propagate their velocity. + * Collision layers that will be included for detecting floor bodies that will act as moving + * platforms to be followed by the [CharacterBody2D]. By default, all floor bodies are detected and + * propagate their velocity. */ public var platformFloorLayers: Long get() { @@ -231,7 +252,8 @@ public open class CharacterBody2D : PhysicsBody2D() { } /** - * Collision layers that will be included for detecting wall bodies that will act as moving platforms to be followed by the [godot.CharacterBody2D]. By default, all wall bodies are ignored. + * Collision layers that will be included for detecting wall bodies that will act as moving + * platforms to be followed by the [CharacterBody2D]. By default, all wall bodies are ignored. */ public var platformWallLayers: Long get() { @@ -246,12 +268,13 @@ public open class CharacterBody2D : PhysicsBody2D() { /** * Extra margin used for collision recovery when calling [moveAndSlide]. - * - * If the body is at least this close to another body, it will consider them to be colliding and will be pushed away before performing the actual motion. - * - * A higher value means it's more flexible for detecting collision, which helps with consistently detecting walls and floors. - * - * A lower value forces the collision algorithm to use more exact detection, so it can be used in cases that specifically require precision, e.g at very low scale to avoid visible jittering, or for stability with a stack of character bodies. + * If the body is at least this close to another body, it will consider them to be colliding and + * will be pushed away before performing the actual motion. + * A higher value means it's more flexible for detecting collision, which helps with consistently + * detecting walls and floors. + * A lower value forces the collision algorithm to use more exact detection, so it can be used in + * cases that specifically require precision, e.g at very low scale to avoid visible jittering, or + * for stability with a stack of character bodies. */ public var safeMargin: Float get() { @@ -270,7 +293,10 @@ public open class CharacterBody2D : PhysicsBody2D() { } /** - * Vector pointing upwards, used to determine what is a wall and what is a floor (or a ceiling) when calling [moveAndSlide]. Defaults to [godot.Vector2.UP]. As the vector will be normalized it can't be equal to [godot.Vector2.ZERO], if you want all collisions to be reported as walls, consider using [MOTION_MODE_FLOATING] as [motionMode]. + * Vector pointing upwards, used to determine what is a wall and what is a floor (or a ceiling) + * when calling [moveAndSlide]. Defaults to [constant Vector2.UP]. As the vector will be normalized + * it can't be equal to [constant Vector2.ZERO], if you want all collisions to be reported as walls, + * consider using [constant MOTION_MODE_FLOATING] as [motionMode]. * * This is a helper function to make dealing with local copies easier. * @@ -318,14 +344,17 @@ public open class CharacterBody2D : PhysicsBody2D() { /** - * Moves the body based on [velocity]. If the body collides with another, it will slide along the other body (by default only on floor) rather than stop immediately. If the other body is a [godot.CharacterBody2D] or [godot.RigidBody2D], it will also be affected by the motion of the other body. You can use this to make moving and rotating platforms, or to make nodes push other nodes. - * - * Modifies [velocity] if a slide collision occurred. To get the latest collision call [getLastSlideCollision], for detailed information about collisions that occurred, use [getSlideCollision]. - * - * When the body touches a moving platform, the platform's velocity is automatically added to the body motion. If a collision occurs due to the platform's motion, it will always be first in the slide collisions. - * + * Moves the body based on [velocity]. If the body collides with another, it will slide along the + * other body (by default only on floor) rather than stop immediately. If the other body is a + * [CharacterBody2D] or [RigidBody2D], it will also be affected by the motion of the other body. You + * can use this to make moving and rotating platforms, or to make nodes push other nodes. + * Modifies [velocity] if a slide collision occurred. To get the latest collision call + * [getLastSlideCollision], for detailed information about collisions that occurred, use + * [getSlideCollision]. + * When the body touches a moving platform, the platform's velocity is automatically added to the + * body motion. If a collision occurs due to the platform's motion, it will always be first in the + * slide collisions. * The general behavior and available properties change according to the [motionMode]. - * * Returns `true` if the body collided, otherwise, returns `false`. */ public fun moveAndSlide(): Boolean { @@ -335,7 +364,8 @@ public open class CharacterBody2D : PhysicsBody2D() { } /** - * Allows to manually apply a snap to the floor regardless of the body's velocity. This function does nothing when [isOnFloor] returns `true`. + * Allows to manually apply a snap to the floor regardless of the body's velocity. This function + * does nothing when [isOnFloor] returns `true`. */ public fun applyFloorSnap(): Unit { TransferContext.writeArguments() @@ -343,7 +373,9 @@ public open class CharacterBody2D : PhysicsBody2D() { } /** - * Returns `true` if the body collided with the floor on the last call of [moveAndSlide]. Otherwise, returns `false`. The [upDirection] and [floorMaxAngle] are used to determine whether a surface is "floor" or not. + * Returns `true` if the body collided with the floor on the last call of [moveAndSlide]. + * Otherwise, returns `false`. The [upDirection] and [floorMaxAngle] are used to determine whether a + * surface is "floor" or not. */ public fun isOnFloor(): Boolean { TransferContext.writeArguments() @@ -352,7 +384,9 @@ public open class CharacterBody2D : PhysicsBody2D() { } /** - * Returns `true` if the body collided only with the floor on the last call of [moveAndSlide]. Otherwise, returns `false`. The [upDirection] and [floorMaxAngle] are used to determine whether a surface is "floor" or not. + * Returns `true` if the body collided only with the floor on the last call of [moveAndSlide]. + * Otherwise, returns `false`. The [upDirection] and [floorMaxAngle] are used to determine whether a + * surface is "floor" or not. */ public fun isOnFloorOnly(): Boolean { TransferContext.writeArguments() @@ -361,7 +395,9 @@ public open class CharacterBody2D : PhysicsBody2D() { } /** - * Returns `true` if the body collided with the ceiling on the last call of [moveAndSlide]. Otherwise, returns `false`. The [upDirection] and [floorMaxAngle] are used to determine whether a surface is "ceiling" or not. + * Returns `true` if the body collided with the ceiling on the last call of [moveAndSlide]. + * Otherwise, returns `false`. The [upDirection] and [floorMaxAngle] are used to determine whether a + * surface is "ceiling" or not. */ public fun isOnCeiling(): Boolean { TransferContext.writeArguments() @@ -370,7 +406,9 @@ public open class CharacterBody2D : PhysicsBody2D() { } /** - * Returns `true` if the body collided only with the ceiling on the last call of [moveAndSlide]. Otherwise, returns `false`. The [upDirection] and [floorMaxAngle] are used to determine whether a surface is "ceiling" or not. + * Returns `true` if the body collided only with the ceiling on the last call of [moveAndSlide]. + * Otherwise, returns `false`. The [upDirection] and [floorMaxAngle] are used to determine whether a + * surface is "ceiling" or not. */ public fun isOnCeilingOnly(): Boolean { TransferContext.writeArguments() @@ -379,7 +417,9 @@ public open class CharacterBody2D : PhysicsBody2D() { } /** - * Returns `true` if the body collided with a wall on the last call of [moveAndSlide]. Otherwise, returns `false`. The [upDirection] and [floorMaxAngle] are used to determine whether a surface is "wall" or not. + * Returns `true` if the body collided with a wall on the last call of [moveAndSlide]. Otherwise, + * returns `false`. The [upDirection] and [floorMaxAngle] are used to determine whether a surface is + * "wall" or not. */ public fun isOnWall(): Boolean { TransferContext.writeArguments() @@ -388,7 +428,9 @@ public open class CharacterBody2D : PhysicsBody2D() { } /** - * Returns `true` if the body collided only with a wall on the last call of [moveAndSlide]. Otherwise, returns `false`. The [upDirection] and [floorMaxAngle] are used to determine whether a surface is "wall" or not. + * Returns `true` if the body collided only with a wall on the last call of [moveAndSlide]. + * Otherwise, returns `false`. The [upDirection] and [floorMaxAngle] are used to determine whether a + * surface is "wall" or not. */ public fun isOnWallOnly(): Boolean { TransferContext.writeArguments() @@ -397,7 +439,8 @@ public open class CharacterBody2D : PhysicsBody2D() { } /** - * Returns the surface normal of the floor at the last collision point. Only valid after calling [moveAndSlide] and when [isOnFloor] returns `true`. + * Returns the surface normal of the floor at the last collision point. Only valid after calling + * [moveAndSlide] and when [isOnFloor] returns `true`. */ public fun getFloorNormal(): Vector2 { TransferContext.writeArguments() @@ -406,7 +449,8 @@ public open class CharacterBody2D : PhysicsBody2D() { } /** - * Returns the surface normal of the wall at the last collision point. Only valid after calling [moveAndSlide] and when [isOnWall] returns `true`. + * Returns the surface normal of the wall at the last collision point. Only valid after calling + * [moveAndSlide] and when [isOnWall] returns `true`. */ public fun getWallNormal(): Vector2 { TransferContext.writeArguments() @@ -415,7 +459,9 @@ public open class CharacterBody2D : PhysicsBody2D() { } /** - * Returns the last motion applied to the [godot.CharacterBody2D] during the last call to [moveAndSlide]. The movement can be split into multiple motions when sliding occurs, and this method return the last one, which is useful to retrieve the current direction of the movement. + * Returns the last motion applied to the [CharacterBody2D] during the last call to + * [moveAndSlide]. The movement can be split into multiple motions when sliding occurs, and this + * method return the last one, which is useful to retrieve the current direction of the movement. */ public fun getLastMotion(): Vector2 { TransferContext.writeArguments() @@ -433,7 +479,9 @@ public open class CharacterBody2D : PhysicsBody2D() { } /** - * Returns the current real velocity since the last call to [moveAndSlide]. For example, when you climb a slope, you will move diagonally even though the velocity is horizontal. This method returns the diagonal movement, as opposed to [velocity] which returns the requested velocity. + * Returns the current real velocity since the last call to [moveAndSlide]. For example, when you + * climb a slope, you will move diagonally even though the velocity is horizontal. This method + * returns the diagonal movement, as opposed to [velocity] which returns the requested velocity. */ public fun getRealVelocity(): Vector2 { TransferContext.writeArguments() @@ -442,7 +490,9 @@ public open class CharacterBody2D : PhysicsBody2D() { } /** - * Returns the floor's collision angle at the last collision point according to [upDirection], which is [godot.Vector2.UP] by default. This value is always positive and only valid after calling [moveAndSlide] and when [isOnFloor] returns `true`. + * Returns the floor's collision angle at the last collision point according to [param + * up_direction], which is [constant Vector2.UP] by default. This value is always positive and only + * valid after calling [moveAndSlide] and when [isOnFloor] returns `true`. */ @JvmOverloads public fun getFloorAngle(upDirection: Vector2 = Vector2(0, -1)): Float { @@ -452,7 +502,8 @@ public open class CharacterBody2D : PhysicsBody2D() { } /** - * Returns the linear velocity of the platform at the last collision point. Only valid after calling [moveAndSlide]. + * Returns the linear velocity of the platform at the last collision point. Only valid after + * calling [moveAndSlide]. */ public fun getPlatformVelocity(): Vector2 { TransferContext.writeArguments() @@ -461,7 +512,8 @@ public open class CharacterBody2D : PhysicsBody2D() { } /** - * Returns the number of times the body collided and changed direction during the last call to [moveAndSlide]. + * Returns the number of times the body collided and changed direction during the last call to + * [moveAndSlide]. */ public fun getSlideCollisionCount(): Int { TransferContext.writeArguments() @@ -470,37 +522,26 @@ public open class CharacterBody2D : PhysicsBody2D() { } /** - * Returns a [godot.KinematicCollision2D], which contains information about a collision that occurred during the last call to [moveAndSlide]. Since the body can collide several times in a single call to [moveAndSlide], you must specify the index of the collision in the range 0 to ([getSlideCollisionCount] - 1). - * + * Returns a [KinematicCollision2D], which contains information about a collision that occurred + * during the last call to [moveAndSlide]. Since the body can collide several times in a single call + * to [moveAndSlide], you must specify the index of the collision in the range 0 to + * ([getSlideCollisionCount] - 1). * **Example usage:** * - * [codeblocks] - * - * [gdscript] - * + * gdscript: + * ```gdscript * for i in get_slide_collision_count(): - * * var collision = get_slide_collision(i) - * * print("Collided with: ", collision.get_collider().name) - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * for (int i = 0; i < GetSlideCollisionCount(); i++) - * * { - * * KinematicCollision2D collision = GetSlideCollision(i); - * * GD.Print("Collided with: ", (collision.GetCollider() as Node).Name); - * * } - * - * [/csharp] - * - * [/codeblocks] + * ``` */ public fun getSlideCollision(slideIdx: Int): KinematicCollision2D? { TransferContext.writeArguments(LONG to slideIdx.toLong()) @@ -509,7 +550,8 @@ public open class CharacterBody2D : PhysicsBody2D() { } /** - * Returns a [godot.KinematicCollision2D], which contains information about the latest collision that occurred during the last call to [moveAndSlide]. + * Returns a [KinematicCollision2D], which contains information about the latest collision that + * occurred during the last call to [moveAndSlide]. */ public fun getLastSlideCollision(): KinematicCollision2D? { TransferContext.writeArguments() @@ -521,11 +563,15 @@ public open class CharacterBody2D : PhysicsBody2D() { id: Long, ) { /** - * Apply when notions of walls, ceiling and floor are relevant. In this mode the body motion will react to slopes (acceleration/slowdown). This mode is suitable for sided games like platformers. + * Apply when notions of walls, ceiling and floor are relevant. In this mode the body motion + * will react to slopes (acceleration/slowdown). This mode is suitable for sided games like + * platformers. */ MOTION_MODE_GROUNDED(0), /** - * Apply when there is no notion of floor or ceiling. All collisions will be reported as `on_wall`. In this mode, when you slide, the speed will always be constant. This mode is suitable for top-down games. + * Apply when there is no notion of floor or ceiling. All collisions will be reported as + * `on_wall`. In this mode, when you slide, the speed will always be constant. This mode is + * suitable for top-down games. */ MOTION_MODE_FLOATING(1), ; @@ -548,7 +594,9 @@ public open class CharacterBody2D : PhysicsBody2D() { */ PLATFORM_ON_LEAVE_ADD_VELOCITY(0), /** - * Add the last platform velocity to the [velocity] when you leave a moving platform, but any downward motion is ignored. It's useful to keep full jump height even when the platform is moving down. + * Add the last platform velocity to the [velocity] when you leave a moving platform, but any + * downward motion is ignored. It's useful to keep full jump height even when the platform is + * moving down. */ PLATFORM_ON_LEAVE_ADD_UPWARD_VELOCITY(1), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CharacterBody3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CharacterBody3D.kt index 820f10f34..23493504d 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CharacterBody3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CharacterBody3D.kt @@ -29,19 +29,21 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * A 3D physics body specialized for characters moved by script. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/678](https://godotengine.org/asset-library/asset/678) - * - * [godot.CharacterBody3D] is a specialized class for physics bodies that are meant to be user-controlled. They are not affected by physics at all, but they affect other physics bodies in their path. They are mainly used to provide high-level API to move objects with wall and slope detection ([moveAndSlide] method) in addition to the general collision detection provided by [godot.PhysicsBody3D.moveAndCollide]. This makes it useful for highly configurable physics bodies that must move in specific ways and collide with the world, as is often the case with user-controlled characters. - * - * For game objects that don't require complex movement or collision detection, such as moving platforms, [godot.AnimatableBody3D] is simpler to configure. + * [CharacterBody3D] is a specialized class for physics bodies that are meant to be user-controlled. + * They are not affected by physics at all, but they affect other physics bodies in their path. They + * are mainly used to provide high-level API to move objects with wall and slope detection + * ([moveAndSlide] method) in addition to the general collision detection provided by + * [PhysicsBody3D.moveAndCollide]. This makes it useful for highly configurable physics bodies that + * must move in specific ways and collide with the world, as is often the case with user-controlled + * characters. + * For game objects that don't require complex movement or collision detection, such as moving + * platforms, [AnimatableBody3D] is simpler to configure. */ @GodotBaseType public open class CharacterBody3D : PhysicsBody3D() { /** - * Sets the motion mode which defines the behavior of [moveAndSlide]. See [enum MotionMode] constants for available modes. + * Sets the motion mode which defines the behavior of [moveAndSlide]. See [enum MotionMode] + * constants for available modes. */ public var motionMode: MotionMode get() { @@ -55,7 +57,10 @@ public open class CharacterBody3D : PhysicsBody3D() { } /** - * Vector pointing upwards, used to determine what is a wall and what is a floor (or a ceiling) when calling [moveAndSlide]. Defaults to [godot.Vector3.UP]. As the vector will be normalized it can't be equal to [godot.Vector3.ZERO], if you want all collisions to be reported as walls, consider using [MOTION_MODE_FLOATING] as [motionMode]. + * Vector pointing upwards, used to determine what is a wall and what is a floor (or a ceiling) + * when calling [moveAndSlide]. Defaults to [constant Vector3.UP]. As the vector will be normalized + * it can't be equal to [constant Vector3.ZERO], if you want all collisions to be reported as walls, + * consider using [constant MOTION_MODE_FLOATING] as [motionMode]. */ @CoreTypeLocalCopy public var upDirection: Vector3 @@ -70,7 +75,8 @@ public open class CharacterBody3D : PhysicsBody3D() { } /** - * If `true`, during a jump against the ceiling, the body will slide, if `false` it will be stopped and will fall vertically. + * If `true`, during a jump against the ceiling, the body will slide, if `false` it will be + * stopped and will fall vertically. */ public var slideOnCeiling: Boolean get() { @@ -84,7 +90,8 @@ public open class CharacterBody3D : PhysicsBody3D() { } /** - * Current velocity vector (typically meters per second), used and modified during calls to [moveAndSlide]. + * Current velocity vector (typically meters per second), used and modified during calls to + * [moveAndSlide]. */ @CoreTypeLocalCopy public var velocity: Vector3 @@ -99,7 +106,8 @@ public open class CharacterBody3D : PhysicsBody3D() { } /** - * Maximum number of times the body can change direction before it stops when calling [moveAndSlide]. + * Maximum number of times the body can change direction before it stops when calling + * [moveAndSlide]. */ public var maxSlides: Int get() { @@ -113,7 +121,9 @@ public open class CharacterBody3D : PhysicsBody3D() { } /** - * Minimum angle (in radians) where the body is allowed to slide when it encounters a slope. The default value equals 15 degrees. When [motionMode] is [MOTION_MODE_GROUNDED], it only affects movement if [floorBlockOnWall] is `true`. + * Minimum angle (in radians) where the body is allowed to slide when it encounters a slope. The + * default value equals 15 degrees. When [motionMode] is [constant MOTION_MODE_GROUNDED], it only + * affects movement if [floorBlockOnWall] is `true`. */ public var wallMinSlideAngle: Float get() { @@ -127,8 +137,8 @@ public open class CharacterBody3D : PhysicsBody3D() { } /** - * If `true`, the body will not slide on slopes when calling [moveAndSlide] when the body is standing still. - * + * If `true`, the body will not slide on slopes when calling [moveAndSlide] when the body is + * standing still. * If `false`, the body will slide on floor's slopes when [velocity] applies a downward force. */ public var floorStopOnSlope: Boolean @@ -143,9 +153,10 @@ public open class CharacterBody3D : PhysicsBody3D() { } /** - * If `false` (by default), the body will move faster on downward slopes and slower on upward slopes. - * - * If `true`, the body will always move at the same speed on the ground no matter the slope. Note that you need to use [floorSnapLength] to stick along a downward slope at constant speed. + * If `false` (by default), the body will move faster on downward slopes and slower on upward + * slopes. + * If `true`, the body will always move at the same speed on the ground no matter the slope. Note + * that you need to use [floorSnapLength] to stick along a downward slope at constant speed. */ public var floorConstantSpeed: Boolean get() { @@ -159,7 +170,8 @@ public open class CharacterBody3D : PhysicsBody3D() { } /** - * If `true`, the body will be able to move on the floor only. This option avoids to be able to walk on walls, it will however allow to slide down along them. + * If `true`, the body will be able to move on the floor only. This option avoids to be able to + * walk on walls, it will however allow to slide down along them. */ public var floorBlockOnWall: Boolean get() { @@ -173,7 +185,8 @@ public open class CharacterBody3D : PhysicsBody3D() { } /** - * Maximum angle (in radians) where a slope is still considered a floor (or a ceiling), rather than a wall, when calling [moveAndSlide]. The default value equals 45 degrees. + * Maximum angle (in radians) where a slope is still considered a floor (or a ceiling), rather + * than a wall, when calling [moveAndSlide]. The default value equals 45 degrees. */ public var floorMaxAngle: Float get() { @@ -187,9 +200,14 @@ public open class CharacterBody3D : PhysicsBody3D() { } /** - * Sets a snapping distance. When set to a value different from `0.0`, the body is kept attached to slopes when calling [moveAndSlide]. The snapping vector is determined by the given distance along the opposite direction of the [upDirection]. - * - * As long as the snapping vector is in contact with the ground and the body moves against [upDirection], the body will remain attached to the surface. Snapping is not applied if the body moves along [upDirection], meaning it contains vertical rising velocity, so it will be able to detach from the ground when jumping or when the body is pushed up by something. If you want to apply a snap without taking into account the velocity, use [applyFloorSnap]. + * Sets a snapping distance. When set to a value different from `0.0`, the body is kept attached + * to slopes when calling [moveAndSlide]. The snapping vector is determined by the given distance + * along the opposite direction of the [upDirection]. + * As long as the snapping vector is in contact with the ground and the body moves against + * [upDirection], the body will remain attached to the surface. Snapping is not applied if the body + * moves along [upDirection], meaning it contains vertical rising velocity, so it will be able to + * detach from the ground when jumping or when the body is pushed up by something. If you want to + * apply a snap without taking into account the velocity, use [applyFloorSnap]. */ public var floorSnapLength: Float get() { @@ -203,7 +221,9 @@ public open class CharacterBody3D : PhysicsBody3D() { } /** - * Sets the behavior to apply when you leave a moving platform. By default, to be physically accurate, when you leave the last platform velocity is applied. See [enum PlatformOnLeave] constants for available behavior. + * Sets the behavior to apply when you leave a moving platform. By default, to be physically + * accurate, when you leave the last platform velocity is applied. See [enum PlatformOnLeave] + * constants for available behavior. */ public var platformOnLeave: PlatformOnLeave get() { @@ -217,7 +237,9 @@ public open class CharacterBody3D : PhysicsBody3D() { } /** - * Collision layers that will be included for detecting floor bodies that will act as moving platforms to be followed by the [godot.CharacterBody3D]. By default, all floor bodies are detected and propagate their velocity. + * Collision layers that will be included for detecting floor bodies that will act as moving + * platforms to be followed by the [CharacterBody3D]. By default, all floor bodies are detected and + * propagate their velocity. */ public var platformFloorLayers: Long get() { @@ -231,7 +253,8 @@ public open class CharacterBody3D : PhysicsBody3D() { } /** - * Collision layers that will be included for detecting wall bodies that will act as moving platforms to be followed by the [godot.CharacterBody3D]. By default, all wall bodies are ignored. + * Collision layers that will be included for detecting wall bodies that will act as moving + * platforms to be followed by the [CharacterBody3D]. By default, all wall bodies are ignored. */ public var platformWallLayers: Long get() { @@ -246,12 +269,13 @@ public open class CharacterBody3D : PhysicsBody3D() { /** * Extra margin used for collision recovery when calling [moveAndSlide]. - * - * If the body is at least this close to another body, it will consider them to be colliding and will be pushed away before performing the actual motion. - * - * A higher value means it's more flexible for detecting collision, which helps with consistently detecting walls and floors. - * - * A lower value forces the collision algorithm to use more exact detection, so it can be used in cases that specifically require precision, e.g at very low scale to avoid visible jittering, or for stability with a stack of character bodies. + * If the body is at least this close to another body, it will consider them to be colliding and + * will be pushed away before performing the actual motion. + * A higher value means it's more flexible for detecting collision, which helps with consistently + * detecting walls and floors. + * A lower value forces the collision algorithm to use more exact detection, so it can be used in + * cases that specifically require precision, e.g at very low scale to avoid visible jittering, or + * for stability with a stack of character bodies. */ public var safeMargin: Float get() { @@ -270,7 +294,10 @@ public open class CharacterBody3D : PhysicsBody3D() { } /** - * Vector pointing upwards, used to determine what is a wall and what is a floor (or a ceiling) when calling [moveAndSlide]. Defaults to [godot.Vector3.UP]. As the vector will be normalized it can't be equal to [godot.Vector3.ZERO], if you want all collisions to be reported as walls, consider using [MOTION_MODE_FLOATING] as [motionMode]. + * Vector pointing upwards, used to determine what is a wall and what is a floor (or a ceiling) + * when calling [moveAndSlide]. Defaults to [constant Vector3.UP]. As the vector will be normalized + * it can't be equal to [constant Vector3.ZERO], if you want all collisions to be reported as walls, + * consider using [constant MOTION_MODE_FLOATING] as [motionMode]. * * This is a helper function to make dealing with local copies easier. * @@ -294,7 +321,8 @@ public open class CharacterBody3D : PhysicsBody3D() { /** - * Current velocity vector (typically meters per second), used and modified during calls to [moveAndSlide]. + * Current velocity vector (typically meters per second), used and modified during calls to + * [moveAndSlide]. * * This is a helper function to make dealing with local copies easier. * @@ -318,12 +346,16 @@ public open class CharacterBody3D : PhysicsBody3D() { /** - * Moves the body based on [velocity]. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a [godot.CharacterBody3D] or [godot.RigidBody3D], it will also be affected by the motion of the other body. You can use this to make moving and rotating platforms, or to make nodes push other nodes. - * - * Modifies [velocity] if a slide collision occurred. To get the latest collision call [getLastSlideCollision], for more detailed information about collisions that occurred, use [getSlideCollision]. - * - * When the body touches a moving platform, the platform's velocity is automatically added to the body motion. If a collision occurs due to the platform's motion, it will always be first in the slide collisions. - * + * Moves the body based on [velocity]. If the body collides with another, it will slide along the + * other body rather than stop immediately. If the other body is a [CharacterBody3D] or + * [RigidBody3D], it will also be affected by the motion of the other body. You can use this to make + * moving and rotating platforms, or to make nodes push other nodes. + * Modifies [velocity] if a slide collision occurred. To get the latest collision call + * [getLastSlideCollision], for more detailed information about collisions that occurred, use + * [getSlideCollision]. + * When the body touches a moving platform, the platform's velocity is automatically added to the + * body motion. If a collision occurs due to the platform's motion, it will always be first in the + * slide collisions. * Returns `true` if the body collided, otherwise, returns `false`. */ public fun moveAndSlide(): Boolean { @@ -333,7 +365,8 @@ public open class CharacterBody3D : PhysicsBody3D() { } /** - * Allows to manually apply a snap to the floor regardless of the body's velocity. This function does nothing when [isOnFloor] returns `true`. + * Allows to manually apply a snap to the floor regardless of the body's velocity. This function + * does nothing when [isOnFloor] returns `true`. */ public fun applyFloorSnap(): Unit { TransferContext.writeArguments() @@ -341,7 +374,9 @@ public open class CharacterBody3D : PhysicsBody3D() { } /** - * Returns `true` if the body collided with the floor on the last call of [moveAndSlide]. Otherwise, returns `false`. The [upDirection] and [floorMaxAngle] are used to determine whether a surface is "floor" or not. + * Returns `true` if the body collided with the floor on the last call of [moveAndSlide]. + * Otherwise, returns `false`. The [upDirection] and [floorMaxAngle] are used to determine whether a + * surface is "floor" or not. */ public fun isOnFloor(): Boolean { TransferContext.writeArguments() @@ -350,7 +385,9 @@ public open class CharacterBody3D : PhysicsBody3D() { } /** - * Returns `true` if the body collided only with the floor on the last call of [moveAndSlide]. Otherwise, returns `false`. The [upDirection] and [floorMaxAngle] are used to determine whether a surface is "floor" or not. + * Returns `true` if the body collided only with the floor on the last call of [moveAndSlide]. + * Otherwise, returns `false`. The [upDirection] and [floorMaxAngle] are used to determine whether a + * surface is "floor" or not. */ public fun isOnFloorOnly(): Boolean { TransferContext.writeArguments() @@ -359,7 +396,9 @@ public open class CharacterBody3D : PhysicsBody3D() { } /** - * Returns `true` if the body collided with the ceiling on the last call of [moveAndSlide]. Otherwise, returns `false`. The [upDirection] and [floorMaxAngle] are used to determine whether a surface is "ceiling" or not. + * Returns `true` if the body collided with the ceiling on the last call of [moveAndSlide]. + * Otherwise, returns `false`. The [upDirection] and [floorMaxAngle] are used to determine whether a + * surface is "ceiling" or not. */ public fun isOnCeiling(): Boolean { TransferContext.writeArguments() @@ -368,7 +407,9 @@ public open class CharacterBody3D : PhysicsBody3D() { } /** - * Returns `true` if the body collided only with the ceiling on the last call of [moveAndSlide]. Otherwise, returns `false`. The [upDirection] and [floorMaxAngle] are used to determine whether a surface is "ceiling" or not. + * Returns `true` if the body collided only with the ceiling on the last call of [moveAndSlide]. + * Otherwise, returns `false`. The [upDirection] and [floorMaxAngle] are used to determine whether a + * surface is "ceiling" or not. */ public fun isOnCeilingOnly(): Boolean { TransferContext.writeArguments() @@ -377,7 +418,9 @@ public open class CharacterBody3D : PhysicsBody3D() { } /** - * Returns `true` if the body collided with a wall on the last call of [moveAndSlide]. Otherwise, returns `false`. The [upDirection] and [floorMaxAngle] are used to determine whether a surface is "wall" or not. + * Returns `true` if the body collided with a wall on the last call of [moveAndSlide]. Otherwise, + * returns `false`. The [upDirection] and [floorMaxAngle] are used to determine whether a surface is + * "wall" or not. */ public fun isOnWall(): Boolean { TransferContext.writeArguments() @@ -386,7 +429,9 @@ public open class CharacterBody3D : PhysicsBody3D() { } /** - * Returns `true` if the body collided only with a wall on the last call of [moveAndSlide]. Otherwise, returns `false`. The [upDirection] and [floorMaxAngle] are used to determine whether a surface is "wall" or not. + * Returns `true` if the body collided only with a wall on the last call of [moveAndSlide]. + * Otherwise, returns `false`. The [upDirection] and [floorMaxAngle] are used to determine whether a + * surface is "wall" or not. */ public fun isOnWallOnly(): Boolean { TransferContext.writeArguments() @@ -395,7 +440,8 @@ public open class CharacterBody3D : PhysicsBody3D() { } /** - * Returns the surface normal of the floor at the last collision point. Only valid after calling [moveAndSlide] and when [isOnFloor] returns `true`. + * Returns the surface normal of the floor at the last collision point. Only valid after calling + * [moveAndSlide] and when [isOnFloor] returns `true`. */ public fun getFloorNormal(): Vector3 { TransferContext.writeArguments() @@ -404,7 +450,8 @@ public open class CharacterBody3D : PhysicsBody3D() { } /** - * Returns the surface normal of the wall at the last collision point. Only valid after calling [moveAndSlide] and when [isOnWall] returns `true`. + * Returns the surface normal of the wall at the last collision point. Only valid after calling + * [moveAndSlide] and when [isOnWall] returns `true`. */ public fun getWallNormal(): Vector3 { TransferContext.writeArguments() @@ -413,7 +460,9 @@ public open class CharacterBody3D : PhysicsBody3D() { } /** - * Returns the last motion applied to the [godot.CharacterBody3D] during the last call to [moveAndSlide]. The movement can be split into multiple motions when sliding occurs, and this method return the last one, which is useful to retrieve the current direction of the movement. + * Returns the last motion applied to the [CharacterBody3D] during the last call to + * [moveAndSlide]. The movement can be split into multiple motions when sliding occurs, and this + * method return the last one, which is useful to retrieve the current direction of the movement. */ public fun getLastMotion(): Vector3 { TransferContext.writeArguments() @@ -431,7 +480,9 @@ public open class CharacterBody3D : PhysicsBody3D() { } /** - * Returns the current real velocity since the last call to [moveAndSlide]. For example, when you climb a slope, you will move diagonally even though the velocity is horizontal. This method returns the diagonal movement, as opposed to [velocity] which returns the requested velocity. + * Returns the current real velocity since the last call to [moveAndSlide]. For example, when you + * climb a slope, you will move diagonally even though the velocity is horizontal. This method + * returns the diagonal movement, as opposed to [velocity] which returns the requested velocity. */ public fun getRealVelocity(): Vector3 { TransferContext.writeArguments() @@ -440,7 +491,9 @@ public open class CharacterBody3D : PhysicsBody3D() { } /** - * Returns the floor's collision angle at the last collision point according to [upDirection], which is [godot.Vector3.UP] by default. This value is always positive and only valid after calling [moveAndSlide] and when [isOnFloor] returns `true`. + * Returns the floor's collision angle at the last collision point according to [param + * up_direction], which is [constant Vector3.UP] by default. This value is always positive and only + * valid after calling [moveAndSlide] and when [isOnFloor] returns `true`. */ @JvmOverloads public fun getFloorAngle(upDirection: Vector3 = Vector3(0, 1, 0)): Float { @@ -450,7 +503,8 @@ public open class CharacterBody3D : PhysicsBody3D() { } /** - * Returns the linear velocity of the platform at the last collision point. Only valid after calling [moveAndSlide]. + * Returns the linear velocity of the platform at the last collision point. Only valid after + * calling [moveAndSlide]. */ public fun getPlatformVelocity(): Vector3 { TransferContext.writeArguments() @@ -459,7 +513,8 @@ public open class CharacterBody3D : PhysicsBody3D() { } /** - * Returns the angular velocity of the platform at the last collision point. Only valid after calling [moveAndSlide]. + * Returns the angular velocity of the platform at the last collision point. Only valid after + * calling [moveAndSlide]. */ public fun getPlatformAngularVelocity(): Vector3 { TransferContext.writeArguments() @@ -468,7 +523,8 @@ public open class CharacterBody3D : PhysicsBody3D() { } /** - * Returns the number of times the body collided and changed direction during the last call to [moveAndSlide]. + * Returns the number of times the body collided and changed direction during the last call to + * [moveAndSlide]. */ public fun getSlideCollisionCount(): Int { TransferContext.writeArguments() @@ -477,7 +533,10 @@ public open class CharacterBody3D : PhysicsBody3D() { } /** - * Returns a [godot.KinematicCollision3D], which contains information about a collision that occurred during the last call to [moveAndSlide]. Since the body can collide several times in a single call to [moveAndSlide], you must specify the index of the collision in the range 0 to ([getSlideCollisionCount] - 1). + * Returns a [KinematicCollision3D], which contains information about a collision that occurred + * during the last call to [moveAndSlide]. Since the body can collide several times in a single call + * to [moveAndSlide], you must specify the index of the collision in the range 0 to + * ([getSlideCollisionCount] - 1). */ public fun getSlideCollision(slideIdx: Int): KinematicCollision3D? { TransferContext.writeArguments(LONG to slideIdx.toLong()) @@ -486,7 +545,8 @@ public open class CharacterBody3D : PhysicsBody3D() { } /** - * Returns a [godot.KinematicCollision3D], which contains information about the latest collision that occurred during the last call to [moveAndSlide]. + * Returns a [KinematicCollision3D], which contains information about the latest collision that + * occurred during the last call to [moveAndSlide]. */ public fun getLastSlideCollision(): KinematicCollision3D? { TransferContext.writeArguments() @@ -498,11 +558,15 @@ public open class CharacterBody3D : PhysicsBody3D() { id: Long, ) { /** - * Apply when notions of walls, ceiling and floor are relevant. In this mode the body motion will react to slopes (acceleration/slowdown). This mode is suitable for grounded games like platformers. + * Apply when notions of walls, ceiling and floor are relevant. In this mode the body motion + * will react to slopes (acceleration/slowdown). This mode is suitable for grounded games like + * platformers. */ MOTION_MODE_GROUNDED(0), /** - * Apply when there is no notion of floor or ceiling. All collisions will be reported as `on_wall`. In this mode, when you slide, the speed will always be constant. This mode is suitable for games without ground like space games. + * Apply when there is no notion of floor or ceiling. All collisions will be reported as + * `on_wall`. In this mode, when you slide, the speed will always be constant. This mode is + * suitable for games without ground like space games. */ MOTION_MODE_FLOATING(1), ; @@ -525,7 +589,9 @@ public open class CharacterBody3D : PhysicsBody3D() { */ PLATFORM_ON_LEAVE_ADD_VELOCITY(0), /** - * Add the last platform velocity to the [velocity] when you leave a moving platform, but any downward motion is ignored. It's useful to keep full jump height even when the platform is moving down. + * Add the last platform velocity to the [velocity] when you leave a moving platform, but any + * downward motion is ignored. It's useful to keep full jump height even when the platform is + * moving down. */ PLATFORM_ON_LEAVE_ADD_UPWARD_VELOCITY(1), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CheckBox.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CheckBox.kt index d088ca160..b4dcd7e2a 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CheckBox.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CheckBox.kt @@ -12,13 +12,14 @@ import kotlin.Int import kotlin.Suppress /** - * A button that represents a binary choice. - * - * [godot.CheckBox] allows the user to choose one of only two possible options. It's similar to [godot.CheckButton] in functionality, but it has a different appearance. To follow established UX patterns, it's recommended to use [godot.CheckBox] when toggling it has **no** immediate effect on something. For example, it could be used when toggling it will only do something once a confirmation button is pressed. - * - * See also [godot.BaseButton] which contains common properties and methods associated with this node. - * - * When [godot.BaseButton.buttonGroup] specifies a [godot.ButtonGroup], [godot.CheckBox] changes its appearance to that of a radio button and uses the various `radio_*` theme properties. + * [CheckBox] allows the user to choose one of only two possible options. It's similar to + * [CheckButton] in functionality, but it has a different appearance. To follow established UX + * patterns, it's recommended to use [CheckBox] when toggling it has **no** immediate effect on + * something. For example, it could be used when toggling it will only do something once a confirmation + * button is pressed. + * See also [BaseButton] which contains common properties and methods associated with this node. + * When [BaseButton.buttonGroup] specifies a [ButtonGroup], [CheckBox] changes its appearance to + * that of a radio button and uses the various `radio_*` theme properties. */ @GodotBaseType public open class CheckBox : Button() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CheckButton.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CheckButton.kt index 25f211795..4dddce27e 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CheckButton.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CheckButton.kt @@ -12,11 +12,12 @@ import kotlin.Int import kotlin.Suppress /** - * A button that represents a binary choice. - * - * [godot.CheckButton] is a toggle button displayed as a check field. It's similar to [godot.CheckBox] in functionality, but it has a different appearance. To follow established UX patterns, it's recommended to use [godot.CheckButton] when toggling it has an **immediate** effect on something. For example, it can be used when pressing it shows or hides advanced settings, without asking the user to confirm this action. - * - * See also [godot.BaseButton] which contains common properties and methods associated with this node. + * [CheckButton] is a toggle button displayed as a check field. It's similar to [CheckBox] in + * functionality, but it has a different appearance. To follow established UX patterns, it's + * recommended to use [CheckButton] when toggling it has an **immediate** effect on something. For + * example, it can be used when pressing it shows or hides advanced settings, without asking the user + * to confirm this action. + * See also [BaseButton] which contains common properties and methods associated with this node. */ @GodotBaseType public open class CheckButton : Button() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CircleShape2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CircleShape2D.kt index e0ec7ede8..ce8899468 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CircleShape2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CircleShape2D.kt @@ -19,11 +19,10 @@ import kotlin.Int import kotlin.Suppress /** - * A 2D circle shape used for physics collision. - * - * A 2D circle shape, intended for use in physics. Usually used to provide a shape for a [godot.CollisionShape2D]. - * - * **Performance:** [godot.CircleShape2D] is fast to check collisions against. It is faster than [godot.RectangleShape2D] and [godot.CapsuleShape2D]. + * A 2D circle shape, intended for use in physics. Usually used to provide a shape for a + * [CollisionShape2D]. + * **Performance:** [CircleShape2D] is fast to check collisions against. It is faster than + * [RectangleShape2D] and [CapsuleShape2D]. */ @GodotBaseType public open class CircleShape2D : Shape2D() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ClassDB.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ClassDB.kt index d9e835f21..09c961f32 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ClassDB.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ClassDB.kt @@ -31,8 +31,6 @@ import kotlin.Suppress import kotlin.jvm.JvmOverloads /** - * A class information repository. - * * Provides access to metadata stored for every available class. */ @GodotBaseType @@ -52,7 +50,7 @@ public object ClassDB : Object() { } /** - * Returns the names of all the classes that directly or indirectly inherit from [class]. + * Returns the names of all the classes that directly or indirectly inherit from [param class]. */ public fun getInheritersFromClass(_class: StringName): PackedStringArray { TransferContext.writeArguments(STRING_NAME to _class) @@ -62,7 +60,7 @@ public object ClassDB : Object() { } /** - * Returns the parent class of [class]. + * Returns the parent class of [param class]. */ public fun getParentClass(_class: StringName): StringName { TransferContext.writeArguments(STRING_NAME to _class) @@ -71,7 +69,7 @@ public object ClassDB : Object() { } /** - * Returns whether the specified [class] is available or not. + * Returns whether the specified [param class] is available or not. */ public fun classExists(_class: StringName): Boolean { TransferContext.writeArguments(STRING_NAME to _class) @@ -80,7 +78,7 @@ public object ClassDB : Object() { } /** - * Returns whether [inherits] is an ancestor of [class] or not. + * Returns whether [param inherits] is an ancestor of [param class] or not. */ public fun isParentClass(_class: StringName, inherits: StringName): Boolean { TransferContext.writeArguments(STRING_NAME to _class, STRING_NAME to inherits) @@ -89,7 +87,8 @@ public object ClassDB : Object() { } /** - * Returns `true` if objects can be instantiated from the specified [class], otherwise returns `false`. + * Returns `true` if objects can be instantiated from the specified [param class], otherwise + * returns `false`. */ public fun canInstantiate(_class: StringName): Boolean { TransferContext.writeArguments(STRING_NAME to _class) @@ -98,7 +97,7 @@ public object ClassDB : Object() { } /** - * Creates an instance of [class]. + * Creates an instance of [param class]. */ public fun instantiate(_class: StringName): Any? { TransferContext.writeArguments(STRING_NAME to _class) @@ -107,7 +106,7 @@ public object ClassDB : Object() { } /** - * Returns whether [class] or its ancestry has a signal called [signal] or not. + * Returns whether [param class] or its ancestry has a signal called [param signal] or not. */ public fun classHasSignal(_class: StringName, signal: StringName): Boolean { TransferContext.writeArguments(STRING_NAME to _class, STRING_NAME to signal) @@ -116,7 +115,9 @@ public object ClassDB : Object() { } /** - * Returns the [signal] data of [class] or its ancestry. The returned value is a [godot.core.Dictionary] with the following keys: `args`, `default_args`, `flags`, `id`, `name`, `return: (class_name, hint, hint_string, name, type, usage)`. + * Returns the [param signal] data of [param class] or its ancestry. The returned value is a + * [Dictionary] with the following keys: `args`, `default_args`, `flags`, `id`, `name`, `return: + * (class_name, hint, hint_string, name, type, usage)`. */ public fun classGetSignal(_class: StringName, signal: StringName): Dictionary { TransferContext.writeArguments(STRING_NAME to _class, STRING_NAME to signal) @@ -125,7 +126,9 @@ public object ClassDB : Object() { } /** - * Returns an array with all the signals of [class] or its ancestry if [noInheritance] is `false`. Every element of the array is a [godot.core.Dictionary] as described in [classGetSignal]. + * Returns an array with all the signals of [param class] or its ancestry if [param + * no_inheritance] is `false`. Every element of the array is a [Dictionary] as described in + * [classGetSignal]. */ @JvmOverloads public fun classGetSignalList(_class: StringName, noInheritance: Boolean = false): @@ -136,7 +139,8 @@ public object ClassDB : Object() { } /** - * Returns an array with all the properties of [class] or its ancestry if [noInheritance] is `false`. + * Returns an array with all the properties of [param class] or its ancestry if [param + * no_inheritance] is `false`. */ @JvmOverloads public fun classGetPropertyList(_class: StringName, noInheritance: Boolean = false): @@ -147,7 +151,7 @@ public object ClassDB : Object() { } /** - * Returns the value of [property] of [object] or its ancestry. + * Returns the value of [param property] of [param object] or its ancestry. */ public fun classGetProperty(_object: Object, `property`: StringName): Any? { TransferContext.writeArguments(OBJECT to _object, STRING_NAME to property) @@ -156,7 +160,7 @@ public object ClassDB : Object() { } /** - * Sets [property] value of [object] to [value]. + * Sets [param property] value of [param object] to [param value]. */ public fun classSetProperty( _object: Object, @@ -169,7 +173,8 @@ public object ClassDB : Object() { } /** - * Returns whether [class] (or its ancestry if [noInheritance] is `false`) has a method called [method] or not. + * Returns whether [param class] (or its ancestry if [param no_inheritance] is `false`) has a + * method called [param method] or not. */ @JvmOverloads public fun classHasMethod( @@ -183,9 +188,12 @@ public object ClassDB : Object() { } /** - * Returns an array with all the methods of [class] or its ancestry if [noInheritance] is `false`. Every element of the array is a [godot.core.Dictionary] with the following keys: `args`, `default_args`, `flags`, `id`, `name`, `return: (class_name, hint, hint_string, name, type, usage)`. - * - * **Note:** In exported release builds the debug info is not available, so the returned dictionaries will contain only method names. + * Returns an array with all the methods of [param class] or its ancestry if [param + * no_inheritance] is `false`. Every element of the array is a [Dictionary] with the following keys: + * `args`, `default_args`, `flags`, `id`, `name`, `return: (class_name, hint, hint_string, name, + * type, usage)`. + * **Note:** In exported release builds the debug info is not available, so the returned + * dictionaries will contain only method names. */ @JvmOverloads public fun classGetMethodList(_class: StringName, noInheritance: Boolean = false): @@ -196,7 +204,7 @@ public object ClassDB : Object() { } /** - * Returns an array with the names all the integer constants of [class] or its ancestry. + * Returns an array with the names all the integer constants of [param class] or its ancestry. */ @JvmOverloads public fun classGetIntegerConstantList(_class: StringName, noInheritance: Boolean = false): @@ -208,7 +216,8 @@ public object ClassDB : Object() { } /** - * Returns whether [class] or its ancestry has an integer constant called [name] or not. + * Returns whether [param class] or its ancestry has an integer constant called [param name] or + * not. */ public fun classHasIntegerConstant(_class: StringName, name: StringName): Boolean { TransferContext.writeArguments(STRING_NAME to _class, STRING_NAME to name) @@ -217,7 +226,8 @@ public object ClassDB : Object() { } /** - * Returns the value of the integer constant [name] of [class] or its ancestry. Always returns 0 when the constant could not be found. + * Returns the value of the integer constant [param name] of [param class] or its ancestry. Always + * returns 0 when the constant could not be found. */ public fun classGetIntegerConstant(_class: StringName, name: StringName): Long { TransferContext.writeArguments(STRING_NAME to _class, STRING_NAME to name) @@ -226,7 +236,7 @@ public object ClassDB : Object() { } /** - * Returns whether [class] or its ancestry has an enum called [name] or not. + * Returns whether [param class] or its ancestry has an enum called [param name] or not. */ @JvmOverloads public fun classHasEnum( @@ -240,7 +250,7 @@ public object ClassDB : Object() { } /** - * Returns an array with all the enums of [class] or its ancestry. + * Returns an array with all the enums of [param class] or its ancestry. */ @JvmOverloads public fun classGetEnumList(_class: StringName, noInheritance: Boolean = false): @@ -251,7 +261,7 @@ public object ClassDB : Object() { } /** - * Returns an array with all the keys in [enum] of [class] or its ancestry. + * Returns an array with all the keys in [param enum] of [param class] or its ancestry. */ @JvmOverloads public fun classGetEnumConstants( @@ -265,7 +275,8 @@ public object ClassDB : Object() { } /** - * Returns which enum the integer constant [name] of [class] or its ancestry belongs to. + * Returns which enum the integer constant [param name] of [param class] or its ancestry belongs + * to. */ @JvmOverloads public fun classGetIntegerConstantEnum( @@ -279,7 +290,7 @@ public object ClassDB : Object() { } /** - * Returns whether this [class] is enabled or not. + * Returns whether this [param class] is enabled or not. */ public fun isClassEnabled(_class: StringName): Boolean { TransferContext.writeArguments(STRING_NAME to _class) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ClockDirection.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ClockDirection.kt index 07e3cceb5..113347062 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ClockDirection.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ClockDirection.kt @@ -6,7 +6,13 @@ import kotlin.Long public enum class ClockDirection( id: Long, ) { + /** + * Clockwise rotation. Used by some methods (e.g. [Image.rotate90]). + */ CLOCKWISE(0), + /** + * Counter-clockwise rotation. Used by some methods (e.g. [Image.rotate90]). + */ COUNTERCLOCKWISE(1), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CodeEdit.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CodeEdit.kt index fd917c067..39c230763 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CodeEdit.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CodeEdit.kt @@ -41,16 +41,17 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * A multiline text editor designed for editing code. - * - * CodeEdit is a specialized [godot.TextEdit] designed for editing plain text code files. It has many features commonly found in code editors such as line numbers, line folding, code completion, indent management, and string/comment management. - * - * **Note:** Regardless of locale, [godot.CodeEdit] will by default always use left-to-right text direction to correctly display source code. + * CodeEdit is a specialized [TextEdit] designed for editing plain text code files. It has many + * features commonly found in code editors such as line numbers, line folding, code completion, indent + * management, and string/comment management. + * **Note:** Regardless of locale, [CodeEdit] will by default always use left-to-right text + * direction to correctly display source code. */ @GodotBaseType public open class CodeEdit : TextEdit() { /** - * Emitted when a breakpoint is added or removed from a line. If the line is moved via backspace a removed is emitted at the old line. + * Emitted when a breakpoint is added or removed from a line. If the line is moved via backspace a + * removed is emitted at the old line. */ public val breakpointToggled: Signal1 by signal("line") @@ -65,12 +66,14 @@ public open class CodeEdit : TextEdit() { public val symbolLookup: Signal3 by signal("symbol", "line", "column") /** - * Emitted when the user hovers over a symbol. The symbol should be validated and responded to, by calling [setSymbolLookupWordAsValid]. + * Emitted when the user hovers over a symbol. The symbol should be validated and responded to, by + * calling [setSymbolLookupWordAsValid]. */ public val symbolValidate: Signal1 by signal("symbol") /** - * Set when a validated word from [symbolValidate] is clicked, the [symbolLookup] should be emitted. + * Set when a validated word from [signal symbol_validate] is clicked, the [signal symbol_lookup] + * should be emitted. */ public var symbolLookupOnClick: Boolean get() { @@ -98,7 +101,8 @@ public open class CodeEdit : TextEdit() { } /** - * Draws vertical lines at the provided columns. The first entry is considered a main hard guideline and is draw more prominently. + * Draws vertical lines at the provided columns. The first entry is considered a main hard + * guideline and is draw more prominently. */ public var lineLengthGuidelines: VariantArray get() { @@ -112,7 +116,8 @@ public open class CodeEdit : TextEdit() { } /** - * Sets if breakpoints should be drawn in the gutter. This gutter is shared with bookmarks and executing lines. + * Sets if breakpoints should be drawn in the gutter. This gutter is shared with bookmarks and + * executing lines. */ public var guttersDrawBreakpointsGutter: Boolean get() { @@ -126,7 +131,8 @@ public open class CodeEdit : TextEdit() { } /** - * Sets if bookmarked should be drawn in the gutter. This gutter is shared with breakpoints and executing lines. + * Sets if bookmarked should be drawn in the gutter. This gutter is shared with breakpoints and + * executing lines. */ public var guttersDrawBookmarks: Boolean get() { @@ -140,7 +146,8 @@ public open class CodeEdit : TextEdit() { } /** - * Sets if executing lines should be marked in the gutter. This gutter is shared with breakpoints and bookmarks lines. + * Sets if executing lines should be marked in the gutter. This gutter is shared with breakpoints + * and bookmarks lines. */ public var guttersDrawExecutingLines: Boolean get() { @@ -252,7 +259,8 @@ public open class CodeEdit : TextEdit() { } /** - * Size of the tabulation indent (one [kbd]Tab[/kbd] press) in characters. If [indentUseSpaces] is enabled the number of spaces to use. + * Size of the tabulation indent (one [kbd]Tab[/kbd] press) in characters. If [indentUseSpaces] is + * enabled the number of spaces to use. */ public var indentSize: Int get() { @@ -280,7 +288,8 @@ public open class CodeEdit : TextEdit() { } /** - * Sets whether automatic indent are enabled, this will add an extra indent if a prefix or brace is found. + * Sets whether automatic indent are enabled, this will add an extra indent if a prefix or brace + * is found. */ public var indentAutomatic: Boolean get() { @@ -355,21 +364,23 @@ public open class CodeEdit : TextEdit() { } /** - * Override this method to define how the selected entry should be inserted. If [replace] is true, any existing text should be replaced. + * Override this method to define how the selected entry should be inserted. If [param replace] is + * true, any existing text should be replaced. */ public open fun _confirmCodeCompletion(replace: Boolean): Unit { } /** - * Override this method to define what happens when the user requests code completion. If [force] is true, any checks should be bypassed. + * Override this method to define what happens when the user requests code completion. If [param + * force] is true, any checks should be bypassed. */ public open fun _requestCodeCompletion(force: Boolean): Unit { } /** - * Override this method to define what items in [candidates] should be displayed. - * - * Both [candidates] and the return is a [godot.Array] of [godot.core.Dictionary], see [getCodeCompletionOption] for [godot.core.Dictionary] content. + * Override this method to define what items in [param candidates] should be displayed. + * Both [param candidates] and the return is a [Array] of [Dictionary], see + * [getCodeCompletionOption] for [Dictionary] content. */ public open fun _filterCodeCompletionCandidates(candidates: VariantArray>): VariantArray> { @@ -393,7 +404,8 @@ public open class CodeEdit : TextEdit() { } /** - * Unindents selected lines, or in the case of no selection the caret line by one. Same as performing "ui_text_unindent" action. + * Unindents selected lines, or in the case of no selection the caret line by one. Same as + * performing "ui_text_unindent" action. */ public fun unindentLines(): Unit { TransferContext.writeArguments() @@ -401,8 +413,8 @@ public open class CodeEdit : TextEdit() { } /** - * Converts the indents of lines between [fromLine] and [toLine] to tabs or spaces as set by [indentUseSpaces]. - * + * Converts the indents of lines between [param from_line] and [param to_line] to tabs or spaces + * as set by [indentUseSpaces]. * Values of `-1` convert the entire text. */ @JvmOverloads @@ -413,7 +425,6 @@ public open class CodeEdit : TextEdit() { /** * Adds a brace pair. - * * Both the start and end keys must be symbols. Only the start key has to be unique. */ public fun addAutoBraceCompletionPair(startKey: String, endKey: String): Unit { @@ -422,7 +433,7 @@ public open class CodeEdit : TextEdit() { } /** - * Returns `true` if open key [openKey] exists. + * Returns `true` if open key [param open_key] exists. */ public fun hasAutoBraceCompletionOpenKey(openKey: String): Boolean { TransferContext.writeArguments(STRING to openKey) @@ -431,7 +442,7 @@ public open class CodeEdit : TextEdit() { } /** - * Returns `true` if close key [closeKey] exists. + * Returns `true` if close key [param close_key] exists. */ public fun hasAutoBraceCompletionCloseKey(closeKey: String): Boolean { TransferContext.writeArguments(STRING to closeKey) @@ -440,7 +451,7 @@ public open class CodeEdit : TextEdit() { } /** - * Gets the matching auto brace close key for [openKey]. + * Gets the matching auto brace close key for [param open_key]. */ public fun getAutoBraceCompletionCloseKey(openKey: String): String { TransferContext.writeArguments(STRING to openKey) @@ -551,7 +562,8 @@ public open class CodeEdit : TextEdit() { } /** - * Returns if the given line is foldable, that is, it has indented lines right below it or a comment / string block. + * Returns if the given line is foldable, that is, it has indented lines right below it or a + * comment / string block. */ public fun canFoldLine(line: Int): Boolean { TransferContext.writeArguments(LONG to line.toLong()) @@ -618,13 +630,13 @@ public open class CodeEdit : TextEdit() { } /** - * Creates a new code region with the selection. At least one single line comment delimiter have to be defined (see [addCommentDelimiter]). - * - * A code region is a part of code that is highlighted when folded and can help organize your script. - * + * Creates a new code region with the selection. At least one single line comment delimiter have + * to be defined (see [addCommentDelimiter]). + * A code region is a part of code that is highlighted when folded and can help organize your + * script. * Code region start and end tags can be customized (see [setCodeRegionTags]). - * - * Code regions are delimited using start and end tags (respectively `region` and `endregion` by default) preceded by one line comment delimiter. (eg. `#region` and `#endregion`) + * Code regions are delimited using start and end tags (respectively `region` and `endregion` by + * default) preceded by one line comment delimiter. (eg. `#region` and `#endregion`) */ public fun createCodeRegion(): Unit { TransferContext.writeArguments() @@ -678,10 +690,9 @@ public open class CodeEdit : TextEdit() { /** * Adds a string delimiter. - * * Both the start and end keys must be symbols. Only the start key has to be unique. - * - * [lineOnly] denotes if the region should continue until the end of the line or carry over on to the next line. If the end key is blank this is automatically set to `true`. + * [param line_only] denotes if the region should continue until the end of the line or carry over + * on to the next line. If the end key is blank this is automatically set to `true`. */ @JvmOverloads public fun addStringDelimiter( @@ -694,7 +705,7 @@ public open class CodeEdit : TextEdit() { } /** - * Removes the string delimiter with [startKey]. + * Removes the string delimiter with [param start_key]. */ public fun removeStringDelimiter(startKey: String): Unit { TransferContext.writeArguments(STRING to startKey) @@ -702,7 +713,7 @@ public open class CodeEdit : TextEdit() { } /** - * Returns `true` if string [startKey] exists. + * Returns `true` if string [param start_key] exists. */ public fun hasStringDelimiter(startKey: String): Boolean { TransferContext.writeArguments(STRING to startKey) @@ -719,7 +730,9 @@ public open class CodeEdit : TextEdit() { } /** - * Returns the delimiter index if [line] [column] is in a string. If [column] is not provided, will return the delimiter index if the entire [line] is a string. Otherwise `-1`. + * Returns the delimiter index if [param line] [param column] is in a string. If [param column] is + * not provided, will return the delimiter index if the entire [param line] is a string. Otherwise + * `-1`. */ @JvmOverloads public fun isInString(line: Int, column: Int = -1): Int { @@ -730,10 +743,9 @@ public open class CodeEdit : TextEdit() { /** * Adds a comment delimiter. - * * Both the start and end keys must be symbols. Only the start key has to be unique. - * - * [lineOnly] denotes if the region should continue until the end of the line or carry over on to the next line. If the end key is blank this is automatically set to `true`. + * [param line_only] denotes if the region should continue until the end of the line or carry over + * on to the next line. If the end key is blank this is automatically set to `true`. */ @JvmOverloads public fun addCommentDelimiter( @@ -746,7 +758,7 @@ public open class CodeEdit : TextEdit() { } /** - * Removes the comment delimiter with [startKey]. + * Removes the comment delimiter with [param start_key]. */ public fun removeCommentDelimiter(startKey: String): Unit { TransferContext.writeArguments(STRING to startKey) @@ -754,7 +766,7 @@ public open class CodeEdit : TextEdit() { } /** - * Returns `true` if comment [startKey] exists. + * Returns `true` if comment [param start_key] exists. */ public fun hasCommentDelimiter(startKey: String): Boolean { TransferContext.writeArguments(STRING to startKey) @@ -771,7 +783,8 @@ public open class CodeEdit : TextEdit() { } /** - * Returns delimiter index if [line] [column] is in a comment. If [column] is not provided, will return delimiter index if the entire [line] is a comment. Otherwise `-1`. + * Returns delimiter index if [param line] [param column] is in a comment. If [param column] is + * not provided, will return delimiter index if the entire [param line] is a comment. Otherwise `-1`. */ @JvmOverloads public fun isInComment(line: Int, column: Int = -1): Int { @@ -799,7 +812,8 @@ public open class CodeEdit : TextEdit() { } /** - * If [line] [column] is in a string or comment, returns the start position of the region. If not or no start could be found, both [godot.core.Vector2] values will be `-1`. + * If [param line] [param column] is in a string or comment, returns the start position of the + * region. If not or no start could be found, both [Vector2] values will be `-1`. */ public fun getDelimiterStartPosition(line: Int, column: Int): Vector2 { TransferContext.writeArguments(LONG to line.toLong(), LONG to column.toLong()) @@ -808,7 +822,8 @@ public open class CodeEdit : TextEdit() { } /** - * If [line] [column] is in a string or comment, returns the end position of the region. If not or no end could be found, both [godot.core.Vector2] values will be `-1`. + * If [param line] [param column] is in a string or comment, returns the end position of the + * region. If not or no end could be found, both [Vector2] values will be `-1`. */ public fun getDelimiterEndPosition(line: Int, column: Int): Vector2 { TransferContext.writeArguments(LONG to line.toLong(), LONG to column.toLong()) @@ -842,7 +857,9 @@ public open class CodeEdit : TextEdit() { } /** - * Emits [codeCompletionRequested], if [force] is true will bypass all checks. Otherwise will check that the caret is in a word or in front of a prefix. Will ignore the request if all current options are of type file path, node path or signal. + * Emits [signal code_completion_requested], if [param force] is true will bypass all checks. + * Otherwise will check that the caret is in a word or in front of a prefix. Will ignore the request + * if all current options are of type file path, node path or signal. */ @JvmOverloads public fun requestCodeCompletion(force: Boolean = false): Unit { @@ -851,10 +868,10 @@ public open class CodeEdit : TextEdit() { } /** - * Submits an item to the queue of potential candidates for the autocomplete menu. Call [updateCodeCompletionOptions] to update the list. - * - * [location] indicates location of the option relative to the location of the code completion query. See [enum CodeEdit.CodeCompletionLocation] for how to set this value. - * + * Submits an item to the queue of potential candidates for the autocomplete menu. Call + * [updateCodeCompletionOptions] to update the list. + * [param location] indicates location of the option relative to the location of the code + * completion query. See [enum CodeEdit.CodeCompletionLocation] for how to set this value. * **Note:** This list will replace all current candidates. */ @JvmOverloads @@ -872,8 +889,8 @@ public open class CodeEdit : TextEdit() { } /** - * Submits all completion options added with [addCodeCompletionOption]. Will try to force the autocomplete menu to popup, if [force] is `true`. - * + * Submits all completion options added with [addCodeCompletionOption]. Will try to force the + * autocomplete menu to popup, if [param force] is `true`. * **Note:** This will replace all current candidates. */ public fun updateCodeCompletionOptions(force: Boolean): Unit { @@ -891,18 +908,13 @@ public open class CodeEdit : TextEdit() { } /** - * Gets the completion option at [index]. The return [godot.core.Dictionary] has the following key-values: - * + * Gets the completion option at [param index]. The return [Dictionary] has the following + * key-values: * `kind`: [enum CodeCompletionKind] - * * `display_text`: Text that is shown on the autocomplete menu. - * * `insert_text`: Text that is to be inserted when this item is selected. - * * `font_color`: Color of the text on the autocomplete menu. - * * `icon`: Icon to draw on the autocomplete menu. - * * `default_value`: Value of the symbol. */ public fun getCodeCompletionOption(index: Int): Dictionary { @@ -929,7 +941,8 @@ public open class CodeEdit : TextEdit() { } /** - * Inserts the selected entry into the text. If [replace] is true, any existing text is replaced rather than merged. + * Inserts the selected entry into the text. If [param replace] is true, any existing text is + * replaced rather than merged. */ @JvmOverloads public fun confirmCodeCompletion(replace: Boolean = false): Unit { @@ -964,7 +977,7 @@ public open class CodeEdit : TextEdit() { } /** - * Sets the symbol emitted by [symbolValidate] as a valid lookup. + * Sets the symbol emitted by [signal symbol_validate] as a valid lookup. */ public fun setSymbolLookupWordAsValid(valid: Boolean): Unit { TransferContext.writeArguments(BOOL to valid) @@ -972,7 +985,8 @@ public open class CodeEdit : TextEdit() { } /** - * Duplicates all lines currently selected with any caret. Duplicates the entire line beneath the current one no matter where the caret is within the line. + * Duplicates all lines currently selected with any caret. Duplicates the entire line beneath the + * current one no matter where the caret is within the line. */ public fun duplicateLines(): Unit { TransferContext.writeArguments() @@ -1038,19 +1052,26 @@ public open class CodeEdit : TextEdit() { id: Long, ) { /** - * The option is local to the location of the code completion query - e.g. a local variable. Subsequent value of location represent options from the outer class, the exact value represent how far they are (in terms of inner classes). + * The option is local to the location of the code completion query - e.g. a local variable. + * Subsequent value of location represent options from the outer class, the exact value represent + * how far they are (in terms of inner classes). */ LOCATION_LOCAL(0), /** - * The option is from the containing class or a parent class, relative to the location of the code completion query. Perform a bitwise OR with the class depth (e.g. 0 for the local class, 1 for the parent, 2 for the grandparent, etc) to store the depth of an option in the class or a parent class. + * The option is from the containing class or a parent class, relative to the location of the + * code completion query. Perform a bitwise OR with the class depth (e.g. 0 for the local class, 1 + * for the parent, 2 for the grandparent, etc) to store the depth of an option in the class or a + * parent class. */ LOCATION_PARENT_MASK(256), /** - * The option is from user code which is not local and not in a derived class (e.g. Autoload Singletons). + * The option is from user code which is not local and not in a derived class (e.g. Autoload + * Singletons). */ LOCATION_OTHER_USER_CODE(512), /** - * The option is from other engine code, not covered by the other enum constants - e.g. built-in classes. + * The option is from other engine code, not covered by the other enum constants - e.g. built-in + * classes. */ LOCATION_OTHER(1024), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CodeHighlighter.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CodeHighlighter.kt index ac36a1dff..4363b3f3e 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CodeHighlighter.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CodeHighlighter.kt @@ -28,9 +28,8 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * A syntax highlighter intended for code. - * - * By adjusting various properties of this resource, you can change the colors of strings, comments, numbers, and other text patterns inside a [godot.TextEdit] control. + * By adjusting various properties of this resource, you can change the colors of strings, comments, + * numbers, and other text patterns inside a [TextEdit] control. */ @GodotBaseType public open class CodeHighlighter : SyntaxHighlighter() { @@ -80,7 +79,8 @@ public open class CodeHighlighter : SyntaxHighlighter() { } /** - * Sets color for member variables. A member variable is non-keyword, non-function string proceeded with a '.'. + * Sets color for member variables. A member variable is non-keyword, non-function string + * proceeded with a '.'. */ @CoreTypeLocalCopy public var memberVariableColor: Color @@ -95,7 +95,8 @@ public open class CodeHighlighter : SyntaxHighlighter() { } /** - * Sets the keyword colors. All existing keywords will be removed. The [godot.core.Dictionary] key is the keyword. The value is the keyword color. + * Sets the keyword colors. All existing keywords will be removed. The [Dictionary] key is the + * keyword. The value is the keyword color. */ public var keywordColors: Dictionary get() { @@ -109,7 +110,8 @@ public open class CodeHighlighter : SyntaxHighlighter() { } /** - * Sets the member keyword colors. All existing member keyword will be removed. The [godot.core.Dictionary] key is the member keyword. The value is the member keyword color. + * Sets the member keyword colors. All existing member keyword will be removed. The [Dictionary] + * key is the member keyword. The value is the member keyword color. */ public var memberKeywordColors: Dictionary get() { @@ -123,7 +125,8 @@ public open class CodeHighlighter : SyntaxHighlighter() { } /** - * Sets the color regions. All existing regions will be removed. The [godot.core.Dictionary] key is the region start and end key, separated by a space. The value is the region color. + * Sets the color regions. All existing regions will be removed. The [Dictionary] key is the + * region start and end key, separated by a space. The value is the region color. */ public var colorRegions: Dictionary get() { @@ -214,7 +217,8 @@ public open class CodeHighlighter : SyntaxHighlighter() { /** - * Sets color for member variables. A member variable is non-keyword, non-function string proceeded with a '.'. + * Sets color for member variables. A member variable is non-keyword, non-function string + * proceeded with a '.'. * * This is a helper function to make dealing with local copies easier. * @@ -240,7 +244,6 @@ public open class CodeHighlighter : SyntaxHighlighter() { /** * Sets the color for a keyword. - * * The keyword cannot contain any symbols except '_'. */ public fun addKeywordColor(keyword: String, color: Color): Unit { @@ -284,9 +287,7 @@ public open class CodeHighlighter : SyntaxHighlighter() { /** * Sets the color for a member keyword. - * * The member keyword cannot contain any symbols except '_'. - * * It will not be highlighted if preceded by a '.'. */ public fun addMemberKeywordColor(memberKeyword: String, color: Color): Unit { @@ -330,10 +331,9 @@ public open class CodeHighlighter : SyntaxHighlighter() { /** * Adds a color region such as comments or strings. - * * Both the start and end keys must be symbols. Only the start key has to be unique. - * - * [lineOnly] denotes if the region should continue until the end of the line or carry over on to the next line. If the end key is blank this is automatically set to `true`. + * [param line_only] denotes if the region should continue until the end of the line or carry over + * on to the next line. If the end key is blank this is automatically set to `true`. */ @JvmOverloads public fun addColorRegion( diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CollisionObject2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CollisionObject2D.kt index 8175fd6d3..e6c33fa63 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CollisionObject2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CollisionObject2D.kt @@ -34,45 +34,60 @@ import kotlin.Suppress import kotlin.Unit /** - * Abstract base class for 2D physics objects. - * - * Abstract base class for 2D physics objects. [godot.CollisionObject2D] can hold any number of [godot.Shape2D]s for collision. Each shape must be assigned to a *shape owner*. Shape owners are not nodes and do not appear in the editor, but are accessible through code using the `shape_owner_*` methods. - * - * **Note:** Only collisions between objects within the same canvas ([godot.Viewport] canvas or [godot.CanvasLayer]) are supported. The behavior of collisions between objects in different canvases is undefined. + * Abstract base class for 2D physics objects. [CollisionObject2D] can hold any number of [Shape2D]s + * for collision. Each shape must be assigned to a *shape owner*. Shape owners are not nodes and do not + * appear in the editor, but are accessible through code using the `shape_owner_*` methods. + * **Note:** Only collisions between objects within the same canvas ([Viewport] canvas or + * [CanvasLayer]) are supported. The behavior of collisions between objects in different canvases is + * undefined. */ @GodotBaseType public open class CollisionObject2D internal constructor() : Node2D() { /** - * Emitted when an input event occurs. Requires [inputPickable] to be `true` and at least one [collisionLayer] bit to be set. See [_inputEvent] for details. + * Emitted when an input event occurs. Requires [inputPickable] to be `true` and at least one + * [collisionLayer] bit to be set. See [_inputEvent] for details. */ public val inputEvent: Signal3 by signal("viewport", "event", "shapeIdx") /** - * Emitted when the mouse pointer enters any of this object's shapes. Requires [inputPickable] to be `true` and at least one [collisionLayer] bit to be set. Note that moving between different shapes within a single [godot.CollisionObject2D] won't cause this signal to be emitted. - * - * **Note:** Due to the lack of continuous collision detection, this signal may not be emitted in the expected order if the mouse moves fast enough and the [godot.CollisionObject2D]'s area is small. This signal may also not be emitted if another [godot.CollisionObject2D] is overlapping the [godot.CollisionObject2D] in question. + * Emitted when the mouse pointer enters any of this object's shapes. Requires [inputPickable] to + * be `true` and at least one [collisionLayer] bit to be set. Note that moving between different + * shapes within a single [CollisionObject2D] won't cause this signal to be emitted. + * **Note:** Due to the lack of continuous collision detection, this signal may not be emitted in + * the expected order if the mouse moves fast enough and the [CollisionObject2D]'s area is small. + * This signal may also not be emitted if another [CollisionObject2D] is overlapping the + * [CollisionObject2D] in question. */ public val mouseEntered: Signal0 by signal() /** - * Emitted when the mouse pointer exits all this object's shapes. Requires [inputPickable] to be `true` and at least one [collisionLayer] bit to be set. Note that moving between different shapes within a single [godot.CollisionObject2D] won't cause this signal to be emitted. - * - * **Note:** Due to the lack of continuous collision detection, this signal may not be emitted in the expected order if the mouse moves fast enough and the [godot.CollisionObject2D]'s area is small. This signal may also not be emitted if another [godot.CollisionObject2D] is overlapping the [godot.CollisionObject2D] in question. + * Emitted when the mouse pointer exits all this object's shapes. Requires [inputPickable] to be + * `true` and at least one [collisionLayer] bit to be set. Note that moving between different shapes + * within a single [CollisionObject2D] won't cause this signal to be emitted. + * **Note:** Due to the lack of continuous collision detection, this signal may not be emitted in + * the expected order if the mouse moves fast enough and the [CollisionObject2D]'s area is small. + * This signal may also not be emitted if another [CollisionObject2D] is overlapping the + * [CollisionObject2D] in question. */ public val mouseExited: Signal0 by signal() /** - * Emitted when the mouse pointer enters any of this object's shapes or moves from one shape to another. [shapeIdx] is the child index of the newly entered [godot.Shape2D]. Requires [inputPickable] to be `true` and at least one [collisionLayer] bit to be set. + * Emitted when the mouse pointer enters any of this object's shapes or moves from one shape to + * another. [param shape_idx] is the child index of the newly entered [Shape2D]. Requires + * [inputPickable] to be `true` and at least one [collisionLayer] bit to be set. */ public val mouseShapeEntered: Signal1 by signal("shapeIdx") /** - * Emitted when the mouse pointer exits any of this object's shapes. [shapeIdx] is the child index of the exited [godot.Shape2D]. Requires [inputPickable] to be `true` and at least one [collisionLayer] bit to be set. + * Emitted when the mouse pointer exits any of this object's shapes. [param shape_idx] is the + * child index of the exited [Shape2D]. Requires [inputPickable] to be `true` and at least one + * [collisionLayer] bit to be set. */ public val mouseShapeExited: Signal1 by signal("shapeIdx") /** - * Defines the behavior in physics when [godot.Node.processMode] is set to [godot.Node.PROCESS_MODE_DISABLED]. See [enum DisableMode] for more details about the different modes. + * Defines the behavior in physics when [Node.processMode] is set to [constant + * Node.PROCESS_MODE_DISABLED]. See [enum DisableMode] for more details about the different modes. */ public var disableMode: DisableMode get() { @@ -86,9 +101,12 @@ public open class CollisionObject2D internal constructor() : Node2D() { } /** - * The physics layers this CollisionObject2D is in. Collision objects can exist in one or more of 32 different layers. See also [collisionMask]. - * - * **Note:** Object A can detect a contact with object B only if object B is in any of the layers that object A scans. See [godot.Collision layers and masks]($DOCS_URL/tutorials/physics/physics_introduction.html#collision-layers-and-masks) in the documentation for more information. + * The physics layers this CollisionObject2D is in. Collision objects can exist in one or more of + * 32 different layers. See also [collisionMask]. + * **Note:** Object A can detect a contact with object B only if object B is in any of the layers + * that object A scans. See + * [url=$DOCS_URL/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision + * layers and masks[/url] in the documentation for more information. */ public var collisionLayer: Long get() { @@ -102,9 +120,12 @@ public open class CollisionObject2D internal constructor() : Node2D() { } /** - * The physics layers this CollisionObject2D scans. Collision objects can scan one or more of 32 different layers. See also [collisionLayer]. - * - * **Note:** Object A can detect a contact with object B only if object B is in any of the layers that object A scans. See [godot.Collision layers and masks]($DOCS_URL/tutorials/physics/physics_introduction.html#collision-layers-and-masks) in the documentation for more information. + * The physics layers this CollisionObject2D scans. Collision objects can scan one or more of 32 + * different layers. See also [collisionLayer]. + * **Note:** Object A can detect a contact with object B only if object B is in any of the layers + * that object A scans. See + * [url=$DOCS_URL/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision + * layers and masks[/url] in the documentation for more information. */ public var collisionMask: Long get() { @@ -118,7 +139,9 @@ public open class CollisionObject2D internal constructor() : Node2D() { } /** - * The priority used to solve colliding when occurring penetration. The higher the priority is, the lower the penetration into the object will be. This can for example be used to prevent the player from breaking through the boundaries of a level. + * The priority used to solve colliding when occurring penetration. The higher the priority is, + * the lower the penetration into the object will be. This can for example be used to prevent the + * player from breaking through the boundaries of a level. */ public var collisionPriority: Float get() { @@ -132,7 +155,9 @@ public open class CollisionObject2D internal constructor() : Node2D() { } /** - * If `true`, this object is pickable. A pickable object can detect the mouse pointer entering/leaving, and if the mouse is inside it, report input events. Requires at least one [collisionLayer] bit to be set. + * If `true`, this object is pickable. A pickable object can detect the mouse pointer + * entering/leaving, and if the mouse is inside it, report input events. Requires at least one + * [collisionLayer] bit to be set. */ public var inputPickable: Boolean get() { @@ -151,9 +176,10 @@ public open class CollisionObject2D internal constructor() : Node2D() { } /** - * Accepts unhandled [godot.InputEvent]s. [shapeIdx] is the child index of the clicked [godot.Shape2D]. Connect to [inputEvent] to easily pick up these events. - * - * **Note:** [_inputEvent] requires [inputPickable] to be `true` and at least one [collisionLayer] bit to be set. + * Accepts unhandled [InputEvent]s. [param shape_idx] is the child index of the clicked [Shape2D]. + * Connect to [signal input_event] to easily pick up these events. + * **Note:** [_inputEvent] requires [inputPickable] to be `true` and at least one [collisionLayer] + * bit to be set. */ public open fun _inputEvent( viewport: Viewport, @@ -163,25 +189,33 @@ public open class CollisionObject2D internal constructor() : Node2D() { } /** - * Called when the mouse pointer enters any of this object's shapes. Requires [inputPickable] to be `true` and at least one [collisionLayer] bit to be set. Note that moving between different shapes within a single [godot.CollisionObject2D] won't cause this function to be called. + * Called when the mouse pointer enters any of this object's shapes. Requires [inputPickable] to + * be `true` and at least one [collisionLayer] bit to be set. Note that moving between different + * shapes within a single [CollisionObject2D] won't cause this function to be called. */ public open fun _mouseEnter(): Unit { } /** - * Called when the mouse pointer exits all this object's shapes. Requires [inputPickable] to be `true` and at least one [collisionLayer] bit to be set. Note that moving between different shapes within a single [godot.CollisionObject2D] won't cause this function to be called. + * Called when the mouse pointer exits all this object's shapes. Requires [inputPickable] to be + * `true` and at least one [collisionLayer] bit to be set. Note that moving between different shapes + * within a single [CollisionObject2D] won't cause this function to be called. */ public open fun _mouseExit(): Unit { } /** - * Called when the mouse pointer enters any of this object's shapes or moves from one shape to another. [shapeIdx] is the child index of the newly entered [godot.Shape2D]. Requires [inputPickable] to be `true` and at least one [collisionLayer] bit to be called. + * Called when the mouse pointer enters any of this object's shapes or moves from one shape to + * another. [param shape_idx] is the child index of the newly entered [Shape2D]. Requires + * [inputPickable] to be `true` and at least one [collisionLayer] bit to be called. */ public open fun _mouseShapeEnter(shapeIdx: Int): Unit { } /** - * Called when the mouse pointer exits any of this object's shapes. [shapeIdx] is the child index of the exited [godot.Shape2D]. Requires [inputPickable] to be `true` and at least one [collisionLayer] bit to be called. + * Called when the mouse pointer exits any of this object's shapes. [param shape_idx] is the child + * index of the exited [Shape2D]. Requires [inputPickable] to be `true` and at least one + * [collisionLayer] bit to be called. */ public open fun _mouseShapeExit(shapeIdx: Int): Unit { } @@ -196,7 +230,8 @@ public open class CollisionObject2D internal constructor() : Node2D() { } /** - * Based on [value], enables or disables the specified layer in the [collisionLayer], given a [layerNumber] between 1 and 32. + * Based on [param value], enables or disables the specified layer in the [collisionLayer], given + * a [param layer_number] between 1 and 32. */ public fun setCollisionLayerValue(layerNumber: Int, `value`: Boolean): Unit { TransferContext.writeArguments(LONG to layerNumber.toLong(), BOOL to value) @@ -204,7 +239,8 @@ public open class CollisionObject2D internal constructor() : Node2D() { } /** - * Returns whether or not the specified layer of the [collisionLayer] is enabled, given a [layerNumber] between 1 and 32. + * Returns whether or not the specified layer of the [collisionLayer] is enabled, given a [param + * layer_number] between 1 and 32. */ public fun getCollisionLayerValue(layerNumber: Int): Boolean { TransferContext.writeArguments(LONG to layerNumber.toLong()) @@ -213,7 +249,8 @@ public open class CollisionObject2D internal constructor() : Node2D() { } /** - * Based on [value], enables or disables the specified layer in the [collisionMask], given a [layerNumber] between 1 and 32. + * Based on [param value], enables or disables the specified layer in the [collisionMask], given a + * [param layer_number] between 1 and 32. */ public fun setCollisionMaskValue(layerNumber: Int, `value`: Boolean): Unit { TransferContext.writeArguments(LONG to layerNumber.toLong(), BOOL to value) @@ -221,7 +258,8 @@ public open class CollisionObject2D internal constructor() : Node2D() { } /** - * Returns whether or not the specified layer of the [collisionMask] is enabled, given a [layerNumber] between 1 and 32. + * Returns whether or not the specified layer of the [collisionMask] is enabled, given a [param + * layer_number] between 1 and 32. */ public fun getCollisionMaskValue(layerNumber: Int): Boolean { TransferContext.writeArguments(LONG to layerNumber.toLong()) @@ -230,7 +268,8 @@ public open class CollisionObject2D internal constructor() : Node2D() { } /** - * Creates a new shape owner for the given object. Returns `owner_id` of the new owner for future reference. + * Creates a new shape owner for the given object. Returns `owner_id` of the new owner for future + * reference. */ public fun createShapeOwner(owner: Object): Long { TransferContext.writeArguments(OBJECT to owner) @@ -247,7 +286,8 @@ public open class CollisionObject2D internal constructor() : Node2D() { } /** - * Returns an [godot.Array] of `owner_id` identifiers. You can use these ids in other methods that take `owner_id` as an argument. + * Returns an [Array] of `owner_id` identifiers. You can use these ids in other methods that take + * `owner_id` as an argument. */ public fun getShapeOwners(): PackedInt32Array { TransferContext.writeArguments() @@ -256,7 +296,7 @@ public open class CollisionObject2D internal constructor() : Node2D() { } /** - * Sets the [godot.core.Transform2D] of the given shape owner. + * Sets the [Transform2D] of the given shape owner. */ public fun shapeOwnerSetTransform(ownerId: Long, transform: Transform2D): Unit { TransferContext.writeArguments(LONG to ownerId, TRANSFORM2D to transform) @@ -264,7 +304,7 @@ public open class CollisionObject2D internal constructor() : Node2D() { } /** - * Returns the shape owner's [godot.core.Transform2D]. + * Returns the shape owner's [Transform2D]. */ public fun shapeOwnerGetTransform(ownerId: Long): Transform2D { TransferContext.writeArguments(LONG to ownerId) @@ -299,7 +339,8 @@ public open class CollisionObject2D internal constructor() : Node2D() { } /** - * If [enable] is `true`, collisions for the shape owner originating from this [godot.CollisionObject2D] will not be reported to collided with [godot.CollisionObject2D]s. + * If [param enable] is `true`, collisions for the shape owner originating from this + * [CollisionObject2D] will not be reported to collided with [CollisionObject2D]s. */ public fun shapeOwnerSetOneWayCollision(ownerId: Long, enable: Boolean): Unit { TransferContext.writeArguments(LONG to ownerId, BOOL to enable) @@ -307,7 +348,8 @@ public open class CollisionObject2D internal constructor() : Node2D() { } /** - * Returns `true` if collisions for the shape owner originating from this [godot.CollisionObject2D] will not be reported to collided with [godot.CollisionObject2D]s. + * Returns `true` if collisions for the shape owner originating from this [CollisionObject2D] will + * not be reported to collided with [CollisionObject2D]s. */ public fun isShapeOwnerOneWayCollisionEnabled(ownerId: Long): Boolean { TransferContext.writeArguments(LONG to ownerId) @@ -316,7 +358,8 @@ public open class CollisionObject2D internal constructor() : Node2D() { } /** - * Sets the `one_way_collision_margin` of the shape owner identified by given [ownerId] to [margin] pixels. + * Sets the `one_way_collision_margin` of the shape owner identified by given [param owner_id] to + * [param margin] pixels. */ public fun shapeOwnerSetOneWayCollisionMargin(ownerId: Long, margin: Float): Unit { TransferContext.writeArguments(LONG to ownerId, DOUBLE to margin.toDouble()) @@ -324,7 +367,7 @@ public open class CollisionObject2D internal constructor() : Node2D() { } /** - * Returns the `one_way_collision_margin` of the shape owner identified by given [ownerId]. + * Returns the `one_way_collision_margin` of the shape owner identified by given [param owner_id]. */ public fun getShapeOwnerOneWayCollisionMargin(ownerId: Long): Float { TransferContext.writeArguments(LONG to ownerId) @@ -333,7 +376,7 @@ public open class CollisionObject2D internal constructor() : Node2D() { } /** - * Adds a [godot.Shape2D] to the shape owner. + * Adds a [Shape2D] to the shape owner. */ public fun shapeOwnerAddShape(ownerId: Long, shape: Shape2D): Unit { TransferContext.writeArguments(LONG to ownerId, OBJECT to shape) @@ -350,7 +393,7 @@ public open class CollisionObject2D internal constructor() : Node2D() { } /** - * Returns the [godot.Shape2D] with the given ID from the given shape owner. + * Returns the [Shape2D] with the given ID from the given shape owner. */ public fun shapeOwnerGetShape(ownerId: Long, shapeId: Int): Shape2D? { TransferContext.writeArguments(LONG to ownerId, LONG to shapeId.toLong()) @@ -359,7 +402,7 @@ public open class CollisionObject2D internal constructor() : Node2D() { } /** - * Returns the child index of the [godot.Shape2D] with the given ID from the given shape owner. + * Returns the child index of the [Shape2D] with the given ID from the given shape owner. */ public fun shapeOwnerGetShapeIndex(ownerId: Long, shapeId: Int): Int { TransferContext.writeArguments(LONG to ownerId, LONG to shapeId.toLong()) @@ -396,19 +439,22 @@ public open class CollisionObject2D internal constructor() : Node2D() { id: Long, ) { /** - * When [godot.Node.processMode] is set to [godot.Node.PROCESS_MODE_DISABLED], remove from the physics simulation to stop all physics interactions with this [godot.CollisionObject2D]. - * - * Automatically re-added to the physics simulation when the [godot.Node] is processed again. + * When [Node.processMode] is set to [constant Node.PROCESS_MODE_DISABLED], remove from the + * physics simulation to stop all physics interactions with this [CollisionObject2D]. + * Automatically re-added to the physics simulation when the [Node] is processed again. */ DISABLE_MODE_REMOVE(0), /** - * When [godot.Node.processMode] is set to [godot.Node.PROCESS_MODE_DISABLED], make the body static. Doesn't affect [godot.Area2D]. [godot.PhysicsBody2D] can't be affected by forces or other bodies while static. - * - * Automatically set [godot.PhysicsBody2D] back to its original mode when the [godot.Node] is processed again. + * When [Node.processMode] is set to [constant Node.PROCESS_MODE_DISABLED], make the body + * static. Doesn't affect [Area2D]. [PhysicsBody2D] can't be affected by forces or other bodies + * while static. + * Automatically set [PhysicsBody2D] back to its original mode when the [Node] is processed + * again. */ DISABLE_MODE_MAKE_STATIC(1), /** - * When [godot.Node.processMode] is set to [godot.Node.PROCESS_MODE_DISABLED], do not affect the physics simulation. + * When [Node.processMode] is set to [constant Node.PROCESS_MODE_DISABLED], do not affect the + * physics simulation. */ DISABLE_MODE_KEEP_ACTIVE(2), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CollisionObject3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CollisionObject3D.kt index 04df772a8..d61991601 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CollisionObject3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CollisionObject3D.kt @@ -34,36 +34,45 @@ import kotlin.Suppress import kotlin.Unit /** - * Abstract base class for 3D physics objects. - * - * Abstract base class for 3D physics objects. [godot.CollisionObject3D] can hold any number of [godot.Shape3D]s for collision. Each shape must be assigned to a *shape owner*. Shape owners are not nodes and do not appear in the editor, but are accessible through code using the `shape_owner_*` methods. - * - * **Warning:** With a non-uniform scale, this node will likely not behave as expected. It is advised to keep its scale the same on all axes and adjust its collision shape(s) instead. + * Abstract base class for 3D physics objects. [CollisionObject3D] can hold any number of [Shape3D]s + * for collision. Each shape must be assigned to a *shape owner*. Shape owners are not nodes and do not + * appear in the editor, but are accessible through code using the `shape_owner_*` methods. + * **Warning:** With a non-uniform scale, this node will likely not behave as expected. It is + * advised to keep its scale the same on all axes and adjust its collision shape(s) instead. */ @GodotBaseType public open class CollisionObject3D internal constructor() : Node3D() { /** - * Emitted when the object receives an unhandled [godot.InputEvent]. [position] is the location in world space of the mouse pointer on the surface of the shape with index [shapeIdx] and [normal] is the normal vector of the surface at that point. + * Emitted when the object receives an unhandled [InputEvent]. [param position] is the location in + * world space of the mouse pointer on the surface of the shape with index [param shape_idx] and + * [param normal] is the normal vector of the surface at that point. */ public val inputEvent: Signal5 by signal("camera", "event", "position", "normal", "shapeIdx") /** - * Emitted when the mouse pointer enters any of this object's shapes. Requires [inputRayPickable] to be `true` and at least one [collisionLayer] bit to be set. - * - * **Note:** Due to the lack of continuous collision detection, this signal may not be emitted in the expected order if the mouse moves fast enough and the [godot.CollisionObject3D]'s area is small. This signal may also not be emitted if another [godot.CollisionObject3D] is overlapping the [godot.CollisionObject3D] in question. + * Emitted when the mouse pointer enters any of this object's shapes. Requires [inputRayPickable] + * to be `true` and at least one [collisionLayer] bit to be set. + * **Note:** Due to the lack of continuous collision detection, this signal may not be emitted in + * the expected order if the mouse moves fast enough and the [CollisionObject3D]'s area is small. + * This signal may also not be emitted if another [CollisionObject3D] is overlapping the + * [CollisionObject3D] in question. */ public val mouseEntered: Signal0 by signal() /** - * Emitted when the mouse pointer exits all this object's shapes. Requires [inputRayPickable] to be `true` and at least one [collisionLayer] bit to be set. - * - * **Note:** Due to the lack of continuous collision detection, this signal may not be emitted in the expected order if the mouse moves fast enough and the [godot.CollisionObject3D]'s area is small. This signal may also not be emitted if another [godot.CollisionObject3D] is overlapping the [godot.CollisionObject3D] in question. + * Emitted when the mouse pointer exits all this object's shapes. Requires [inputRayPickable] to + * be `true` and at least one [collisionLayer] bit to be set. + * **Note:** Due to the lack of continuous collision detection, this signal may not be emitted in + * the expected order if the mouse moves fast enough and the [CollisionObject3D]'s area is small. + * This signal may also not be emitted if another [CollisionObject3D] is overlapping the + * [CollisionObject3D] in question. */ public val mouseExited: Signal0 by signal() /** - * Defines the behavior in physics when [godot.Node.processMode] is set to [godot.Node.PROCESS_MODE_DISABLED]. See [enum DisableMode] for more details about the different modes. + * Defines the behavior in physics when [Node.processMode] is set to [constant + * Node.PROCESS_MODE_DISABLED]. See [enum DisableMode] for more details about the different modes. */ public var disableMode: DisableMode get() { @@ -77,9 +86,12 @@ public open class CollisionObject3D internal constructor() : Node3D() { } /** - * The physics layers this CollisionObject3D **is in**. Collision objects can exist in one or more of 32 different layers. See also [collisionMask]. - * - * **Note:** Object A can detect a contact with object B only if object B is in any of the layers that object A scans. See [godot.Collision layers and masks]($DOCS_URL/tutorials/physics/physics_introduction.html#collision-layers-and-masks) in the documentation for more information. + * The physics layers this CollisionObject3D **is in**. Collision objects can exist in one or more + * of 32 different layers. See also [collisionMask]. + * **Note:** Object A can detect a contact with object B only if object B is in any of the layers + * that object A scans. See + * [url=$DOCS_URL/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision + * layers and masks[/url] in the documentation for more information. */ public var collisionLayer: Long get() { @@ -93,9 +105,12 @@ public open class CollisionObject3D internal constructor() : Node3D() { } /** - * The physics layers this CollisionObject3D **scans**. Collision objects can scan one or more of 32 different layers. See also [collisionLayer]. - * - * **Note:** Object A can detect a contact with object B only if object B is in any of the layers that object A scans. See [godot.Collision layers and masks]($DOCS_URL/tutorials/physics/physics_introduction.html#collision-layers-and-masks) in the documentation for more information. + * The physics layers this CollisionObject3D **scans**. Collision objects can scan one or more of + * 32 different layers. See also [collisionLayer]. + * **Note:** Object A can detect a contact with object B only if object B is in any of the layers + * that object A scans. See + * [url=$DOCS_URL/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision + * layers and masks[/url] in the documentation for more information. */ public var collisionMask: Long get() { @@ -109,7 +124,9 @@ public open class CollisionObject3D internal constructor() : Node3D() { } /** - * The priority used to solve colliding when occurring penetration. The higher the priority is, the lower the penetration into the object will be. This can for example be used to prevent the player from breaking through the boundaries of a level. + * The priority used to solve colliding when occurring penetration. The higher the priority is, + * the lower the penetration into the object will be. This can for example be used to prevent the + * player from breaking through the boundaries of a level. */ public var collisionPriority: Float get() { @@ -123,7 +140,9 @@ public open class CollisionObject3D internal constructor() : Node3D() { } /** - * If `true`, this object is pickable. A pickable object can detect the mouse pointer entering/leaving, and if the mouse is inside it, report input events. Requires at least one [collisionLayer] bit to be set. + * If `true`, this object is pickable. A pickable object can detect the mouse pointer + * entering/leaving, and if the mouse is inside it, report input events. Requires at least one + * [collisionLayer] bit to be set. */ public var inputRayPickable: Boolean get() { @@ -137,7 +156,8 @@ public open class CollisionObject3D internal constructor() : Node3D() { } /** - * If `true`, the [godot.CollisionObject3D] will continue to receive input events as the mouse is dragged across its shapes. + * If `true`, the [CollisionObject3D] will continue to receive input events as the mouse is + * dragged across its shapes. */ public var inputCaptureOnDrag: Boolean get() { @@ -156,9 +176,12 @@ public open class CollisionObject3D internal constructor() : Node3D() { } /** - * Receives unhandled [godot.InputEvent]s. [position] is the location in world space of the mouse pointer on the surface of the shape with index [shapeIdx] and [normal] is the normal vector of the surface at that point. Connect to the [inputEvent] signal to easily pick up these events. - * - * **Note:** [_inputEvent] requires [inputRayPickable] to be `true` and at least one [collisionLayer] bit to be set. + * Receives unhandled [InputEvent]s. [param position] is the location in world space of the mouse + * pointer on the surface of the shape with index [param shape_idx] and [param normal] is the normal + * vector of the surface at that point. Connect to the [signal input_event] signal to easily pick up + * these events. + * **Note:** [_inputEvent] requires [inputRayPickable] to be `true` and at least one + * [collisionLayer] bit to be set. */ public open fun _inputEvent( camera: Camera3D, @@ -170,19 +193,24 @@ public open class CollisionObject3D internal constructor() : Node3D() { } /** - * Called when the mouse pointer enters any of this object's shapes. Requires [inputRayPickable] to be `true` and at least one [collisionLayer] bit to be set. Note that moving between different shapes within a single [godot.CollisionObject3D] won't cause this function to be called. + * Called when the mouse pointer enters any of this object's shapes. Requires [inputRayPickable] + * to be `true` and at least one [collisionLayer] bit to be set. Note that moving between different + * shapes within a single [CollisionObject3D] won't cause this function to be called. */ public open fun _mouseEnter(): Unit { } /** - * Called when the mouse pointer exits all this object's shapes. Requires [inputRayPickable] to be `true` and at least one [collisionLayer] bit to be set. Note that moving between different shapes within a single [godot.CollisionObject3D] won't cause this function to be called. + * Called when the mouse pointer exits all this object's shapes. Requires [inputRayPickable] to be + * `true` and at least one [collisionLayer] bit to be set. Note that moving between different shapes + * within a single [CollisionObject3D] won't cause this function to be called. */ public open fun _mouseExit(): Unit { } /** - * Based on [value], enables or disables the specified layer in the [collisionLayer], given a [layerNumber] between 1 and 32. + * Based on [param value], enables or disables the specified layer in the [collisionLayer], given + * a [param layer_number] between 1 and 32. */ public fun setCollisionLayerValue(layerNumber: Int, `value`: Boolean): Unit { TransferContext.writeArguments(LONG to layerNumber.toLong(), BOOL to value) @@ -190,7 +218,8 @@ public open class CollisionObject3D internal constructor() : Node3D() { } /** - * Returns whether or not the specified layer of the [collisionLayer] is enabled, given a [layerNumber] between 1 and 32. + * Returns whether or not the specified layer of the [collisionLayer] is enabled, given a [param + * layer_number] between 1 and 32. */ public fun getCollisionLayerValue(layerNumber: Int): Boolean { TransferContext.writeArguments(LONG to layerNumber.toLong()) @@ -199,7 +228,8 @@ public open class CollisionObject3D internal constructor() : Node3D() { } /** - * Based on [value], enables or disables the specified layer in the [collisionMask], given a [layerNumber] between 1 and 32. + * Based on [param value], enables or disables the specified layer in the [collisionMask], given a + * [param layer_number] between 1 and 32. */ public fun setCollisionMaskValue(layerNumber: Int, `value`: Boolean): Unit { TransferContext.writeArguments(LONG to layerNumber.toLong(), BOOL to value) @@ -207,7 +237,8 @@ public open class CollisionObject3D internal constructor() : Node3D() { } /** - * Returns whether or not the specified layer of the [collisionMask] is enabled, given a [layerNumber] between 1 and 32. + * Returns whether or not the specified layer of the [collisionMask] is enabled, given a [param + * layer_number] between 1 and 32. */ public fun getCollisionMaskValue(layerNumber: Int): Boolean { TransferContext.writeArguments(LONG to layerNumber.toLong()) @@ -225,7 +256,8 @@ public open class CollisionObject3D internal constructor() : Node3D() { } /** - * Creates a new shape owner for the given object. Returns `owner_id` of the new owner for future reference. + * Creates a new shape owner for the given object. Returns `owner_id` of the new owner for future + * reference. */ public fun createShapeOwner(owner: Object): Long { TransferContext.writeArguments(OBJECT to owner) @@ -242,7 +274,8 @@ public open class CollisionObject3D internal constructor() : Node3D() { } /** - * Returns an [godot.Array] of `owner_id` identifiers. You can use these ids in other methods that take `owner_id` as an argument. + * Returns an [Array] of `owner_id` identifiers. You can use these ids in other methods that take + * `owner_id` as an argument. */ public fun getShapeOwners(): PackedInt32Array { TransferContext.writeArguments() @@ -251,7 +284,7 @@ public open class CollisionObject3D internal constructor() : Node3D() { } /** - * Sets the [godot.Transform3D] of the given shape owner. + * Sets the [Transform3D] of the given shape owner. */ public fun shapeOwnerSetTransform(ownerId: Long, transform: Transform3D): Unit { TransferContext.writeArguments(LONG to ownerId, TRANSFORM3D to transform) @@ -259,7 +292,7 @@ public open class CollisionObject3D internal constructor() : Node3D() { } /** - * Returns the shape owner's [godot.Transform3D]. + * Returns the shape owner's [Transform3D]. */ public fun shapeOwnerGetTransform(ownerId: Long): Transform3D { TransferContext.writeArguments(LONG to ownerId) @@ -294,7 +327,7 @@ public open class CollisionObject3D internal constructor() : Node3D() { } /** - * Adds a [godot.Shape3D] to the shape owner. + * Adds a [Shape3D] to the shape owner. */ public fun shapeOwnerAddShape(ownerId: Long, shape: Shape3D): Unit { TransferContext.writeArguments(LONG to ownerId, OBJECT to shape) @@ -311,7 +344,7 @@ public open class CollisionObject3D internal constructor() : Node3D() { } /** - * Returns the [godot.Shape3D] with the given ID from the given shape owner. + * Returns the [Shape3D] with the given ID from the given shape owner. */ public fun shapeOwnerGetShape(ownerId: Long, shapeId: Int): Shape3D? { TransferContext.writeArguments(LONG to ownerId, LONG to shapeId.toLong()) @@ -320,7 +353,7 @@ public open class CollisionObject3D internal constructor() : Node3D() { } /** - * Returns the child index of the [godot.Shape3D] with the given ID from the given shape owner. + * Returns the child index of the [Shape3D] with the given ID from the given shape owner. */ public fun shapeOwnerGetShapeIndex(ownerId: Long, shapeId: Int): Int { TransferContext.writeArguments(LONG to ownerId, LONG to shapeId.toLong()) @@ -357,19 +390,22 @@ public open class CollisionObject3D internal constructor() : Node3D() { id: Long, ) { /** - * When [godot.Node.processMode] is set to [godot.Node.PROCESS_MODE_DISABLED], remove from the physics simulation to stop all physics interactions with this [godot.CollisionObject3D]. - * - * Automatically re-added to the physics simulation when the [godot.Node] is processed again. + * When [Node.processMode] is set to [constant Node.PROCESS_MODE_DISABLED], remove from the + * physics simulation to stop all physics interactions with this [CollisionObject3D]. + * Automatically re-added to the physics simulation when the [Node] is processed again. */ DISABLE_MODE_REMOVE(0), /** - * When [godot.Node.processMode] is set to [godot.Node.PROCESS_MODE_DISABLED], make the body static. Doesn't affect [godot.Area3D]. [godot.PhysicsBody3D] can't be affected by forces or other bodies while static. - * - * Automatically set [godot.PhysicsBody3D] back to its original mode when the [godot.Node] is processed again. + * When [Node.processMode] is set to [constant Node.PROCESS_MODE_DISABLED], make the body + * static. Doesn't affect [Area3D]. [PhysicsBody3D] can't be affected by forces or other bodies + * while static. + * Automatically set [PhysicsBody3D] back to its original mode when the [Node] is processed + * again. */ DISABLE_MODE_MAKE_STATIC(1), /** - * When [godot.Node.processMode] is set to [godot.Node.PROCESS_MODE_DISABLED], do not affect the physics simulation. + * When [Node.processMode] is set to [constant Node.PROCESS_MODE_DISABLED], do not affect the + * physics simulation. */ DISABLE_MODE_KEEP_ACTIVE(2), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CollisionPolygon3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CollisionPolygon3D.kt index 8150bc56b..9f205f6ac 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CollisionPolygon3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CollisionPolygon3D.kt @@ -22,16 +22,17 @@ import kotlin.Int import kotlin.Suppress /** - * A node that provides a thickened polygon shape (a prism) to a [godot.CollisionObject3D] parent. - * - * A node that provides a thickened polygon shape (a prism) to a [godot.CollisionObject3D] parent and allows to edit it. The polygon can be concave or convex. This can give a detection shape to an [godot.Area3D] or turn [godot.PhysicsBody3D] into a solid object. - * - * **Warning:** A non-uniformly scaled [godot.CollisionShape3D] will likely not behave as expected. Make sure to keep its scale the same on all axes and adjust its shape resource instead. + * A node that provides a thickened polygon shape (a prism) to a [CollisionObject3D] parent and + * allows to edit it. The polygon can be concave or convex. This can give a detection shape to an + * [Area3D] or turn [PhysicsBody3D] into a solid object. + * **Warning:** A non-uniformly scaled [CollisionShape3D] will likely not behave as expected. Make + * sure to keep its scale the same on all axes and adjust its shape resource instead. */ @GodotBaseType public open class CollisionPolygon3D : Node3D() { /** - * Length that the resulting collision extends in either direction perpendicular to its 2D polygon. + * Length that the resulting collision extends in either direction perpendicular to its 2D + * polygon. */ public var depth: Float get() { @@ -60,8 +61,9 @@ public open class CollisionPolygon3D : Node3D() { /** * Array of vertices which define the 2D polygon in the local XY plane. - * - * **Note:** The returned value is a copy of the original. Methods which mutate the size or properties of the return value will not impact the original polygon. To change properties of the polygon, assign it to a temporary variable and make changes before reassigning the class property. + * **Note:** The returned value is a copy of the original. Methods which mutate the size or + * properties of the return value will not impact the original polygon. To change properties of the + * polygon, assign it to a temporary variable and make changes before reassigning the class property. */ public var polygon: PackedVector2Array get() { @@ -75,7 +77,7 @@ public open class CollisionPolygon3D : Node3D() { } /** - * The collision margin for the generated [godot.Shape3D]. See [godot.Shape3D.margin] for more details. + * The collision margin for the generated [Shape3D]. See [Shape3D.margin] for more details. */ public var margin: Float get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CollisionShape2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CollisionShape2D.kt index fe42f8730..96ba96146 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CollisionShape2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CollisionShape2D.kt @@ -26,12 +26,8 @@ import kotlin.Suppress import kotlin.Unit /** - * A node that provides a [godot.Shape2D] to a [godot.CollisionObject2D] parent. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/113](https://godotengine.org/asset-library/asset/113) - * - * A node that provides a [godot.Shape2D] to a [godot.CollisionObject2D] parent and allows to edit it. This can give a detection shape to an [godot.Area2D] or turn a [godot.PhysicsBody2D] into a solid object. + * A node that provides a [Shape2D] to a [CollisionObject2D] parent and allows to edit it. This can + * give a detection shape to an [Area2D] or turn a [PhysicsBody2D] into a solid object. */ @GodotBaseType public open class CollisionShape2D : Node2D() { @@ -50,7 +46,8 @@ public open class CollisionShape2D : Node2D() { } /** - * A disabled collision shape has no effect in the world. This property should be changed with [godot.Object.setDeferred]. + * A disabled collision shape has no effect in the world. This property should be changed with + * [Object.setDeferred]. */ public var disabled: Boolean get() { @@ -65,8 +62,8 @@ public open class CollisionShape2D : Node2D() { /** * Sets whether this collision shape should only detect collision on one side (top or bottom). - * - * **Note:** This property has no effect if this [godot.CollisionShape2D] is a child of an [godot.Area2D] node. + * **Note:** This property has no effect if this [CollisionShape2D] is a child of an [Area2D] + * node. */ public var oneWayCollision: Boolean get() { @@ -80,7 +77,8 @@ public open class CollisionShape2D : Node2D() { } /** - * The margin used for one-way collision (in pixels). Higher values will make the shape thicker, and work better for colliders that enter the shape at a high velocity. + * The margin used for one-way collision (in pixels). Higher values will make the shape thicker, + * and work better for colliders that enter the shape at a high velocity. */ public var oneWayCollisionMargin: Float get() { @@ -95,8 +93,9 @@ public open class CollisionShape2D : Node2D() { /** * The collision shape debug color. - * - * **Note:** The default value is [godot.ProjectSettings.debug/shapes/collision/shapeColor]. The `Color(0, 0, 0, 1)` value documented here is a placeholder, and not the actual default debug color. + * **Note:** The default value is [ProjectSettings.debug/shapes/collision/shapeColor]. The + * `Color(0, 0, 0, 1)` value documented here is a placeholder, and not the actual default debug + * color. */ @CoreTypeLocalCopy public var debugColor: Color @@ -117,8 +116,9 @@ public open class CollisionShape2D : Node2D() { /** * The collision shape debug color. - * - * **Note:** The default value is [godot.ProjectSettings.debug/shapes/collision/shapeColor]. The `Color(0, 0, 0, 1)` value documented here is a placeholder, and not the actual default debug color. + * **Note:** The default value is [ProjectSettings.debug/shapes/collision/shapeColor]. The + * `Color(0, 0, 0, 1)` value documented here is a placeholder, and not the actual default debug + * color. * * This is a helper function to make dealing with local copies easier. * diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CollisionShape3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CollisionShape3D.kt index 370bce2ba..b8a3f2994 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CollisionShape3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CollisionShape3D.kt @@ -19,14 +19,10 @@ import kotlin.Suppress import kotlin.Unit /** - * A node that provides a [godot.Shape3D] to a [godot.CollisionObject3D] parent. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/678](https://godotengine.org/asset-library/asset/678) - * - * A node that provides a [godot.Shape3D] to a [godot.CollisionObject3D] parent and allows to edit it. This can give a detection shape to an [godot.Area3D] or turn a [godot.PhysicsBody3D] into a solid object. - * - * **Warning:** A non-uniformly scaled [godot.CollisionShape3D] will likely not behave as expected. Make sure to keep its scale the same on all axes and adjust its [shape] resource instead. + * A node that provides a [Shape3D] to a [CollisionObject3D] parent and allows to edit it. This can + * give a detection shape to an [Area3D] or turn a [PhysicsBody3D] into a solid object. + * **Warning:** A non-uniformly scaled [CollisionShape3D] will likely not behave as expected. Make + * sure to keep its scale the same on all axes and adjust its [shape] resource instead. */ @GodotBaseType public open class CollisionShape3D : Node3D() { @@ -64,7 +60,7 @@ public open class CollisionShape3D : Node3D() { } /** - * *Obsoleted.* Use [godot.Resource.changed] instead. + * *Obsoleted.* Use [signal Resource.changed] instead. */ public fun resourceChanged(resource: Resource): Unit { TransferContext.writeArguments(OBJECT to resource) @@ -72,7 +68,8 @@ public open class CollisionShape3D : Node3D() { } /** - * Sets the collision shape's shape to the addition of all its convexed [godot.MeshInstance3D] siblings geometry. + * Sets the collision shape's shape to the addition of all its convexed [MeshInstance3D] siblings + * geometry. */ public fun makeConvexFromSiblings(): Unit { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ColorPicker.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ColorPicker.kt index f133e2e43..6998c05c8 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ColorPicker.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ColorPicker.kt @@ -28,14 +28,10 @@ import kotlin.Suppress import kotlin.Unit /** - * A widget that provides an interface for selecting or modifying a color. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/146](https://godotengine.org/asset-library/asset/146) - * - * A widget that provides an interface for selecting or modifying a color. It can optionally provide functionalities like a color sampler (eyedropper), color modes, and presets. - * - * **Note:** This control is the color picker widget itself. You can use a [godot.ColorPickerButton] instead if you need a button that brings up a [godot.ColorPicker] in a popup. + * A widget that provides an interface for selecting or modifying a color. It can optionally provide + * functionalities like a color sampler (eyedropper), color modes, and presets. + * **Note:** This control is the color picker widget itself. You can use a [ColorPickerButton] + * instead if you need a button that brings up a [ColorPicker] in a popup. */ @GodotBaseType public open class ColorPicker : VBoxContainer() { @@ -98,7 +94,8 @@ public open class ColorPicker : VBoxContainer() { } /** - * If `true`, the color will apply only after the user releases the mouse button, otherwise it will apply immediately even in mouse motion event (which can cause performance issues). + * If `true`, the color will apply only after the user releases the mouse button, otherwise it + * will apply immediately even in mouse motion event (which can cause performance issues). */ public var deferredMode: Boolean get() { @@ -126,7 +123,8 @@ public open class ColorPicker : VBoxContainer() { } /** - * If `true`, it's possible to add presets under Swatches. If `false`, the button to add presets is disabled. + * If `true`, it's possible to add presets under Swatches. If `false`, the button to add presets + * is disabled. */ public var canAddSwatches: Boolean get() { @@ -239,8 +237,8 @@ public open class ColorPicker : VBoxContainer() { /** - * Adds the given color to a list of color presets. The presets are displayed in the color picker and the user will be able to select them. - * + * Adds the given color to a list of color presets. The presets are displayed in the color picker + * and the user will be able to select them. * **Note:** The presets list is only for *this* color picker. */ public fun addPreset(color: Color): Unit { @@ -266,8 +264,9 @@ public open class ColorPicker : VBoxContainer() { } /** - * Adds the given color to a list of color recent presets so that it can be picked later. Recent presets are the colors that were picked recently, a new preset is automatically created and added to recent presets when you pick a new color. - * + * Adds the given color to a list of color recent presets so that it can be picked later. Recent + * presets are the colors that were picked recently, a new preset is automatically created and added + * to recent presets when you pick a new color. * **Note:** The recent presets list is only for *this* color picker. */ public fun addRecentPreset(color: Color): Unit { @@ -304,15 +303,16 @@ public open class ColorPicker : VBoxContainer() { */ MODE_HSV(1), /** - * Allows the color R, G, B component values to go beyond 1.0, which can be used for certain special operations that require it (like tinting without darkening or rendering sprites in HDR). + * Allows the color R, G, B component values to go beyond 1.0, which can be used for certain + * special operations that require it (like tinting without darkening or rendering sprites in HDR). */ MODE_RAW(2), /** * Allows editing the color with Hue/Saturation/Lightness sliders. - * - * OKHSL is a new color space similar to HSL but that better match perception by leveraging the Oklab color space which is designed to be simple to use, while doing a good job at predicting perceived lightness, chroma and hue. - * - * [godot.Okhsv and Okhsl color spaces](https://bottosson.github.io/posts/colorpicker/) + * OKHSL is a new color space similar to HSL but that better match perception by leveraging the + * Oklab color space which is designed to be simple to use, while doing a good job at predicting + * perceived lightness, chroma and hue. + * [url=https://bottosson.github.io/posts/colorpicker/]Okhsv and Okhsl color spaces[/url] */ MODE_OKHSL(3), ; @@ -347,7 +347,8 @@ public open class ColorPicker : VBoxContainer() { */ SHAPE_OKHSL_CIRCLE(3), /** - * The color space shape and the shape select button are hidden. Can't be selected from the shapes popup. + * The color space shape and the shape select button are hidden. Can't be selected from the + * shapes popup. */ SHAPE_NONE(4), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ColorPickerButton.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ColorPickerButton.kt index f7a429668..491052145 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ColorPickerButton.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ColorPickerButton.kt @@ -26,16 +26,12 @@ import kotlin.Suppress import kotlin.Unit /** - * A button that brings up a [godot.ColorPicker] when pressed. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/517](https://godotengine.org/asset-library/asset/517) - * - * Encapsulates a [godot.ColorPicker], making it accessible by pressing a button. Pressing the button will toggle the [godot.ColorPicker]'s visibility. - * - * See also [godot.BaseButton] which contains common properties and methods associated with this node. - * - * **Note:** By default, the button may not be wide enough for the color preview swatch to be visible. Make sure to set [godot.Control.customMinimumSize] to a big enough value to give the button enough space. + * Encapsulates a [ColorPicker], making it accessible by pressing a button. Pressing the button will + * toggle the [ColorPicker]'s visibility. + * See also [BaseButton] which contains common properties and methods associated with this node. + * **Note:** By default, the button may not be wide enough for the color preview swatch to be + * visible. Make sure to set [Control.customMinimumSize] to a big enough value to give the button + * enough space. */ @GodotBaseType public open class ColorPickerButton : Button() { @@ -45,12 +41,12 @@ public open class ColorPickerButton : Button() { public val colorChanged: Signal1 by signal("color") /** - * Emitted when the [godot.ColorPicker] is closed. + * Emitted when the [ColorPicker] is closed. */ public val popupClosed: Signal0 by signal() /** - * Emitted when the [godot.ColorPicker] is created (the button is pressed for the first time). + * Emitted when the [ColorPicker] is created (the button is pressed for the first time). */ public val pickerCreated: Signal0 by signal() @@ -70,7 +66,7 @@ public open class ColorPickerButton : Button() { } /** - * If `true`, the alpha channel in the displayed [godot.ColorPicker] will be visible. + * If `true`, the alpha channel in the displayed [ColorPicker] will be visible. */ public var editAlpha: Boolean get() { @@ -113,9 +109,9 @@ public open class ColorPickerButton : Button() { /** - * Returns the [godot.ColorPicker] that this node toggles. - * - * **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [godot.CanvasItem.visible] property. + * Returns the [ColorPicker] that this node toggles. + * **Warning:** This is a required internal node, removing and freeing it may cause a crash. If + * you wish to hide it or any of its children, use their [CanvasItem.visible] property. */ public fun getPicker(): ColorPicker? { TransferContext.writeArguments() @@ -124,9 +120,10 @@ public open class ColorPickerButton : Button() { } /** - * Returns the control's [godot.PopupPanel] which allows you to connect to popup signals. This allows you to handle events when the ColorPicker is shown or hidden. - * - * **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [godot.Window.visible] property. + * Returns the control's [PopupPanel] which allows you to connect to popup signals. This allows + * you to handle events when the ColorPicker is shown or hidden. + * **Warning:** This is a required internal node, removing and freeing it may cause a crash. If + * you wish to hide it or any of its children, use their [Window.visible] property. */ public fun getPopup(): PopupPanel? { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ColorRect.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ColorRect.kt index 70e27fbd8..b27102ee5 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ColorRect.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ColorRect.kt @@ -21,12 +21,8 @@ import kotlin.Suppress import kotlin.Unit /** - * A control that displays a solid color rectangle. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/515](https://godotengine.org/asset-library/asset/515) - * - * Displays a rectangle filled with a solid [color]. If you need to display the border alone, consider using a [godot.Panel] instead. + * Displays a rectangle filled with a solid [color]. If you need to display the border alone, + * consider using a [Panel] instead. */ @GodotBaseType public open class ColorRect : Control() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CompressedTexture2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CompressedTexture2D.kt index b9ac68304..ca6797340 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CompressedTexture2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CompressedTexture2D.kt @@ -20,28 +20,26 @@ import kotlin.String import kotlin.Suppress /** - * Texture with 2 dimensions, optionally compressed. - * - * A texture that is loaded from a `.ctex` file. This file format is internal to Godot; it is created by importing other image formats with the import system. [godot.CompressedTexture2D] can use one of 4 compression methods (including a lack of any compression): - * + * A texture that is loaded from a `.ctex` file. This file format is internal to Godot; it is + * created by importing other image formats with the import system. [CompressedTexture2D] can use one + * of 4 compression methods (including a lack of any compression): * - Lossless (WebP or PNG, uncompressed on the GPU) - * * - Lossy (WebP, uncompressed on the GPU) - * * - VRAM Compressed (compressed on the GPU) - * * - VRAM Uncompressed (uncompressed on the GPU) - * - * - Basis Universal (compressed on the GPU. Lower file sizes than VRAM Compressed, but slower to compress and lower quality than VRAM Compressed) - * - * Only **VRAM Compressed** actually reduces the memory usage on the GPU. The **Lossless** and **Lossy** compression methods will reduce the required storage on disk, but they will not reduce memory usage on the GPU as the texture is sent to the GPU uncompressed. - * - * Using **VRAM Compressed** also improves loading times, as VRAM-compressed textures are faster to load compared to textures using lossless or lossy compression. VRAM compression can exhibit noticeable artifacts and is intended to be used for 3D rendering, not 2D. + * - Basis Universal (compressed on the GPU. Lower file sizes than VRAM Compressed, but slower to + * compress and lower quality than VRAM Compressed) + * Only **VRAM Compressed** actually reduces the memory usage on the GPU. The **Lossless** and + * **Lossy** compression methods will reduce the required storage on disk, but they will not reduce + * memory usage on the GPU as the texture is sent to the GPU uncompressed. + * Using **VRAM Compressed** also improves loading times, as VRAM-compressed textures are faster to + * load compared to textures using lossless or lossy compression. VRAM compression can exhibit + * noticeable artifacts and is intended to be used for 3D rendering, not 2D. */ @GodotBaseType public open class CompressedTexture2D : Texture2D() { /** - * The [godot.CompressedTexture2D]'s file path to a `.ctex` file. + * The [CompressedTexture2D]'s file path to a `.ctex` file. */ public val loadPath: String get() { @@ -56,7 +54,7 @@ public open class CompressedTexture2D : Texture2D() { } /** - * Loads the texture from the specified [path]. + * Loads the texture from the specified [param path]. */ public fun load(path: String): GodotError { TransferContext.writeArguments(STRING to path) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CompressedTexture3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CompressedTexture3D.kt index da85cb916..f738793b5 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CompressedTexture3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CompressedTexture3D.kt @@ -20,18 +20,19 @@ import kotlin.String import kotlin.Suppress /** - * Texture with 3 dimensions, optionally compressed. - * - * [godot.CompressedTexture3D] is the VRAM-compressed counterpart of [godot.ImageTexture3D]. The file extension for [godot.CompressedTexture3D] files is `.ctex3d`. This file format is internal to Godot; it is created by importing other image formats with the import system. - * - * [godot.CompressedTexture3D] uses VRAM compression, which allows to reduce memory usage on the GPU when rendering the texture. This also improves loading times, as VRAM-compressed textures are faster to load compared to textures using lossless compression. VRAM compression can exhibit noticeable artifacts and is intended to be used for 3D rendering, not 2D. - * - * See [godot.Texture3D] for a general description of 3D textures. + * [CompressedTexture3D] is the VRAM-compressed counterpart of [ImageTexture3D]. The file extension + * for [CompressedTexture3D] files is `.ctex3d`. This file format is internal to Godot; it is created + * by importing other image formats with the import system. + * [CompressedTexture3D] uses VRAM compression, which allows to reduce memory usage on the GPU when + * rendering the texture. This also improves loading times, as VRAM-compressed textures are faster to + * load compared to textures using lossless compression. VRAM compression can exhibit noticeable + * artifacts and is intended to be used for 3D rendering, not 2D. + * See [Texture3D] for a general description of 3D textures. */ @GodotBaseType public open class CompressedTexture3D : Texture3D() { /** - * The [godot.CompressedTexture3D]'s file path to a `.ctex3d` file. + * The [CompressedTexture3D]'s file path to a `.ctex3d` file. */ public val loadPath: String get() { @@ -46,7 +47,7 @@ public open class CompressedTexture3D : Texture3D() { } /** - * Loads the texture from the specified [path]. + * Loads the texture from the specified [param path]. */ public fun load(path: String): GodotError { TransferContext.writeArguments(STRING to path) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CompressedTextureLayered.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CompressedTextureLayered.kt index 76d3cd029..270db0b0d 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CompressedTextureLayered.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CompressedTextureLayered.kt @@ -20,9 +20,9 @@ import kotlin.String import kotlin.Suppress /** - * Base class for texture arrays that can optionally be compressed. - * - * Base class for [godot.CompressedTexture2DArray] and [godot.CompressedTexture3D]. Cannot be used directly, but contains all the functions necessary for accessing the derived resource types. See also [godot.TextureLayered]. + * Base class for [CompressedTexture2DArray] and [CompressedTexture3D]. Cannot be used directly, but + * contains all the functions necessary for accessing the derived resource types. See also + * [TextureLayered]. */ @GodotBaseType public open class CompressedTextureLayered internal constructor() : TextureLayered() { @@ -42,7 +42,7 @@ public open class CompressedTextureLayered internal constructor() : TextureLayer } /** - * Loads the texture at [path]. + * Loads the texture at [param path]. */ public fun load(path: String): GodotError { TransferContext.writeArguments(STRING to path) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ConeTwistJoint3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ConeTwistJoint3D.kt index da75b31ef..d295e8b15 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ConeTwistJoint3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ConeTwistJoint3D.kt @@ -21,19 +21,17 @@ import kotlin.Long import kotlin.Suppress /** - * A physics joint that connects two 3D physics bodies in a way that simulates a ball-and-socket joint. - * - * A physics joint that connects two 3D physics bodies in a way that simulates a ball-and-socket joint. The twist axis is initiated as the X axis of the [godot.ConeTwistJoint3D]. Once the physics bodies swing, the twist axis is calculated as the middle of the X axes of the joint in the local space of the two physics bodies. Useful for limbs like shoulders and hips, lamps hanging off a ceiling, etc. + * A physics joint that connects two 3D physics bodies in a way that simulates a ball-and-socket + * joint. The twist axis is initiated as the X axis of the [ConeTwistJoint3D]. Once the physics bodies + * swing, the twist axis is calculated as the middle of the X axes of the joint in the local space of + * the two physics bodies. Useful for limbs like shoulders and hips, lamps hanging off a ceiling, etc. */ @GodotBaseType public open class ConeTwistJoint3D : Joint3D() { /** * Swing is rotation from side to side, around the axis perpendicular to the twist axis. - * * The swing span defines, how much rotation will not get corrected along the swing axis. - * - * Could be defined as looseness in the [godot.ConeTwistJoint3D]. - * + * Could be defined as looseness in the [ConeTwistJoint3D]. * If below 0.05, this behavior is locked. */ public var swingSpan: Float @@ -49,7 +47,6 @@ public open class ConeTwistJoint3D : Joint3D() { /** * Twist is the rotation around the twist axis, this value defined how far the joint can twist. - * * Twist is locked if below 0.05. */ public var twistSpan: Float @@ -65,7 +62,6 @@ public open class ConeTwistJoint3D : Joint3D() { /** * The speed with which the swing or twist will take place. - * * The higher, the faster. */ public var bias: Float @@ -80,7 +76,8 @@ public open class ConeTwistJoint3D : Joint3D() { } /** - * The ease with which the joint starts to twist. If it's too low, it takes more force to start twisting the joint. + * The ease with which the joint starts to twist. If it's too low, it takes more force to start + * twisting the joint. */ public var softness: Float get() { @@ -117,28 +114,24 @@ public open class ConeTwistJoint3D : Joint3D() { ) { /** * Swing is rotation from side to side, around the axis perpendicular to the twist axis. - * * The swing span defines, how much rotation will not get corrected along the swing axis. - * - * Could be defined as looseness in the [godot.ConeTwistJoint3D]. - * + * Could be defined as looseness in the [ConeTwistJoint3D]. * If below 0.05, this behavior is locked. */ PARAM_SWING_SPAN(0), /** * Twist is the rotation around the twist axis, this value defined how far the joint can twist. - * * Twist is locked if below 0.05. */ PARAM_TWIST_SPAN(1), /** * The speed with which the swing or twist will take place. - * * The higher, the faster. */ PARAM_BIAS(2), /** - * The ease with which the joint starts to twist. If it's too low, it takes more force to start twisting the joint. + * The ease with which the joint starts to twist. If it's too low, it takes more force to start + * twisting the joint. */ PARAM_SOFTNESS(3), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ConfigFile.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ConfigFile.kt index e6247f5c5..71efe9dc3 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ConfigFile.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ConfigFile.kt @@ -30,170 +30,105 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * Helper class to handle INI-style files. - * - * This helper class can be used to store [Variant] values on the filesystem using INI-style formatting. The stored values are identified by a section and a key: - * - * ``` - * [section] - * some_key=42 - * string_example="Hello World3D!" - * a_vector=Vector3(1, 0, 2) - * ``` - * - * The stored data can be saved to or parsed from a file, though ConfigFile objects can also be used directly without accessing the filesystem. - * - * The following example shows how to create a simple [godot.ConfigFile] and save it on disc: - * - * [codeblocks] - * - * [gdscript] - * + * This helper class can be used to store [Variant] values on the filesystem using INI-style + * formatting. The stored values are identified by a section and a key: + * [codeblock] + * [section] + * some_key=42 + * string_example="Hello World3D!" + * a_vector=Vector3(1, 0, 2) + * [/codeblock] + * The stored data can be saved to or parsed from a file, though ConfigFile objects can also be used + * directly without accessing the filesystem. + * The following example shows how to create a simple [ConfigFile] and save it on disc: + * + * gdscript: + * ```gdscript * # Create new ConfigFile object. - * * var config = ConfigFile.new() * - * - * * # Store some values. - * * config.set_value("Player1", "player_name", "Steve") - * * config.set_value("Player1", "best_score", 10) - * * config.set_value("Player2", "player_name", "V3geta") - * * config.set_value("Player2", "best_score", 9001) * - * - * * # Save it to a file (overwrite if already exists). - * * config.save("user://scores.cfg") - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * // Create new ConfigFile object. - * * var config = new ConfigFile(); * - * - * * // Store some values. - * * config.SetValue("Player1", "player_name", "Steve"); - * * config.SetValue("Player1", "best_score", 10); - * * config.SetValue("Player2", "player_name", "V3geta"); - * * config.SetValue("Player2", "best_score", 9001); * - * - * * // Save it to a file (overwrite if already exists). - * * config.Save("user://scores.cfg"); - * - * [/csharp] - * - * [/codeblocks] + * ``` * * This example shows how the above file could be loaded: * - * [codeblocks] - * - * [gdscript] - * + * gdscript: + * ```gdscript * var score_data = {} - * * var config = ConfigFile.new() * - * - * * # Load data from a file. - * * var err = config.load("user://scores.cfg") * - * - * * # If the file didn't load, ignore it. - * * if err != OK: - * * return * - * - * * # Iterate over all sections. - * * for player in config.get_sections(): - * * # Fetch the data for each section. - * * var player_name = config.get_value(player, "player_name") - * * var player_score = config.get_value(player, "best_score") - * * score_data[player_name] = player_score - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * var score_data = new Godot.Collections.Dictionary(); - * * var config = new ConfigFile(); * - * - * * // Load data from a file. - * * Error err = config.Load("user://scores.cfg"); * - * - * * // If the file didn't load, ignore it. - * * if (err != Error.Ok) - * * { - * * return; - * * } * - * - * * // Iterate over all sections. - * * foreach (String player in config.GetSections()) - * * { - * * // Fetch the data for each section. - * * var player_name = (String)config.GetValue(player, "player_name"); - * * var player_score = (int)config.GetValue(player, "best_score"); - * * score_data[player_name] = player_score; - * * } + * ``` * - * [/csharp] - * - * [/codeblocks] - * - * Any operation that mutates the ConfigFile such as [setValue], [clear], or [eraseSection], only changes what is loaded in memory. If you want to write the change to a file, you have to save the changes with [save], [saveEncrypted], or [saveEncryptedPass]. - * - * Keep in mind that section and property names can't contain spaces. Anything after a space will be ignored on save and on load. - * - * ConfigFiles can also contain manually written comment lines starting with a semicolon (`;`). Those lines will be ignored when parsing the file. Note that comments will be lost when saving the ConfigFile. This can still be useful for dedicated server configuration files, which are typically never overwritten without explicit user action. - * - * **Note:** The file extension given to a ConfigFile does not have any impact on its formatting or behavior. By convention, the `.cfg` extension is used here, but any other extension such as `.ini` is also valid. Since neither `.cfg` nor `.ini` are standardized, Godot's ConfigFile formatting may differ from files written by other programs. + * Any operation that mutates the ConfigFile such as [setValue], [clear], or [eraseSection], only + * changes what is loaded in memory. If you want to write the change to a file, you have to save the + * changes with [save], [saveEncrypted], or [saveEncryptedPass]. + * Keep in mind that section and property names can't contain spaces. Anything after a space will be + * ignored on save and on load. + * ConfigFiles can also contain manually written comment lines starting with a semicolon (`;`). + * Those lines will be ignored when parsing the file. Note that comments will be lost when saving the + * ConfigFile. This can still be useful for dedicated server configuration files, which are typically + * never overwritten without explicit user action. + * **Note:** The file extension given to a ConfigFile does not have any impact on its formatting or + * behavior. By convention, the `.cfg` extension is used here, but any other extension such as `.ini` + * is also valid. Since neither `.cfg` nor `.ini` are standardized, Godot's ConfigFile formatting may + * differ from files written by other programs. */ @GodotBaseType public open class ConfigFile : RefCounted() { @@ -203,7 +138,9 @@ public open class ConfigFile : RefCounted() { } /** - * Assigns a value to the specified key of the specified section. If either the section or the key do not exist, they are created. Passing a `null` value deletes the specified key if it exists, and deletes the section if it ends up empty once the key has been removed. + * Assigns a value to the specified key of the specified section. If either the section or the key + * do not exist, they are created. Passing a `null` value deletes the specified key if it exists, and + * deletes the section if it ends up empty once the key has been removed. */ public fun setValue( section: String, @@ -215,7 +152,9 @@ public open class ConfigFile : RefCounted() { } /** - * Returns the current value for the specified section and key. If either the section or the key do not exist, the method returns the fallback [default] value. If [default] is not specified or set to `null`, an error is also raised. + * Returns the current value for the specified section and key. If either the section or the key + * do not exist, the method returns the fallback [param default] value. If [param default] is not + * specified or set to `null`, an error is also raised. */ @JvmOverloads public fun getValue( @@ -256,7 +195,8 @@ public open class ConfigFile : RefCounted() { } /** - * Returns an array of all defined key identifiers in the specified section. Raises an error and returns an empty array if the section does not exist. + * Returns an array of all defined key identifiers in the specified section. Raises an error and + * returns an empty array if the section does not exist. */ public fun getSectionKeys(section: String): PackedStringArray { TransferContext.writeArguments(STRING to section) @@ -265,7 +205,8 @@ public open class ConfigFile : RefCounted() { } /** - * Deletes the specified section along with all the key-value pairs inside. Raises an error if the section does not exist. + * Deletes the specified section along with all the key-value pairs inside. Raises an error if the + * section does not exist. */ public fun eraseSection(section: String): Unit { TransferContext.writeArguments(STRING to section) @@ -273,7 +214,8 @@ public open class ConfigFile : RefCounted() { } /** - * Deletes the specified key in a section. Raises an error if either the section or the key do not exist. + * Deletes the specified key in a section. Raises an error if either the section or the key do not + * exist. */ public fun eraseSectionKey(section: String, key: String): Unit { TransferContext.writeArguments(STRING to section, STRING to key) @@ -281,9 +223,10 @@ public open class ConfigFile : RefCounted() { } /** - * Loads the config file specified as a parameter. The file's contents are parsed and loaded in the [godot.ConfigFile] object which the method was called on. - * - * Returns [OK] on success, or one of the other [enum Error] values if the operation failed. + * Loads the config file specified as a parameter. The file's contents are parsed and loaded in + * the [ConfigFile] object which the method was called on. + * Returns [constant OK] on success, or one of the other [enum Error] values if the operation + * failed. */ public fun load(path: String): GodotError { TransferContext.writeArguments(STRING to path) @@ -292,9 +235,10 @@ public open class ConfigFile : RefCounted() { } /** - * Parses the passed string as the contents of a config file. The string is parsed and loaded in the ConfigFile object which the method was called on. - * - * Returns [OK] on success, or one of the other [enum Error] values if the operation failed. + * Parses the passed string as the contents of a config file. The string is parsed and loaded in + * the ConfigFile object which the method was called on. + * Returns [constant OK] on success, or one of the other [enum Error] values if the operation + * failed. */ public fun parse(`data`: String): GodotError { TransferContext.writeArguments(STRING to data) @@ -303,9 +247,10 @@ public open class ConfigFile : RefCounted() { } /** - * Saves the contents of the [godot.ConfigFile] object to the file specified as a parameter. The output file uses an INI-style structure. - * - * Returns [OK] on success, or one of the other [enum Error] values if the operation failed. + * Saves the contents of the [ConfigFile] object to the file specified as a parameter. The output + * file uses an INI-style structure. + * Returns [constant OK] on success, or one of the other [enum Error] values if the operation + * failed. */ public fun save(path: String): GodotError { TransferContext.writeArguments(STRING to path) @@ -323,9 +268,11 @@ public open class ConfigFile : RefCounted() { } /** - * Loads the encrypted config file specified as a parameter, using the provided [key] to decrypt it. The file's contents are parsed and loaded in the [godot.ConfigFile] object which the method was called on. - * - * Returns [OK] on success, or one of the other [enum Error] values if the operation failed. + * Loads the encrypted config file specified as a parameter, using the provided [param key] to + * decrypt it. The file's contents are parsed and loaded in the [ConfigFile] object which the method + * was called on. + * Returns [constant OK] on success, or one of the other [enum Error] values if the operation + * failed. */ public fun loadEncrypted(path: String, key: PackedByteArray): GodotError { TransferContext.writeArguments(STRING to path, PACKED_BYTE_ARRAY to key) @@ -334,9 +281,11 @@ public open class ConfigFile : RefCounted() { } /** - * Loads the encrypted config file specified as a parameter, using the provided [password] to decrypt it. The file's contents are parsed and loaded in the [godot.ConfigFile] object which the method was called on. - * - * Returns [OK] on success, or one of the other [enum Error] values if the operation failed. + * Loads the encrypted config file specified as a parameter, using the provided [param password] + * to decrypt it. The file's contents are parsed and loaded in the [ConfigFile] object which the + * method was called on. + * Returns [constant OK] on success, or one of the other [enum Error] values if the operation + * failed. */ public fun loadEncryptedPass(path: String, password: String): GodotError { TransferContext.writeArguments(STRING to path, STRING to password) @@ -345,9 +294,11 @@ public open class ConfigFile : RefCounted() { } /** - * Saves the contents of the [godot.ConfigFile] object to the AES-256 encrypted file specified as a parameter, using the provided [key] to encrypt it. The output file uses an INI-style structure. - * - * Returns [OK] on success, or one of the other [enum Error] values if the operation failed. + * Saves the contents of the [ConfigFile] object to the AES-256 encrypted file specified as a + * parameter, using the provided [param key] to encrypt it. The output file uses an INI-style + * structure. + * Returns [constant OK] on success, or one of the other [enum Error] values if the operation + * failed. */ public fun saveEncrypted(path: String, key: PackedByteArray): GodotError { TransferContext.writeArguments(STRING to path, PACKED_BYTE_ARRAY to key) @@ -356,9 +307,11 @@ public open class ConfigFile : RefCounted() { } /** - * Saves the contents of the [godot.ConfigFile] object to the AES-256 encrypted file specified as a parameter, using the provided [password] to encrypt it. The output file uses an INI-style structure. - * - * Returns [OK] on success, or one of the other [enum Error] values if the operation failed. + * Saves the contents of the [ConfigFile] object to the AES-256 encrypted file specified as a + * parameter, using the provided [param password] to encrypt it. The output file uses an INI-style + * structure. + * Returns [constant OK] on success, or one of the other [enum Error] values if the operation + * failed. */ public fun saveEncryptedPass(path: String, password: String): GodotError { TransferContext.writeArguments(STRING to path, STRING to password) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ConfirmationDialog.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ConfirmationDialog.kt index 118dc7d06..5a0f8818c 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ConfirmationDialog.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ConfirmationDialog.kt @@ -19,27 +19,19 @@ import kotlin.String import kotlin.Suppress /** - * A dialog used for confirmation of actions. - * - * A dialog used for confirmation of actions. This window is similar to [godot.AcceptDialog], but pressing its Cancel button can have a different outcome from pressing the OK button. The order of the two buttons varies depending on the host OS. - * + * A dialog used for confirmation of actions. This window is similar to [AcceptDialog], but pressing + * its Cancel button can have a different outcome from pressing the OK button. The order of the two + * buttons varies depending on the host OS. * To get cancel action, you can use: * - * [codeblocks] - * - * [gdscript] - * + * gdscript: + * ```gdscript * get_cancel_button().pressed.connect(self.canceled) - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * GetCancelButton().Pressed += Canceled; - * - * [/csharp] - * - * [/codeblocks] + * ``` */ @GodotBaseType public open class ConfirmationDialog : AcceptDialog() { @@ -64,8 +56,8 @@ public open class ConfirmationDialog : AcceptDialog() { /** * Returns the cancel button. - * - * **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [godot.CanvasItem.visible] property. + * **Warning:** This is a required internal node, removing and freeing it may cause a crash. If + * you wish to hide it or any of its children, use their [CanvasItem.visible] property. */ public fun getCancelButton(): Button? { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Container.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Container.kt index 6ab90e6a3..0f88749df 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Container.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Container.kt @@ -25,12 +25,8 @@ import kotlin.Suppress import kotlin.Unit /** - * Base class for all GUI containers. - * - * Tutorials: - * [$DOCS_URL/tutorials/ui/gui_containers.html]($DOCS_URL/tutorials/ui/gui_containers.html) - * - * Base class for all GUI containers. A [godot.Container] automatically arranges its child controls in a certain way. This class can be inherited to make custom container types. + * Base class for all GUI containers. A [Container] automatically arranges its child controls in a + * certain way. This class can be inherited to make custom container types. */ @GodotBaseType public open class Container : Control() { @@ -50,25 +46,30 @@ public open class Container : Control() { } /** - * Implement to return a list of allowed horizontal [enum Control.SizeFlags] for child nodes. This doesn't technically prevent the usages of any other size flags, if your implementation requires that. This only limits the options available to the user in the Inspector dock. - * - * **Note:** Having no size flags is equal to having [godot.Control.SIZE_SHRINK_BEGIN]. As such, this value is always implicitly allowed. + * Implement to return a list of allowed horizontal [enum Control.SizeFlags] for child nodes. This + * doesn't technically prevent the usages of any other size flags, if your implementation requires + * that. This only limits the options available to the user in the Inspector dock. + * **Note:** Having no size flags is equal to having [constant Control.SIZE_SHRINK_BEGIN]. As + * such, this value is always implicitly allowed. */ public open fun _getAllowedSizeFlagsHorizontal(): PackedInt32Array { throw NotImplementedError("_get_allowed_size_flags_horizontal is not implemented for Container") } /** - * Implement to return a list of allowed vertical [enum Control.SizeFlags] for child nodes. This doesn't technically prevent the usages of any other size flags, if your implementation requires that. This only limits the options available to the user in the Inspector dock. - * - * **Note:** Having no size flags is equal to having [godot.Control.SIZE_SHRINK_BEGIN]. As such, this value is always implicitly allowed. + * Implement to return a list of allowed vertical [enum Control.SizeFlags] for child nodes. This + * doesn't technically prevent the usages of any other size flags, if your implementation requires + * that. This only limits the options available to the user in the Inspector dock. + * **Note:** Having no size flags is equal to having [constant Control.SIZE_SHRINK_BEGIN]. As + * such, this value is always implicitly allowed. */ public open fun _getAllowedSizeFlagsVertical(): PackedInt32Array { throw NotImplementedError("_get_allowed_size_flags_vertical is not implemented for Container") } /** - * Queue resort of the contained children. This is called automatically anyway, but can be called upon request. + * Queue resort of the contained children. This is called automatically anyway, but can be called + * upon request. */ public fun queueSort(): Unit { TransferContext.writeArguments() @@ -76,7 +77,8 @@ public open class Container : Control() { } /** - * Fit a child control in a given rect. This is mainly a helper for creating custom container classes. + * Fit a child control in a given rect. This is mainly a helper for creating custom container + * classes. */ public fun fitChildInRect(child: Control, rect: Rect2): Unit { TransferContext.writeArguments(OBJECT to child, RECT2 to rect) @@ -85,7 +87,8 @@ public open class Container : Control() { public companion object { /** - * Notification just before children are going to be sorted, in case there's something to process beforehand. + * Notification just before children are going to be sorted, in case there's something to + * process beforehand. */ public final const val NOTIFICATION_PRE_SORT_CHILDREN: Long = 50 diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ConvexPolygonShape2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ConvexPolygonShape2D.kt index b2ecc72c2..e74ba4a1e 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ConvexPolygonShape2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ConvexPolygonShape2D.kt @@ -19,22 +19,29 @@ import kotlin.Suppress import kotlin.Unit /** - * A 2D convex polygon shape used for physics collision. - * - * A 2D convex polygon shape, intended for use in physics. Used internally in [godot.CollisionPolygon2D] when it's in [godot.CollisionPolygon2D.BUILD_SOLIDS] mode. - * - * [godot.ConvexPolygonShape2D] is *solid*, which means it detects collisions from objects that are fully inside it, unlike [godot.ConcavePolygonShape2D] which is hollow. This makes it more suitable for both detection and physics. - * - * **Convex decomposition:** A concave polygon can be split up into several convex polygons. This allows dynamic physics bodies to have complex concave collisions (at a performance cost) and can be achieved by using several [godot.ConvexPolygonShape2D] nodes or by using the [godot.CollisionPolygon2D] node in [godot.CollisionPolygon2D.BUILD_SOLIDS] mode. To generate a collision polygon from a sprite, select the [godot.Sprite2D] node, go to the **Sprite2D** menu that appears above the viewport, and choose **Create Polygon2D Sibling**. - * - * **Performance:** [godot.ConvexPolygonShape2D] is faster to check collisions against compared to [godot.ConcavePolygonShape2D], but it is slower than primitive collision shapes such as [godot.CircleShape2D] and [godot.RectangleShape2D]. Its use should generally be limited to medium-sized objects that cannot have their collision accurately represented by primitive shapes. + * A 2D convex polygon shape, intended for use in physics. Used internally in [CollisionPolygon2D] + * when it's in [constant CollisionPolygon2D.BUILD_SOLIDS] mode. + * [ConvexPolygonShape2D] is *solid*, which means it detects collisions from objects that are fully + * inside it, unlike [ConcavePolygonShape2D] which is hollow. This makes it more suitable for both + * detection and physics. + * **Convex decomposition:** A concave polygon can be split up into several convex polygons. This + * allows dynamic physics bodies to have complex concave collisions (at a performance cost) and can be + * achieved by using several [ConvexPolygonShape2D] nodes or by using the [CollisionPolygon2D] node in + * [constant CollisionPolygon2D.BUILD_SOLIDS] mode. To generate a collision polygon from a sprite, + * select the [Sprite2D] node, go to the **Sprite2D** menu that appears above the viewport, and choose + * **Create Polygon2D Sibling**. + * **Performance:** [ConvexPolygonShape2D] is faster to check collisions against compared to + * [ConcavePolygonShape2D], but it is slower than primitive collision shapes such as [CircleShape2D] + * and [RectangleShape2D]. Its use should generally be limited to medium-sized objects that cannot have + * their collision accurately represented by primitive shapes. */ @GodotBaseType public open class ConvexPolygonShape2D : Shape2D() { /** - * The polygon's list of vertices that form a convex hull. Can be in either clockwise or counterclockwise order. - * - * **Warning:** Only set this property to a list of points that actually form a convex hull. Use [setPointCloud] to generate the convex hull of an arbitrary set of points. + * The polygon's list of vertices that form a convex hull. Can be in either clockwise or + * counterclockwise order. + * **Warning:** Only set this property to a list of points that actually form a convex hull. Use + * [setPointCloud] to generate the convex hull of an arbitrary set of points. */ public var points: PackedVector2Array get() { @@ -53,7 +60,8 @@ public open class ConvexPolygonShape2D : Shape2D() { } /** - * Based on the set of points provided, this assigns the [points] property using the convex hull algorithm, removing all unneeded points. See [godot.Geometry2D.convexHull] for details. + * Based on the set of points provided, this assigns the [points] property using the convex hull + * algorithm, removing all unneeded points. See [Geometry2D.convexHull] for details. */ public fun setPointCloud(pointCloud: PackedVector2Array): Unit { TransferContext.writeArguments(PACKED_VECTOR2_ARRAY to pointCloud) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ConvexPolygonShape3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ConvexPolygonShape3D.kt index 2c5d7665a..3ce5725c7 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ConvexPolygonShape3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ConvexPolygonShape3D.kt @@ -18,18 +18,22 @@ import kotlin.Int import kotlin.Suppress /** - * A 3D convex polyhedron shape used for physics collision. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/675](https://godotengine.org/asset-library/asset/675) - * - * A 3D convex polyhedron shape, intended for use in physics. Usually used to provide a shape for a [godot.CollisionShape3D]. - * - * [godot.ConvexPolygonShape3D] is *solid*, which means it detects collisions from objects that are fully inside it, unlike [godot.ConcavePolygonShape3D] which is hollow. This makes it more suitable for both detection and physics. - * - * **Convex decomposition:** A concave polyhedron can be split up into several convex polyhedra. This allows dynamic physics bodies to have complex concave collisions (at a performance cost) and can be achieved by using several [godot.ConvexPolygonShape3D] nodes. To generate a convex decomposition from a mesh, select the [godot.MeshInstance3D] node, go to the **Mesh** menu that appears above the viewport, and choose **Create Multiple Convex Collision Siblings**. Alternatively, [godot.MeshInstance3D.createMultipleConvexCollisions] can be called in a script to perform this decomposition at run-time. - * - * **Performance:** [godot.ConvexPolygonShape3D] is faster to check collisions against compared to [godot.ConcavePolygonShape3D], but it is slower than primitive collision shapes such as [godot.SphereShape3D] and [godot.BoxShape3D]. Its use should generally be limited to medium-sized objects that cannot have their collision accurately represented by primitive shapes. + * A 3D convex polyhedron shape, intended for use in physics. Usually used to provide a shape for a + * [CollisionShape3D]. + * [ConvexPolygonShape3D] is *solid*, which means it detects collisions from objects that are fully + * inside it, unlike [ConcavePolygonShape3D] which is hollow. This makes it more suitable for both + * detection and physics. + * **Convex decomposition:** A concave polyhedron can be split up into several convex polyhedra. + * This allows dynamic physics bodies to have complex concave collisions (at a performance cost) and + * can be achieved by using several [ConvexPolygonShape3D] nodes. To generate a convex decomposition + * from a mesh, select the [MeshInstance3D] node, go to the **Mesh** menu that appears above the + * viewport, and choose **Create Multiple Convex Collision Siblings**. Alternatively, + * [MeshInstance3D.createMultipleConvexCollisions] can be called in a script to perform this + * decomposition at run-time. + * **Performance:** [ConvexPolygonShape3D] is faster to check collisions against compared to + * [ConcavePolygonShape3D], but it is slower than primitive collision shapes such as [SphereShape3D] + * and [BoxShape3D]. Its use should generally be limited to medium-sized objects that cannot have their + * collision accurately represented by primitive shapes. */ @GodotBaseType public open class ConvexPolygonShape3D : Shape3D() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Corner.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Corner.kt index 74f651859..2772d7e23 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Corner.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Corner.kt @@ -6,9 +6,21 @@ import kotlin.Long public enum class Corner( id: Long, ) { + /** + * Top-left corner. + */ CORNER_TOP_LEFT(0), + /** + * Top-right corner. + */ CORNER_TOP_RIGHT(1), + /** + * Bottom-right corner. + */ CORNER_BOTTOM_RIGHT(2), + /** + * Bottom-left corner. + */ CORNER_BOTTOM_LEFT(3), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Crypto.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Crypto.kt index 0fe96354a..4c600b233 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Crypto.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Crypto.kt @@ -23,139 +23,79 @@ import kotlin.Suppress import kotlin.jvm.JvmOverloads /** - * Provides access to advanced cryptographic functionalities. - * * The Crypto class provides access to advanced cryptographic functionalities. + * Currently, this includes asymmetric key encryption/decryption, signing/verification, and + * generating cryptographically secure random bytes, RSA keys, HMAC digests, and self-signed + * [X509Certificate]s. * - * Currently, this includes asymmetric key encryption/decryption, signing/verification, and generating cryptographically secure random bytes, RSA keys, HMAC digests, and self-signed [godot.X509Certificate]s. - * - * [codeblocks] - * - * [gdscript] - * + * gdscript: + * ```gdscript * extends Node * - * - * * var crypto = Crypto.new() - * * var key = CryptoKey.new() - * * var cert = X509Certificate.new() * - * - * * func _ready(): - * * # Generate new RSA key. - * * key = crypto.generate_rsa(4096) - * * # Generate new self-signed certificate with the given key. - * * cert = crypto.generate_self_signed_certificate(key, "CN=mydomain.com,O=My Game Company,C=IT") - * * # Save key and certificate in the user folder. - * * key.save("user://generated.key") - * * cert.save("user://generated.crt") - * * # Encryption - * * var data = "Some data" - * * var encrypted = crypto.encrypt(key, data.to_utf8_buffer()) - * * # Decryption - * * var decrypted = crypto.decrypt(key, encrypted) - * * # Signing - * * var signature = crypto.sign(HashingContext.HASH_SHA256, data.sha256_buffer(), key) - * * # Verifying - * - * var verified = crypto.verify(HashingContext.HASH_SHA256, data.sha256_buffer(), signature, key) - * + * var verified = crypto.verify(HashingContext.HASH_SHA256, data.sha256_buffer(), signature, + * key) * # Checks - * * assert(verified) - * * assert(data.to_utf8_buffer() == decrypted) - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * using Godot; - * * using System.Diagnostics; * - * - * * public partial class MyNode : Node - * * { - * * private Crypto _crypto = new Crypto(); - * * private CryptoKey _key = new CryptoKey(); - * * private X509Certificate _cert = new X509Certificate(); * - * - * * public override void _Ready() - * * { - * * // Generate new RSA key. - * * _key = _crypto.GenerateRsa(4096); - * * // Generate new self-signed certificate with the given key. - * - * _cert = _crypto.GenerateSelfSignedCertificate(_key, "CN=mydomain.com,O=My Game Company,C=IT"); - * + * _cert = _crypto.GenerateSelfSignedCertificate(_key, "CN=mydomain.com,O=My Game + * Company,C=IT"); * // Save key and certificate in the user folder. - * * _key.Save("user://generated.key"); - * * _cert.Save("user://generated.crt"); - * * // Encryption - * * string data = "Some data"; - * * byte[] encrypted = _crypto.Encrypt(_key, data.ToUtf8Buffer()); - * * // Decryption - * * byte[] decrypted = _crypto.Decrypt(_key, encrypted); - * * // Signing - * - * byte[] signature = _crypto.Sign(HashingContext.HashType.Sha256, Data.Sha256Buffer(), _key); - * + * byte[] signature = _crypto.Sign(HashingContext.HashType.Sha256, Data.Sha256Buffer(), + * _key); * // Verifying - * - * bool verified = _crypto.Verify(HashingContext.HashType.Sha256, Data.Sha256Buffer(), signature, _key); - * + * bool verified = _crypto.Verify(HashingContext.HashType.Sha256, Data.Sha256Buffer(), + * signature, _key); * // Checks - * * Debug.Assert(verified); - * * Debug.Assert(data.ToUtf8Buffer() == decrypted); - * * } - * * } - * - * [/csharp] - * - * [/codeblocks] + * ``` */ @GodotBaseType public open class Crypto : RefCounted() { @@ -165,7 +105,7 @@ public open class Crypto : RefCounted() { } /** - * Generates a [godot.PackedByteArray] of cryptographically secure random bytes with given [size]. + * Generates a [PackedByteArray] of cryptographically secure random bytes with given [param size]. */ public fun generateRandomBytes(size: Int): PackedByteArray { TransferContext.writeArguments(LONG to size.toLong()) @@ -174,7 +114,8 @@ public open class Crypto : RefCounted() { } /** - * Generates an RSA [godot.CryptoKey] that can be used for creating self-signed certificates and passed to [godot.StreamPeerTLS.acceptStream]. + * Generates an RSA [CryptoKey] that can be used for creating self-signed certificates and passed + * to [StreamPeerTLS.acceptStream]. */ public fun generateRsa(size: Int): CryptoKey? { TransferContext.writeArguments(LONG to size.toLong()) @@ -183,41 +124,30 @@ public open class Crypto : RefCounted() { } /** - * Generates a self-signed [godot.X509Certificate] from the given [godot.CryptoKey] and [issuerName]. The certificate validity will be defined by [notBefore] and [notAfter] (first valid date and last valid date). The [issuerName] must contain at least "CN=" (common name, i.e. the domain name), "O=" (organization, i.e. your company name), "C=" (country, i.e. 2 lettered ISO-3166 code of the country the organization is based in). - * + * Generates a self-signed [X509Certificate] from the given [CryptoKey] and [param issuer_name]. + * The certificate validity will be defined by [param not_before] and [param not_after] (first valid + * date and last valid date). The [param issuer_name] must contain at least "CN=" (common name, i.e. + * the domain name), "O=" (organization, i.e. your company name), "C=" (country, i.e. 2 lettered + * ISO-3166 code of the country the organization is based in). * A small example to generate an RSA key and a X509 self-signed certificate. * - * [codeblocks] - * - * [gdscript] - * + * gdscript: + * ```gdscript * var crypto = Crypto.new() - * * # Generate 4096 bits RSA key. - * * var key = crypto.generate_rsa(4096) - * * # Generate self-signed certificate using the given key. - * * var cert = crypto.generate_self_signed_certificate(key, "CN=example.com,O=A Game Company,C=IT") - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * var crypto = new Crypto(); - * * // Generate 4096 bits RSA key. - * * CryptoKey key = crypto.GenerateRsa(4096); - * * // Generate self-signed certificate using the given key. - * - * X509Certificate cert = crypto.GenerateSelfSignedCertificate(key, "CN=mydomain.com,O=My Game Company,C=IT"); - * - * [/csharp] - * - * [/codeblocks] + * X509Certificate cert = crypto.GenerateSelfSignedCertificate(key, "CN=mydomain.com,O=My Game + * Company,C=IT"); + * ``` */ @JvmOverloads public fun generateSelfSignedCertificate( @@ -232,7 +162,7 @@ public open class Crypto : RefCounted() { } /** - * Sign a given [hash] of type [hashType] with the provided private [key]. + * Sign a given [param hash] of type [param hash_type] with the provided private [param key]. */ public fun sign( hashType: HashingContext.HashType, @@ -245,7 +175,8 @@ public open class Crypto : RefCounted() { } /** - * Verify that a given [signature] for [hash] of type [hashType] against the provided public [key]. + * Verify that a given [param signature] for [param hash] of type [param hash_type] against the + * provided public [param key]. */ public fun verify( hashType: HashingContext.HashType, @@ -259,8 +190,7 @@ public open class Crypto : RefCounted() { } /** - * Encrypt the given [plaintext] with the provided public [key]. - * + * Encrypt the given [param plaintext] with the provided public [param key]. * **Note:** The maximum size of accepted plaintext is limited by the key size. */ public fun encrypt(key: CryptoKey, plaintext: PackedByteArray): PackedByteArray { @@ -270,8 +200,7 @@ public open class Crypto : RefCounted() { } /** - * Decrypt the given [ciphertext] with the provided private [key]. - * + * Decrypt the given [param ciphertext] with the provided private [param key]. * **Note:** The maximum size of accepted ciphertext is limited by the key size. */ public fun decrypt(key: CryptoKey, ciphertext: PackedByteArray): PackedByteArray { @@ -281,9 +210,11 @@ public open class Crypto : RefCounted() { } /** - * Generates an [HMAC](https://en.wikipedia.org/wiki/HMAC) digest of [msg] using [key]. The [hashType] parameter is the hashing algorithm that is used for the inner and outer hashes. - * - * Currently, only [godot.HashingContext.HASH_SHA256] and [godot.HashingContext.HASH_SHA1] are supported. + * Generates an [url=https://en.wikipedia.org/wiki/HMAC]HMAC[/url] digest of [param msg] using + * [param key]. The [param hash_type] parameter is the hashing algorithm that is used for the inner + * and outer hashes. + * Currently, only [constant HashingContext.HASH_SHA256] and [constant HashingContext.HASH_SHA1] + * are supported. */ public fun hmacDigest( hashType: HashingContext.HashType, @@ -296,9 +227,11 @@ public open class Crypto : RefCounted() { } /** - * Compares two [godot.PackedByteArray]s for equality without leaking timing information in order to prevent timing attacks. - * - * See [this blog post](https://paragonie.com/blog/2015/11/preventing-timing-attacks-on-string-comparison-with-double-hmac-strategy) for more information. + * Compares two [PackedByteArray]s for equality without leaking timing information in order to + * prevent timing attacks. + * See + * [url=https://paragonie.com/blog/2015/11/preventing-timing-attacks-on-string-comparison-with-double-hmac-strategy]this + * blog post[/url] for more information. */ public fun constantTimeCompare(trusted: PackedByteArray, received: PackedByteArray): Boolean { TransferContext.writeArguments(PACKED_BYTE_ARRAY to trusted, PACKED_BYTE_ARRAY to received) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CryptoKey.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CryptoKey.kt index 65e0767e7..1800ebbcd 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CryptoKey.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CryptoKey.kt @@ -22,14 +22,11 @@ import kotlin.Suppress import kotlin.jvm.JvmOverloads /** - * A cryptographic key (RSA). - * - * Tutorials: - * [$DOCS_URL/tutorials/networking/ssl_certificates.html]($DOCS_URL/tutorials/networking/ssl_certificates.html) - * - * The CryptoKey class represents a cryptographic key. Keys can be loaded and saved like any other [godot.Resource]. - * - * They can be used to generate a self-signed [godot.X509Certificate] via [godot.Crypto.generateSelfSignedCertificate] and as private key in [godot.StreamPeerTLS.acceptStream] along with the appropriate certificate. + * The CryptoKey class represents a cryptographic key. Keys can be loaded and saved like any other + * [Resource]. + * They can be used to generate a self-signed [X509Certificate] via + * [Crypto.generateSelfSignedCertificate] and as private key in [StreamPeerTLS.acceptStream] along with + * the appropriate certificate. */ @GodotBaseType public open class CryptoKey : Resource() { @@ -39,9 +36,10 @@ public open class CryptoKey : Resource() { } /** - * Saves a key to the given [path]. If [publicOnly] is `true`, only the public key will be saved. - * - * **Note:** [path] should be a "*.pub" file if [publicOnly] is `true`, a "*.key" file otherwise. + * Saves a key to the given [param path]. If [param public_only] is `true`, only the public key + * will be saved. + * **Note:** [param path] should be a "*.pub" file if [param public_only] is `true`, a "*.key" + * file otherwise. */ @JvmOverloads public fun save(path: String, publicOnly: Boolean = false): GodotError { @@ -51,9 +49,10 @@ public open class CryptoKey : Resource() { } /** - * Loads a key from [path]. If [publicOnly] is `true`, only the public key will be loaded. - * - * **Note:** [path] should be a "*.pub" file if [publicOnly] is `true`, a "*.key" file otherwise. + * Loads a key from [param path]. If [param public_only] is `true`, only the public key will be + * loaded. + * **Note:** [param path] should be a "*.pub" file if [param public_only] is `true`, a "*.key" + * file otherwise. */ @JvmOverloads public fun load(path: String, publicOnly: Boolean = false): GodotError { @@ -72,7 +71,8 @@ public open class CryptoKey : Resource() { } /** - * Returns a string containing the key in PEM format. If [publicOnly] is `true`, only the public key will be included. + * Returns a string containing the key in PEM format. If [param public_only] is `true`, only the + * public key will be included. */ @JvmOverloads public fun saveToString(publicOnly: Boolean = false): String { @@ -82,7 +82,8 @@ public open class CryptoKey : Resource() { } /** - * Loads a key from the given [stringKey]. If [publicOnly] is `true`, only the public key will be loaded. + * Loads a key from the given [param string_key]. If [param public_only] is `true`, only the + * public key will be loaded. */ @JvmOverloads public fun loadFromString(stringKey: String, publicOnly: Boolean = false): GodotError { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Cubemap.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Cubemap.kt index 390a19700..65cb5789e 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Cubemap.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Cubemap.kt @@ -16,15 +16,17 @@ import kotlin.Int import kotlin.Suppress /** - * Six square textures representing the faces of a cube. Commonly used as a skybox. - * - * A cubemap is made of 6 textures organized in layers. They are typically used for faking reflections in 3D rendering (see [godot.ReflectionProbe]). It can be used to make an object look as if it's reflecting its surroundings. This usually delivers much better performance than other reflection methods. - * - * This resource is typically used as a uniform in custom shaders. Few core Godot methods make use of [godot.Cubemap] resources. - * - * To create such a texture file yourself, reimport your image files using the Godot Editor import presets. - * - * **Note:** Godot doesn't support using cubemaps in a [godot.PanoramaSkyMaterial]. You can use [this tool](https://danilw.github.io/GLSL-howto/cubemap_to_panorama_js/cubemap_to_panorama.html) to convert a cubemap to an equirectangular sky map. + * A cubemap is made of 6 textures organized in layers. They are typically used for faking + * reflections in 3D rendering (see [ReflectionProbe]). It can be used to make an object look as if + * it's reflecting its surroundings. This usually delivers much better performance than other + * reflection methods. + * This resource is typically used as a uniform in custom shaders. Few core Godot methods make use + * of [Cubemap] resources. + * To create such a texture file yourself, reimport your image files using the Godot Editor import + * presets. + * **Note:** Godot doesn't support using cubemaps in a [PanoramaSkyMaterial]. You can use + * [url=https://danilw.github.io/GLSL-howto/cubemap_to_panorama_js/cubemap_to_panorama.html]this + * tool[/url] to convert a cubemap to an equirectangular sky map. */ @GodotBaseType public open class Cubemap : ImageTextureLayered() { @@ -34,7 +36,7 @@ public open class Cubemap : ImageTextureLayered() { } /** - * Creates a placeholder version of this resource ([godot.PlaceholderCubemap]). + * Creates a placeholder version of this resource ([PlaceholderCubemap]). */ public fun createPlaceholder(): Resource? { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CubemapArray.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CubemapArray.kt index 21866bb6b..5aa0bce78 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CubemapArray.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CubemapArray.kt @@ -16,17 +16,18 @@ import kotlin.Int import kotlin.Suppress /** - * An array of [godot.Cubemap]s, stored together and with a single reference. - * - * [godot.CubemapArray]s are made of an array of [godot.Cubemap]s. Like [godot.Cubemap]s, they are made of multiple textures, the amount of which must be divisible by 6 (one for each face of the cube). The primary benefit of [godot.CubemapArray]s is that they can be accessed in shader code using a single texture reference. In other words, you can pass multiple [godot.Cubemap]s into a shader using a single [godot.CubemapArray]. - * - * Moreover, [godot.Cubemap]s are allocated in adjacent cache regions on the GPU. This makes [godot.CubemapArray]s the most efficient way to store multiple [godot.Cubemap]s. - * - * Internally, Godot uses [godot.CubemapArray]s for many effects, including the [godot.Sky] if you set [godot.ProjectSettings.rendering/reflections/skyReflections/textureArrayReflections] to `true`. - * - * To create such a texture file yourself, reimport your image files using the import presets of the File System dock. - * - * **Note:** [godot.CubemapArray] is not supported in the OpenGL 3 rendering backend. + * [CubemapArray]s are made of an array of [Cubemap]s. Like [Cubemap]s, they are made of multiple + * textures, the amount of which must be divisible by 6 (one for each face of the cube). The primary + * benefit of [CubemapArray]s is that they can be accessed in shader code using a single texture + * reference. In other words, you can pass multiple [Cubemap]s into a shader using a single + * [CubemapArray]. + * Moreover, [Cubemap]s are allocated in adjacent cache regions on the GPU. This makes + * [CubemapArray]s the most efficient way to store multiple [Cubemap]s. + * Internally, Godot uses [CubemapArray]s for many effects, including the [Sky] if you set + * [ProjectSettings.rendering/reflections/skyReflections/textureArrayReflections] to `true`. + * To create such a texture file yourself, reimport your image files using the import presets of the + * File System dock. + * **Note:** [CubemapArray] is not supported in the OpenGL 3 rendering backend. */ @GodotBaseType public open class CubemapArray : ImageTextureLayered() { @@ -36,7 +37,7 @@ public open class CubemapArray : ImageTextureLayered() { } /** - * Creates a placeholder version of this resource ([godot.PlaceholderCubemapArray]). + * Creates a placeholder version of this resource ([PlaceholderCubemapArray]). */ public fun createPlaceholder(): Resource? { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Curve.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Curve.kt index b8f148183..ec3d3dba9 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Curve.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Curve.kt @@ -27,11 +27,10 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * A mathematical curve. - * - * This resource describes a mathematical curve by defining a set of points and tangents at each point. By default, it ranges between `0` and `1` on the Y axis and positions points relative to the `0.5` Y position. - * - * See also [godot.Gradient] which is designed for color interpolation. See also [godot.Curve2D] and [godot.Curve3D]. + * This resource describes a mathematical curve by defining a set of points and tangents at each + * point. By default, it ranges between `0` and `1` on the Y axis and positions points relative to the + * `0.5` Y position. + * See also [Gradient] which is designed for color interpolation. See also [Curve2D] and [Curve3D]. */ @GodotBaseType public open class Curve : Resource() { @@ -102,7 +101,9 @@ public open class Curve : Resource() { } /** - * Adds a point to the curve. For each side, if the `*_mode` is [TANGENT_LINEAR], the `*_tangent` angle (in degrees) uses the slope of the curve halfway to the adjacent point. Allows custom assignments to the `*_tangent` angle if `*_mode` is set to [TANGENT_FREE]. + * Adds a point to the curve. For each side, if the `*_mode` is [constant TANGENT_LINEAR], the + * `*_tangent` angle (in degrees) uses the slope of the curve halfway to the adjacent point. Allows + * custom assignments to the `*_tangent` angle if `*_mode` is set to [constant TANGENT_FREE]. */ @JvmOverloads public fun addPoint( @@ -118,7 +119,7 @@ public open class Curve : Resource() { } /** - * Removes the point at [index] from the curve. + * Removes the point at [param index] from the curve. */ public fun removePoint(index: Int): Unit { TransferContext.writeArguments(LONG to index.toLong()) @@ -134,7 +135,7 @@ public open class Curve : Resource() { } /** - * Returns the curve coordinates for the point at [index]. + * Returns the curve coordinates for the point at [param index]. */ public fun getPointPosition(index: Int): Vector2 { TransferContext.writeArguments(LONG to index.toLong()) @@ -143,7 +144,7 @@ public open class Curve : Resource() { } /** - * Assigns the vertical position [y] to the point at [index]. + * Assigns the vertical position [param y] to the point at [param index]. */ public fun setPointValue(index: Int, y: Float): Unit { TransferContext.writeArguments(LONG to index.toLong(), DOUBLE to y.toDouble()) @@ -160,7 +161,8 @@ public open class Curve : Resource() { } /** - * Returns the Y value for the point that would exist at the X position [offset] along the curve. + * Returns the Y value for the point that would exist at the X position [param offset] along the + * curve. */ public fun sample(offset: Float): Float { TransferContext.writeArguments(DOUBLE to offset.toDouble()) @@ -169,7 +171,8 @@ public open class Curve : Resource() { } /** - * Returns the Y value for the point that would exist at the X position [offset] along the curve using the baked cache. Bakes the curve's points if not already baked. + * Returns the Y value for the point that would exist at the X position [param offset] along the + * curve using the baked cache. Bakes the curve's points if not already baked. */ public fun sampleBaked(offset: Float): Float { TransferContext.writeArguments(DOUBLE to offset.toDouble()) @@ -178,7 +181,7 @@ public open class Curve : Resource() { } /** - * Returns the left tangent angle (in degrees) for the point at [index]. + * Returns the left tangent angle (in degrees) for the point at [param index]. */ public fun getPointLeftTangent(index: Int): Float { TransferContext.writeArguments(LONG to index.toLong()) @@ -187,7 +190,7 @@ public open class Curve : Resource() { } /** - * Returns the right tangent angle (in degrees) for the point at [index]. + * Returns the right tangent angle (in degrees) for the point at [param index]. */ public fun getPointRightTangent(index: Int): Float { TransferContext.writeArguments(LONG to index.toLong()) @@ -196,7 +199,7 @@ public open class Curve : Resource() { } /** - * Returns the left [enum TangentMode] for the point at [index]. + * Returns the left [enum TangentMode] for the point at [param index]. */ public fun getPointLeftMode(index: Int): TangentMode { TransferContext.writeArguments(LONG to index.toLong()) @@ -205,7 +208,7 @@ public open class Curve : Resource() { } /** - * Returns the right [enum TangentMode] for the point at [index]. + * Returns the right [enum TangentMode] for the point at [param index]. */ public fun getPointRightMode(index: Int): TangentMode { TransferContext.writeArguments(LONG to index.toLong()) @@ -214,7 +217,7 @@ public open class Curve : Resource() { } /** - * Sets the left tangent angle for the point at [index] to [tangent]. + * Sets the left tangent angle for the point at [param index] to [param tangent]. */ public fun setPointLeftTangent(index: Int, tangent: Float): Unit { TransferContext.writeArguments(LONG to index.toLong(), DOUBLE to tangent.toDouble()) @@ -222,7 +225,7 @@ public open class Curve : Resource() { } /** - * Sets the right tangent angle for the point at [index] to [tangent]. + * Sets the right tangent angle for the point at [param index] to [param tangent]. */ public fun setPointRightTangent(index: Int, tangent: Float): Unit { TransferContext.writeArguments(LONG to index.toLong(), DOUBLE to tangent.toDouble()) @@ -230,7 +233,7 @@ public open class Curve : Resource() { } /** - * Sets the left [enum TangentMode] for the point at [index] to [mode]. + * Sets the left [enum TangentMode] for the point at [param index] to [param mode]. */ public fun setPointLeftMode(index: Int, mode: TangentMode): Unit { TransferContext.writeArguments(LONG to index.toLong(), LONG to mode.id) @@ -238,7 +241,7 @@ public open class Curve : Resource() { } /** - * Sets the right [enum TangentMode] for the point at [index] to [mode]. + * Sets the right [enum TangentMode] for the point at [param index] to [param mode]. */ public fun setPointRightMode(index: Int, mode: TangentMode): Unit { TransferContext.writeArguments(LONG to index.toLong(), LONG to mode.id) @@ -246,7 +249,8 @@ public open class Curve : Resource() { } /** - * Removes duplicate points, i.e. points that are less than 0.00001 units (engine epsilon value) away from their neighbor on the curve. + * Removes duplicate points, i.e. points that are less than 0.00001 units (engine epsilon value) + * away from their neighbor on the curve. */ public fun cleanDupes(): Unit { TransferContext.writeArguments() @@ -269,7 +273,8 @@ public open class Curve : Resource() { */ TANGENT_FREE(0), /** - * The curve calculates the tangent on this side of the point as the slope halfway towards the adjacent point. + * The curve calculates the tangent on this side of the point as the slope halfway towards the + * adjacent point. */ TANGENT_LINEAR(1), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Curve2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Curve2D.kt index cb2ed3635..63e643790 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Curve2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Curve2D.kt @@ -30,16 +30,16 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * Describes a Bézier curve in 2D space. - * - * This class describes a Bézier curve in 2D space. It is mainly used to give a shape to a [godot.Path2D], but can be manually sampled for other purposes. - * + * This class describes a Bézier curve in 2D space. It is mainly used to give a shape to a [Path2D], + * but can be manually sampled for other purposes. * It keeps a cache of precalculated points along the curve, to speed up further calculations. */ @GodotBaseType public open class Curve2D : Resource() { /** - * The distance in pixels between two adjacent cached points. Changing it forces the cache to be recomputed the next time the [getBakedPoints] or [getBakedLength] function is called. The smaller the distance, the more points in the cache and the more memory it will consume, so use with care. + * The distance in pixels between two adjacent cached points. Changing it forces the cache to be + * recomputed the next time the [getBakedPoints] or [getBakedLength] function is called. The smaller + * the distance, the more points in the cache and the more memory it will consume, so use with care. */ public var bakeInterval: Float get() { @@ -72,9 +72,12 @@ public open class Curve2D : Resource() { } /** - * Adds a point with the specified [position] relative to the curve's own position, with control points [in] and [out]. Appends the new point at the end of the point list. - * - * If [index] is given, the new point is inserted before the existing point identified by index [index]. Every existing point starting from [index] is shifted further down the list of points. The index must be greater than or equal to `0` and must not exceed the number of existing points in the line. See [pointCount]. + * Adds a point with the specified [param position] relative to the curve's own position, with + * control points [param in] and [param out]. Appends the new point at the end of the point list. + * If [param index] is given, the new point is inserted before the existing point identified by + * index [param index]. Every existing point starting from [param index] is shifted further down the + * list of points. The index must be greater than or equal to `0` and must not exceed the number of + * existing points in the line. See [pointCount]. */ @JvmOverloads public fun addPoint( @@ -88,7 +91,8 @@ public open class Curve2D : Resource() { } /** - * Sets the position for the vertex [idx]. If the index is out of bounds, the function sends an error to the console. + * Sets the position for the vertex [param idx]. If the index is out of bounds, the function sends + * an error to the console. */ public fun setPointPosition(idx: Int, position: Vector2): Unit { TransferContext.writeArguments(LONG to idx.toLong(), VECTOR2 to position) @@ -96,7 +100,8 @@ public open class Curve2D : Resource() { } /** - * Returns the position of the vertex [idx]. If the index is out of bounds, the function sends an error to the console, and returns `(0, 0)`. + * Returns the position of the vertex [param idx]. If the index is out of bounds, the function + * sends an error to the console, and returns `(0, 0)`. */ public fun getPointPosition(idx: Int): Vector2 { TransferContext.writeArguments(LONG to idx.toLong()) @@ -105,7 +110,8 @@ public open class Curve2D : Resource() { } /** - * Sets the position of the control point leading to the vertex [idx]. If the index is out of bounds, the function sends an error to the console. The position is relative to the vertex. + * Sets the position of the control point leading to the vertex [param idx]. If the index is out + * of bounds, the function sends an error to the console. The position is relative to the vertex. */ public fun setPointIn(idx: Int, position: Vector2): Unit { TransferContext.writeArguments(LONG to idx.toLong(), VECTOR2 to position) @@ -113,7 +119,9 @@ public open class Curve2D : Resource() { } /** - * Returns the position of the control point leading to the vertex [idx]. The returned position is relative to the vertex [idx]. If the index is out of bounds, the function sends an error to the console, and returns `(0, 0)`. + * Returns the position of the control point leading to the vertex [param idx]. The returned + * position is relative to the vertex [param idx]. If the index is out of bounds, the function sends + * an error to the console, and returns `(0, 0)`. */ public fun getPointIn(idx: Int): Vector2 { TransferContext.writeArguments(LONG to idx.toLong()) @@ -122,7 +130,8 @@ public open class Curve2D : Resource() { } /** - * Sets the position of the control point leading out of the vertex [idx]. If the index is out of bounds, the function sends an error to the console. The position is relative to the vertex. + * Sets the position of the control point leading out of the vertex [param idx]. If the index is + * out of bounds, the function sends an error to the console. The position is relative to the vertex. */ public fun setPointOut(idx: Int, position: Vector2): Unit { TransferContext.writeArguments(LONG to idx.toLong(), VECTOR2 to position) @@ -130,7 +139,9 @@ public open class Curve2D : Resource() { } /** - * Returns the position of the control point leading out of the vertex [idx]. The returned position is relative to the vertex [idx]. If the index is out of bounds, the function sends an error to the console, and returns `(0, 0)`. + * Returns the position of the control point leading out of the vertex [param idx]. The returned + * position is relative to the vertex [param idx]. If the index is out of bounds, the function sends + * an error to the console, and returns `(0, 0)`. */ public fun getPointOut(idx: Int): Vector2 { TransferContext.writeArguments(LONG to idx.toLong()) @@ -139,7 +150,8 @@ public open class Curve2D : Resource() { } /** - * Deletes the point [idx] from the curve. Sends an error to the console if [idx] is out of bounds. + * Deletes the point [param idx] from the curve. Sends an error to the console if [param idx] is + * out of bounds. */ public fun removePoint(idx: Int): Unit { TransferContext.writeArguments(LONG to idx.toLong()) @@ -155,9 +167,12 @@ public open class Curve2D : Resource() { } /** - * Returns the position between the vertex [idx] and the vertex `idx + 1`, where [t] controls if the point is the first vertex (`t = 0.0`), the last vertex (`t = 1.0`), or in between. Values of [t] outside the range (`0.0 >= t <=1`) give strange, but predictable results. - * - * If [idx] is out of bounds it is truncated to the first or last vertex, and [t] is ignored. If the curve has no points, the function sends an error to the console, and returns `(0, 0)`. + * Returns the position between the vertex [param idx] and the vertex `idx + 1`, where [param t] + * controls if the point is the first vertex (`t = 0.0`), the last vertex (`t = 1.0`), or in between. + * Values of [param t] outside the range (`0.0 >= t <=1`) give strange, but predictable results. + * If [param idx] is out of bounds it is truncated to the first or last vertex, and [param t] is + * ignored. If the curve has no points, the function sends an error to the console, and returns `(0, + * 0)`. */ public fun sample(idx: Int, t: Float): Vector2 { TransferContext.writeArguments(LONG to idx.toLong(), DOUBLE to t.toDouble()) @@ -166,7 +181,8 @@ public open class Curve2D : Resource() { } /** - * Returns the position at the vertex [fofs]. It calls [sample] using the integer part of [fofs] as `idx`, and its fractional part as `t`. + * Returns the position at the vertex [param fofs]. It calls [sample] using the integer part of + * [param fofs] as `idx`, and its fractional part as `t`. */ public fun samplef(fofs: Float): Vector2 { TransferContext.writeArguments(DOUBLE to fofs.toDouble()) @@ -175,7 +191,8 @@ public open class Curve2D : Resource() { } /** - * Returns the total length of the curve, based on the cached points. Given enough density (see [bakeInterval]), it should be approximate enough. + * Returns the total length of the curve, based on the cached points. Given enough density (see + * [bakeInterval]), it should be approximate enough. */ public fun getBakedLength(): Float { TransferContext.writeArguments() @@ -184,11 +201,13 @@ public open class Curve2D : Resource() { } /** - * Returns a point within the curve at position [offset], where [offset] is measured as a pixel distance along the curve. - * - * To do that, it finds the two cached points where the [offset] lies between, then interpolates the values. This interpolation is cubic if [cubic] is set to `true`, or linear if set to `false`. - * - * Cubic interpolation tends to follow the curves better, but linear is faster (and often, precise enough). + * Returns a point within the curve at position [param offset], where [param offset] is measured + * as a pixel distance along the curve. + * To do that, it finds the two cached points where the [param offset] lies between, then + * interpolates the values. This interpolation is cubic if [param cubic] is set to `true`, or linear + * if set to `false`. + * Cubic interpolation tends to follow the curves better, but linear is faster (and often, precise + * enough). */ @JvmOverloads public fun sampleBaked(offset: Float = 0.0f, cubic: Boolean = false): Vector2 { @@ -198,18 +217,20 @@ public open class Curve2D : Resource() { } /** - * Similar to [sampleBaked], but returns [godot.core.Transform2D] that includes a rotation along the curve, with [godot.Transform2D.origin] as the point position, [godot.Transform2D.x] as the sideways vector, and [godot.Transform2D.y] as the forward vector. Returns an empty transform if the length of the curve is `0`. - * - * ``` - * var baked = curve.sample_baked_with_rotation(offset) - * # This will rotate and position the node with the up direction pointing along the curve. - * position = baked.get_origin() - * rotation = baked.get_rotation() - * # Alternatively, not preserving scale. - * transform = baked * Transform2D.FLIP_Y - * # To match the rotation of PathFollow2D, not preserving scale. - * transform = Transform2D(baked.y, baked.x, baked.origin) - * ``` + * Similar to [sampleBaked], but returns [Transform2D] that includes a rotation along the curve, + * with [Transform2D.origin] as the point position, [Transform2D.x] as the sideways vector, and + * [Transform2D.y] as the forward vector. Returns an empty transform if the length of the curve is + * `0`. + * [codeblock] + * var baked = curve.sample_baked_with_rotation(offset) + * # This will rotate and position the node with the up direction pointing along the curve. + * position = baked.get_origin() + * rotation = baked.get_rotation() + * # Alternatively, not preserving scale. + * transform = baked * Transform2D.FLIP_Y + * # To match the rotation of PathFollow2D, not preserving scale. + * transform = Transform2D(baked.y, baked.x, baked.origin) + * [/codeblock] */ @JvmOverloads public fun sampleBakedWithRotation(offset: Float = 0.0f, cubic: Boolean = false): Transform2D { @@ -219,7 +240,7 @@ public open class Curve2D : Resource() { } /** - * Returns the cache of points as a [godot.PackedVector2Array]. + * Returns the cache of points as a [PackedVector2Array]. */ public fun getBakedPoints(): PackedVector2Array { TransferContext.writeArguments() @@ -228,9 +249,8 @@ public open class Curve2D : Resource() { } /** - * Returns the closest point on baked segments (in curve's local space) to [toPoint]. - * - * [toPoint] must be in this curve's local space. + * Returns the closest point on baked segments (in curve's local space) to [param to_point]. + * [param to_point] must be in this curve's local space. */ public fun getClosestPoint(toPoint: Vector2): Vector2 { TransferContext.writeArguments(VECTOR2 to toPoint) @@ -239,9 +259,9 @@ public open class Curve2D : Resource() { } /** - * Returns the closest offset to [toPoint]. This offset is meant to be used in [sampleBaked]. - * - * [toPoint] must be in this curve's local space. + * Returns the closest offset to [param to_point]. This offset is meant to be used in + * [sampleBaked]. + * [param to_point] must be in this curve's local space. */ public fun getClosestOffset(toPoint: Vector2): Float { TransferContext.writeArguments(VECTOR2 to toPoint) @@ -250,13 +270,15 @@ public open class Curve2D : Resource() { } /** - * Returns a list of points along the curve, with a curvature controlled point density. That is, the curvier parts will have more points than the straighter parts. - * - * This approximation makes straight segments between each point, then subdivides those segments until the resulting shape is similar enough. - * - * [maxStages] controls how many subdivisions a curve segment may face before it is considered approximate enough. Each subdivision splits the segment in half, so the default 5 stages may mean up to 32 subdivisions per curve segment. Increase with care! - * - * [toleranceDegrees] controls how many degrees the midpoint of a segment may deviate from the real curve, before the segment has to be subdivided. + * Returns a list of points along the curve, with a curvature controlled point density. That is, + * the curvier parts will have more points than the straighter parts. + * This approximation makes straight segments between each point, then subdivides those segments + * until the resulting shape is similar enough. + * [param max_stages] controls how many subdivisions a curve segment may face before it is + * considered approximate enough. Each subdivision splits the segment in half, so the default 5 + * stages may mean up to 32 subdivisions per curve segment. Increase with care! + * [param tolerance_degrees] controls how many degrees the midpoint of a segment may deviate from + * the real curve, before the segment has to be subdivided. */ @JvmOverloads public fun tessellate(maxStages: Int = 5, toleranceDegrees: Float = 4.0f): PackedVector2Array { @@ -266,9 +288,12 @@ public open class Curve2D : Resource() { } /** - * Returns a list of points along the curve, with almost uniform density. [maxStages] controls how many subdivisions a curve segment may face before it is considered approximate enough. Each subdivision splits the segment in half, so the default 5 stages may mean up to 32 subdivisions per curve segment. Increase with care! - * - * [toleranceLength] controls the maximal distance between two neighboring points, before the segment has to be subdivided. + * Returns a list of points along the curve, with almost uniform density. [param max_stages] + * controls how many subdivisions a curve segment may face before it is considered approximate + * enough. Each subdivision splits the segment in half, so the default 5 stages may mean up to 32 + * subdivisions per curve segment. Increase with care! + * [param tolerance_length] controls the maximal distance between two neighboring points, before + * the segment has to be subdivided. */ @JvmOverloads public fun tessellateEvenLength(maxStages: Int = 5, toleranceLength: Float = 20.0f): diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Curve3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Curve3D.kt index 8b994c757..12c5b2efa 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Curve3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Curve3D.kt @@ -32,16 +32,16 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * Describes a Bézier curve in 3D space. - * - * This class describes a Bézier curve in 3D space. It is mainly used to give a shape to a [godot.Path3D], but can be manually sampled for other purposes. - * + * This class describes a Bézier curve in 3D space. It is mainly used to give a shape to a [Path3D], + * but can be manually sampled for other purposes. * It keeps a cache of precalculated points along the curve, to speed up further calculations. */ @GodotBaseType public open class Curve3D : Resource() { /** - * The distance in meters between two adjacent cached points. Changing it forces the cache to be recomputed the next time the [getBakedPoints] or [getBakedLength] function is called. The smaller the distance, the more points in the cache and the more memory it will consume, so use with care. + * The distance in meters between two adjacent cached points. Changing it forces the cache to be + * recomputed the next time the [getBakedPoints] or [getBakedLength] function is called. The smaller + * the distance, the more points in the cache and the more memory it will consume, so use with care. */ public var bakeInterval: Float get() { @@ -69,7 +69,9 @@ public open class Curve3D : Resource() { } /** - * If `true`, the curve will bake up vectors used for orientation. This is used when [godot.PathFollow3D.rotationMode] is set to [godot.PathFollow3D.ROTATION_ORIENTED]. Changing it forces the cache to be recomputed. + * If `true`, the curve will bake up vectors used for orientation. This is used when + * [PathFollow3D.rotationMode] is set to [constant PathFollow3D.ROTATION_ORIENTED]. Changing it + * forces the cache to be recomputed. */ public var upVectorEnabled: Boolean get() { @@ -88,9 +90,12 @@ public open class Curve3D : Resource() { } /** - * Adds a point with the specified [position] relative to the curve's own position, with control points [in] and [out]. Appends the new point at the end of the point list. - * - * If [index] is given, the new point is inserted before the existing point identified by index [index]. Every existing point starting from [index] is shifted further down the list of points. The index must be greater than or equal to `0` and must not exceed the number of existing points in the line. See [pointCount]. + * Adds a point with the specified [param position] relative to the curve's own position, with + * control points [param in] and [param out]. Appends the new point at the end of the point list. + * If [param index] is given, the new point is inserted before the existing point identified by + * index [param index]. Every existing point starting from [param index] is shifted further down the + * list of points. The index must be greater than or equal to `0` and must not exceed the number of + * existing points in the line. See [pointCount]. */ @JvmOverloads public fun addPoint( @@ -104,7 +109,8 @@ public open class Curve3D : Resource() { } /** - * Sets the position for the vertex [idx]. If the index is out of bounds, the function sends an error to the console. + * Sets the position for the vertex [param idx]. If the index is out of bounds, the function sends + * an error to the console. */ public fun setPointPosition(idx: Int, position: Vector3): Unit { TransferContext.writeArguments(LONG to idx.toLong(), VECTOR3 to position) @@ -112,7 +118,8 @@ public open class Curve3D : Resource() { } /** - * Returns the position of the vertex [idx]. If the index is out of bounds, the function sends an error to the console, and returns `(0, 0, 0)`. + * Returns the position of the vertex [param idx]. If the index is out of bounds, the function + * sends an error to the console, and returns `(0, 0, 0)`. */ public fun getPointPosition(idx: Int): Vector3 { TransferContext.writeArguments(LONG to idx.toLong()) @@ -121,9 +128,11 @@ public open class Curve3D : Resource() { } /** - * Sets the tilt angle in radians for the point [idx]. If the index is out of bounds, the function sends an error to the console. - * - * The tilt controls the rotation along the look-at axis an object traveling the path would have. In the case of a curve controlling a [godot.PathFollow3D], this tilt is an offset over the natural tilt the [godot.PathFollow3D] calculates. + * Sets the tilt angle in radians for the point [param idx]. If the index is out of bounds, the + * function sends an error to the console. + * The tilt controls the rotation along the look-at axis an object traveling the path would have. + * In the case of a curve controlling a [PathFollow3D], this tilt is an offset over the natural tilt + * the [PathFollow3D] calculates. */ public fun setPointTilt(idx: Int, tilt: Float): Unit { TransferContext.writeArguments(LONG to idx.toLong(), DOUBLE to tilt.toDouble()) @@ -131,7 +140,8 @@ public open class Curve3D : Resource() { } /** - * Returns the tilt angle in radians for the point [idx]. If the index is out of bounds, the function sends an error to the console, and returns `0`. + * Returns the tilt angle in radians for the point [param idx]. If the index is out of bounds, the + * function sends an error to the console, and returns `0`. */ public fun getPointTilt(idx: Int): Float { TransferContext.writeArguments(LONG to idx.toLong()) @@ -140,7 +150,8 @@ public open class Curve3D : Resource() { } /** - * Sets the position of the control point leading to the vertex [idx]. If the index is out of bounds, the function sends an error to the console. The position is relative to the vertex. + * Sets the position of the control point leading to the vertex [param idx]. If the index is out + * of bounds, the function sends an error to the console. The position is relative to the vertex. */ public fun setPointIn(idx: Int, position: Vector3): Unit { TransferContext.writeArguments(LONG to idx.toLong(), VECTOR3 to position) @@ -148,7 +159,9 @@ public open class Curve3D : Resource() { } /** - * Returns the position of the control point leading to the vertex [idx]. The returned position is relative to the vertex [idx]. If the index is out of bounds, the function sends an error to the console, and returns `(0, 0, 0)`. + * Returns the position of the control point leading to the vertex [param idx]. The returned + * position is relative to the vertex [param idx]. If the index is out of bounds, the function sends + * an error to the console, and returns `(0, 0, 0)`. */ public fun getPointIn(idx: Int): Vector3 { TransferContext.writeArguments(LONG to idx.toLong()) @@ -157,7 +170,8 @@ public open class Curve3D : Resource() { } /** - * Sets the position of the control point leading out of the vertex [idx]. If the index is out of bounds, the function sends an error to the console. The position is relative to the vertex. + * Sets the position of the control point leading out of the vertex [param idx]. If the index is + * out of bounds, the function sends an error to the console. The position is relative to the vertex. */ public fun setPointOut(idx: Int, position: Vector3): Unit { TransferContext.writeArguments(LONG to idx.toLong(), VECTOR3 to position) @@ -165,7 +179,9 @@ public open class Curve3D : Resource() { } /** - * Returns the position of the control point leading out of the vertex [idx]. The returned position is relative to the vertex [idx]. If the index is out of bounds, the function sends an error to the console, and returns `(0, 0, 0)`. + * Returns the position of the control point leading out of the vertex [param idx]. The returned + * position is relative to the vertex [param idx]. If the index is out of bounds, the function sends + * an error to the console, and returns `(0, 0, 0)`. */ public fun getPointOut(idx: Int): Vector3 { TransferContext.writeArguments(LONG to idx.toLong()) @@ -174,7 +190,8 @@ public open class Curve3D : Resource() { } /** - * Deletes the point [idx] from the curve. Sends an error to the console if [idx] is out of bounds. + * Deletes the point [param idx] from the curve. Sends an error to the console if [param idx] is + * out of bounds. */ public fun removePoint(idx: Int): Unit { TransferContext.writeArguments(LONG to idx.toLong()) @@ -190,9 +207,12 @@ public open class Curve3D : Resource() { } /** - * Returns the position between the vertex [idx] and the vertex `idx + 1`, where [t] controls if the point is the first vertex (`t = 0.0`), the last vertex (`t = 1.0`), or in between. Values of [t] outside the range (`0.0 >= t <=1`) give strange, but predictable results. - * - * If [idx] is out of bounds it is truncated to the first or last vertex, and [t] is ignored. If the curve has no points, the function sends an error to the console, and returns `(0, 0, 0)`. + * Returns the position between the vertex [param idx] and the vertex `idx + 1`, where [param t] + * controls if the point is the first vertex (`t = 0.0`), the last vertex (`t = 1.0`), or in between. + * Values of [param t] outside the range (`0.0 >= t <=1`) give strange, but predictable results. + * If [param idx] is out of bounds it is truncated to the first or last vertex, and [param t] is + * ignored. If the curve has no points, the function sends an error to the console, and returns `(0, + * 0, 0)`. */ public fun sample(idx: Int, t: Float): Vector3 { TransferContext.writeArguments(LONG to idx.toLong(), DOUBLE to t.toDouble()) @@ -201,7 +221,8 @@ public open class Curve3D : Resource() { } /** - * Returns the position at the vertex [fofs]. It calls [sample] using the integer part of [fofs] as `idx`, and its fractional part as `t`. + * Returns the position at the vertex [param fofs]. It calls [sample] using the integer part of + * [param fofs] as `idx`, and its fractional part as `t`. */ public fun samplef(fofs: Float): Vector3 { TransferContext.writeArguments(DOUBLE to fofs.toDouble()) @@ -210,7 +231,8 @@ public open class Curve3D : Resource() { } /** - * Returns the total length of the curve, based on the cached points. Given enough density (see [bakeInterval]), it should be approximate enough. + * Returns the total length of the curve, based on the cached points. Given enough density (see + * [bakeInterval]), it should be approximate enough. */ public fun getBakedLength(): Float { TransferContext.writeArguments() @@ -219,9 +241,12 @@ public open class Curve3D : Resource() { } /** - * Returns a point within the curve at position [offset], where [offset] is measured as a distance in 3D units along the curve. To do that, it finds the two cached points where the [offset] lies between, then interpolates the values. This interpolation is cubic if [cubic] is set to `true`, or linear if set to `false`. - * - * Cubic interpolation tends to follow the curves better, but linear is faster (and often, precise enough). + * Returns a point within the curve at position [param offset], where [param offset] is measured + * as a distance in 3D units along the curve. To do that, it finds the two cached points where the + * [param offset] lies between, then interpolates the values. This interpolation is cubic if [param + * cubic] is set to `true`, or linear if set to `false`. + * Cubic interpolation tends to follow the curves better, but linear is faster (and often, precise + * enough). */ @JvmOverloads public fun sampleBaked(offset: Float = 0.0f, cubic: Boolean = false): Vector3 { @@ -231,7 +256,9 @@ public open class Curve3D : Resource() { } /** - * Returns a [godot.Transform3D] with `origin` as point position, `basis.x` as sideway vector, `basis.y` as up vector, `basis.z` as forward vector. When the curve length is 0, there is no reasonable way to calculate the rotation, all vectors aligned with global space axes. See also [sampleBaked]. + * Returns a [Transform3D] with `origin` as point position, `basis.x` as sideway vector, `basis.y` + * as up vector, `basis.z` as forward vector. When the curve length is 0, there is no reasonable way + * to calculate the rotation, all vectors aligned with global space axes. See also [sampleBaked]. */ @JvmOverloads public fun sampleBakedWithRotation( @@ -245,9 +272,12 @@ public open class Curve3D : Resource() { } /** - * Returns an up vector within the curve at position [offset], where [offset] is measured as a distance in 3D units along the curve. To do that, it finds the two cached up vectors where the [offset] lies between, then interpolates the values. If [applyTilt] is `true`, an interpolated tilt is applied to the interpolated up vector. - * - * If the curve has no up vectors, the function sends an error to the console, and returns `(0, 1, 0)`. + * Returns an up vector within the curve at position [param offset], where [param offset] is + * measured as a distance in 3D units along the curve. To do that, it finds the two cached up vectors + * where the [param offset] lies between, then interpolates the values. If [param apply_tilt] is + * `true`, an interpolated tilt is applied to the interpolated up vector. + * If the curve has no up vectors, the function sends an error to the console, and returns `(0, 1, + * 0)`. */ @JvmOverloads public fun sampleBakedUpVector(offset: Float, applyTilt: Boolean = false): Vector3 { @@ -257,7 +287,7 @@ public open class Curve3D : Resource() { } /** - * Returns the cache of points as a [godot.PackedVector3Array]. + * Returns the cache of points as a [PackedVector3Array]. */ public fun getBakedPoints(): PackedVector3Array { TransferContext.writeArguments() @@ -266,7 +296,7 @@ public open class Curve3D : Resource() { } /** - * Returns the cache of tilts as a [godot.PackedFloat32Array]. + * Returns the cache of tilts as a [PackedFloat32Array]. */ public fun getBakedTilts(): PackedFloat32Array { TransferContext.writeArguments() @@ -275,8 +305,7 @@ public open class Curve3D : Resource() { } /** - * Returns the cache of up vectors as a [godot.PackedVector3Array]. - * + * Returns the cache of up vectors as a [PackedVector3Array]. * If [upVectorEnabled] is `false`, the cache will be empty. */ public fun getBakedUpVectors(): PackedVector3Array { @@ -286,9 +315,8 @@ public open class Curve3D : Resource() { } /** - * Returns the closest point on baked segments (in curve's local space) to [toPoint]. - * - * [toPoint] must be in this curve's local space. + * Returns the closest point on baked segments (in curve's local space) to [param to_point]. + * [param to_point] must be in this curve's local space. */ public fun getClosestPoint(toPoint: Vector3): Vector3 { TransferContext.writeArguments(VECTOR3 to toPoint) @@ -297,9 +325,9 @@ public open class Curve3D : Resource() { } /** - * Returns the closest offset to [toPoint]. This offset is meant to be used in [sampleBaked] or [sampleBakedUpVector]. - * - * [toPoint] must be in this curve's local space. + * Returns the closest offset to [param to_point]. This offset is meant to be used in + * [sampleBaked] or [sampleBakedUpVector]. + * [param to_point] must be in this curve's local space. */ public fun getClosestOffset(toPoint: Vector3): Float { TransferContext.writeArguments(VECTOR3 to toPoint) @@ -308,13 +336,15 @@ public open class Curve3D : Resource() { } /** - * Returns a list of points along the curve, with a curvature controlled point density. That is, the curvier parts will have more points than the straighter parts. - * - * This approximation makes straight segments between each point, then subdivides those segments until the resulting shape is similar enough. - * - * [maxStages] controls how many subdivisions a curve segment may face before it is considered approximate enough. Each subdivision splits the segment in half, so the default 5 stages may mean up to 32 subdivisions per curve segment. Increase with care! - * - * [toleranceDegrees] controls how many degrees the midpoint of a segment may deviate from the real curve, before the segment has to be subdivided. + * Returns a list of points along the curve, with a curvature controlled point density. That is, + * the curvier parts will have more points than the straighter parts. + * This approximation makes straight segments between each point, then subdivides those segments + * until the resulting shape is similar enough. + * [param max_stages] controls how many subdivisions a curve segment may face before it is + * considered approximate enough. Each subdivision splits the segment in half, so the default 5 + * stages may mean up to 32 subdivisions per curve segment. Increase with care! + * [param tolerance_degrees] controls how many degrees the midpoint of a segment may deviate from + * the real curve, before the segment has to be subdivided. */ @JvmOverloads public fun tessellate(maxStages: Int = 5, toleranceDegrees: Float = 4.0f): PackedVector3Array { @@ -324,9 +354,12 @@ public open class Curve3D : Resource() { } /** - * Returns a list of points along the curve, with almost uniform density. [maxStages] controls how many subdivisions a curve segment may face before it is considered approximate enough. Each subdivision splits the segment in half, so the default 5 stages may mean up to 32 subdivisions per curve segment. Increase with care! - * - * [toleranceLength] controls the maximal distance between two neighboring points, before the segment has to be subdivided. + * Returns a list of points along the curve, with almost uniform density. [param max_stages] + * controls how many subdivisions a curve segment may face before it is considered approximate + * enough. Each subdivision splits the segment in half, so the default 5 stages may mean up to 32 + * subdivisions per curve segment. Increase with care! + * [param tolerance_length] controls the maximal distance between two neighboring points, before + * the segment has to be subdivided. */ @JvmOverloads public fun tessellateEvenLength(maxStages: Int = 5, toleranceLength: Float = 0.2f): diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CurveTexture.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CurveTexture.kt index fd5810ba9..e23f38767 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CurveTexture.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CurveTexture.kt @@ -20,16 +20,17 @@ import kotlin.Suppress import kotlin.jvm.JvmName /** - * A 1D texture where pixel brightness corresponds to points on a curve. - * - * A 1D texture where pixel brightness corresponds to points on a [godot.Curve] resource, either in grayscale or in red. This visual representation simplifies the task of saving curves as image files. - * - * If you need to store up to 3 curves within a single texture, use [godot.CurveXYZTexture] instead. See also [godot.GradientTexture1D] and [godot.GradientTexture2D]. + * A 1D texture where pixel brightness corresponds to points on a [Curve] resource, either in + * grayscale or in red. This visual representation simplifies the task of saving curves as image files. + * If you need to store up to 3 curves within a single texture, use [CurveXYZTexture] instead. See + * also [GradientTexture1D] and [GradientTexture2D]. */ @GodotBaseType public open class CurveTexture : Texture2D() { /** - * The width of the texture (in pixels). Higher values make it possible to represent high-frequency data better (such as sudden direction changes), at the cost of increased generation time and memory usage. + * The width of the texture (in pixels). Higher values make it possible to represent + * high-frequency data better (such as sudden direction changes), at the cost of increased generation + * time and memory usage. */ public var width: Int @JvmName("getWidth_prop") @@ -40,7 +41,8 @@ public open class CurveTexture : Texture2D() { } /** - * The format the texture should be generated with. When passing a CurveTexture as an input to a [godot.Shader], this may need to be adjusted. + * The format the texture should be generated with. When passing a CurveTexture as an input to a + * [Shader], this may need to be adjusted. */ public var textureMode: TextureMode get() { @@ -54,7 +56,7 @@ public open class CurveTexture : Texture2D() { } /** - * The [godot.Curve] that is rendered onto the texture. + * The [Curve] that is rendered onto the texture. */ public var curve: Curve? get() { @@ -76,11 +78,13 @@ public open class CurveTexture : Texture2D() { id: Long, ) { /** - * Store the curve equally across the red, green and blue channels. This uses more video memory, but is more compatible with shaders that only read the green and blue values. + * Store the curve equally across the red, green and blue channels. This uses more video memory, + * but is more compatible with shaders that only read the green and blue values. */ TEXTURE_MODE_RGB(0), /** - * Store the curve only in the red channel. This saves video memory, but some custom shaders may not be able to work with this. + * Store the curve only in the red channel. This saves video memory, but some custom shaders may + * not be able to work with this. */ TEXTURE_MODE_RED(1), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CurveXYZTexture.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CurveXYZTexture.kt index 83aec2545..dc5941a49 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CurveXYZTexture.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CurveXYZTexture.kt @@ -19,16 +19,18 @@ import kotlin.Suppress import kotlin.jvm.JvmName /** - * A 1D texture where the red, green, and blue color channels correspond to points on 3 curves. - * - * A 1D texture where the red, green, and blue color channels correspond to points on 3 [godot.Curve] resources. Compared to using separate [godot.CurveTexture]s, this further simplifies the task of saving curves as image files. - * - * If you only need to store one curve within a single texture, use [godot.CurveTexture] instead. See also [godot.GradientTexture1D] and [godot.GradientTexture2D]. + * A 1D texture where the red, green, and blue color channels correspond to points on 3 [Curve] + * resources. Compared to using separate [CurveTexture]s, this further simplifies the task of saving + * curves as image files. + * If you only need to store one curve within a single texture, use [CurveTexture] instead. See also + * [GradientTexture1D] and [GradientTexture2D]. */ @GodotBaseType public open class CurveXYZTexture : Texture2D() { /** - * The width of the texture (in pixels). Higher values make it possible to represent high-frequency data better (such as sudden direction changes), at the cost of increased generation time and memory usage. + * The width of the texture (in pixels). Higher values make it possible to represent + * high-frequency data better (such as sudden direction changes), at the cost of increased generation + * time and memory usage. */ public var width: Int @JvmName("getWidth_prop") @@ -39,7 +41,7 @@ public open class CurveXYZTexture : Texture2D() { } /** - * The [godot.Curve] that is rendered onto the texture's red channel. + * The [Curve] that is rendered onto the texture's red channel. */ public var curveX: Curve? get() { @@ -53,7 +55,7 @@ public open class CurveXYZTexture : Texture2D() { } /** - * The [godot.Curve] that is rendered onto the texture's green channel. + * The [Curve] that is rendered onto the texture's green channel. */ public var curveY: Curve? get() { @@ -67,7 +69,7 @@ public open class CurveXYZTexture : Texture2D() { } /** - * The [godot.Curve] that is rendered onto the texture's blue channel. + * The [Curve] that is rendered onto the texture's blue channel. */ public var curveZ: Curve? get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CylinderMesh.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CylinderMesh.kt index 073bddb5e..d057fa3ae 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CylinderMesh.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CylinderMesh.kt @@ -22,14 +22,14 @@ import kotlin.Long import kotlin.Suppress /** - * Class representing a cylindrical [godot.PrimitiveMesh]. - * - * Class representing a cylindrical [godot.PrimitiveMesh]. This class can be used to create cones by setting either the [topRadius] or [bottomRadius] properties to `0.0`. + * Class representing a cylindrical [PrimitiveMesh]. This class can be used to create cones by + * setting either the [topRadius] or [bottomRadius] properties to `0.0`. */ @GodotBaseType public open class CylinderMesh : PrimitiveMesh() { /** - * Top radius of the cylinder. If set to `0.0`, the top faces will not be generated, resulting in a conic shape. See also [capTop]. + * Top radius of the cylinder. If set to `0.0`, the top faces will not be generated, resulting in + * a conic shape. See also [capTop]. */ public var topRadius: Float get() { @@ -43,7 +43,8 @@ public open class CylinderMesh : PrimitiveMesh() { } /** - * Bottom radius of the cylinder. If set to `0.0`, the bottom faces will not be generated, resulting in a conic shape. See also [capBottom]. + * Bottom radius of the cylinder. If set to `0.0`, the bottom faces will not be generated, + * resulting in a conic shape. See also [capBottom]. */ public var bottomRadius: Float get() { @@ -71,7 +72,8 @@ public open class CylinderMesh : PrimitiveMesh() { } /** - * Number of radial segments on the cylinder. Higher values result in a more detailed cylinder/cone at the cost of performance. + * Number of radial segments on the cylinder. Higher values result in a more detailed + * cylinder/cone at the cost of performance. */ public var radialSegments: Int get() { @@ -85,7 +87,11 @@ public open class CylinderMesh : PrimitiveMesh() { } /** - * Number of edge rings along the height of the cylinder. Changing [rings] does not have any visual impact unless a shader or procedural mesh tool is used to alter the vertex data. Higher values result in more subdivisions, which can be used to create smoother-looking effects with shaders or procedural mesh tools (at the cost of performance). When not altering the vertex data using a shader or procedural mesh tool, [rings] should be kept to its default value. + * Number of edge rings along the height of the cylinder. Changing [rings] does not have any + * visual impact unless a shader or procedural mesh tool is used to alter the vertex data. Higher + * values result in more subdivisions, which can be used to create smoother-looking effects with + * shaders or procedural mesh tools (at the cost of performance). When not altering the vertex data + * using a shader or procedural mesh tool, [rings] should be kept to its default value. */ public var rings: Int get() { @@ -99,8 +105,8 @@ public open class CylinderMesh : PrimitiveMesh() { } /** - * If `true`, generates a cap at the top of the cylinder. This can be set to `false` to speed up generation and rendering when the cap is never seen by the camera. See also [topRadius]. - * + * If `true`, generates a cap at the top of the cylinder. This can be set to `false` to speed up + * generation and rendering when the cap is never seen by the camera. See also [topRadius]. * **Note:** If [topRadius] is `0.0`, cap generation is always skipped even if [capTop] is `true`. */ public var capTop: Boolean @@ -115,9 +121,10 @@ public open class CylinderMesh : PrimitiveMesh() { } /** - * If `true`, generates a cap at the bottom of the cylinder. This can be set to `false` to speed up generation and rendering when the cap is never seen by the camera. See also [bottomRadius]. - * - * **Note:** If [bottomRadius] is `0.0`, cap generation is always skipped even if [capBottom] is `true`. + * If `true`, generates a cap at the bottom of the cylinder. This can be set to `false` to speed + * up generation and rendering when the cap is never seen by the camera. See also [bottomRadius]. + * **Note:** If [bottomRadius] is `0.0`, cap generation is always skipped even if [capBottom] is + * `true`. */ public var capBottom: Boolean get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CylinderShape3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CylinderShape3D.kt index a9caf35bb..0161453ca 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CylinderShape3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CylinderShape3D.kt @@ -19,16 +19,12 @@ import kotlin.Int import kotlin.Suppress /** - * A 3D cylinder shape used for physics collision. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/676](https://godotengine.org/asset-library/asset/676) - * - * A 3D cylinder shape, intended for use in physics. Usually used to provide a shape for a [godot.CollisionShape3D]. - * - * **Note:** There are several known bugs with cylinder collision shapes. Using [godot.CapsuleShape3D] or [godot.BoxShape3D] instead is recommended. - * - * **Performance:** [godot.CylinderShape3D] is fast to check collisions against, but it is slower than [godot.CapsuleShape3D], [godot.BoxShape3D], and [godot.SphereShape3D]. + * A 3D cylinder shape, intended for use in physics. Usually used to provide a shape for a + * [CollisionShape3D]. + * **Note:** There are several known bugs with cylinder collision shapes. Using [CapsuleShape3D] or + * [BoxShape3D] instead is recommended. + * **Performance:** [CylinderShape3D] is fast to check collisions against, but it is slower than + * [CapsuleShape3D], [BoxShape3D], and [SphereShape3D]. */ @GodotBaseType public open class CylinderShape3D : Shape3D() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/DampedSpringJoint2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/DampedSpringJoint2D.kt index 82724c1de..6fe632f7e 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/DampedSpringJoint2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/DampedSpringJoint2D.kt @@ -19,9 +19,8 @@ import kotlin.Int import kotlin.Suppress /** - * A physics joint that connects two 2D physics bodies with a spring-like force. - * - * A physics joint that connects two 2D physics bodies with a spring-like force. This resembles a spring that always wants to stretch to a given length. + * A physics joint that connects two 2D physics bodies with a spring-like force. This resembles a + * spring that always wants to stretch to a given length. */ @GodotBaseType public open class DampedSpringJoint2D : Joint2D() { @@ -40,7 +39,8 @@ public open class DampedSpringJoint2D : Joint2D() { } /** - * When the bodies attached to the spring joint move they stretch or squash it. The joint always tries to resize towards this length. + * When the bodies attached to the spring joint move they stretch or squash it. The joint always + * tries to resize towards this length. */ public var restLength: Float get() { @@ -54,7 +54,9 @@ public open class DampedSpringJoint2D : Joint2D() { } /** - * The higher the value, the less the bodies attached to the joint will deform it. The joint applies an opposing force to the bodies, the product of the stiffness multiplied by the size difference from its resting length. + * The higher the value, the less the bodies attached to the joint will deform it. The joint + * applies an opposing force to the bodies, the product of the stiffness multiplied by the size + * difference from its resting length. */ public var stiffness: Float get() { @@ -68,7 +70,9 @@ public open class DampedSpringJoint2D : Joint2D() { } /** - * The spring joint's damping ratio. A value between `0` and `1`. When the two bodies move into different directions the system tries to align them to the spring axis again. A high [damping] value forces the attached bodies to align faster. + * The spring joint's damping ratio. A value between `0` and `1`. When the two bodies move into + * different directions the system tries to align them to the spring axis again. A high [damping] + * value forces the attached bodies to align faster. */ public var damping: Float get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Decal.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Decal.kt index 3c19b3327..99633311b 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Decal.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Decal.kt @@ -30,26 +30,40 @@ import kotlin.Suppress import kotlin.Unit /** - * Node that projects a texture onto a [godot.MeshInstance3D]. - * - * [godot.Decal]s are used to project a texture onto a [godot.Mesh] in the scene. Use Decals to add detail to a scene without affecting the underlying [godot.Mesh]. They are often used to add weathering to building, add dirt or mud to the ground, or add variety to props. Decals can be moved at any time, making them suitable for things like blob shadows or laser sight dots. - * - * They are made of an [AABB] and a group of [godot.Texture2D]s specifying [godot.core.Color], normal, ORM (ambient occlusion, roughness, metallic), and emission. Decals are projected within their [AABB] so altering the orientation of the Decal affects the direction in which they are projected. By default, Decals are projected down (i.e. from positive Y to negative Y). - * - * The [godot.Texture2D]s associated with the Decal are automatically stored in a texture atlas which is used for drawing the decals so all decals can be drawn at once. Godot uses clustered decals, meaning they are stored in cluster data and drawn when the mesh is drawn, they are not drawn as a post-processing effect after. - * - * **Note:** Decals cannot affect an underlying material's transparency, regardless of its transparency mode (alpha blend, alpha scissor, alpha hash, opaque pre-pass). This means translucent or transparent areas of a material will remain translucent or transparent even if an opaque decal is applied on them. - * - * **Note:** Decals are only supported in the Forward+ and Mobile rendering methods, not Compatibility. When using the Mobile rendering method, only 8 decals can be displayed on each mesh resource. Attempting to display more than 8 decals on a single mesh resource will result in decals flickering in and out as the camera moves. - * - * **Note:** When using the Mobile rendering method, decals will only correctly affect meshes whose visibility AABB intersects with the decal's AABB. If using a shader to deform the mesh in a way that makes it go outside its AABB, [godot.GeometryInstance3D.extraCullMargin] must be increased on the mesh. Otherwise, the decal may not be visible on the mesh. + * [Decal]s are used to project a texture onto a [Mesh] in the scene. Use Decals to add detail to a + * scene without affecting the underlying [Mesh]. They are often used to add weathering to building, + * add dirt or mud to the ground, or add variety to props. Decals can be moved at any time, making them + * suitable for things like blob shadows or laser sight dots. + * They are made of an [AABB] and a group of [Texture2D]s specifying [Color], normal, ORM (ambient + * occlusion, roughness, metallic), and emission. Decals are projected within their [AABB] so altering + * the orientation of the Decal affects the direction in which they are projected. By default, Decals + * are projected down (i.e. from positive Y to negative Y). + * The [Texture2D]s associated with the Decal are automatically stored in a texture atlas which is + * used for drawing the decals so all decals can be drawn at once. Godot uses clustered decals, meaning + * they are stored in cluster data and drawn when the mesh is drawn, they are not drawn as a + * post-processing effect after. + * **Note:** Decals cannot affect an underlying material's transparency, regardless of its + * transparency mode (alpha blend, alpha scissor, alpha hash, opaque pre-pass). This means translucent + * or transparent areas of a material will remain translucent or transparent even if an opaque decal is + * applied on them. + * **Note:** Decals are only supported in the Forward+ and Mobile rendering methods, not + * Compatibility. When using the Mobile rendering method, only 8 decals can be displayed on each mesh + * resource. Attempting to display more than 8 decals on a single mesh resource will result in decals + * flickering in and out as the camera moves. + * **Note:** When using the Mobile rendering method, decals will only correctly affect meshes whose + * visibility AABB intersects with the decal's AABB. If using a shader to deform the mesh in a way that + * makes it go outside its AABB, [GeometryInstance3D.extraCullMargin] must be increased on the mesh. + * Otherwise, the decal may not be visible on the mesh. */ @GodotBaseType public open class Decal : VisualInstance3D() { /** - * Sets the size of the [AABB] used by the decal. All dimensions must be set to a value greater than zero (they will be clamped to `0.001` if this is not the case). The AABB goes from `-size/2` to `size/2`. - * - * **Note:** To improve culling efficiency of "hard surface" decals, set their [upperFade] and [lowerFade] to `0.0` and set the Y component of the [size] as low as possible. This will reduce the decals' AABB size without affecting their appearance. + * Sets the size of the [AABB] used by the decal. All dimensions must be set to a value greater + * than zero (they will be clamped to `0.001` if this is not the case). The AABB goes from `-size/2` + * to `size/2`. + * **Note:** To improve culling efficiency of "hard surface" decals, set their [upperFade] and + * [lowerFade] to `0.0` and set the Y component of the [size] as low as possible. This will reduce + * the decals' AABB size without affecting their appearance. */ @CoreTypeLocalCopy public var size: Vector3 @@ -64,9 +78,12 @@ public open class Decal : VisualInstance3D() { } /** - * [godot.Texture2D] with the base [godot.core.Color] of the Decal. Either this or the [textureEmission] must be set for the Decal to be visible. Use the alpha channel like a mask to smoothly blend the edges of the decal with the underlying object. - * - * **Note:** Unlike [godot.BaseMaterial3D] whose filter mode can be adjusted on a per-material basis, the filter mode for [godot.Decal] textures is set globally with [godot.ProjectSettings.rendering/textures/decals/filter]. + * [Texture2D] with the base [Color] of the Decal. Either this or the [textureEmission] must be + * set for the Decal to be visible. Use the alpha channel like a mask to smoothly blend the edges of + * the decal with the underlying object. + * **Note:** Unlike [BaseMaterial3D] whose filter mode can be adjusted on a per-material basis, + * the filter mode for [Decal] textures is set globally with + * [ProjectSettings.rendering/textures/decals/filter]. */ public var textureAlbedo: Texture2D? get() { @@ -80,11 +97,15 @@ public open class Decal : VisualInstance3D() { } /** - * [godot.Texture2D] with the per-pixel normal map for the decal. Use this to add extra detail to decals. - * - * **Note:** Unlike [godot.BaseMaterial3D] whose filter mode can be adjusted on a per-material basis, the filter mode for [godot.Decal] textures is set globally with [godot.ProjectSettings.rendering/textures/decals/filter]. - * - * **Note:** Setting this texture alone will not result in a visible decal, as [textureAlbedo] must also be set. To create a normal-only decal, load an albedo texture into [textureAlbedo] and set [albedoMix] to `0.0`. The albedo texture's alpha channel will be used to determine where the underlying surface's normal map should be overridden (and its intensity). + * [Texture2D] with the per-pixel normal map for the decal. Use this to add extra detail to + * decals. + * **Note:** Unlike [BaseMaterial3D] whose filter mode can be adjusted on a per-material basis, + * the filter mode for [Decal] textures is set globally with + * [ProjectSettings.rendering/textures/decals/filter]. + * **Note:** Setting this texture alone will not result in a visible decal, as [textureAlbedo] + * must also be set. To create a normal-only decal, load an albedo texture into [textureAlbedo] and + * set [albedoMix] to `0.0`. The albedo texture's alpha channel will be used to determine where the + * underlying surface's normal map should be overridden (and its intensity). */ public var textureNormal: Texture2D? get() { @@ -98,11 +119,15 @@ public open class Decal : VisualInstance3D() { } /** - * [godot.Texture2D] storing ambient occlusion, roughness, and metallic for the decal. Use this to add extra detail to decals. - * - * **Note:** Unlike [godot.BaseMaterial3D] whose filter mode can be adjusted on a per-material basis, the filter mode for [godot.Decal] textures is set globally with [godot.ProjectSettings.rendering/textures/decals/filter]. - * - * **Note:** Setting this texture alone will not result in a visible decal, as [textureAlbedo] must also be set. To create an ORM-only decal, load an albedo texture into [textureAlbedo] and set [albedoMix] to `0.0`. The albedo texture's alpha channel will be used to determine where the underlying surface's ORM map should be overridden (and its intensity). + * [Texture2D] storing ambient occlusion, roughness, and metallic for the decal. Use this to add + * extra detail to decals. + * **Note:** Unlike [BaseMaterial3D] whose filter mode can be adjusted on a per-material basis, + * the filter mode for [Decal] textures is set globally with + * [ProjectSettings.rendering/textures/decals/filter]. + * **Note:** Setting this texture alone will not result in a visible decal, as [textureAlbedo] + * must also be set. To create an ORM-only decal, load an albedo texture into [textureAlbedo] and set + * [albedoMix] to `0.0`. The albedo texture's alpha channel will be used to determine where the + * underlying surface's ORM map should be overridden (and its intensity). */ public var textureOrm: Texture2D? get() { @@ -116,9 +141,12 @@ public open class Decal : VisualInstance3D() { } /** - * [godot.Texture2D] with the emission [godot.core.Color] of the Decal. Either this or the [textureAlbedo] must be set for the Decal to be visible. Use the alpha channel like a mask to smoothly blend the edges of the decal with the underlying object. - * - * **Note:** Unlike [godot.BaseMaterial3D] whose filter mode can be adjusted on a per-material basis, the filter mode for [godot.Decal] textures is set globally with [godot.ProjectSettings.rendering/textures/decals/filter]. + * [Texture2D] with the emission [Color] of the Decal. Either this or the [textureAlbedo] must be + * set for the Decal to be visible. Use the alpha channel like a mask to smoothly blend the edges of + * the decal with the underlying object. + * **Note:** Unlike [BaseMaterial3D] whose filter mode can be adjusted on a per-material basis, + * the filter mode for [Decal] textures is set globally with + * [ProjectSettings.rendering/textures/decals/filter]. */ public var textureEmission: Texture2D? get() { @@ -132,7 +160,8 @@ public open class Decal : VisualInstance3D() { } /** - * Energy multiplier for the emission texture. This will make the decal emit light at a higher or lower intensity, independently of the albedo color. See also [modulate]. + * Energy multiplier for the emission texture. This will make the decal emit light at a higher or + * lower intensity, independently of the albedo color. See also [modulate]. */ public var emissionEnergy: Float get() { @@ -146,7 +175,10 @@ public open class Decal : VisualInstance3D() { } /** - * Changes the [godot.core.Color] of the Decal by multiplying the albedo and emission colors with this value. The alpha component is only taken into account when multiplying the albedo color, not the emission color. See also [emissionEnergy] and [albedoMix] to change the emission and albedo intensity independently of each other. + * Changes the [Color] of the Decal by multiplying the albedo and emission colors with this value. + * The alpha component is only taken into account when multiplying the albedo color, not the emission + * color. See also [emissionEnergy] and [albedoMix] to change the emission and albedo intensity + * independently of each other. */ @CoreTypeLocalCopy public var modulate: Color @@ -161,7 +193,10 @@ public open class Decal : VisualInstance3D() { } /** - * Blends the albedo [godot.core.Color] of the decal with albedo [godot.core.Color] of the underlying mesh. This can be set to `0.0` to create a decal that only affects normal or ORM. In this case, an albedo texture is still required as its alpha channel will determine where the normal and ORM will be overridden. See also [modulate]. + * Blends the albedo [Color] of the decal with albedo [Color] of the underlying mesh. This can be + * set to `0.0` to create a decal that only affects normal or ORM. In this case, an albedo texture is + * still required as its alpha channel will determine where the normal and ORM will be overridden. + * See also [modulate]. */ public var albedoMix: Float get() { @@ -175,9 +210,11 @@ public open class Decal : VisualInstance3D() { } /** - * Fades the Decal if the angle between the Decal's [AABB] and the target surface becomes too large. A value of `0` projects the Decal regardless of angle, a value of `1` limits the Decal to surfaces that are nearly perpendicular. - * - * **Note:** Setting [normalFade] to a value greater than `0.0` has a small performance cost due to the added normal angle computations. + * Fades the Decal if the angle between the Decal's [AABB] and the target surface becomes too + * large. A value of `0` projects the Decal regardless of angle, a value of `1` limits the Decal to + * surfaces that are nearly perpendicular. + * **Note:** Setting [normalFade] to a value greater than `0.0` has a small performance cost due + * to the added normal angle computations. */ public var normalFade: Float get() { @@ -191,7 +228,9 @@ public open class Decal : VisualInstance3D() { } /** - * Sets the curve over which the decal will fade as the surface gets further from the center of the [AABB]. Only positive values are valid (negative values will be clamped to `0.0`). See also [lowerFade]. + * Sets the curve over which the decal will fade as the surface gets further from the center of + * the [AABB]. Only positive values are valid (negative values will be clamped to `0.0`). See also + * [lowerFade]. */ public var upperFade: Float get() { @@ -205,7 +244,9 @@ public open class Decal : VisualInstance3D() { } /** - * Sets the curve over which the decal will fade as the surface gets further from the center of the [AABB]. Only positive values are valid (negative values will be clamped to `0.0`). See also [upperFade]. + * Sets the curve over which the decal will fade as the surface gets further from the center of + * the [AABB]. Only positive values are valid (negative values will be clamped to `0.0`). See also + * [upperFade]. */ public var lowerFade: Float get() { @@ -219,7 +260,10 @@ public open class Decal : VisualInstance3D() { } /** - * If `true`, decals will smoothly fade away when far from the active [godot.Camera3D] starting at [distanceFadeBegin]. The Decal will fade out over [distanceFadeBegin] + [distanceFadeLength], after which it will be culled and not sent to the shader at all. Use this to reduce the number of active Decals in a scene and thus improve performance. + * If `true`, decals will smoothly fade away when far from the active [Camera3D] starting at + * [distanceFadeBegin]. The Decal will fade out over [distanceFadeBegin] + [distanceFadeLength], + * after which it will be culled and not sent to the shader at all. Use this to reduce the number of + * active Decals in a scene and thus improve performance. */ public var distanceFadeEnabled: Boolean get() { @@ -247,7 +291,9 @@ public open class Decal : VisualInstance3D() { } /** - * The distance over which the Decal fades (in 3D units). The Decal becomes slowly more transparent over this distance and is completely invisible at the end. Higher values result in a smoother fade-out transition, which is more suited when the camera moves fast. + * The distance over which the Decal fades (in 3D units). The Decal becomes slowly more + * transparent over this distance and is completely invisible at the end. Higher values result in a + * smoother fade-out transition, which is more suited when the camera moves fast. */ public var distanceFadeLength: Float get() { @@ -261,7 +307,10 @@ public open class Decal : VisualInstance3D() { } /** - * Specifies which [godot.VisualInstance3D.layers] this decal will project on. By default, Decals affect all layers. This is used so you can specify which types of objects receive the Decal and which do not. This is especially useful so you can ensure that dynamic objects don't accidentally receive a Decal intended for the terrain under them. + * Specifies which [VisualInstance3D.layers] this decal will project on. By default, Decals affect + * all layers. This is used so you can specify which types of objects receive the Decal and which do + * not. This is especially useful so you can ensure that dynamic objects don't accidentally receive a + * Decal intended for the terrain under them. */ public var cullMask: Long get() { @@ -280,9 +329,12 @@ public open class Decal : VisualInstance3D() { } /** - * Sets the size of the [AABB] used by the decal. All dimensions must be set to a value greater than zero (they will be clamped to `0.001` if this is not the case). The AABB goes from `-size/2` to `size/2`. - * - * **Note:** To improve culling efficiency of "hard surface" decals, set their [upperFade] and [lowerFade] to `0.0` and set the Y component of the [size] as low as possible. This will reduce the decals' AABB size without affecting their appearance. + * Sets the size of the [AABB] used by the decal. All dimensions must be set to a value greater + * than zero (they will be clamped to `0.001` if this is not the case). The AABB goes from `-size/2` + * to `size/2`. + * **Note:** To improve culling efficiency of "hard surface" decals, set their [upperFade] and + * [lowerFade] to `0.0` and set the Y component of the [size] as low as possible. This will reduce + * the decals' AABB size without affecting their appearance. * * This is a helper function to make dealing with local copies easier. * @@ -306,7 +358,10 @@ public open class Decal : VisualInstance3D() { /** - * Changes the [godot.core.Color] of the Decal by multiplying the albedo and emission colors with this value. The alpha component is only taken into account when multiplying the albedo color, not the emission color. See also [emissionEnergy] and [albedoMix] to change the emission and albedo intensity independently of each other. + * Changes the [Color] of the Decal by multiplying the albedo and emission colors with this value. + * The alpha component is only taken into account when multiplying the albedo color, not the emission + * color. See also [emissionEnergy] and [albedoMix] to change the emission and albedo intensity + * independently of each other. * * This is a helper function to make dealing with local copies easier. * @@ -333,19 +388,19 @@ public open class Decal : VisualInstance3D() { id: Long, ) { /** - * [godot.Texture2D] corresponding to [textureAlbedo]. + * [Texture2D] corresponding to [textureAlbedo]. */ TEXTURE_ALBEDO(0), /** - * [godot.Texture2D] corresponding to [textureNormal]. + * [Texture2D] corresponding to [textureNormal]. */ TEXTURE_NORMAL(1), /** - * [godot.Texture2D] corresponding to [textureOrm]. + * [Texture2D] corresponding to [textureOrm]. */ TEXTURE_ORM(2), /** - * [godot.Texture2D] corresponding to [textureEmission]. + * [Texture2D] corresponding to [textureEmission]. */ TEXTURE_EMISSION(3), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/DirAccess.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/DirAccess.kt index 4fd0439b3..058c8680c 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/DirAccess.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/DirAccess.kt @@ -27,122 +27,72 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * Provides methods for managing directories and their content. - * - * Tutorials: - * [$DOCS_URL/tutorials/scripting/filesystem.html]($DOCS_URL/tutorials/scripting/filesystem.html) - * * This class is used to manage directories and their content, even outside of the project folder. - * - * [godot.DirAccess] can't be instantiated directly. Instead it is created with a static method that takes a path for which it will be opened. - * - * Most of the methods have a static alternative that can be used without creating a [godot.DirAccess]. Static methods only support absolute paths (including `res://` and `user://`). - * - * ``` - * # Standard - * var dir = DirAccess.open("user://levels") - * dir.make_dir("world1") - * # Static - * DirAccess.make_dir_absolute("user://levels/world1") - * ``` - * - * **Note:** Many resources types are imported (e.g. textures or sound files), and their source asset will not be included in the exported game, as only the imported version is used. Use [godot.ResourceLoader] to access imported resources. - * + * [DirAccess] can't be instantiated directly. Instead it is created with a static method that takes + * a path for which it will be opened. + * Most of the methods have a static alternative that can be used without creating a [DirAccess]. + * Static methods only support absolute paths (including `res://` and `user://`). + * [codeblock] + * # Standard + * var dir = DirAccess.open("user://levels") + * dir.make_dir("world1") + * # Static + * DirAccess.make_dir_absolute("user://levels/world1") + * [/codeblock] + * **Note:** Many resources types are imported (e.g. textures or sound files), and their source + * asset will not be included in the exported game, as only the imported version is used. Use + * [ResourceLoader] to access imported resources. * Here is an example on how to iterate through the files of a directory: * - * [codeblocks] - * - * [gdscript] - * + * gdscript: + * ```gdscript * func dir_contents(path): - * * var dir = DirAccess.open(path) - * * if dir: - * * dir.list_dir_begin() - * * var file_name = dir.get_next() - * * while file_name != "": - * * if dir.current_is_dir(): - * * print("Found directory: " + file_name) - * * else: - * * print("Found file: " + file_name) - * * file_name = dir.get_next() - * * else: - * * print("An error occurred when trying to access the path.") - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * public void DirContents(string path) - * * { - * * using var dir = DirAccess.Open(path); - * * if (dir != null) - * * { - * * dir.ListDirBegin(); - * * string fileName = dir.GetNext(); - * * while (fileName != "") - * * { - * * if (dir.CurrentIsDir()) - * * { - * * GD.Print($"Found directory: {fileName}"); - * * } - * * else - * * { - * * GD.Print($"Found file: {fileName}"); - * * } - * * fileName = dir.GetNext(); - * * } - * * } - * * else - * * { - * * GD.Print("An error occurred when trying to access the path."); - * * } - * * } - * - * [/csharp] - * - * [/codeblocks] + * ``` */ @GodotBaseType public open class DirAccess internal constructor() : RefCounted() { /** * If `true`, `.` and `..` are included when navigating the directory. - * * Affects [listDirBegin] and [getDirectories]. */ public var includeNavigational: Boolean @@ -158,7 +108,6 @@ public open class DirAccess internal constructor() : RefCounted() { /** * If `true`, hidden files are included when navigating the directory. - * * Affects [listDirBegin], [getDirectories] and [getFiles]. */ public var includeHidden: Boolean @@ -178,11 +127,13 @@ public open class DirAccess internal constructor() : RefCounted() { } /** - * Initializes the stream used to list all files and directories using the [getNext] function, closing the currently opened stream if needed. Once the stream has been processed, it should typically be closed with [listDirEnd]. - * + * Initializes the stream used to list all files and directories using the [getNext] function, + * closing the currently opened stream if needed. Once the stream has been processed, it should + * typically be closed with [listDirEnd]. * Affected by [includeHidden] and [includeNavigational]. - * - * **Note:** The order of files and directories returned by this method is not deterministic, and can vary between operating systems. If you want a list of all files or folders sorted alphabetically, use [getFiles] or [getDirectories]. + * **Note:** The order of files and directories returned by this method is not deterministic, and + * can vary between operating systems. If you want a list of all files or folders sorted + * alphabetically, use [getFiles] or [getDirectories]. */ public fun listDirBegin(): GodotError { TransferContext.writeArguments() @@ -192,8 +143,9 @@ public open class DirAccess internal constructor() : RefCounted() { /** * Returns the next element (file or directory) in the current directory. - * - * The name of the file or directory is returned (and not its full path). Once the stream has been fully processed, the method returns an empty [godot.String] and closes the stream automatically (i.e. [listDirEnd] would not be mandatory in such a case). + * The name of the file or directory is returned (and not its full path). Once the stream has been + * fully processed, the method returns an empty [String] and closes the stream automatically (i.e. + * [listDirEnd] would not be mandatory in such a case). */ public fun getNext(): String { TransferContext.writeArguments() @@ -202,7 +154,8 @@ public open class DirAccess internal constructor() : RefCounted() { } /** - * Returns whether the current item processed with the last [getNext] call is a directory (`.` and `..` are considered directories). + * Returns whether the current item processed with the last [getNext] call is a directory (`.` and + * `..` are considered directories). */ public fun currentIsDir(): Boolean { TransferContext.writeArguments() @@ -211,7 +164,8 @@ public open class DirAccess internal constructor() : RefCounted() { } /** - * Closes the current stream opened with [listDirBegin] (whether it has been fully processed with [getNext] does not matter). + * Closes the current stream opened with [listDirBegin] (whether it has been fully processed with + * [getNext] does not matter). */ public fun listDirEnd(): Unit { TransferContext.writeArguments() @@ -219,11 +173,15 @@ public open class DirAccess internal constructor() : RefCounted() { } /** - * Returns a [godot.PackedStringArray] containing filenames of the directory contents, excluding directories. The array is sorted alphabetically. - * + * Returns a [PackedStringArray] containing filenames of the directory contents, excluding + * directories. The array is sorted alphabetically. * Affected by [includeHidden]. - * - * **Note:** When used on a `res://` path in an exported project, only the files actually included in the PCK at the given folder level are returned. In practice, this means that since imported resources are stored in a top-level `.godot/` folder, only paths to `*.gd` and `*.import` files are returned (plus a few files such as `project.godot` or `project.binary` and the project icon). In an exported project, the list of returned files will also vary depending on whether [godot.ProjectSettings.editor/export/convertTextResourcesToBinary] is `true`. + * **Note:** When used on a `res://` path in an exported project, only the files actually included + * in the PCK at the given folder level are returned. In practice, this means that since imported + * resources are stored in a top-level `.godot/` folder, only paths to `*.gd` and `*.import` files + * are returned (plus a few files such as `project.godot` or `project.binary` and the project icon). + * In an exported project, the list of returned files will also vary depending on whether + * [ProjectSettings.editor/export/convertTextResourcesToBinary] is `true`. */ public fun getFiles(): PackedStringArray { TransferContext.writeArguments() @@ -232,8 +190,8 @@ public open class DirAccess internal constructor() : RefCounted() { } /** - * Returns a [godot.PackedStringArray] containing filenames of the directory contents, excluding files. The array is sorted alphabetically. - * + * Returns a [PackedStringArray] containing filenames of the directory contents, excluding files. + * The array is sorted alphabetically. * Affected by [includeHidden] and [includeNavigational]. */ public fun getDirectories(): PackedStringArray { @@ -243,7 +201,8 @@ public open class DirAccess internal constructor() : RefCounted() { } /** - * Returns the currently opened directory's drive index. See [getDriveName] to convert returned index to the name of the drive. + * Returns the currently opened directory's drive index. See [getDriveName] to convert returned + * index to the name of the drive. */ public fun getCurrentDrive(): Int { TransferContext.writeArguments() @@ -252,11 +211,13 @@ public open class DirAccess internal constructor() : RefCounted() { } /** - * Changes the currently opened directory to the one passed as an argument. The argument can be relative to the current directory (e.g. `newdir` or `../newdir`), or an absolute path (e.g. `/tmp/newdir` or `res://somedir/newdir`). - * - * Returns one of the [enum Error] code constants ([OK] on success). - * - * **Note:** The new directory must be within the same scope, e.g. when you had opened a directory inside `res://`, you can't change it to `user://` directory. If you need to open a directory in another access scope, use [open] to create a new instance instead. + * Changes the currently opened directory to the one passed as an argument. The argument can be + * relative to the current directory (e.g. `newdir` or `../newdir`), or an absolute path (e.g. + * `/tmp/newdir` or `res://somedir/newdir`). + * Returns one of the [enum Error] code constants ([constant OK] on success). + * **Note:** The new directory must be within the same scope, e.g. when you had opened a directory + * inside `res://`, you can't change it to `user://` directory. If you need to open a directory in + * another access scope, use [open] to create a new instance instead. */ public fun changeDir(toDir: String): GodotError { TransferContext.writeArguments(STRING to toDir) @@ -265,7 +226,8 @@ public open class DirAccess internal constructor() : RefCounted() { } /** - * Returns the absolute path to the currently opened directory (e.g. `res://folder` or `C:\tmp\folder`). + * Returns the absolute path to the currently opened directory (e.g. `res://folder` or + * `C:\tmp\folder`). */ @JvmOverloads public fun getCurrentDir(includeDrive: Boolean = true): String { @@ -275,9 +237,10 @@ public open class DirAccess internal constructor() : RefCounted() { } /** - * Creates a directory. The argument can be relative to the current directory, or an absolute path. The target directory should be placed in an already existing directory (to create the full path recursively, see [makeDirRecursive]). - * - * Returns one of the [enum Error] code constants ([OK] on success). + * Creates a directory. The argument can be relative to the current directory, or an absolute + * path. The target directory should be placed in an already existing directory (to create the full + * path recursively, see [makeDirRecursive]). + * Returns one of the [enum Error] code constants ([constant OK] on success). */ public fun makeDir(path: String): GodotError { TransferContext.writeArguments(STRING to path) @@ -286,9 +249,9 @@ public open class DirAccess internal constructor() : RefCounted() { } /** - * Creates a target directory and all necessary intermediate directories in its path, by calling [makeDir] recursively. The argument can be relative to the current directory, or an absolute path. - * - * Returns one of the [enum Error] code constants ([OK] on success). + * Creates a target directory and all necessary intermediate directories in its path, by calling + * [makeDir] recursively. The argument can be relative to the current directory, or an absolute path. + * Returns one of the [enum Error] code constants ([constant OK] on success). */ public fun makeDirRecursive(path: String): GodotError { TransferContext.writeArguments(STRING to path) @@ -297,9 +260,9 @@ public open class DirAccess internal constructor() : RefCounted() { } /** - * Returns whether the target file exists. The argument can be relative to the current directory, or an absolute path. - * - * For a static equivalent, use [godot.FileAccess.fileExists]. + * Returns whether the target file exists. The argument can be relative to the current directory, + * or an absolute path. + * For a static equivalent, use [FileAccess.fileExists]. */ public fun fileExists(path: String): Boolean { TransferContext.writeArguments(STRING to path) @@ -308,7 +271,8 @@ public open class DirAccess internal constructor() : RefCounted() { } /** - * Returns whether the target directory exists. The argument can be relative to the current directory, or an absolute path. + * Returns whether the target directory exists. The argument can be relative to the current + * directory, or an absolute path. */ public fun dirExists(path: String): Boolean { TransferContext.writeArguments(STRING to path) @@ -317,7 +281,8 @@ public open class DirAccess internal constructor() : RefCounted() { } /** - * Returns the available space on the current directory's disk, in bytes. Returns `0` if the platform-specific method to query the available space fails. + * Returns the available space on the current directory's disk, in bytes. Returns `0` if the + * platform-specific method to query the available space fails. */ public fun getSpaceLeft(): Long { TransferContext.writeArguments() @@ -326,11 +291,12 @@ public open class DirAccess internal constructor() : RefCounted() { } /** - * Copies the [from] file to the [to] destination. Both arguments should be paths to files, either relative or absolute. If the destination file exists and is not access-protected, it will be overwritten. - * - * If [chmodFlags] is different than `-1`, the Unix permissions for the destination path will be set to the provided value, if available on the current operating system. - * - * Returns one of the [enum Error] code constants ([OK] on success). + * Copies the [param from] file to the [param to] destination. Both arguments should be paths to + * files, either relative or absolute. If the destination file exists and is not access-protected, it + * will be overwritten. + * If [param chmod_flags] is different than `-1`, the Unix permissions for the destination path + * will be set to the provided value, if available on the current operating system. + * Returns one of the [enum Error] code constants ([constant OK] on success). */ @JvmOverloads public fun copy( @@ -344,9 +310,10 @@ public open class DirAccess internal constructor() : RefCounted() { } /** - * Renames (move) the [from] file or directory to the [to] destination. Both arguments should be paths to files or directories, either relative or absolute. If the destination file or directory exists and is not access-protected, it will be overwritten. - * - * Returns one of the [enum Error] code constants ([OK] on success). + * Renames (move) the [param from] file or directory to the [param to] destination. Both arguments + * should be paths to files or directories, either relative or absolute. If the destination file or + * directory exists and is not access-protected, it will be overwritten. + * Returns one of the [enum Error] code constants ([constant OK] on success). */ public fun rename(from: String, to: String): GodotError { TransferContext.writeArguments(STRING to from, STRING to to) @@ -355,11 +322,11 @@ public open class DirAccess internal constructor() : RefCounted() { } /** - * Permanently deletes the target file or an empty directory. The argument can be relative to the current directory, or an absolute path. If the target directory is not empty, the operation will fail. - * - * If you don't want to delete the file/directory permanently, use [godot.OS.moveToTrash] instead. - * - * Returns one of the [enum Error] code constants ([OK] on success). + * Permanently deletes the target file or an empty directory. The argument can be relative to the + * current directory, or an absolute path. If the target directory is not empty, the operation will + * fail. + * If you don't want to delete the file/directory permanently, use [OS.moveToTrash] instead. + * Returns one of the [enum Error] code constants ([constant OK] on success). */ public fun remove(path: String): GodotError { TransferContext.writeArguments(STRING to path) @@ -380,9 +347,12 @@ public open class DirAccess internal constructor() : RefCounted() { public companion object { /** - * Creates a new [godot.DirAccess] object and opens an existing directory of the filesystem. The [path] argument can be within the project tree (`res://folder`), the user directory (`user://folder`) or an absolute path of the user filesystem (e.g. `/tmp/folder` or `C:\tmp\folder`). - * - * Returns `null` if opening the directory failed. You can use [getOpenError] to check the error that occurred. + * Creates a new [DirAccess] object and opens an existing directory of the filesystem. The + * [param path] argument can be within the project tree (`res://folder`), the user directory + * (`user://folder`) or an absolute path of the user filesystem (e.g. `/tmp/folder` or + * `C:\tmp\folder`). + * Returns `null` if opening the directory failed. You can use [getOpenError] to check the error + * that occurred. */ public fun `open`(path: String): DirAccess? { TransferContext.writeArguments(STRING to path) @@ -400,8 +370,8 @@ public open class DirAccess internal constructor() : RefCounted() { } /** - * Returns a [godot.PackedStringArray] containing filenames of the directory contents, excluding directories, at the given [path]. The array is sorted alphabetically. - * + * Returns a [PackedStringArray] containing filenames of the directory contents, excluding + * directories, at the given [param path]. The array is sorted alphabetically. * Use [getFiles] if you want more control of what gets included. */ public fun getFilesAt(path: String): PackedStringArray { @@ -411,8 +381,8 @@ public open class DirAccess internal constructor() : RefCounted() { } /** - * Returns a [godot.PackedStringArray] containing filenames of the directory contents, excluding files, at the given [path]. The array is sorted alphabetically. - * + * Returns a [PackedStringArray] containing filenames of the directory contents, excluding + * files, at the given [param path]. The array is sorted alphabetically. * Use [getDirectories] if you want more control of what gets included. */ public fun getDirectoriesAt(path: String): PackedStringArray { @@ -423,11 +393,8 @@ public open class DirAccess internal constructor() : RefCounted() { /** * On Windows, returns the number of drives (partitions) mounted on the current filesystem. - * * On macOS, returns the number of mounted volumes. - * * On Linux, returns the number of mounted volumes and GTK 3 bookmarks. - * * On other platforms, the method returns 0. */ public fun getDriveCount(): Int { @@ -438,12 +405,10 @@ public open class DirAccess internal constructor() : RefCounted() { /** * On Windows, returns the name of the drive (partition) passed as an argument (e.g. `C:`). - * * On macOS, returns the path to the mounted volume passed as an argument. - * * On Linux, returns the path to the mounted volume or GTK 3 bookmark passed as an argument. - * - * On other platforms, or if the requested drive does not exist, the method returns an empty String. + * On other platforms, or if the requested drive does not exist, the method returns an empty + * String. */ public fun getDriveName(idx: Int): String { TransferContext.writeArguments(LONG to idx.toLong()) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/DirectionalLight2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/DirectionalLight2D.kt index 902c9e762..5287c85f2 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/DirectionalLight2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/DirectionalLight2D.kt @@ -20,19 +20,17 @@ import kotlin.Suppress import kotlin.jvm.JvmName /** - * Directional 2D light from a distance. - * - * Tutorials: - * [$DOCS_URL/tutorials/2d/2d_lights_and_shadows.html]($DOCS_URL/tutorials/2d/2d_lights_and_shadows.html) - * - * A directional light is a type of [godot.Light2D] node that models an infinite number of parallel rays covering the entire scene. It is used for lights with strong intensity that are located far away from the scene (for example: to model sunlight or moonlight). - * - * **Note:** [godot.DirectionalLight2D] does not support light cull masks (but it supports shadow cull masks). It will always light up 2D nodes, regardless of the 2D node's [godot.CanvasItem.lightMask]. + * A directional light is a type of [Light2D] node that models an infinite number of parallel rays + * covering the entire scene. It is used for lights with strong intensity that are located far away + * from the scene (for example: to model sunlight or moonlight). + * **Note:** [DirectionalLight2D] does not support light cull masks (but it supports shadow cull + * masks). It will always light up 2D nodes, regardless of the 2D node's [CanvasItem.lightMask]. */ @GodotBaseType public open class DirectionalLight2D : Light2D() { /** - * The height of the light. Used with 2D normal mapping. Ranges from 0 (parallel to the plane) to 1 (perpendicular to the plane). + * The height of the light. Used with 2D normal mapping. Ranges from 0 (parallel to the plane) to + * 1 (perpendicular to the plane). */ public var height: Float @JvmName("getHeight_prop") @@ -43,7 +41,11 @@ public open class DirectionalLight2D : Light2D() { } /** - * The maximum distance from the camera center objects can be before their shadows are culled (in pixels). Decreasing this value can prevent objects located outside the camera from casting shadows (while also improving performance). [godot.Camera2D.zoom] is not taken into account by [maxDistance], which means that at higher zoom values, shadows will appear to fade out sooner when zooming onto a given point. + * The maximum distance from the camera center objects can be before their shadows are culled (in + * pixels). Decreasing this value can prevent objects located outside the camera from casting shadows + * (while also improving performance). [Camera2D.zoom] is not taken into account by [maxDistance], + * which means that at higher zoom values, shadows will appear to fade out sooner when zooming onto a + * given point. */ public var maxDistance: Float get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/DirectionalLight3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/DirectionalLight3D.kt index 5154c8589..31769d941 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/DirectionalLight3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/DirectionalLight3D.kt @@ -19,12 +19,10 @@ import kotlin.Long import kotlin.Suppress /** - * Directional light from a distance, as from the Sun. - * - * Tutorials: - * [$DOCS_URL/tutorials/3d/global_illumination/faking_global_illumination.html]($DOCS_URL/tutorials/3d/global_illumination/faking_global_illumination.html) - * - * A directional light is a type of [godot.Light3D] node that models an infinite number of parallel rays covering the entire scene. It is used for lights with strong intensity that are located far away from the scene to model sunlight or moonlight. The worldspace location of the DirectionalLight3D transform (origin) is ignored. Only the basis is used to determine light direction. + * A directional light is a type of [Light3D] node that models an infinite number of parallel rays + * covering the entire scene. It is used for lights with strong intensity that are located far away + * from the scene to model sunlight or moonlight. The worldspace location of the DirectionalLight3D + * transform (origin) is ignored. Only the basis is used to determine light direction. */ @GodotBaseType public open class DirectionalLight3D : Light3D() { @@ -43,7 +41,9 @@ public open class DirectionalLight3D : Light3D() { } /** - * If `true`, shadow detail is sacrificed in exchange for smoother transitions between splits. Enabling shadow blend splitting also has a moderate performance cost. This is ignored when [directionalShadowMode] is [SHADOW_ORTHOGONAL]. + * If `true`, shadow detail is sacrificed in exchange for smoother transitions between splits. + * Enabling shadow blend splitting also has a moderate performance cost. This is ignored when + * [directionalShadowMode] is [constant SHADOW_ORTHOGONAL]. */ public var directionalShadowBlendSplits: Boolean get() { @@ -57,7 +57,8 @@ public open class DirectionalLight3D : Light3D() { } /** - * Set whether this [godot.DirectionalLight3D] is visible in the sky, in the scene, or both in the sky and in the scene. See [enum SkyMode] for options. + * Set whether this [DirectionalLight3D] is visible in the sky, in the scene, or both in the sky + * and in the scene. See [enum SkyMode] for options. */ public var skyMode: SkyMode get() { @@ -79,15 +80,19 @@ public open class DirectionalLight3D : Light3D() { id: Long, ) { /** - * Renders the entire scene's shadow map from an orthogonal point of view. This is the fastest directional shadow mode. May result in blurrier shadows on close objects. + * Renders the entire scene's shadow map from an orthogonal point of view. This is the fastest + * directional shadow mode. May result in blurrier shadows on close objects. */ SHADOW_ORTHOGONAL(0), /** - * Splits the view frustum in 2 areas, each with its own shadow map. This shadow mode is a compromise between [SHADOW_ORTHOGONAL] and [godot.SHADOW_PARALLEL_4_SPLITS] in terms of performance. + * Splits the view frustum in 2 areas, each with its own shadow map. This shadow mode is a + * compromise between [constant SHADOW_ORTHOGONAL] and [constant SHADOW_PARALLEL_4_SPLITS] in terms + * of performance. */ SHADOW_PARALLEL_2_SPLITS(1), /** - * Splits the view frustum in 4 areas, each with its own shadow map. This is the slowest directional shadow mode. + * Splits the view frustum in 4 areas, each with its own shadow map. This is the slowest + * directional shadow mode. */ SHADOW_PARALLEL_4_SPLITS(2), ; @@ -110,11 +115,15 @@ public open class DirectionalLight3D : Light3D() { */ SKY_MODE_LIGHT_AND_SKY(0), /** - * Makes the light visible in scene lighting only (including direct lighting and global illumination). When using this mode, the light will not be visible from sky shaders. + * Makes the light visible in scene lighting only (including direct lighting and global + * illumination). When using this mode, the light will not be visible from sky shaders. */ SKY_MODE_LIGHT_ONLY(1), /** - * Makes the light visible to sky shaders only. When using this mode the light will not cast light into the scene (either through direct lighting or through global illumination), but can be accessed through sky shaders. This can be useful, for example, when you want to control sky effects without illuminating the scene (during a night cycle, for example). + * Makes the light visible to sky shaders only. When using this mode the light will not cast + * light into the scene (either through direct lighting or through global illumination), but can be + * accessed through sky shaders. This can be useful, for example, when you want to control sky + * effects without illuminating the scene (during a night cycle, for example). */ SKY_MODE_SKY_ONLY(2), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ENetConnection.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ENetConnection.kt index d0cc4316f..f976a7c6f 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ENetConnection.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ENetConnection.kt @@ -31,6 +31,10 @@ import kotlin.Suppress import kotlin.Unit import kotlin.jvm.JvmOverloads +/** + * ENet's purpose is to provide a relatively thin, simple and robust network communication layer on + * top of UDP (User Datagram Protocol). + */ @GodotBaseType public open class ENetConnection : RefCounted() { public override fun new(scriptIndex: Int): Boolean { @@ -38,6 +42,10 @@ public open class ENetConnection : RefCounted() { return true } + /** + * Create an ENetHost like [createHost] which is also bound to the given [param bind_address] and + * [param bind_port]. + */ @JvmOverloads public fun createHostBound( bindAddress: String, @@ -52,6 +60,11 @@ public open class ENetConnection : RefCounted() { return GodotError.from(TransferContext.readReturnValue(LONG) as Long) } + /** + * Create an ENetHost that will allow up to [param max_peers] connected peers, each allocating up + * to [param max_channels] channels, optionally limiting bandwidth to [param in_bandwidth] and [param + * out_bandwidth]. + */ @JvmOverloads public fun createHost( maxPeers: Int = 32, @@ -64,11 +77,20 @@ public open class ENetConnection : RefCounted() { return GodotError.from(TransferContext.readReturnValue(LONG) as Long) } + /** + * Destroys the host and all resources associated with it. + */ public fun destroy(): Unit { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.destroyPtr, NIL) } + /** + * Initiates a connection to a foreign [param address] using the specified [param port] and + * allocating the requested [param channels]. Optional [param data] can be passed during connection + * in the form of a 32 bit integer. + * **Note:** You must call either [createHost] or [createHostBound] before calling this method. + */ @JvmOverloads public fun connectToHost( address: String, @@ -81,6 +103,14 @@ public open class ENetConnection : RefCounted() { return (TransferContext.readReturnValue(OBJECT, true) as ENetPacketPeer?) } + /** + * Waits for events on the host specified and shuttles packets between the host and its peers. The + * returned [Array] will have 4 elements. An [enum EventType], the [ENetPacketPeer] which generated + * the event, the event associated data (if any), the event associated channel (if any). If the + * generated event is [constant EVENT_RECEIVE], the received packet will be queued to the associated + * [ENetPacketPeer]. + * Call this function regularly to handle connections, disconnections, and to receive new packets. + */ @JvmOverloads public fun service(timeout: Int = 0): VariantArray { TransferContext.writeArguments(LONG to timeout.toLong()) @@ -88,22 +118,35 @@ public open class ENetConnection : RefCounted() { return (TransferContext.readReturnValue(ARRAY, false) as VariantArray) } + /** + * Sends any queued packets on the host specified to its designated peers. + */ public fun flush(): Unit { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.flushPtr, NIL) } + /** + * Adjusts the bandwidth limits of a host. + */ @JvmOverloads public fun bandwidthLimit(inBandwidth: Int = 0, outBandwidth: Int = 0): Unit { TransferContext.writeArguments(LONG to inBandwidth.toLong(), LONG to outBandwidth.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.bandwidthLimitPtr, NIL) } + /** + * Limits the maximum allowed channels of future incoming connections. + */ public fun channelLimit(limit: Int): Unit { TransferContext.writeArguments(LONG to limit.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.channelLimitPtr, NIL) } + /** + * Queues a [param packet] to be sent to all peers associated with the host over the specified + * [param channel]. See [ENetPacketPeer] `FLAG_*` constants for available packet flags. + */ public fun broadcast( channel: Int, packet: PackedByteArray, @@ -113,17 +156,40 @@ public open class ENetConnection : RefCounted() { TransferContext.callMethod(rawPtr, MethodBindings.broadcastPtr, NIL) } + /** + * Sets the compression method used for network packets. These have different tradeoffs of + * compression speed versus bandwidth, you may need to test which one works best for your use case if + * you use compression at all. + * **Note:** Most games' network design involve sending many small packets frequently (smaller + * than 4 KB each). If in doubt, it is recommended to keep the default compression algorithm as it + * works best on these small packets. + * **Note:** The compression mode must be set to the same value on both the server and all its + * clients. Clients will fail to connect if the compression mode set on the client differs from the + * one set on the server. + */ public fun compress(mode: CompressionMode): Unit { TransferContext.writeArguments(LONG to mode.id) TransferContext.callMethod(rawPtr, MethodBindings.compressPtr, NIL) } + /** + * Configure this ENetHost to use the custom Godot extension allowing DTLS encryption for ENet + * servers. Call this right after [createHostBound] to have ENet expect peers to connect using DTLS. + * See [TLSOptions.server]. + */ public fun dtlsServerSetup(serverOptions: TLSOptions): GodotError { TransferContext.writeArguments(OBJECT to serverOptions) TransferContext.callMethod(rawPtr, MethodBindings.dtlsServerSetupPtr, LONG) return GodotError.from(TransferContext.readReturnValue(LONG) as Long) } + /** + * Configure this ENetHost to use the custom Godot extension allowing DTLS encryption for ENet + * clients. Call this before [connectToHost] to have ENet connect using DTLS validating the server + * certificate against [param hostname]. You can pass the optional [param client_options] parameter + * to customize the trusted certification authorities, or disable the common name verification. See + * [TLSOptions.client] and [TLSOptions.clientUnsafe]. + */ @JvmOverloads public fun dtlsClientSetup(hostname: String, clientOptions: TLSOptions? = null): GodotError { TransferContext.writeArguments(STRING to hostname, OBJECT to clientOptions) @@ -131,35 +197,66 @@ public open class ENetConnection : RefCounted() { return GodotError.from(TransferContext.readReturnValue(LONG) as Long) } + /** + * Configures the DTLS server to automatically drop new connections. + * **Note:** This method is only relevant after calling [dtlsServerSetup]. + */ public fun refuseNewConnections(refuse: Boolean): Unit { TransferContext.writeArguments(BOOL to refuse) TransferContext.callMethod(rawPtr, MethodBindings.refuseNewConnectionsPtr, NIL) } + /** + * Returns and resets host statistics. See [enum HostStatistic] for more info. + */ public fun popStatistic(statistic: HostStatistic): Double { TransferContext.writeArguments(LONG to statistic.id) TransferContext.callMethod(rawPtr, MethodBindings.popStatisticPtr, DOUBLE) return (TransferContext.readReturnValue(DOUBLE, false) as Double) } + /** + * Returns the maximum number of channels allowed for connected peers. + */ public fun getMaxChannels(): Int { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getMaxChannelsPtr, LONG) return (TransferContext.readReturnValue(LONG, false) as Long).toInt() } + /** + * Returns the local port to which this peer is bound. + */ public fun getLocalPort(): Int { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getLocalPortPtr, LONG) return (TransferContext.readReturnValue(LONG, false) as Long).toInt() } + /** + * Returns the list of peers associated with this host. + * **Note:** This list might include some peers that are not fully connected or are still being + * disconnected. + */ public fun getPeers(): VariantArray { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getPeersPtr, ARRAY) return (TransferContext.readReturnValue(ARRAY, false) as VariantArray) } + /** + * Sends a [param packet] toward a destination from the address and port currently bound by this + * ENetConnection instance. + * This is useful as it serves to establish entries in NAT routing tables on all devices between + * this bound instance and the public facing internet, allowing a prospective client's connection + * packets to be routed backward through the NAT device(s) between the public internet and this host. + * This requires forward knowledge of a prospective client's address and communication port as + * seen by the public internet - after any NAT devices have handled their connection request. This + * information can be obtained by a [url=https://en.wikipedia.org/wiki/STUN]STUN[/url] service, and + * must be handed off to your host by an entity that is not the prospective client. This will never + * work for a client behind a Symmetric NAT due to the nature of the Symmetric NAT routing algorithm, + * as their IP and Port cannot be known beforehand. + */ public fun socketSend( destinationAddress: String, destinationPort: Int, @@ -172,10 +269,32 @@ public open class ENetConnection : RefCounted() { public enum class CompressionMode( id: Long, ) { + /** + * No compression. This uses the most bandwidth, but has the upside of requiring the fewest CPU + * resources. This option may also be used to make network debugging using tools like Wireshark + * easier. + */ COMPRESS_NONE(0), + /** + * ENet's built-in range encoding. Works well on small packets, but is not the most efficient + * algorithm on packets larger than 4 KB. + */ COMPRESS_RANGE_CODER(1), + /** + * [url=https://fastlz.org/]FastLZ[/url] compression. This option uses less CPU resources + * compared to [constant COMPRESS_ZLIB], at the expense of using more bandwidth. + */ COMPRESS_FASTLZ(2), + /** + * [url=https://www.zlib.net/]Zlib[/url] compression. This option uses less bandwidth compared + * to [constant COMPRESS_FASTLZ], at the expense of using more CPU resources. + */ COMPRESS_ZLIB(3), + /** + * [url=https://facebook.github.io/zstd/]Zstandard[/url] compression. Note that this algorithm + * is not very efficient on packets smaller than 4 KB. Therefore, it's recommended to use other + * compression algorithms in most cases. + */ COMPRESS_ZSTD(4), ; @@ -192,10 +311,32 @@ public open class ENetConnection : RefCounted() { public enum class EventType( id: Long, ) { + /** + * An error occurred during [service]. You will likely need to [destroy] the host and recreate + * it. + */ EVENT_ERROR(-1), + /** + * No event occurred within the specified time limit. + */ EVENT_NONE(0), + /** + * A connection request initiated by enet_host_connect has completed. The array will contain the + * peer which successfully connected. + */ EVENT_CONNECT(1), + /** + * A peer has disconnected. This event is generated on a successful completion of a disconnect + * initiated by [ENetPacketPeer.peerDisconnect], if a peer has timed out, or if a connection + * request initialized by [connectToHost] has timed out. The array will contain the peer which + * disconnected. The data field contains user supplied data describing the disconnection, or 0, if + * none is available. + */ EVENT_DISCONNECT(2), + /** + * A packet has been received from a peer. The array will contain the peer which sent the + * packet, the channel number upon which the packet was received, and the received packet. + */ EVENT_RECEIVE(3), ; @@ -212,9 +353,21 @@ public open class ENetConnection : RefCounted() { public enum class HostStatistic( id: Long, ) { + /** + * Total data sent. + */ HOST_TOTAL_SENT_DATA(0), + /** + * Total UDP packets sent. + */ HOST_TOTAL_SENT_PACKETS(1), + /** + * Total data received. + */ HOST_TOTAL_RECEIVED_DATA(2), + /** + * Total UDP packets received. + */ HOST_TOTAL_RECEIVED_PACKETS(3), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ENetMultiplayerPeer.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ENetMultiplayerPeer.kt index 68439ba76..141d8d690 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ENetMultiplayerPeer.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ENetMultiplayerPeer.kt @@ -23,8 +23,19 @@ import kotlin.Suppress import kotlin.Unit import kotlin.jvm.JvmOverloads +/** + * A MultiplayerPeer implementation that should be passed to [MultiplayerAPI.multiplayerPeer] after + * being initialized as either a client, server, or mesh. Events can then be handled by connecting to + * [MultiplayerAPI] signals. See [ENetConnection] for more information on the ENet library wrapper. + * **Note:** ENet only uses UDP, not TCP. When forwarding the server port to make your server + * accessible on the public Internet, you only need to forward the server port in UDP. You can use the + * [UPNP] class to try to forward the server port automatically when starting the server. + */ @GodotBaseType public open class ENetMultiplayerPeer : MultiplayerPeer() { + /** + * The underlying [ENetConnection] created after [createClient] and [createServer]. + */ public val host: ENetConnection? get() { TransferContext.writeArguments() @@ -37,6 +48,18 @@ public open class ENetMultiplayerPeer : MultiplayerPeer() { return true } + /** + * Create server that listens to connections via [param port]. The port needs to be an available, + * unused port between 0 and 65535. Note that ports below 1024 are privileged and may require + * elevated permissions depending on the platform. To change the interface the server listens on, use + * [setBindIp]. The default IP is the wildcard `"*"`, which listens on all available interfaces. + * [param max_clients] is the maximum number of clients that are allowed at once, any number up to + * 4095 may be used, although the achievable number of simultaneous clients may be far lower and + * depends on the application. For additional details on the bandwidth parameters, see + * [createClient]. Returns [constant OK] if a server was created, [constant ERR_ALREADY_IN_USE] if + * this ENetMultiplayerPeer instance already has an open connection (in which case you need to call + * [MultiplayerPeer.close] first) or [constant ERR_CANT_CREATE] if the server could not be created. + */ @JvmOverloads public fun createServer( port: Int, @@ -50,6 +73,22 @@ public open class ENetMultiplayerPeer : MultiplayerPeer() { return GodotError.from(TransferContext.readReturnValue(LONG) as Long) } + /** + * Create client that connects to a server at [param address] using specified [param port]. The + * given address needs to be either a fully qualified domain name (e.g. `"www.example.com"`) or an IP + * address in IPv4 or IPv6 format (e.g. `"192.168.1.1"`). The [param port] is the port the server is + * listening on. The [param channel_count] parameter can be used to specify the number of ENet + * channels allocated for the connection. The [param in_bandwidth] and [param out_bandwidth] + * parameters can be used to limit the incoming and outgoing bandwidth to the given number of bytes + * per second. The default of 0 means unlimited bandwidth. Note that ENet will strategically drop + * packets on specific sides of a connection between peers to ensure the peer's bandwidth is not + * overwhelmed. The bandwidth parameters also determine the window size of a connection which limits + * the amount of reliable packets that may be in transit at any given time. Returns [constant OK] if + * a client was created, [constant ERR_ALREADY_IN_USE] if this ENetMultiplayerPeer instance already + * has an open connection (in which case you need to call [MultiplayerPeer.close] first) or [constant + * ERR_CANT_CREATE] if the client could not be created. If [param local_port] is specified, the + * client will also listen to the given port; this is useful for some NAT traversal techniques. + */ @JvmOverloads public fun createClient( address: String, @@ -64,23 +103,44 @@ public open class ENetMultiplayerPeer : MultiplayerPeer() { return GodotError.from(TransferContext.readReturnValue(LONG) as Long) } + /** + * Initialize this [MultiplayerPeer] in mesh mode. The provided [param unique_id] will be used as + * the local peer network unique ID once assigned as the [MultiplayerAPI.multiplayerPeer]. In the + * mesh configuration you will need to set up each new peer manually using [ENetConnection] before + * calling [addMeshPeer]. While this technique is more advanced, it allows for better control over + * the connection process (e.g. when dealing with NAT punch-through) and for better distribution of + * the network load (which would otherwise be more taxing on the server). + */ public fun createMesh(uniqueId: Int): GodotError { TransferContext.writeArguments(LONG to uniqueId.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.createMeshPtr, LONG) return GodotError.from(TransferContext.readReturnValue(LONG) as Long) } + /** + * Add a new remote peer with the given [param peer_id] connected to the given [param host]. + * **Note:** The [param host] must have exactly one peer in the [constant + * ENetPacketPeer.STATE_CONNECTED] state. + */ public fun addMeshPeer(peerId: Int, host: ENetConnection): GodotError { TransferContext.writeArguments(LONG to peerId.toLong(), OBJECT to host) TransferContext.callMethod(rawPtr, MethodBindings.addMeshPeerPtr, LONG) return GodotError.from(TransferContext.readReturnValue(LONG) as Long) } + /** + * The IP used when creating a server. This is set to the wildcard `"*"` by default, which binds + * to all available interfaces. The given IP needs to be in IPv4 or IPv6 address format, for example: + * `"192.168.1.1"`. + */ public fun setBindIp(ip: String): Unit { TransferContext.writeArguments(STRING to ip) TransferContext.callMethod(rawPtr, MethodBindings.setBindIpPtr, NIL) } + /** + * Returns the [ENetPacketPeer] associated to the given [param id]. + */ public fun getPeer(id: Int): ENetPacketPeer? { TransferContext.writeArguments(LONG to id.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.getPeerPtr, OBJECT) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ENetPacketPeer.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ENetPacketPeer.kt index d128134ba..756cec84a 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ENetPacketPeer.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ENetPacketPeer.kt @@ -27,6 +27,14 @@ import kotlin.Suppress import kotlin.Unit import kotlin.jvm.JvmOverloads +/** + * A PacketPeer implementation representing a peer of an [ENetConnection]. + * This class cannot be instantiated directly but can be retrieved during [ENetConnection.service] + * or via [ENetConnection.getPeers]. + * **Note:** When exporting to Android, make sure to enable the `INTERNET` permission in the Android + * export preset before exporting the project or using one-click deploy. Otherwise, network + * communication of any kind will be blocked by Android. + */ @GodotBaseType public open class ENetPacketPeer internal constructor() : PacketPeer() { public override fun new(scriptIndex: Int): Boolean { @@ -34,39 +42,71 @@ public open class ENetPacketPeer internal constructor() : PacketPeer() { return true } + /** + * Request a disconnection from a peer. An [constant ENetConnection.EVENT_DISCONNECT] will be + * generated during [ENetConnection.service] once the disconnection is complete. + */ @JvmOverloads public fun peerDisconnect(`data`: Int = 0): Unit { TransferContext.writeArguments(LONG to data.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.peerDisconnectPtr, NIL) } + /** + * Request a disconnection from a peer, but only after all queued outgoing packets are sent. An + * [constant ENetConnection.EVENT_DISCONNECT] will be generated during [ENetConnection.service] once + * the disconnection is complete. + */ @JvmOverloads public fun peerDisconnectLater(`data`: Int = 0): Unit { TransferContext.writeArguments(LONG to data.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.peerDisconnectLaterPtr, NIL) } + /** + * Force an immediate disconnection from a peer. No [constant ENetConnection.EVENT_DISCONNECT] + * will be generated. The foreign peer is not guaranteed to receive the disconnect notification, and + * is reset immediately upon return from this function. + */ @JvmOverloads public fun peerDisconnectNow(`data`: Int = 0): Unit { TransferContext.writeArguments(LONG to data.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.peerDisconnectNowPtr, NIL) } + /** + * Sends a ping request to a peer. ENet automatically pings all connected peers at regular + * intervals, however, this function may be called to ensure more frequent ping requests. + */ public fun ping(): Unit { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.pingPtr, NIL) } + /** + * Sets the [param ping_interval] in milliseconds at which pings will be sent to a peer. Pings are + * used both to monitor the liveness of the connection and also to dynamically adjust the throttle + * during periods of low traffic so that the throttle has reasonable responsiveness during traffic + * spikes. The default ping interval is `500` milliseconds. + */ public fun pingInterval(pingInterval: Int): Unit { TransferContext.writeArguments(LONG to pingInterval.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.pingIntervalPtr, NIL) } + /** + * Forcefully disconnects a peer. The foreign host represented by the peer is not notified of the + * disconnection and will timeout on its connection to the local host. + */ public fun reset(): Unit { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.resetPtr, NIL) } + /** + * Queues a [param packet] to be sent over the specified [param channel]. See `FLAG_*` constants + * for available packet flags. + */ public fun send( channel: Int, packet: PackedByteArray, @@ -77,6 +117,23 @@ public open class ENetPacketPeer internal constructor() : PacketPeer() { return GodotError.from(TransferContext.readReturnValue(LONG) as Long) } + /** + * Configures throttle parameter for a peer. + * Unreliable packets are dropped by ENet in response to the varying conditions of the Internet + * connection to the peer. The throttle represents a probability that an unreliable packet should not + * be dropped and thus sent by ENet to the peer. By measuring fluctuations in round trip times of + * reliable packets over the specified [param interval], ENet will either increase the probability by + * the amount specified in the [param acceleration] parameter, or decrease it by the amount specified + * in the [param deceleration] parameter (both are ratios to [constant PACKET_THROTTLE_SCALE]). + * When the throttle has a value of [constant PACKET_THROTTLE_SCALE], no unreliable packets are + * dropped by ENet, and so 100% of all unreliable packets will be sent. + * When the throttle has a value of `0`, all unreliable packets are dropped by ENet, and so 0% + * of all unreliable packets will be sent. + * Intermediate values for the throttle represent intermediate probabilities between 0% and + * 100% of unreliable packets being sent. The bandwidth limits of the local and foreign hosts are + * taken into account to determine a sensible limit for the throttle probability above which it + * should not raise even in the best of conditions. + */ public fun throttleConfigure( interval: Int, acceleration: Int, @@ -86,6 +143,16 @@ public open class ENetPacketPeer internal constructor() : PacketPeer() { TransferContext.callMethod(rawPtr, MethodBindings.throttleConfigurePtr, NIL) } + /** + * Sets the timeout parameters for a peer. The timeout parameters control how and when a peer will + * timeout from a failure to acknowledge reliable traffic. Timeout values are expressed in + * milliseconds. + * The [param timeout] is a factor that, multiplied by a value based on the average round trip + * time, will determine the timeout limit for a reliable packet. When that limit is reached, the + * timeout will be doubled, and the peer will be disconnected if that limit has reached [param + * timeout_min]. The [param timeout_max] parameter, on the other hand, defines a fixed timeout for + * which any packet must be acknowledged or the peer will be dropped. + */ public fun setTimeout( timeout: Int, timeoutMin: Int, @@ -95,36 +162,55 @@ public open class ENetPacketPeer internal constructor() : PacketPeer() { TransferContext.callMethod(rawPtr, MethodBindings.setTimeoutPtr, NIL) } + /** + * Returns the IP address of this peer. + */ public fun getRemoteAddress(): String { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getRemoteAddressPtr, STRING) return (TransferContext.readReturnValue(STRING, false) as String) } + /** + * Returns the remote port of this peer. + */ public fun getRemotePort(): Int { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getRemotePortPtr, LONG) return (TransferContext.readReturnValue(LONG, false) as Long).toInt() } + /** + * Returns the requested [param statistic] for this peer. See [enum PeerStatistic]. + */ public fun getStatistic(statistic: PeerStatistic): Double { TransferContext.writeArguments(LONG to statistic.id) TransferContext.callMethod(rawPtr, MethodBindings.getStatisticPtr, DOUBLE) return (TransferContext.readReturnValue(DOUBLE, false) as Double) } + /** + * Returns the current peer state. See [enum PeerState]. + */ public fun getState(): PeerState { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getStatePtr, LONG) return ENetPacketPeer.PeerState.from(TransferContext.readReturnValue(LONG) as Long) } + /** + * Returns the number of channels allocated for communication with peer. + */ public fun getChannels(): Int { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getChannelsPtr, LONG) return (TransferContext.readReturnValue(LONG, false) as Long).toInt() } + /** + * Returns `true` if the peer is currently active (i.e. the associated [ENetConnection] is still + * valid). + */ public fun isActive(): Boolean { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.isActivePtr, BOOL) @@ -134,15 +220,47 @@ public open class ENetPacketPeer internal constructor() : PacketPeer() { public enum class PeerState( id: Long, ) { + /** + * The peer is disconnected. + */ STATE_DISCONNECTED(0), + /** + * The peer is currently attempting to connect. + */ STATE_CONNECTING(1), + /** + * The peer has acknowledged the connection request. + */ STATE_ACKNOWLEDGING_CONNECT(2), + /** + * The peer is currently connecting. + */ STATE_CONNECTION_PENDING(3), + /** + * The peer has successfully connected, but is not ready to communicate with yet ([constant + * STATE_CONNECTED]). + */ STATE_CONNECTION_SUCCEEDED(4), + /** + * The peer is currently connected and ready to communicate with. + */ STATE_CONNECTED(5), + /** + * The peer is slated to disconnect after it has no more outgoing packets to send. + */ STATE_DISCONNECT_LATER(6), + /** + * The peer is currently disconnecting. + */ STATE_DISCONNECTING(7), + /** + * The peer has acknowledged the disconnection request. + */ STATE_ACKNOWLEDGING_DISCONNECT(8), + /** + * The peer has lost connection, but is not considered truly disconnected (as the peer didn't + * acknowledge the disconnection request). + */ STATE_ZOMBIE(9), ; @@ -159,19 +277,72 @@ public open class ENetPacketPeer internal constructor() : PacketPeer() { public enum class PeerStatistic( id: Long, ) { + /** + * Mean packet loss of reliable packets as a ratio with respect to the [constant + * PACKET_LOSS_SCALE]. + */ PEER_PACKET_LOSS(0), + /** + * Packet loss variance. + */ PEER_PACKET_LOSS_VARIANCE(1), + /** + * The time at which packet loss statistics were last updated (in milliseconds since the + * connection started). The interval for packet loss statistics updates is 10 seconds, and at least + * one packet must have been sent since the last statistics update. + */ PEER_PACKET_LOSS_EPOCH(2), + /** + * Mean packet round trip time for reliable packets. + */ PEER_ROUND_TRIP_TIME(3), + /** + * Variance of the mean round trip time. + */ PEER_ROUND_TRIP_TIME_VARIANCE(4), + /** + * Last recorded round trip time for a reliable packet. + */ PEER_LAST_ROUND_TRIP_TIME(5), + /** + * Variance of the last trip time recorded. + */ PEER_LAST_ROUND_TRIP_TIME_VARIANCE(6), + /** + * The peer's current throttle status. + */ PEER_PACKET_THROTTLE(7), + /** + * The maximum number of unreliable packets that should not be dropped. This value is always + * greater than or equal to `1`. The initial value is equal to [constant PACKET_THROTTLE_SCALE]. + */ PEER_PACKET_THROTTLE_LIMIT(8), + /** + * Internal value used to increment the packet throttle counter. The value is hardcoded to `7` + * and cannot be changed. You probably want to look at [constant PEER_PACKET_THROTTLE_ACCELERATION] + * instead. + */ PEER_PACKET_THROTTLE_COUNTER(9), + /** + * The time at which throttle statistics were last updated (in milliseconds since the connection + * started). The interval for throttle statistics updates is [constant + * PEER_PACKET_THROTTLE_INTERVAL]. + */ PEER_PACKET_THROTTLE_EPOCH(10), + /** + * The throttle's acceleration factor. Higher values will make ENet adapt to fluctuating network + * conditions faster, causing unrelaible packets to be sent *more* often. The default value is `2`. + */ PEER_PACKET_THROTTLE_ACCELERATION(11), + /** + * The throttle's deceleration factor. Higher values will make ENet adapt to fluctuating network + * conditions faster, causing unrelaible packets to be sent *less* often. The default value is `2`. + */ PEER_PACKET_THROTTLE_DECELERATION(12), + /** + * The interval over which the lowest mean round trip time should be measured for use by the + * throttle mechanism (in milliseconds). The default value is `5000`. + */ PEER_PACKET_THROTTLE_INTERVAL(13), ; @@ -186,14 +357,31 @@ public open class ENetPacketPeer internal constructor() : PacketPeer() { } public companion object { + /** + * The reference scale for packet loss. See [getStatistic] and [constant PEER_PACKET_LOSS]. + */ public final const val PACKET_LOSS_SCALE: Long = 65536 + /** + * The reference value for throttle configuration. The default value is `32`. See + * [throttleConfigure]. + */ public final const val PACKET_THROTTLE_SCALE: Long = 32 + /** + * Mark the packet to be sent as reliable. + */ public final const val FLAG_RELIABLE: Long = 1 + /** + * Mark the packet to be sent unsequenced (unreliable). + */ public final const val FLAG_UNSEQUENCED: Long = 2 + /** + * Mark the packet to be sent unreliable even if the packet is too big and needs fragmentation + * (increasing the chance of it being dropped). + */ public final const val FLAG_UNRELIABLE_FRAGMENT: Long = 8 } diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/EncodedObjectAsID.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/EncodedObjectAsID.kt index ff9513f44..6e6f3714c 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/EncodedObjectAsID.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/EncodedObjectAsID.kt @@ -18,16 +18,17 @@ import kotlin.Long import kotlin.Suppress /** - * Holds a reference to an [godot.Object]'s instance ID. - * - * Utility class which holds a reference to the internal identifier of an [godot.Object] instance, as given by [godot.Object.getInstanceId]. This ID can then be used to retrieve the object instance with [@GlobalScope.instanceFromId]. - * - * This class is used internally by the editor inspector and script debugger, but can also be used in plugins to pass and display objects as their IDs. + * Utility class which holds a reference to the internal identifier of an [Object] instance, as + * given by [Object.getInstanceId]. This ID can then be used to retrieve the object instance with + * [@GlobalScope.instanceFromId]. + * This class is used internally by the editor inspector and script debugger, but can also be used + * in plugins to pass and display objects as their IDs. */ @GodotBaseType public open class EncodedObjectAsID : RefCounted() { /** - * The [godot.Object] identifier stored in this [godot.EncodedObjectAsID] instance. The object instance can be retrieved with [@GlobalScope.instanceFromId]. + * The [Object] identifier stored in this [EncodedObjectAsID] instance. The object instance can be + * retrieved with [@GlobalScope.instanceFromId]. */ public var objectId: Long get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Engine.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Engine.kt index 6b5d74f87..1389a9ff6 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Engine.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Engine.kt @@ -35,9 +35,8 @@ import kotlin.Suppress import kotlin.Unit /** - * Provides access to engine properties. - * - * The [godot.Engine] singleton allows you to query and modify the project's run-time parameters, such as frames per second, time scale, and others. + * The [Engine] singleton allows you to query and modify the project's run-time parameters, such as + * frames per second, time scale, and others. */ @GodotBaseType public object Engine : Object() { @@ -80,7 +79,8 @@ public object Engine : Object() { } /** - * Returns the fraction through the current physics tick we are at the time of rendering the frame. This can be used to implement fixed timestep interpolation. + * Returns the fraction through the current physics tick we are at the time of rendering the + * frame. This can be used to implement fixed timestep interpolation. */ public fun getPhysicsInterpolationFraction(): Double { TransferContext.writeArguments() @@ -111,7 +111,9 @@ public object Engine : Object() { } /** - * Returns the total number of frames drawn. On headless platforms, or if the render loop is disabled with `--disable-render-loop` via command line, [getFramesDrawn] always returns `0`. See [getProcessFrames]. + * Returns the total number of frames drawn. On headless platforms, or if the render loop is + * disabled with `--disable-render-loop` via command line, [getFramesDrawn] always returns `0`. See + * [getProcessFrames]. */ public fun getFramesDrawn(): Int { TransferContext.writeArguments() @@ -129,45 +131,28 @@ public object Engine : Object() { } /** - * Returns the total number of frames passed since engine initialization which is advanced on each **physics frame**. See also [getProcessFrames]. - * - * [getPhysicsFrames] can be used to run expensive logic less often without relying on a [godot.Timer]: - * - * [codeblocks] - * - * [gdscript] + * Returns the total number of frames passed since engine initialization which is advanced on each + * **physics frame**. See also [getProcessFrames]. + * [getPhysicsFrames] can be used to run expensive logic less often without relying on a [Timer]: * + * gdscript: + * ```gdscript * func _physics_process(_delta): - * - * if Engine.get_physics_frames() % 2 == 0: - * + * if Engine.get_physics_frames() % 2 == 0: * pass # Run expensive logic only once every 2 physics frames here. - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * public override void _PhysicsProcess(double delta) - * * { - * * base._PhysicsProcess(delta); * - * - * - * if (Engine.GetPhysicsFrames() % 2 == 0) - * + * if (Engine.GetPhysicsFrames() % 2 == 0) * { - * * // Run expensive logic only once every 2 physics frames here. - * * } - * * } - * - * [/csharp] - * - * [/codeblocks] + * ``` */ public fun getPhysicsFrames(): Long { TransferContext.writeArguments() @@ -176,45 +161,29 @@ public object Engine : Object() { } /** - * Returns the total number of frames passed since engine initialization which is advanced on each **process frame**, regardless of whether the render loop is enabled. See also [getFramesDrawn] and [getPhysicsFrames]. - * - * [getProcessFrames] can be used to run expensive logic less often without relying on a [godot.Timer]: - * - * [codeblocks] - * - * [gdscript] + * Returns the total number of frames passed since engine initialization which is advanced on each + * **process frame**, regardless of whether the render loop is enabled. See also [getFramesDrawn] and + * [getPhysicsFrames]. + * [getProcessFrames] can be used to run expensive logic less often without relying on a [Timer]: * + * gdscript: + * ```gdscript * func _process(_delta): - * - * if Engine.get_process_frames() % 2 == 0: - * + * if Engine.get_process_frames() % 2 == 0: * pass # Run expensive logic only once every 2 process (render) frames here. - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * public override void _Process(double delta) - * * { - * * base._Process(delta); * - * - * - * if (Engine.GetProcessFrames() % 2 == 0) - * + * if (Engine.GetProcessFrames() % 2 == 0) * { - * * // Run expensive logic only once every 2 physics frames here. - * * } - * * } - * - * [/csharp] - * - * [/codeblocks] + * ``` */ public fun getProcessFrames(): Long { TransferContext.writeArguments() @@ -223,7 +192,7 @@ public object Engine : Object() { } /** - * Returns the main loop object (see [godot.MainLoop] and [godot.SceneTree]). + * Returns the main loop object (see [MainLoop] and [SceneTree]). */ public fun getMainLoop(): MainLoop? { TransferContext.writeArguments() @@ -233,62 +202,39 @@ public object Engine : Object() { /** * Returns the current engine version information in a Dictionary. - * * `major` - Holds the major version number as an int - * * `minor` - Holds the minor version number as an int - * * `patch` - Holds the patch version number as an int - * - * `hex` - Holds the full version number encoded as a hexadecimal int with one byte (2 places) per number (see example below) - * + * `hex` - Holds the full version number encoded as a hexadecimal int with one byte (2 + * places) per number (see example below) * `status` - Holds the status (e.g. "beta", "rc1", "rc2", ... "stable") as a String - * * `build` - Holds the build name (e.g. "custom_build") as a String - * * `hash` - Holds the full Git commit hash as a String - * * `year` - Holds the year the version was released in as an int - * * `string` - `major` + `minor` + `patch` + `status` + `build` in a single String + * The `hex` value is encoded as follows, from left to right: one byte for the major, one byte for + * the minor, one byte for the patch version. For example, "3.1.12" would be `0x03010C`. **Note:** + * It's still an int internally, and printing it will give you its decimal representation, which is + * not particularly meaningful. Use hexadecimal literals for easy version comparisons from code: * - * The `hex` value is encoded as follows, from left to right: one byte for the major, one byte for the minor, one byte for the patch version. For example, "3.1.12" would be `0x03010C`. **Note:** It's still an int internally, and printing it will give you its decimal representation, which is not particularly meaningful. Use hexadecimal literals for easy version comparisons from code: - * - * [codeblocks] - * - * [gdscript] - * + * gdscript: + * ```gdscript * if Engine.get_version_info().hex >= 0x030200: - * * # Do things specific to version 3.2 or later - * * else: - * * # Do things specific to versions before 3.2 - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * if ((int)Engine.GetVersionInfo()["hex"] >= 0x030200) - * * { - * * // Do things specific to version 3.2 or later - * * } - * * else - * * { - * * // Do things specific to versions before 3.2 - * * } - * - * [/csharp] - * - * [/codeblocks] + * ``` */ public fun getVersionInfo(): Dictionary { TransferContext.writeArguments() @@ -298,13 +244,9 @@ public object Engine : Object() { /** * Returns engine author information in a Dictionary. - * * `lead_developers` - Array of Strings, lead developer names - * * `founders` - Array of Strings, founder names - * * `project_managers` - Array of Strings, project manager names - * * `developers` - Array of Strings, developer names */ public fun getAuthorInfo(): Dictionary { @@ -315,10 +257,9 @@ public object Engine : Object() { /** * Returns an Array of copyright information Dictionaries. - * * `name` - String, component name - * - * `parts` - Array of Dictionaries {`files`, `copyright`, `license`} describing subsections of the component + * `parts` - Array of Dictionaries {`files`, `copyright`, `license`} describing subsections of + * the component */ public fun getCopyrightInfo(): VariantArray> { TransferContext.writeArguments() @@ -328,8 +269,8 @@ public object Engine : Object() { /** * Returns a Dictionary of Arrays of donor names. - * - * {`platinum_sponsors`, `gold_sponsors`, `silver_sponsors`, `bronze_sponsors`, `mini_sponsors`, `gold_donors`, `silver_donors`, `bronze_donors`} + * {`platinum_sponsors`, `gold_sponsors`, `silver_sponsors`, `bronze_sponsors`, `mini_sponsors`, + * `gold_donors`, `silver_donors`, `bronze_donors`} */ public fun getDonorInfo(): Dictionary { TransferContext.writeArguments() @@ -356,39 +297,29 @@ public object Engine : Object() { } /** - * Returns the name of the CPU architecture the Godot binary was built for. Possible return values are `x86_64`, `x86_32`, `arm64`, `arm32`, `rv64`, `riscv`, `ppc64`, `ppc`, `wasm64` and `wasm32`. - * - * To detect whether the current CPU architecture is 64-bit, you can use the fact that all 64-bit architecture names have `64` in their name: - * - * [codeblocks] - * - * [gdscript] + * Returns the name of the CPU architecture the Godot binary was built for. Possible return values + * are `x86_64`, `x86_32`, `arm64`, `arm32`, `rv64`, `riscv`, `ppc64`, `ppc`, `wasm64` and `wasm32`. + * To detect whether the current CPU architecture is 64-bit, you can use the fact that all 64-bit + * architecture names have `64` in their name: * + * gdscript: + * ```gdscript * if "64" in Engine.get_architecture_name(): - * * print("Running a 64-bit build of Godot.") - * * else: - * * print("Running a 32-bit build of Godot.") - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * if (Engine.GetArchitectureName().Contains("64")) - * * GD.Print("Running a 64-bit build of Godot."); - * * else - * * GD.Print("Running a 32-bit build of Godot."); + * ``` * - * [/csharp] - * - * [/codeblocks] - * - * **Note:** [getArchitectureName] does *not* return the name of the host CPU architecture. For example, if running an x86_32 Godot binary on a x86_64 system, the returned value will be `x86_32`. + * **Note:** [getArchitectureName] does *not* return the name of the host CPU architecture. For + * example, if running an x86_32 Godot binary on a x86_64 system, the returned value will be + * `x86_32`. */ public fun getArchitectureName(): String { TransferContext.writeArguments() @@ -406,7 +337,7 @@ public object Engine : Object() { } /** - * Returns `true` if a singleton with given [name] exists in global scope. + * Returns `true` if a singleton with given [param name] exists in global scope. */ public fun hasSingleton(name: StringName): Boolean { TransferContext.writeArguments(STRING_NAME to name) @@ -415,7 +346,7 @@ public object Engine : Object() { } /** - * Returns a global singleton with given [name]. Often used for plugins, e.g. GodotPayments. + * Returns a global singleton with given [param name]. Often used for plugins, e.g. GodotPayments. */ public fun getSingleton(name: StringName): Object? { TransferContext.writeArguments(STRING_NAME to name) @@ -424,7 +355,7 @@ public object Engine : Object() { } /** - * Registers the given object as a singleton, globally available under [name]. + * Registers the given object as a singleton, globally available under [param name]. */ public fun registerSingleton(name: StringName, instance: Object): Unit { TransferContext.writeArguments(STRING_NAME to name, OBJECT to instance) @@ -432,7 +363,8 @@ public object Engine : Object() { } /** - * Unregisters the singleton registered under [name]. The singleton object is not freed. Only works with user-defined singletons created with [registerSingleton]. + * Unregisters the singleton registered under [param name]. The singleton object is not freed. + * Only works with user-defined singletons created with [registerSingleton]. */ public fun unregisterSingleton(name: StringName): Unit { TransferContext.writeArguments(STRING_NAME to name) @@ -449,15 +381,13 @@ public object Engine : Object() { } /** - * Registers a [godot.ScriptLanguage] instance to be available with `ScriptServer`. - * + * Registers a [ScriptLanguage] instance to be available with `ScriptServer`. * Returns: - * - * - [OK] on success - * - * - [ERR_UNAVAILABLE] if `ScriptServer` has reached it limit and cannot register any new language - * - * - [ERR_ALREADY_EXISTS] if `ScriptServer` already contains a language with similar extension/name/type + * - [constant OK] on success + * - [constant ERR_UNAVAILABLE] if `ScriptServer` has reached it limit and cannot register any new + * language + * - [constant ERR_ALREADY_EXISTS] if `ScriptServer` already contains a language with similar + * extension/name/type */ public fun registerScriptLanguage(language: ScriptLanguage): GodotError { TransferContext.writeArguments(OBJECT to language) @@ -466,13 +396,10 @@ public object Engine : Object() { } /** - * Unregisters the [godot.ScriptLanguage] instance from `ScriptServer`. - * + * Unregisters the [ScriptLanguage] instance from `ScriptServer`. * Returns: - * - * - [OK] on success - * - * - [ERR_DOES_NOT_EXIST] if the language is already not registered in `ScriptServer` + * - [constant OK] on success + * - [constant ERR_DOES_NOT_EXIST] if the language is already not registered in `ScriptServer` */ public fun unregisterScriptLanguage(language: ScriptLanguage): GodotError { TransferContext.writeArguments(OBJECT to language) @@ -490,7 +417,7 @@ public object Engine : Object() { } /** - * Returns an instance of a [godot.ScriptLanguage] with the given index. + * Returns an instance of a [ScriptLanguage] with the given index. */ public fun getScriptLanguage(index: Int): ScriptLanguage? { TransferContext.writeArguments(LONG to index.toLong()) @@ -499,39 +426,32 @@ public object Engine : Object() { } /** - * Returns `true` if the script is currently running inside the editor, `false` otherwise. This is useful for `@tool` scripts to conditionally draw editor helpers, or prevent accidentally running "game" code that would affect the scene state while in the editor: - * - * [codeblocks] - * - * [gdscript] + * Returns `true` if the script is currently running inside the editor, `false` otherwise. This is + * useful for `@tool` scripts to conditionally draw editor helpers, or prevent accidentally running + * "game" code that would affect the scene state while in the editor: * + * gdscript: + * ```gdscript * if Engine.is_editor_hint(): - * * draw_gizmos() - * * else: - * * simulate_physics() - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * if (Engine.IsEditorHint()) - * * DrawGizmos(); - * * else - * * SimulatePhysics(); - * - * [/csharp] - * - * [/codeblocks] - * - * See [godot.Running code in the editor]($DOCS_URL/tutorials/plugins/running_code_in_the_editor.html) in the documentation for more information. - * - * **Note:** To detect whether the script is run from an editor *build* (e.g. when pressing [kbd]F5[/kbd]), use [godot.OS.hasFeature] with the `"editor"` argument instead. `OS.has_feature("editor")` will evaluate to `true` both when the code is running in the editor and when running the project from the editor, but it will evaluate to `false` when the code is run from an exported project. + * ``` + * + * See [url=$DOCS_URL/tutorials/plugins/running_code_in_the_editor.html]Running code in the + * editor[/url] in the documentation for more information. + * **Note:** To detect whether the script is run from an editor *build* (e.g. when pressing + * [kbd]F5[/kbd]), use [OS.hasFeature] with the `"editor"` argument instead. + * `OS.has_feature("editor")` will evaluate to `true` both when the code is running in the editor and + * when running the project from the editor, but it will evaluate to `false` when the code is run + * from an exported project. */ public fun isEditorHint(): Boolean { TransferContext.writeArguments() @@ -540,7 +460,9 @@ public object Engine : Object() { } /** - * Returns the path to the [godot.MovieWriter]'s output file, or an empty string if the engine wasn't started in Movie Maker mode. This path can be absolute or relative depending on how the user specified it. + * Returns the path to the [MovieWriter]'s output file, or an empty string if the engine wasn't + * started in Movie Maker mode. This path can be absolute or relative depending on how the user + * specified it. */ public fun getWriteMoviePath(): String { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/EngineDebugger.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/EngineDebugger.kt index 25930b539..8f5c1bb26 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/EngineDebugger.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/EngineDebugger.kt @@ -29,9 +29,8 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * Exposes the internal debugger. - * - * [godot.EngineDebugger] handles the communication between the editor and the running game. It is active in the running game. Messages can be sent/received through it. It also manages the profilers. + * [EngineDebugger] handles the communication between the editor and the running game. It is active + * in the running game. Messages can be sent/received through it. It also manages the profilers. */ @GodotBaseType public object EngineDebugger : Object() { @@ -50,7 +49,7 @@ public object EngineDebugger : Object() { } /** - * Registers a profiler with the given [name]. See [godot.EngineProfiler] for more information. + * Registers a profiler with the given [param name]. See [EngineProfiler] for more information. */ public fun registerProfiler(name: StringName, profiler: EngineProfiler): Unit { TransferContext.writeArguments(STRING_NAME to name, OBJECT to profiler) @@ -58,7 +57,7 @@ public object EngineDebugger : Object() { } /** - * Unregisters a profiler with given [name]. + * Unregisters a profiler with given [param name]. */ public fun unregisterProfiler(name: StringName): Unit { TransferContext.writeArguments(STRING_NAME to name) @@ -84,7 +83,7 @@ public object EngineDebugger : Object() { } /** - * Calls the `add` callable of the profiler with given [name] and [data]. + * Calls the `add` callable of the profiler with given [param name] and [param data]. */ public fun profilerAddFrameData(name: StringName, `data`: VariantArray): Unit { TransferContext.writeArguments(STRING_NAME to name, ARRAY to data) @@ -92,7 +91,8 @@ public object EngineDebugger : Object() { } /** - * Calls the `toggle` callable of the profiler with given [name] and [arguments]. Enables/Disables the same profiler depending on [enable] argument. + * Calls the `toggle` callable of the profiler with given [param name] and [param arguments]. + * Enables/Disables the same profiler depending on [param enable] argument. */ @JvmOverloads public fun profilerEnable( @@ -105,9 +105,10 @@ public object EngineDebugger : Object() { } /** - * Registers a message capture with given [name]. If [name] is "my_message" then messages starting with "my_message:" will be called with the given callable. - * - * Callable must accept a message string and a data array as argument. If the message and data are valid then callable must return `true` otherwise `false`. + * Registers a message capture with given [param name]. If [param name] is "my_message" then + * messages starting with "my_message:" will be called with the given callable. + * Callable must accept a message string and a data array as argument. If the message and data are + * valid then callable must return `true` otherwise `false`. */ public fun registerMessageCapture(name: StringName, callable: Callable): Unit { TransferContext.writeArguments(STRING_NAME to name, CALLABLE to callable) @@ -115,7 +116,7 @@ public object EngineDebugger : Object() { } /** - * Unregisters the message capture with given [name]. + * Unregisters the message capture with given [param name]. */ public fun unregisterMessageCapture(name: StringName): Unit { TransferContext.writeArguments(STRING_NAME to name) @@ -132,7 +133,7 @@ public object EngineDebugger : Object() { } /** - * Sends a message with given [message] and [data] array. + * Sends a message with given [param message] and [param data] array. */ public fun sendMessage(message: String, `data`: VariantArray): Unit { TransferContext.writeArguments(STRING to message, ARRAY to data) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/EngineProfiler.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/EngineProfiler.kt index 0dc18fddb..d6b83478a 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/EngineProfiler.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/EngineProfiler.kt @@ -18,11 +18,9 @@ import kotlin.Suppress import kotlin.Unit /** - * Base class for creating custom profilers. - * - * This class can be used to implement custom profilers that are able to interact with the engine and editor debugger. - * - * See [godot.EngineDebugger] and [godot.EditorDebuggerPlugin] for more information. + * This class can be used to implement custom profilers that are able to interact with the engine + * and editor debugger. + * See [EngineDebugger] and [EditorDebuggerPlugin] for more information. */ @GodotBaseType public open class EngineProfiler : RefCounted() { @@ -32,19 +30,21 @@ public open class EngineProfiler : RefCounted() { } /** - * Called when the profiler is enabled/disabled, along with a set of [options]. + * Called when the profiler is enabled/disabled, along with a set of [param options]. */ public open fun _toggle(enable: Boolean, options: VariantArray): Unit { } /** - * Called when data is added to profiler using [godot.EngineDebugger.profilerAddFrameData]. + * Called when data is added to profiler using [EngineDebugger.profilerAddFrameData]. */ public open fun _addFrame(`data`: VariantArray): Unit { } /** - * Called once every engine iteration when the profiler is active with information about the current frame. All time values are in seconds. Lower values represent faster processing times and are therefore considered better. + * Called once every engine iteration when the profiler is active with information about the + * current frame. All time values are in seconds. Lower values represent faster processing times and + * are therefore considered better. */ public open fun _tick( frameTime: Double, diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Environment.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Environment.kt index dc88cf78a..961799748 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Environment.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Environment.kt @@ -30,19 +30,12 @@ import kotlin.Suppress import kotlin.Unit /** - * Resource for environment nodes (like [godot.WorldEnvironment]) that define multiple rendering options. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/678](https://godotengine.org/asset-library/asset/678) - * - * Resource for environment nodes (like [godot.WorldEnvironment]) that define multiple environment operations (such as background [godot.Sky] or [godot.core.Color], ambient light, fog, depth-of-field...). These parameters affect the final render of the scene. The order of these operations is: - * + * Resource for environment nodes (like [WorldEnvironment]) that define multiple environment + * operations (such as background [Sky] or [Color], ambient light, fog, depth-of-field...). These + * parameters affect the final render of the scene. The order of these operations is: * - Depth of Field Blur - * * - Glow - * * - Tonemap (Auto Exposure) - * * - Adjustments */ @GodotBaseType @@ -62,7 +55,8 @@ public open class Environment : Resource() { } /** - * The [godot.core.Color] displayed for clear areas of the scene. Only effective when using the [BG_COLOR] background mode. + * The [Color] displayed for clear areas of the scene. Only effective when using the [constant + * BG_COLOR] background mode. */ @CoreTypeLocalCopy public var backgroundColor: Color @@ -77,7 +71,8 @@ public open class Environment : Resource() { } /** - * Multiplier for background energy. Increase to make background brighter, decrease to make background dimmer. + * Multiplier for background energy. Increase to make background brighter, decrease to make + * background dimmer. */ public var backgroundEnergyMultiplier: Float get() { @@ -91,7 +86,9 @@ public open class Environment : Resource() { } /** - * Luminance of background measured in nits (candela per square meter). Only used when [godot.ProjectSettings.rendering/lightsAndShadows/usePhysicalLightUnits] is enabled. The default value is roughly equivalent to the sky at midday. + * Luminance of background measured in nits (candela per square meter). Only used when + * [ProjectSettings.rendering/lightsAndShadows/usePhysicalLightUnits] is enabled. The default value + * is roughly equivalent to the sky at midday. */ public var backgroundIntensity: Float get() { @@ -105,7 +102,8 @@ public open class Environment : Resource() { } /** - * The maximum layer ID to display. Only effective when using the [BG_CANVAS] background mode. + * The maximum layer ID to display. Only effective when using the [constant BG_CANVAS] background + * mode. */ public var backgroundCanvasMaxLayer: Int get() { @@ -133,7 +131,7 @@ public open class Environment : Resource() { } /** - * The [godot.Sky] resource used for this [godot.Environment]. + * The [Sky] resource used for this [Environment]. */ public var sky: Sky? get() { @@ -147,7 +145,8 @@ public open class Environment : Resource() { } /** - * If set to a value greater than `0.0`, overrides the field of view to use for sky rendering. If set to `0.0`, the same FOV as the current [godot.Camera3D] is used for sky rendering. + * If set to a value greater than `0.0`, overrides the field of view to use for sky rendering. If + * set to `0.0`, the same FOV as the current [Camera3D] is used for sky rendering. */ public var skyCustomFov: Float get() { @@ -190,7 +189,8 @@ public open class Environment : Resource() { } /** - * The ambient light's [godot.core.Color]. Only effective if [ambientLightSkyContribution] is lower than `1.0` (exclusive). + * The ambient light's [Color]. Only effective if [ambientLightSkyContribution] is lower than + * `1.0` (exclusive). */ @CoreTypeLocalCopy public var ambientLightColor: Color @@ -205,9 +205,13 @@ public open class Environment : Resource() { } /** - * Defines the amount of light that the sky brings on the scene. A value of `0.0` means that the sky's light emission has no effect on the scene illumination, thus all ambient illumination is provided by the ambient light. On the contrary, a value of `1.0` means that *all* the light that affects the scene is provided by the sky, thus the ambient light parameter has no effect on the scene. - * - * **Note:** [ambientLightSkyContribution] is internally clamped between `0.0` and `1.0` (inclusive). + * Defines the amount of light that the sky brings on the scene. A value of `0.0` means that the + * sky's light emission has no effect on the scene illumination, thus all ambient illumination is + * provided by the ambient light. On the contrary, a value of `1.0` means that *all* the light that + * affects the scene is provided by the sky, thus the ambient light parameter has no effect on the + * scene. + * **Note:** [ambientLightSkyContribution] is internally clamped between `0.0` and `1.0` + * (inclusive). */ public var ambientLightSkyContribution: Float get() { @@ -221,7 +225,8 @@ public open class Environment : Resource() { } /** - * The ambient light's energy. The higher the value, the stronger the light. Only effective if [ambientLightSkyContribution] is lower than `1.0` (exclusive). + * The ambient light's energy. The higher the value, the stronger the light. Only effective if + * [ambientLightSkyContribution] is lower than `1.0` (exclusive). */ public var ambientLightEnergy: Float get() { @@ -249,7 +254,8 @@ public open class Environment : Resource() { } /** - * The tonemapping mode to use. Tonemapping is the process that "converts" HDR values to be suitable for rendering on a LDR display. (Godot doesn't support rendering on HDR displays yet.) + * The tonemapping mode to use. Tonemapping is the process that "converts" HDR values to be + * suitable for rendering on a LDR display. (Godot doesn't support rendering on HDR displays yet.) */ public var tonemapMode: ToneMapper get() { @@ -263,7 +269,8 @@ public open class Environment : Resource() { } /** - * The default exposure used for tonemapping. Higher values result in a brighter image. See also [tonemapWhite]. + * The default exposure used for tonemapping. Higher values result in a brighter image. See also + * [tonemapWhite]. */ public var tonemapExposure: Float get() { @@ -277,7 +284,10 @@ public open class Environment : Resource() { } /** - * The white reference value for tonemapping (also called "whitepoint"). Higher values can make highlights look less blown out, and will also slightly darken the whole scene as a result. Only effective if the [tonemapMode] isn't set to [TONE_MAPPER_LINEAR]. See also [tonemapExposure]. + * The white reference value for tonemapping (also called "whitepoint"). Higher values can make + * highlights look less blown out, and will also slightly darken the whole scene as a result. Only + * effective if the [tonemapMode] isn't set to [constant TONE_MAPPER_LINEAR]. See also + * [tonemapExposure]. */ public var tonemapWhite: Float get() { @@ -291,8 +301,9 @@ public open class Environment : Resource() { } /** - * If `true`, screen-space reflections are enabled. Screen-space reflections are more accurate than reflections from [godot.VoxelGI]s or [godot.ReflectionProbe]s, but are slower and can't reflect surfaces occluded by others. - * + * If `true`, screen-space reflections are enabled. Screen-space reflections are more accurate + * than reflections from [VoxelGI]s or [ReflectionProbe]s, but are slower and can't reflect surfaces + * occluded by others. * **Note:** SSR is only supported in the Forward+ rendering method, not Mobile or Compatibility. */ public var ssrEnabled: Boolean @@ -321,7 +332,9 @@ public open class Environment : Resource() { } /** - * The fade-in distance for screen-space reflections. Affects the area from the reflected material to the screen-space reflection. Only positive values are valid (negative values will be clamped to `0.0`). + * The fade-in distance for screen-space reflections. Affects the area from the reflected material + * to the screen-space reflection. Only positive values are valid (negative values will be clamped to + * `0.0`). */ public var ssrFadeIn: Float get() { @@ -335,7 +348,9 @@ public open class Environment : Resource() { } /** - * The fade-out distance for screen-space reflections. Affects the area from the screen-space reflection to the "global" reflection. Only positive values are valid (negative values will be clamped to `0.0`). + * The fade-out distance for screen-space reflections. Affects the area from the screen-space + * reflection to the "global" reflection. Only positive values are valid (negative values will be + * clamped to `0.0`). */ public var ssrFadeOut: Float get() { @@ -363,8 +378,11 @@ public open class Environment : Resource() { } /** - * If `true`, the screen-space ambient occlusion effect is enabled. This darkens objects' corners and cavities to simulate ambient light not reaching the entire object as in real life. This works well for small, dynamic objects, but baked lighting or ambient occlusion textures will do a better job at displaying ambient occlusion on large static objects. Godot uses a form of SSAO called Adaptive Screen Space Ambient Occlusion which is itself a form of Horizon Based Ambient Occlusion. - * + * If `true`, the screen-space ambient occlusion effect is enabled. This darkens objects' corners + * and cavities to simulate ambient light not reaching the entire object as in real life. This works + * well for small, dynamic objects, but baked lighting or ambient occlusion textures will do a better + * job at displaying ambient occlusion on large static objects. Godot uses a form of SSAO called + * Adaptive Screen Space Ambient Occlusion which is itself a form of Horizon Based Ambient Occlusion. * **Note:** SSAO is only supported in the Forward+ rendering method, not Mobile or Compatibility. */ public var ssaoEnabled: Boolean @@ -379,7 +397,9 @@ public open class Environment : Resource() { } /** - * The distance at which objects can occlude each other when calculating screen-space ambient occlusion. Higher values will result in occlusion over a greater distance at the cost of performance and quality. + * The distance at which objects can occlude each other when calculating screen-space ambient + * occlusion. Higher values will result in occlusion over a greater distance at the cost of + * performance and quality. */ public var ssaoRadius: Float get() { @@ -393,7 +413,8 @@ public open class Environment : Resource() { } /** - * The primary screen-space ambient occlusion intensity. Acts as a multiplier for the screen-space ambient occlusion effect. A higher value results in darker occlusion. + * The primary screen-space ambient occlusion intensity. Acts as a multiplier for the screen-space + * ambient occlusion effect. A higher value results in darker occlusion. */ public var ssaoIntensity: Float get() { @@ -407,7 +428,8 @@ public open class Environment : Resource() { } /** - * The distribution of occlusion. A higher value results in darker occlusion, similar to [ssaoIntensity], but with a sharper falloff. + * The distribution of occlusion. A higher value results in darker occlusion, similar to + * [ssaoIntensity], but with a sharper falloff. */ public var ssaoPower: Float get() { @@ -421,7 +443,9 @@ public open class Environment : Resource() { } /** - * Sets the strength of the additional level of detail for the screen-space ambient occlusion effect. A high value makes the detail pass more prominent, but it may contribute to aliasing in your final image. + * Sets the strength of the additional level of detail for the screen-space ambient occlusion + * effect. A high value makes the detail pass more prominent, but it may contribute to aliasing in + * your final image. */ public var ssaoDetail: Float get() { @@ -435,7 +459,9 @@ public open class Environment : Resource() { } /** - * The threshold for considering whether a given point on a surface is occluded or not represented as an angle from the horizon mapped into the `0.0-1.0` range. A value of `1.0` results in no occlusion. + * The threshold for considering whether a given point on a surface is occluded or not represented + * as an angle from the horizon mapped into the `0.0-1.0` range. A value of `1.0` results in no + * occlusion. */ public var ssaoHorizon: Float get() { @@ -449,7 +475,9 @@ public open class Environment : Resource() { } /** - * The amount that the screen-space ambient occlusion effect is allowed to blur over the edges of objects. Setting too high will result in aliasing around the edges of objects. Setting too low will make object edges appear blurry. + * The amount that the screen-space ambient occlusion effect is allowed to blur over the edges of + * objects. Setting too high will result in aliasing around the edges of objects. Setting too low + * will make object edges appear blurry. */ public var ssaoSharpness: Float get() { @@ -463,7 +491,9 @@ public open class Environment : Resource() { } /** - * The screen-space ambient occlusion intensity in direct light. In real life, ambient occlusion only applies to indirect light, which means its effects can't be seen in direct light. Values higher than `0` will make the SSAO effect visible in direct light. + * The screen-space ambient occlusion intensity in direct light. In real life, ambient occlusion + * only applies to indirect light, which means its effects can't be seen in direct light. Values + * higher than `0` will make the SSAO effect visible in direct light. */ public var ssaoLightAffect: Float get() { @@ -477,7 +507,8 @@ public open class Environment : Resource() { } /** - * The screen-space ambient occlusion intensity on materials that have an AO texture defined. Values higher than `0` will make the SSAO effect visible in areas darkened by AO textures. + * The screen-space ambient occlusion intensity on materials that have an AO texture defined. + * Values higher than `0` will make the SSAO effect visible in areas darkened by AO textures. */ public var ssaoAoChannelAffect: Float get() { @@ -491,8 +522,12 @@ public open class Environment : Resource() { } /** - * If `true`, the screen-space indirect lighting effect is enabled. Screen space indirect lighting is a form of indirect lighting that allows diffuse light to bounce between nearby objects. Screen-space indirect lighting works very similarly to screen-space ambient occlusion, in that it only affects a limited range. It is intended to be used along with a form of proper global illumination like SDFGI or [godot.VoxelGI]. Screen-space indirect lighting is not affected by individual light's [godot.Light3D.lightIndirectEnergy]. - * + * If `true`, the screen-space indirect lighting effect is enabled. Screen space indirect lighting + * is a form of indirect lighting that allows diffuse light to bounce between nearby objects. + * Screen-space indirect lighting works very similarly to screen-space ambient occlusion, in that it + * only affects a limited range. It is intended to be used along with a form of proper global + * illumination like SDFGI or [VoxelGI]. Screen-space indirect lighting is not affected by individual + * light's [Light3D.lightIndirectEnergy]. * **Note:** SSIL is only supported in the Forward+ rendering method, not Mobile or Compatibility. */ public var ssilEnabled: Boolean @@ -507,7 +542,9 @@ public open class Environment : Resource() { } /** - * The distance that bounced lighting can travel when using the screen space indirect lighting effect. A larger value will result in light bouncing further in a scene, but may result in under-sampling artifacts which look like long spikes surrounding light sources. + * The distance that bounced lighting can travel when using the screen space indirect lighting + * effect. A larger value will result in light bouncing further in a scene, but may result in + * under-sampling artifacts which look like long spikes surrounding light sources. */ public var ssilRadius: Float get() { @@ -521,7 +558,8 @@ public open class Environment : Resource() { } /** - * The brightness multiplier for the screen-space indirect lighting effect. A higher value will result in brighter light. + * The brightness multiplier for the screen-space indirect lighting effect. A higher value will + * result in brighter light. */ public var ssilIntensity: Float get() { @@ -535,7 +573,9 @@ public open class Environment : Resource() { } /** - * The amount that the screen-space indirect lighting effect is allowed to blur over the edges of objects. Setting too high will result in aliasing around the edges of objects. Setting too low will make object edges appear blurry. + * The amount that the screen-space indirect lighting effect is allowed to blur over the edges of + * objects. Setting too high will result in aliasing around the edges of objects. Setting too low + * will make object edges appear blurry. */ public var ssilSharpness: Float get() { @@ -549,7 +589,12 @@ public open class Environment : Resource() { } /** - * Amount of normal rejection used when calculating screen-space indirect lighting. Normal rejection uses the normal of a given sample point to reject samples that are facing away from the current pixel. Normal rejection is necessary to avoid light leaking when only one side of an object is illuminated. However, normal rejection can be disabled if light leaking is desirable, such as when the scene mostly contains emissive objects that emit light from faces that cannot be seen from the camera. + * Amount of normal rejection used when calculating screen-space indirect lighting. Normal + * rejection uses the normal of a given sample point to reject samples that are facing away from the + * current pixel. Normal rejection is necessary to avoid light leaking when only one side of an + * object is illuminated. However, normal rejection can be disabled if light leaking is desirable, + * such as when the scene mostly contains emissive objects that emit light from faces that cannot be + * seen from the camera. */ public var ssilNormalRejection: Float get() { @@ -563,13 +608,20 @@ public open class Environment : Resource() { } /** - * If `true`, enables signed distance field global illumination for meshes that have their [godot.GeometryInstance3D.giMode] set to [godot.GeometryInstance3D.GI_MODE_STATIC]. SDFGI is a real-time global illumination technique that works well with procedurally generated and user-built levels, including in situations where geometry is created during gameplay. The signed distance field is automatically generated around the camera as it moves. Dynamic lights are supported, but dynamic occluders and emissive surfaces are not. - * - * **Note:** SDFGI is only supported in the Forward+ rendering method, not Mobile or Compatibility. - * - * **Performance:** SDFGI is relatively demanding on the GPU and is not suited to low-end hardware such as integrated graphics (consider [godot.LightmapGI] instead). To improve SDFGI performance, enable [godot.ProjectSettings.rendering/globalIllumination/gi/useHalfResolution] in the Project Settings. - * - * **Note:** Meshes should have sufficiently thick walls to avoid light leaks (avoid one-sided walls). For interior levels, enclose your level geometry in a sufficiently large box and bridge the loops to close the mesh. + * If `true`, enables signed distance field global illumination for meshes that have their + * [GeometryInstance3D.giMode] set to [constant GeometryInstance3D.GI_MODE_STATIC]. SDFGI is a + * real-time global illumination technique that works well with procedurally generated and user-built + * levels, including in situations where geometry is created during gameplay. The signed distance + * field is automatically generated around the camera as it moves. Dynamic lights are supported, but + * dynamic occluders and emissive surfaces are not. + * **Note:** SDFGI is only supported in the Forward+ rendering method, not Mobile or + * Compatibility. + * **Performance:** SDFGI is relatively demanding on the GPU and is not suited to low-end hardware + * such as integrated graphics (consider [LightmapGI] instead). To improve SDFGI performance, enable + * [ProjectSettings.rendering/globalIllumination/gi/useHalfResolution] in the Project Settings. + * **Note:** Meshes should have sufficiently thick walls to avoid light leaks (avoid one-sided + * walls). For interior levels, enclose your level geometry in a sufficiently large box and bridge + * the loops to close the mesh. */ public var sdfgiEnabled: Boolean get() { @@ -583,7 +635,9 @@ public open class Environment : Resource() { } /** - * If `true`, SDFGI uses an occlusion detection approach to reduce light leaking. Occlusion may however introduce dark blotches in certain spots, which may be undesired in mostly outdoor scenes. [sdfgiUseOcclusion] has a performance impact and should only be enabled when needed. + * If `true`, SDFGI uses an occlusion detection approach to reduce light leaking. Occlusion may + * however introduce dark blotches in certain spots, which may be undesired in mostly outdoor scenes. + * [sdfgiUseOcclusion] has a performance impact and should only be enabled when needed. */ public var sdfgiUseOcclusion: Boolean get() { @@ -597,7 +651,8 @@ public open class Environment : Resource() { } /** - * If `true`, SDFGI takes the environment lighting into account. This should be set to `false` for interior scenes. + * If `true`, SDFGI takes the environment lighting into account. This should be set to `false` for + * interior scenes. */ public var sdfgiReadSkyLight: Boolean get() { @@ -611,11 +666,14 @@ public open class Environment : Resource() { } /** - * The energy multiplier applied to light every time it bounces from a surface when using SDFGI. Values greater than `0.0` will simulate multiple bounces, resulting in a more realistic appearance. Increasing [sdfgiBounceFeedback] generally has no performance impact. See also [sdfgiEnergy]. - * - * **Note:** Values greater than `0.5` can cause infinite feedback loops and should be avoided in scenes with bright materials. - * - * **Note:** If [sdfgiBounceFeedback] is `0.0`, indirect lighting will not be represented in reflections as light will only bounce one time. + * The energy multiplier applied to light every time it bounces from a surface when using SDFGI. + * Values greater than `0.0` will simulate multiple bounces, resulting in a more realistic + * appearance. Increasing [sdfgiBounceFeedback] generally has no performance impact. See also + * [sdfgiEnergy]. + * **Note:** Values greater than `0.5` can cause infinite feedback loops and should be avoided in + * scenes with bright materials. + * **Note:** If [sdfgiBounceFeedback] is `0.0`, indirect lighting will not be represented in + * reflections as light will only bounce one time. */ public var sdfgiBounceFeedback: Float get() { @@ -629,7 +687,10 @@ public open class Environment : Resource() { } /** - * The number of cascades to use for SDFGI (between 1 and 8). A higher number of cascades allows displaying SDFGI further away while preserving detail up close, at the cost of performance. When using SDFGI on small-scale levels, [sdfgiCascades] can often be decreased between `1` and `4` to improve performance. + * The number of cascades to use for SDFGI (between 1 and 8). A higher number of cascades allows + * displaying SDFGI further away while preserving detail up close, at the cost of performance. When + * using SDFGI on small-scale levels, [sdfgiCascades] can often be decreased between `1` and `4` to + * improve performance. */ public var sdfgiCascades: Int get() { @@ -643,9 +704,12 @@ public open class Environment : Resource() { } /** - * The cell size to use for the closest SDFGI cascade (in 3D units). Lower values allow SDFGI to be more precise up close, at the cost of making SDFGI updates more demanding. This can cause stuttering when the camera moves fast. Higher values allow SDFGI to cover more ground, while also reducing the performance impact of SDFGI updates. - * - * **Note:** This property is linked to [sdfgiMaxDistance] and [sdfgiCascade0Distance]. Changing its value will automatically change those properties as well. + * The cell size to use for the closest SDFGI cascade (in 3D units). Lower values allow SDFGI to + * be more precise up close, at the cost of making SDFGI updates more demanding. This can cause + * stuttering when the camera moves fast. Higher values allow SDFGI to cover more ground, while also + * reducing the performance impact of SDFGI updates. + * **Note:** This property is linked to [sdfgiMaxDistance] and [sdfgiCascade0Distance]. Changing + * its value will automatically change those properties as well. */ public var sdfgiMinCellSize: Float get() { @@ -659,7 +723,8 @@ public open class Environment : Resource() { } /** - * **Note:** This property is linked to [sdfgiMinCellSize] and [sdfgiMaxDistance]. Changing its value will automatically change those properties as well. + * **Note:** This property is linked to [sdfgiMinCellSize] and [sdfgiMaxDistance]. Changing its + * value will automatically change those properties as well. */ public var sdfgiCascade0Distance: Float get() { @@ -673,9 +738,10 @@ public open class Environment : Resource() { } /** - * The maximum distance at which SDFGI is visible. Beyond this distance, environment lighting or other sources of GI such as [godot.ReflectionProbe] will be used as a fallback. - * - * **Note:** This property is linked to [sdfgiMinCellSize] and [sdfgiCascade0Distance]. Changing its value will automatically change those properties as well. + * The maximum distance at which SDFGI is visible. Beyond this distance, environment lighting or + * other sources of GI such as [ReflectionProbe] will be used as a fallback. + * **Note:** This property is linked to [sdfgiMinCellSize] and [sdfgiCascade0Distance]. Changing + * its value will automatically change those properties as well. */ public var sdfgiMaxDistance: Float get() { @@ -689,7 +755,10 @@ public open class Environment : Resource() { } /** - * The Y scale to use for SDFGI cells. Lower values will result in SDFGI cells being packed together more closely on the Y axis. This is used to balance between quality and covering a lot of vertical ground. [sdfgiYScale] should be set depending on how vertical your scene is (and how fast your camera may move on the Y axis). + * The Y scale to use for SDFGI cells. Lower values will result in SDFGI cells being packed + * together more closely on the Y axis. This is used to balance between quality and covering a lot of + * vertical ground. [sdfgiYScale] should be set depending on how vertical your scene is (and how fast + * your camera may move on the Y axis). */ public var sdfgiYScale: SDFGIYScale get() { @@ -703,7 +772,8 @@ public open class Environment : Resource() { } /** - * The energy multiplier to use for SDFGI. Higher values will result in brighter indirect lighting and reflections. See also [sdfgiBounceFeedback]. + * The energy multiplier to use for SDFGI. Higher values will result in brighter indirect lighting + * and reflections. See also [sdfgiBounceFeedback]. */ public var sdfgiEnergy: Float get() { @@ -717,7 +787,8 @@ public open class Environment : Resource() { } /** - * The normal bias to use for SDFGI probes. Increasing this value can reduce visible streaking artifacts on sloped surfaces, at the cost of increased light leaking. + * The normal bias to use for SDFGI probes. Increasing this value can reduce visible streaking + * artifacts on sloped surfaces, at the cost of increased light leaking. */ public var sdfgiNormalBias: Float get() { @@ -731,7 +802,8 @@ public open class Environment : Resource() { } /** - * The constant bias to use for SDFGI probes. Increasing this value can reduce visible streaking artifacts on sloped surfaces, at the cost of increased light leaking. + * The constant bias to use for SDFGI probes. Increasing this value can reduce visible streaking + * artifacts on sloped surfaces, at the cost of increased light leaking. */ public var sdfgiProbeBias: Float get() { @@ -746,8 +818,9 @@ public open class Environment : Resource() { /** * If `true`, the glow effect is enabled. - * - * **Note:** Glow is only supported in the Forward+ and Mobile rendering methods, not Compatibility. When using the Mobile rendering method, glow will look different due to the lower dynamic range available in the Mobile rendering method. + * **Note:** Glow is only supported in the Forward+ and Mobile rendering methods, not + * Compatibility. When using the Mobile rendering method, glow will look different due to the lower + * dynamic range available in the Mobile rendering method. */ public var glowEnabled: Boolean get() { @@ -761,7 +834,8 @@ public open class Environment : Resource() { } /** - * If `true`, glow levels will be normalized so that summed together their intensities equal `1.0`. + * If `true`, glow levels will be normalized so that summed together their intensities equal + * `1.0`. */ public var glowNormalized: Boolean get() { @@ -775,7 +849,9 @@ public open class Environment : Resource() { } /** - * The overall brightness multiplier of the glow effect. When using the Mobile rendering method (which only supports a lower dynamic range up to `2.0`), this should be increased to `1.5` to compensate. + * The overall brightness multiplier of the glow effect. When using the Mobile rendering method + * (which only supports a lower dynamic range up to `2.0`), this should be increased to `1.5` to + * compensate. */ public var glowIntensity: Float get() { @@ -789,7 +865,9 @@ public open class Environment : Resource() { } /** - * The strength of the glow effect. This applies as the glow is blurred across the screen and increases the distance and intensity of the blur. When using the Mobile rendering method, this should be increased to compensate for the lower dynamic range. + * The strength of the glow effect. This applies as the glow is blurred across the screen and + * increases the distance and intensity of the blur. When using the Mobile rendering method, this + * should be increased to compensate for the lower dynamic range. */ public var glowStrength: Float get() { @@ -803,7 +881,9 @@ public open class Environment : Resource() { } /** - * When using the [GLOW_BLEND_MODE_MIX] [glowBlendMode], this controls how much the source image is blended with the glow layer. A value of `0.0` makes the glow rendering invisible, while a value of `1.0` is equivalent to [GLOW_BLEND_MODE_REPLACE]. + * When using the [constant GLOW_BLEND_MODE_MIX] [glowBlendMode], this controls how much the + * source image is blended with the glow layer. A value of `0.0` makes the glow rendering invisible, + * while a value of `1.0` is equivalent to [constant GLOW_BLEND_MODE_REPLACE]. */ public var glowMix: Float get() { @@ -817,7 +897,8 @@ public open class Environment : Resource() { } /** - * The bloom's intensity. If set to a value higher than `0`, this will make glow visible in areas darker than the [glowHdrThreshold]. + * The bloom's intensity. If set to a value higher than `0`, this will make glow visible in areas + * darker than the [glowHdrThreshold]. */ public var glowBloom: Float get() { @@ -845,7 +926,10 @@ public open class Environment : Resource() { } /** - * The lower threshold of the HDR glow. When using the Mobile rendering method (which only supports a lower dynamic range up to `2.0`), this may need to be below `1.0` for glow to be visible. A value of `0.9` works well in this case. This value also needs to be decreased below `1.0` when using glow in 2D, as 2D rendering is performed in SDR. + * The lower threshold of the HDR glow. When using the Mobile rendering method (which only + * supports a lower dynamic range up to `2.0`), this may need to be below `1.0` for glow to be + * visible. A value of `0.9` works well in this case. This value also needs to be decreased below + * `1.0` when using glow in 2D, as 2D rendering is performed in SDR. */ public var glowHdrThreshold: Float get() { @@ -873,7 +957,8 @@ public open class Environment : Resource() { } /** - * The higher threshold of the HDR glow. Areas brighter than this threshold will be clamped for the purposes of the glow effect. + * The higher threshold of the HDR glow. Areas brighter than this threshold will be clamped for + * the purposes of the glow effect. */ public var glowHdrLuminanceCap: Float get() { @@ -887,7 +972,10 @@ public open class Environment : Resource() { } /** - * How strong of an impact the [glowMap] should have on the overall glow effect. A strength of `0.0` means the glow map has no effect on the overall glow effect. A strength of `1.0` means the glow has a full effect on the overall glow effect (and can turn off glow entirely in specific areas of the screen if the glow map has black areas). + * How strong of an impact the [glowMap] should have on the overall glow effect. A strength of + * `0.0` means the glow map has no effect on the overall glow effect. A strength of `1.0` means the + * glow has a full effect on the overall glow effect (and can turn off glow entirely in specific + * areas of the screen if the glow map has black areas). */ public var glowMapStrength: Float get() { @@ -901,9 +989,11 @@ public open class Environment : Resource() { } /** - * The texture that should be used as a glow map to *multiply* the resulting glow color according to [glowMapStrength]. This can be used to create a "lens dirt" effect. The texture's RGB color channels are used for modulation, but the alpha channel is ignored. - * - * **Note:** The texture will be stretched to fit the screen. Therefore, it's recommended to use a texture with an aspect ratio that matches your project's base aspect ratio (typically 16:9). + * The texture that should be used as a glow map to *multiply* the resulting glow color according + * to [glowMapStrength]. This can be used to create a "lens dirt" effect. The texture's RGB color + * channels are used for modulation, but the alpha channel is ignored. + * **Note:** The texture will be stretched to fit the screen. Therefore, it's recommended to use a + * texture with an aspect ratio that matches your project's base aspect ratio (typically 16:9). */ public var glowMap: Texture? get() { @@ -960,7 +1050,8 @@ public open class Environment : Resource() { } /** - * If set above `0.0`, renders the scene's directional light(s) in the fog color depending on the view angle. This can be used to give the impression that the sun is "piercing" through the fog. + * If set above `0.0`, renders the scene's directional light(s) in the fog color depending on the + * view angle. This can be used to give the impression that the sun is "piercing" through the fog. */ public var fogSunScatter: Float get() { @@ -974,7 +1065,8 @@ public open class Environment : Resource() { } /** - * The *exponential* fog density to use. Higher values result in a more dense fog. Fog rendering is exponential as in real life. + * The *exponential* fog density to use. Higher values result in a more dense fog. Fog rendering + * is exponential as in real life. */ public var fogDensity: Float get() { @@ -988,9 +1080,13 @@ public open class Environment : Resource() { } /** - * If set above `0.0` (exclusive), blends between the fog's color and the color of the background [godot.Sky]. This has a small performance cost when set above `0.0`. Must have [backgroundMode] set to [BG_SKY]. - * - * This is useful to simulate [aerial perspective](https://en.wikipedia.org/wiki/Aerial_perspective) in large scenes with low density fog. However, it is not very useful for high-density fog, as the sky will shine through. When set to `1.0`, the fog color comes completely from the [godot.Sky]. If set to `0.0`, aerial perspective is disabled. + * If set above `0.0` (exclusive), blends between the fog's color and the color of the background + * [Sky]. This has a small performance cost when set above `0.0`. Must have [backgroundMode] set to + * [constant BG_SKY]. + * This is useful to simulate [url=https://en.wikipedia.org/wiki/Aerial_perspective]aerial + * perspective[/url] in large scenes with low density fog. However, it is not very useful for + * high-density fog, as the sky will shine through. When set to `1.0`, the fog color comes completely + * from the [Sky]. If set to `0.0`, aerial perspective is disabled. */ public var fogAerialPerspective: Float get() { @@ -1004,8 +1100,9 @@ public open class Environment : Resource() { } /** - * The factor to use when affecting the sky with non-volumetric fog. `1.0` means that fog can fully obscure the sky. Lower values reduce the impact of fog on sky rendering, with `0.0` not affecting sky rendering at all. - * + * The factor to use when affecting the sky with non-volumetric fog. `1.0` means that fog can + * fully obscure the sky. Lower values reduce the impact of fog on sky rendering, with `0.0` not + * affecting sky rendering at all. * **Note:** [fogSkyAffect] has no visual effect if [fogAerialPerspective] is `1.0`. */ public var fogSkyAffect: Float @@ -1034,7 +1131,8 @@ public open class Environment : Resource() { } /** - * The density used to increase fog as height decreases. To make fog increase as height increases, use a negative value. + * The density used to increase fog as height decreases. To make fog increase as height increases, + * use a negative value. */ public var fogHeightDensity: Float get() { @@ -1048,9 +1146,13 @@ public open class Environment : Resource() { } /** - * Enables the volumetric fog effect. Volumetric fog uses a screen-aligned froxel buffer to calculate accurate volumetric scattering in the short to medium range. Volumetric fog interacts with [godot.FogVolume]s and lights to calculate localized and global fog. Volumetric fog uses a PBR single-scattering model based on extinction, scattering, and emission which it exposes to users as density, albedo, and emission. - * - * **Note:** Volumetric fog is only supported in the Forward+ rendering method, not Mobile or Compatibility. + * Enables the volumetric fog effect. Volumetric fog uses a screen-aligned froxel buffer to + * calculate accurate volumetric scattering in the short to medium range. Volumetric fog interacts + * with [FogVolume]s and lights to calculate localized and global fog. Volumetric fog uses a PBR + * single-scattering model based on extinction, scattering, and emission which it exposes to users as + * density, albedo, and emission. + * **Note:** Volumetric fog is only supported in the Forward+ rendering method, not Mobile or + * Compatibility. */ public var volumetricFogEnabled: Boolean get() { @@ -1064,11 +1166,14 @@ public open class Environment : Resource() { } /** - * The base *exponential* density of the volumetric fog. Set this to the lowest density you want to have globally. [godot.FogVolume]s can be used to add to or subtract from this density in specific areas. Fog rendering is exponential as in real life. - * - * A value of `0.0` disables global volumetric fog while allowing [godot.FogVolume]s to display volumetric fog in specific areas. - * - * To make volumetric fog work as a volumetric *lighting* solution, set [volumetricFogDensity] to the lowest non-zero value (`0.0001`) then increase lights' [godot.Light3D.lightVolumetricFogEnergy] to values between `10000` and `100000` to compensate for the very low density. + * The base *exponential* density of the volumetric fog. Set this to the lowest density you want + * to have globally. [FogVolume]s can be used to add to or subtract from this density in specific + * areas. Fog rendering is exponential as in real life. + * A value of `0.0` disables global volumetric fog while allowing [FogVolume]s to display + * volumetric fog in specific areas. + * To make volumetric fog work as a volumetric *lighting* solution, set [volumetricFogDensity] to + * the lowest non-zero value (`0.0001`) then increase lights' [Light3D.lightVolumetricFogEnergy] to + * values between `10000` and `100000` to compensate for the very low density. */ public var volumetricFogDensity: Float get() { @@ -1082,7 +1187,8 @@ public open class Environment : Resource() { } /** - * The [godot.core.Color] of the volumetric fog when interacting with lights. Mist and fog have an albedo close to `Color(1, 1, 1, 1)` while smoke has a darker albedo. + * The [Color] of the volumetric fog when interacting with lights. Mist and fog have an albedo + * close to `Color(1, 1, 1, 1)` while smoke has a darker albedo. */ @CoreTypeLocalCopy public var volumetricFogAlbedo: Color @@ -1097,7 +1203,10 @@ public open class Environment : Resource() { } /** - * The emitted light from the volumetric fog. Even with emission, volumetric fog will not cast light onto other surfaces. Emission is useful to establish an ambient color. As the volumetric fog effect uses single-scattering only, fog tends to need a little bit of emission to soften the harsh shadows. + * The emitted light from the volumetric fog. Even with emission, volumetric fog will not cast + * light onto other surfaces. Emission is useful to establish an ambient color. As the volumetric fog + * effect uses single-scattering only, fog tends to need a little bit of emission to soften the harsh + * shadows. */ @CoreTypeLocalCopy public var volumetricFogEmission: Color @@ -1126,11 +1235,14 @@ public open class Environment : Resource() { } /** - * Scales the strength of Global Illumination used in the volumetric fog's albedo color. A value of `0.0` means that Global Illumination will not impact the volumetric fog. [volumetricFogGiInject] has a small performance cost when set above `0.0`. - * - * **Note:** This has no visible effect if [volumetricFogDensity] is `0.0` or if [volumetricFogAlbedo] is a fully black color. - * - * **Note:** Only [godot.VoxelGI] and SDFGI ([godot.Environment.sdfgiEnabled]) are taken into account when using [volumetricFogGiInject]. Global illumination from [godot.LightmapGI], [godot.ReflectionProbe] and SSIL (see [ssilEnabled]) will be ignored by volumetric fog. + * Scales the strength of Global Illumination used in the volumetric fog's albedo color. A value + * of `0.0` means that Global Illumination will not impact the volumetric fog. + * [volumetricFogGiInject] has a small performance cost when set above `0.0`. + * **Note:** This has no visible effect if [volumetricFogDensity] is `0.0` or if + * [volumetricFogAlbedo] is a fully black color. + * **Note:** Only [VoxelGI] and SDFGI ([Environment.sdfgiEnabled]) are taken into account when + * using [volumetricFogGiInject]. Global illumination from [LightmapGI], [ReflectionProbe] and SSIL + * (see [ssilEnabled]) will be ignored by volumetric fog. */ public var volumetricFogGiInject: Float get() { @@ -1144,7 +1256,10 @@ public open class Environment : Resource() { } /** - * The direction of scattered light as it goes through the volumetric fog. A value close to `1.0` means almost all light is scattered forward. A value close to `0.0` means light is scattered equally in all directions. A value close to `-1.0` means light is scattered mostly backward. Fog and mist scatter light slightly forward, while smoke scatters light equally in all directions. + * The direction of scattered light as it goes through the volumetric fog. A value close to `1.0` + * means almost all light is scattered forward. A value close to `0.0` means light is scattered + * equally in all directions. A value close to `-1.0` means light is scattered mostly backward. Fog + * and mist scatter light slightly forward, while smoke scatters light equally in all directions. */ public var volumetricFogAnisotropy: Float get() { @@ -1158,7 +1273,10 @@ public open class Environment : Resource() { } /** - * The distance over which the volumetric fog is computed. Increase to compute fog over a greater range, decrease to add more detail when a long range is not needed. For best quality fog, keep this as low as possible. See also [godot.ProjectSettings.rendering/environment/volumetricFog/volumeDepth]. + * The distance over which the volumetric fog is computed. Increase to compute fog over a greater + * range, decrease to add more detail when a long range is not needed. For best quality fog, keep + * this as low as possible. See also + * [ProjectSettings.rendering/environment/volumetricFog/volumeDepth]. */ public var volumetricFogLength: Float get() { @@ -1172,7 +1290,8 @@ public open class Environment : Resource() { } /** - * The distribution of size down the length of the froxel buffer. A higher value compresses the froxels closer to the camera and places more detail closer to the camera. + * The distribution of size down the length of the froxel buffer. A higher value compresses the + * froxels closer to the camera and places more detail closer to the camera. */ public var volumetricFogDetailSpread: Float get() { @@ -1186,9 +1305,11 @@ public open class Environment : Resource() { } /** - * Scales the strength of ambient light used in the volumetric fog. A value of `0.0` means that ambient light will not impact the volumetric fog. [volumetricFogAmbientInject] has a small performance cost when set above `0.0`. - * - * **Note:** This has no visible effect if [volumetricFogDensity] is `0.0` or if [volumetricFogAlbedo] is a fully black color. + * Scales the strength of ambient light used in the volumetric fog. A value of `0.0` means that + * ambient light will not impact the volumetric fog. [volumetricFogAmbientInject] has a small + * performance cost when set above `0.0`. + * **Note:** This has no visible effect if [volumetricFogDensity] is `0.0` or if + * [volumetricFogAlbedo] is a fully black color. */ public var volumetricFogAmbientInject: Float get() { @@ -1202,9 +1323,12 @@ public open class Environment : Resource() { } /** - * The factor to use when affecting the sky with volumetric fog. `1.0` means that volumetric fog can fully obscure the sky. Lower values reduce the impact of volumetric fog on sky rendering, with `0.0` not affecting sky rendering at all. - * - * **Note:** [volumetricFogSkyAffect] also affects [godot.FogVolume]s, even if [volumetricFogDensity] is `0.0`. If you notice [godot.FogVolume]s are disappearing when looking towards the sky, set [volumetricFogSkyAffect] to `1.0`. + * The factor to use when affecting the sky with volumetric fog. `1.0` means that volumetric fog + * can fully obscure the sky. Lower values reduce the impact of volumetric fog on sky rendering, with + * `0.0` not affecting sky rendering at all. + * **Note:** [volumetricFogSkyAffect] also affects [FogVolume]s, even if [volumetricFogDensity] is + * `0.0`. If you notice [FogVolume]s are disappearing when looking towards the sky, set + * [volumetricFogSkyAffect] to `1.0`. */ public var volumetricFogSkyAffect: Float get() { @@ -1218,7 +1342,12 @@ public open class Environment : Resource() { } /** - * Enables temporal reprojection in the volumetric fog. Temporal reprojection blends the current frame's volumetric fog with the last frame's volumetric fog to smooth out jagged edges. The performance cost is minimal; however, it leads to moving [godot.FogVolume]s and [godot.Light3D]s "ghosting" and leaving a trail behind them. When temporal reprojection is enabled, try to avoid moving [godot.FogVolume]s or [godot.Light3D]s too fast. Short-lived dynamic lighting effects should have [godot.Light3D.lightVolumetricFogEnergy] set to `0.0` to avoid ghosting. + * Enables temporal reprojection in the volumetric fog. Temporal reprojection blends the current + * frame's volumetric fog with the last frame's volumetric fog to smooth out jagged edges. The + * performance cost is minimal; however, it leads to moving [FogVolume]s and [Light3D]s "ghosting" + * and leaving a trail behind them. When temporal reprojection is enabled, try to avoid moving + * [FogVolume]s or [Light3D]s too fast. Short-lived dynamic lighting effects should have + * [Light3D.lightVolumetricFogEnergy] set to `0.0` to avoid ghosting. */ public var volumetricFogTemporalReprojectionEnabled: Boolean get() { @@ -1234,7 +1363,9 @@ public open class Environment : Resource() { } /** - * The amount by which to blend the last frame with the current frame. A higher number results in smoother volumetric fog, but makes "ghosting" much worse. A lower value reduces ghosting but can result in the per-frame temporal jitter becoming visible. + * The amount by which to blend the last frame with the current frame. A higher number results in + * smoother volumetric fog, but makes "ghosting" much worse. A lower value reduces ghosting but can + * result in the per-frame temporal jitter becoming visible. */ public var volumetricFogTemporalReprojectionAmount: Float get() { @@ -1250,9 +1381,10 @@ public open class Environment : Resource() { } /** - * If `true`, enables the `adjustment_*` properties provided by this resource. If `false`, modifications to the `adjustment_*` properties will have no effect on the rendered scene. - * - * **Note:** Adjustments are only supported in the Forward+ and Mobile rendering methods, not Compatibility. + * If `true`, enables the `adjustment_*` properties provided by this resource. If `false`, + * modifications to the `adjustment_*` properties will have no effect on the rendered scene. + * **Note:** Adjustments are only supported in the Forward+ and Mobile rendering methods, not + * Compatibility. */ public var adjustmentEnabled: Boolean get() { @@ -1266,7 +1398,8 @@ public open class Environment : Resource() { } /** - * The global brightness value of the rendered scene. Effective only if [adjustmentEnabled] is `true`. + * The global brightness value of the rendered scene. Effective only if [adjustmentEnabled] is + * `true`. */ public var adjustmentBrightness: Float get() { @@ -1280,7 +1413,8 @@ public open class Environment : Resource() { } /** - * The global contrast value of the rendered scene (default value is 1). Effective only if [adjustmentEnabled] is `true`. + * The global contrast value of the rendered scene (default value is 1). Effective only if + * [adjustmentEnabled] is `true`. */ public var adjustmentContrast: Float get() { @@ -1294,7 +1428,8 @@ public open class Environment : Resource() { } /** - * The global color saturation value of the rendered scene (default value is 1). Effective only if [adjustmentEnabled] is `true`. + * The global color saturation value of the rendered scene (default value is 1). Effective only if + * [adjustmentEnabled] is `true`. */ public var adjustmentSaturation: Float get() { @@ -1308,7 +1443,9 @@ public open class Environment : Resource() { } /** - * The [godot.Texture2D] or [godot.Texture3D] lookup table (LUT) to use for the built-in post-process color grading. Can use a [godot.GradientTexture1D] for a 1-dimensional LUT, or a [godot.Texture3D] for a more complex LUT. Effective only if [adjustmentEnabled] is `true`. + * The [Texture2D] or [Texture3D] lookup table (LUT) to use for the built-in post-process color + * grading. Can use a [GradientTexture1D] for a 1-dimensional LUT, or a [Texture3D] for a more + * complex LUT. Effective only if [adjustmentEnabled] is `true`. */ public var adjustmentColorCorrection: Material? get() { @@ -1327,7 +1464,8 @@ public open class Environment : Resource() { } /** - * The [godot.core.Color] displayed for clear areas of the scene. Only effective when using the [BG_COLOR] background mode. + * The [Color] displayed for clear areas of the scene. Only effective when using the [constant + * BG_COLOR] background mode. * * This is a helper function to make dealing with local copies easier. * @@ -1375,7 +1513,8 @@ public open class Environment : Resource() { /** - * The ambient light's [godot.core.Color]. Only effective if [ambientLightSkyContribution] is lower than `1.0` (exclusive). + * The ambient light's [Color]. Only effective if [ambientLightSkyContribution] is lower than + * `1.0` (exclusive). * * This is a helper function to make dealing with local copies easier. * @@ -1423,7 +1562,8 @@ public open class Environment : Resource() { /** - * The [godot.core.Color] of the volumetric fog when interacting with lights. Mist and fog have an albedo close to `Color(1, 1, 1, 1)` while smoke has a darker albedo. + * The [Color] of the volumetric fog when interacting with lights. Mist and fog have an albedo + * close to `Color(1, 1, 1, 1)` while smoke has a darker albedo. * * This is a helper function to make dealing with local copies easier. * @@ -1448,7 +1588,10 @@ public open class Environment : Resource() { /** - * The emitted light from the volumetric fog. Even with emission, volumetric fog will not cast light onto other surfaces. Emission is useful to establish an ambient color. As the volumetric fog effect uses single-scattering only, fog tends to need a little bit of emission to soften the harsh shadows. + * The emitted light from the volumetric fog. Even with emission, volumetric fog will not cast + * light onto other surfaces. Emission is useful to establish an ambient color. As the volumetric fog + * effect uses single-scattering only, fog tends to need a little bit of emission to soften the harsh + * shadows. * * This is a helper function to make dealing with local copies easier. * @@ -1473,7 +1616,9 @@ public open class Environment : Resource() { /** - * Sets the intensity of the glow level [idx]. A value above `0.0` enables the level. Each level relies on the previous level. This means that enabling higher glow levels will slow down the glow effect rendering, even if previous levels aren't enabled. + * Sets the intensity of the glow level [param idx]. A value above `0.0` enables the level. Each + * level relies on the previous level. This means that enabling higher glow levels will slow down the + * glow effect rendering, even if previous levels aren't enabled. */ public fun setGlowLevel(idx: Int, intensity: Float): Unit { TransferContext.writeArguments(LONG to idx.toLong(), DOUBLE to intensity.toDouble()) @@ -1481,7 +1626,7 @@ public open class Environment : Resource() { } /** - * Returns the intensity of the glow level [idx]. + * Returns the intensity of the glow level [param idx]. */ public fun getGlowLevel(idx: Int): Float { TransferContext.writeArguments(LONG to idx.toLong()) @@ -1493,7 +1638,8 @@ public open class Environment : Resource() { id: Long, ) { /** - * Clears the background using the clear color defined in [godot.ProjectSettings.rendering/environment/defaults/defaultClearColor]. + * Clears the background using the clear color defined in + * [ProjectSettings.rendering/environment/defaults/defaultClearColor]. */ BG_CLEAR_COLOR(0), /** @@ -1505,11 +1651,14 @@ public open class Environment : Resource() { */ BG_SKY(2), /** - * Displays a [godot.CanvasLayer] in the background. + * Displays a [CanvasLayer] in the background. */ BG_CANVAS(3), /** - * Keeps on screen every pixel drawn in the background. This is the fastest background mode, but it can only be safely used in fully-interior scenes (no visible sky or sky reflections). If enabled in a scene where the background is visible, "ghost trail" artifacts will be visible when moving the camera. + * Keeps on screen every pixel drawn in the background. This is the fastest background mode, but + * it can only be safely used in fully-interior scenes (no visible sky or sky reflections). If + * enabled in a scene where the background is visible, "ghost trail" artifacts will be visible when + * moving the camera. */ BG_KEEP(4), /** @@ -1540,15 +1689,17 @@ public open class Environment : Resource() { */ AMBIENT_SOURCE_BG(0), /** - * Disable ambient light. This provides a slight performance boost over [AMBIENT_SOURCE_SKY]. + * Disable ambient light. This provides a slight performance boost over [constant + * AMBIENT_SOURCE_SKY]. */ AMBIENT_SOURCE_DISABLED(1), /** - * Specify a specific [godot.core.Color] for ambient light. This provides a slight performance boost over [AMBIENT_SOURCE_SKY]. + * Specify a specific [Color] for ambient light. This provides a slight performance boost over + * [constant AMBIENT_SOURCE_SKY]. */ AMBIENT_SOURCE_COLOR(2), /** - * Gather ambient light from the [godot.Sky] regardless of what the background is. + * Gather ambient light from the [Sky] regardless of what the background is. */ AMBIENT_SOURCE_SKY(3), ; @@ -1575,7 +1726,7 @@ public open class Environment : Resource() { */ REFLECTION_SOURCE_DISABLED(1), /** - * Use the [godot.Sky] for reflections regardless of what the background is. + * Use the [Sky] for reflections regardless of what the background is. */ REFLECTION_SOURCE_SKY(2), ; @@ -1594,20 +1745,26 @@ public open class Environment : Resource() { id: Long, ) { /** - * Linear tonemapper operator. Reads the linear data and passes it on unmodified. This can cause bright lighting to look blown out, with noticeable clipping in the output colors. + * Linear tonemapper operator. Reads the linear data and passes it on unmodified. This can cause + * bright lighting to look blown out, with noticeable clipping in the output colors. */ TONE_MAPPER_LINEAR(0), /** - * Reinhardt tonemapper operator. Performs a variation on rendered pixels' colors by this formula: `color = color / (1 + color)`. This avoids clipping bright highlights, but the resulting image can look a bit dull. + * Reinhardt tonemapper operator. Performs a variation on rendered pixels' colors by this + * formula: `color = color / (1 + color)`. This avoids clipping bright highlights, but the + * resulting image can look a bit dull. */ TONE_MAPPER_REINHARDT(1), /** - * Filmic tonemapper operator. This avoids clipping bright highlights, with a resulting image that usually looks more vivid than [TONE_MAPPER_REINHARDT]. + * Filmic tonemapper operator. This avoids clipping bright highlights, with a resulting image + * that usually looks more vivid than [constant TONE_MAPPER_REINHARDT]. */ TONE_MAPPER_FILMIC(2), /** - * Use the Academy Color Encoding System tonemapper. ACES is slightly more expensive than other options, but it handles bright lighting in a more realistic fashion by desaturating it as it becomes brighter. ACES typically has a more contrasted output compared to [TONE_MAPPER_REINHARDT] and [TONE_MAPPER_FILMIC]. - * + * Use the Academy Color Encoding System tonemapper. ACES is slightly more expensive than other + * options, but it handles bright lighting in a more realistic fashion by desaturating it as it + * becomes brighter. ACES typically has a more contrasted output compared to [constant + * TONE_MAPPER_REINHARDT] and [constant TONE_MAPPER_FILMIC]. * **Note:** This tonemapping operator is called "ACES Fitted" in Godot 3.x. */ TONE_MAPPER_ACES(3), @@ -1627,7 +1784,8 @@ public open class Environment : Resource() { id: Long, ) { /** - * Additive glow blending mode. Mostly used for particles, glows (bloom), lens flare, bright sources. + * Additive glow blending mode. Mostly used for particles, glows (bloom), lens flare, bright + * sources. */ GLOW_BLEND_MODE_ADDITIVE(0), /** @@ -1635,15 +1793,19 @@ public open class Environment : Resource() { */ GLOW_BLEND_MODE_SCREEN(1), /** - * Soft light glow blending mode. Modifies contrast, exposes shadows and highlights (vivid bloom). + * Soft light glow blending mode. Modifies contrast, exposes shadows and highlights (vivid + * bloom). */ GLOW_BLEND_MODE_SOFTLIGHT(2), /** - * Replace glow blending mode. Replaces all pixels' color by the glow value. This can be used to simulate a full-screen blur effect by tweaking the glow parameters to match the original image's brightness. + * Replace glow blending mode. Replaces all pixels' color by the glow value. This can be used to + * simulate a full-screen blur effect by tweaking the glow parameters to match the original image's + * brightness. */ GLOW_BLEND_MODE_REPLACE(3), /** - * Mixes the glow with the underlying color to avoid increasing brightness as much while still maintaining a glow effect. + * Mixes the glow with the underlying color to avoid increasing brightness as much while still + * maintaining a glow effect. */ GLOW_BLEND_MODE_MIX(4), ; @@ -1662,15 +1824,21 @@ public open class Environment : Resource() { id: Long, ) { /** - * Use 50% scale for SDFGI on the Y (vertical) axis. SDFGI cells will be twice as short as they are wide. This allows providing increased GI detail and reduced light leaking with thin floors and ceilings. This is usually the best choice for scenes that don't feature much verticality. + * Use 50% scale for SDFGI on the Y (vertical) axis. SDFGI cells will be twice as short as + * they are wide. This allows providing increased GI detail and reduced light leaking with thin + * floors and ceilings. This is usually the best choice for scenes that don't feature much + * verticality. */ SDFGI_Y_SCALE_50_PERCENT(0), /** - * Use 75% scale for SDFGI on the Y (vertical) axis. This is a balance between the 50% and 100% SDFGI Y scales. + * Use 75% scale for SDFGI on the Y (vertical) axis. This is a balance between the 50% + * and 100% SDFGI Y scales. */ SDFGI_Y_SCALE_75_PERCENT(1), /** - * Use 100% scale for SDFGI on the Y (vertical) axis. SDFGI cells will be as tall as they are wide. This is usually the best choice for highly vertical scenes. The downside is that light leaking may become more noticeable with thin floors and ceilings. + * Use 100% scale for SDFGI on the Y (vertical) axis. SDFGI cells will be as tall as they + * are wide. This is usually the best choice for highly vertical scenes. The downside is that light + * leaking may become more noticeable with thin floors and ceilings. */ SDFGI_Y_SCALE_100_PERCENT(2), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Error.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Error.kt index d6f0647be..d4be3ddbf 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Error.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Error.kt @@ -6,54 +6,217 @@ import kotlin.Long public enum class Error( id: Long, ) { + /** + * Methods that return [enum Error] return [constant OK] when no error occurred. + * Since [constant OK] has value 0, and all other error constants are positive integers, it can + * also be used in boolean checks. + * **Example:** + * [codeblock] + * var error = method_that_returns_error() + * if error != OK: + * printerr("Failure!") + * + * # Or, alternatively: + * if error: + * printerr("Still failing!") + * [/codeblock] + * **Note:** Many functions do not return an error code, but will print error messages to standard + * output. + */ OK(0), + /** + * Generic error. + */ FAILED(1), + /** + * Unavailable error. + */ ERR_UNAVAILABLE(2), + /** + * Unconfigured error. + */ ERR_UNCONFIGURED(3), + /** + * Unauthorized error. + */ ERR_UNAUTHORIZED(4), + /** + * Parameter range error. + */ ERR_PARAMETER_RANGE_ERROR(5), + /** + * Out of memory (OOM) error. + */ ERR_OUT_OF_MEMORY(6), + /** + * File: Not found error. + */ ERR_FILE_NOT_FOUND(7), + /** + * File: Bad drive error. + */ ERR_FILE_BAD_DRIVE(8), + /** + * File: Bad path error. + */ ERR_FILE_BAD_PATH(9), + /** + * File: No permission error. + */ ERR_FILE_NO_PERMISSION(10), + /** + * File: Already in use error. + */ ERR_FILE_ALREADY_IN_USE(11), + /** + * File: Can't open error. + */ ERR_FILE_CANT_OPEN(12), + /** + * File: Can't write error. + */ ERR_FILE_CANT_WRITE(13), + /** + * File: Can't read error. + */ ERR_FILE_CANT_READ(14), + /** + * File: Unrecognized error. + */ ERR_FILE_UNRECOGNIZED(15), + /** + * File: Corrupt error. + */ ERR_FILE_CORRUPT(16), + /** + * File: Missing dependencies error. + */ ERR_FILE_MISSING_DEPENDENCIES(17), + /** + * File: End of file (EOF) error. + */ ERR_FILE_EOF(18), + /** + * Can't open error. + */ ERR_CANT_OPEN(19), + /** + * Can't create error. + */ ERR_CANT_CREATE(20), + /** + * Query failed error. + */ ERR_QUERY_FAILED(21), + /** + * Already in use error. + */ ERR_ALREADY_IN_USE(22), + /** + * Locked error. + */ ERR_LOCKED(23), + /** + * Timeout error. + */ ERR_TIMEOUT(24), + /** + * Can't connect error. + */ ERR_CANT_CONNECT(25), + /** + * Can't resolve error. + */ ERR_CANT_RESOLVE(26), + /** + * Connection error. + */ ERR_CONNECTION_ERROR(27), + /** + * Can't acquire resource error. + */ ERR_CANT_ACQUIRE_RESOURCE(28), + /** + * Can't fork process error. + */ ERR_CANT_FORK(29), + /** + * Invalid data error. + */ ERR_INVALID_DATA(30), + /** + * Invalid parameter error. + */ ERR_INVALID_PARAMETER(31), + /** + * Already exists error. + */ ERR_ALREADY_EXISTS(32), + /** + * Does not exist error. + */ ERR_DOES_NOT_EXIST(33), + /** + * Database: Read error. + */ ERR_DATABASE_CANT_READ(34), + /** + * Database: Write error. + */ ERR_DATABASE_CANT_WRITE(35), + /** + * Compilation failed error. + */ ERR_COMPILATION_FAILED(36), + /** + * Method not found error. + */ ERR_METHOD_NOT_FOUND(37), + /** + * Linking failed error. + */ ERR_LINK_FAILED(38), + /** + * Script failed error. + */ ERR_SCRIPT_FAILED(39), + /** + * Cycling link (import cycle) error. + */ ERR_CYCLIC_LINK(40), + /** + * Invalid declaration error. + */ ERR_INVALID_DECLARATION(41), + /** + * Duplicate symbol error. + */ ERR_DUPLICATE_SYMBOL(42), + /** + * Parse error. + */ ERR_PARSE_ERROR(43), + /** + * Busy error. + */ ERR_BUSY(44), + /** + * Skip error. + */ ERR_SKIP(45), + /** + * Help error. Used internally when passing `--version` or `--help` as executable options. + */ ERR_HELP(46), + /** + * Bug error, caused by an implementation issue in the method. + * **Note:** If a built-in method returns this code, please open an issue on + * [url=https://github.com/godotengine/godot/issues]the GitHub Issue Tracker[/url]. + */ ERR_BUG(47), + /** + * Printer on fire error (This is an easter egg, no built-in methods return this error code). + */ ERR_PRINTER_ON_FIRE(48), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/EulerOrder.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/EulerOrder.kt index 5b5839b27..f59eff878 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/EulerOrder.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/EulerOrder.kt @@ -6,11 +6,35 @@ import kotlin.Long public enum class EulerOrder( id: Long, ) { + /** + * Specifies that Euler angles should be in XYZ order. When composing, the order is X, Y, Z. When + * decomposing, the order is reversed, first Z, then Y, and X last. + */ EULER_ORDER_XYZ(0), + /** + * Specifies that Euler angles should be in XZY order. When composing, the order is X, Z, Y. When + * decomposing, the order is reversed, first Y, then Z, and X last. + */ EULER_ORDER_XZY(1), + /** + * Specifies that Euler angles should be in YXZ order. When composing, the order is Y, X, Z. When + * decomposing, the order is reversed, first Z, then X, and Y last. + */ EULER_ORDER_YXZ(2), + /** + * Specifies that Euler angles should be in YZX order. When composing, the order is Y, Z, X. When + * decomposing, the order is reversed, first X, then Z, and Y last. + */ EULER_ORDER_YZX(3), + /** + * Specifies that Euler angles should be in ZXY order. When composing, the order is Z, X, Y. When + * decomposing, the order is reversed, first Y, then X, and Z last. + */ EULER_ORDER_ZXY(4), + /** + * Specifies that Euler angles should be in ZYX order. When composing, the order is Z, Y, X. When + * decomposing, the order is reversed, first X, then Y, and Z last. + */ EULER_ORDER_ZYX(5), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Expression.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Expression.kt index a4c229b8c..f9ac51d66 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Expression.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Expression.kt @@ -29,96 +29,52 @@ import kotlin.Suppress import kotlin.jvm.JvmOverloads /** - * A class that stores an expression you can execute. - * - * Tutorials: - * [$DOCS_URL/tutorials/scripting/evaluating_expressions.html]($DOCS_URL/tutorials/scripting/evaluating_expressions.html) - * - * An expression can be made of any arithmetic operation, built-in math function call, method call of a passed instance, or built-in type construction call. - * - * An example expression text using the built-in math functions could be `sqrt(pow(3, 2) + pow(4, 2))`. - * - * In the following example we use a [godot.LineEdit] node to write our expression and show the result. - * - * [codeblocks] - * - * [gdscript] - * + * An expression can be made of any arithmetic operation, built-in math function call, method call + * of a passed instance, or built-in type construction call. + * An example expression text using the built-in math functions could be `sqrt(pow(3, 2) + pow(4, + * 2))`. + * In the following example we use a [LineEdit] node to write our expression and show the result. + * + * gdscript: + * ```gdscript * var expression = Expression.new() * - * - * * func _ready(): - * * $LineEdit.text_submitted.connect(self._on_text_submitted) * - * - * * func _on_text_submitted(command): - * * var error = expression.parse(command) - * * if error != OK: - * * print(expression.get_error_text()) - * * return - * * var result = expression.execute() - * * if not expression.has_execute_failed(): - * * $LineEdit.text = str(result) - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * private Expression _expression = new Expression(); * - * - * * public override void _Ready() - * * { - * * GetNode("LineEdit").TextSubmitted += OnTextEntered; - * * } * - * - * * private void OnTextEntered(string command) - * * { - * * Error error = _expression.Parse(command); - * * if (error != Error.Ok) - * * { - * * GD.Print(_expression.GetErrorText()); - * * return; - * * } - * * Variant result = _expression.Execute(); - * * if (!_expression.HasExecuteFailed()) - * * { - * * GetNode("LineEdit").Text = result.ToString(); - * * } - * * } - * - * [/csharp] - * - * [/codeblocks] + * ``` */ @GodotBaseType public open class Expression : RefCounted() { @@ -129,8 +85,8 @@ public open class Expression : RefCounted() { /** * Parses the expression and returns an [enum Error] code. - * - * You can optionally specify names of variables that may appear in the expression with [inputNames], so that you can bind them when it gets executed. + * You can optionally specify names of variables that may appear in the expression with [param + * input_names], so that you can bind them when it gets executed. */ @JvmOverloads public fun parse(expression: String, inputNames: PackedStringArray = PackedStringArray()): @@ -141,9 +97,10 @@ public open class Expression : RefCounted() { } /** - * Executes the expression that was previously parsed by [parse] and returns the result. Before you use the returned object, you should check if the method failed by calling [hasExecuteFailed]. - * - * If you defined input variables in [parse], you can specify their values in the inputs array, in the same order. + * Executes the expression that was previously parsed by [parse] and returns the result. Before + * you use the returned object, you should check if the method failed by calling [hasExecuteFailed]. + * If you defined input variables in [parse], you can specify their values in the inputs array, in + * the same order. */ @JvmOverloads public fun execute( diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/FastNoiseLite.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/FastNoiseLite.kt index 5a0dc85a4..5e1dd928e 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/FastNoiseLite.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/FastNoiseLite.kt @@ -26,8 +26,17 @@ import kotlin.Long import kotlin.Suppress import kotlin.Unit +/** + * This class generates noise using the FastNoiseLite library, which is a collection of several + * noise algorithms including Cellular, Perlin, Value, and more. + * Most generated noise values are in the range of `[-1, 1]`, but not always. Some of the cellular + * noise algorithms return results above `1`. + */ @GodotBaseType public open class FastNoiseLite : Noise() { + /** + * The noise algorithm used. See [enum NoiseType]. + */ public var noiseType: NoiseType get() { TransferContext.writeArguments() @@ -39,6 +48,9 @@ public open class FastNoiseLite : Noise() { TransferContext.callMethod(rawPtr, MethodBindings.setNoiseTypePtr, NIL) } + /** + * The random number seed for all noise types. + */ public var seed: Int get() { TransferContext.writeArguments() @@ -50,6 +62,10 @@ public open class FastNoiseLite : Noise() { TransferContext.callMethod(rawPtr, MethodBindings.setSeedPtr, NIL) } + /** + * The frequency for all noise types. Low frequency results in smooth noise while high frequency + * results in rougher, more granular noise. + */ public var frequency: Float get() { TransferContext.writeArguments() @@ -61,6 +77,9 @@ public open class FastNoiseLite : Noise() { TransferContext.callMethod(rawPtr, MethodBindings.setFrequencyPtr, NIL) } + /** + * Translate the noise input coordinates by the given [Vector3]. + */ @CoreTypeLocalCopy public var offset: Vector3 get() { @@ -73,6 +92,9 @@ public open class FastNoiseLite : Noise() { TransferContext.callMethod(rawPtr, MethodBindings.setOffsetPtr, NIL) } + /** + * The method for combining octaves into a fractal. See [enum FractalType]. + */ public var fractalType: FractalType get() { TransferContext.writeArguments() @@ -84,6 +106,9 @@ public open class FastNoiseLite : Noise() { TransferContext.callMethod(rawPtr, MethodBindings.setFractalTypePtr, NIL) } + /** + * The number of noise layers that are sampled to get the final value for fractal noise types. + */ public var fractalOctaves: Int get() { TransferContext.writeArguments() @@ -95,6 +120,10 @@ public open class FastNoiseLite : Noise() { TransferContext.callMethod(rawPtr, MethodBindings.setFractalOctavesPtr, NIL) } + /** + * Frequency multiplier between subsequent octaves. Increasing this value results in higher + * octaves producing noise with finer details and a rougher appearance. + */ public var fractalLacunarity: Float get() { TransferContext.writeArguments() @@ -106,6 +135,11 @@ public open class FastNoiseLite : Noise() { TransferContext.callMethod(rawPtr, MethodBindings.setFractalLacunarityPtr, NIL) } + /** + * Determines the strength of each subsequent layer of noise in fractal noise. + * A low value places more emphasis on the lower frequency base layers, while a high value puts + * more emphasis on the higher frequency layers. + */ public var fractalGain: Float get() { TransferContext.writeArguments() @@ -117,6 +151,9 @@ public open class FastNoiseLite : Noise() { TransferContext.callMethod(rawPtr, MethodBindings.setFractalGainPtr, NIL) } + /** + * Higher weighting means higher octaves have less impact if lower octaves have a large impact. + */ public var fractalWeightedStrength: Float get() { TransferContext.writeArguments() @@ -128,6 +165,9 @@ public open class FastNoiseLite : Noise() { TransferContext.callMethod(rawPtr, MethodBindings.setFractalWeightedStrengthPtr, NIL) } + /** + * Sets the strength of the fractal ping pong type. + */ public var fractalPingPongStrength: Float get() { TransferContext.writeArguments() @@ -139,6 +179,10 @@ public open class FastNoiseLite : Noise() { TransferContext.callMethod(rawPtr, MethodBindings.setFractalPingPongStrengthPtr, NIL) } + /** + * Determines how the distance to the nearest/second-nearest point is computed. See [enum + * CellularDistanceFunction] for options. + */ public var cellularDistanceFunction: CellularDistanceFunction get() { TransferContext.writeArguments() @@ -150,6 +194,9 @@ public open class FastNoiseLite : Noise() { TransferContext.callMethod(rawPtr, MethodBindings.setCellularDistanceFunctionPtr, NIL) } + /** + * Maximum distance a point can move off of its grid position. Set to `0` for an even grid. + */ public var cellularJitter: Float get() { TransferContext.writeArguments() @@ -161,6 +208,9 @@ public open class FastNoiseLite : Noise() { TransferContext.callMethod(rawPtr, MethodBindings.setCellularJitterPtr, NIL) } + /** + * Return type from cellular noise calculations. See [enum CellularReturnType]. + */ public var cellularReturnType: CellularReturnType get() { TransferContext.writeArguments() @@ -172,6 +222,10 @@ public open class FastNoiseLite : Noise() { TransferContext.callMethod(rawPtr, MethodBindings.setCellularReturnTypePtr, NIL) } + /** + * If enabled, another FastNoiseLite instance is used to warp the space, resulting in a distortion + * of the noise. + */ public var domainWarpEnabled: Boolean get() { TransferContext.writeArguments() @@ -183,6 +237,9 @@ public open class FastNoiseLite : Noise() { TransferContext.callMethod(rawPtr, MethodBindings.setDomainWarpEnabledPtr, NIL) } + /** + * Sets the warp algorithm. See [enum DomainWarpType]. + */ public var domainWarpType: DomainWarpType get() { TransferContext.writeArguments() @@ -194,6 +251,9 @@ public open class FastNoiseLite : Noise() { TransferContext.callMethod(rawPtr, MethodBindings.setDomainWarpTypePtr, NIL) } + /** + * Sets the maximum warp distance from the origin. + */ public var domainWarpAmplitude: Float get() { TransferContext.writeArguments() @@ -205,6 +265,10 @@ public open class FastNoiseLite : Noise() { TransferContext.callMethod(rawPtr, MethodBindings.setDomainWarpAmplitudePtr, NIL) } + /** + * Frequency of the noise which warps the space. Low frequency results in smooth noise while high + * frequency results in rougher, more granular noise. + */ public var domainWarpFrequency: Float get() { TransferContext.writeArguments() @@ -216,6 +280,10 @@ public open class FastNoiseLite : Noise() { TransferContext.callMethod(rawPtr, MethodBindings.setDomainWarpFrequencyPtr, NIL) } + /** + * The method for combining octaves into a fractal which is used to warp the space. See [enum + * DomainWarpFractalType]. + */ public var domainWarpFractalType: DomainWarpFractalType get() { TransferContext.writeArguments() @@ -227,6 +295,10 @@ public open class FastNoiseLite : Noise() { TransferContext.callMethod(rawPtr, MethodBindings.setDomainWarpFractalTypePtr, NIL) } + /** + * The number of noise layers that are sampled to get the final value for the fractal noise which + * warps the space. + */ public var domainWarpFractalOctaves: Int get() { TransferContext.writeArguments() @@ -238,6 +310,10 @@ public open class FastNoiseLite : Noise() { TransferContext.callMethod(rawPtr, MethodBindings.setDomainWarpFractalOctavesPtr, NIL) } + /** + * Octave lacunarity of the fractal noise which warps the space. Increasing this value results in + * higher octaves producing noise with finer details and a rougher appearance. + */ public var domainWarpFractalLacunarity: Float get() { TransferContext.writeArguments() @@ -249,6 +325,11 @@ public open class FastNoiseLite : Noise() { TransferContext.callMethod(rawPtr, MethodBindings.setDomainWarpFractalLacunarityPtr, NIL) } + /** + * Determines the strength of each subsequent layer of the noise which is used to warp the space. + * A low value places more emphasis on the lower frequency base layers, while a high value puts + * more emphasis on the higher frequency layers. + */ public var domainWarpFractalGain: Float get() { TransferContext.writeArguments() @@ -266,6 +347,8 @@ public open class FastNoiseLite : Noise() { } /** + * Translate the noise input coordinates by the given [Vector3]. + * * This is a helper function to make dealing with local copies easier. * * For more information, see our @@ -290,11 +373,35 @@ public open class FastNoiseLite : Noise() { public enum class NoiseType( id: Long, ) { + /** + * A lattice of points are assigned random values then interpolated based on neighboring values. + */ TYPE_VALUE(5), + /** + * Similar to Value noise, but slower. Has more variance in peaks and valleys. + * Cubic noise can be used to avoid certain artifacts when using value noise to create a + * bumpmap. In general, you should always use this mode if the value noise is being used for a + * heightmap or bumpmap. + */ TYPE_VALUE_CUBIC(4), + /** + * A lattice of random gradients. Their dot products are interpolated to obtain values in + * between the lattices. + */ TYPE_PERLIN(3), + /** + * Cellular includes both Worley noise and Voronoi diagrams which creates various regions of the + * same value. + */ TYPE_CELLULAR(2), + /** + * As opposed to [constant TYPE_PERLIN], gradients exist in a simplex lattice rather than a grid + * lattice, avoiding directional artifacts. + */ TYPE_SIMPLEX(0), + /** + * Modified, higher quality version of [constant TYPE_SIMPLEX], but slower. + */ TYPE_SIMPLEX_SMOOTH(1), ; @@ -311,9 +418,21 @@ public open class FastNoiseLite : Noise() { public enum class FractalType( id: Long, ) { + /** + * No fractal noise. + */ FRACTAL_NONE(0), + /** + * Method using Fractional Brownian Motion to combine octaves into a fractal. + */ FRACTAL_FBM(1), + /** + * Method of combining octaves into a fractal resulting in a "ridged" look. + */ FRACTAL_RIDGED(2), + /** + * Method of combining octaves into a fractal with a ping pong effect. + */ FRACTAL_PING_PONG(3), ; @@ -330,9 +449,22 @@ public open class FastNoiseLite : Noise() { public enum class CellularDistanceFunction( id: Long, ) { + /** + * Euclidean distance to the nearest point. + */ DISTANCE_EUCLIDEAN(0), + /** + * Squared Euclidean distance to the nearest point. + */ DISTANCE_EUCLIDEAN_SQUARED(1), + /** + * Manhattan distance (taxicab metric) to the nearest point. + */ DISTANCE_MANHATTAN(2), + /** + * Blend of [constant DISTANCE_EUCLIDEAN] and [constant DISTANCE_MANHATTAN] to give curved cell + * boundaries + */ DISTANCE_HYBRID(3), ; @@ -349,12 +481,36 @@ public open class FastNoiseLite : Noise() { public enum class CellularReturnType( id: Long, ) { + /** + * The cellular distance function will return the same value for all points within a cell. + */ RETURN_CELL_VALUE(0), + /** + * The cellular distance function will return a value determined by the distance to the nearest + * point. + */ RETURN_DISTANCE(1), + /** + * The cellular distance function returns the distance to the second-nearest point. + */ RETURN_DISTANCE2(2), + /** + * The distance to the nearest point is added to the distance to the second-nearest point. + */ RETURN_DISTANCE2_ADD(3), + /** + * The distance to the nearest point is subtracted from the distance to the second-nearest + * point. + */ RETURN_DISTANCE2_SUB(4), + /** + * The distance to the nearest point is multiplied with the distance to the second-nearest + * point. + */ RETURN_DISTANCE2_MUL(5), + /** + * The distance to the nearest point is divided by the distance to the second-nearest point. + */ RETURN_DISTANCE2_DIV(6), ; @@ -371,8 +527,18 @@ public open class FastNoiseLite : Noise() { public enum class DomainWarpType( id: Long, ) { + /** + * The domain is warped using the simplex noise algorithm. + */ DOMAIN_WARP_SIMPLEX(0), + /** + * The domain is warped using a simplified version of the simplex noise algorithm. + */ DOMAIN_WARP_SIMPLEX_REDUCED(1), + /** + * The domain is warped using a simple noise grid (not as smooth as the other methods, but more + * performant). + */ DOMAIN_WARP_BASIC_GRID(2), ; @@ -389,8 +555,18 @@ public open class FastNoiseLite : Noise() { public enum class DomainWarpFractalType( id: Long, ) { + /** + * No fractal noise for warping the space. + */ DOMAIN_WARP_FRACTAL_NONE(0), + /** + * Warping the space progressively, octave for octave, resulting in a more "liquified" + * distortion. + */ DOMAIN_WARP_FRACTAL_PROGRESSIVE(1), + /** + * Warping the space independently for each octave, resulting in a more chaotic distortion. + */ DOMAIN_WARP_FRACTAL_INDEPENDENT(2), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/FlowContainer.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/FlowContainer.kt index 72a5363be..9cb622619 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/FlowContainer.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/FlowContainer.kt @@ -19,17 +19,15 @@ import kotlin.Long import kotlin.Suppress /** - * A container that arranges its child controls horizontally or vertically and wraps them around at the borders. - * - * Tutorials: - * [$DOCS_URL/tutorials/ui/gui_containers.html]($DOCS_URL/tutorials/ui/gui_containers.html) - * - * A container that arranges its child controls horizontally or vertically and wraps them around at the borders. This is similar to how text in a book wraps around when no more words can fit on a line. + * A container that arranges its child controls horizontally or vertically and wraps them around at + * the borders. This is similar to how text in a book wraps around when no more words can fit on a + * line. */ @GodotBaseType public open class FlowContainer : Container() { /** - * The alignment of the container's children (must be one of [ALIGNMENT_BEGIN], [ALIGNMENT_CENTER], or [ALIGNMENT_END]). + * The alignment of the container's children (must be one of [constant ALIGNMENT_BEGIN], [constant + * ALIGNMENT_CENTER], or [constant ALIGNMENT_END]). */ public var alignment: AlignmentMode get() { @@ -43,9 +41,8 @@ public open class FlowContainer : Container() { } /** - * If `true`, the [godot.FlowContainer] will arrange its children vertically, rather than horizontally. - * - * Can't be changed when using [godot.HFlowContainer] and [godot.VFlowContainer]. + * If `true`, the [FlowContainer] will arrange its children vertically, rather than horizontally. + * Can't be changed when using [HFlowContainer] and [VFlowContainer]. */ public var vertical: Boolean get() { @@ -76,7 +73,8 @@ public open class FlowContainer : Container() { id: Long, ) { /** - * The child controls will be arranged at the beginning of the container, i.e. top if orientation is vertical, left if orientation is horizontal (right for RTL layout). + * The child controls will be arranged at the beginning of the container, i.e. top if + * orientation is vertical, left if orientation is horizontal (right for RTL layout). */ ALIGNMENT_BEGIN(0), /** @@ -84,7 +82,8 @@ public open class FlowContainer : Container() { */ ALIGNMENT_CENTER(1), /** - * The child controls will be arranged at the end of the container, i.e. bottom if orientation is vertical, right if orientation is horizontal (left for RTL layout). + * The child controls will be arranged at the end of the container, i.e. bottom if orientation + * is vertical, right if orientation is horizontal (left for RTL layout). */ ALIGNMENT_END(2), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/FogMaterial.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/FogMaterial.kt index 85d29c935..f3f506281 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/FogMaterial.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/FogMaterial.kt @@ -25,18 +25,18 @@ import kotlin.Suppress import kotlin.Unit /** - * A material that controls how volumetric fog is rendered, to be assigned to a [godot.FogVolume]. - * - * A [godot.Material] resource that can be used by [godot.FogVolume]s to draw volumetric effects. - * - * If you need more advanced effects, use a custom [fog shader]($DOCS_URL/tutorials/shaders/shader_reference/fog_shader.html). + * A [Material] resource that can be used by [FogVolume]s to draw volumetric effects. + * If you need more advanced effects, use a custom + * [url=$DOCS_URL/tutorials/shaders/shader_reference/fog_shader.html]fog shader[/url]. */ @GodotBaseType public open class FogMaterial : Material() { /** - * The density of the [godot.FogVolume]. Denser objects are more opaque, but may suffer from under-sampling artifacts that look like stripes. Negative values can be used to subtract fog from other [godot.FogVolume]s or global volumetric fog. - * - * **Note:** Due to limited precision, [density] values between `-0.001` and `0.001` (exclusive) act like `0.0`. This does not apply to [godot.Environment.volumetricFogDensity]. + * The density of the [FogVolume]. Denser objects are more opaque, but may suffer from + * under-sampling artifacts that look like stripes. Negative values can be used to subtract fog from + * other [FogVolume]s or global volumetric fog. + * **Note:** Due to limited precision, [density] values between `-0.001` and `0.001` (exclusive) + * act like `0.0`. This does not apply to [Environment.volumetricFogDensity]. */ public var density: Float get() { @@ -50,7 +50,9 @@ public open class FogMaterial : Material() { } /** - * The single-scattering [godot.core.Color] of the [godot.FogVolume]. Internally, [albedo] is converted into single-scattering, which is additively blended with other [godot.FogVolume]s and the [godot.Environment.volumetricFogAlbedo]. + * The single-scattering [Color] of the [FogVolume]. Internally, [albedo] is converted into + * single-scattering, which is additively blended with other [FogVolume]s and the + * [Environment.volumetricFogAlbedo]. */ @CoreTypeLocalCopy public var albedo: Color @@ -65,7 +67,9 @@ public open class FogMaterial : Material() { } /** - * The [godot.core.Color] of the light emitted by the [godot.FogVolume]. Emitted light will not cast light or shadows on other objects, but can be useful for modulating the [godot.core.Color] of the [godot.FogVolume] independently from light sources. + * The [Color] of the light emitted by the [FogVolume]. Emitted light will not cast light or + * shadows on other objects, but can be useful for modulating the [Color] of the [FogVolume] + * independently from light sources. */ @CoreTypeLocalCopy public var emission: Color @@ -80,7 +84,10 @@ public open class FogMaterial : Material() { } /** - * The rate by which the height-based fog decreases in density as height increases in world space. A high falloff will result in a sharp transition, while a low falloff will result in a smoother transition. A value of `0.0` results in uniform-density fog. The height threshold is determined by the height of the associated [godot.FogVolume]. + * The rate by which the height-based fog decreases in density as height increases in world space. + * A high falloff will result in a sharp transition, while a low falloff will result in a smoother + * transition. A value of `0.0` results in uniform-density fog. The height threshold is determined by + * the height of the associated [FogVolume]. */ public var heightFalloff: Float get() { @@ -94,7 +101,8 @@ public open class FogMaterial : Material() { } /** - * The hardness of the edges of the [godot.FogVolume]. A higher value will result in softer edges, while a lower value will result in harder edges. + * The hardness of the edges of the [FogVolume]. A higher value will result in softer edges, while + * a lower value will result in harder edges. */ public var edgeFade: Float get() { @@ -108,7 +116,9 @@ public open class FogMaterial : Material() { } /** - * The 3D texture that is used to scale the [density] of the [godot.FogVolume]. This can be used to vary fog density within the [godot.FogVolume] with any kind of static pattern. For animated effects, consider using a custom [fog shader]($DOCS_URL/tutorials/shaders/shader_reference/fog_shader.html). + * The 3D texture that is used to scale the [density] of the [FogVolume]. This can be used to vary + * fog density within the [FogVolume] with any kind of static pattern. For animated effects, consider + * using a custom [url=$DOCS_URL/tutorials/shaders/shader_reference/fog_shader.html]fog shader[/url]. */ public var densityTexture: Texture3D? get() { @@ -127,7 +137,9 @@ public open class FogMaterial : Material() { } /** - * The single-scattering [godot.core.Color] of the [godot.FogVolume]. Internally, [albedo] is converted into single-scattering, which is additively blended with other [godot.FogVolume]s and the [godot.Environment.volumetricFogAlbedo]. + * The single-scattering [Color] of the [FogVolume]. Internally, [albedo] is converted into + * single-scattering, which is additively blended with other [FogVolume]s and the + * [Environment.volumetricFogAlbedo]. * * This is a helper function to make dealing with local copies easier. * @@ -151,7 +163,9 @@ public open class FogMaterial : Material() { /** - * The [godot.core.Color] of the light emitted by the [godot.FogVolume]. Emitted light will not cast light or shadows on other objects, but can be useful for modulating the [godot.core.Color] of the [godot.FogVolume] independently from light sources. + * The [Color] of the light emitted by the [FogVolume]. Emitted light will not cast light or + * shadows on other objects, but can be useful for modulating the [Color] of the [FogVolume] + * independently from light sources. * * This is a helper function to make dealing with local copies easier. * diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/FogVolume.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/FogVolume.kt index 26806082f..6c62e13d0 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/FogVolume.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/FogVolume.kt @@ -24,25 +24,32 @@ import kotlin.Suppress import kotlin.Unit /** - * A region that contributes to the default volumetric fog from the world environment. - * - * Tutorials: - * [$DOCS_URL/tutorials/3d/volumetric_fog.html]($DOCS_URL/tutorials/3d/volumetric_fog.html) - * - * [godot.FogVolume]s are used to add localized fog into the global volumetric fog effect. [godot.FogVolume]s can also remove volumetric fog from specific areas if using a [godot.FogMaterial] with a negative [godot.FogMaterial.density]. - * - * Performance of [godot.FogVolume]s is directly related to their relative size on the screen and the complexity of their attached [godot.FogMaterial]. It is best to keep [godot.FogVolume]s relatively small and simple where possible. - * - * **Note:** [godot.FogVolume]s only have a visible effect if [godot.Environment.volumetricFogEnabled] is `true`. If you don't want fog to be globally visible (but only within [godot.FogVolume] nodes), set [godot.Environment.volumetricFogDensity] to `0.0`. + * [FogVolume]s are used to add localized fog into the global volumetric fog effect. [FogVolume]s + * can also remove volumetric fog from specific areas if using a [FogMaterial] with a negative + * [FogMaterial.density]. + * Performance of [FogVolume]s is directly related to their relative size on the screen and the + * complexity of their attached [FogMaterial]. It is best to keep [FogVolume]s relatively small and + * simple where possible. + * **Note:** [FogVolume]s only have a visible effect if [Environment.volumetricFogEnabled] is + * `true`. If you don't want fog to be globally visible (but only within [FogVolume] nodes), set + * [Environment.volumetricFogDensity] to `0.0`. */ @GodotBaseType public open class FogVolume : VisualInstance3D() { /** - * The size of the [godot.FogVolume] when [shape] is [godot.RenderingServer.FOG_VOLUME_SHAPE_ELLIPSOID], [godot.RenderingServer.FOG_VOLUME_SHAPE_CONE], [godot.RenderingServer.FOG_VOLUME_SHAPE_CYLINDER] or [godot.RenderingServer.FOG_VOLUME_SHAPE_BOX]. - * - * **Note:** Thin fog volumes may appear to flicker when the camera moves or rotates. This can be alleviated by increasing [godot.ProjectSettings.rendering/environment/volumetricFog/volumeDepth] (at a performance cost) or by decreasing [godot.Environment.volumetricFogLength] (at no performance cost, but at the cost of lower fog range). Alternatively, the [godot.FogVolume] can be made thicker and use a lower density in the [material]. - * - * **Note:** If [shape] is [godot.RenderingServer.FOG_VOLUME_SHAPE_CONE] or [godot.RenderingServer.FOG_VOLUME_SHAPE_CYLINDER], the cone/cylinder will be adjusted to fit within the size. Non-uniform scaling of cone/cylinder shapes via the [size] property is not supported, but you can scale the [godot.FogVolume] node instead. + * The size of the [FogVolume] when [shape] is [constant + * RenderingServer.FOG_VOLUME_SHAPE_ELLIPSOID], [constant RenderingServer.FOG_VOLUME_SHAPE_CONE], + * [constant RenderingServer.FOG_VOLUME_SHAPE_CYLINDER] or [constant + * RenderingServer.FOG_VOLUME_SHAPE_BOX]. + * **Note:** Thin fog volumes may appear to flicker when the camera moves or rotates. This can be + * alleviated by increasing [ProjectSettings.rendering/environment/volumetricFog/volumeDepth] (at a + * performance cost) or by decreasing [Environment.volumetricFogLength] (at no performance cost, but + * at the cost of lower fog range). Alternatively, the [FogVolume] can be made thicker and use a + * lower density in the [material]. + * **Note:** If [shape] is [constant RenderingServer.FOG_VOLUME_SHAPE_CONE] or [constant + * RenderingServer.FOG_VOLUME_SHAPE_CYLINDER], the cone/cylinder will be adjusted to fit within the + * size. Non-uniform scaling of cone/cylinder shapes via the [size] property is not supported, but + * you can scale the [FogVolume] node instead. */ @CoreTypeLocalCopy public var size: Vector3 @@ -57,7 +64,10 @@ public open class FogVolume : VisualInstance3D() { } /** - * The shape of the [godot.FogVolume]. This can be set to either [godot.RenderingServer.FOG_VOLUME_SHAPE_ELLIPSOID], [godot.RenderingServer.FOG_VOLUME_SHAPE_CONE], [godot.RenderingServer.FOG_VOLUME_SHAPE_CYLINDER], [godot.RenderingServer.FOG_VOLUME_SHAPE_BOX] or [godot.RenderingServer.FOG_VOLUME_SHAPE_WORLD]. + * The shape of the [FogVolume]. This can be set to either [constant + * RenderingServer.FOG_VOLUME_SHAPE_ELLIPSOID], [constant RenderingServer.FOG_VOLUME_SHAPE_CONE], + * [constant RenderingServer.FOG_VOLUME_SHAPE_CYLINDER], [constant + * RenderingServer.FOG_VOLUME_SHAPE_BOX] or [constant RenderingServer.FOG_VOLUME_SHAPE_WORLD]. */ public var shape: RenderingServer.FogVolumeShape get() { @@ -71,7 +81,8 @@ public open class FogVolume : VisualInstance3D() { } /** - * The [godot.Material] used by the [godot.FogVolume]. Can be either a built-in [godot.FogMaterial] or a custom [godot.ShaderMaterial]. + * The [Material] used by the [FogVolume]. Can be either a built-in [FogMaterial] or a custom + * [ShaderMaterial]. */ public var material: Material? get() { @@ -90,11 +101,19 @@ public open class FogVolume : VisualInstance3D() { } /** - * The size of the [godot.FogVolume] when [shape] is [godot.RenderingServer.FOG_VOLUME_SHAPE_ELLIPSOID], [godot.RenderingServer.FOG_VOLUME_SHAPE_CONE], [godot.RenderingServer.FOG_VOLUME_SHAPE_CYLINDER] or [godot.RenderingServer.FOG_VOLUME_SHAPE_BOX]. - * - * **Note:** Thin fog volumes may appear to flicker when the camera moves or rotates. This can be alleviated by increasing [godot.ProjectSettings.rendering/environment/volumetricFog/volumeDepth] (at a performance cost) or by decreasing [godot.Environment.volumetricFogLength] (at no performance cost, but at the cost of lower fog range). Alternatively, the [godot.FogVolume] can be made thicker and use a lower density in the [material]. - * - * **Note:** If [shape] is [godot.RenderingServer.FOG_VOLUME_SHAPE_CONE] or [godot.RenderingServer.FOG_VOLUME_SHAPE_CYLINDER], the cone/cylinder will be adjusted to fit within the size. Non-uniform scaling of cone/cylinder shapes via the [size] property is not supported, but you can scale the [godot.FogVolume] node instead. + * The size of the [FogVolume] when [shape] is [constant + * RenderingServer.FOG_VOLUME_SHAPE_ELLIPSOID], [constant RenderingServer.FOG_VOLUME_SHAPE_CONE], + * [constant RenderingServer.FOG_VOLUME_SHAPE_CYLINDER] or [constant + * RenderingServer.FOG_VOLUME_SHAPE_BOX]. + * **Note:** Thin fog volumes may appear to flicker when the camera moves or rotates. This can be + * alleviated by increasing [ProjectSettings.rendering/environment/volumetricFog/volumeDepth] (at a + * performance cost) or by decreasing [Environment.volumetricFogLength] (at no performance cost, but + * at the cost of lower fog range). Alternatively, the [FogVolume] can be made thicker and use a + * lower density in the [material]. + * **Note:** If [shape] is [constant RenderingServer.FOG_VOLUME_SHAPE_CONE] or [constant + * RenderingServer.FOG_VOLUME_SHAPE_CYLINDER], the cone/cylinder will be adjusted to fit within the + * size. Non-uniform scaling of cone/cylinder shapes via the [size] property is not supported, but + * you can scale the [FogVolume] node instead. * * This is a helper function to make dealing with local copies easier. * diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/FontVariation.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/FontVariation.kt index 32c589a00..252303265 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/FontVariation.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/FontVariation.kt @@ -32,57 +32,39 @@ import kotlin.Unit import kotlin.jvm.JvmName /** - * A variation of a font with additional settings. - * - * Provides OpenType variations, simulated bold / slant, and additional font settings like OpenType features and extra spacing. - * + * Provides OpenType variations, simulated bold / slant, and additional font settings like OpenType + * features and extra spacing. * To use simulated bold font variant: * - * [codeblocks] - * - * [gdscript] - * + * gdscript: + * ```gdscript * var fv = FontVariation.new() - * * fv.set_base_font(load("res://BarlowCondensed-Regular.ttf")) - * * fv.set_variation_embolden(1.2) - * * $Label.add_theme_font_override("font", fv) - * * $Label.add_theme_font_size_override("font_size", 64) - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * var fv = new FontVariation(); - * * fv.SetBaseFont(ResourceLoader.Load("res://BarlowCondensed-Regular.ttf")); - * * fv.SetVariationEmbolden(1.2); - * * GetNode("Label").AddThemeFontOverride("font", fv); - * * GetNode("Label").AddThemeFontSizeOverride("font_size", 64); - * - * [/csharp] - * - * [/codeblocks] + * ``` * * To set the coordinate of multiple variation axes: - * - * ``` - * var fv = FontVariation.new(); - * var ts = TextServerManager.get_primary_interface() - * fv.base_font = load("res://BarlowCondensed-Regular.ttf") - * fv.variation_opentype = { ts.name_to_tag("wght"): 900, ts.name_to_tag("custom_hght"): 900 } - * ``` + * [codeblock] + * var fv = FontVariation.new(); + * var ts = TextServerManager.get_primary_interface() + * fv.base_font = load("res://BarlowCondensed-Regular.ttf") + * fv.variation_opentype = { ts.name_to_tag("wght"): 900, ts.name_to_tag("custom_hght"): 900 } + * [/codeblock] */ @GodotBaseType public open class FontVariation : Font() { /** - * Base font used to create a variation. If not set, default [godot.Theme] font is used. + * Base font used to create a variation. If not set, default [Theme] font is used. */ public var baseFont: Font? get() { @@ -96,11 +78,15 @@ public open class FontVariation : Font() { } /** - * Font OpenType variation coordinates. More info: [godot.OpenType variation tags](https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg). - * - * **Note:** This [godot.core.Dictionary] uses OpenType tags as keys. Variation axes can be identified both by tags ([int], e.g. `0x77678674`) and names ([godot.String], e.g. `wght`). Some axes might be accessible by multiple names. For example, `wght` refers to the same axis as `weight`. Tags on the other hand are unique. To convert between names and tags, use [godot.TextServer.nameToTag] and [godot.TextServer.tagToName]. - * - * **Note:** To get available variation axes of a font, use [godot.Font.getSupportedVariationList]. + * Font OpenType variation coordinates. More info: + * [url=https://docs.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg]OpenType variation + * tags[/url]. + * **Note:** This [Dictionary] uses OpenType tags as keys. Variation axes can be identified both + * by tags ([int], e.g. `0x77678674`) and names ([String], e.g. `wght`). Some axes might be + * accessible by multiple names. For example, `wght` refers to the same axis as `weight`. Tags on the + * other hand are unique. To convert between names and tags, use [TextServer.nameToTag] and + * [TextServer.tagToName]. + * **Note:** To get available variation axes of a font, use [Font.getSupportedVariationList]. */ public var variationOpentype: Dictionary get() { @@ -128,9 +114,10 @@ public open class FontVariation : Font() { } /** - * If is not equal to zero, emboldens the font outlines. Negative values reduce the outline thickness. - * - * **Note:** Emboldened fonts might have self-intersecting outlines, which will prevent MSDF fonts and [godot.TextMesh] from working correctly. + * If is not equal to zero, emboldens the font outlines. Negative values reduce the outline + * thickness. + * **Note:** Emboldened fonts might have self-intersecting outlines, which will prevent MSDF fonts + * and [TextMesh] from working correctly. */ public var variationEmbolden: Float get() { @@ -144,9 +131,10 @@ public open class FontVariation : Font() { } /** - * 2D transform, applied to the font outlines, can be used for slanting, flipping and rotating glyphs. - * - * For example, to simulate italic typeface by slanting, apply the following transform `Transform2D(1.0, slant, 0.0, 1.0, 0.0, 0.0)`. + * 2D transform, applied to the font outlines, can be used for slanting, flipping and rotating + * glyphs. + * For example, to simulate italic typeface by slanting, apply the following transform + * `Transform2D(1.0, slant, 0.0, 1.0, 0.0, 0.0)`. */ @CoreTypeLocalCopy public var variationTransform: Transform2D @@ -161,7 +149,9 @@ public open class FontVariation : Font() { } /** - * A set of OpenType feature tags. More info: [godot.OpenType feature tags](https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags). + * A set of OpenType feature tags. More info: + * [url=https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags]OpenType feature + * tags[/url]. */ public var opentypeFeatures: Dictionary @JvmName("getOpentypeFeatures_prop") @@ -228,9 +218,10 @@ public open class FontVariation : Font() { } /** - * 2D transform, applied to the font outlines, can be used for slanting, flipping and rotating glyphs. - * - * For example, to simulate italic typeface by slanting, apply the following transform `Transform2D(1.0, slant, 0.0, 1.0, 0.0, 0.0)`. + * 2D transform, applied to the font outlines, can be used for slanting, flipping and rotating + * glyphs. + * For example, to simulate italic typeface by slanting, apply the following transform + * `Transform2D(1.0, slant, 0.0, 1.0, 0.0, 0.0)`. * * This is a helper function to make dealing with local copies easier. * diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/GDExtension.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/GDExtension.kt index 6a8c4e804..ba1736bfe 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/GDExtension.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/GDExtension.kt @@ -22,9 +22,6 @@ import kotlin.String import kotlin.Suppress import kotlin.Unit -/** - * - */ @GodotBaseType public open class GDExtension : Resource() { public override fun new(scriptIndex: Int): Boolean { @@ -32,44 +29,29 @@ public open class GDExtension : Resource() { return true } - /** - * - */ public fun openLibrary(path: String, entrySymbol: String): GodotError { TransferContext.writeArguments(STRING to path, STRING to entrySymbol) TransferContext.callMethod(rawPtr, MethodBindings.openLibraryPtr, LONG) return GodotError.from(TransferContext.readReturnValue(LONG) as Long) } - /** - * - */ public fun closeLibrary(): Unit { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.closeLibraryPtr, NIL) } - /** - * - */ public fun isLibraryOpen(): Boolean { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.isLibraryOpenPtr, BOOL) return (TransferContext.readReturnValue(BOOL, false) as Boolean) } - /** - * - */ public fun getMinimumLibraryInitializationLevel(): InitializationLevel { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getMinimumLibraryInitializationLevelPtr, LONG) return GDExtension.InitializationLevel.from(TransferContext.readReturnValue(LONG) as Long) } - /** - * - */ public fun initializeLibrary(level: InitializationLevel): Unit { TransferContext.writeArguments(LONG to level.id) TransferContext.callMethod(rawPtr, MethodBindings.initializeLibraryPtr, NIL) @@ -78,21 +60,9 @@ public open class GDExtension : Resource() { public enum class InitializationLevel( id: Long, ) { - /** - * - */ INITIALIZATION_LEVEL_CORE(0), - /** - * - */ INITIALIZATION_LEVEL_SERVERS(1), - /** - * - */ INITIALIZATION_LEVEL_SCENE(2), - /** - * - */ INITIALIZATION_LEVEL_EDITOR(3), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/GDExtensionManager.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/GDExtensionManager.kt index 361876cea..888574f2c 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/GDExtensionManager.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/GDExtensionManager.kt @@ -24,9 +24,6 @@ import kotlin.Long import kotlin.String import kotlin.Suppress -/** - * - */ @GodotBaseType public object GDExtensionManager : Object() { /** @@ -39,54 +36,36 @@ public object GDExtensionManager : Object() { return false } - /** - * - */ public fun loadExtension(path: String): LoadStatus { TransferContext.writeArguments(STRING to path) TransferContext.callMethod(rawPtr, MethodBindings.loadExtensionPtr, LONG) return GDExtensionManager.LoadStatus.from(TransferContext.readReturnValue(LONG) as Long) } - /** - * - */ public fun reloadExtension(path: String): LoadStatus { TransferContext.writeArguments(STRING to path) TransferContext.callMethod(rawPtr, MethodBindings.reloadExtensionPtr, LONG) return GDExtensionManager.LoadStatus.from(TransferContext.readReturnValue(LONG) as Long) } - /** - * - */ public fun unloadExtension(path: String): LoadStatus { TransferContext.writeArguments(STRING to path) TransferContext.callMethod(rawPtr, MethodBindings.unloadExtensionPtr, LONG) return GDExtensionManager.LoadStatus.from(TransferContext.readReturnValue(LONG) as Long) } - /** - * - */ public fun isExtensionLoaded(path: String): Boolean { TransferContext.writeArguments(STRING to path) TransferContext.callMethod(rawPtr, MethodBindings.isExtensionLoadedPtr, BOOL) return (TransferContext.readReturnValue(BOOL, false) as Boolean) } - /** - * - */ public fun getLoadedExtensions(): PackedStringArray { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getLoadedExtensionsPtr, PACKED_STRING_ARRAY) return (TransferContext.readReturnValue(PACKED_STRING_ARRAY, false) as PackedStringArray) } - /** - * - */ public fun getExtension(path: String): GDExtension? { TransferContext.writeArguments(STRING to path) TransferContext.callMethod(rawPtr, MethodBindings.getExtensionPtr, OBJECT) @@ -96,25 +75,10 @@ public object GDExtensionManager : Object() { public enum class LoadStatus( id: Long, ) { - /** - * - */ LOAD_STATUS_OK(0), - /** - * - */ LOAD_STATUS_FAILED(1), - /** - * - */ LOAD_STATUS_ALREADY_LOADED(2), - /** - * - */ LOAD_STATUS_NOT_LOADED(3), - /** - * - */ LOAD_STATUS_NEEDS_RESTART(4), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/GDScript.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/GDScript.kt index 17c414d3d..f097db86e 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/GDScript.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/GDScript.kt @@ -16,6 +16,13 @@ import kotlin.Boolean import kotlin.Int import kotlin.Suppress +/** + * A script implemented in the GDScript programming language, saved with the `.gd` extension. The + * script extends the functionality of all objects that instantiate it. + * Calling [new] creates a new instance of the script. [Object.setScript] extends an existing + * object, if that object's class matches one of the script's base classes. + * If you are looking for GDScript's built-in functions, see [@GDScript] instead. + */ @GodotBaseType public open class GDScript : Script() { public override fun new(scriptIndex: Int): Boolean { @@ -23,6 +30,15 @@ public open class GDScript : Script() { return true } + /** + * Returns a new instance of the script. + * For example: + * [codeblock] + * var MyClass = load("myclass.gd") + * var instance = MyClass.new() + * assert(instance.get_script() == MyClass) + * [/codeblock] + */ public fun new(vararg __var_args: Any?): Any? { TransferContext.writeArguments( *__var_args.map { ANY to it }.toTypedArray()) TransferContext.callMethod(rawPtr, MethodBindings.newPtr, ANY) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/GLTFCamera.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/GLTFCamera.kt index 1987a9d8b..823f80db5 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/GLTFCamera.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/GLTFCamera.kt @@ -23,8 +23,16 @@ import kotlin.Float import kotlin.Int import kotlin.Suppress +/** + * Represents a camera as defined by the base GLTF spec. + */ @GodotBaseType public open class GLTFCamera : Resource() { + /** + * Whether or not the camera is in perspective mode. If false, the camera is in + * orthographic/orthogonal mode. This maps to GLTF's camera `type` property. See + * [Camera3D.projection] and the GLTF spec for more information. + */ public var perspective: Boolean get() { TransferContext.writeArguments() @@ -36,6 +44,11 @@ public open class GLTFCamera : Resource() { TransferContext.callMethod(rawPtr, MethodBindings.setPerspectivePtr, NIL) } + /** + * The FOV of the camera. This class and GLTF define the camera FOV in radians, while Godot uses + * degrees. This maps to GLTF's `yfov` property. This value is only used for perspective cameras, + * when [perspective] is true. + */ public var fov: Float get() { TransferContext.writeArguments() @@ -47,6 +60,11 @@ public open class GLTFCamera : Resource() { TransferContext.callMethod(rawPtr, MethodBindings.setFovPtr, NIL) } + /** + * The size of the camera. This class and GLTF define the camera size magnitude as a radius in + * meters, while Godot defines it as a diameter in meters. This maps to GLTF's `ymag` property. This + * value is only used for orthographic/orthogonal cameras, when [perspective] is false. + */ public var sizeMag: Float get() { TransferContext.writeArguments() @@ -58,6 +76,10 @@ public open class GLTFCamera : Resource() { TransferContext.callMethod(rawPtr, MethodBindings.setSizeMagPtr, NIL) } + /** + * The distance to the far culling boundary for this camera relative to its local Z axis, in + * meters. This maps to GLTF's `zfar` property. + */ public var depthFar: Float get() { TransferContext.writeArguments() @@ -69,6 +91,10 @@ public open class GLTFCamera : Resource() { TransferContext.callMethod(rawPtr, MethodBindings.setDepthFarPtr, NIL) } + /** + * The distance to the near culling boundary for this camera relative to its local Z axis, in + * meters. This maps to GLTF's `znear` property. + */ public var depthNear: Float get() { TransferContext.writeArguments() @@ -85,12 +111,18 @@ public open class GLTFCamera : Resource() { return true } + /** + * Converts this GLTFCamera instance into a Godot [Camera3D] node. + */ public fun toNode(): Camera3D? { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.toNodePtr, OBJECT) return (TransferContext.readReturnValue(OBJECT, true) as Camera3D?) } + /** + * Serializes this GLTFCamera instance into a [Dictionary]. + */ public fun toDictionary(): Dictionary { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.toDictionaryPtr, DICTIONARY) @@ -98,12 +130,18 @@ public open class GLTFCamera : Resource() { } public companion object { + /** + * Create a new GLTFCamera instance from the given Godot [Camera3D] node. + */ public fun fromNode(cameraNode: Camera3D): GLTFCamera? { TransferContext.writeArguments(OBJECT to cameraNode) TransferContext.callMethod(0, MethodBindings.fromNodePtr, OBJECT) return (TransferContext.readReturnValue(OBJECT, true) as GLTFCamera?) } + /** + * Creates a new GLTFCamera instance by parsing the given [Dictionary]. + */ public fun fromDictionary(dictionary: Dictionary): GLTFCamera? { TransferContext.writeArguments(DICTIONARY to dictionary) TransferContext.callMethod(0, MethodBindings.fromDictionaryPtr, OBJECT) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/GLTFDocument.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/GLTFDocument.kt index 61f08e965..e9935602e 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/GLTFDocument.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/GLTFDocument.kt @@ -29,8 +29,26 @@ import kotlin.Suppress import kotlin.Unit import kotlin.jvm.JvmOverloads +/** + * GLTFDocument supports reading data from a glTF file, buffer, or Godot scene. This data can then + * be written to the filesystem, buffer, or used to create a Godot scene. + * All of the data in a GLTF scene is stored in the [GLTFState] class. GLTFDocument processes state + * objects, but does not contain any scene data itself. GLTFDocument has member variables to store + * export configuration settings such as the image format, but is otherwise stateless. Multiple scenes + * can be processed with the same settings using the same GLTFDocument object and different [GLTFState] + * objects. + * GLTFDocument can be extended with arbitrary functionality by extending the + * [GLTFDocumentExtension] class and registering it with GLTFDocument via + * [registerGltfDocumentExtension]. This allows for custom data to be imported and exported. + */ @GodotBaseType public open class GLTFDocument : Resource() { + /** + * The user-friendly name of the export image format. This is used when exporting the GLTF file, + * including writing to a file and writing to a byte array. + * By default, Godot allows the following options: "None", "PNG", "JPEG", "Lossless WebP", and + * "Lossy WebP". Support for more image formats can be added in [GLTFDocumentExtension] classes. + */ public var imageFormat: String get() { TransferContext.writeArguments() @@ -42,6 +60,11 @@ public open class GLTFDocument : Resource() { TransferContext.callMethod(rawPtr, MethodBindings.setImageFormatPtr, NIL) } + /** + * If [imageFormat] is a lossy image format, this determines the lossy quality of the image. On a + * range of `0.0` to `1.0`, where `0.0` is the lowest quality and `1.0` is the highest quality. A + * lossy quality of `1.0` is not the same as lossless. + */ public var lossyQuality: Float get() { TransferContext.writeArguments() @@ -53,6 +76,12 @@ public open class GLTFDocument : Resource() { TransferContext.callMethod(rawPtr, MethodBindings.setLossyQualityPtr, NIL) } + /** + * How to process the root node during export. See [enum RootNodeMode] for details. The default + * and recommended value is [constant ROOT_NODE_MODE_SINGLE_ROOT]. + * **Note:** Regardless of how the glTF file is exported, when importing, the root node type and + * name can be overridden in the scene import settings tab. + */ public var rootNodeMode: RootNodeMode get() { TransferContext.writeArguments() @@ -69,6 +98,12 @@ public open class GLTFDocument : Resource() { return true } + /** + * Takes a path to a GLTF file and imports the data at that file path to the given [GLTFState] + * object through the [param state] parameter. + * **Note:** The [param base_path] tells [appendFromFile] where to find dependencies and can be + * empty. + */ @JvmOverloads public fun appendFromFile( path: String, @@ -81,6 +116,12 @@ public open class GLTFDocument : Resource() { return GodotError.from(TransferContext.readReturnValue(LONG) as Long) } + /** + * Takes a [PackedByteArray] defining a GLTF and imports the data to the given [GLTFState] object + * through the [param state] parameter. + * **Note:** The [param base_path] tells [appendFromBuffer] where to find dependencies and can be + * empty. + */ @JvmOverloads public fun appendFromBuffer( bytes: PackedByteArray, @@ -93,6 +134,10 @@ public open class GLTFDocument : Resource() { return GodotError.from(TransferContext.readReturnValue(LONG) as Long) } + /** + * Takes a Godot Engine scene node and exports it and its descendants to the given [GLTFState] + * object through the [param state] parameter. + */ @JvmOverloads public fun appendFromScene( node: Node, @@ -104,6 +149,10 @@ public open class GLTFDocument : Resource() { return GodotError.from(TransferContext.readReturnValue(LONG) as Long) } + /** + * Takes a [GLTFState] object through the [param state] parameter and returns a Godot Engine scene + * node. + */ @JvmOverloads public fun generateScene( state: GLTFState, @@ -116,12 +165,22 @@ public open class GLTFDocument : Resource() { return (TransferContext.readReturnValue(OBJECT, true) as Node?) } + /** + * Takes a [GLTFState] object through the [param state] parameter and returns a GLTF + * [PackedByteArray]. + */ public fun generateBuffer(state: GLTFState): PackedByteArray { TransferContext.writeArguments(OBJECT to state) TransferContext.callMethod(rawPtr, MethodBindings.generateBufferPtr, PACKED_BYTE_ARRAY) return (TransferContext.readReturnValue(PACKED_BYTE_ARRAY, false) as PackedByteArray) } + /** + * Takes a [GLTFState] object through the [param state] parameter and writes a glTF file to the + * filesystem. + * **Note:** The extension of the glTF file determines if it is a .glb binary file or a .gltf + * file. + */ public fun writeToFilesystem(state: GLTFState, path: String): GodotError { TransferContext.writeArguments(OBJECT to state, STRING to path) TransferContext.callMethod(rawPtr, MethodBindings.writeToFilesystemPtr, LONG) @@ -131,8 +190,24 @@ public open class GLTFDocument : Resource() { public enum class RootNodeMode( id: Long, ) { + /** + * Treat the Godot scene's root node as the root node of the glTF file, and mark it as the + * single root node via the `GODOT_single_root` glTF extension. This will be parsed the same as + * [constant ROOT_NODE_MODE_KEEP_ROOT] if the implementation does not support `GODOT_single_root`. + */ ROOT_NODE_MODE_SINGLE_ROOT(0), + /** + * Treat the Godot scene's root node as the root node of the glTF file, but do not mark it as + * anything special. An extra root node will be generated when importing into Godot. This uses only + * vanilla glTF features. This is equivalent to the behavior in Godot 4.1 and earlier. + */ ROOT_NODE_MODE_KEEP_ROOT(1), + /** + * Treat the Godot scene's root node as the name of the glTF scene, and add all of its children + * as root nodes of the glTF file. This uses only vanilla glTF features. This avoids an extra root + * node, but only the name of the Godot scene's root node will be preserved, as it will not be + * saved as a node. + */ ROOT_NODE_MODE_MULTI_ROOT(2), ; @@ -147,6 +222,13 @@ public open class GLTFDocument : Resource() { } public companion object { + /** + * Registers the given [GLTFDocumentExtension] instance with GLTFDocument. If [param + * first_priority] is true, this extension will be run first. Otherwise, it will be run last. + * **Note:** Like GLTFDocument itself, all GLTFDocumentExtension classes must be stateless in + * order to function properly. If you need to store data, use the `set_additional_data` and + * `get_additional_data` methods in [GLTFState] or [GLTFNode]. + */ @JvmOverloads public fun registerGltfDocumentExtension(extension: GLTFDocumentExtension, firstPriority: Boolean = false): Unit { @@ -154,6 +236,9 @@ public open class GLTFDocument : Resource() { TransferContext.callMethod(0, MethodBindings.registerGltfDocumentExtensionPtr, NIL) } + /** + * Unregisters the given [GLTFDocumentExtension] instance. + */ public fun unregisterGltfDocumentExtension(extension: GLTFDocumentExtension): Unit { TransferContext.writeArguments(OBJECT to extension) TransferContext.callMethod(0, MethodBindings.unregisterGltfDocumentExtensionPtr, NIL) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/GLTFDocumentExtension.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/GLTFDocumentExtension.kt index 522d7b9d6..8fb55167b 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/GLTFDocumentExtension.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/GLTFDocumentExtension.kt @@ -22,6 +22,15 @@ import kotlin.String import kotlin.Suppress import kotlin.Unit +/** + * Extends the functionality of the [GLTFDocument] class by allowing you to run arbitrary code at + * various stages of GLTF import or export. + * To use, make a new class extending GLTFDocumentExtension, override any methods you need, make an + * instance of your class, and register it using [GLTFDocument.registerGltfDocumentExtension]. + * **Note:** Like GLTFDocument itself, all GLTFDocumentExtension classes must be stateless in order + * to function properly. If you need to store data, use the `set_additional_data` and + * `get_additional_data` methods in [GLTFState] or [GLTFNode]. + */ @GodotBaseType public open class GLTFDocumentExtension : Resource() { public override fun new(scriptIndex: Int): Boolean { @@ -29,14 +38,34 @@ public open class GLTFDocumentExtension : Resource() { return true } + /** + * Part of the import process. This method is run first, before all other parts of the import + * process. + * The return value is used to determine if this [GLTFDocumentExtension] instance should be used + * for importing a given GLTF file. If [constant OK], the import will use this + * [GLTFDocumentExtension] instance. If not overridden, [constant OK] is returned. + */ public open fun _importPreflight(state: GLTFState, extensions: PackedStringArray): GodotError { throw NotImplementedError("_import_preflight is not implemented for GLTFDocumentExtension") } + /** + * Part of the import process. This method is run after [_importPreflight] and before + * [_parseNodeExtensions]. + * Returns an array of the GLTF extensions supported by this GLTFDocumentExtension class. This is + * used to validate if a GLTF file with required extensions can be loaded. + */ public open fun _getSupportedExtensions(): PackedStringArray { throw NotImplementedError("_get_supported_extensions is not implemented for GLTFDocumentExtension") } + /** + * Part of the import process. This method is run after [_getSupportedExtensions] and before + * [_importPostParse]. + * Runs when parsing the node extensions of a GLTFNode. This method can be used to process the + * extension JSON data into a format that can be used by [_generateSceneNode]. The return value + * should be a member of the [enum Error] enum. + */ public open fun _parseNodeExtensions( state: GLTFState, gltfNode: GLTFNode, @@ -45,6 +74,12 @@ public open class GLTFDocumentExtension : Resource() { throw NotImplementedError("_parse_node_extensions is not implemented for GLTFDocumentExtension") } + /** + * Part of the import process. This method is run after [_parseNodeExtensions] and before + * [_parseTextureJson]. + * Runs when parsing image data from a GLTF file. The data could be sourced from a separate file, + * a URI, or a buffer, and then is passed as a byte array. + */ public open fun _parseImageData( state: GLTFState, imageData: PackedByteArray, @@ -54,10 +89,23 @@ public open class GLTFDocumentExtension : Resource() { throw NotImplementedError("_parse_image_data is not implemented for GLTFDocumentExtension") } + /** + * Returns the file extension to use for saving image data into, for example, `".png"`. If + * defined, when this extension is used to handle images, and the images are saved to a separate + * file, the image bytes will be copied to a file with this extension. If this is set, there should + * be a [ResourceImporter] class able to import the file. If not defined or empty, Godot will save + * the image into a PNG file. + */ public open fun _getImageFileExtension(): String { throw NotImplementedError("_get_image_file_extension is not implemented for GLTFDocumentExtension") } + /** + * Part of the import process. This method is run after [_parseImageData] and before + * [_generateSceneNode]. + * Runs when parsing the texture JSON from the GLTF textures array. This can be used to set the + * source image index to use as the texture. + */ public open fun _parseTextureJson( state: GLTFState, textureJson: Dictionary, @@ -66,6 +114,14 @@ public open class GLTFDocumentExtension : Resource() { throw NotImplementedError("_parse_texture_json is not implemented for GLTFDocumentExtension") } + /** + * Part of the import process. This method is run after [_importPostParse] and before + * [_importNode]. + * Runs when generating a Godot scene node from a GLTFNode. The returned node will be added to the + * scene tree. Multiple nodes can be generated in this step if they are added as a child of the + * returned node. + * **Note:** The [param scene_parent] parameter may be null if this is the single root node. + */ public open fun _generateSceneNode( state: GLTFState, gltfNode: GLTFNode, @@ -74,10 +130,21 @@ public open class GLTFDocumentExtension : Resource() { throw NotImplementedError("_generate_scene_node is not implemented for GLTFDocumentExtension") } + /** + * Part of the import process. This method is run after [_parseNodeExtensions] and before + * [_generateSceneNode]. + * This method can be used to modify any of the data imported so far, including any scene nodes, + * before running the final per-node import step. + */ public open fun _importPostParse(state: GLTFState): GodotError { throw NotImplementedError("_import_post_parse is not implemented for GLTFDocumentExtension") } + /** + * Part of the import process. This method is run after [_generateSceneNode] and before + * [_importPost]. + * This method can be used to make modifications to each of the generated Godot scene nodes. + */ public open fun _importNode( state: GLTFState, gltfNode: GLTFNode, @@ -87,14 +154,32 @@ public open class GLTFDocumentExtension : Resource() { throw NotImplementedError("_import_node is not implemented for GLTFDocumentExtension") } + /** + * Part of the import process. This method is run last, after all other parts of the import + * process. + * This method can be used to modify the final Godot scene generated by the import process. + */ public open fun _importPost(state: GLTFState, root: Node): GodotError { throw NotImplementedError("_import_post is not implemented for GLTFDocumentExtension") } + /** + * Part of the export process. This method is run first, before all other parts of the export + * process. + * The return value is used to determine if this [GLTFDocumentExtension] instance should be used + * for exporting a given GLTF file. If [constant OK], the export will use this + * [GLTFDocumentExtension] instance. If not overridden, [constant OK] is returned. + */ public open fun _exportPreflight(state: GLTFState, root: Node): GodotError { throw NotImplementedError("_export_preflight is not implemented for GLTFDocumentExtension") } + /** + * Part of the export process. This method is run after [_exportPreflight] and before + * [_exportPreserialize]. + * Runs when converting the data from a Godot scene node. This method can be used to process the + * Godot scene node data into a format that can be used by [_exportNode]. + */ public open fun _convertSceneNode( state: GLTFState, gltfNode: GLTFNode, @@ -102,14 +187,41 @@ public open class GLTFDocumentExtension : Resource() { ): Unit { } + /** + * Part of the export process. This method is run after [_convertSceneNode] and before + * [_getSaveableImageFormats]. + * This method can be used to alter the state before performing serialization. It runs every time + * when generating a buffer with [GLTFDocument.generateBuffer] or writing to the file system with + * [GLTFDocument.writeToFilesystem]. + */ public open fun _exportPreserialize(state: GLTFState): GodotError { throw NotImplementedError("_export_preserialize is not implemented for GLTFDocumentExtension") } + /** + * Part of the export process. This method is run after [_convertSceneNode] and before + * [_exportNode]. + * Returns an array of the image formats that can be saved/exported by this extension. This + * extension will only be selected as the image exporter if the [GLTFDocument]'s + * [GLTFDocument.imageFormat] is in this array. If this [GLTFDocumentExtension] is selected as the + * image exporter, one of the [_saveImageAtPath] or [_serializeImageToBytes] methods will run next, + * otherwise [_exportNode] will run next. If the format name contains `"Lossy"`, the lossy quality + * slider will be displayed. + */ public open fun _getSaveableImageFormats(): PackedStringArray { throw NotImplementedError("_get_saveable_image_formats is not implemented for GLTFDocumentExtension") } + /** + * Part of the export process. This method is run after [_getSaveableImageFormats] and before + * [_serializeTextureJson]. + * This method is run when embedding images in the GLTF file. When images are saved separately, + * [_saveImageAtPath] runs instead. Note that these methods only run when this + * [GLTFDocumentExtension] is selected as the image exporter. + * This method must set the image MIME type in the [param image_dict] with the `"mimeType"` key. + * For example, for a PNG image, it would be set to `"image/png"`. The return value must be a + * [PackedByteArray] containing the image data. + */ public open fun _serializeImageToBytes( state: GLTFState, image: Image, @@ -120,6 +232,13 @@ public open class GLTFDocumentExtension : Resource() { throw NotImplementedError("_serialize_image_to_bytes is not implemented for GLTFDocumentExtension") } + /** + * Part of the export process. This method is run after [_getSaveableImageFormats] and before + * [_serializeTextureJson]. + * This method is run when saving images separately from the GLTF file. When images are embedded, + * [_serializeImageToBytes] runs instead. Note that these methods only run when this + * [GLTFDocumentExtension] is selected as the image exporter. + */ public open fun _saveImageAtPath( state: GLTFState, image: Image, @@ -130,6 +249,15 @@ public open class GLTFDocumentExtension : Resource() { throw NotImplementedError("_save_image_at_path is not implemented for GLTFDocumentExtension") } + /** + * Part of the export process. This method is run after [_saveImageAtPath] or + * [_serializeImageToBytes], and before [_exportNode]. Note that this method only runs when this + * [GLTFDocumentExtension] is selected as the image exporter. + * This method can be used to set up the extensions for the texture JSON by editing [param + * texture_json]. The extension must also be added as used extension with + * [GLTFState.addUsedExtension], be sure to set `required` to `true` if you are not providing a + * fallback. + */ public open fun _serializeTextureJson( state: GLTFState, textureJson: Dictionary, @@ -139,6 +267,12 @@ public open class GLTFDocumentExtension : Resource() { throw NotImplementedError("_serialize_texture_json is not implemented for GLTFDocumentExtension") } + /** + * Part of the export process. This method is run after [_getSaveableImageFormats] and before + * [_exportPost]. If this [GLTFDocumentExtension] is used for exporting images, this runs after + * [_serializeTextureJson]. + * This method can be used to modify the final JSON of each node. + */ public open fun _exportNode( state: GLTFState, gltfNode: GLTFNode, @@ -148,6 +282,11 @@ public open class GLTFDocumentExtension : Resource() { throw NotImplementedError("_export_node is not implemented for GLTFDocumentExtension") } + /** + * Part of the export process. This method is run last, after all other parts of the export + * process. + * This method can be used to modify the final JSON of the generated GLTF file. + */ public open fun _exportPost(state: GLTFState): GodotError { throw NotImplementedError("_export_post is not implemented for GLTFDocumentExtension") } diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/GLTFLight.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/GLTFLight.kt index 177e5e12a..8fa0bf121 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/GLTFLight.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/GLTFLight.kt @@ -29,8 +29,14 @@ import kotlin.String import kotlin.Suppress import kotlin.Unit +/** + * Represents a light as defined by the `KHR_lights_punctual` GLTF extension. + */ @GodotBaseType public open class GLTFLight : Resource() { + /** + * The [Color] of the light. Defaults to white. A black color causes the light to have no effect. + */ @CoreTypeLocalCopy public var color: Color get() { @@ -43,6 +49,11 @@ public open class GLTFLight : Resource() { TransferContext.callMethod(rawPtr, MethodBindings.setColorPtr, NIL) } + /** + * The intensity of the light. This is expressed in candelas (lumens per steradian) for point and + * spot lights, and lux (lumens per m²) for directional lights. When creating a Godot light, this + * value is converted to a unitless multiplier. + */ public var intensity: Float get() { TransferContext.writeArguments() @@ -54,6 +65,10 @@ public open class GLTFLight : Resource() { TransferContext.callMethod(rawPtr, MethodBindings.setIntensityPtr, NIL) } + /** + * The type of the light. The values accepted by Godot are "point", "spot", and "directional", + * which correspond to Godot's [OmniLight3D], [SpotLight3D], and [DirectionalLight3D] respectively. + */ public var lightType: String get() { TransferContext.writeArguments() @@ -65,6 +80,11 @@ public open class GLTFLight : Resource() { TransferContext.callMethod(rawPtr, MethodBindings.setLightTypePtr, NIL) } + /** + * The range of the light, beyond which the light has no effect. GLTF lights with no range defined + * behave like physical lights (which have infinite range). When creating a Godot light, the range is + * clamped to 4096. + */ public var range: Float get() { TransferContext.writeArguments() @@ -76,6 +96,13 @@ public open class GLTFLight : Resource() { TransferContext.callMethod(rawPtr, MethodBindings.setRangePtr, NIL) } + /** + * The inner angle of the cone in a spotlight. Must be less than or equal to the outer cone angle. + * Within this angle, the light is at full brightness. Between the inner and outer cone angles, + * there is a transition from full brightness to zero brightness. When creating a Godot + * [SpotLight3D], the ratio between the inner and outer cone angles is used to calculate the + * attenuation of the light. + */ public var innerConeAngle: Float get() { TransferContext.writeArguments() @@ -87,6 +114,13 @@ public open class GLTFLight : Resource() { TransferContext.callMethod(rawPtr, MethodBindings.setInnerConeAnglePtr, NIL) } + /** + * The outer angle of the cone in a spotlight. Must be greater than or equal to the inner angle. + * At this angle, the light drops off to zero brightness. Between the inner and outer cone angles, + * there is a transition from full brightness to zero brightness. If this angle is a half turn, then + * the spotlight emits in all directions. When creating a Godot [SpotLight3D], the outer cone angle + * is used as the angle of the spotlight. + */ public var outerConeAngle: Float get() { TransferContext.writeArguments() @@ -104,6 +138,8 @@ public open class GLTFLight : Resource() { } /** + * The [Color] of the light. Defaults to white. A black color causes the light to have no effect. + * * This is a helper function to make dealing with local copies easier. * * For more information, see our @@ -125,12 +161,18 @@ public open class GLTFLight : Resource() { } + /** + * Converts this GLTFLight instance into a Godot [Light3D] node. + */ public fun toNode(): Light3D? { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.toNodePtr, OBJECT) return (TransferContext.readReturnValue(OBJECT, true) as Light3D?) } + /** + * Serializes this GLTFLight instance into a [Dictionary]. + */ public fun toDictionary(): Dictionary { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.toDictionaryPtr, DICTIONARY) @@ -138,12 +180,18 @@ public open class GLTFLight : Resource() { } public companion object { + /** + * Create a new GLTFLight instance from the given Godot [Light3D] node. + */ public fun fromNode(lightNode: Light3D): GLTFLight? { TransferContext.writeArguments(OBJECT to lightNode) TransferContext.callMethod(0, MethodBindings.fromNodePtr, OBJECT) return (TransferContext.readReturnValue(OBJECT, true) as GLTFLight?) } + /** + * Creates a new GLTFLight instance by parsing the given [Dictionary]. + */ public fun fromDictionary(dictionary: Dictionary): GLTFLight? { TransferContext.writeArguments(DICTIONARY to dictionary) TransferContext.callMethod(0, MethodBindings.fromDictionaryPtr, OBJECT) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/GLTFNode.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/GLTFNode.kt index 5e586455d..449a45cbe 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/GLTFNode.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/GLTFNode.kt @@ -32,8 +32,18 @@ import kotlin.Long import kotlin.Suppress import kotlin.Unit +/** + * Represents a GLTF node. GLTF nodes may have names, transforms, children (other GLTF nodes), and + * more specialized properties (represented by their own classes). + * GLTF nodes generally exist inside of [GLTFState] which represents all data of a GLTF file. Most + * of GLTFNode's properties are indices of other data in the GLTF file. You can extend a GLTF node with + * additional properties by using [getAdditionalData] and [setAdditionalData]. + */ @GodotBaseType public open class GLTFNode : Resource() { + /** + * The index of the parent node in the [GLTFState]. If -1, this node is a root node. + */ public var parent: Int get() { TransferContext.writeArguments() @@ -45,6 +55,10 @@ public open class GLTFNode : Resource() { TransferContext.callMethod(rawPtr, MethodBindings.setParentPtr, NIL) } + /** + * How deep into the node hierarchy this node is. A root node will have a height of 0, its + * children will have a height of 1, and so on. If -1, the height has not been calculated. + */ public var height: Int get() { TransferContext.writeArguments() @@ -56,6 +70,10 @@ public open class GLTFNode : Resource() { TransferContext.callMethod(rawPtr, MethodBindings.setHeightPtr, NIL) } + /** + * The transform of the GLTF node relative to its parent. This property is usually unused since + * the position, rotation, and scale properties are preferred. + */ @CoreTypeLocalCopy public var xform: Transform3D get() { @@ -68,6 +86,10 @@ public open class GLTFNode : Resource() { TransferContext.callMethod(rawPtr, MethodBindings.setXformPtr, NIL) } + /** + * If this GLTF node is a mesh, the index of the [GLTFMesh] in the [GLTFState] that describes the + * mesh's properties. If -1, this node is not a mesh. + */ public var mesh: Int get() { TransferContext.writeArguments() @@ -79,6 +101,10 @@ public open class GLTFNode : Resource() { TransferContext.callMethod(rawPtr, MethodBindings.setMeshPtr, NIL) } + /** + * If this GLTF node is a camera, the index of the [GLTFCamera] in the [GLTFState] that describes + * the camera's properties. If -1, this node is not a camera. + */ public var camera: Int get() { TransferContext.writeArguments() @@ -90,6 +116,10 @@ public open class GLTFNode : Resource() { TransferContext.callMethod(rawPtr, MethodBindings.setCameraPtr, NIL) } + /** + * If this GLTF node has a skin, the index of the [GLTFSkin] in the [GLTFState] that describes the + * skin's properties. If -1, this node does not have a skin. + */ public var skin: Int get() { TransferContext.writeArguments() @@ -101,6 +131,10 @@ public open class GLTFNode : Resource() { TransferContext.callMethod(rawPtr, MethodBindings.setSkinPtr, NIL) } + /** + * If this GLTF node has a skeleton, the index of the [GLTFSkeleton] in the [GLTFState] that + * describes the skeleton's properties. If -1, this node does not have a skeleton. + */ public var skeleton: Int get() { TransferContext.writeArguments() @@ -112,6 +146,9 @@ public open class GLTFNode : Resource() { TransferContext.callMethod(rawPtr, MethodBindings.setSkeletonPtr, NIL) } + /** + * The position of the GLTF node relative to its parent. + */ @CoreTypeLocalCopy public var position: Vector3 get() { @@ -124,6 +161,9 @@ public open class GLTFNode : Resource() { TransferContext.callMethod(rawPtr, MethodBindings.setPositionPtr, NIL) } + /** + * The rotation of the GLTF node relative to its parent. + */ @CoreTypeLocalCopy public var rotation: Quaternion get() { @@ -136,6 +176,9 @@ public open class GLTFNode : Resource() { TransferContext.callMethod(rawPtr, MethodBindings.setRotationPtr, NIL) } + /** + * The scale of the GLTF node relative to its parent. + */ @CoreTypeLocalCopy public var scale: Vector3 get() { @@ -148,6 +191,10 @@ public open class GLTFNode : Resource() { TransferContext.callMethod(rawPtr, MethodBindings.setScalePtr, NIL) } + /** + * The indices of the children nodes in the [GLTFState]. If this GLTF node has no children, this + * will be an empty array. + */ public var children: PackedInt32Array get() { TransferContext.writeArguments() @@ -159,6 +206,10 @@ public open class GLTFNode : Resource() { TransferContext.callMethod(rawPtr, MethodBindings.setChildrenPtr, NIL) } + /** + * If this GLTF node is a light, the index of the [GLTFLight] in the [GLTFState] that describes + * the light's properties. If -1, this node is not a light. + */ public var light: Int get() { TransferContext.writeArguments() @@ -176,6 +227,9 @@ public open class GLTFNode : Resource() { } /** + * The transform of the GLTF node relative to its parent. This property is usually unused since + * the position, rotation, and scale properties are preferred. + * * This is a helper function to make dealing with local copies easier. * * For more information, see our @@ -198,6 +252,8 @@ public open class GLTFNode : Resource() { /** + * The position of the GLTF node relative to its parent. + * * This is a helper function to make dealing with local copies easier. * * For more information, see our @@ -220,6 +276,8 @@ public open class GLTFNode : Resource() { /** + * The rotation of the GLTF node relative to its parent. + * * This is a helper function to make dealing with local copies easier. * * For more information, see our @@ -242,6 +300,8 @@ public open class GLTFNode : Resource() { /** + * The scale of the GLTF node relative to its parent. + * * This is a helper function to make dealing with local copies easier. * * For more information, see our @@ -263,12 +323,25 @@ public open class GLTFNode : Resource() { } + /** + * Gets additional arbitrary data in this [GLTFNode] instance. This can be used to keep per-node + * state data in [GLTFDocumentExtension] classes, which is important because they are stateless. + * The argument should be the [GLTFDocumentExtension] name (does not have to match the extension + * name in the GLTF file), and the return value can be anything you set. If nothing was set, the + * return value is null. + */ public fun getAdditionalData(extensionName: StringName): Any? { TransferContext.writeArguments(STRING_NAME to extensionName) TransferContext.callMethod(rawPtr, MethodBindings.getAdditionalDataPtr, ANY) return (TransferContext.readReturnValue(ANY, true) as Any?) } + /** + * Sets additional arbitrary data in this [GLTFNode] instance. This can be used to keep per-node + * state data in [GLTFDocumentExtension] classes, which is important because they are stateless. + * The first argument should be the [GLTFDocumentExtension] name (does not have to match the + * extension name in the GLTF file), and the second argument can be anything you want. + */ public fun setAdditionalData(extensionName: StringName, additionalData: Any?): Unit { TransferContext.writeArguments(STRING_NAME to extensionName, ANY to additionalData) TransferContext.callMethod(rawPtr, MethodBindings.setAdditionalDataPtr, NIL) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/GLTFPhysicsShape.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/GLTFPhysicsShape.kt index 272991f1e..0a07430ef 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/GLTFPhysicsShape.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/GLTFPhysicsShape.kt @@ -33,8 +33,17 @@ import kotlin.Suppress import kotlin.Unit import kotlin.jvm.JvmOverloads +/** + * Represents a physics shape as defined by the `OMI_collider` GLTF extension. This class is an + * intermediary between the GLTF data and Godot's nodes, and it's abstracted in a way that allows + * adding support for different GLTF physics extensions in the future. + */ @GodotBaseType public open class GLTFPhysicsShape : Resource() { + /** + * The type of shape this shape represents. Valid values are "box", "capsule", "cylinder", + * "sphere", "hull", and "trimesh". + */ public var shapeType: String get() { TransferContext.writeArguments() @@ -46,6 +55,10 @@ public open class GLTFPhysicsShape : Resource() { TransferContext.callMethod(rawPtr, MethodBindings.setShapeTypePtr, NIL) } + /** + * The size of the shape, in meters. This is only used when the shape type is "box", and it + * represents the "diameter" of the box. This value should not be negative. + */ @CoreTypeLocalCopy public var size: Vector3 get() { @@ -58,6 +71,10 @@ public open class GLTFPhysicsShape : Resource() { TransferContext.callMethod(rawPtr, MethodBindings.setSizePtr, NIL) } + /** + * The radius of the shape, in meters. This is only used when the shape type is "capsule", + * "cylinder", or "sphere". This value should not be negative. + */ public var radius: Float get() { TransferContext.writeArguments() @@ -69,6 +86,11 @@ public open class GLTFPhysicsShape : Resource() { TransferContext.callMethod(rawPtr, MethodBindings.setRadiusPtr, NIL) } + /** + * The height of the shape, in meters. This is only used when the shape type is "capsule" or + * "cylinder". This value should not be negative, and for "capsule" it should be at least twice the + * radius. + */ public var height: Float get() { TransferContext.writeArguments() @@ -80,6 +102,12 @@ public open class GLTFPhysicsShape : Resource() { TransferContext.callMethod(rawPtr, MethodBindings.setHeightPtr, NIL) } + /** + * If `true`, indicates that this shape is a trigger. For Godot, this means that the shape should + * be a child of an Area3D node. + * This is the only variable not used in the [toNode] method, it's intended to be used alongside + * when deciding where to add the generated node as a child. + */ public var isTrigger: Boolean get() { TransferContext.writeArguments() @@ -91,6 +119,10 @@ public open class GLTFPhysicsShape : Resource() { TransferContext.callMethod(rawPtr, MethodBindings.setIsTriggerPtr, NIL) } + /** + * The index of the shape's mesh in the GLTF file. This is only used when the shape type is "hull" + * (convex hull) or "trimesh" (concave trimesh). + */ public var meshIndex: Int get() { TransferContext.writeArguments() @@ -102,6 +134,10 @@ public open class GLTFPhysicsShape : Resource() { TransferContext.callMethod(rawPtr, MethodBindings.setMeshIndexPtr, NIL) } + /** + * The [ImporterMesh] resource of the shape. This is only used when the shape type is "hull" + * (convex hull) or "trimesh" (concave trimesh). + */ public var importerMesh: ImporterMesh? get() { TransferContext.writeArguments() @@ -119,6 +155,9 @@ public open class GLTFPhysicsShape : Resource() { } /** + * The size of the shape, in meters. This is only used when the shape type is "box", and it + * represents the "diameter" of the box. This value should not be negative. + * * This is a helper function to make dealing with local copies easier. * * For more information, see our @@ -140,6 +179,9 @@ public open class GLTFPhysicsShape : Resource() { } + /** + * Converts this GLTFPhysicsShape instance into a Godot [CollisionShape3D] node. + */ @JvmOverloads public fun toNode(cacheShapes: Boolean = false): CollisionShape3D? { TransferContext.writeArguments(BOOL to cacheShapes) @@ -147,6 +189,9 @@ public open class GLTFPhysicsShape : Resource() { return (TransferContext.readReturnValue(OBJECT, true) as CollisionShape3D?) } + /** + * Serializes this GLTFPhysicsShape instance into a [Dictionary]. + */ public fun toDictionary(): Dictionary { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.toDictionaryPtr, DICTIONARY) @@ -154,12 +199,18 @@ public open class GLTFPhysicsShape : Resource() { } public companion object { + /** + * Create a new GLTFPhysicsShape instance from the given Godot [CollisionShape3D] node. + */ public fun fromNode(shapeNode: CollisionShape3D): GLTFPhysicsShape? { TransferContext.writeArguments(OBJECT to shapeNode) TransferContext.callMethod(0, MethodBindings.fromNodePtr, OBJECT) return (TransferContext.readReturnValue(OBJECT, true) as GLTFPhysicsShape?) } + /** + * Creates a new GLTFPhysicsShape instance by parsing the given [Dictionary]. + */ public fun fromDictionary(dictionary: Dictionary): GLTFPhysicsShape? { TransferContext.writeArguments(DICTIONARY to dictionary) TransferContext.callMethod(0, MethodBindings.fromDictionaryPtr, OBJECT) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/GLTFSpecGloss.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/GLTFSpecGloss.kt index 1ce53ab31..05f8afcf4 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/GLTFSpecGloss.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/GLTFSpecGloss.kt @@ -24,8 +24,15 @@ import kotlin.Int import kotlin.Suppress import kotlin.Unit +/** + * KHR_materials_pbrSpecularGlossiness is an archived GLTF extension. This means that it is + * deprecated and not recommended for new files. However, it is still supported for loading old files. + */ @GodotBaseType public open class GLTFSpecGloss : Resource() { + /** + * The diffuse texture. + */ public var diffuseImg: Image? get() { TransferContext.writeArguments() @@ -37,6 +44,9 @@ public open class GLTFSpecGloss : Resource() { TransferContext.callMethod(rawPtr, MethodBindings.setDiffuseImgPtr, NIL) } + /** + * The reflected diffuse factor of the material. + */ @CoreTypeLocalCopy public var diffuseFactor: Color get() { @@ -49,6 +59,9 @@ public open class GLTFSpecGloss : Resource() { TransferContext.callMethod(rawPtr, MethodBindings.setDiffuseFactorPtr, NIL) } + /** + * The glossiness or smoothness of the material. + */ public var glossFactor: Float get() { TransferContext.writeArguments() @@ -60,6 +73,9 @@ public open class GLTFSpecGloss : Resource() { TransferContext.callMethod(rawPtr, MethodBindings.setGlossFactorPtr, NIL) } + /** + * The specular RGB color of the material. The alpha channel is unused. + */ @CoreTypeLocalCopy public var specularFactor: Color get() { @@ -72,6 +88,9 @@ public open class GLTFSpecGloss : Resource() { TransferContext.callMethod(rawPtr, MethodBindings.setSpecularFactorPtr, NIL) } + /** + * The specular-glossiness texture. + */ public var specGlossImg: Image? get() { TransferContext.writeArguments() @@ -89,6 +108,8 @@ public open class GLTFSpecGloss : Resource() { } /** + * The reflected diffuse factor of the material. + * * This is a helper function to make dealing with local copies easier. * * For more information, see our @@ -111,6 +132,8 @@ public open class GLTFSpecGloss : Resource() { /** + * The specular RGB color of the material. The alpha channel is unused. + * * This is a helper function to make dealing with local copies easier. * * For more information, see our diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/GLTFTexture.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/GLTFTexture.kt index fcf6a0020..e4031420a 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/GLTFTexture.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/GLTFTexture.kt @@ -19,6 +19,10 @@ import kotlin.Suppress @GodotBaseType public open class GLTFTexture : Resource() { + /** + * The index of the image associated with this texture, see [GLTFState.getImages]. If -1, then + * this texture does not have an image assigned. + */ public var srcImage: Int get() { TransferContext.writeArguments() @@ -30,6 +34,10 @@ public open class GLTFTexture : Resource() { TransferContext.callMethod(rawPtr, MethodBindings.setSrcImagePtr, NIL) } + /** + * ID of the texture sampler to use when sampling the image. If -1, then the default texture + * sampler is used (linear filtering, and repeat wrapping in both axes). + */ public var sampler: Int get() { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/GLTFTextureSampler.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/GLTFTextureSampler.kt index 8d86fa10e..d8c5a06f6 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/GLTFTextureSampler.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/GLTFTextureSampler.kt @@ -17,8 +17,16 @@ import kotlin.Int import kotlin.Long import kotlin.Suppress +/** + * Represents a texture sampler as defined by the base GLTF spec. Texture samplers in GLTF specify + * how to sample data from the texture's base image, when rendering the texture on an object. + */ @GodotBaseType public open class GLTFTextureSampler : Resource() { + /** + * Texture's magnification filter, used when texture appears larger on screen than the source + * image. + */ public var magFilter: Int get() { TransferContext.writeArguments() @@ -30,6 +38,10 @@ public open class GLTFTextureSampler : Resource() { TransferContext.callMethod(rawPtr, MethodBindings.setMagFilterPtr, NIL) } + /** + * Texture's minification filter, used when the texture appears smaller on screen than the source + * image. + */ public var minFilter: Int get() { TransferContext.writeArguments() @@ -41,6 +53,9 @@ public open class GLTFTextureSampler : Resource() { TransferContext.callMethod(rawPtr, MethodBindings.setMinFilterPtr, NIL) } + /** + * Wrapping mode to use for S-axis (horizontal) texture coordinates. + */ public var wrapS: Int get() { TransferContext.writeArguments() @@ -52,6 +67,9 @@ public open class GLTFTextureSampler : Resource() { TransferContext.callMethod(rawPtr, MethodBindings.setWrapSPtr, NIL) } + /** + * Wrapping mode to use for T-axis (vertical) texture coordinates. + */ public var wrapT: Int get() { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/GPUParticlesAttractor3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/GPUParticlesAttractor3D.kt index afcdc2a8d..6e3751f59 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/GPUParticlesAttractor3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/GPUParticlesAttractor3D.kt @@ -21,20 +21,19 @@ import kotlin.Long import kotlin.Suppress /** - * Abstract base class for 3D particle attractors. - * - * Particle attractors can be used to attract particles towards the attractor's origin, or to push them away from the attractor's origin. - * - * Particle attractors work in real-time and can be moved, rotated and scaled during gameplay. Unlike collision shapes, non-uniform scaling of attractors is also supported. - * + * Particle attractors can be used to attract particles towards the attractor's origin, or to push + * them away from the attractor's origin. + * Particle attractors work in real-time and can be moved, rotated and scaled during gameplay. + * Unlike collision shapes, non-uniform scaling of attractors is also supported. * Attractors can be temporarily disabled by hiding them, or by setting their [strength] to `0.0`. - * - * **Note:** Particle attractors only affect [godot.GPUParticles3D], not [godot.CPUParticles3D]. + * **Note:** Particle attractors only affect [GPUParticles3D], not [CPUParticles3D]. */ @GodotBaseType public open class GPUParticlesAttractor3D internal constructor() : VisualInstance3D() { /** - * Adjusts the strength of the attractor. If [strength] is negative, particles will be pushed in the opposite direction. Particles will be pushed *away* from the attractor's origin if [directionality] is `0.0`, or towards local +Z if [directionality] is greater than `0.0`. + * Adjusts the strength of the attractor. If [strength] is negative, particles will be pushed in + * the opposite direction. Particles will be pushed *away* from the attractor's origin if + * [directionality] is `0.0`, or towards local +Z if [directionality] is greater than `0.0`. */ public var strength: Float get() { @@ -48,7 +47,9 @@ public open class GPUParticlesAttractor3D internal constructor() : VisualInstanc } /** - * The particle attractor's attenuation. Higher values result in more gradual pushing of particles as they come closer to the attractor's origin. Zero or negative values will cause particles to be pushed very fast as soon as the touch the attractor's edges. + * The particle attractor's attenuation. Higher values result in more gradual pushing of particles + * as they come closer to the attractor's origin. Zero or negative values will cause particles to be + * pushed very fast as soon as the touch the attractor's edges. */ public var attenuation: Float get() { @@ -62,9 +63,11 @@ public open class GPUParticlesAttractor3D internal constructor() : VisualInstanc } /** - * Adjusts how directional the attractor is. At `0.0`, the attractor is not directional at all: it will attract particles towards its center. At `1.0`, the attractor is fully directional: particles will always be pushed towards local -Z (or +Z if [strength] is negative). - * - * **Note:** If [directionality] is greater than `0.0`, the direction in which particles are pushed can be changed by rotating the [godot.GPUParticlesAttractor3D] node. + * Adjusts how directional the attractor is. At `0.0`, the attractor is not directional at all: it + * will attract particles towards its center. At `1.0`, the attractor is fully directional: particles + * will always be pushed towards local -Z (or +Z if [strength] is negative). + * **Note:** If [directionality] is greater than `0.0`, the direction in which particles are + * pushed can be changed by rotating the [GPUParticlesAttractor3D] node. */ public var directionality: Float get() { @@ -78,11 +81,14 @@ public open class GPUParticlesAttractor3D internal constructor() : VisualInstanc } /** - * The particle rendering layers ([godot.VisualInstance3D.layers]) that will be affected by the attractor. By default, all particles are affected by an attractor. - * - * After configuring particle nodes accordingly, specific layers can be unchecked to prevent certain particles from being affected by attractors. For example, this can be used if you're using an attractor as part of a spell effect but don't want the attractor to affect unrelated weather particles at the same position. - * - * Particle attraction can also be disabled on a per-process material basis by setting [godot.ParticleProcessMaterial.attractorInteractionEnabled] on the [godot.GPUParticles3D] node. + * The particle rendering layers ([VisualInstance3D.layers]) that will be affected by the + * attractor. By default, all particles are affected by an attractor. + * After configuring particle nodes accordingly, specific layers can be unchecked to prevent + * certain particles from being affected by attractors. For example, this can be used if you're using + * an attractor as part of a spell effect but don't want the attractor to affect unrelated weather + * particles at the same position. + * Particle attraction can also be disabled on a per-process material basis by setting + * [ParticleProcessMaterial.attractorInteractionEnabled] on the [GPUParticles3D] node. */ public var cullMask: Long get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/GPUParticlesAttractorBox3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/GPUParticlesAttractorBox3D.kt index d0ebf2a18..7b43cc993 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/GPUParticlesAttractorBox3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/GPUParticlesAttractorBox3D.kt @@ -21,13 +21,11 @@ import kotlin.Suppress import kotlin.Unit /** - * A box-shaped attractor that influences particles from [godot.GPUParticles3D] nodes. - * - * A box-shaped attractor that influences particles from [godot.GPUParticles3D] nodes. Can be used to attract particles towards its origin, or to push them away from its origin. - * - * Particle attractors work in real-time and can be moved, rotated and scaled during gameplay. Unlike collision shapes, non-uniform scaling of attractors is also supported. - * - * **Note:** Particle attractors only affect [godot.GPUParticles3D], not [godot.CPUParticles3D]. + * A box-shaped attractor that influences particles from [GPUParticles3D] nodes. Can be used to + * attract particles towards its origin, or to push them away from its origin. + * Particle attractors work in real-time and can be moved, rotated and scaled during gameplay. + * Unlike collision shapes, non-uniform scaling of attractors is also supported. + * **Note:** Particle attractors only affect [GPUParticles3D], not [CPUParticles3D]. */ @GodotBaseType public open class GPUParticlesAttractorBox3D : GPUParticlesAttractor3D() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/GPUParticlesAttractorSphere3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/GPUParticlesAttractorSphere3D.kt index 4e4d695c9..8c893a257 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/GPUParticlesAttractorSphere3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/GPUParticlesAttractorSphere3D.kt @@ -19,20 +19,18 @@ import kotlin.Int import kotlin.Suppress /** - * A spheroid-shaped attractor that influences particles from [godot.GPUParticles3D] nodes. - * - * A spheroid-shaped attractor that influences particles from [godot.GPUParticles3D] nodes. Can be used to attract particles towards its origin, or to push them away from its origin. - * - * Particle attractors work in real-time and can be moved, rotated and scaled during gameplay. Unlike collision shapes, non-uniform scaling of attractors is also supported. - * - * **Note:** Particle attractors only affect [godot.GPUParticles3D], not [godot.CPUParticles3D]. + * A spheroid-shaped attractor that influences particles from [GPUParticles3D] nodes. Can be used to + * attract particles towards its origin, or to push them away from its origin. + * Particle attractors work in real-time and can be moved, rotated and scaled during gameplay. + * Unlike collision shapes, non-uniform scaling of attractors is also supported. + * **Note:** Particle attractors only affect [GPUParticles3D], not [CPUParticles3D]. */ @GodotBaseType public open class GPUParticlesAttractorSphere3D : GPUParticlesAttractor3D() { /** * The attractor sphere's radius in 3D units. - * - * **Note:** Stretched ellipses can be obtained by using non-uniform scaling on the [godot.GPUParticlesAttractorSphere3D] node. + * **Note:** Stretched ellipses can be obtained by using non-uniform scaling on the + * [GPUParticlesAttractorSphere3D] node. */ public var radius: Float get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/GPUParticlesAttractorVectorField3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/GPUParticlesAttractorVectorField3D.kt index 901edc74d..32640fc12 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/GPUParticlesAttractorVectorField3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/GPUParticlesAttractorVectorField3D.kt @@ -22,15 +22,15 @@ import kotlin.Suppress import kotlin.Unit /** - * A box-shaped attractor with varying directions and strengths defined in it that influences particles from [godot.GPUParticles3D] nodes. - * - * A box-shaped attractor with varying directions and strengths defined in it that influences particles from [godot.GPUParticles3D] nodes. - * - * Unlike [godot.GPUParticlesAttractorBox3D], [godot.GPUParticlesAttractorVectorField3D] uses a [texture] to affect attraction strength within the box. This can be used to create complex attraction scenarios where particles travel in different directions depending on their location. This can be useful for weather effects such as sandstorms. - * - * Particle attractors work in real-time and can be moved, rotated and scaled during gameplay. Unlike collision shapes, non-uniform scaling of attractors is also supported. - * - * **Note:** Particle attractors only affect [godot.GPUParticles3D], not [godot.CPUParticles3D]. + * A box-shaped attractor with varying directions and strengths defined in it that influences + * particles from [GPUParticles3D] nodes. + * Unlike [GPUParticlesAttractorBox3D], [GPUParticlesAttractorVectorField3D] uses a [texture] to + * affect attraction strength within the box. This can be used to create complex attraction scenarios + * where particles travel in different directions depending on their location. This can be useful for + * weather effects such as sandstorms. + * Particle attractors work in real-time and can be moved, rotated and scaled during gameplay. + * Unlike collision shapes, non-uniform scaling of attractors is also supported. + * **Note:** Particle attractors only affect [GPUParticles3D], not [CPUParticles3D]. */ @GodotBaseType public open class GPUParticlesAttractorVectorField3D : GPUParticlesAttractor3D() { @@ -51,8 +51,9 @@ public open class GPUParticlesAttractorVectorField3D : GPUParticlesAttractor3D() /** * The 3D texture to be used. Values are linearly interpolated between the texture's pixels. - * - * **Note:** To get better performance, the 3D texture's resolution should reflect the [size] of the attractor. Since particle attraction is usually low-frequency data, the texture can be kept at a low resolution such as 64×64×64. + * **Note:** To get better performance, the 3D texture's resolution should reflect the [size] of + * the attractor. Since particle attraction is usually low-frequency data, the texture can be kept at + * a low resolution such as 64×64×64. */ public var texture: Texture3D? get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/GPUParticlesCollision3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/GPUParticlesCollision3D.kt index d68d107fe..f9ccbd225 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/GPUParticlesCollision3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/GPUParticlesCollision3D.kt @@ -18,28 +18,32 @@ import kotlin.Long import kotlin.Suppress /** - * Abstract base class for 3D particle collision shapes affecting [godot.GPUParticles3D] nodes. - * * Particle collision shapes can be used to make particles stop or bounce against them. - * - * Particle collision shapes work in real-time and can be moved, rotated and scaled during gameplay. Unlike attractors, non-uniform scaling of collision shapes is *not* supported. - * + * Particle collision shapes work in real-time and can be moved, rotated and scaled during gameplay. + * Unlike attractors, non-uniform scaling of collision shapes is *not* supported. * Particle collision shapes can be temporarily disabled by hiding them. - * - * **Note:** [godot.ParticleProcessMaterial.collisionMode] must be [godot.ParticleProcessMaterial.COLLISION_RIGID] or [godot.ParticleProcessMaterial.COLLISION_HIDE_ON_CONTACT] on the [godot.GPUParticles3D]'s process material for collision to work. - * - * **Note:** Particle collision only affects [godot.GPUParticles3D], not [godot.CPUParticles3D]. - * - * **Note:** Particles pushed by a collider that is being moved will not be interpolated, which can result in visible stuttering. This can be alleviated by setting [godot.GPUParticles3D.fixedFps] to `0` or a value that matches or exceeds the target framerate. + * **Note:** [ParticleProcessMaterial.collisionMode] must be [constant + * ParticleProcessMaterial.COLLISION_RIGID] or [constant + * ParticleProcessMaterial.COLLISION_HIDE_ON_CONTACT] on the [GPUParticles3D]'s process material for + * collision to work. + * **Note:** Particle collision only affects [GPUParticles3D], not [CPUParticles3D]. + * **Note:** Particles pushed by a collider that is being moved will not be interpolated, which can + * result in visible stuttering. This can be alleviated by setting [GPUParticles3D.fixedFps] to `0` or + * a value that matches or exceeds the target framerate. */ @GodotBaseType public open class GPUParticlesCollision3D internal constructor() : VisualInstance3D() { /** - * The particle rendering layers ([godot.VisualInstance3D.layers]) that will be affected by the collision shape. By default, all particles that have [godot.ParticleProcessMaterial.collisionMode] set to [godot.ParticleProcessMaterial.COLLISION_RIGID] or [godot.ParticleProcessMaterial.COLLISION_HIDE_ON_CONTACT] will be affected by a collision shape. - * - * After configuring particle nodes accordingly, specific layers can be unchecked to prevent certain particles from being affected by attractors. For example, this can be used if you're using an attractor as part of a spell effect but don't want the attractor to affect unrelated weather particles at the same position. - * - * Particle attraction can also be disabled on a per-process material basis by setting [godot.ParticleProcessMaterial.attractorInteractionEnabled] on the [godot.GPUParticles3D] node. + * The particle rendering layers ([VisualInstance3D.layers]) that will be affected by the + * collision shape. By default, all particles that have [ParticleProcessMaterial.collisionMode] set + * to [constant ParticleProcessMaterial.COLLISION_RIGID] or [constant + * ParticleProcessMaterial.COLLISION_HIDE_ON_CONTACT] will be affected by a collision shape. + * After configuring particle nodes accordingly, specific layers can be unchecked to prevent + * certain particles from being affected by attractors. For example, this can be used if you're using + * an attractor as part of a spell effect but don't want the attractor to affect unrelated weather + * particles at the same position. + * Particle attraction can also be disabled on a per-process material basis by setting + * [ParticleProcessMaterial.attractorInteractionEnabled] on the [GPUParticles3D] node. */ public var cullMask: Long get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/GPUParticlesCollisionBox3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/GPUParticlesCollisionBox3D.kt index e674a2e1f..4529d7c77 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/GPUParticlesCollisionBox3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/GPUParticlesCollisionBox3D.kt @@ -21,15 +21,14 @@ import kotlin.Suppress import kotlin.Unit /** - * A box-shaped 3D particle collision shape affecting [godot.GPUParticles3D] nodes. - * - * A box-shaped 3D particle collision shape affecting [godot.GPUParticles3D] nodes. - * - * Particle collision shapes work in real-time and can be moved, rotated and scaled during gameplay. Unlike attractors, non-uniform scaling of collision shapes is *not* supported. - * - * **Note:** [godot.ParticleProcessMaterial.collisionMode] must be [godot.ParticleProcessMaterial.COLLISION_RIGID] or [godot.ParticleProcessMaterial.COLLISION_HIDE_ON_CONTACT] on the [godot.GPUParticles3D]'s process material for collision to work. - * - * **Note:** Particle collision only affects [godot.GPUParticles3D], not [godot.CPUParticles3D]. + * A box-shaped 3D particle collision shape affecting [GPUParticles3D] nodes. + * Particle collision shapes work in real-time and can be moved, rotated and scaled during gameplay. + * Unlike attractors, non-uniform scaling of collision shapes is *not* supported. + * **Note:** [ParticleProcessMaterial.collisionMode] must be [constant + * ParticleProcessMaterial.COLLISION_RIGID] or [constant + * ParticleProcessMaterial.COLLISION_HIDE_ON_CONTACT] on the [GPUParticles3D]'s process material for + * collision to work. + * **Note:** Particle collision only affects [GPUParticles3D], not [CPUParticles3D]. */ @GodotBaseType public open class GPUParticlesCollisionBox3D : GPUParticlesCollision3D() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/GPUParticlesCollisionHeightField3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/GPUParticlesCollisionHeightField3D.kt index 5c0090463..cc4075f79 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/GPUParticlesCollisionHeightField3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/GPUParticlesCollisionHeightField3D.kt @@ -24,22 +24,23 @@ import kotlin.Suppress import kotlin.Unit /** - * A real-time heightmap-shaped 3D particle collision shape affecting [godot.GPUParticles3D] nodes. - * - * A real-time heightmap-shaped 3D particle collision shape affecting [godot.GPUParticles3D] nodes. - * - * Heightmap shapes allow for efficiently representing collisions for convex and concave objects with a single "floor" (such as terrain). This is less flexible than [godot.GPUParticlesCollisionSDF3D], but it doesn't require a baking step. - * - * [godot.GPUParticlesCollisionHeightField3D] can also be regenerated in real-time when it is moved, when the camera moves, or even continuously. This makes [godot.GPUParticlesCollisionHeightField3D] a good choice for weather effects such as rain and snow and games with highly dynamic geometry. However, this class is limited since heightmaps cannot represent overhangs (e.g. indoors or caves). - * - * **Note:** [godot.ParticleProcessMaterial.collisionMode] must be `true` on the [godot.GPUParticles3D]'s process material for collision to work. - * - * **Note:** Particle collision only affects [godot.GPUParticles3D], not [godot.CPUParticles3D]. + * A real-time heightmap-shaped 3D particle collision shape affecting [GPUParticles3D] nodes. + * Heightmap shapes allow for efficiently representing collisions for convex and concave objects + * with a single "floor" (such as terrain). This is less flexible than [GPUParticlesCollisionSDF3D], + * but it doesn't require a baking step. + * [GPUParticlesCollisionHeightField3D] can also be regenerated in real-time when it is moved, when + * the camera moves, or even continuously. This makes [GPUParticlesCollisionHeightField3D] a good + * choice for weather effects such as rain and snow and games with highly dynamic geometry. However, + * this class is limited since heightmaps cannot represent overhangs (e.g. indoors or caves). + * **Note:** [ParticleProcessMaterial.collisionMode] must be `true` on the [GPUParticles3D]'s + * process material for collision to work. + * **Note:** Particle collision only affects [GPUParticles3D], not [CPUParticles3D]. */ @GodotBaseType public open class GPUParticlesCollisionHeightField3D : GPUParticlesCollision3D() { /** - * The collision heightmap's size in 3D units. To improve heightmap quality, [size] should be set as small as possible while covering the parts of the scene you need. + * The collision heightmap's size in 3D units. To improve heightmap quality, [size] should be set + * as small as possible while covering the parts of the scene you need. */ @CoreTypeLocalCopy public var size: Vector3 @@ -54,7 +55,9 @@ public open class GPUParticlesCollisionHeightField3D : GPUParticlesCollision3D() } /** - * Higher resolutions can represent small details more accurately in large scenes, at the cost of lower performance. If [updateMode] is [UPDATE_MODE_ALWAYS], consider using the lowest resolution possible. + * Higher resolutions can represent small details more accurately in large scenes, at the cost of + * lower performance. If [updateMode] is [constant UPDATE_MODE_ALWAYS], consider using the lowest + * resolution possible. */ public var resolution: Resolution get() { @@ -82,9 +85,12 @@ public open class GPUParticlesCollisionHeightField3D : GPUParticlesCollision3D() } /** - * If `true`, the [godot.GPUParticlesCollisionHeightField3D] will follow the current camera in global space. The [godot.GPUParticlesCollisionHeightField3D] does not need to be a child of the [godot.Camera3D] node for this to work. - * - * Following the camera has a performance cost, as it will force the heightmap to update whenever the camera moves. Consider lowering [resolution] to improve performance if [followCameraEnabled] is `true`. + * If `true`, the [GPUParticlesCollisionHeightField3D] will follow the current camera in global + * space. The [GPUParticlesCollisionHeightField3D] does not need to be a child of the [Camera3D] node + * for this to work. + * Following the camera has a performance cost, as it will force the heightmap to update whenever + * the camera moves. Consider lowering [resolution] to improve performance if [followCameraEnabled] + * is `true`. */ public var followCameraEnabled: Boolean get() { @@ -103,7 +109,8 @@ public open class GPUParticlesCollisionHeightField3D : GPUParticlesCollision3D() } /** - * The collision heightmap's size in 3D units. To improve heightmap quality, [size] should be set as small as possible while covering the parts of the scene you need. + * The collision heightmap's size in 3D units. To improve heightmap quality, [size] should be set + * as small as possible while covering the parts of the scene you need. * * This is a helper function to make dealing with local copies easier. * @@ -130,11 +137,13 @@ public open class GPUParticlesCollisionHeightField3D : GPUParticlesCollision3D() id: Long, ) { /** - * Generate a 256×256 heightmap. Intended for small-scale scenes, or larger scenes with no distant particles. + * Generate a 256×256 heightmap. Intended for small-scale scenes, or larger scenes with no + * distant particles. */ RESOLUTION_256(0), /** - * Generate a 512×512 heightmap. Intended for medium-scale scenes, or larger scenes with no distant particles. + * Generate a 512×512 heightmap. Intended for medium-scale scenes, or larger scenes with no + * distant particles. */ RESOLUTION_512(1), /** @@ -173,11 +182,16 @@ public open class GPUParticlesCollisionHeightField3D : GPUParticlesCollision3D() id: Long, ) { /** - * Only update the heightmap when the [godot.GPUParticlesCollisionHeightField3D] node is moved, or when the camera moves if [followCameraEnabled] is `true`. An update can be forced by slightly moving the [godot.GPUParticlesCollisionHeightField3D] in any direction, or by calling [godot.RenderingServer.particlesCollisionHeightFieldUpdate]. + * Only update the heightmap when the [GPUParticlesCollisionHeightField3D] node is moved, or + * when the camera moves if [followCameraEnabled] is `true`. An update can be forced by slightly + * moving the [GPUParticlesCollisionHeightField3D] in any direction, or by calling + * [RenderingServer.particlesCollisionHeightFieldUpdate]. */ UPDATE_MODE_WHEN_MOVED(0), /** - * Update the heightmap every frame. This has a significant performance cost. This update should only be used when geometry that particles can collide with changes significantly during gameplay. + * Update the heightmap every frame. This has a significant performance cost. This update should + * only be used when geometry that particles can collide with changes significantly during + * gameplay. */ UPDATE_MODE_ALWAYS(1), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/GPUParticlesCollisionSDF3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/GPUParticlesCollisionSDF3D.kt index 7d72c6211..1d3ced43f 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/GPUParticlesCollisionSDF3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/GPUParticlesCollisionSDF3D.kt @@ -28,24 +28,28 @@ import kotlin.Suppress import kotlin.Unit /** - * A baked signed distance field 3D particle collision shape affecting [godot.GPUParticles3D] nodes. - * - * A baked signed distance field 3D particle collision shape affecting [godot.GPUParticles3D] nodes. - * - * Signed distance fields (SDF) allow for efficiently representing approximate collision shapes for convex and concave objects of any shape. This is more flexible than [godot.GPUParticlesCollisionHeightField3D], but it requires a baking step. - * - * **Baking:** The signed distance field texture can be baked by selecting the [godot.GPUParticlesCollisionSDF3D] node in the editor, then clicking **Bake SDF** at the top of the 3D viewport. Any *visible* [godot.MeshInstance3D]s within the [size] will be taken into account for baking, regardless of their [godot.GeometryInstance3D.giMode]. - * - * **Note:** Baking a [godot.GPUParticlesCollisionSDF3D]'s [texture] is only possible within the editor, as there is no bake method exposed for use in exported projects. However, it's still possible to load pre-baked [godot.Texture3D]s into its [texture] property in an exported project. - * - * **Note:** [godot.ParticleProcessMaterial.collisionMode] must be [godot.ParticleProcessMaterial.COLLISION_RIGID] or [godot.ParticleProcessMaterial.COLLISION_HIDE_ON_CONTACT] on the [godot.GPUParticles3D]'s process material for collision to work. - * - * **Note:** Particle collision only affects [godot.GPUParticles3D], not [godot.CPUParticles3D]. + * A baked signed distance field 3D particle collision shape affecting [GPUParticles3D] nodes. + * Signed distance fields (SDF) allow for efficiently representing approximate collision shapes for + * convex and concave objects of any shape. This is more flexible than + * [GPUParticlesCollisionHeightField3D], but it requires a baking step. + * **Baking:** The signed distance field texture can be baked by selecting the + * [GPUParticlesCollisionSDF3D] node in the editor, then clicking **Bake SDF** at the top of the 3D + * viewport. Any *visible* [MeshInstance3D]s within the [size] will be taken into account for baking, + * regardless of their [GeometryInstance3D.giMode]. + * **Note:** Baking a [GPUParticlesCollisionSDF3D]'s [texture] is only possible within the editor, + * as there is no bake method exposed for use in exported projects. However, it's still possible to + * load pre-baked [Texture3D]s into its [texture] property in an exported project. + * **Note:** [ParticleProcessMaterial.collisionMode] must be [constant + * ParticleProcessMaterial.COLLISION_RIGID] or [constant + * ParticleProcessMaterial.COLLISION_HIDE_ON_CONTACT] on the [GPUParticles3D]'s process material for + * collision to work. + * **Note:** Particle collision only affects [GPUParticles3D], not [CPUParticles3D]. */ @GodotBaseType public open class GPUParticlesCollisionSDF3D : GPUParticlesCollision3D() { /** - * The collision SDF's size in 3D units. To improve SDF quality, the [size] should be set as small as possible while covering the parts of the scene you need. + * The collision SDF's size in 3D units. To improve SDF quality, the [size] should be set as small + * as possible while covering the parts of the scene you need. */ @CoreTypeLocalCopy public var size: Vector3 @@ -60,7 +64,12 @@ public open class GPUParticlesCollisionSDF3D : GPUParticlesCollision3D() { } /** - * The bake resolution to use for the signed distance field [texture]. The texture must be baked again for changes to the [resolution] property to be effective. Higher resolutions have a greater performance cost and take more time to bake. Higher resolutions also result in larger baked textures, leading to increased VRAM and storage space requirements. To improve performance and reduce bake times, use the lowest resolution possible for the object you're representing the collision of. + * The bake resolution to use for the signed distance field [texture]. The texture must be baked + * again for changes to the [resolution] property to be effective. Higher resolutions have a greater + * performance cost and take more time to bake. Higher resolutions also result in larger baked + * textures, leading to increased VRAM and storage space requirements. To improve performance and + * reduce bake times, use the lowest resolution possible for the object you're representing the + * collision of. */ public var resolution: Resolution get() { @@ -74,7 +83,9 @@ public open class GPUParticlesCollisionSDF3D : GPUParticlesCollision3D() { } /** - * The collision shape's thickness. Unlike other particle colliders, [godot.GPUParticlesCollisionSDF3D] is actually hollow on the inside. [thickness] can be increased to prevent particles from tunneling through the collision shape at high speeds, or when the [godot.GPUParticlesCollisionSDF3D] is moved. + * The collision shape's thickness. Unlike other particle colliders, [GPUParticlesCollisionSDF3D] + * is actually hollow on the inside. [thickness] can be increased to prevent particles from tunneling + * through the collision shape at high speeds, or when the [GPUParticlesCollisionSDF3D] is moved. */ public var thickness: Float get() { @@ -88,7 +99,10 @@ public open class GPUParticlesCollisionSDF3D : GPUParticlesCollision3D() { } /** - * The visual layers to account for when baking the particle collision SDF. Only [godot.MeshInstance3D]s whose [godot.VisualInstance3D.layers] match with this [bakeMask] will be included in the generated particle collision SDF. By default, all objects are taken into account for the particle collision SDF baking. + * The visual layers to account for when baking the particle collision SDF. Only [MeshInstance3D]s + * whose [VisualInstance3D.layers] match with this [bakeMask] will be included in the generated + * particle collision SDF. By default, all objects are taken into account for the particle collision + * SDF baking. */ public var bakeMask: Long get() { @@ -121,7 +135,8 @@ public open class GPUParticlesCollisionSDF3D : GPUParticlesCollision3D() { } /** - * The collision SDF's size in 3D units. To improve SDF quality, the [size] should be set as small as possible while covering the parts of the scene you need. + * The collision SDF's size in 3D units. To improve SDF quality, the [size] should be set as small + * as possible while covering the parts of the scene you need. * * This is a helper function to make dealing with local copies easier. * @@ -145,7 +160,8 @@ public open class GPUParticlesCollisionSDF3D : GPUParticlesCollision3D() { /** - * Based on [value], enables or disables the specified layer in the [bakeMask], given a [layerNumber] between 1 and 32. + * Based on [param value], enables or disables the specified layer in the [bakeMask], given a + * [param layer_number] between 1 and 32. */ public fun setBakeMaskValue(layerNumber: Int, `value`: Boolean): Unit { TransferContext.writeArguments(LONG to layerNumber.toLong(), BOOL to value) @@ -153,7 +169,8 @@ public open class GPUParticlesCollisionSDF3D : GPUParticlesCollision3D() { } /** - * Returns whether or not the specified layer of the [bakeMask] is enabled, given a [layerNumber] between 1 and 32. + * Returns whether or not the specified layer of the [bakeMask] is enabled, given a [param + * layer_number] between 1 and 32. */ public fun getBakeMaskValue(layerNumber: Int): Boolean { TransferContext.writeArguments(LONG to layerNumber.toLong()) @@ -165,7 +182,8 @@ public open class GPUParticlesCollisionSDF3D : GPUParticlesCollision3D() { id: Long, ) { /** - * Bake a 16×16×16 signed distance field. This is the fastest option, but also the least precise. + * Bake a 16×16×16 signed distance field. This is the fastest option, but also the least + * precise. */ RESOLUTION_16(0), /** @@ -185,7 +203,8 @@ public open class GPUParticlesCollisionSDF3D : GPUParticlesCollision3D() { */ RESOLUTION_256(4), /** - * Bake a 512×512×512 signed distance field. This is the slowest option, but also the most precise. + * Bake a 512×512×512 signed distance field. This is the slowest option, but also the most + * precise. */ RESOLUTION_512(5), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/GPUParticlesCollisionSphere3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/GPUParticlesCollisionSphere3D.kt index 95a2ac3c2..3e5d71d9d 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/GPUParticlesCollisionSphere3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/GPUParticlesCollisionSphere3D.kt @@ -19,15 +19,14 @@ import kotlin.Int import kotlin.Suppress /** - * A sphere-shaped 3D particle collision shape affecting [godot.GPUParticles3D] nodes. - * - * A sphere-shaped 3D particle collision shape affecting [godot.GPUParticles3D] nodes. - * - * Particle collision shapes work in real-time and can be moved, rotated and scaled during gameplay. Unlike attractors, non-uniform scaling of collision shapes is *not* supported. - * - * **Note:** [godot.ParticleProcessMaterial.collisionMode] must be [godot.ParticleProcessMaterial.COLLISION_RIGID] or [godot.ParticleProcessMaterial.COLLISION_HIDE_ON_CONTACT] on the [godot.GPUParticles3D]'s process material for collision to work. - * - * **Note:** Particle collision only affects [godot.GPUParticles3D], not [godot.CPUParticles3D]. + * A sphere-shaped 3D particle collision shape affecting [GPUParticles3D] nodes. + * Particle collision shapes work in real-time and can be moved, rotated and scaled during gameplay. + * Unlike attractors, non-uniform scaling of collision shapes is *not* supported. + * **Note:** [ParticleProcessMaterial.collisionMode] must be [constant + * ParticleProcessMaterial.COLLISION_RIGID] or [constant + * ParticleProcessMaterial.COLLISION_HIDE_ON_CONTACT] on the [GPUParticles3D]'s process material for + * collision to work. + * **Note:** Particle collision only affects [GPUParticles3D], not [CPUParticles3D]. */ @GodotBaseType public open class GPUParticlesCollisionSphere3D : GPUParticlesCollision3D() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/GdjScript.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/GdjScript.kt index 90f01faf0..d80ece1f2 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/GdjScript.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/GdjScript.kt @@ -11,6 +11,16 @@ import kotlin.Boolean import kotlin.Int import kotlin.Suppress +/** + * MP3 is a lossy audio format, with worse audio quality compared to [ResourceImporterOggVorbis] at + * a given bitrate. + * In most cases, it's recommended to use Ogg Vorbis over MP3. However, if you're using a MP3 sound + * source with no higher quality source available, then it's recommended to use the MP3 file directly + * to avoid double lossy compression. + * MP3 requires more CPU to decode than [ResourceImporterWAV]. If you need to play a lot of + * simultaneous sounds, it's recommended to use WAV for those sounds instead, especially if targeting + * low-end devices. + */ @GodotBaseType public open class GdjScript : JvmScript() { public override fun new(scriptIndex: Int): Boolean { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Generic6DOFJoint3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Generic6DOFJoint3D.kt index ae82b655d..9baf1e506 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Generic6DOFJoint3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Generic6DOFJoint3D.kt @@ -23,11 +23,10 @@ import kotlin.Suppress import kotlin.Unit /** - * A physics joint that allows for complex movement and rotation between two 3D physics bodies. - * - * The [godot.Generic6DOFJoint3D] (6 Degrees Of Freedom) joint allows for implementing custom types of joints by locking the rotation and translation of certain axes. - * - * The first 3 DOF represent the linear motion of the physics bodies and the last 3 DOF represent the angular motion of the physics bodies. Each axis can be either locked, or limited. + * The [Generic6DOFJoint3D] (6 Degrees Of Freedom) joint allows for implementing custom types of + * joints by locking the rotation and translation of certain axes. + * The first 3 DOF represent the linear motion of the physics bodies and the last 3 DOF represent + * the angular motion of the physics bodies. Each axis can be either locked, or limited. */ @GodotBaseType public open class Generic6DOFJoint3D : Joint3D() { @@ -36,102 +35,66 @@ public open class Generic6DOFJoint3D : Joint3D() { return true } - /** - * - */ public fun setParamX(`param`: Param, `value`: Float): Unit { TransferContext.writeArguments(LONG to param.id, DOUBLE to value.toDouble()) TransferContext.callMethod(rawPtr, MethodBindings.setParamXPtr, NIL) } - /** - * - */ public fun getParamX(`param`: Param): Float { TransferContext.writeArguments(LONG to param.id) TransferContext.callMethod(rawPtr, MethodBindings.getParamXPtr, DOUBLE) return (TransferContext.readReturnValue(DOUBLE, false) as Double).toFloat() } - /** - * - */ public fun setParamY(`param`: Param, `value`: Float): Unit { TransferContext.writeArguments(LONG to param.id, DOUBLE to value.toDouble()) TransferContext.callMethod(rawPtr, MethodBindings.setParamYPtr, NIL) } - /** - * - */ public fun getParamY(`param`: Param): Float { TransferContext.writeArguments(LONG to param.id) TransferContext.callMethod(rawPtr, MethodBindings.getParamYPtr, DOUBLE) return (TransferContext.readReturnValue(DOUBLE, false) as Double).toFloat() } - /** - * - */ public fun setParamZ(`param`: Param, `value`: Float): Unit { TransferContext.writeArguments(LONG to param.id, DOUBLE to value.toDouble()) TransferContext.callMethod(rawPtr, MethodBindings.setParamZPtr, NIL) } - /** - * - */ public fun getParamZ(`param`: Param): Float { TransferContext.writeArguments(LONG to param.id) TransferContext.callMethod(rawPtr, MethodBindings.getParamZPtr, DOUBLE) return (TransferContext.readReturnValue(DOUBLE, false) as Double).toFloat() } - /** - * - */ public fun setFlagX(flag: Flag, `value`: Boolean): Unit { TransferContext.writeArguments(LONG to flag.id, BOOL to value) TransferContext.callMethod(rawPtr, MethodBindings.setFlagXPtr, NIL) } - /** - * - */ public fun getFlagX(flag: Flag): Boolean { TransferContext.writeArguments(LONG to flag.id) TransferContext.callMethod(rawPtr, MethodBindings.getFlagXPtr, BOOL) return (TransferContext.readReturnValue(BOOL, false) as Boolean) } - /** - * - */ public fun setFlagY(flag: Flag, `value`: Boolean): Unit { TransferContext.writeArguments(LONG to flag.id, BOOL to value) TransferContext.callMethod(rawPtr, MethodBindings.setFlagYPtr, NIL) } - /** - * - */ public fun getFlagY(flag: Flag): Boolean { TransferContext.writeArguments(LONG to flag.id) TransferContext.callMethod(rawPtr, MethodBindings.getFlagYPtr, BOOL) return (TransferContext.readReturnValue(BOOL, false) as Boolean) } - /** - * - */ public fun setFlagZ(flag: Flag, `value`: Boolean): Unit { TransferContext.writeArguments(LONG to flag.id, BOOL to value) TransferContext.callMethod(rawPtr, MethodBindings.setFlagZPtr, NIL) } - /** - * - */ public fun getFlagZ(flag: Flag): Boolean { TransferContext.writeArguments(LONG to flag.id) TransferContext.callMethod(rawPtr, MethodBindings.getFlagZPtr, BOOL) @@ -169,17 +132,8 @@ public open class Generic6DOFJoint3D : Joint3D() { * The maximum force the linear motor will apply while trying to reach the velocity target. */ PARAM_LINEAR_MOTOR_FORCE_LIMIT(6), - /** - * - */ PARAM_LINEAR_SPRING_STIFFNESS(7), - /** - * - */ PARAM_LINEAR_SPRING_DAMPING(8), - /** - * - */ PARAM_LINEAR_SPRING_EQUILIBRIUM_POINT(9), /** * The minimum rotation in negative direction to break loose and rotate around the axes. @@ -206,7 +160,8 @@ public open class Generic6DOFJoint3D : Joint3D() { */ PARAM_ANGULAR_FORCE_LIMIT(15), /** - * When rotating across the axes, this error tolerance factor defines how much the correction gets slowed down. The lower, the slower. + * When rotating across the axes, this error tolerance factor defines how much the correction + * gets slowed down. The lower, the slower. */ PARAM_ANGULAR_ERP(16), /** @@ -217,17 +172,8 @@ public open class Generic6DOFJoint3D : Joint3D() { * Maximum acceleration for the motor at the axes. */ PARAM_ANGULAR_MOTOR_FORCE_LIMIT(18), - /** - * - */ PARAM_ANGULAR_SPRING_STIFFNESS(19), - /** - * - */ PARAM_ANGULAR_SPRING_DAMPING(20), - /** - * - */ PARAM_ANGULAR_SPRING_EQUILIBRIUM_POINT(21), /** * Represents the size of the [enum Param] enum. @@ -256,13 +202,7 @@ public open class Generic6DOFJoint3D : Joint3D() { * If enabled, rotational motion is possible within the given limits. */ FLAG_ENABLE_ANGULAR_LIMIT(1), - /** - * - */ FLAG_ENABLE_LINEAR_SPRING(3), - /** - * - */ FLAG_ENABLE_ANGULAR_SPRING(2), /** * If enabled, there is a rotational motor across these axes. diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Geometry2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Geometry2D.kt index 11a5f694a..856e3fd94 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Geometry2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Geometry2D.kt @@ -34,9 +34,8 @@ import kotlin.Suppress import kotlin.jvm.JvmOverloads /** - * Provides methods for some common 2D geometric operations. - * - * Provides a set of helper functions to create geometric shapes, compute intersections between shapes, and process various other geometric operations in 2D. + * Provides a set of helper functions to create geometric shapes, compute intersections between + * shapes, and process various other geometric operations in 2D. */ @GodotBaseType public object Geometry2D : Object() { @@ -46,7 +45,8 @@ public object Geometry2D : Object() { } /** - * Returns `true` if [point] is inside the circle or if it's located exactly *on* the circle's boundary, otherwise returns `false`. + * Returns `true` if [param point] is inside the circle or if it's located exactly *on* the + * circle's boundary, otherwise returns `false`. */ public fun isPointInCircle( point: Vector2, @@ -59,7 +59,11 @@ public object Geometry2D : Object() { } /** - * Given the 2D segment ([segmentFrom], [segmentTo]), returns the position on the segment (as a number between 0 and 1) at which the segment hits the circle that is located at position [circlePosition] and has radius [circleRadius]. If the segment does not intersect the circle, -1 is returned (this is also the case if the line extending the segment would intersect the circle, but the segment does not). + * Given the 2D segment ([param segment_from], [param segment_to]), returns the position on the + * segment (as a number between 0 and 1) at which the segment hits the circle that is located at + * position [param circle_position] and has radius [param circle_radius]. If the segment does not + * intersect the circle, -1 is returned (this is also the case if the line extending the segment + * would intersect the circle, but the segment does not). */ public fun segmentIntersectsCircle( segmentFrom: Vector2, @@ -73,7 +77,9 @@ public object Geometry2D : Object() { } /** - * Checks if the two segments ([fromA], [toA]) and ([fromB], [toB]) intersect. If yes, return the point of intersection as [godot.core.Vector2]. If no intersection takes place, returns `null`. + * Checks if the two segments ([param from_a], [param to_a]) and ([param from_b], [param to_b]) + * intersect. If yes, return the point of intersection as [Vector2]. If no intersection takes place, + * returns `null`. */ public fun segmentIntersectsSegment( fromA: Vector2, @@ -87,8 +93,9 @@ public object Geometry2D : Object() { } /** - * Checks if the two lines ([fromA], [dirA]) and ([fromB], [dirB]) intersect. If yes, return the point of intersection as [godot.core.Vector2]. If no intersection takes place, returns `null`. - * + * Checks if the two lines ([param from_a], [param dir_a]) and ([param from_b], [param dir_b]) + * intersect. If yes, return the point of intersection as [Vector2]. If no intersection takes place, + * returns `null`. * **Note:** The lines are specified using direction vectors, not end points. */ public fun lineIntersectsLine( @@ -103,7 +110,10 @@ public object Geometry2D : Object() { } /** - * Given the two 2D segments ([p1], [q1]) and ([p2], [q2]), finds those two points on the two segments that are closest to each other. Returns a [godot.PackedVector2Array] that contains this point on ([p1], [q1]) as well the accompanying point on ([p2], [q2]). + * Given the two 2D segments ([param p1], [param q1]) and ([param p2], [param q2]), finds those + * two points on the two segments that are closest to each other. Returns a [PackedVector2Array] that + * contains this point on ([param p1], [param q1]) as well the accompanying point on ([param p2], + * [param q2]). */ public fun getClosestPointsBetweenSegments( p1: Vector2, @@ -118,7 +128,8 @@ public object Geometry2D : Object() { } /** - * Returns the 2D point on the 2D segment ([s1], [s2]) that is closest to [point]. The returned point will always be inside the specified segment. + * Returns the 2D point on the 2D segment ([param s1], [param s2]) that is closest to [param + * point]. The returned point will always be inside the specified segment. */ public fun getClosestPointToSegment( point: Vector2, @@ -131,7 +142,9 @@ public object Geometry2D : Object() { } /** - * Returns the 2D point on the 2D line defined by ([s1], [s2]) that is closest to [point]. The returned point can be inside the segment ([s1], [s2]) or outside of it, i.e. somewhere on the line extending from the segment. + * Returns the 2D point on the 2D line defined by ([param s1], [param s2]) that is closest to + * [param point]. The returned point can be inside the segment ([param s1], [param s2]) or outside of + * it, i.e. somewhere on the line extending from the segment. */ public fun getClosestPointToSegmentUncapped( point: Vector2, @@ -144,7 +157,8 @@ public object Geometry2D : Object() { } /** - * Returns if [point] is inside the triangle specified by [a], [b] and [c]. + * Returns if [param point] is inside the triangle specified by [param a], [param b] and [param + * c]. */ public fun pointIsInsideTriangle( point: Vector2, @@ -158,7 +172,8 @@ public object Geometry2D : Object() { } /** - * Returns `true` if [polygon]'s vertices are ordered in clockwise order, otherwise returns `false`. + * Returns `true` if [param polygon]'s vertices are ordered in clockwise order, otherwise returns + * `false`. */ public fun isPolygonClockwise(polygon: PackedVector2Array): Boolean { TransferContext.writeArguments(PACKED_VECTOR2_ARRAY to polygon) @@ -167,7 +182,8 @@ public object Geometry2D : Object() { } /** - * Returns `true` if [point] is inside [polygon] or if it's located exactly *on* polygon's boundary, otherwise returns `false`. + * Returns `true` if [param point] is inside [param polygon] or if it's located exactly *on* + * polygon's boundary, otherwise returns `false`. */ public fun isPointInPolygon(point: Vector2, polygon: PackedVector2Array): Boolean { TransferContext.writeArguments(VECTOR2 to point, PACKED_VECTOR2_ARRAY to polygon) @@ -176,7 +192,11 @@ public object Geometry2D : Object() { } /** - * Triangulates the polygon specified by the points in [polygon]. Returns a [godot.PackedInt32Array] where each triangle consists of three consecutive point indices into [polygon] (i.e. the returned array will have `n * 3` elements, with `n` being the number of found triangles). Output triangles will always be counter clockwise, and the contour will be flipped if it's clockwise. If the triangulation did not succeed, an empty [godot.PackedInt32Array] is returned. + * Triangulates the polygon specified by the points in [param polygon]. Returns a + * [PackedInt32Array] where each triangle consists of three consecutive point indices into [param + * polygon] (i.e. the returned array will have `n * 3` elements, with `n` being the number of found + * triangles). Output triangles will always be counter clockwise, and the contour will be flipped if + * it's clockwise. If the triangulation did not succeed, an empty [PackedInt32Array] is returned. */ public fun triangulatePolygon(polygon: PackedVector2Array): PackedInt32Array { TransferContext.writeArguments(PACKED_VECTOR2_ARRAY to polygon) @@ -185,7 +205,11 @@ public object Geometry2D : Object() { } /** - * Triangulates the area specified by discrete set of [points] such that no point is inside the circumcircle of any resulting triangle. Returns a [godot.PackedInt32Array] where each triangle consists of three consecutive point indices into [points] (i.e. the returned array will have `n * 3` elements, with `n` being the number of found triangles). If the triangulation did not succeed, an empty [godot.PackedInt32Array] is returned. + * Triangulates the area specified by discrete set of [param points] such that no point is inside + * the circumcircle of any resulting triangle. Returns a [PackedInt32Array] where each triangle + * consists of three consecutive point indices into [param points] (i.e. the returned array will have + * `n * 3` elements, with `n` being the number of found triangles). If the triangulation did not + * succeed, an empty [PackedInt32Array] is returned. */ public fun triangulateDelaunay(points: PackedVector2Array): PackedInt32Array { TransferContext.writeArguments(PACKED_VECTOR2_ARRAY to points) @@ -194,7 +218,8 @@ public object Geometry2D : Object() { } /** - * Given an array of [godot.core.Vector2]s, returns the convex hull as a list of points in counterclockwise order. The last point is the same as the first one. + * Given an array of [Vector2]s, returns the convex hull as a list of points in counterclockwise + * order. The last point is the same as the first one. */ public fun convexHull(points: PackedVector2Array): PackedVector2Array { TransferContext.writeArguments(PACKED_VECTOR2_ARRAY to points) @@ -203,7 +228,8 @@ public object Geometry2D : Object() { } /** - * Decomposes the [polygon] into multiple convex hulls and returns an array of [godot.PackedVector2Array]. + * Decomposes the [param polygon] into multiple convex hulls and returns an array of + * [PackedVector2Array]. */ public fun decomposePolygonInConvex(polygon: PackedVector2Array): VariantArray { @@ -213,9 +239,10 @@ public object Geometry2D : Object() { } /** - * Merges (combines) [polygonA] and [polygonB] and returns an array of merged polygons. This performs [OPERATION_UNION] between polygons. - * - * The operation may result in an outer polygon (boundary) and multiple inner polygons (holes) produced which could be distinguished by calling [isPolygonClockwise]. + * Merges (combines) [param polygon_a] and [param polygon_b] and returns an array of merged + * polygons. This performs [constant OPERATION_UNION] between polygons. + * The operation may result in an outer polygon (boundary) and multiple inner polygons (holes) + * produced which could be distinguished by calling [isPolygonClockwise]. */ public fun mergePolygons(polygonA: PackedVector2Array, polygonB: PackedVector2Array): VariantArray { @@ -225,9 +252,11 @@ public object Geometry2D : Object() { } /** - * Clips [polygonA] against [polygonB] and returns an array of clipped polygons. This performs [OPERATION_DIFFERENCE] between polygons. Returns an empty array if [polygonB] completely overlaps [polygonA]. - * - * If [polygonB] is enclosed by [polygonA], returns an outer polygon (boundary) and inner polygon (hole) which could be distinguished by calling [isPolygonClockwise]. + * Clips [param polygon_a] against [param polygon_b] and returns an array of clipped polygons. + * This performs [constant OPERATION_DIFFERENCE] between polygons. Returns an empty array if [param + * polygon_b] completely overlaps [param polygon_a]. + * If [param polygon_b] is enclosed by [param polygon_a], returns an outer polygon (boundary) and + * inner polygon (hole) which could be distinguished by calling [isPolygonClockwise]. */ public fun clipPolygons(polygonA: PackedVector2Array, polygonB: PackedVector2Array): VariantArray { @@ -237,9 +266,11 @@ public object Geometry2D : Object() { } /** - * Intersects [polygonA] with [polygonB] and returns an array of intersected polygons. This performs [OPERATION_INTERSECTION] between polygons. In other words, returns common area shared by polygons. Returns an empty array if no intersection occurs. - * - * The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which could be distinguished by calling [isPolygonClockwise]. + * Intersects [param polygon_a] with [param polygon_b] and returns an array of intersected + * polygons. This performs [constant OPERATION_INTERSECTION] between polygons. In other words, + * returns common area shared by polygons. Returns an empty array if no intersection occurs. + * The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which + * could be distinguished by calling [isPolygonClockwise]. */ public fun intersectPolygons(polygonA: PackedVector2Array, polygonB: PackedVector2Array): VariantArray { @@ -249,9 +280,12 @@ public object Geometry2D : Object() { } /** - * Mutually excludes common area defined by intersection of [polygonA] and [polygonB] (see [intersectPolygons]) and returns an array of excluded polygons. This performs [OPERATION_XOR] between polygons. In other words, returns all but common area between polygons. - * - * The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which could be distinguished by calling [isPolygonClockwise]. + * Mutually excludes common area defined by intersection of [param polygon_a] and [param + * polygon_b] (see [intersectPolygons]) and returns an array of excluded polygons. This performs + * [constant OPERATION_XOR] between polygons. In other words, returns all but common area between + * polygons. + * The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which + * could be distinguished by calling [isPolygonClockwise]. */ public fun excludePolygons(polygonA: PackedVector2Array, polygonB: PackedVector2Array): VariantArray { @@ -261,7 +295,9 @@ public object Geometry2D : Object() { } /** - * Clips [polyline] against [polygon] and returns an array of clipped polylines. This performs [OPERATION_DIFFERENCE] between the polyline and the polygon. This operation can be thought of as cutting a line with a closed shape. + * Clips [param polyline] against [param polygon] and returns an array of clipped polylines. This + * performs [constant OPERATION_DIFFERENCE] between the polyline and the polygon. This operation can + * be thought of as cutting a line with a closed shape. */ public fun clipPolylineWithPolygon(polyline: PackedVector2Array, polygon: PackedVector2Array): VariantArray { @@ -271,7 +307,9 @@ public object Geometry2D : Object() { } /** - * Intersects [polyline] with [polygon] and returns an array of intersected polylines. This performs [OPERATION_INTERSECTION] between the polyline and the polygon. This operation can be thought of as chopping a line with a closed shape. + * Intersects [param polyline] with [param polygon] and returns an array of intersected polylines. + * This performs [constant OPERATION_INTERSECTION] between the polyline and the polygon. This + * operation can be thought of as chopping a line with a closed shape. */ public fun intersectPolylineWithPolygon(polyline: PackedVector2Array, polygon: PackedVector2Array): VariantArray { @@ -281,41 +319,33 @@ public object Geometry2D : Object() { } /** - * Inflates or deflates [polygon] by [delta] units (pixels). If [delta] is positive, makes the polygon grow outward. If [delta] is negative, shrinks the polygon inward. Returns an array of polygons because inflating/deflating may result in multiple discrete polygons. Returns an empty array if [delta] is negative and the absolute value of it approximately exceeds the minimum bounding rectangle dimensions of the polygon. - * - * Each polygon's vertices will be rounded as determined by [joinType], see [enum PolyJoinType]. - * - * The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which could be distinguished by calling [isPolygonClockwise]. - * - * **Note:** To translate the polygon's vertices specifically, multiply them to a [godot.core.Transform2D]: - * - * [codeblocks] - * - * [gdscript] - * - * var polygon = PackedVector2Array([godot.Vector2(0, 0), Vector2(100, 0), Vector2(100, 100), Vector2(0, 100)]) + * Inflates or deflates [param polygon] by [param delta] units (pixels). If [param delta] is + * positive, makes the polygon grow outward. If [param delta] is negative, shrinks the polygon + * inward. Returns an array of polygons because inflating/deflating may result in multiple discrete + * polygons. Returns an empty array if [param delta] is negative and the absolute value of it + * approximately exceeds the minimum bounding rectangle dimensions of the polygon. + * Each polygon's vertices will be rounded as determined by [param join_type], see [enum + * PolyJoinType]. + * The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which + * could be distinguished by calling [isPolygonClockwise]. + * **Note:** To translate the polygon's vertices specifically, multiply them to a [Transform2D]: * + * gdscript: + * ```gdscript + * var polygon = PackedVector2Array([Vector2(0, 0), Vector2(100, 0), Vector2(100, 100), Vector2(0, + * 100)]) * var offset = Vector2(50, 50) - * * polygon = Transform2D(0, offset) * polygon - * * print(polygon) # prints [(50, 50), (150, 50), (150, 150), (50, 150)] - * - * [/gdscript] - * - * [csharp] - * - * var polygon = new Vector2[] { new Vector2(0, 0), new Vector2(100, 0), new Vector2(100, 100), new Vector2(0, 100) }; - * + * ``` + * csharp: + * ```csharp + * var polygon = new Vector2[] { new Vector2(0, 0), new Vector2(100, 0), new Vector2(100, 100), + * new Vector2(0, 100) }; * var offset = new Vector2(50, 50); - * * polygon = new Transform2D(0, offset) * polygon; - * * GD.Print((Variant)polygon); // prints [(50, 50), (150, 50), (150, 150), (50, 150)] - * - * [/csharp] - * - * [/codeblocks] + * ``` */ @JvmOverloads public fun offsetPolygon( @@ -329,13 +359,16 @@ public object Geometry2D : Object() { } /** - * Inflates or deflates [polyline] by [delta] units (pixels), producing polygons. If [delta] is positive, makes the polyline grow outward. Returns an array of polygons because inflating/deflating may result in multiple discrete polygons. If [delta] is negative, returns an empty array. - * - * Each polygon's vertices will be rounded as determined by [joinType], see [enum PolyJoinType]. - * - * Each polygon's endpoints will be rounded as determined by [endType], see [enum PolyEndType]. - * - * The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which could be distinguished by calling [isPolygonClockwise]. + * Inflates or deflates [param polyline] by [param delta] units (pixels), producing polygons. If + * [param delta] is positive, makes the polyline grow outward. Returns an array of polygons because + * inflating/deflating may result in multiple discrete polygons. If [param delta] is negative, + * returns an empty array. + * Each polygon's vertices will be rounded as determined by [param join_type], see [enum + * PolyJoinType]. + * Each polygon's endpoints will be rounded as determined by [param end_type], see [enum + * PolyEndType]. + * The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which + * could be distinguished by calling [isPolygonClockwise]. */ @JvmOverloads public fun offsetPolyline( @@ -350,7 +383,9 @@ public object Geometry2D : Object() { } /** - * Given an array of [godot.core.Vector2]s representing tiles, builds an atlas. The returned dictionary has two keys: `points` is a [godot.PackedVector2Array] that specifies the positions of each tile, `size` contains the overall size of the whole atlas as [godot.Vector2i]. + * Given an array of [Vector2]s representing tiles, builds an atlas. The returned dictionary has + * two keys: `points` is a [PackedVector2Array] that specifies the positions of each tile, `size` + * contains the overall size of the whole atlas as [Vector2i]. */ public fun makeAtlas(sizes: PackedVector2Array): Dictionary { TransferContext.writeArguments(PACKED_VECTOR2_ARRAY to sizes) @@ -374,7 +409,8 @@ public object Geometry2D : Object() { */ OPERATION_INTERSECTION(2), /** - * Create regions where either subject or clip polygons are filled but not where both are filled. + * Create regions where either subject or clip polygons are filled but not where both are + * filled. */ OPERATION_XOR(3), ; @@ -397,11 +433,14 @@ public object Geometry2D : Object() { */ JOIN_SQUARE(0), /** - * While flattened paths can never perfectly trace an arc, they are approximated by a series of arc chords. + * While flattened paths can never perfectly trace an arc, they are approximated by a series of + * arc chords. */ JOIN_ROUND(1), /** - * There's a necessary limit to mitered joins since offsetting edges that join at very acute angles will produce excessively long and narrow "spikes". For any given edge join, when miter offsetting would exceed that maximum distance, "square" joining is applied. + * There's a necessary limit to mitered joins since offsetting edges that join at very acute + * angles will produce excessively long and narrow "spikes". For any given edge join, when miter + * offsetting would exceed that maximum distance, "square" joining is applied. */ JOIN_MITER(2), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Geometry3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Geometry3D.kt index 00786784a..b4fbafcef 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Geometry3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Geometry3D.kt @@ -29,9 +29,8 @@ import kotlin.Suppress import kotlin.jvm.JvmOverloads /** - * Provides methods for some common 3D geometric operations. - * - * Provides a set of helper functions to create geometric shapes, compute intersections between shapes, and process various other geometric operations in 3D. + * Provides a set of helper functions to create geometric shapes, compute intersections between + * shapes, and process various other geometric operations in 3D. */ @GodotBaseType public object Geometry3D : Object() { @@ -41,7 +40,8 @@ public object Geometry3D : Object() { } /** - * Calculates and returns all the vertex points of a convex shape defined by an array of [planes]. + * Calculates and returns all the vertex points of a convex shape defined by an array of [param + * planes]. */ public fun computeConvexMeshPoints(planes: VariantArray): PackedVector3Array { TransferContext.writeArguments(ARRAY to planes) @@ -51,7 +51,9 @@ public object Geometry3D : Object() { } /** - * Returns an array with 6 [godot.core.Plane]s that describe the sides of a box centered at the origin. The box size is defined by [extents], which represents one (positive) corner of the box (i.e. half its actual size). + * Returns an array with 6 [Plane]s that describe the sides of a box centered at the origin. The + * box size is defined by [param extents], which represents one (positive) corner of the box (i.e. + * half its actual size). */ public fun buildBoxPlanes(extents: Vector3): VariantArray { TransferContext.writeArguments(VECTOR3 to extents) @@ -60,7 +62,10 @@ public object Geometry3D : Object() { } /** - * Returns an array of [godot.core.Plane]s closely bounding a faceted cylinder centered at the origin with radius [radius] and height [height]. The parameter [sides] defines how many planes will be generated for the round part of the cylinder. The parameter [axis] describes the axis along which the cylinder is oriented (0 for X, 1 for Y, 2 for Z). + * Returns an array of [Plane]s closely bounding a faceted cylinder centered at the origin with + * radius [param radius] and height [param height]. The parameter [param sides] defines how many + * planes will be generated for the round part of the cylinder. The parameter [param axis] describes + * the axis along which the cylinder is oriented (0 for X, 1 for Y, 2 for Z). */ @JvmOverloads public fun buildCylinderPlanes( @@ -75,7 +80,11 @@ public object Geometry3D : Object() { } /** - * Returns an array of [godot.core.Plane]s closely bounding a faceted capsule centered at the origin with radius [radius] and height [height]. The parameter [sides] defines how many planes will be generated for the side part of the capsule, whereas [lats] gives the number of latitudinal steps at the bottom and top of the capsule. The parameter [axis] describes the axis along which the capsule is oriented (0 for X, 1 for Y, 2 for Z). + * Returns an array of [Plane]s closely bounding a faceted capsule centered at the origin with + * radius [param radius] and height [param height]. The parameter [param sides] defines how many + * planes will be generated for the side part of the capsule, whereas [param lats] gives the number + * of latitudinal steps at the bottom and top of the capsule. The parameter [param axis] describes + * the axis along which the capsule is oriented (0 for X, 1 for Y, 2 for Z). */ @JvmOverloads public fun buildCapsulePlanes( @@ -91,7 +100,10 @@ public object Geometry3D : Object() { } /** - * Given the two 3D segments ([p1], [p2]) and ([q1], [q2]), finds those two points on the two segments that are closest to each other. Returns a [godot.PackedVector3Array] that contains this point on ([p1], [p2]) as well the accompanying point on ([q1], [q2]). + * Given the two 3D segments ([param p1], [param p2]) and ([param q1], [param q2]), finds those + * two points on the two segments that are closest to each other. Returns a [PackedVector3Array] that + * contains this point on ([param p1], [param p2]) as well the accompanying point on ([param q1], + * [param q2]). */ public fun getClosestPointsBetweenSegments( p1: Vector3, @@ -106,7 +118,8 @@ public object Geometry3D : Object() { } /** - * Returns the 3D point on the 3D segment ([s1], [s2]) that is closest to [point]. The returned point will always be inside the specified segment. + * Returns the 3D point on the 3D segment ([param s1], [param s2]) that is closest to [param + * point]. The returned point will always be inside the specified segment. */ public fun getClosestPointToSegment( point: Vector3, @@ -119,7 +132,9 @@ public object Geometry3D : Object() { } /** - * Returns the 3D point on the 3D line defined by ([s1], [s2]) that is closest to [point]. The returned point can be inside the segment ([s1], [s2]) or outside of it, i.e. somewhere on the line extending from the segment. + * Returns the 3D point on the 3D line defined by ([param s1], [param s2]) that is closest to + * [param point]. The returned point can be inside the segment ([param s1], [param s2]) or outside of + * it, i.e. somewhere on the line extending from the segment. */ public fun getClosestPointToSegmentUncapped( point: Vector3, @@ -132,9 +147,12 @@ public object Geometry3D : Object() { } /** - * Returns a [godot.core.Vector3] containing weights based on how close a 3D position ([point]) is to a triangle's different vertices ([a], [b] and [c]). This is useful for interpolating between the data of different vertices in a triangle. One example use case is using this to smoothly rotate over a mesh instead of relying solely on face normals. - * - * [godot.Here is a more detailed explanation of barycentric coordinates.](https://en.wikipedia.org/wiki/Barycentric_coordinate_system) + * Returns a [Vector3] containing weights based on how close a 3D position ([param point]) is to a + * triangle's different vertices ([param a], [param b] and [param c]). This is useful for + * interpolating between the data of different vertices in a triangle. One example use case is using + * this to smoothly rotate over a mesh instead of relying solely on face normals. + * [url=https://en.wikipedia.org/wiki/Barycentric_coordinate_system]Here is a more detailed + * explanation of barycentric coordinates.[/url] */ public fun getTriangleBarycentricCoords( point: Vector3, @@ -148,7 +166,9 @@ public object Geometry3D : Object() { } /** - * Tests if the 3D ray starting at [from] with the direction of [dir] intersects the triangle specified by [a], [b] and [c]. If yes, returns the point of intersection as [godot.core.Vector3]. If no intersection takes place, returns `null`. + * Tests if the 3D ray starting at [param from] with the direction of [param dir] intersects the + * triangle specified by [param a], [param b] and [param c]. If yes, returns the point of + * intersection as [Vector3]. If no intersection takes place, returns `null`. */ public fun rayIntersectsTriangle( from: Vector3, @@ -163,7 +183,9 @@ public object Geometry3D : Object() { } /** - * Tests if the segment ([from], [to]) intersects the triangle [a], [b], [c]. If yes, returns the point of intersection as [godot.core.Vector3]. If no intersection takes place, returns `null`. + * Tests if the segment ([param from], [param to]) intersects the triangle [param a], [param b], + * [param c]. If yes, returns the point of intersection as [Vector3]. If no intersection takes place, + * returns `null`. */ public fun segmentIntersectsTriangle( from: Vector3, @@ -178,7 +200,10 @@ public object Geometry3D : Object() { } /** - * Checks if the segment ([from], [to]) intersects the sphere that is located at [spherePosition] and has radius [sphereRadius]. If no, returns an empty [godot.PackedVector3Array]. If yes, returns a [godot.PackedVector3Array] containing the point of intersection and the sphere's normal at the point of intersection. + * Checks if the segment ([param from], [param to]) intersects the sphere that is located at + * [param sphere_position] and has radius [param sphere_radius]. If no, returns an empty + * [PackedVector3Array]. If yes, returns a [PackedVector3Array] containing the point of intersection + * and the sphere's normal at the point of intersection. */ public fun segmentIntersectsSphere( from: Vector3, @@ -193,7 +218,10 @@ public object Geometry3D : Object() { } /** - * Checks if the segment ([from], [to]) intersects the cylinder with height [height] that is centered at the origin and has radius [radius]. If no, returns an empty [godot.PackedVector3Array]. If an intersection takes place, the returned array contains the point of intersection and the cylinder's normal at the point of intersection. + * Checks if the segment ([param from], [param to]) intersects the cylinder with height [param + * height] that is centered at the origin and has radius [param radius]. If no, returns an empty + * [PackedVector3Array]. If an intersection takes place, the returned array contains the point of + * intersection and the cylinder's normal at the point of intersection. */ public fun segmentIntersectsCylinder( from: Vector3, @@ -208,7 +236,10 @@ public object Geometry3D : Object() { } /** - * Given a convex hull defined though the [godot.core.Plane]s in the array [planes], tests if the segment ([from], [to]) intersects with that hull. If an intersection is found, returns a [godot.PackedVector3Array] containing the point the intersection and the hull's normal. Otherwise, returns an empty array. + * Given a convex hull defined though the [Plane]s in the array [param planes], tests if the + * segment ([param from], [param to]) intersects with that hull. If an intersection is found, returns + * a [PackedVector3Array] containing the point the intersection and the hull's normal. Otherwise, + * returns an empty array. */ public fun segmentIntersectsConvex( from: Vector3, @@ -222,7 +253,8 @@ public object Geometry3D : Object() { } /** - * Clips the polygon defined by the points in [points] against the [plane] and returns the points of the clipped polygon. + * Clips the polygon defined by the points in [param points] against the [param plane] and returns + * the points of the clipped polygon. */ public fun clipPolygon(points: PackedVector3Array, plane: Plane): PackedVector3Array { TransferContext.writeArguments(PACKED_VECTOR3_ARRAY to points, PLANE to plane) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Gradient.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Gradient.kt index 5e380a844..220afdabf 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Gradient.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Gradient.kt @@ -28,16 +28,15 @@ import kotlin.Suppress import kotlin.Unit /** - * A color transition. - * - * This resource describes a color transition by defining a set of colored points and how to interpolate between them. - * - * See also [godot.Curve] which supports more complex easing methods, but does not support colors. + * This resource describes a color transition by defining a set of colored points and how to + * interpolate between them. + * See also [Curve] which supports more complex easing methods, but does not support colors. */ @GodotBaseType public open class Gradient : Resource() { /** - * The algorithm used to interpolate between points of the gradient. See [enum InterpolationMode] for available modes. + * The algorithm used to interpolate between points of the gradient. See [enum InterpolationMode] + * for available modes. */ public var interpolationMode: InterpolationMode get() { @@ -51,9 +50,10 @@ public open class Gradient : Resource() { } /** - * The color space used to interpolate between points of the gradient. It does not affect the returned colors, which will always be in sRGB space. See [enum ColorSpace] for available modes. - * - * **Note:** This setting has no effect when [interpolationMode] is set to [GRADIENT_INTERPOLATE_CONSTANT]. + * The color space used to interpolate between points of the gradient. It does not affect the + * returned colors, which will always be in sRGB space. See [enum ColorSpace] for available modes. + * **Note:** This setting has no effect when [interpolationMode] is set to [constant + * GRADIENT_INTERPOLATE_CONSTANT]. */ public var interpolationColorSpace: ColorSpace get() { @@ -67,9 +67,10 @@ public open class Gradient : Resource() { } /** - * Gradient's offsets returned as a [godot.PackedFloat32Array]. - * - * **Note:** This property returns a copy, modifying the return value does not update the gradient. To update the gradient use [setOffset] method (for updating offsets individually) or assign to this property directly (for bulk-updating all offsets at once). + * Gradient's offsets returned as a [PackedFloat32Array]. + * **Note:** This property returns a copy, modifying the return value does not update the + * gradient. To update the gradient use [setOffset] method (for updating offsets individually) or + * assign to this property directly (for bulk-updating all offsets at once). */ public var offsets: PackedFloat32Array get() { @@ -83,9 +84,10 @@ public open class Gradient : Resource() { } /** - * Gradient's colors returned as a [godot.PackedColorArray]. - * - * **Note:** This property returns a copy, modifying the return value does not update the gradient. To update the gradient use [setColor] method (for updating colors individually) or assign to this property directly (for bulk-updating all colors at once). + * Gradient's colors returned as a [PackedColorArray]. + * **Note:** This property returns a copy, modifying the return value does not update the + * gradient. To update the gradient use [setColor] method (for updating colors individually) or + * assign to this property directly (for bulk-updating all colors at once). */ public var colors: PackedColorArray get() { @@ -112,7 +114,7 @@ public open class Gradient : Resource() { } /** - * Removes the color at index [point]. + * Removes the color at index [param point]. */ public fun removePoint(point: Int): Unit { TransferContext.writeArguments(LONG to point.toLong()) @@ -120,7 +122,7 @@ public open class Gradient : Resource() { } /** - * Sets the offset for the gradient color at index [point]. + * Sets the offset for the gradient color at index [param point]. */ public fun setOffset(point: Int, offset: Float): Unit { TransferContext.writeArguments(LONG to point.toLong(), DOUBLE to offset.toDouble()) @@ -128,7 +130,7 @@ public open class Gradient : Resource() { } /** - * Returns the offset of the gradient color at index [point]. + * Returns the offset of the gradient color at index [param point]. */ public fun getOffset(point: Int): Float { TransferContext.writeArguments(LONG to point.toLong()) @@ -138,8 +140,8 @@ public open class Gradient : Resource() { /** * Reverses/mirrors the gradient. - * - * **Note:** This method mirrors all points around the middle of the gradient, which may produce unexpected results when [interpolationMode] is set to [GRADIENT_INTERPOLATE_CONSTANT]. + * **Note:** This method mirrors all points around the middle of the gradient, which may produce + * unexpected results when [interpolationMode] is set to [constant GRADIENT_INTERPOLATE_CONSTANT]. */ public fun reverse(): Unit { TransferContext.writeArguments() @@ -147,7 +149,7 @@ public open class Gradient : Resource() { } /** - * Sets the color of the gradient color at index [point]. + * Sets the color of the gradient color at index [param point]. */ public fun setColor(point: Int, color: Color): Unit { TransferContext.writeArguments(LONG to point.toLong(), COLOR to color) @@ -155,7 +157,7 @@ public open class Gradient : Resource() { } /** - * Returns the color of the gradient color at index [point]. + * Returns the color of the gradient color at index [param point]. */ public fun getColor(point: Int): Color { TransferContext.writeArguments(LONG to point.toLong()) @@ -164,7 +166,7 @@ public open class Gradient : Resource() { } /** - * Returns the interpolated color specified by [offset]. + * Returns the interpolated color specified by [param offset]. */ public fun sample(offset: Float): Color { TransferContext.writeArguments(DOUBLE to offset.toDouble()) @@ -189,7 +191,8 @@ public open class Gradient : Resource() { */ GRADIENT_INTERPOLATE_LINEAR(0), /** - * Constant interpolation, color changes abruptly at each point and stays uniform between. This might cause visible aliasing when used for a gradient texture in some cases. + * Constant interpolation, color changes abruptly at each point and stays uniform between. This + * might cause visible aliasing when used for a gradient texture in some cases. */ GRADIENT_INTERPOLATE_CONSTANT(1), /** @@ -220,7 +223,8 @@ public open class Gradient : Resource() { */ GRADIENT_COLOR_SPACE_LINEAR_SRGB(1), /** - * [godot.Oklab](https://bottosson.github.io/posts/oklab/) color space. This color space provides a smooth and uniform-looking transition between colors. + * [url=https://bottosson.github.io/posts/oklab/]Oklab[/url] color space. This color space + * provides a smooth and uniform-looking transition between colors. */ GRADIENT_COLOR_SPACE_OKLAB(2), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/GradientTexture1D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/GradientTexture1D.kt index 970959bdf..88682b74d 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/GradientTexture1D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/GradientTexture1D.kt @@ -20,14 +20,15 @@ import kotlin.Suppress import kotlin.jvm.JvmName /** - * A 1D texture that uses colors obtained from a [godot.Gradient]. - * - * A 1D texture that obtains colors from a [godot.Gradient] to fill the texture data. The texture is filled by sampling the gradient for each pixel. Therefore, the texture does not necessarily represent an exact copy of the gradient, as it may miss some colors if there are not enough pixels. See also [godot.GradientTexture2D], [godot.CurveTexture] and [godot.CurveXYZTexture]. + * A 1D texture that obtains colors from a [Gradient] to fill the texture data. The texture is + * filled by sampling the gradient for each pixel. Therefore, the texture does not necessarily + * represent an exact copy of the gradient, as it may miss some colors if there are not enough pixels. + * See also [GradientTexture2D], [CurveTexture] and [CurveXYZTexture]. */ @GodotBaseType public open class GradientTexture1D : Texture2D() { /** - * The [godot.Gradient] used to fill the texture. + * The [Gradient] used to fill the texture. */ public var gradient: Gradient? get() { @@ -41,7 +42,7 @@ public open class GradientTexture1D : Texture2D() { } /** - * The number of color samples that will be obtained from the [godot.Gradient]. + * The number of color samples that will be obtained from the [Gradient]. */ public var width: Int @JvmName("getWidth_prop") @@ -52,7 +53,10 @@ public open class GradientTexture1D : Texture2D() { } /** - * If `true`, the generated texture will support high dynamic range ([godot.Image.FORMAT_RGBAF] format). This allows for glow effects to work if [godot.Environment.glowEnabled] is `true`. If `false`, the generated texture will use low dynamic range; overbright colors will be clamped ([godot.Image.FORMAT_RGBA8] format). + * If `true`, the generated texture will support high dynamic range ([constant Image.FORMAT_RGBAF] + * format). This allows for glow effects to work if [Environment.glowEnabled] is `true`. If `false`, + * the generated texture will use low dynamic range; overbright colors will be clamped ([constant + * Image.FORMAT_RGBA8] format). */ public var useHdr: Boolean get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/GradientTexture2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/GradientTexture2D.kt index 991a39213..0807a54e9 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/GradientTexture2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/GradientTexture2D.kt @@ -26,14 +26,16 @@ import kotlin.Unit import kotlin.jvm.JvmName /** - * A 2D texture that creates a pattern with colors obtained from a [godot.Gradient]. - * - * A 2D texture that obtains colors from a [godot.Gradient] to fill the texture data. This texture is able to transform a color transition into different patterns such as a linear or a radial gradient. The gradient is sampled individually for each pixel so it does not necessarily represent an exact copy of the gradient(see [width] and [height]). See also [godot.GradientTexture1D], [godot.CurveTexture] and [godot.CurveXYZTexture]. + * A 2D texture that obtains colors from a [Gradient] to fill the texture data. This texture is able + * to transform a color transition into different patterns such as a linear or a radial gradient. The + * gradient is sampled individually for each pixel so it does not necessarily represent an exact copy + * of the gradient(see [width] and [height]). See also [GradientTexture1D], [CurveTexture] and + * [CurveXYZTexture]. */ @GodotBaseType public open class GradientTexture2D : Texture2D() { /** - * The [godot.Gradient] used to fill the texture. + * The [Gradient] used to fill the texture. */ public var gradient: Gradient? get() { @@ -47,7 +49,8 @@ public open class GradientTexture2D : Texture2D() { } /** - * The number of horizontal color samples that will be obtained from the [godot.Gradient], which also represents the texture's width. + * The number of horizontal color samples that will be obtained from the [Gradient], which also + * represents the texture's width. */ public var width: Int @JvmName("getWidth_prop") @@ -58,7 +61,8 @@ public open class GradientTexture2D : Texture2D() { } /** - * The number of vertical color samples that will be obtained from the [godot.Gradient], which also represents the texture's height. + * The number of vertical color samples that will be obtained from the [Gradient], which also + * represents the texture's height. */ public var height: Int @JvmName("getHeight_prop") @@ -69,7 +73,10 @@ public open class GradientTexture2D : Texture2D() { } /** - * If `true`, the generated texture will support high dynamic range ([godot.Image.FORMAT_RGBAF] format). This allows for glow effects to work if [godot.Environment.glowEnabled] is `true`. If `false`, the generated texture will use low dynamic range; overbright colors will be clamped ([godot.Image.FORMAT_RGBA8] format). + * If `true`, the generated texture will support high dynamic range ([constant Image.FORMAT_RGBAF] + * format). This allows for glow effects to work if [Environment.glowEnabled] is `true`. If `false`, + * the generated texture will use low dynamic range; overbright colors will be clamped ([constant + * Image.FORMAT_RGBA8] format). */ public var useHdr: Boolean get() { @@ -83,7 +90,8 @@ public open class GradientTexture2D : Texture2D() { } /** - * The gradient fill type, one of the [enum Fill] values. The texture is filled by interpolating colors starting from [fillFrom] to [fillTo] offsets. + * The gradient fill type, one of the [enum Fill] values. The texture is filled by interpolating + * colors starting from [fillFrom] to [fillTo] offsets. */ public var fill: Fill get() { @@ -127,7 +135,9 @@ public open class GradientTexture2D : Texture2D() { } /** - * The gradient repeat type, one of the [enum Repeat] values. The texture is filled starting from [fillFrom] to [fillTo] offsets by default, but the gradient fill can be repeated to cover the entire texture. + * The gradient repeat type, one of the [enum Repeat] values. The texture is filled starting from + * [fillFrom] to [fillTo] offsets by default, but the gradient fill can be repeated to cover the + * entire texture. */ public var repeat: Repeat get() { @@ -228,11 +238,13 @@ public open class GradientTexture2D : Texture2D() { */ REPEAT_NONE(0), /** - * The texture is filled starting from [fillFrom] to [fillTo] offsets, repeating the same pattern in both directions. + * The texture is filled starting from [fillFrom] to [fillTo] offsets, repeating the same + * pattern in both directions. */ REPEAT(1), /** - * The texture is filled starting from [fillFrom] to [fillTo] offsets, mirroring the pattern in both directions. + * The texture is filled starting from [fillFrom] to [fillTo] offsets, mirroring the pattern in + * both directions. */ REPEAT_MIRROR(2), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/GraphElement.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/GraphElement.kt index d30b503dd..b1653714f 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/GraphElement.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/GraphElement.kt @@ -26,9 +26,9 @@ import kotlin.Suppress import kotlin.Unit /** - * A container that represents a basic element that can be placed inside a [godot.GraphEdit] control. - * - * [godot.GraphElement] allows to create custom elements for a [godot.GraphEdit] graph. By default such elements can be selected, resized, and repositioned, but they cannot be connected. For a graph element that allows for connections see [godot.GraphNode]. + * [GraphElement] allows to create custom elements for a [GraphEdit] graph. By default such elements + * can be selected, resized, and repositioned, but they cannot be connected. For a graph element that + * allows for connections see [GraphNode]. */ @GodotBaseType public open class GraphElement : Container() { @@ -43,7 +43,8 @@ public open class GraphElement : Container() { public val nodeDeselected: Signal0 by signal() /** - * Emitted when displaying the GraphElement over other ones is requested. Happens on focusing (clicking into) the GraphElement. + * Emitted when displaying the GraphElement over other ones is requested. Happens on focusing + * (clicking into) the GraphElement. */ public val raiseRequest: Signal0 by signal() @@ -53,7 +54,8 @@ public open class GraphElement : Container() { public val deleteRequest: Signal0 by signal() /** - * Emitted when resizing the GraphElement is requested. Happens on dragging the resizer handle (see [resizable]). + * Emitted when resizing the GraphElement is requested. Happens on dragging the resizer handle + * (see [resizable]). */ public val resizeRequest: Signal1 by signal("newMinsize") @@ -68,7 +70,7 @@ public open class GraphElement : Container() { public val positionOffsetChanged: Signal0 by signal() /** - * The offset of the GraphElement, relative to the scroll offset of the [godot.GraphEdit]. + * The offset of the GraphElement, relative to the scroll offset of the [GraphEdit]. */ @CoreTypeLocalCopy public var positionOffset: Vector2 @@ -84,8 +86,8 @@ public open class GraphElement : Container() { /** * If `true`, the user can resize the GraphElement. - * - * **Note:** Dragging the handle will only emit the [resizeRequest] signal, the GraphElement needs to be resized manually. + * **Note:** Dragging the handle will only emit the [signal resize_request] signal, the + * GraphElement needs to be resized manually. */ public var resizable: Boolean get() { @@ -146,7 +148,7 @@ public open class GraphElement : Container() { } /** - * The offset of the GraphElement, relative to the scroll offset of the [godot.GraphEdit]. + * The offset of the GraphElement, relative to the scroll offset of the [GraphEdit]. * * This is a helper function to make dealing with local copies easier. * diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/GraphNode.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/GraphNode.kt index d2509b5c8..2bbc88e9b 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/GraphNode.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/GraphNode.kt @@ -31,15 +31,22 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * A container with connection ports, representing a node in a [godot.GraphEdit]. - * - * [godot.GraphNode] allows to create nodes for a [godot.GraphEdit] graph with customizable content based on its child controls. [godot.GraphNode] is derived from [godot.Container] and it is responsible for placing its children on screen. This works similar to [godot.VBoxContainer]. Children, in turn, provide [godot.GraphNode] with so-called slots, each of which can have a connection port on either side. - * - * Each [godot.GraphNode] slot is defined by its index and can provide the node with up to two ports: one on the left, and one on the right. By convention the left port is also referred to as the **input port** and the right port is referred to as the **output port**. Each port can be enabled and configured individually, using different type and color. The type is an arbitrary value that you can define using your own considerations. The parent [godot.GraphEdit] will receive this information on each connect and disconnect request. - * - * Slots can be configured in the Inspector dock once you add at least one child [godot.Control]. The properties are grouped by each slot's index in the "Slot" section. - * - * **Note:** While GraphNode is set up using slots and slot indices, connections are made between the ports which are enabled. Because of that [godot.GraphEdit] uses the port's index and not the slot's index. You can use [getInputPortSlot] and [getOutputPortSlot] to get the slot index from the port index. + * [GraphNode] allows to create nodes for a [GraphEdit] graph with customizable content based on its + * child controls. [GraphNode] is derived from [Container] and it is responsible for placing its + * children on screen. This works similar to [VBoxContainer]. Children, in turn, provide [GraphNode] + * with so-called slots, each of which can have a connection port on either side. + * Each [GraphNode] slot is defined by its index and can provide the node with up to two ports: one + * on the left, and one on the right. By convention the left port is also referred to as the **input + * port** and the right port is referred to as the **output port**. Each port can be enabled and + * configured individually, using different type and color. The type is an arbitrary value that you can + * define using your own considerations. The parent [GraphEdit] will receive this information on each + * connect and disconnect request. + * Slots can be configured in the Inspector dock once you add at least one child [Control]. The + * properties are grouped by each slot's index in the "Slot" section. + * **Note:** While GraphNode is set up using slots and slot indices, connections are made between + * the ports which are enabled. Because of that [GraphEdit] uses the port's index and not the slot's + * index. You can use [getInputPortSlot] and [getOutputPortSlot] to get the slot index from the port + * index. */ @GodotBaseType public open class GraphNode : GraphElement() { @@ -67,9 +74,6 @@ public open class GraphNode : GraphElement() { return true } - /** - * - */ public open fun _drawPort( slotIndex: Int, position: Vector2i, @@ -79,7 +83,9 @@ public open class GraphNode : GraphElement() { } /** - * Returns the [godot.HBoxContainer] used for the title bar, only containing a [godot.Label] for displaying the title by default. This can be used to add custom controls to the title bar such as option or close buttons. + * Returns the [HBoxContainer] used for the title bar, only containing a [Label] for displaying + * the title by default. This can be used to add custom controls to the title bar such as option or + * close buttons. */ public fun getTitlebarHbox(): HBoxContainer? { TransferContext.writeArguments() @@ -88,19 +94,22 @@ public open class GraphNode : GraphElement() { } /** - * Sets properties of the slot with the given [slotIndex]. - * - * If [enableLeftPort]/[enableRightPort] is `true`, a port will appear and the slot will be able to be connected from this side. - * - * With [typeLeft]/[typeRight] an arbitrary type can be assigned to each port. Two ports can be connected if they share the same type, or if the connection between their types is allowed in the parent [godot.GraphEdit] (see [godot.GraphEdit.addValidConnectionType]). Keep in mind that the [godot.GraphEdit] has the final say in accepting the connection. Type compatibility simply allows the [godot.GraphEdit.connectionRequest] signal to be emitted. - * - * Ports can be further customized using [colorLeft]/[colorRight] and [customIconLeft]/[customIconRight]. The color parameter adds a tint to the icon. The custom icon can be used to override the default port dot. - * - * Additionally, [drawStylebox] can be used to enable or disable drawing of the background stylebox for each slot. See [theme_item slot]. - * + * Sets properties of the slot with the given [param slot_index]. + * If [param enable_left_port]/[param enable_right_port] is `true`, a port will appear and the + * slot will be able to be connected from this side. + * With [param type_left]/[param type_right] an arbitrary type can be assigned to each port. Two + * ports can be connected if they share the same type, or if the connection between their types is + * allowed in the parent [GraphEdit] (see [GraphEdit.addValidConnectionType]). Keep in mind that the + * [GraphEdit] has the final say in accepting the connection. Type compatibility simply allows the + * [signal GraphEdit.connection_request] signal to be emitted. + * Ports can be further customized using [param color_left]/[param color_right] and [param + * custom_icon_left]/[param custom_icon_right]. The color parameter adds a tint to the icon. The + * custom icon can be used to override the default port dot. + * Additionally, [param draw_stylebox] can be used to enable or disable drawing of the background + * stylebox for each slot. See [theme_item slot]. * Individual properties can also be set using one of the `set_slot_*` methods. - * - * **Note:** This method only sets properties of the slot. To create the slot itself, add a [godot.Control]-derived child to the GraphNode. + * **Note:** This method only sets properties of the slot. To create the slot itself, add a + * [Control]-derived child to the GraphNode. */ @JvmOverloads public fun setSlot( @@ -120,7 +129,8 @@ public open class GraphNode : GraphElement() { } /** - * Disables the slot with the given [slotIndex]. This will remove the corresponding input and output port from the GraphNode. + * Disables the slot with the given [param slot_index]. This will remove the corresponding input + * and output port from the GraphNode. */ public fun clearSlot(slotIndex: Int): Unit { TransferContext.writeArguments(LONG to slotIndex.toLong()) @@ -128,7 +138,8 @@ public open class GraphNode : GraphElement() { } /** - * Disables all slots of the GraphNode. This will remove all input/output ports from the GraphNode. + * Disables all slots of the GraphNode. This will remove all input/output ports from the + * GraphNode. */ public fun clearAllSlots(): Unit { TransferContext.writeArguments() @@ -136,7 +147,7 @@ public open class GraphNode : GraphElement() { } /** - * Returns `true` if left (input) side of the slot with the given [slotIndex] is enabled. + * Returns `true` if left (input) side of the slot with the given [param slot_index] is enabled. */ public fun isSlotEnabledLeft(slotIndex: Int): Boolean { TransferContext.writeArguments(LONG to slotIndex.toLong()) @@ -145,7 +156,9 @@ public open class GraphNode : GraphElement() { } /** - * Toggles the left (input) side of the slot with the given [slotIndex]. If [enable] is `true`, a port will appear on the left side and the slot will be able to be connected from this side. + * Toggles the left (input) side of the slot with the given [param slot_index]. If [param enable] + * is `true`, a port will appear on the left side and the slot will be able to be connected from this + * side. */ public fun setSlotEnabledLeft(slotIndex: Int, enable: Boolean): Unit { TransferContext.writeArguments(LONG to slotIndex.toLong(), BOOL to enable) @@ -153,7 +166,8 @@ public open class GraphNode : GraphElement() { } /** - * Sets the left (input) type of the slot with the given [slotIndex] to [type]. If the value is negative, all connections will be disallowed to be created via user inputs. + * Sets the left (input) type of the slot with the given [param slot_index] to [param type]. If + * the value is negative, all connections will be disallowed to be created via user inputs. */ public fun setSlotTypeLeft(slotIndex: Int, type: Int): Unit { TransferContext.writeArguments(LONG to slotIndex.toLong(), LONG to type.toLong()) @@ -161,7 +175,7 @@ public open class GraphNode : GraphElement() { } /** - * Returns the left (input) type of the slot with the given [slotIndex]. + * Returns the left (input) type of the slot with the given [param slot_index]. */ public fun getSlotTypeLeft(slotIndex: Int): Int { TransferContext.writeArguments(LONG to slotIndex.toLong()) @@ -170,7 +184,8 @@ public open class GraphNode : GraphElement() { } /** - * Sets the [godot.core.Color] of the left (input) side of the slot with the given [slotIndex] to [color]. + * Sets the [Color] of the left (input) side of the slot with the given [param slot_index] to + * [param color]. */ public fun setSlotColorLeft(slotIndex: Int, color: Color): Unit { TransferContext.writeArguments(LONG to slotIndex.toLong(), COLOR to color) @@ -178,7 +193,7 @@ public open class GraphNode : GraphElement() { } /** - * Returns the left (input) [godot.core.Color] of the slot with the given [slotIndex]. + * Returns the left (input) [Color] of the slot with the given [param slot_index]. */ public fun getSlotColorLeft(slotIndex: Int): Color { TransferContext.writeArguments(LONG to slotIndex.toLong()) @@ -187,7 +202,7 @@ public open class GraphNode : GraphElement() { } /** - * Returns `true` if right (output) side of the slot with the given [slotIndex] is enabled. + * Returns `true` if right (output) side of the slot with the given [param slot_index] is enabled. */ public fun isSlotEnabledRight(slotIndex: Int): Boolean { TransferContext.writeArguments(LONG to slotIndex.toLong()) @@ -196,7 +211,9 @@ public open class GraphNode : GraphElement() { } /** - * Toggles the right (output) side of the slot with the given [slotIndex]. If [enable] is `true`, a port will appear on the right side and the slot will be able to be connected from this side. + * Toggles the right (output) side of the slot with the given [param slot_index]. If [param + * enable] is `true`, a port will appear on the right side and the slot will be able to be connected + * from this side. */ public fun setSlotEnabledRight(slotIndex: Int, enable: Boolean): Unit { TransferContext.writeArguments(LONG to slotIndex.toLong(), BOOL to enable) @@ -204,7 +221,8 @@ public open class GraphNode : GraphElement() { } /** - * Sets the right (output) type of the slot with the given [slotIndex] to [type]. If the value is negative, all connections will be disallowed to be created via user inputs. + * Sets the right (output) type of the slot with the given [param slot_index] to [param type]. If + * the value is negative, all connections will be disallowed to be created via user inputs. */ public fun setSlotTypeRight(slotIndex: Int, type: Int): Unit { TransferContext.writeArguments(LONG to slotIndex.toLong(), LONG to type.toLong()) @@ -212,7 +230,7 @@ public open class GraphNode : GraphElement() { } /** - * Returns the right (output) type of the slot with the given [slotIndex]. + * Returns the right (output) type of the slot with the given [param slot_index]. */ public fun getSlotTypeRight(slotIndex: Int): Int { TransferContext.writeArguments(LONG to slotIndex.toLong()) @@ -221,7 +239,8 @@ public open class GraphNode : GraphElement() { } /** - * Sets the [godot.core.Color] of the right (output) side of the slot with the given [slotIndex] to [color]. + * Sets the [Color] of the right (output) side of the slot with the given [param slot_index] to + * [param color]. */ public fun setSlotColorRight(slotIndex: Int, color: Color): Unit { TransferContext.writeArguments(LONG to slotIndex.toLong(), COLOR to color) @@ -229,7 +248,7 @@ public open class GraphNode : GraphElement() { } /** - * Returns the right (output) [godot.core.Color] of the slot with the given [slotIndex]. + * Returns the right (output) [Color] of the slot with the given [param slot_index]. */ public fun getSlotColorRight(slotIndex: Int): Color { TransferContext.writeArguments(LONG to slotIndex.toLong()) @@ -238,7 +257,8 @@ public open class GraphNode : GraphElement() { } /** - * Returns true if the background [godot.StyleBox] of the slot with the given [slotIndex] is drawn. + * Returns true if the background [StyleBox] of the slot with the given [param slot_index] is + * drawn. */ public fun isSlotDrawStylebox(slotIndex: Int): Boolean { TransferContext.writeArguments(LONG to slotIndex.toLong()) @@ -247,7 +267,7 @@ public open class GraphNode : GraphElement() { } /** - * Toggles the background [godot.StyleBox] of the slot with the given [slotIndex]. + * Toggles the background [StyleBox] of the slot with the given [param slot_index]. */ public fun setSlotDrawStylebox(slotIndex: Int, enable: Boolean): Unit { TransferContext.writeArguments(LONG to slotIndex.toLong(), BOOL to enable) @@ -264,7 +284,7 @@ public open class GraphNode : GraphElement() { } /** - * Returns the position of the input port with the given [portIdx]. + * Returns the position of the input port with the given [param port_idx]. */ public fun getInputPortPosition(portIdx: Int): Vector2 { TransferContext.writeArguments(LONG to portIdx.toLong()) @@ -273,7 +293,7 @@ public open class GraphNode : GraphElement() { } /** - * Returns the type of the input port with the given [portIdx]. + * Returns the type of the input port with the given [param port_idx]. */ public fun getInputPortType(portIdx: Int): Int { TransferContext.writeArguments(LONG to portIdx.toLong()) @@ -282,7 +302,7 @@ public open class GraphNode : GraphElement() { } /** - * Returns the [godot.core.Color] of the input port with the given [portIdx]. + * Returns the [Color] of the input port with the given [param port_idx]. */ public fun getInputPortColor(portIdx: Int): Color { TransferContext.writeArguments(LONG to portIdx.toLong()) @@ -291,7 +311,7 @@ public open class GraphNode : GraphElement() { } /** - * Returns the corresponding slot index of the input port with the given [portIdx]. + * Returns the corresponding slot index of the input port with the given [param port_idx]. */ public fun getInputPortSlot(portIdx: Int): Int { TransferContext.writeArguments(LONG to portIdx.toLong()) @@ -309,7 +329,7 @@ public open class GraphNode : GraphElement() { } /** - * Returns the position of the output port with the given [portIdx]. + * Returns the position of the output port with the given [param port_idx]. */ public fun getOutputPortPosition(portIdx: Int): Vector2 { TransferContext.writeArguments(LONG to portIdx.toLong()) @@ -318,7 +338,7 @@ public open class GraphNode : GraphElement() { } /** - * Returns the type of the output port with the given [portIdx]. + * Returns the type of the output port with the given [param port_idx]. */ public fun getOutputPortType(portIdx: Int): Int { TransferContext.writeArguments(LONG to portIdx.toLong()) @@ -327,7 +347,7 @@ public open class GraphNode : GraphElement() { } /** - * Returns the [godot.core.Color] of the output port with the given [portIdx]. + * Returns the [Color] of the output port with the given [param port_idx]. */ public fun getOutputPortColor(portIdx: Int): Color { TransferContext.writeArguments(LONG to portIdx.toLong()) @@ -336,7 +356,7 @@ public open class GraphNode : GraphElement() { } /** - * Returns the corresponding slot index of the output port with the given [portIdx]. + * Returns the corresponding slot index of the output port with the given [param port_idx]. */ public fun getOutputPortSlot(portIdx: Int): Int { TransferContext.writeArguments(LONG to portIdx.toLong()) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/GridContainer.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/GridContainer.kt index 23f0f6a69..941df5273 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/GridContainer.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/GridContainer.kt @@ -18,19 +18,17 @@ import kotlin.Long import kotlin.Suppress /** - * A container that arranges its child controls in a grid layout. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/677](https://godotengine.org/asset-library/asset/677) - * - * [godot.GridContainer] arranges its child controls in a grid layout. The number of columns is specified by the [columns] property, whereas the number of rows depends on how many are needed for the child controls. The number of rows and columns is preserved for every size of the container. - * - * **Note:** [godot.GridContainer] only works with child nodes inheriting from [godot.Control]. It won't rearrange child nodes inheriting from [godot.Node2D]. + * [GridContainer] arranges its child controls in a grid layout. The number of columns is specified + * by the [columns] property, whereas the number of rows depends on how many are needed for the child + * controls. The number of rows and columns is preserved for every size of the container. + * **Note:** [GridContainer] only works with child nodes inheriting from [Control]. It won't + * rearrange child nodes inheriting from [Node2D]. */ @GodotBaseType public open class GridContainer : Container() { /** - * The number of columns in the [godot.GridContainer]. If modified, [godot.GridContainer] reorders its Control-derived children to accommodate the new layout. + * The number of columns in the [GridContainer]. If modified, [GridContainer] reorders its + * Control-derived children to accommodate the new layout. */ public var columns: Int get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/GridMap.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/GridMap.kt index 19d6969e2..e4592873a 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/GridMap.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/GridMap.kt @@ -40,12 +40,34 @@ import kotlin.Suppress import kotlin.Unit import kotlin.jvm.JvmOverloads +/** + * GridMap lets you place meshes on a grid interactively. It works both from the editor and from + * scripts, which can help you create in-game level editors. + * GridMaps use a [MeshLibrary] which contains a list of tiles. Each tile is a mesh with materials + * plus optional collision and navigation shapes. + * A GridMap contains a collection of cells. Each grid cell refers to a tile in the [MeshLibrary]. + * All cells in the map have the same dimensions. + * Internally, a GridMap is split into a sparse collection of octants for efficient rendering and + * physics processing. Every octant has the same dimensions and can contain several cells. + * **Note:** GridMap doesn't extend [VisualInstance3D] and therefore can't be hidden or cull masked + * based on [VisualInstance3D.layers]. If you make a light not affect the first layer, the whole + * GridMap won't be lit by the light in question. + */ @GodotBaseType public open class GridMap : Node3D() { + /** + * Emitted when [cellSize] changes. + */ public val cellSizeChanged: Signal1 by signal("cellSize") + /** + * Emitted when the [MeshLibrary] of this GridMap changes. + */ public val changed: Signal0 by signal() + /** + * The assigned [MeshLibrary]. + */ public var meshLibrary: MeshLibrary? get() { TransferContext.writeArguments() @@ -57,6 +79,9 @@ public open class GridMap : Node3D() { TransferContext.callMethod(rawPtr, MethodBindings.setMeshLibraryPtr, NIL) } + /** + * Overrides the default friction and bounce physics properties for the whole [GridMap]. + */ public var physicsMaterial: PhysicsMaterial? get() { TransferContext.writeArguments() @@ -68,6 +93,10 @@ public open class GridMap : Node3D() { TransferContext.callMethod(rawPtr, MethodBindings.setPhysicsMaterialPtr, NIL) } + /** + * The dimensions of the grid's cells. + * This does not affect the size of the meshes. See [cellScale]. + */ @CoreTypeLocalCopy public var cellSize: Vector3 get() { @@ -80,6 +109,9 @@ public open class GridMap : Node3D() { TransferContext.callMethod(rawPtr, MethodBindings.setCellSizePtr, NIL) } + /** + * The size of each octant measured in number of cells. This applies to all three axis. + */ public var cellOctantSize: Int get() { TransferContext.writeArguments() @@ -91,6 +123,9 @@ public open class GridMap : Node3D() { TransferContext.callMethod(rawPtr, MethodBindings.setOctantSizePtr, NIL) } + /** + * If `true`, grid items are centered on the X axis. + */ public var cellCenterX: Boolean get() { TransferContext.writeArguments() @@ -102,6 +137,9 @@ public open class GridMap : Node3D() { TransferContext.callMethod(rawPtr, MethodBindings.setCenterXPtr, NIL) } + /** + * If `true`, grid items are centered on the Y axis. + */ public var cellCenterY: Boolean get() { TransferContext.writeArguments() @@ -113,6 +151,9 @@ public open class GridMap : Node3D() { TransferContext.callMethod(rawPtr, MethodBindings.setCenterYPtr, NIL) } + /** + * If `true`, grid items are centered on the Z axis. + */ public var cellCenterZ: Boolean get() { TransferContext.writeArguments() @@ -124,6 +165,11 @@ public open class GridMap : Node3D() { TransferContext.callMethod(rawPtr, MethodBindings.setCenterZPtr, NIL) } + /** + * The scale of the cell items. + * This does not affect the size of the grid cells themselves, only the items in them. This can be + * used to make cell items overlap their neighbors. + */ public var cellScale: Float get() { TransferContext.writeArguments() @@ -135,6 +181,11 @@ public open class GridMap : Node3D() { TransferContext.callMethod(rawPtr, MethodBindings.setCellScalePtr, NIL) } + /** + * The physics layers this GridMap is in. + * GridMaps act as static bodies, meaning they aren't affected by gravity or other forces. They + * only affect other physics bodies that collide with them. + */ public var collisionLayer: Long get() { TransferContext.writeArguments() @@ -146,6 +197,11 @@ public open class GridMap : Node3D() { TransferContext.callMethod(rawPtr, MethodBindings.setCollisionLayerPtr, NIL) } + /** + * The physics layers this GridMap detects collisions in. See + * [url=$DOCS_URL/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision + * layers and masks[/url] in the documentation for more information. + */ public var collisionMask: Long get() { TransferContext.writeArguments() @@ -157,6 +213,11 @@ public open class GridMap : Node3D() { TransferContext.callMethod(rawPtr, MethodBindings.setCollisionMaskPtr, NIL) } + /** + * The priority used to solve colliding when occurring penetration. The higher the priority is, + * the lower the penetration into the object will be. This can for example be used to prevent the + * player from breaking through the boundaries of a level. + */ public var collisionPriority: Float get() { TransferContext.writeArguments() @@ -168,6 +229,11 @@ public open class GridMap : Node3D() { TransferContext.callMethod(rawPtr, MethodBindings.setCollisionPriorityPtr, NIL) } + /** + * If `true`, this GridMap creates a navigation region for each cell that uses a [meshLibrary] + * item with a navigation mesh. The created navigation region will use the navigation layers bitmask + * assigned to the [MeshLibrary]'s item. + */ public var bakeNavigation: Boolean get() { TransferContext.writeArguments() @@ -185,6 +251,9 @@ public open class GridMap : Node3D() { } /** + * The dimensions of the grid's cells. + * This does not affect the size of the meshes. See [cellScale]. + * * This is a helper function to make dealing with local copies easier. * * For more information, see our @@ -206,39 +275,72 @@ public open class GridMap : Node3D() { } + /** + * Based on [param value], enables or disables the specified layer in the [collisionMask], given a + * [param layer_number] between 1 and 32. + */ public fun setCollisionMaskValue(layerNumber: Int, `value`: Boolean): Unit { TransferContext.writeArguments(LONG to layerNumber.toLong(), BOOL to value) TransferContext.callMethod(rawPtr, MethodBindings.setCollisionMaskValuePtr, NIL) } + /** + * Returns whether or not the specified layer of the [collisionMask] is enabled, given a [param + * layer_number] between 1 and 32. + */ public fun getCollisionMaskValue(layerNumber: Int): Boolean { TransferContext.writeArguments(LONG to layerNumber.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.getCollisionMaskValuePtr, BOOL) return (TransferContext.readReturnValue(BOOL, false) as Boolean) } + /** + * Based on [param value], enables or disables the specified layer in the [collisionLayer], given + * a [param layer_number] between 1 and 32. + */ public fun setCollisionLayerValue(layerNumber: Int, `value`: Boolean): Unit { TransferContext.writeArguments(LONG to layerNumber.toLong(), BOOL to value) TransferContext.callMethod(rawPtr, MethodBindings.setCollisionLayerValuePtr, NIL) } + /** + * Returns whether or not the specified layer of the [collisionLayer] is enabled, given a [param + * layer_number] between 1 and 32. + */ public fun getCollisionLayerValue(layerNumber: Int): Boolean { TransferContext.writeArguments(LONG to layerNumber.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.getCollisionLayerValuePtr, BOOL) return (TransferContext.readReturnValue(BOOL, false) as Boolean) } + /** + * Sets the [RID] of the navigation map this GridMap node should use for its cell baked navigation + * meshes. + */ public fun setNavigationMap(navigationMap: RID): Unit { TransferContext.writeArguments(_RID to navigationMap) TransferContext.callMethod(rawPtr, MethodBindings.setNavigationMapPtr, NIL) } + /** + * Returns the [RID] of the navigation map this GridMap node uses for its cell baked navigation + * meshes. + * This function returns always the map set on the GridMap node and not the map on the + * NavigationServer. If the map is changed directly with the NavigationServer API the GridMap node + * will not be aware of the map change. + */ public fun getNavigationMap(): RID { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getNavigationMapPtr, _RID) return (TransferContext.readReturnValue(_RID, false) as RID) } + /** + * Sets the mesh index for the cell referenced by its grid coordinates. + * A negative item index such as [constant INVALID_CELL_ITEM] will clear the cell. + * Optionally, the item's orientation can be passed. For valid orientation values, see + * [getOrthogonalIndexFromBasis]. + */ @JvmOverloads public fun setCellItem( position: Vector3i, @@ -249,93 +351,152 @@ public open class GridMap : Node3D() { TransferContext.callMethod(rawPtr, MethodBindings.setCellItemPtr, NIL) } + /** + * The [MeshLibrary] item index located at the given grid coordinates. If the cell is empty, + * [constant INVALID_CELL_ITEM] will be returned. + */ public fun getCellItem(position: Vector3i): Int { TransferContext.writeArguments(VECTOR3I to position) TransferContext.callMethod(rawPtr, MethodBindings.getCellItemPtr, LONG) return (TransferContext.readReturnValue(LONG, false) as Long).toInt() } + /** + * The orientation of the cell at the given grid coordinates. `-1` is returned if the cell is + * empty. + */ public fun getCellItemOrientation(position: Vector3i): Int { TransferContext.writeArguments(VECTOR3I to position) TransferContext.callMethod(rawPtr, MethodBindings.getCellItemOrientationPtr, LONG) return (TransferContext.readReturnValue(LONG, false) as Long).toInt() } + /** + * Returns the basis that gives the specified cell its orientation. + */ public fun getCellItemBasis(position: Vector3i): Basis { TransferContext.writeArguments(VECTOR3I to position) TransferContext.callMethod(rawPtr, MethodBindings.getCellItemBasisPtr, BASIS) return (TransferContext.readReturnValue(BASIS, false) as Basis) } + /** + * Returns one of 24 possible rotations that lie along the vectors (x,y,z) with each component + * being either -1, 0, or 1. For further details, refer to the Godot source code. + */ public fun getBasisWithOrthogonalIndex(index: Int): Basis { TransferContext.writeArguments(LONG to index.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.getBasisWithOrthogonalIndexPtr, BASIS) return (TransferContext.readReturnValue(BASIS, false) as Basis) } + /** + * This function considers a discretization of rotations into 24 points on unit sphere, lying + * along the vectors (x,y,z) with each component being either -1, 0, or 1, and returns the index (in + * the range from 0 to 23) of the point best representing the orientation of the object. For further + * details, refer to the Godot source code. + */ public fun getOrthogonalIndexFromBasis(basis: Basis): Int { TransferContext.writeArguments(BASIS to basis) TransferContext.callMethod(rawPtr, MethodBindings.getOrthogonalIndexFromBasisPtr, LONG) return (TransferContext.readReturnValue(LONG, false) as Long).toInt() } + /** + * Returns the map coordinates of the cell containing the given [param local_position]. If [param + * local_position] is in global coordinates, consider using [Node3D.toLocal] before passing it to + * this method. See also [mapToLocal]. + */ public fun localToMap(localPosition: Vector3): Vector3i { TransferContext.writeArguments(VECTOR3 to localPosition) TransferContext.callMethod(rawPtr, MethodBindings.localToMapPtr, VECTOR3I) return (TransferContext.readReturnValue(VECTOR3I, false) as Vector3i) } + /** + * Returns the position of a grid cell in the GridMap's local coordinate space. To convert the + * returned value into global coordinates, use [Node3D.toGlobal]. See also [mapToLocal]. + */ public fun mapToLocal(mapPosition: Vector3i): Vector3 { TransferContext.writeArguments(VECTOR3I to mapPosition) TransferContext.callMethod(rawPtr, MethodBindings.mapToLocalPtr, VECTOR3) return (TransferContext.readReturnValue(VECTOR3, false) as Vector3) } + /** + * *Obsoleted.* Use [signal Resource.changed] instead. + */ public fun resourceChanged(resource: Resource): Unit { TransferContext.writeArguments(OBJECT to resource) TransferContext.callMethod(rawPtr, MethodBindings.resourceChangedPtr, NIL) } + /** + * Clear all cells. + */ public fun clear(): Unit { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.clearPtr, NIL) } + /** + * Returns an array of [Vector3] with the non-empty cell coordinates in the grid map. + */ public fun getUsedCells(): VariantArray { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getUsedCellsPtr, ARRAY) return (TransferContext.readReturnValue(ARRAY, false) as VariantArray) } + /** + * Returns an array of all cells with the given item index specified in [param item]. + */ public fun getUsedCellsByItem(item: Int): VariantArray { TransferContext.writeArguments(LONG to item.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.getUsedCellsByItemPtr, ARRAY) return (TransferContext.readReturnValue(ARRAY, false) as VariantArray) } + /** + * Returns an array of [Transform3D] and [Mesh] references corresponding to the non-empty cells in + * the grid. The transforms are specified in local space. + */ public fun getMeshes(): VariantArray { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getMeshesPtr, ARRAY) return (TransferContext.readReturnValue(ARRAY, false) as VariantArray) } + /** + * Returns an array of [ArrayMesh]es and [Transform3D] references of all bake meshes that exist + * within the current GridMap. + */ public fun getBakeMeshes(): VariantArray { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getBakeMeshesPtr, ARRAY) return (TransferContext.readReturnValue(ARRAY, false) as VariantArray) } + /** + * Returns [RID] of a baked mesh with the given [param idx]. + */ public fun getBakeMeshInstance(idx: Int): RID { TransferContext.writeArguments(LONG to idx.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.getBakeMeshInstancePtr, _RID) return (TransferContext.readReturnValue(_RID, false) as RID) } + /** + * Clears all baked meshes. See [makeBakedMeshes]. + */ public fun clearBakedMeshes(): Unit { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.clearBakedMeshesPtr, NIL) } + /** + * Bakes lightmap data for all meshes in the assigned [MeshLibrary]. + */ @JvmOverloads public fun makeBakedMeshes(genLightmapUv: Boolean = false, lightmapUvTexelSize: Float = 0.1f): Unit { @@ -344,6 +505,10 @@ public open class GridMap : Node3D() { } public companion object { + /** + * Invalid cell item that can be used in [setCellItem] to clear cells (or represent an empty + * cell in [getCellItem]). + */ public final const val INVALID_CELL_ITEM: Long = -1 } diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/GrooveJoint2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/GrooveJoint2D.kt index ca5c9db75..9c0c8bd5c 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/GrooveJoint2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/GrooveJoint2D.kt @@ -19,14 +19,15 @@ import kotlin.Int import kotlin.Suppress /** - * A physics joint that restricts the movement of two 2D physics bodies to a fixed axis. - * - * A physics joint that restricts the movement of two 2D physics bodies to a fixed axis. For example, a [godot.StaticBody2D] representing a piston base can be attached to a [godot.RigidBody2D] representing the piston head, moving up and down. + * A physics joint that restricts the movement of two 2D physics bodies to a fixed axis. For + * example, a [StaticBody2D] representing a piston base can be attached to a [RigidBody2D] representing + * the piston head, moving up and down. */ @GodotBaseType public open class GrooveJoint2D : Joint2D() { /** - * The groove's length. The groove is from the joint's origin towards [length] along the joint's local Y axis. + * The groove's length. The groove is from the joint's origin towards [length] along the joint's + * local Y axis. */ public var length: Float get() { @@ -40,7 +41,8 @@ public open class GrooveJoint2D : Joint2D() { } /** - * The body B's initial anchor position defined by the joint's origin and a local offset [initialOffset] along the joint's Y axis (along the groove). + * The body B's initial anchor position defined by the joint's origin and a local offset + * [initialOffset] along the joint's Y axis (along the groove). */ public var initialOffset: Float get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/HBoxContainer.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/HBoxContainer.kt index 2c409ca50..5f083f777 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/HBoxContainer.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/HBoxContainer.kt @@ -12,12 +12,8 @@ import kotlin.Int import kotlin.Suppress /** - * A container that arranges its child controls horizontally. - * - * Tutorials: - * [$DOCS_URL/tutorials/ui/gui_containers.html]($DOCS_URL/tutorials/ui/gui_containers.html) - * - * A variant of [godot.BoxContainer] that can only arrange its child controls horizontally. Child controls are rearranged automatically when their minimum size changes. + * A variant of [BoxContainer] that can only arrange its child controls horizontally. Child controls + * are rearranged automatically when their minimum size changes. */ @GodotBaseType public open class HBoxContainer : BoxContainer() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/HFlowContainer.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/HFlowContainer.kt index 224f5e82e..6b0af66c5 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/HFlowContainer.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/HFlowContainer.kt @@ -12,12 +12,9 @@ import kotlin.Int import kotlin.Suppress /** - * A container that arranges its child controls horizontally and wraps them around at the borders. - * - * Tutorials: - * [$DOCS_URL/tutorials/ui/gui_containers.html]($DOCS_URL/tutorials/ui/gui_containers.html) - * - * A variant of [godot.FlowContainer] that can only arrange its child controls horizontally, wrapping them around at the borders. This is similar to how text in a book wraps around when no more words can fit on a line. + * A variant of [FlowContainer] that can only arrange its child controls horizontally, wrapping them + * around at the borders. This is similar to how text in a book wraps around when no more words can fit + * on a line. */ @GodotBaseType public open class HFlowContainer : FlowContainer() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/HMACContext.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/HMACContext.kt index 1f8c99058..fb33fe530 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/HMACContext.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/HMACContext.kt @@ -20,97 +20,53 @@ import kotlin.Long import kotlin.Suppress /** - * Used to create an HMAC for a message using a key. - * - * The HMACContext class is useful for advanced HMAC use cases, such as streaming the message as it supports creating the message over time rather than providing it all at once. - * - * [codeblocks] - * - * [gdscript] + * The HMACContext class is useful for advanced HMAC use cases, such as streaming the message as it + * supports creating the message over time rather than providing it all at once. * + * gdscript: + * ```gdscript * extends Node - * * var ctx = HMACContext.new() * - * - * * func _ready(): - * * var key = "supersecret".to_utf8_buffer() - * * var err = ctx.start(HashingContext.HASH_SHA256, key) - * * assert(err == OK) - * * var msg1 = "this is ".to_utf8_buffer() - * * var msg2 = "super duper secret".to_utf8_buffer() - * * err = ctx.update(msg1) - * * assert(err == OK) - * * err = ctx.update(msg2) - * * assert(err == OK) - * * var hmac = ctx.finish() - * * print(hmac.hex_encode()) * - * - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * using Godot; - * * using System.Diagnostics; * - * - * * public partial class MyNode : Node - * * { - * * private HmacContext _ctx = new HmacContext(); * - * - * * public override void _Ready() - * * { - * * byte[] key = "supersecret".ToUtf8Buffer(); - * * Error err = _ctx.Start(HashingContext.HashType.Sha256, key); - * * Debug.Assert(err == Error.Ok); - * * byte[] msg1 = "this is ".ToUtf8Buffer(); - * * byte[] msg2 = "super duper secret".ToUtf8Buffer(); - * * err = _ctx.Update(msg1); - * * Debug.Assert(err == Error.Ok); - * * err = _ctx.Update(msg2); - * * Debug.Assert(err == Error.Ok); - * * byte[] hmac = _ctx.Finish(); - * * GD.Print(hmac.HexEncode()); - * * } - * * } - * - * [/csharp] - * - * [/codeblocks] + * ``` */ @GodotBaseType public open class HMACContext : RefCounted() { @@ -120,7 +76,8 @@ public open class HMACContext : RefCounted() { } /** - * Initializes the HMACContext. This method cannot be called again on the same HMACContext until [finish] has been called. + * Initializes the HMACContext. This method cannot be called again on the same HMACContext until + * [finish] has been called. */ public fun start(hashType: HashingContext.HashType, key: PackedByteArray): GodotError { TransferContext.writeArguments(LONG to hashType.id, PACKED_BYTE_ARRAY to key) @@ -129,7 +86,8 @@ public open class HMACContext : RefCounted() { } /** - * Updates the message to be HMACed. This can be called multiple times before [finish] is called to append [data] to the message, but cannot be called until [start] has been called. + * Updates the message to be HMACed. This can be called multiple times before [finish] is called + * to append [param data] to the message, but cannot be called until [start] has been called. */ public fun update(`data`: PackedByteArray): GodotError { TransferContext.writeArguments(PACKED_BYTE_ARRAY to data) @@ -138,7 +96,7 @@ public open class HMACContext : RefCounted() { } /** - * Returns the resulting HMAC. If the HMAC failed, an empty [godot.PackedByteArray] is returned. + * Returns the resulting HMAC. If the HMAC failed, an empty [PackedByteArray] is returned. */ public fun finish(): PackedByteArray { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/HScrollBar.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/HScrollBar.kt index fc3ebcee4..c54e8b7fd 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/HScrollBar.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/HScrollBar.kt @@ -12,9 +12,8 @@ import kotlin.Int import kotlin.Suppress /** - * A horizontal scrollbar that goes from left (min) to right (max). - * - * A horizontal scrollbar, typically used to navigate through content that extends beyond the visible width of a control. It is a [godot.Range]-based control and goes from left (min) to right (max). + * A horizontal scrollbar, typically used to navigate through content that extends beyond the + * visible width of a control. It is a [Range]-based control and goes from left (min) to right (max). */ @GodotBaseType public open class HScrollBar : ScrollBar() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/HSeparator.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/HSeparator.kt index 2d21d810c..7ce445254 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/HSeparator.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/HSeparator.kt @@ -12,9 +12,8 @@ import kotlin.Int import kotlin.Suppress /** - * A horizontal line used for separating other controls. - * - * A horizontal separator used for separating other controls that are arranged **vertically**. [godot.HSeparator] is purely visual and normally drawn as a [godot.StyleBoxLine]. + * A horizontal separator used for separating other controls that are arranged **vertically**. + * [HSeparator] is purely visual and normally drawn as a [StyleBoxLine]. */ @GodotBaseType public open class HSeparator : Separator() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/HSlider.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/HSlider.kt index 06be51653..bad474e63 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/HSlider.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/HSlider.kt @@ -12,9 +12,8 @@ import kotlin.Int import kotlin.Suppress /** - * A horizontal slider that goes from left (min) to right (max). - * - * A horizontal slider, used to adjust a value by moving a grabber along a horizontal axis. It is a [godot.Range]-based control and goes from left (min) to right (max). + * A horizontal slider, used to adjust a value by moving a grabber along a horizontal axis. It is a + * [Range]-based control and goes from left (min) to right (max). */ @GodotBaseType public open class HSlider : Slider() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/HSplitContainer.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/HSplitContainer.kt index b341875ad..a4c5c4b33 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/HSplitContainer.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/HSplitContainer.kt @@ -12,12 +12,9 @@ import kotlin.Int import kotlin.Suppress /** - * A container that splits two child controls horizontally and provides a grabber for adjusting the split ratio. - * - * Tutorials: - * [$DOCS_URL/tutorials/ui/gui_containers.html]($DOCS_URL/tutorials/ui/gui_containers.html) - * - * A container that accepts only two child controls, then arranges them horizontally and creates a divisor between them. The divisor can be dragged around to change the size relation between the child controls. + * A container that accepts only two child controls, then arranges them horizontally and creates a + * divisor between them. The divisor can be dragged around to change the size relation between the + * child controls. */ @GodotBaseType public open class HSplitContainer : SplitContainer() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/HashingContext.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/HashingContext.kt index 726da3670..6af4b2ce9 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/HashingContext.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/HashingContext.kt @@ -20,107 +20,59 @@ import kotlin.Long import kotlin.Suppress /** - * Provides functionality for computing cryptographic hashes chunk by chunk. - * - * The HashingContext class provides an interface for computing cryptographic hashes over multiple iterations. Useful for computing hashes of big files (so you don't have to load them all in memory), network streams, and data streams in general (so you don't have to hold buffers). - * + * The HashingContext class provides an interface for computing cryptographic hashes over multiple + * iterations. Useful for computing hashes of big files (so you don't have to load them all in memory), + * network streams, and data streams in general (so you don't have to hold buffers). * The [enum HashType] enum shows the supported hashing algorithms. * - * [codeblocks] - * - * [gdscript] - * + * gdscript: + * ```gdscript * const CHUNK_SIZE = 1024 * - * - * * func hash_file(path): - * * # Check that file exists. - * * if not FileAccess.file_exists(path): - * * return - * * # Start a SHA-256 context. - * * var ctx = HashingContext.new() - * * ctx.start(HashingContext.HASH_SHA256) - * * # Open the file to hash. - * * var file = FileAccess.open(path, FileAccess.READ) - * * # Update the context after reading each chunk. - * * while not file.eof_reached(): - * * ctx.update(file.get_buffer(CHUNK_SIZE)) - * * # Get the computed hash. - * * var res = ctx.finish() - * * # Print the result as hex string and array. - * * printt(res.hex_encode(), Array(res)) - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * public const int ChunkSize = 1024; * - * - * * public void HashFile(string path) - * * { - * * // Check that file exists. - * * if (!FileAccess.FileExists(path)) - * * { - * * return; - * * } - * * // Start a SHA-256 context. - * * var ctx = new HashingContext(); - * * ctx.Start(HashingContext.HashType.Sha256); - * * // Open the file to hash. - * * using var file = FileAccess.Open(path, FileAccess.ModeFlags.Read); - * * // Update the context after reading each chunk. - * * while (!file.EofReached()) - * * { - * * ctx.Update(file.GetBuffer(ChunkSize)); - * * } - * * // Get the computed hash. - * * byte[] res = ctx.Finish(); - * * // Print the result as hex string and array. - * * GD.PrintT(res.HexEncode(), (Variant)res); - * * } - * - * [/csharp] - * - * [/codeblocks] + * ``` */ @GodotBaseType public open class HashingContext : RefCounted() { @@ -130,7 +82,8 @@ public open class HashingContext : RefCounted() { } /** - * Starts a new hash computation of the given [type] (e.g. [godot.HASH_SHA256] to start computation of a SHA-256). + * Starts a new hash computation of the given [param type] (e.g. [constant HASH_SHA256] to start + * computation of a SHA-256). */ public fun start(type: HashType): GodotError { TransferContext.writeArguments(LONG to type.id) @@ -139,7 +92,7 @@ public open class HashingContext : RefCounted() { } /** - * Updates the computation with the given [chunk] of data. + * Updates the computation with the given [param chunk] of data. */ public fun update(chunk: PackedByteArray): GodotError { TransferContext.writeArguments(PACKED_BYTE_ARRAY to chunk) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/HeightMapShape3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/HeightMapShape3D.kt index 72b933084..c51455eb0 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/HeightMapShape3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/HeightMapShape3D.kt @@ -20,11 +20,12 @@ import kotlin.Long import kotlin.Suppress /** - * A 3D height map shape used for physics collision. - * - * A 3D heightmap shape, intended for use in physics. Usually used to provide a shape for a [godot.CollisionShape3D]. This is useful for terrain, but it is limited as overhangs (such as caves) cannot be stored. Holes in a [godot.HeightMapShape3D] are created by assigning very low values to points in the desired area. - * - * **Performance:** [godot.HeightMapShape3D] is faster to check collisions against than [godot.ConcavePolygonShape3D], but it is significantly slower than primitive shapes like [godot.BoxShape3D]. + * A 3D heightmap shape, intended for use in physics. Usually used to provide a shape for a + * [CollisionShape3D]. This is useful for terrain, but it is limited as overhangs (such as caves) + * cannot be stored. Holes in a [HeightMapShape3D] are created by assigning very low values to points + * in the desired area. + * **Performance:** [HeightMapShape3D] is faster to check collisions against than + * [ConcavePolygonShape3D], but it is significantly slower than primitive shapes like [BoxShape3D]. */ @GodotBaseType public open class HeightMapShape3D : Shape3D() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/HingeJoint3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/HingeJoint3D.kt index e2b27afd3..615681090 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/HingeJoint3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/HingeJoint3D.kt @@ -23,9 +23,9 @@ import kotlin.Suppress import kotlin.Unit /** - * A physics joint that restricts the rotation of a 3D physics body around an axis relative to another physics body. - * - * A physics joint that restricts the rotation of a 3D physics body around an axis relative to another physics body. For example, Body A can be a [godot.StaticBody3D] representing a door hinge that a [godot.RigidBody3D] rotates around. + * A physics joint that restricts the rotation of a 3D physics body around an axis relative to + * another physics body. For example, Body A can be a [StaticBody3D] representing a door hinge that a + * [RigidBody3D] rotates around. */ @GodotBaseType public open class HingeJoint3D : Joint3D() { @@ -72,7 +72,8 @@ public open class HingeJoint3D : Joint3D() { id: Long, ) { /** - * The speed with which the two bodies get pulled together when they move in different directions. + * The speed with which the two bodies get pulled together when they move in different + * directions. */ PARAM_BIAS(0), /** @@ -87,9 +88,6 @@ public open class HingeJoint3D : Joint3D() { * The speed with which the rotation across the axis perpendicular to the hinge gets corrected. */ PARAM_LIMIT_BIAS(3), - /** - * - */ PARAM_LIMIT_SOFTNESS(4), /** * The lower this value, the more the rotation gets slowed down. @@ -123,7 +121,8 @@ public open class HingeJoint3D : Joint3D() { id: Long, ) { /** - * If `true`, the hinges maximum and minimum rotation, defined by [angularLimit/lower] and [angularLimit/upper] has effects. + * If `true`, the hinges maximum and minimum rotation, defined by [angularLimit/lower] and + * [angularLimit/upper] has effects. */ FLAG_USE_LIMIT(0), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/HorizontalAlignment.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/HorizontalAlignment.kt index 3a0b1e471..d9e77be27 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/HorizontalAlignment.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/HorizontalAlignment.kt @@ -6,9 +6,21 @@ import kotlin.Long public enum class HorizontalAlignment( id: Long, ) { + /** + * Horizontal left alignment, usually for text-derived classes. + */ HORIZONTAL_ALIGNMENT_LEFT(0), + /** + * Horizontal center alignment, usually for text-derived classes. + */ HORIZONTAL_ALIGNMENT_CENTER(1), + /** + * Horizontal right alignment, usually for text-derived classes. + */ HORIZONTAL_ALIGNMENT_RIGHT(2), + /** + * Expand row to fit width, usually for text-derived classes. + */ HORIZONTAL_ALIGNMENT_FILL(3), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/IP.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/IP.kt index 2ebd6c049..fcf4062ba 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/IP.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/IP.kt @@ -28,19 +28,20 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * Internet protocol (IP) support functions such as DNS resolution. - * - * IP contains support functions for the Internet Protocol (IP). TCP/IP support is in different classes (see [godot.StreamPeerTCP] and [godot.TCPServer]). IP provides DNS hostname resolution support, both blocking and threaded. + * IP contains support functions for the Internet Protocol (IP). TCP/IP support is in different + * classes (see [StreamPeerTCP] and [TCPServer]). IP provides DNS hostname resolution support, both + * blocking and threaded. */ @GodotBaseType public object IP : Object() { /** - * Maximum number of concurrent DNS resolver queries allowed, [RESOLVER_INVALID_ID] is returned if exceeded. + * Maximum number of concurrent DNS resolver queries allowed, [constant RESOLVER_INVALID_ID] is + * returned if exceeded. */ public final const val RESOLVER_MAX_QUERIES: Long = 256 /** - * Invalid ID constant. Returned if [RESOLVER_MAX_QUERIES] is exceeded. + * Invalid ID constant. Returned if [constant RESOLVER_MAX_QUERIES] is exceeded. */ public final const val RESOLVER_INVALID_ID: Long = -1 @@ -50,7 +51,8 @@ public object IP : Object() { } /** - * Returns a given hostname's IPv4 or IPv6 address when resolved (blocking-type method). The address type returned depends on the [enum Type] constant given as [ipType]. + * Returns a given hostname's IPv4 or IPv6 address when resolved (blocking-type method). The + * address type returned depends on the [enum Type] constant given as [param ip_type]. */ @JvmOverloads public fun resolveHostname(host: String, ipType: Type = IP.Type.TYPE_ANY): String { @@ -60,7 +62,8 @@ public object IP : Object() { } /** - * Resolves a given hostname in a blocking way. Addresses are returned as an [godot.Array] of IPv4 or IPv6 addresses depending on [ipType]. + * Resolves a given hostname in a blocking way. Addresses are returned as an [Array] of IPv4 or + * IPv6 addresses depending on [param ip_type]. */ @JvmOverloads public fun resolveHostnameAddresses(host: String, ipType: Type = IP.Type.TYPE_ANY): @@ -72,7 +75,9 @@ public object IP : Object() { } /** - * Creates a queue item to resolve a hostname to an IPv4 or IPv6 address depending on the [enum Type] constant given as [ipType]. Returns the queue ID if successful, or [RESOLVER_INVALID_ID] on error. + * Creates a queue item to resolve a hostname to an IPv4 or IPv6 address depending on the [enum + * Type] constant given as [param ip_type]. Returns the queue ID if successful, or [constant + * RESOLVER_INVALID_ID] on error. */ @JvmOverloads public fun resolveHostnameQueueItem(host: String, ipType: Type = IP.Type.TYPE_ANY): Int { @@ -82,7 +87,8 @@ public object IP : Object() { } /** - * Returns a queued hostname's status as a [enum ResolverStatus] constant, given its queue [id]. + * Returns a queued hostname's status as a [enum ResolverStatus] constant, given its queue [param + * id]. */ public fun getResolveItemStatus(id: Int): ResolverStatus { TransferContext.writeArguments(LONG to id.toLong()) @@ -91,7 +97,8 @@ public object IP : Object() { } /** - * Returns a queued hostname's IP address, given its queue [id]. Returns an empty string on error or if resolution hasn't happened yet (see [getResolveItemStatus]). + * Returns a queued hostname's IP address, given its queue [param id]. Returns an empty string on + * error or if resolution hasn't happened yet (see [getResolveItemStatus]). */ public fun getResolveItemAddress(id: Int): String { TransferContext.writeArguments(LONG to id.toLong()) @@ -100,7 +107,8 @@ public object IP : Object() { } /** - * Returns resolved addresses, or an empty array if an error happened or resolution didn't happen yet (see [getResolveItemStatus]). + * Returns resolved addresses, or an empty array if an error happened or resolution didn't happen + * yet (see [getResolveItemStatus]). */ public fun getResolveItemAddresses(id: Int): VariantArray { TransferContext.writeArguments(LONG to id.toLong()) @@ -109,7 +117,8 @@ public object IP : Object() { } /** - * Removes a given item [id] from the queue. This should be used to free a queue after it has completed to enable more queries to happen. + * Removes a given item [param id] from the queue. This should be used to free a queue after it + * has completed to enable more queries to happen. */ public fun eraseResolveItem(id: Int): Unit { TransferContext.writeArguments(LONG to id.toLong()) @@ -127,17 +136,15 @@ public object IP : Object() { /** * Returns all network adapters as an array. - * * Each adapter is a dictionary of the form: - * - * ``` - * { - * "index": "1", # Interface index. - * "name": "eth0", # Interface name. - * "friendly": "Ethernet One", # A friendly name (might be empty). - * "addresses": ["192.168.1.101"], # An array of IP addresses associated to this interface. - * } - * ``` + * [codeblock] + * { + * "index": "1", # Interface index. + * "name": "eth0", # Interface name. + * "friendly": "Ethernet One", # A friendly name (might be empty). + * "addresses": ["192.168.1.101"], # An array of IP addresses associated to this interface. + * } + * [/codeblock] */ public fun getLocalInterfaces(): VariantArray> { TransferContext.writeArguments() @@ -146,7 +153,8 @@ public object IP : Object() { } /** - * Removes all of a [hostname]'s cached references. If no [hostname] is given, all cached IP addresses are removed. + * Removes all of a [param hostname]'s cached references. If no [param hostname] is given, all + * cached IP addresses are removed. */ @JvmOverloads public fun clearCache(hostname: String = ""): Unit { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ImageFormatLoader.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ImageFormatLoader.kt index b768db270..414adee95 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ImageFormatLoader.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ImageFormatLoader.kt @@ -14,9 +14,9 @@ import kotlin.Suppress import kotlin.jvm.JvmInline /** - * Base class to add support for specific image formats. - * - * The engine supports multiple image formats out of the box (PNG, SVG, JPEG, WebP to name a few), but you can choose to implement support for additional image formats by extending [godot.ImageFormatLoaderExtension]. + * The engine supports multiple image formats out of the box (PNG, SVG, JPEG, WebP to name a few), + * but you can choose to implement support for additional image formats by extending + * [ImageFormatLoaderExtension]. */ @GodotBaseType public open class ImageFormatLoader internal constructor() : RefCounted() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ImageFormatLoaderExtension.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ImageFormatLoaderExtension.kt index cadf2ecb3..c31a871bb 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ImageFormatLoaderExtension.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ImageFormatLoaderExtension.kt @@ -21,11 +21,10 @@ import kotlin.Suppress import kotlin.Unit /** - * Base class for creating [godot.ImageFormatLoader] extensions (adding support for extra image formats). - * - * The engine supports multiple image formats out of the box (PNG, SVG, JPEG, WebP to name a few), but you can choose to implement support for additional image formats by extending this class. - * - * Be sure to respect the documented return types and values. You should create an instance of it, and call [addFormatLoader] to register that loader during the initialization phase. + * The engine supports multiple image formats out of the box (PNG, SVG, JPEG, WebP to name a few), + * but you can choose to implement support for additional image formats by extending this class. + * Be sure to respect the documented return types and values. You should create an instance of it, + * and call [addFormatLoader] to register that loader during the initialization phase. */ @GodotBaseType public open class ImageFormatLoaderExtension : ImageFormatLoader() { @@ -35,14 +34,15 @@ public open class ImageFormatLoaderExtension : ImageFormatLoader() { } /** - * Returns the list of file extensions for this image format. Files with the given extensions will be treated as image file and loaded using this class. + * Returns the list of file extensions for this image format. Files with the given extensions will + * be treated as image file and loaded using this class. */ public open fun _getRecognizedExtensions(): PackedStringArray { throw NotImplementedError("_get_recognized_extensions is not implemented for ImageFormatLoaderExtension") } /** - * Loads the content of [fileaccess] into the provided [image]. + * Loads the content of [param fileaccess] into the provided [param image]. */ public open fun _loadImage( image: Image, @@ -54,7 +54,8 @@ public open class ImageFormatLoaderExtension : ImageFormatLoader() { } /** - * Add this format loader to the engine, allowing it to recognize the file extensions returned by [_getRecognizedExtensions]. + * Add this format loader to the engine, allowing it to recognize the file extensions returned by + * [_getRecognizedExtensions]. */ public fun addFormatLoader(): Unit { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ImageTexture.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ImageTexture.kt index e65404259..64dea4fb4 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ImageTexture.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ImageTexture.kt @@ -22,39 +22,34 @@ import kotlin.Suppress import kotlin.Unit /** - * A [godot.Texture2D] based on an [godot.Image]. - * - * Tutorials: - * [$DOCS_URL/tutorials/assets_pipeline/importing_images.html]($DOCS_URL/tutorials/assets_pipeline/importing_images.html) - * - * A [godot.Texture2D] based on an [godot.Image]. For an image to be displayed, an [godot.ImageTexture] has to be created from it using the [createFromImage] method: - * - * ``` - * var image = Image.load_from_file("res://icon.svg") - * var texture = ImageTexture.create_from_image(image) - * $Sprite2D.texture = texture - * ``` - * - * This way, textures can be created at run-time by loading images both from within the editor and externally. - * - * **Warning:** Prefer to load imported textures with [@GDScript.load] over loading them from within the filesystem dynamically with [godot.Image.load], as it may not work in exported projects: - * - * ``` - * var texture = load("res://icon.svg") - * $Sprite2D.texture = texture - * ``` - * - * This is because images have to be imported as a [godot.CompressedTexture2D] first to be loaded with [@GDScript.load]. If you'd still like to load an image file just like any other [godot.Resource], import it as an [godot.Image] resource instead, and then load it normally using the [@GDScript.load] method. - * - * **Note:** The image can be retrieved from an imported texture using the [godot.Texture2D.getImage] method, which returns a copy of the image: - * - * ``` - * var texture = load("res://icon.svg") - * var image: Image = texture.get_image() - * ``` - * - * An [godot.ImageTexture] is not meant to be operated from within the editor interface directly, and is mostly useful for rendering images on screen dynamically via code. If you need to generate images procedurally from within the editor, consider saving and importing images as custom texture resources implementing a new [godot.EditorImportPlugin]. - * + * A [Texture2D] based on an [Image]. For an image to be displayed, an [ImageTexture] has to be + * created from it using the [createFromImage] method: + * [codeblock] + * var image = Image.load_from_file("res://icon.svg") + * var texture = ImageTexture.create_from_image(image) + * $Sprite2D.texture = texture + * [/codeblock] + * This way, textures can be created at run-time by loading images both from within the editor and + * externally. + * **Warning:** Prefer to load imported textures with [@GDScript.load] over loading them from within + * the filesystem dynamically with [Image.load], as it may not work in exported projects: + * [codeblock] + * var texture = load("res://icon.svg") + * $Sprite2D.texture = texture + * [/codeblock] + * This is because images have to be imported as a [CompressedTexture2D] first to be loaded with + * [@GDScript.load]. If you'd still like to load an image file just like any other [Resource], import + * it as an [Image] resource instead, and then load it normally using the [@GDScript.load] method. + * **Note:** The image can be retrieved from an imported texture using the [Texture2D.getImage] + * method, which returns a copy of the image: + * [codeblock] + * var texture = load("res://icon.svg") + * var image: Image = texture.get_image() + * [/codeblock] + * An [ImageTexture] is not meant to be operated from within the editor interface directly, and is + * mostly useful for rendering images on screen dynamically via code. If you need to generate images + * procedurally from within the editor, consider saving and importing images as custom texture + * resources implementing a new [EditorImportPlugin]. * **Note:** The maximum texture size is 16384×16384 pixels due to graphics hardware limitations. */ @GodotBaseType @@ -74,9 +69,10 @@ public open class ImageTexture : Texture2D() { } /** - * Replaces the texture's data with a new [godot.Image]. This will re-allocate new memory for the texture. - * - * If you want to update the image, but don't need to change its parameters (format, size), use [update] instead for better performance. + * Replaces the texture's data with a new [Image]. This will re-allocate new memory for the + * texture. + * If you want to update the image, but don't need to change its parameters (format, size), use + * [update] instead for better performance. */ public fun setImage(image: Image): Unit { TransferContext.writeArguments(OBJECT to image) @@ -84,11 +80,12 @@ public open class ImageTexture : Texture2D() { } /** - * Replaces the texture's data with a new [godot.Image]. - * - * **Note:** The texture has to be created using [createFromImage] or initialized first with the [setImage] method before it can be updated. The new image dimensions, format, and mipmaps configuration should match the existing texture's image configuration. - * - * Use this method over [setImage] if you need to update the texture frequently, which is faster than allocating additional memory for a new texture each time. + * Replaces the texture's data with a new [Image]. + * **Note:** The texture has to be created using [createFromImage] or initialized first with the + * [setImage] method before it can be updated. The new image dimensions, format, and mipmaps + * configuration should match the existing texture's image configuration. + * Use this method over [setImage] if you need to update the texture frequently, which is faster + * than allocating additional memory for a new texture each time. */ public fun update(image: Image): Unit { TransferContext.writeArguments(OBJECT to image) @@ -105,7 +102,8 @@ public open class ImageTexture : Texture2D() { public companion object { /** - * Creates a new [godot.ImageTexture] and initializes it by allocating and setting the data from an [godot.Image]. + * Creates a new [ImageTexture] and initializes it by allocating and setting the data from an + * [Image]. */ public fun createFromImage(image: Image): ImageTexture? { TransferContext.writeArguments(OBJECT to image) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ImageTexture3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ImageTexture3D.kt index 4d40be5bc..2f5c9c7ef 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ImageTexture3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ImageTexture3D.kt @@ -23,11 +23,11 @@ import kotlin.Suppress import kotlin.Unit /** - * Texture with 3 dimensions. - * - * [godot.ImageTexture3D] is a 3-dimensional [godot.ImageTexture] that has a width, height, and depth. See also [godot.ImageTextureLayered]. - * - * 3D textures are typically used to store density maps for [godot.FogMaterial], color correction LUTs for [godot.Environment], vector fields for [godot.GPUParticlesAttractorVectorField3D] and collision maps for [godot.GPUParticlesCollisionSDF3D]. 3D textures can also be used in custom shaders. + * [ImageTexture3D] is a 3-dimensional [ImageTexture] that has a width, height, and depth. See also + * [ImageTextureLayered]. + * 3D textures are typically used to store density maps for [FogMaterial], color correction LUTs for + * [Environment], vector fields for [GPUParticlesAttractorVectorField3D] and collision maps for + * [GPUParticlesCollisionSDF3D]. 3D textures can also be used in custom shaders. */ @GodotBaseType public open class ImageTexture3D : Texture3D() { @@ -37,7 +37,9 @@ public open class ImageTexture3D : Texture3D() { } /** - * Creates the [godot.ImageTexture3D] with specified [width], [height], and [depth]. See [enum Image.Format] for [format] options. If [useMipmaps] is `true`, then generate mipmaps for the [godot.ImageTexture3D]. + * Creates the [ImageTexture3D] with specified [param width], [param height], and [param depth]. + * See [enum Image.Format] for [param format] options. If [param use_mipmaps] is `true`, then + * generate mipmaps for the [ImageTexture3D]. */ public fun create( format: Image.Format, @@ -53,7 +55,9 @@ public open class ImageTexture3D : Texture3D() { } /** - * Replaces the texture's existing data with the layers specified in [data]. The size of [data] must match the parameters that were used for [create]. In other words, the texture cannot be resized or have its format changed by calling [update]. + * Replaces the texture's existing data with the layers specified in [param data]. The size of + * [param data] must match the parameters that were used for [create]. In other words, the texture + * cannot be resized or have its format changed by calling [update]. */ public fun update(`data`: VariantArray): Unit { TransferContext.writeArguments(ARRAY to data) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ImageTextureLayered.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ImageTextureLayered.kt index 35ff7351a..b2ba7da64 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ImageTextureLayered.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ImageTextureLayered.kt @@ -23,9 +23,8 @@ import kotlin.Suppress import kotlin.Unit /** - * Base class for texture types which contain the data of multiple [godot.ImageTexture]s. Each image is of the same size and format. - * - * Base class for [godot.Texture2DArray], [godot.Cubemap] and [godot.CubemapArray]. Cannot be used directly, but contains all the functions necessary for accessing the derived resource types. See also [godot.Texture3D]. + * Base class for [Texture2DArray], [Cubemap] and [CubemapArray]. Cannot be used directly, but + * contains all the functions necessary for accessing the derived resource types. See also [Texture3D]. */ @GodotBaseType public open class ImageTextureLayered internal constructor() : TextureLayered() { @@ -35,9 +34,10 @@ public open class ImageTextureLayered internal constructor() : TextureLayered() } /** - * Creates an [godot.ImageTextureLayered] from an array of [godot.Image]s. See [godot.Image.create] for the expected data format. The first image decides the width, height, image format and mipmapping setting. The other images *must* have the same width, height, image format and mipmapping setting. - * - * Each [godot.Image] represents one `layer`. + * Creates an [ImageTextureLayered] from an array of [Image]s. See [Image.create] for the expected + * data format. The first image decides the width, height, image format and mipmapping setting. The + * other images *must* have the same width, height, image format and mipmapping setting. + * Each [Image] represents one `layer`. */ public fun createFromImages(images: VariantArray): GodotError { TransferContext.writeArguments(ARRAY to images) @@ -46,12 +46,11 @@ public open class ImageTextureLayered internal constructor() : TextureLayered() } /** - * Replaces the existing [godot.Image] data at the given [layer] with this new image. - * - * The given [godot.Image] must have the same width, height, image format, and mipmapping flag as the rest of the referenced images. - * - * If the image format is unsupported, it will be decompressed and converted to a similar and supported [enum Image.Format]. - * + * Replaces the existing [Image] data at the given [param layer] with this new image. + * The given [Image] must have the same width, height, image format, and mipmapping flag as the + * rest of the referenced images. + * If the image format is unsupported, it will be decompressed and converted to a similar and + * supported [enum Image.Format]. * The update is immediate: it's synchronized with drawing. */ public fun updateLayer(image: Image, layer: Int): Unit { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ImporterMeshInstance3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ImporterMeshInstance3D.kt index de5bc6039..aa4823bc3 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ImporterMeshInstance3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ImporterMeshInstance3D.kt @@ -23,14 +23,8 @@ import kotlin.Int import kotlin.Long import kotlin.Suppress -/** - * - */ @GodotBaseType public open class ImporterMeshInstance3D : Node3D() { - /** - * - */ public var mesh: ImporterMesh? get() { TransferContext.writeArguments() @@ -42,9 +36,6 @@ public open class ImporterMeshInstance3D : Node3D() { TransferContext.callMethod(rawPtr, MethodBindings.setMeshPtr, NIL) } - /** - * - */ public var skin: Skin? get() { TransferContext.writeArguments() @@ -56,9 +47,6 @@ public open class ImporterMeshInstance3D : Node3D() { TransferContext.callMethod(rawPtr, MethodBindings.setSkinPtr, NIL) } - /** - * - */ public var skeletonPath: NodePath get() { TransferContext.writeArguments() @@ -70,9 +58,6 @@ public open class ImporterMeshInstance3D : Node3D() { TransferContext.callMethod(rawPtr, MethodBindings.setSkeletonPathPtr, NIL) } - /** - * - */ public var layerMask: Long get() { TransferContext.writeArguments() @@ -84,9 +69,6 @@ public open class ImporterMeshInstance3D : Node3D() { TransferContext.callMethod(rawPtr, MethodBindings.setLayerMaskPtr, NIL) } - /** - * - */ public var castShadow: GeometryInstance3D.ShadowCastingSetting get() { TransferContext.writeArguments() @@ -98,9 +80,6 @@ public open class ImporterMeshInstance3D : Node3D() { TransferContext.callMethod(rawPtr, MethodBindings.setCastShadowsSettingPtr, NIL) } - /** - * - */ public var visibilityRangeBegin: Float get() { TransferContext.writeArguments() @@ -112,9 +91,6 @@ public open class ImporterMeshInstance3D : Node3D() { TransferContext.callMethod(rawPtr, MethodBindings.setVisibilityRangeBeginPtr, NIL) } - /** - * - */ public var visibilityRangeBeginMargin: Float get() { TransferContext.writeArguments() @@ -126,9 +102,6 @@ public open class ImporterMeshInstance3D : Node3D() { TransferContext.callMethod(rawPtr, MethodBindings.setVisibilityRangeBeginMarginPtr, NIL) } - /** - * - */ public var visibilityRangeEnd: Float get() { TransferContext.writeArguments() @@ -140,9 +113,6 @@ public open class ImporterMeshInstance3D : Node3D() { TransferContext.callMethod(rawPtr, MethodBindings.setVisibilityRangeEndPtr, NIL) } - /** - * - */ public var visibilityRangeEndMargin: Float get() { TransferContext.writeArguments() @@ -154,9 +124,6 @@ public open class ImporterMeshInstance3D : Node3D() { TransferContext.callMethod(rawPtr, MethodBindings.setVisibilityRangeEndMarginPtr, NIL) } - /** - * - */ public var visibilityRangeFadeMode: GeometryInstance3D.VisibilityRangeFadeMode get() { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/InlineAlignment.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/InlineAlignment.kt index e33490866..225811b9b 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/InlineAlignment.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/InlineAlignment.kt @@ -6,18 +6,67 @@ import kotlin.Long public enum class InlineAlignment( id: Long, ) { + /** + * Aligns the top of the inline object (e.g. image, table) to the position of the text specified + * by `INLINE_ALIGNMENT_TO_*` constant. + */ INLINE_ALIGNMENT_TOP_TO(0), + /** + * Aligns the center of the inline object (e.g. image, table) to the position of the text + * specified by `INLINE_ALIGNMENT_TO_*` constant. + */ INLINE_ALIGNMENT_CENTER_TO(1), + /** + * Aligns the baseline (user defined) of the inline object (e.g. image, table) to the position of + * the text specified by `INLINE_ALIGNMENT_TO_*` constant. + */ INLINE_ALIGNMENT_BASELINE_TO(3), + /** + * Aligns the bottom of the inline object (e.g. image, table) to the position of the text + * specified by `INLINE_ALIGNMENT_TO_*` constant. + */ INLINE_ALIGNMENT_BOTTOM_TO(2), + /** + * Aligns the position of the inline object (e.g. image, table) specified by + * `INLINE_ALIGNMENT_*_TO` constant to the top of the text. + */ INLINE_ALIGNMENT_TO_TOP(0), + /** + * Aligns the position of the inline object (e.g. image, table) specified by + * `INLINE_ALIGNMENT_*_TO` constant to the center of the text. + */ INLINE_ALIGNMENT_TO_CENTER(4), + /** + * Aligns the position of the inline object (e.g. image, table) specified by + * `INLINE_ALIGNMENT_*_TO` constant to the baseline of the text. + */ INLINE_ALIGNMENT_TO_BASELINE(8), + /** + * Aligns inline object (e.g. image, table) to the bottom of the text. + */ INLINE_ALIGNMENT_TO_BOTTOM(12), + /** + * Aligns top of the inline object (e.g. image, table) to the top of the text. Equivalent to + * `INLINE_ALIGNMENT_TOP_TO | INLINE_ALIGNMENT_TO_TOP`. + */ INLINE_ALIGNMENT_TOP(0), + /** + * Aligns center of the inline object (e.g. image, table) to the center of the text. Equivalent to + * `INLINE_ALIGNMENT_CENTER_TO | INLINE_ALIGNMENT_TO_CENTER`. + */ INLINE_ALIGNMENT_CENTER(5), + /** + * Aligns bottom of the inline object (e.g. image, table) to the bottom of the text. Equivalent to + * `INLINE_ALIGNMENT_BOTTOM_TO | INLINE_ALIGNMENT_TO_BOTTOM`. + */ INLINE_ALIGNMENT_BOTTOM(14), + /** + * A bit mask for `INLINE_ALIGNMENT_*_TO` alignment constants. + */ INLINE_ALIGNMENT_IMAGE_MASK(3), + /** + * A bit mask for `INLINE_ALIGNMENT_TO_*` alignment constants. + */ INLINE_ALIGNMENT_TEXT_MASK(12), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEvent.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEvent.kt index 18f27f5a6..718e36625 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEvent.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEvent.kt @@ -32,19 +32,14 @@ import kotlin.Suppress import kotlin.jvm.JvmOverloads /** - * Abstract base class for input events. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/676](https://godotengine.org/asset-library/asset/676) - * - * Abstract base class of all types of input events. See [godot.Node.Input]. + * Abstract base class of all types of input events. See [Node.Input]. */ @GodotBaseType public open class InputEvent internal constructor() : Resource() { /** * The event's device ID. - * - * **Note:** This device ID will always be `-1` for emulated mouse input from a touchscreen. This can be used to distinguish emulated mouse input from physical mouse input. + * **Note:** This device ID will always be `-1` for emulated mouse input from a touchscreen. This + * can be used to distinguish emulated mouse input from physical mouse input. */ public var device: Int get() { @@ -64,8 +59,8 @@ public open class InputEvent internal constructor() : Resource() { /** * Returns `true` if this input event matches a pre-defined action of any type. - * - * If [exactMatch] is `false`, it ignores additional input modifiers for [godot.InputEventKey] and [godot.InputEventMouseButton] events, and the direction for [godot.InputEventJoypadMotion] events. + * If [param exact_match] is `false`, it ignores additional input modifiers for [InputEventKey] + * and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events. */ @JvmOverloads public fun isAction(action: StringName, exactMatch: Boolean = false): Boolean { @@ -75,11 +70,15 @@ public open class InputEvent internal constructor() : Resource() { } /** - * Returns `true` if the given action is being pressed (and is not an echo event for [godot.InputEventKey] events, unless [allowEcho] is `true`). Not relevant for events of type [godot.InputEventMouseMotion] or [godot.InputEventScreenDrag]. - * - * If [exactMatch] is `false`, it ignores additional input modifiers for [godot.InputEventKey] and [godot.InputEventMouseButton] events, and the direction for [godot.InputEventJoypadMotion] events. - * - * **Note:** Due to keyboard ghosting, [isActionPressed] may return `false` even if one of the action's keys is pressed. See [godot.Input examples]($DOCS_URL/tutorials/inputs/input_examples.html#keyboard-events) in the documentation for more information. + * Returns `true` if the given action is being pressed (and is not an echo event for + * [InputEventKey] events, unless [param allow_echo] is `true`). Not relevant for events of type + * [InputEventMouseMotion] or [InputEventScreenDrag]. + * If [param exact_match] is `false`, it ignores additional input modifiers for [InputEventKey] + * and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events. + * **Note:** Due to keyboard ghosting, [isActionPressed] may return `false` even if one of the + * action's keys is pressed. See + * [url=$DOCS_URL/tutorials/inputs/input_examples.html#keyboard-events]Input examples[/url] in the + * documentation for more information. */ @JvmOverloads public fun isActionPressed( @@ -93,9 +92,10 @@ public open class InputEvent internal constructor() : Resource() { } /** - * Returns `true` if the given action is released (i.e. not pressed). Not relevant for events of type [godot.InputEventMouseMotion] or [godot.InputEventScreenDrag]. - * - * If [exactMatch] is `false`, it ignores additional input modifiers for [godot.InputEventKey] and [godot.InputEventMouseButton] events, and the direction for [godot.InputEventJoypadMotion] events. + * Returns `true` if the given action is released (i.e. not pressed). Not relevant for events of + * type [InputEventMouseMotion] or [InputEventScreenDrag]. + * If [param exact_match] is `false`, it ignores additional input modifiers for [InputEventKey] + * and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events. */ @JvmOverloads public fun isActionReleased(action: StringName, exactMatch: Boolean = false): Boolean { @@ -105,9 +105,10 @@ public open class InputEvent internal constructor() : Resource() { } /** - * Returns a value between 0.0 and 1.0 depending on the given actions' state. Useful for getting the value of events of type [godot.InputEventJoypadMotion]. - * - * If [exactMatch] is `false`, it ignores additional input modifiers for [godot.InputEventKey] and [godot.InputEventMouseButton] events, and the direction for [godot.InputEventJoypadMotion] events. + * Returns a value between 0.0 and 1.0 depending on the given actions' state. Useful for getting + * the value of events of type [InputEventJoypadMotion]. + * If [param exact_match] is `false`, it ignores additional input modifiers for [InputEventKey] + * and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events. */ @JvmOverloads public fun getActionStrength(action: StringName, exactMatch: Boolean = false): Float { @@ -126,9 +127,11 @@ public open class InputEvent internal constructor() : Resource() { } /** - * Returns `true` if this input event is pressed. Not relevant for events of type [godot.InputEventMouseMotion] or [godot.InputEventScreenDrag]. - * - * **Note:** Due to keyboard ghosting, [isPressed] may return `false` even if one of the action's keys is pressed. See [godot.Input examples]($DOCS_URL/tutorials/inputs/input_examples.html#keyboard-events) in the documentation for more information. + * Returns `true` if this input event is pressed. Not relevant for events of type + * [InputEventMouseMotion] or [InputEventScreenDrag]. + * **Note:** Due to keyboard ghosting, [isPressed] may return `false` even if one of the action's + * keys is pressed. See [url=$DOCS_URL/tutorials/inputs/input_examples.html#keyboard-events]Input + * examples[/url] in the documentation for more information. */ public fun isPressed(): Boolean { TransferContext.writeArguments() @@ -137,7 +140,8 @@ public open class InputEvent internal constructor() : Resource() { } /** - * Returns `true` if this input event is released. Not relevant for events of type [godot.InputEventMouseMotion] or [godot.InputEventScreenDrag]. + * Returns `true` if this input event is released. Not relevant for events of type + * [InputEventMouseMotion] or [InputEventScreenDrag]. */ public fun isReleased(): Boolean { TransferContext.writeArguments() @@ -146,7 +150,8 @@ public open class InputEvent internal constructor() : Resource() { } /** - * Returns `true` if this input event is an echo event (only for events of type [godot.InputEventKey]). Any other event type returns `false`. + * Returns `true` if this input event is an echo event (only for events of type [InputEventKey]). + * Any other event type returns `false`. */ public fun isEcho(): Boolean { TransferContext.writeArguments() @@ -155,7 +160,7 @@ public open class InputEvent internal constructor() : Resource() { } /** - * Returns a [godot.String] representation of the event. + * Returns a [String] representation of the event. */ public fun asText(): String { TransferContext.writeArguments() @@ -164,9 +169,11 @@ public open class InputEvent internal constructor() : Resource() { } /** - * Returns `true` if the specified [event] matches this event. Only valid for action events i.e key ([godot.InputEventKey]), button ([godot.InputEventMouseButton] or [godot.InputEventJoypadButton]), axis [godot.InputEventJoypadMotion] or action ([godot.InputEventAction]) events. - * - * If [exactMatch] is `false`, it ignores additional input modifiers for [godot.InputEventKey] and [godot.InputEventMouseButton] events, and the direction for [godot.InputEventJoypadMotion] events. + * Returns `true` if the specified [param event] matches this event. Only valid for action events + * i.e key ([InputEventKey]), button ([InputEventMouseButton] or [InputEventJoypadButton]), axis + * [InputEventJoypadMotion] or action ([InputEventAction]) events. + * If [param exact_match] is `false`, it ignores additional input modifiers for [InputEventKey] + * and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events. */ @JvmOverloads public fun isMatch(event: InputEvent, exactMatch: Boolean = true): Boolean { @@ -185,9 +192,10 @@ public open class InputEvent internal constructor() : Resource() { } /** - * Returns `true` if the given input event and this input event can be added together (only for events of type [godot.InputEventMouseMotion]). - * - * The given input event's position, global position and speed will be copied. The resulting `relative` is a sum of both events. Both events' modifiers have to be identical. + * Returns `true` if the given input event and this input event can be added together (only for + * events of type [InputEventMouseMotion]). + * The given input event's position, global position and speed will be copied. The resulting + * `relative` is a sum of both events. Both events' modifiers have to be identical. */ public fun accumulate(withEvent: InputEvent): Boolean { TransferContext.writeArguments(OBJECT to withEvent) @@ -196,7 +204,10 @@ public open class InputEvent internal constructor() : Resource() { } /** - * Returns a copy of the given input event which has been offset by [localOfs] and transformed by [xform]. Relevant for events of type [godot.InputEventMouseButton], [godot.InputEventMouseMotion], [godot.InputEventScreenTouch], [godot.InputEventScreenDrag], [godot.InputEventMagnifyGesture] and [godot.InputEventPanGesture]. + * Returns a copy of the given input event which has been offset by [param local_ofs] and + * transformed by [param xform]. Relevant for events of type [InputEventMouseButton], + * [InputEventMouseMotion], [InputEventScreenTouch], [InputEventScreenDrag], + * [InputEventMagnifyGesture] and [InputEventPanGesture]. */ @JvmOverloads public fun xformedBy(xform: Transform2D, localOfs: Vector2 = Vector2(0, 0)): InputEvent? { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEventAction.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEventAction.kt index 3faa19a76..6b83def02 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEventAction.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEventAction.kt @@ -23,19 +23,18 @@ import kotlin.Suppress import kotlin.jvm.JvmName /** - * An input event type for actions. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/676](https://godotengine.org/asset-library/asset/676) - * - * Contains a generic action which can be targeted from several types of inputs. Actions and their events can be set in the **Input Map** tab in **Project > Project Settings**, or with the [godot.InputMap] class. - * - * **Note:** Unlike the other [godot.InputEvent] subclasses which map to unique physical events, this virtual one is not emitted by the engine. This class is useful to emit actions manually with [godot.Input.parseInputEvent], which are then received in [godot.Node.Input]. To check if a physical event matches an action from the Input Map, use [godot.InputEvent.isAction] and [godot.InputEvent.isActionPressed]. + * Contains a generic action which can be targeted from several types of inputs. Actions and their + * events can be set in the **Input Map** tab in **Project > Project Settings**, or with the [InputMap] + * class. + * **Note:** Unlike the other [InputEvent] subclasses which map to unique physical events, this + * virtual one is not emitted by the engine. This class is useful to emit actions manually with + * [Input.parseInputEvent], which are then received in [Node.Input]. To check if a physical event + * matches an action from the Input Map, use [InputEvent.isAction] and [InputEvent.isActionPressed]. */ @GodotBaseType public open class InputEventAction : InputEvent() { /** - * The action's name. Actions are accessed via this [godot.String]. + * The action's name. Actions are accessed via this [String]. */ public var action: StringName get() { @@ -60,7 +59,9 @@ public open class InputEventAction : InputEvent() { } /** - * The action's strength between 0 and 1. This value is considered as equal to 0 if pressed is `false`. The event strength allows faking analog joypad motion events, by specifying how strongly the joypad axis is bent or pressed. + * The action's strength between 0 and 1. This value is considered as equal to 0 if pressed is + * `false`. The event strength allows faking analog joypad motion events, by specifying how strongly + * the joypad axis is bent or pressed. */ public var strength: Float get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEventFromWindow.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEventFromWindow.kt index 1ca884a1b..1e385df81 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEventFromWindow.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEventFromWindow.kt @@ -18,14 +18,13 @@ import kotlin.Long import kotlin.Suppress /** - * Abstract base class for [godot.Viewport]-based input events. - * - * InputEventFromWindow represents events specifically received by windows. This includes mouse events, keyboard events in focused windows or touch screen actions. + * InputEventFromWindow represents events specifically received by windows. This includes mouse + * events, keyboard events in focused windows or touch screen actions. */ @GodotBaseType public open class InputEventFromWindow internal constructor() : InputEvent() { /** - * The ID of a [godot.Window] that received this event. + * The ID of a [Window] that received this event. */ public var windowId: Long get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEventGesture.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEventGesture.kt index ffa628fca..7b83aeb43 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEventGesture.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEventGesture.kt @@ -21,17 +21,14 @@ import kotlin.Suppress import kotlin.Unit /** - * Abstract base class for touch gestures. - * - * Tutorials: - * [$DOCS_URL/tutorials/inputs/inputevent.html]($DOCS_URL/tutorials/inputs/inputevent.html) - * - * InputEventGestures are sent when a user performs a supported gesture on a touch screen. Gestures can't be emulated using mouse, because they typically require multi-touch. + * InputEventGestures are sent when a user performs a supported gesture on a touch screen. Gestures + * can't be emulated using mouse, because they typically require multi-touch. */ @GodotBaseType public open class InputEventGesture internal constructor() : InputEventWithModifiers() { /** - * The local gesture position relative to the [godot.Viewport]. If used in [godot.Control.GuiInput], the position is relative to the current [godot.Control] that received this gesture. + * The local gesture position relative to the [Viewport]. If used in [Control.GuiInput], the + * position is relative to the current [Control] that received this gesture. */ @CoreTypeLocalCopy public var position: Vector2 @@ -51,7 +48,8 @@ public open class InputEventGesture internal constructor() : InputEventWithModif } /** - * The local gesture position relative to the [godot.Viewport]. If used in [godot.Control.GuiInput], the position is relative to the current [godot.Control] that received this gesture. + * The local gesture position relative to the [Viewport]. If used in [Control.GuiInput], the + * position is relative to the current [Control] that received this gesture. * * This is a helper function to make dealing with local copies easier. * diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEventJoypadMotion.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEventJoypadMotion.kt index 528deda38..9fbfc4899 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEventJoypadMotion.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEventJoypadMotion.kt @@ -21,12 +21,8 @@ import kotlin.Long import kotlin.Suppress /** - * Represents axis motions (such as joystick or analog triggers) from a gamepad. - * - * Tutorials: - * [$DOCS_URL/tutorials/inputs/inputevent.html]($DOCS_URL/tutorials/inputs/inputevent.html) - * - * Stores information about joystick motions. One [godot.InputEventJoypadMotion] represents one axis at a time. For gamepad buttons, see [godot.InputEventJoypadButton]. + * Stores information about joystick motions. One [InputEventJoypadMotion] represents one axis at a + * time. For gamepad buttons, see [InputEventJoypadButton]. */ @GodotBaseType public open class InputEventJoypadMotion : InputEvent() { @@ -45,7 +41,8 @@ public open class InputEventJoypadMotion : InputEvent() { } /** - * Current position of the joystick on the given axis. The value ranges from `-1.0` to `1.0`. A value of `0` means the axis is in its resting position. + * Current position of the joystick on the given axis. The value ranges from `-1.0` to `1.0`. A + * value of `0` means the axis is in its resting position. */ public var axisValue: Float get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEventMouse.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEventMouse.kt index d5e04bc94..79b26c0f8 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEventMouse.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEventMouse.kt @@ -24,17 +24,13 @@ import kotlin.Suppress import kotlin.Unit /** - * Base input event type for mouse events. - * - * Tutorials: - * [$DOCS_URL/tutorials/inputs/inputevent.html]($DOCS_URL/tutorials/inputs/inputevent.html) - * * Stores general information about mouse events. */ @GodotBaseType public open class InputEventMouse internal constructor() : InputEventWithModifiers() { /** - * The mouse button mask identifier, one of or a bitwise combination of the [enum MouseButton] button masks. + * The mouse button mask identifier, one of or a bitwise combination of the [enum MouseButton] + * button masks. */ public var buttonMask: MouseButtonMask get() { @@ -48,9 +44,10 @@ public open class InputEventMouse internal constructor() : InputEventWithModifie } /** - * When received in [godot.Node.Input] or [godot.Node.UnhandledInput], returns the mouse's position in the [godot.Viewport] this [godot.Node] is in using the coordinate system of this [godot.Viewport]. - * - * When received in [godot.Control.GuiInput], returns the mouse's position in the [godot.Control] using the local coordinate system of the [godot.Control]. + * When received in [Node.Input] or [Node.UnhandledInput], returns the mouse's position in the + * [Viewport] this [Node] is in using the coordinate system of this [Viewport]. + * When received in [Control.GuiInput], returns the mouse's position in the [Control] using the + * local coordinate system of the [Control]. */ @CoreTypeLocalCopy public var position: Vector2 @@ -65,9 +62,10 @@ public open class InputEventMouse internal constructor() : InputEventWithModifie } /** - * When received in [godot.Node.Input] or [godot.Node.UnhandledInput], returns the mouse's position in the root [godot.Viewport] using the coordinate system of the root [godot.Viewport]. - * - * When received in [godot.Control.GuiInput], returns the mouse's position in the [godot.CanvasLayer] that the [godot.Control] is in using the coordinate system of the [godot.CanvasLayer]. + * When received in [Node.Input] or [Node.UnhandledInput], returns the mouse's position in the + * root [Viewport] using the coordinate system of the root [Viewport]. + * When received in [Control.GuiInput], returns the mouse's position in the [CanvasLayer] that the + * [Control] is in using the coordinate system of the [CanvasLayer]. */ @CoreTypeLocalCopy public var globalPosition: Vector2 @@ -87,9 +85,10 @@ public open class InputEventMouse internal constructor() : InputEventWithModifie } /** - * When received in [godot.Node.Input] or [godot.Node.UnhandledInput], returns the mouse's position in the [godot.Viewport] this [godot.Node] is in using the coordinate system of this [godot.Viewport]. - * - * When received in [godot.Control.GuiInput], returns the mouse's position in the [godot.Control] using the local coordinate system of the [godot.Control]. + * When received in [Node.Input] or [Node.UnhandledInput], returns the mouse's position in the + * [Viewport] this [Node] is in using the coordinate system of this [Viewport]. + * When received in [Control.GuiInput], returns the mouse's position in the [Control] using the + * local coordinate system of the [Control]. * * This is a helper function to make dealing with local copies easier. * @@ -113,9 +112,10 @@ public open class InputEventMouse internal constructor() : InputEventWithModifie /** - * When received in [godot.Node.Input] or [godot.Node.UnhandledInput], returns the mouse's position in the root [godot.Viewport] using the coordinate system of the root [godot.Viewport]. - * - * When received in [godot.Control.GuiInput], returns the mouse's position in the [godot.CanvasLayer] that the [godot.Control] is in using the coordinate system of the [godot.CanvasLayer]. + * When received in [Node.Input] or [Node.UnhandledInput], returns the mouse's position in the + * root [Viewport] using the coordinate system of the root [Viewport]. + * When received in [Control.GuiInput], returns the mouse's position in the [CanvasLayer] that the + * [Control] is in using the coordinate system of the [CanvasLayer]. * * This is a helper function to make dealing with local copies easier. * diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEventMouseButton.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEventMouseButton.kt index 3c1a2d4c4..b36a189ea 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEventMouseButton.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEventMouseButton.kt @@ -23,17 +23,14 @@ import kotlin.Suppress import kotlin.jvm.JvmName /** - * Represents a mouse button being pressed or released. - * - * Tutorials: - * [$DOCS_URL/tutorials/inputs/mouse_and_input_coordinates.html]($DOCS_URL/tutorials/inputs/mouse_and_input_coordinates.html) - * - * Stores information about mouse click events. See [godot.Node.Input]. + * Stores information about mouse click events. See [Node.Input]. */ @GodotBaseType public open class InputEventMouseButton : InputEventMouse() { /** - * The amount (or delta) of the event. When used for high-precision scroll events, this indicates the scroll amount (vertical or horizontal). This is only supported on some platforms; the reported sensitivity varies depending on the platform. May be `0` if not supported. + * The amount (or delta) of the event. When used for high-precision scroll events, this indicates + * the scroll amount (vertical or horizontal). This is only supported on some platforms; the reported + * sensitivity varies depending on the platform. May be `0` if not supported. */ public var factor: Float get() { @@ -72,7 +69,8 @@ public open class InputEventMouseButton : InputEventMouse() { } /** - * If `true`, the mouse button's state is pressed. If `false`, the mouse button's state is released. + * If `true`, the mouse button's state is pressed. If `false`, the mouse button's state is + * released. */ public var pressed: Boolean @JvmName("isPressed_prop") diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEventMouseMotion.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEventMouseMotion.kt index a40c5e968..a793b7b04 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEventMouseMotion.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEventMouseMotion.kt @@ -25,19 +25,20 @@ import kotlin.Suppress import kotlin.Unit /** - * Represents a mouse or a pen movement. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/676](https://godotengine.org/asset-library/asset/676) - * - * Stores information about a mouse or a pen motion. This includes relative position, absolute position, and velocity. See [godot.Node.Input]. - * - * **Note:** By default, this event is only emitted once per frame rendered at most. If you need more precise input reporting, set [godot.Input.useAccumulatedInput] to `false` to make events emitted as often as possible. If you use InputEventMouseMotion to draw lines, consider implementing [godot.Bresenham's line algorithm](https://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm) as well to avoid visible gaps in lines if the user is moving the mouse quickly. + * Stores information about a mouse or a pen motion. This includes relative position, absolute + * position, and velocity. See [Node.Input]. + * **Note:** By default, this event is only emitted once per frame rendered at most. If you need + * more precise input reporting, set [Input.useAccumulatedInput] to `false` to make events emitted as + * often as possible. If you use InputEventMouseMotion to draw lines, consider implementing + * [url=https://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm]Bresenham's line algorithm[/url] + * as well to avoid visible gaps in lines if the user is moving the mouse quickly. */ @GodotBaseType public open class InputEventMouseMotion : InputEventMouse() { /** - * Represents the angles of tilt of the pen. Positive X-coordinate value indicates a tilt to the right. Positive Y-coordinate value indicates a tilt toward the user. Ranges from `-1.0` to `1.0` for both axes. + * Represents the angles of tilt of the pen. Positive X-coordinate value indicates a tilt to the + * right. Positive Y-coordinate value indicates a tilt toward the user. Ranges from `-1.0` to `1.0` + * for both axes. */ @CoreTypeLocalCopy public var tilt: Vector2 @@ -67,7 +68,6 @@ public open class InputEventMouseMotion : InputEventMouse() { /** * Returns `true` when using the eraser end of a stylus pen. - * * **Note:** This property is implemented on Linux, macOS and Windows. */ public var penInverted: Boolean @@ -83,8 +83,8 @@ public open class InputEventMouseMotion : InputEventMouse() { /** * The mouse position relative to the previous position (position at the last frame). - * - * **Note:** Since [godot.InputEventMouseMotion] is only emitted when the mouse moves, the last event won't have a relative position of `Vector2(0, 0)` when the user stops moving the mouse. + * **Note:** Since [InputEventMouseMotion] is only emitted when the mouse moves, the last event + * won't have a relative position of `Vector2(0, 0)` when the user stops moving the mouse. */ @CoreTypeLocalCopy public var relative: Vector2 @@ -119,7 +119,9 @@ public open class InputEventMouseMotion : InputEventMouse() { } /** - * Represents the angles of tilt of the pen. Positive X-coordinate value indicates a tilt to the right. Positive Y-coordinate value indicates a tilt toward the user. Ranges from `-1.0` to `1.0` for both axes. + * Represents the angles of tilt of the pen. Positive X-coordinate value indicates a tilt to the + * right. Positive Y-coordinate value indicates a tilt toward the user. Ranges from `-1.0` to `1.0` + * for both axes. * * This is a helper function to make dealing with local copies easier. * @@ -144,8 +146,8 @@ public open class InputEventMouseMotion : InputEventMouse() { /** * The mouse position relative to the previous position (position at the last frame). - * - * **Note:** Since [godot.InputEventMouseMotion] is only emitted when the mouse moves, the last event won't have a relative position of `Vector2(0, 0)` when the user stops moving the mouse. + * **Note:** Since [InputEventMouseMotion] is only emitted when the mouse moves, the last event + * won't have a relative position of `Vector2(0, 0)` when the user stops moving the mouse. * * This is a helper function to make dealing with local copies easier. * diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEventScreenDrag.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEventScreenDrag.kt index 29427dd72..0abc337c4 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEventScreenDrag.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEventScreenDrag.kt @@ -27,12 +27,7 @@ import kotlin.Suppress import kotlin.Unit /** - * Represents a screen drag event. - * - * Tutorials: - * [$DOCS_URL/tutorials/inputs/inputevent.html]($DOCS_URL/tutorials/inputs/inputevent.html) - * - * Stores information about screen drag events. See [godot.Node.Input]. + * Stores information about screen drag events. See [Node.Input]. */ @GodotBaseType public open class InputEventScreenDrag : InputEventFromWindow() { @@ -51,7 +46,9 @@ public open class InputEventScreenDrag : InputEventFromWindow() { } /** - * Represents the angles of tilt of the pen. Positive X-coordinate value indicates a tilt to the right. Positive Y-coordinate value indicates a tilt toward the user. Ranges from `-1.0` to `1.0` for both axes. + * Represents the angles of tilt of the pen. Positive X-coordinate value indicates a tilt to the + * right. Positive Y-coordinate value indicates a tilt toward the user. Ranges from `-1.0` to `1.0` + * for both axes. */ @CoreTypeLocalCopy public var tilt: Vector2 @@ -144,7 +141,9 @@ public open class InputEventScreenDrag : InputEventFromWindow() { } /** - * Represents the angles of tilt of the pen. Positive X-coordinate value indicates a tilt to the right. Positive Y-coordinate value indicates a tilt toward the user. Ranges from `-1.0` to `1.0` for both axes. + * Represents the angles of tilt of the pen. Positive X-coordinate value indicates a tilt to the + * right. Positive Y-coordinate value indicates a tilt toward the user. Ranges from `-1.0` to `1.0` + * for both axes. * * This is a helper function to make dealing with local copies easier. * diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEventScreenTouch.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEventScreenTouch.kt index 3cbb7fb89..9385478af 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEventScreenTouch.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEventScreenTouch.kt @@ -25,12 +25,8 @@ import kotlin.Unit import kotlin.jvm.JvmName /** - * Represents a screen touch event. - * - * Tutorials: - * [$DOCS_URL/tutorials/inputs/inputevent.html]($DOCS_URL/tutorials/inputs/inputevent.html) - * - * Stores information about multi-touch press/release input events. Supports touch press, touch release and [index] for multi-touch count and order. + * Stores information about multi-touch press/release input events. Supports touch press, touch + * release and [index] for multi-touch count and order. */ @GodotBaseType public open class InputEventScreenTouch : InputEventFromWindow() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEventShortcut.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEventShortcut.kt index 5a91d47d5..5e85a3005 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEventShortcut.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEventShortcut.kt @@ -17,14 +17,15 @@ import kotlin.Int import kotlin.Suppress /** - * Represents a triggered keyboard [godot.Shortcut]. - * - * InputEventShortcut is a special event that can be received in [godot.Node.UnhandledKeyInput]. It is typically sent by the editor's Command Palette to trigger actions, but can also be sent manually using [godot.Viewport.pushInput]. + * InputEventShortcut is a special event that can be received in [Node.UnhandledKeyInput]. It is + * typically sent by the editor's Command Palette to trigger actions, but can also be sent manually + * using [Viewport.pushInput]. */ @GodotBaseType public open class InputEventShortcut : InputEvent() { /** - * The [godot.Shortcut] represented by this event. Its [godot.Shortcut.matchesEvent] method will always return `true` for this event. + * The [Shortcut] represented by this event. Its [Shortcut.matchesEvent] method will always return + * `true` for this event. */ public var shortcut: Shortcut? get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEventWithModifiers.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEventWithModifiers.kt index 8d5b135a8..40b5ca7f0 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEventWithModifiers.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/InputEventWithModifiers.kt @@ -20,17 +20,15 @@ import kotlin.Long import kotlin.Suppress /** - * Abstract base class for input events affected by modifier keys like [kbd]Shift[/kbd] and [kbd]Alt[/kbd]. - * - * Tutorials: - * [$DOCS_URL/tutorials/inputs/inputevent.html]($DOCS_URL/tutorials/inputs/inputevent.html) - * - * Stores information about mouse, keyboard, and touch gesture input events. This includes information about which modifier keys are pressed, such as [kbd]Shift[/kbd] or [kbd]Alt[/kbd]. See [godot.Node.Input]. + * Stores information about mouse, keyboard, and touch gesture input events. This includes + * information about which modifier keys are pressed, such as [kbd]Shift[/kbd] or [kbd]Alt[/kbd]. See + * [Node.Input]. */ @GodotBaseType public open class InputEventWithModifiers internal constructor() : InputEventFromWindow() { /** - * Automatically use [kbd]Meta[/kbd] ([kbd]Cmd[/kbd]) on macOS and [kbd]Ctrl[/kbd] on other platforms. If `true`, [ctrlPressed] and [metaPressed] cannot be set. + * Automatically use [kbd]Meta[/kbd] ([kbd]Cmd[/kbd]) on macOS and [kbd]Ctrl[/kbd] on other + * platforms. If `true`, [ctrlPressed] and [metaPressed] cannot be set. */ public var commandOrControlAutoremap: Boolean get() { @@ -86,7 +84,8 @@ public open class InputEventWithModifiers internal constructor() : InputEventFro } /** - * State of the [kbd]Meta[/kbd] modifier. On Windows and Linux, this represents the Windows key (sometimes called "meta" or "super" on Linux). On macOS, this represents the Command key. + * State of the [kbd]Meta[/kbd] modifier. On Windows and Linux, this represents the Windows key + * (sometimes called "meta" or "super" on Linux). On macOS, this represents the Command key. */ public var metaPressed: Boolean get() { @@ -106,7 +105,6 @@ public open class InputEventWithModifiers internal constructor() : InputEventFro /** * On macOS, returns `true` if [kbd]Meta[/kbd] ([kbd]Cmd[/kbd]) is pressed. - * * On other platforms, returns `true` if [kbd]Ctrl[/kbd] is pressed. */ public fun isCommandOrControlPressed(): Boolean { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/InputMap.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/InputMap.kt index 1dc728968..0fa99376a 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/InputMap.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/InputMap.kt @@ -27,12 +27,9 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * A singleton that manages all [godot.InputEventAction]s. - * - * Tutorials: - * [$DOCS_URL/tutorials/inputs/inputevent.html#inputmap]($DOCS_URL/tutorials/inputs/inputevent.html#inputmap) - * - * Manages all [godot.InputEventAction] which can be created/modified from the project settings menu **Project > Project Settings > Input Map** or in code with [addAction] and [actionAddEvent]. See [godot.Node.Input]. + * Manages all [InputEventAction] which can be created/modified from the project settings menu + * **Project > Project Settings > Input Map** or in code with [addAction] and [actionAddEvent]. See + * [Node.Input]. */ @GodotBaseType public object InputMap : Object() { @@ -42,7 +39,7 @@ public object InputMap : Object() { } /** - * Returns `true` if the [godot.InputMap] has a registered action with the given name. + * Returns `true` if the [InputMap] has a registered action with the given name. */ public fun hasAction(action: StringName): Boolean { TransferContext.writeArguments(STRING_NAME to action) @@ -51,7 +48,7 @@ public object InputMap : Object() { } /** - * Returns an array of all actions in the [godot.InputMap]. + * Returns an array of all actions in the [InputMap]. */ public fun getActions(): VariantArray { TransferContext.writeArguments() @@ -60,9 +57,8 @@ public object InputMap : Object() { } /** - * Adds an empty action to the [godot.InputMap] with a configurable [deadzone]. - * - * An [godot.InputEvent] can then be added to this action with [actionAddEvent]. + * Adds an empty action to the [InputMap] with a configurable [param deadzone]. + * An [InputEvent] can then be added to this action with [actionAddEvent]. */ @JvmOverloads public fun addAction(action: StringName, deadzone: Float = 0.5f): Unit { @@ -71,7 +67,7 @@ public object InputMap : Object() { } /** - * Removes an action from the [godot.InputMap]. + * Removes an action from the [InputMap]. */ public fun eraseAction(action: StringName): Unit { TransferContext.writeArguments(STRING_NAME to action) @@ -96,7 +92,7 @@ public object InputMap : Object() { } /** - * Adds an [godot.InputEvent] to an action. This [godot.InputEvent] will trigger the action. + * Adds an [InputEvent] to an action. This [InputEvent] will trigger the action. */ public fun actionAddEvent(action: StringName, event: InputEvent): Unit { TransferContext.writeArguments(STRING_NAME to action, OBJECT to event) @@ -104,7 +100,7 @@ public object InputMap : Object() { } /** - * Returns `true` if the action has the given [godot.InputEvent] associated with it. + * Returns `true` if the action has the given [InputEvent] associated with it. */ public fun actionHasEvent(action: StringName, event: InputEvent): Boolean { TransferContext.writeArguments(STRING_NAME to action, OBJECT to event) @@ -113,7 +109,7 @@ public object InputMap : Object() { } /** - * Removes an [godot.InputEvent] from an action. + * Removes an [InputEvent] from an action. */ public fun actionEraseEvent(action: StringName, event: InputEvent): Unit { TransferContext.writeArguments(STRING_NAME to action, OBJECT to event) @@ -129,9 +125,10 @@ public object InputMap : Object() { } /** - * Returns an array of [godot.InputEvent]s associated with a given action. - * - * **Note:** When used in the editor (e.g. a tool script or [godot.EditorPlugin]), this method will return events for the editor action. If you want to access your project's input binds from the editor, read the `input/ *` settings from [godot.ProjectSettings]. + * Returns an array of [InputEvent]s associated with a given action. + * **Note:** When used in the editor (e.g. a tool script or [EditorPlugin]), this method will + * return events for the editor action. If you want to access your project's input binds from the + * editor, read the `input/*` settings from [ProjectSettings]. */ public fun actionGetEvents(action: StringName): VariantArray { TransferContext.writeArguments(STRING_NAME to action) @@ -140,9 +137,11 @@ public object InputMap : Object() { } /** - * Returns `true` if the given event is part of an existing action. This method ignores keyboard modifiers if the given [godot.InputEvent] is not pressed (for proper release detection). See [actionHasEvent] if you don't want this behavior. - * - * If [exactMatch] is `false`, it ignores additional input modifiers for [godot.InputEventKey] and [godot.InputEventMouseButton] events, and the direction for [godot.InputEventJoypadMotion] events. + * Returns `true` if the given event is part of an existing action. This method ignores keyboard + * modifiers if the given [InputEvent] is not pressed (for proper release detection). See + * [actionHasEvent] if you don't want this behavior. + * If [param exact_match] is `false`, it ignores additional input modifiers for [InputEventKey] + * and [InputEventMouseButton] events, and the direction for [InputEventJoypadMotion] events. */ @JvmOverloads public fun eventIsAction( @@ -156,7 +155,7 @@ public object InputMap : Object() { } /** - * Clears all [godot.InputEventAction] in the [godot.InputMap] and load it anew from [godot.ProjectSettings]. + * Clears all [InputEventAction] in the [InputMap] and load it anew from [ProjectSettings]. */ public fun loadFromProjectSettings(): Unit { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/InstancePlaceholder.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/InstancePlaceholder.kt index 00b7afb32..c08b17241 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/InstancePlaceholder.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/InstancePlaceholder.kt @@ -23,11 +23,15 @@ import kotlin.Suppress import kotlin.jvm.JvmOverloads /** - * Placeholder for the root [godot.Node] of a [godot.PackedScene]. - * - * Turning on the option **Load As Placeholder** for an instantiated scene in the editor causes it to be replaced by an [godot.InstancePlaceholder] when running the game, this will not replace the node in the editor. This makes it possible to delay actually loading the scene until calling [createInstance]. This is useful to avoid loading large scenes all at once by loading parts of it selectively. - * - * The [godot.InstancePlaceholder] does not have a transform. This causes any child nodes to be positioned relatively to the [godot.Viewport] from point (0,0), rather than their parent as displayed in the editor. Replacing the placeholder with a scene with a transform will transform children relatively to their parent again. + * Turning on the option **Load As Placeholder** for an instantiated scene in the editor causes it + * to be replaced by an [InstancePlaceholder] when running the game, this will not replace the node in + * the editor. This makes it possible to delay actually loading the scene until calling + * [createInstance]. This is useful to avoid loading large scenes all at once by loading parts of it + * selectively. + * The [InstancePlaceholder] does not have a transform. This causes any child nodes to be positioned + * relatively to the [Viewport] from point (0,0), rather than their parent as displayed in the editor. + * Replacing the placeholder with a scene with a transform will transform children relatively to their + * parent again. */ @GodotBaseType public open class InstancePlaceholder internal constructor() : Node() { @@ -37,9 +41,11 @@ public open class InstancePlaceholder internal constructor() : Node() { } /** - * Returns the list of properties that will be applied to the node when [createInstance] is called. - * - * If [withOrder] is `true`, a key named `.order` (note the leading period) is added to the dictionary. This `.order` key is an [godot.Array] of [godot.String] property names specifying the order in which properties will be applied (with index 0 being the first). + * Returns the list of properties that will be applied to the node when [createInstance] is + * called. + * If [param with_order] is `true`, a key named `.order` (note the leading period) is added to the + * dictionary. This `.order` key is an [Array] of [String] property names specifying the order in + * which properties will be applied (with index 0 being the first). */ @JvmOverloads public fun getStoredValues(withOrder: Boolean = false): Dictionary { @@ -49,9 +55,11 @@ public open class InstancePlaceholder internal constructor() : Node() { } /** - * Call this method to actually load in the node. The created node will be placed as a sibling *above* the [godot.InstancePlaceholder] in the scene tree. The [godot.Node]'s reference is also returned for convenience. - * - * **Note:** [createInstance] is not thread-safe. Use [godot.Object.callDeferred] if calling from a thread. + * Call this method to actually load in the node. The created node will be placed as a sibling + * *above* the [InstancePlaceholder] in the scene tree. The [Node]'s reference is also returned for + * convenience. + * **Note:** [createInstance] is not thread-safe. Use [Object.callDeferred] if calling from a + * thread. */ @JvmOverloads public fun createInstance(replace: Boolean = false, customScene: PackedScene? = null): Node? { @@ -61,7 +69,8 @@ public open class InstancePlaceholder internal constructor() : Node() { } /** - * Gets the path to the [godot.PackedScene] resource file that is loaded by default when calling [createInstance]. Not thread-safe. Use [godot.Object.callDeferred] if calling from a thread. + * Gets the path to the [PackedScene] resource file that is loaded by default when calling + * [createInstance]. Not thread-safe. Use [Object.callDeferred] if calling from a thread. */ public fun getInstancePath(): String { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/IntervalTweener.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/IntervalTweener.kt index fd8ae0e3d..61da46a74 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/IntervalTweener.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/IntervalTweener.kt @@ -12,11 +12,10 @@ import kotlin.Int import kotlin.Suppress /** - * Creates an idle interval in a [godot.Tween] animation. - * - * [godot.IntervalTweener] is used to make delays in a tweening sequence. See [godot.Tween.tweenInterval] for more usage information. - * - * **Note:** [godot.Tween.tweenInterval] is the only correct way to create [godot.IntervalTweener]. Any [godot.IntervalTweener] created manually will not function correctly. + * [IntervalTweener] is used to make delays in a tweening sequence. See [Tween.tweenInterval] for + * more usage information. + * **Note:** [Tween.tweenInterval] is the only correct way to create [IntervalTweener]. Any + * [IntervalTweener] created manually will not function correctly. */ @GodotBaseType public open class IntervalTweener : Tweener() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ItemList.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ItemList.kt index c5d97ceb1..29231bbd7 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ItemList.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ItemList.kt @@ -45,23 +45,32 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * A vertical list of selectable items with one or multiple columns. - * - * This control provides a vertical list of selectable items that may be in a single or in multiple columns, with each item having options for text and an icon. Tooltips are supported and may be different for every item in the list. - * - * Selectable items in the list may be selected or deselected and multiple selection may be enabled. Selection with right mouse button may also be enabled to allow use of popup context menus. Items may also be "activated" by double-clicking them or by pressing [kbd]Enter[/kbd]. - * - * Item text only supports single-line strings. Newline characters (e.g. `\n`) in the string won't produce a newline. Text wrapping is enabled in [ICON_MODE_TOP] mode, but the column's width is adjusted to fully fit its content by default. You need to set [fixedColumnWidth] greater than zero to wrap the text. - * - * All `set_*` methods allow negative item indices, i.e. `-1` to access the last item, `-2` to select the second-to-last item, and so on. - * - * **Incremental search:** Like [godot.PopupMenu] and [godot.Tree], [godot.ItemList] supports searching within the list while the control is focused. Press a key that matches the first letter of an item's name to select the first item starting with the given letter. After that point, there are two ways to perform incremental search: 1) Press the same key again before the timeout duration to select the next item starting with the same letter. 2) Press letter keys that match the rest of the word before the timeout duration to match to select the item in question directly. Both of these actions will be reset to the beginning of the list if the timeout duration has passed since the last keystroke was registered. You can adjust the timeout duration by changing [godot.ProjectSettings.gui/timers/incrementalSearchMaxIntervalMsec]. + * This control provides a vertical list of selectable items that may be in a single or in multiple + * columns, with each item having options for text and an icon. Tooltips are supported and may be + * different for every item in the list. + * Selectable items in the list may be selected or deselected and multiple selection may be enabled. + * Selection with right mouse button may also be enabled to allow use of popup context menus. Items may + * also be "activated" by double-clicking them or by pressing [kbd]Enter[/kbd]. + * Item text only supports single-line strings. Newline characters (e.g. `\n`) in the string won't + * produce a newline. Text wrapping is enabled in [constant ICON_MODE_TOP] mode, but the column's width + * is adjusted to fully fit its content by default. You need to set [fixedColumnWidth] greater than + * zero to wrap the text. + * All `set_*` methods allow negative item indices, i.e. `-1` to access the last item, `-2` to + * select the second-to-last item, and so on. + * **Incremental search:** Like [PopupMenu] and [Tree], [ItemList] supports searching within the + * list while the control is focused. Press a key that matches the first letter of an item's name to + * select the first item starting with the given letter. After that point, there are two ways to + * perform incremental search: 1) Press the same key again before the timeout duration to select the + * next item starting with the same letter. 2) Press letter keys that match the rest of the word before + * the timeout duration to match to select the item in question directly. Both of these actions will be + * reset to the beginning of the list if the timeout duration has passed since the last keystroke was + * registered. You can adjust the timeout duration by changing + * [ProjectSettings.gui/timers/incrementalSearchMaxIntervalMsec]. */ @GodotBaseType public open class ItemList : Control() { /** * Triggered when specified item has been selected. - * * [allowReselect] must be enabled to reselect an item. */ public val itemSelected: Signal1 by signal("index") @@ -73,8 +82,8 @@ public open class ItemList : Control() { /** * Triggered when specified list item has been clicked with any mouse button. - * - * The click position is also provided to allow appropriate popup of context menus at the correct location. + * The click position is also provided to allow appropriate popup of context menus at the correct + * location. */ public val itemClicked: Signal3 by signal("index", "atPosition", "mouseButtonIndex") @@ -85,7 +94,8 @@ public open class ItemList : Control() { public val multiSelected: Signal2 by signal("index", "selected") /** - * Triggered when specified list item is activated via double-clicking or by pressing [kbd]Enter[/kbd]. + * Triggered when specified list item is activated via double-clicking or by pressing + * [kbd]Enter[/kbd]. */ public val itemActivated: Signal1 by signal("index") @@ -132,7 +142,7 @@ public open class ItemList : Control() { } /** - * If `true`, allows navigating the [godot.ItemList] with letter keys through incremental search. + * If `true`, allows navigating the [ItemList] with letter keys through incremental search. */ public var allowSearch: Boolean get() { @@ -146,9 +156,10 @@ public open class ItemList : Control() { } /** - * Maximum lines of text allowed in each item. Space will be reserved even when there is not enough lines of text to display. - * - * **Note:** This property takes effect only when [iconMode] is [ICON_MODE_TOP]. To make the text wrap, [fixedColumnWidth] should be greater than zero. + * Maximum lines of text allowed in each item. Space will be reserved even when there is not + * enough lines of text to display. + * **Note:** This property takes effect only when [iconMode] is [constant ICON_MODE_TOP]. To make + * the text wrap, [fixedColumnWidth] should be greater than zero. */ public var maxTextLines: Int get() { @@ -176,7 +187,8 @@ public open class ItemList : Control() { } /** - * Sets the clipping behavior when the text exceeds an item's bounding rectangle. See [enum TextServer.OverrunBehavior] for a description of all modes. + * Sets the clipping behavior when the text exceeds an item's bounding rectangle. See [enum + * TextServer.OverrunBehavior] for a description of all modes. */ public var textOverrunBehavior: TextServer.OverrunBehavior get() { @@ -205,9 +217,7 @@ public open class ItemList : Control() { /** * Maximum columns the list will have. - * * If greater than zero, the content will be split among the specified columns. - * * A value of zero means unlimited columns, i.e. all items will be put in the same row. */ public var maxColumns: Int @@ -223,7 +233,6 @@ public open class ItemList : Control() { /** * Whether all columns will have the same width. - * * If `true`, the width is equal to the largest column width of all columns. */ public var sameColumnWidth: Boolean @@ -239,8 +248,8 @@ public open class ItemList : Control() { /** * The width all columns will be adjusted to. - * - * A value of zero disables the adjustment, each item will have a width equal to the width of its content and the columns will have an uneven width. + * A value of zero disables the adjustment, each item will have a width equal to the width of its + * content and the columns will have an uneven width. */ public var fixedColumnWidth: Int get() { @@ -283,7 +292,6 @@ public open class ItemList : Control() { /** * The size all icons will be adjusted to. - * * If either X or Y component is not greater than zero, icon size won't be affected. */ @CoreTypeLocalCopy @@ -305,7 +313,6 @@ public open class ItemList : Control() { /** * The size all icons will be adjusted to. - * * If either X or Y component is not greater than zero, icon size won't be affected. * * This is a helper function to make dealing with local copies easier. @@ -331,9 +338,7 @@ public open class ItemList : Control() { /** * Adds an item to the item list with specified text. Returns the index of an added item. - * - * Specify an [icon], or use `null` as the [icon] for a list item with no icon. - * + * Specify an [param icon], or use `null` as the [param icon] for a list item with no icon. * If selectable is `true`, the list item will be selectable. */ @JvmOverloads @@ -375,7 +380,7 @@ public open class ItemList : Control() { } /** - * Sets (or replaces) the icon's [godot.Texture2D] associated with the specified index. + * Sets (or replaces) the icon's [Texture2D] associated with the specified index. */ public fun setItemIcon(idx: Int, icon: Texture2D): Unit { TransferContext.writeArguments(LONG to idx.toLong(), OBJECT to icon) @@ -409,7 +414,8 @@ public open class ItemList : Control() { } /** - * Sets language code of item's text used for line-breaking and text shaping algorithms, if left empty current locale is used instead. + * Sets language code of item's text used for line-breaking and text shaping algorithms, if left + * empty current locale is used instead. */ public fun setItemLanguage(idx: Int, language: String): Unit { TransferContext.writeArguments(LONG to idx.toLong(), STRING to language) @@ -460,7 +466,7 @@ public open class ItemList : Control() { } /** - * Sets a modulating [godot.core.Color] of the item associated with the specified index. + * Sets a modulating [Color] of the item associated with the specified index. */ public fun setItemIconModulate(idx: Int, modulate: Color): Unit { TransferContext.writeArguments(LONG to idx.toLong(), COLOR to modulate) @@ -468,7 +474,7 @@ public open class ItemList : Control() { } /** - * Returns a [godot.core.Color] modulating item's icon at the specified index. + * Returns a [Color] modulating item's icon at the specified index. */ public fun getItemIconModulate(idx: Int): Color { TransferContext.writeArguments(LONG to idx.toLong()) @@ -495,8 +501,8 @@ public open class ItemList : Control() { /** * Disables (or enables) the item at the specified index. - * - * Disabled items cannot be selected and do not trigger activation signals (when double-clicking or pressing [kbd]Enter[/kbd]). + * Disabled items cannot be selected and do not trigger activation signals (when double-clicking + * or pressing [kbd]Enter[/kbd]). */ public fun setItemDisabled(idx: Int, disabled: Boolean): Unit { TransferContext.writeArguments(LONG to idx.toLong(), BOOL to disabled) @@ -530,7 +536,7 @@ public open class ItemList : Control() { } /** - * Sets the background color of the item specified by [idx] index to the specified [godot.core.Color]. + * Sets the background color of the item specified by [param idx] index to the specified [Color]. */ public fun setItemCustomBgColor(idx: Int, customBgColor: Color): Unit { TransferContext.writeArguments(LONG to idx.toLong(), COLOR to customBgColor) @@ -538,7 +544,7 @@ public open class ItemList : Control() { } /** - * Returns the custom background color of the item specified by [idx] index. + * Returns the custom background color of the item specified by [param idx] index. */ public fun getItemCustomBgColor(idx: Int): Color { TransferContext.writeArguments(LONG to idx.toLong()) @@ -547,7 +553,7 @@ public open class ItemList : Control() { } /** - * Sets the foreground color of the item specified by [idx] index to the specified [godot.core.Color]. + * Sets the foreground color of the item specified by [param idx] index to the specified [Color]. */ public fun setItemCustomFgColor(idx: Int, customFgColor: Color): Unit { TransferContext.writeArguments(LONG to idx.toLong(), COLOR to customFgColor) @@ -555,7 +561,7 @@ public open class ItemList : Control() { } /** - * Returns the custom foreground color of the item specified by [idx] index. + * Returns the custom foreground color of the item specified by [param idx] index. */ public fun getItemCustomFgColor(idx: Int): Color { TransferContext.writeArguments(LONG to idx.toLong()) @@ -564,9 +570,11 @@ public open class ItemList : Control() { } /** - * Returns the position and size of the item with the specified index, in the coordinate system of the [godot.ItemList] node. If [expand] is `true` the last column expands to fill the rest of the row. - * - * **Note:** The returned value is unreliable if called right after modifying the [godot.ItemList], before it redraws in the next frame. + * Returns the position and size of the item with the specified index, in the coordinate system of + * the [ItemList] node. If [param expand] is `true` the last column expands to fill the rest of the + * row. + * **Note:** The returned value is unreliable if called right after modifying the [ItemList], + * before it redraws in the next frame. */ @JvmOverloads public fun getItemRect(idx: Int, expand: Boolean = true): Rect2 { @@ -611,7 +619,6 @@ public open class ItemList : Control() { /** * Select the item at the specified index. - * * **Note:** This method does not trigger the item selection signal. */ @JvmOverloads @@ -655,7 +662,7 @@ public open class ItemList : Control() { } /** - * Moves item from index [fromIdx] to [toIdx]. + * Moves item from index [param from_idx] to [param to_idx]. */ public fun moveItem(fromIdx: Int, toIdx: Int): Unit { TransferContext.writeArguments(LONG to fromIdx.toLong(), LONG to toIdx.toLong()) @@ -663,7 +670,7 @@ public open class ItemList : Control() { } /** - * Removes the item specified by [idx] index from the list. + * Removes the item specified by [param idx] index from the list. */ public fun removeItem(idx: Int): Unit { TransferContext.writeArguments(LONG to idx.toLong()) @@ -696,11 +703,11 @@ public open class ItemList : Control() { } /** - * Returns the item index at the given [position]. - * - * When there is no item at that point, -1 will be returned if [exact] is `true`, and the closest item index will be returned otherwise. - * - * **Note:** The returned value is unreliable if called right after modifying the [godot.ItemList], before it redraws in the next frame. + * Returns the item index at the given [param position]. + * When there is no item at that point, -1 will be returned if [param exact] is `true`, and the + * closest item index will be returned otherwise. + * **Note:** The returned value is unreliable if called right after modifying the [ItemList], + * before it redraws in the next frame. */ @JvmOverloads public fun getItemAtPosition(position: Vector2, exact: Boolean = false): Int { @@ -719,8 +726,8 @@ public open class ItemList : Control() { /** * Returns the vertical scrollbar. - * - * **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [godot.CanvasItem.visible] property. + * **Warning:** This is a required internal node, removing and freeing it may cause a crash. If + * you wish to hide it or any of its children, use their [CanvasItem.visible] property. */ public fun getVScrollBar(): VScrollBar? { TransferContext.writeArguments() @@ -729,7 +736,9 @@ public open class ItemList : Control() { } /** - * Forces an update to the list size based on its items. This happens automatically whenever size of the items, or other relevant settings like [autoHeight], change. The method can be used to trigger the update ahead of next drawing pass. + * Forces an update to the list size based on its items. This happens automatically whenever size + * of the items, or other relevant settings like [autoHeight], change. The method can be used to + * trigger the update ahead of next drawing pass. */ public fun forceUpdateListSize(): Unit { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/JNISingleton.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/JNISingleton.kt index 80a4787e7..4be117df9 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/JNISingleton.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/JNISingleton.kt @@ -12,12 +12,11 @@ import kotlin.Int import kotlin.Suppress /** - * Singleton that connects the engine with Android plugins to interface with native Android code. - * - * Tutorials: - * [$DOCS_URL/tutorials/platform/android/android_plugin.html#doc-android-plugin]($DOCS_URL/tutorials/platform/android/android_plugin.html#doc-android-plugin) - * - * The JNISingleton is implemented only in the Android export. It's used to call methods and connect signals from an Android plugin written in Java or Kotlin. Methods and signals can be called and connected to the JNISingleton as if it is a Node. See [godot.Java Native Interface - Wikipedia](https://en.wikipedia.org/wiki/Java_Native_Interface) for more information. + * The JNISingleton is implemented only in the Android export. It's used to call methods and connect + * signals from an Android plugin written in Java or Kotlin. Methods and signals can be called and + * connected to the JNISingleton as if it is a Node. See + * [url=https://en.wikipedia.org/wiki/Java_Native_Interface]Java Native Interface - Wikipedia[/url] for + * more information. */ @GodotBaseType public open class JNISingleton : Object() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/JSON.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/JSON.kt index 59b891029..245b0764e 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/JSON.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/JSON.kt @@ -25,49 +25,45 @@ import kotlin.Suppress import kotlin.jvm.JvmOverloads /** - * Helper class for creating and parsing JSON data. - * - * The [JSON] enables all data types to be converted to and from a JSON string. This useful for serializing data to save to a file or send over the network. - * + * The [JSON] enables all data types to be converted to and from a JSON string. This useful for + * serializing data to save to a file or send over the network. * [stringify] is used to convert any data type into a JSON string. - * - * [parse] is used to convert any existing JSON data into a [Variant] that can be used within Godot. If successfully parsed, use [data] to retrieve the [Variant], and use `typeof` to check if the Variant's type is what you expect. JSON Objects are converted into a [godot.core.Dictionary], but JSON data can be used to store [godot.Array]s, numbers, [godot.String]s and even just a boolean. - * + * [parse] is used to convert any existing JSON data into a [Variant] that can be used within Godot. + * If successfully parsed, use [data] to retrieve the [Variant], and use `typeof` to check if the + * Variant's type is what you expect. JSON Objects are converted into a [Dictionary], but JSON data can + * be used to store [Array]s, numbers, [String]s and even just a boolean. * **Example** - * - * ``` - * var data_to_send = ["a", "b", "c"] - * var json_string = JSON.stringify(data_to_send) - * # Save data - * # ... - * # Retrieve data - * var json = JSON.new() - * var error = json.parse(json_string) - * if error == OK: - * var data_received = json.data - * if typeof(data_received) == TYPE_ARRAY: - * print(data_received) # Prints array - * else: - * print("Unexpected data") - * else: - * print("JSON Parse Error: ", json.get_error_message(), " in ", json_string, " at line ", json.get_error_line()) - * ``` - * - * Alternatively, you can parse string using the static [parseString] method, but it doesn't allow to handle errors. - * - * ``` - * var data = JSON.parse_string(json_string) # Returns null if parsing failed. - * ``` - * + * [codeblock] + * var data_to_send = ["a", "b", "c"] + * var json_string = JSON.stringify(data_to_send) + * # Save data + * # ... + * # Retrieve data + * var json = JSON.new() + * var error = json.parse(json_string) + * if error == OK: + * var data_received = json.data + * if typeof(data_received) == TYPE_ARRAY: + * print(data_received) # Prints array + * else: + * print("Unexpected data") + * else: + * print("JSON Parse Error: ", json.get_error_message(), " in ", json_string, " at line ", + * json.get_error_line()) + * [/codeblock] + * Alternatively, you can parse string using the static [parseString] method, but it doesn't allow + * to handle errors. + * [codeblock] + * var data = JSON.parse_string(json_string) # Returns null if parsing failed. + * [/codeblock] * **Note:** Both parse methods do not fully comply with the JSON specification: - * * - Trailing commas in arrays or objects are ignored, instead of causing a parser error. - * - * - New line and tab characters are accepted in string literals, and are treated like their corresponding escape sequences `\n` and `\t`. - * - * - Numbers are parsed using [godot.String.toFloat] which is generally more lax than the JSON specification. - * - * - Certain errors, such as invalid Unicode sequences, do not cause a parser error. Instead, the string is cleansed and an error is logged to the console. + * - New line and tab characters are accepted in string literals, and are treated like their + * corresponding escape sequences `\n` and `\t`. + * - Numbers are parsed using [String.toFloat] which is generally more lax than the JSON + * specification. + * - Certain errors, such as invalid Unicode sequences, do not cause a parser error. Instead, the + * string is cleansed and an error is logged to the console. */ @GodotBaseType public open class JSON : Resource() { @@ -91,13 +87,14 @@ public open class JSON : Resource() { } /** - * Attempts to parse the [jsonText] provided. - * - * Returns an [enum Error]. If the parse was successful, it returns [OK] and the result can be retrieved using [data]. If unsuccessful, use [getErrorLine] and [getErrorMessage] for identifying the source of the failure. - * + * Attempts to parse the [param json_text] provided. + * Returns an [enum Error]. If the parse was successful, it returns [constant OK] and the result + * can be retrieved using [data]. If unsuccessful, use [getErrorLine] and [getErrorMessage] for + * identifying the source of the failure. * Non-static variant of [parseString], if you want custom error handling. - * - * The optional [keepText] argument instructs the parser to keep a copy of the original text. This text can be obtained later by using the [getParsedText] function and is used when saving the resource (instead of generating new text from [data]). + * The optional [param keep_text] argument instructs the parser to keep a copy of the original + * text. This text can be obtained later by using the [getParsedText] function and is used when + * saving the resource (instead of generating new text from [data]). */ @JvmOverloads public fun parse(jsonText: String, keepText: Boolean = false): GodotError { @@ -116,7 +113,8 @@ public open class JSON : Resource() { } /** - * Returns `0` if the last call to [parse] was successful, or the line number where the parse failed. + * Returns `0` if the last call to [parse] was successful, or the line number where the parse + * failed. */ public fun getErrorLine(): Int { TransferContext.writeArguments() @@ -125,7 +123,8 @@ public open class JSON : Resource() { } /** - * Returns an empty string if the last call to [parse] was successful, or the error message if it failed. + * Returns an empty string if the last call to [parse] was successful, or the error message if it + * failed. */ public fun getErrorMessage(): String { TransferContext.writeArguments() @@ -135,52 +134,54 @@ public open class JSON : Resource() { public companion object { /** - * Converts a [Variant] var to JSON text and returns the result. Useful for serializing data to store or send over the network. - * - * **Note:** The JSON specification does not define integer or float types, but only a *number* type. Therefore, converting a Variant to JSON text will convert all numerical values to [float] types. - * - * **Note:** If [fullPrecision] is `true`, when stringifying floats, the unreliable digits are stringified in addition to the reliable digits to guarantee exact decoding. - * - * The [indent] parameter controls if and how something is indented, the string used for this parameter will be used where there should be an indent in the output, even spaces like `" "` will work. `\t` and `\n` can also be used for a tab indent, or to make a newline for each indent respectively. - * + * Converts a [Variant] var to JSON text and returns the result. Useful for serializing data to + * store or send over the network. + * **Note:** The JSON specification does not define integer or float types, but only a *number* + * type. Therefore, converting a Variant to JSON text will convert all numerical values to [float] + * types. + * **Note:** If [param full_precision] is `true`, when stringifying floats, the unreliable + * digits are stringified in addition to the reliable digits to guarantee exact decoding. + * The [param indent] parameter controls if and how something is indented, the string used for + * this parameter will be used where there should be an indent in the output, even spaces like `" + * "` will work. `\t` and `\n` can also be used for a tab indent, or to make a newline for each + * indent respectively. * **Example output:** + * [codeblock] + * ## JSON.stringify(my_dictionary) + * {"name":"my_dictionary","version":"1.0.0","entities":[{"name":"entity_0","value":"value_0"},{"name":"entity_1","value":"value_1"}]} * - * ``` - * ## JSON.stringify(my_dictionary) - * {"name":"my_dictionary","version":"1.0.0","entities":[{"name":"entity_0","value":"value_0"},{"name":"entity_1","value":"value_1"}]} - * - * ## JSON.stringify(my_dictionary, "\t") - * { - * "name": "my_dictionary", - * "version": "1.0.0", - * "entities": [ - * { - * "name": "entity_0", - * "value": "value_0" - * }, - * { - * "name": "entity_1", - * "value": "value_1" - * } - * ] - * } + * ## JSON.stringify(my_dictionary, "\t") + * { + * "name": "my_dictionary", + * "version": "1.0.0", + * "entities": [ + * { + * "name": "entity_0", + * "value": "value_0" + * }, + * { + * "name": "entity_1", + * "value": "value_1" + * } + * ] + * } * - * ## JSON.stringify(my_dictionary, "...") - * { - * ..."name": "my_dictionary", - * ..."version": "1.0.0", - * ..."entities": [ - * ......{ - * ........."name": "entity_0", - * ........."value": "value_0" - * ......}, - * ......{ - * ........."name": "entity_1", - * ........."value": "value_1" - * ......} - * ...] - * } - * ``` + * ## JSON.stringify(my_dictionary, "...") + * { + * ..."name": "my_dictionary", + * ..."version": "1.0.0", + * ..."entities": [ + * ......{ + * ........."name": "entity_0", + * ........."value": "value_0" + * ......}, + * ......{ + * ........."name": "entity_1", + * ........."value": "value_1" + * ......} + * ...] + * } + * [/codeblock] */ @JvmOverloads public fun stringify( @@ -195,7 +196,8 @@ public open class JSON : Resource() { } /** - * Attempts to parse the [jsonString] provided and returns the parsed data. Returns `null` if parse failed. + * Attempts to parse the [param json_string] provided and returns the parsed data. Returns + * `null` if parse failed. */ public fun parseString(jsonString: String): Any? { TransferContext.writeArguments(STRING to jsonString) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/JSONRPC.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/JSONRPC.kt index 972aba903..bbc7b5841 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/JSONRPC.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/JSONRPC.kt @@ -28,9 +28,11 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * A helper to handle dictionaries which look like JSONRPC documents. - * - * [godot.JSON-RPC](https://www.jsonrpc.org/) is a standard which wraps a method call in a [JSON] object. The object has a particular structure and identifies which method is called, the parameters to that function, and carries an ID to keep track of responses. This class implements that standard on top of [godot.core.Dictionary]; you will have to convert between a [godot.core.Dictionary] and [JSON] with other functions. + * [url=https://www.jsonrpc.org/]JSON-RPC[/url] is a standard which wraps a method call in a [JSON] + * object. The object has a particular structure and identifies which method is called, the parameters + * to that function, and carries an ID to keep track of responses. This class implements that standard + * on top of [Dictionary]; you will have to convert between a [Dictionary] and [JSON] with other + * functions. */ @GodotBaseType public open class JSONRPC : Object() { @@ -39,20 +41,19 @@ public open class JSONRPC : Object() { return true } - /** - * - */ public fun setScope(scope: String, target: Object): Unit { TransferContext.writeArguments(STRING to scope, OBJECT to target) TransferContext.callMethod(rawPtr, MethodBindings.setScopePtr, NIL) } /** - * Given a Dictionary which takes the form of a JSON-RPC request: unpack the request and run it. Methods are resolved by looking at the field called "method" and looking for an equivalently named function in the JSONRPC object. If one is found that method is called. - * - * To add new supported methods extend the JSONRPC class and call [processAction] on your subclass. - * - * [action]: The action to be run, as a Dictionary in the form of a JSON-RPC request or notification. + * Given a Dictionary which takes the form of a JSON-RPC request: unpack the request and run it. + * Methods are resolved by looking at the field called "method" and looking for an equivalently named + * function in the JSONRPC object. If one is found that method is called. + * To add new supported methods extend the JSONRPC class and call [processAction] on your + * subclass. + * [param action]: The action to be run, as a Dictionary in the form of a JSON-RPC request or + * notification. */ @JvmOverloads public fun processAction(action: Any?, recurse: Boolean = false): Any? { @@ -61,9 +62,6 @@ public open class JSONRPC : Object() { return (TransferContext.readReturnValue(ANY, true) as Any?) } - /** - * - */ public fun processString(action: String): String { TransferContext.writeArguments(STRING to action) TransferContext.callMethod(rawPtr, MethodBindings.processStringPtr, STRING) @@ -71,13 +69,13 @@ public open class JSONRPC : Object() { } /** - * Returns a dictionary in the form of a JSON-RPC request. Requests are sent to a server with the expectation of a response. The ID field is used for the server to specify which exact request it is responding to. - * - * - [method]: Name of the method being called. - * - * - [params]: An array or dictionary of parameters being passed to the method. - * - * - [id]: Uniquely identifies this request. The server is expected to send a response with the same ID. + * Returns a dictionary in the form of a JSON-RPC request. Requests are sent to a server with the + * expectation of a response. The ID field is used for the server to specify which exact request it + * is responding to. + * - [param method]: Name of the method being called. + * - [param params]: An array or dictionary of parameters being passed to the method. + * - [param id]: Uniquely identifies this request. The server is expected to send a response with + * the same ID. */ public fun makeRequest( method: String, @@ -90,11 +88,10 @@ public open class JSONRPC : Object() { } /** - * When a server has received and processed a request, it is expected to send a response. If you did not want a response then you need to have sent a Notification instead. - * - * - [result]: The return value of the function which was called. - * - * - [id]: The ID of the request this response is targeted to. + * When a server has received and processed a request, it is expected to send a response. If you + * did not want a response then you need to have sent a Notification instead. + * - [param result]: The return value of the function which was called. + * - [param id]: The ID of the request this response is targeted to. */ public fun makeResponse(result: Any?, id: Any?): Dictionary { TransferContext.writeArguments(ANY to result, ANY to id) @@ -103,11 +100,10 @@ public open class JSONRPC : Object() { } /** - * Returns a dictionary in the form of a JSON-RPC notification. Notifications are one-shot messages which do not expect a response. - * - * - [method]: Name of the method being called. - * - * - [params]: An array or dictionary of parameters being passed to the method. + * Returns a dictionary in the form of a JSON-RPC notification. Notifications are one-shot + * messages which do not expect a response. + * - [param method]: Name of the method being called. + * - [param params]: An array or dictionary of parameters being passed to the method. */ public fun makeNotification(method: String, params: Any?): Dictionary { TransferContext.writeArguments(STRING to method, ANY to params) @@ -117,12 +113,10 @@ public open class JSONRPC : Object() { /** * Creates a response which indicates a previous reply has failed in some way. - * - * - [code]: The error code corresponding to what kind of error this is. See the [enum ErrorCode] constants. - * - * - [message]: A custom message about this error. - * - * - [id]: The request this error is a response to. + * - [param code]: The error code corresponding to what kind of error this is. See the [enum + * ErrorCode] constants. + * - [param message]: A custom message about this error. + * - [param id]: The request this error is a response to. */ @JvmOverloads public fun makeResponseError( @@ -138,25 +132,13 @@ public open class JSONRPC : Object() { public enum class ErrorCode( id: Long, ) { - /** - * - */ PARSE_ERROR(-32700), - /** - * - */ INVALID_REQUEST(-32600), /** * A method call was requested but no function of that name existed in the JSONRPC subclass. */ METHOD_NOT_FOUND(-32601), - /** - * - */ INVALID_PARAMS(-32602), - /** - * - */ INTERNAL_ERROR(-32603), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/JavaClass.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/JavaClass.kt index 4cbe6149e..52719eab2 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/JavaClass.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/JavaClass.kt @@ -11,9 +11,6 @@ import kotlin.Boolean import kotlin.Int import kotlin.Suppress -/** - * - */ @GodotBaseType public open class JavaClass : RefCounted() { public override fun new(scriptIndex: Int): Boolean { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/JavaClassWrapper.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/JavaClassWrapper.kt index 23d208cd3..449e1db82 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/JavaClassWrapper.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/JavaClassWrapper.kt @@ -17,9 +17,6 @@ import kotlin.Int import kotlin.String import kotlin.Suppress -/** - * - */ @GodotBaseType public object JavaClassWrapper : Object() { public override fun new(scriptIndex: Int): Boolean { @@ -27,9 +24,6 @@ public object JavaClassWrapper : Object() { return false } - /** - * - */ public fun wrap(name: String): JavaClass? { TransferContext.writeArguments(STRING to name) TransferContext.callMethod(rawPtr, MethodBindings.wrapPtr, OBJECT) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/JavaScriptBridge.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/JavaScriptBridge.kt index dcf71e4b0..0f22bb2e7 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/JavaScriptBridge.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/JavaScriptBridge.kt @@ -33,19 +33,21 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * Singleton that connects the engine with the browser's JavaScript context in Web export. - * - * Tutorials: - * [$DOCS_URL/tutorials/export/exporting_for_web.html#calling-javascript-from-script]($DOCS_URL/tutorials/export/exporting_for_web.html#calling-javascript-from-script) - * - * The JavaScriptBridge singleton is implemented only in the Web export. It's used to access the browser's JavaScript context. This allows interaction with embedding pages or calling third-party JavaScript APIs. - * - * **Note:** This singleton can be disabled at build-time to improve security. By default, the JavaScriptBridge singleton is enabled. Official export templates also have the JavaScriptBridge singleton enabled. See [godot.Compiling for the Web]($DOCS_URL/contributing/development/compiling/compiling_for_web.html) in the documentation for more information. + * The JavaScriptBridge singleton is implemented only in the Web export. It's used to access the + * browser's JavaScript context. This allows interaction with embedding pages or calling third-party + * JavaScript APIs. + * **Note:** This singleton can be disabled at build-time to improve security. By default, the + * JavaScriptBridge singleton is enabled. Official export templates also have the JavaScriptBridge + * singleton enabled. See + * [url=$DOCS_URL/contributing/development/compiling/compiling_for_web.html]Compiling for the Web[/url] + * in the documentation for more information. */ @GodotBaseType public object JavaScriptBridge : Object() { /** - * Emitted when an update for this progressive web app has been detected but is waiting to be activated because a previous version is active. See [pwaUpdate] to force the update to take place immediately. + * Emitted when an update for this progressive web app has been detected but is waiting to be + * activated because a previous version is active. See [pwaUpdate] to force the update to take place + * immediately. */ public val pwaUpdateAvailable: Signal0 by signal() @@ -55,9 +57,11 @@ public object JavaScriptBridge : Object() { } /** - * Execute the string [code] as JavaScript code within the browser window. This is a call to the actual global JavaScript function [code skip-lint]eval()`. - * - * If [useGlobalExecutionContext] is `true`, the code will be evaluated in the global execution context. Otherwise, it is evaluated in the execution context of a function within the engine's runtime environment. + * Execute the string [param code] as JavaScript code within the browser window. This is a call to + * the actual global JavaScript function [code skip-lint]eval()[/code]. + * If [param use_global_execution_context] is `true`, the code will be evaluated in the global + * execution context. Otherwise, it is evaluated in the execution context of a function within the + * engine's runtime environment. */ @JvmOverloads public fun eval(code: String, useGlobalExecutionContext: Boolean = false): Any? { @@ -67,7 +71,9 @@ public object JavaScriptBridge : Object() { } /** - * Returns an interface to a JavaScript object that can be used by scripts. The [interface] must be a valid property of the JavaScript `window`. The callback must accept a single [godot.Array] argument, which will contain the JavaScript `arguments`. See [godot.JavaScriptObject] for usage. + * Returns an interface to a JavaScript object that can be used by scripts. The [param interface] + * must be a valid property of the JavaScript `window`. The callback must accept a single [Array] + * argument, which will contain the JavaScript `arguments`. See [JavaScriptObject] for usage. */ public fun getInterface(_interface: String): JavaScriptObject? { TransferContext.writeArguments(STRING to _interface) @@ -76,7 +82,9 @@ public object JavaScriptBridge : Object() { } /** - * Creates a reference to a [godot.Callable] that can be used as a callback by JavaScript. The reference must be kept until the callback happens, or it won't be called at all. See [godot.JavaScriptObject] for usage. + * Creates a reference to a [Callable] that can be used as a callback by JavaScript. The reference + * must be kept until the callback happens, or it won't be called at all. See [JavaScriptObject] for + * usage. */ public fun createCallback(callable: Callable): JavaScriptObject? { TransferContext.writeArguments(CALLABLE to callable) @@ -85,7 +93,8 @@ public object JavaScriptBridge : Object() { } /** - * Creates a new JavaScript object using the `new` constructor. The [object] must a valid property of the JavaScript `window`. See [godot.JavaScriptObject] for usage. + * Creates a new JavaScript object using the `new` constructor. The [param object] must a valid + * property of the JavaScript `window`. See [JavaScriptObject] for usage. */ public fun createObject(_object: String, vararg __var_args: Any?): Any? { TransferContext.writeArguments(STRING to _object, *__var_args.map { ANY to it }.toTypedArray()) @@ -94,13 +103,14 @@ public object JavaScriptBridge : Object() { } /** - * Prompts the user to download a file containing the specified [buffer]. The file will have the given [name] and [mime] type. - * - * **Note:** The browser may override the [godot.MIME type](https://en.wikipedia.org/wiki/Media_type) provided based on the file [name]'s extension. - * - * **Note:** Browsers might block the download if [downloadBuffer] is not being called from a user interaction (e.g. button click). - * - * **Note:** Browsers might ask the user for permission or block the download if multiple download requests are made in a quick succession. + * Prompts the user to download a file containing the specified [param buffer]. The file will have + * the given [param name] and [param mime] type. + * **Note:** The browser may override the [url=https://en.wikipedia.org/wiki/Media_type]MIME + * type[/url] provided based on the file [param name]'s extension. + * **Note:** Browsers might block the download if [downloadBuffer] is not being called from a user + * interaction (e.g. button click). + * **Note:** Browsers might ask the user for permission or block the download if multiple download + * requests are made in a quick succession. */ @JvmOverloads public fun downloadBuffer( @@ -114,7 +124,6 @@ public object JavaScriptBridge : Object() { /** * Returns `true` if a new version of the progressive web app is waiting to be activated. - * * **Note:** Only relevant when exported as a Progressive Web App. */ public fun pwaNeedsUpdate(): Boolean { @@ -124,11 +133,11 @@ public object JavaScriptBridge : Object() { } /** - * Performs the live update of the progressive web app. Forcing the new version to be installed and the page to be reloaded. - * + * Performs the live update of the progressive web app. Forcing the new version to be installed + * and the page to be reloaded. * **Note:** Your application will be **reloaded in all browser tabs**. - * - * **Note:** Only relevant when exported as a Progressive Web App and [pwaNeedsUpdate] returns `true`. + * **Note:** Only relevant when exported as a Progressive Web App and [pwaNeedsUpdate] returns + * `true`. */ public fun pwaUpdate(): GodotError { TransferContext.writeArguments() @@ -138,8 +147,8 @@ public object JavaScriptBridge : Object() { /** * Force synchronization of the persistent file system (when enabled). - * - * **Note:** This is only useful for modules or extensions that can't use [godot.FileAccess] to write files. + * **Note:** This is only useful for modules or extensions that can't use [FileAccess] to write + * files. */ public fun forceFsSync(): Unit { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/JavaScriptObject.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/JavaScriptObject.kt index 67238040a..ff9f3e796 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/JavaScriptObject.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/JavaScriptObject.kt @@ -12,38 +12,36 @@ import kotlin.Int import kotlin.Suppress /** - * A wrapper class for web native JavaScript objects. - * - * JavaScriptObject is used to interact with JavaScript objects retrieved or created via [godot.JavaScriptBridge.getInterface], [godot.JavaScriptBridge.createObject], or [godot.JavaScriptBridge.createCallback]. - * + * JavaScriptObject is used to interact with JavaScript objects retrieved or created via + * [JavaScriptBridge.getInterface], [JavaScriptBridge.createObject], or + * [JavaScriptBridge.createCallback]. * **Example:** - * - * ``` - * extends Node - * - * var _my_js_callback = JavaScriptBridge.create_callback(myCallback) # This reference must be kept - * var console = JavaScriptBridge.get_interface("console") - * - * func _init(): - * var buf = JavaScriptBridge.create_object("ArrayBuffer", 10) # new ArrayBuffer(10) - * print(buf) # prints [godot.JavaScriptObject:OBJECT_ID] - * var uint8arr = JavaScriptBridge.create_object("Uint8Array", buf) # new Uint8Array(buf) - * uint8arr[1] = 255 - * prints(uint8arr[1], uint8arr.byteLength) # prints 255 10 - * console.log(uint8arr) # prints in browser console "Uint8Array(10) [ 0, 255, 0, 0, 0, 0, 0, 0, 0, 0 ]" - * - * # Equivalent of JavaScriptBridge: Array.from(uint8arr).forEach(myCallback) - * JavaScriptBridge.get_interface("Array").from(uint8arr).forEach(_my_js_callback) - * - * func myCallback(args): - * # Will be called with the parameters passed to the "forEach" callback - * # [0, 0, [godot.JavaScriptObject:1173]] - * # [255, 1, [godot.JavaScriptObject:1173]] - * # ... - * # [0, 9, [godot.JavaScriptObject:1180]] - * print(args) - * ``` - * + * [codeblock] + * extends Node + * + * var _my_js_callback = JavaScriptBridge.create_callback(myCallback) # This reference must be kept + * var console = JavaScriptBridge.get_interface("console") + * + * func _init(): + * var buf = JavaScriptBridge.create_object("ArrayBuffer", 10) # new ArrayBuffer(10) + * print(buf) # prints [JavaScriptObject:OBJECT_ID] + * var uint8arr = JavaScriptBridge.create_object("Uint8Array", buf) # new Uint8Array(buf) + * uint8arr[1] = 255 + * prints(uint8arr[1], uint8arr.byteLength) # prints 255 10 + * console.log(uint8arr) # prints in browser console "Uint8Array(10) [ 0, 255, 0, 0, 0, 0, 0, 0, + * 0, 0 ]" + * + * # Equivalent of JavaScriptBridge: Array.from(uint8arr).forEach(myCallback) + * JavaScriptBridge.get_interface("Array").from(uint8arr).forEach(_my_js_callback) + * + * func myCallback(args): + * # Will be called with the parameters passed to the "forEach" callback + * # [0, 0, [JavaScriptObject:1173]] + * # [255, 1, [JavaScriptObject:1173]] + * # ... + * # [0, 9, [JavaScriptObject:1180]] + * print(args) + * [/codeblock] * **Note:** Only available in the Web platform. */ @GodotBaseType diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Joint2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Joint2D.kt index d89336bb6..e12d9042d 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Joint2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Joint2D.kt @@ -24,14 +24,13 @@ import kotlin.Int import kotlin.Suppress /** - * Abstract base class for all 2D physics joints. - * - * Abstract base class for all joints in 2D physics. 2D joints bind together two physics bodies and apply a constraint. + * Abstract base class for all joints in 2D physics. 2D joints bind together two physics bodies and + * apply a constraint. */ @GodotBaseType public open class Joint2D internal constructor() : Node2D() { /** - * The first body attached to the joint. Must derive from [godot.PhysicsBody2D]. + * The first body attached to the joint. Must derive from [PhysicsBody2D]. */ public var nodeA: NodePath get() { @@ -45,7 +44,7 @@ public open class Joint2D internal constructor() : Node2D() { } /** - * The second body attached to the joint. Must derive from [godot.PhysicsBody2D]. + * The second body attached to the joint. Must derive from [PhysicsBody2D]. */ public var nodeB: NodePath get() { @@ -59,9 +58,11 @@ public open class Joint2D internal constructor() : Node2D() { } /** - * When [nodeA] and [nodeB] move in different directions the [bias] controls how fast the joint pulls them back to their original position. The lower the [bias] the more the two bodies can pull on the joint. - * - * When set to `0`, the default value from [godot.ProjectSettings.physics/2d/solver/defaultConstraintBias] is used. + * When [nodeA] and [nodeB] move in different directions the [bias] controls how fast the joint + * pulls them back to their original position. The lower the [bias] the more the two bodies can pull + * on the joint. + * When set to `0`, the default value from + * [ProjectSettings.physics/2d/solver/defaultConstraintBias] is used. */ public var bias: Float get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Joint3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Joint3D.kt index f89910b48..cf5323728 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Joint3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Joint3D.kt @@ -23,12 +23,8 @@ import kotlin.Long import kotlin.Suppress /** - * Abstract base class for all 3D physics joints. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/524](https://godotengine.org/asset-library/asset/524) - * - * Abstract base class for all joints in 3D physics. 3D joints bind together two physics bodies and apply a constraint. + * Abstract base class for all joints in 3D physics. 3D joints bind together two physics bodies and + * apply a constraint. */ @GodotBaseType public open class Joint3D internal constructor() : Node3D() { @@ -61,7 +57,8 @@ public open class Joint3D internal constructor() : Node3D() { } /** - * The priority used to define which solver is executed first for multiple joints. The lower the value, the higher the priority. + * The priority used to define which solver is executed first for multiple joints. The lower the + * value, the higher the priority. */ public var solverPriority: Int get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/JoyAxis.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/JoyAxis.kt index e90c24e03..be8f7dbb2 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/JoyAxis.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/JoyAxis.kt @@ -6,14 +6,42 @@ import kotlin.Long public enum class JoyAxis( id: Long, ) { + /** + * An invalid game controller axis. + */ JOY_AXIS_INVALID(-1), + /** + * Game controller left joystick x-axis. + */ JOY_AXIS_LEFT_X(0), + /** + * Game controller left joystick y-axis. + */ JOY_AXIS_LEFT_Y(1), + /** + * Game controller right joystick x-axis. + */ JOY_AXIS_RIGHT_X(2), + /** + * Game controller right joystick y-axis. + */ JOY_AXIS_RIGHT_Y(3), + /** + * Game controller left trigger axis. + */ JOY_AXIS_TRIGGER_LEFT(4), + /** + * Game controller right trigger axis. + */ JOY_AXIS_TRIGGER_RIGHT(5), + /** + * The number of SDL game controller axes. + */ JOY_AXIS_SDL_MAX(6), + /** + * The maximum number of game controller axes: OpenVR supports up to 5 Joysticks making a total of + * 10 axes. + */ JOY_AXIS_MAX(10), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/JoyButton.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/JoyButton.kt index 544fa5106..1c013769e 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/JoyButton.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/JoyButton.kt @@ -6,29 +6,111 @@ import kotlin.Long public enum class JoyButton( id: Long, ) { + /** + * An invalid game controller button. + */ JOY_BUTTON_INVALID(-1), + /** + * Game controller SDL button A. Corresponds to the bottom action button: Sony Cross, Xbox A, + * Nintendo B. + */ JOY_BUTTON_A(0), + /** + * Game controller SDL button B. Corresponds to the right action button: Sony Circle, Xbox B, + * Nintendo A. + */ JOY_BUTTON_B(1), + /** + * Game controller SDL button X. Corresponds to the left action button: Sony Square, Xbox X, + * Nintendo Y. + */ JOY_BUTTON_X(2), + /** + * Game controller SDL button Y. Corresponds to the top action button: Sony Triangle, Xbox Y, + * Nintendo X. + */ JOY_BUTTON_Y(3), + /** + * Game controller SDL back button. Corresponds to the Sony Select, Xbox Back, Nintendo - button. + */ JOY_BUTTON_BACK(4), + /** + * Game controller SDL guide button. Corresponds to the Sony PS, Xbox Home button. + */ JOY_BUTTON_GUIDE(5), + /** + * Game controller SDL start button. Corresponds to the Sony Options, Xbox Menu, Nintendo + + * button. + */ JOY_BUTTON_START(6), + /** + * Game controller SDL left stick button. Corresponds to the Sony L3, Xbox L/LS button. + */ JOY_BUTTON_LEFT_STICK(7), + /** + * Game controller SDL right stick button. Corresponds to the Sony R3, Xbox R/RS button. + */ JOY_BUTTON_RIGHT_STICK(8), + /** + * Game controller SDL left shoulder button. Corresponds to the Sony L1, Xbox LB button. + */ JOY_BUTTON_LEFT_SHOULDER(9), + /** + * Game controller SDL right shoulder button. Corresponds to the Sony R1, Xbox RB button. + */ JOY_BUTTON_RIGHT_SHOULDER(10), + /** + * Game controller D-pad up button. + */ JOY_BUTTON_DPAD_UP(11), + /** + * Game controller D-pad down button. + */ JOY_BUTTON_DPAD_DOWN(12), + /** + * Game controller D-pad left button. + */ JOY_BUTTON_DPAD_LEFT(13), + /** + * Game controller D-pad right button. + */ JOY_BUTTON_DPAD_RIGHT(14), + /** + * Game controller SDL miscellaneous button. Corresponds to Xbox share button, PS5 microphone + * button, Nintendo Switch capture button. + */ JOY_BUTTON_MISC1(15), + /** + * Game controller SDL paddle 1 button. + */ JOY_BUTTON_PADDLE1(16), + /** + * Game controller SDL paddle 2 button. + */ JOY_BUTTON_PADDLE2(17), + /** + * Game controller SDL paddle 3 button. + */ JOY_BUTTON_PADDLE3(18), + /** + * Game controller SDL paddle 4 button. + */ JOY_BUTTON_PADDLE4(19), + /** + * Game controller SDL touchpad button. + */ JOY_BUTTON_TOUCHPAD(20), + /** + * The number of SDL game controller buttons. + */ JOY_BUTTON_SDL_MAX(21), + /** + * The maximum number of game controller buttons supported by the engine. The actual limit may be + * lower on specific platforms: + * - **Android:** Up to 36 buttons. + * - **Linux:** Up to 80 buttons. + * - **Windows** and **macOS:** Up to 128 buttons. + */ JOY_BUTTON_MAX(128), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Key.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Key.kt index 5188eb39b..0f5073e52 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Key.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Key.kt @@ -6,198 +6,778 @@ import kotlin.Long public enum class Key( id: Long, ) { + /** + * Enum value which doesn't correspond to any key. This is used to initialize [enum Key] + * properties with a generic state. + */ KEY_NONE(0), + /** + * Keycodes with this bit applied are non-printable. + */ KEY_SPECIAL(4194304), + /** + * Escape key. + */ KEY_ESCAPE(4194305), + /** + * Tab key. + */ KEY_TAB(4194306), + /** + * Shift + Tab key. + */ KEY_BACKTAB(4194307), + /** + * Backspace key. + */ KEY_BACKSPACE(4194308), + /** + * Return key (on the main keyboard). + */ KEY_ENTER(4194309), + /** + * Enter key on the numeric keypad. + */ KEY_KP_ENTER(4194310), + /** + * Insert key. + */ KEY_INSERT(4194311), + /** + * Delete key. + */ KEY_DELETE(4194312), + /** + * Pause key. + */ KEY_PAUSE(4194313), + /** + * Print Screen key. + */ KEY_PRINT(4194314), + /** + * System Request key. + */ KEY_SYSREQ(4194315), + /** + * Clear key. + */ KEY_CLEAR(4194316), + /** + * Home key. + */ KEY_HOME(4194317), + /** + * End key. + */ KEY_END(4194318), + /** + * Left arrow key. + */ KEY_LEFT(4194319), + /** + * Up arrow key. + */ KEY_UP(4194320), + /** + * Right arrow key. + */ KEY_RIGHT(4194321), + /** + * Down arrow key. + */ KEY_DOWN(4194322), + /** + * Page Up key. + */ KEY_PAGEUP(4194323), + /** + * Page Down key. + */ KEY_PAGEDOWN(4194324), + /** + * Shift key. + */ KEY_SHIFT(4194325), + /** + * Control key. + */ KEY_CTRL(4194326), + /** + * Meta key. + */ KEY_META(4194327), + /** + * Alt key. + */ KEY_ALT(4194328), + /** + * Caps Lock key. + */ KEY_CAPSLOCK(4194329), + /** + * Num Lock key. + */ KEY_NUMLOCK(4194330), + /** + * Scroll Lock key. + */ KEY_SCROLLLOCK(4194331), + /** + * F1 key. + */ KEY_F1(4194332), + /** + * F2 key. + */ KEY_F2(4194333), + /** + * F3 key. + */ KEY_F3(4194334), + /** + * F4 key. + */ KEY_F4(4194335), + /** + * F5 key. + */ KEY_F5(4194336), + /** + * F6 key. + */ KEY_F6(4194337), + /** + * F7 key. + */ KEY_F7(4194338), + /** + * F8 key. + */ KEY_F8(4194339), + /** + * F9 key. + */ KEY_F9(4194340), + /** + * F10 key. + */ KEY_F10(4194341), + /** + * F11 key. + */ KEY_F11(4194342), + /** + * F12 key. + */ KEY_F12(4194343), + /** + * F13 key. + */ KEY_F13(4194344), + /** + * F14 key. + */ KEY_F14(4194345), + /** + * F15 key. + */ KEY_F15(4194346), + /** + * F16 key. + */ KEY_F16(4194347), + /** + * F17 key. + */ KEY_F17(4194348), + /** + * F18 key. + */ KEY_F18(4194349), + /** + * F19 key. + */ KEY_F19(4194350), + /** + * F20 key. + */ KEY_F20(4194351), + /** + * F21 key. + */ KEY_F21(4194352), + /** + * F22 key. + */ KEY_F22(4194353), + /** + * F23 key. + */ KEY_F23(4194354), + /** + * F24 key. + */ KEY_F24(4194355), + /** + * F25 key. Only supported on macOS and Linux due to a Windows limitation. + */ KEY_F25(4194356), + /** + * F26 key. Only supported on macOS and Linux due to a Windows limitation. + */ KEY_F26(4194357), + /** + * F27 key. Only supported on macOS and Linux due to a Windows limitation. + */ KEY_F27(4194358), + /** + * F28 key. Only supported on macOS and Linux due to a Windows limitation. + */ KEY_F28(4194359), + /** + * F29 key. Only supported on macOS and Linux due to a Windows limitation. + */ KEY_F29(4194360), + /** + * F30 key. Only supported on macOS and Linux due to a Windows limitation. + */ KEY_F30(4194361), + /** + * F31 key. Only supported on macOS and Linux due to a Windows limitation. + */ KEY_F31(4194362), + /** + * F32 key. Only supported on macOS and Linux due to a Windows limitation. + */ KEY_F32(4194363), + /** + * F33 key. Only supported on macOS and Linux due to a Windows limitation. + */ KEY_F33(4194364), + /** + * F34 key. Only supported on macOS and Linux due to a Windows limitation. + */ KEY_F34(4194365), + /** + * F35 key. Only supported on macOS and Linux due to a Windows limitation. + */ KEY_F35(4194366), + /** + * Multiply (*) key on the numeric keypad. + */ KEY_KP_MULTIPLY(4194433), + /** + * Divide (/) key on the numeric keypad. + */ KEY_KP_DIVIDE(4194434), + /** + * Subtract (-) key on the numeric keypad. + */ KEY_KP_SUBTRACT(4194435), + /** + * Period (.) key on the numeric keypad. + */ KEY_KP_PERIOD(4194436), + /** + * Add (+) key on the numeric keypad. + */ KEY_KP_ADD(4194437), + /** + * Number 0 on the numeric keypad. + */ KEY_KP_0(4194438), + /** + * Number 1 on the numeric keypad. + */ KEY_KP_1(4194439), + /** + * Number 2 on the numeric keypad. + */ KEY_KP_2(4194440), + /** + * Number 3 on the numeric keypad. + */ KEY_KP_3(4194441), + /** + * Number 4 on the numeric keypad. + */ KEY_KP_4(4194442), + /** + * Number 5 on the numeric keypad. + */ KEY_KP_5(4194443), + /** + * Number 6 on the numeric keypad. + */ KEY_KP_6(4194444), + /** + * Number 7 on the numeric keypad. + */ KEY_KP_7(4194445), + /** + * Number 8 on the numeric keypad. + */ KEY_KP_8(4194446), + /** + * Number 9 on the numeric keypad. + */ KEY_KP_9(4194447), + /** + * Context menu key. + */ KEY_MENU(4194370), + /** + * Hyper key. (On Linux/X11 only). + */ KEY_HYPER(4194371), + /** + * Help key. + */ KEY_HELP(4194373), + /** + * Media back key. Not to be confused with the Back button on an Android device. + */ KEY_BACK(4194376), + /** + * Media forward key. + */ KEY_FORWARD(4194377), + /** + * Media stop key. + */ KEY_STOP(4194378), + /** + * Media refresh key. + */ KEY_REFRESH(4194379), + /** + * Volume down key. + */ KEY_VOLUMEDOWN(4194380), + /** + * Mute volume key. + */ KEY_VOLUMEMUTE(4194381), + /** + * Volume up key. + */ KEY_VOLUMEUP(4194382), + /** + * Media play key. + */ KEY_MEDIAPLAY(4194388), + /** + * Media stop key. + */ KEY_MEDIASTOP(4194389), + /** + * Previous song key. + */ KEY_MEDIAPREVIOUS(4194390), + /** + * Next song key. + */ KEY_MEDIANEXT(4194391), + /** + * Media record key. + */ KEY_MEDIARECORD(4194392), + /** + * Home page key. + */ KEY_HOMEPAGE(4194393), + /** + * Favorites key. + */ KEY_FAVORITES(4194394), + /** + * Search key. + */ KEY_SEARCH(4194395), + /** + * Standby key. + */ KEY_STANDBY(4194396), + /** + * Open URL / Launch Browser key. + */ KEY_OPENURL(4194397), + /** + * Launch Mail key. + */ KEY_LAUNCHMAIL(4194398), + /** + * Launch Media key. + */ KEY_LAUNCHMEDIA(4194399), + /** + * Launch Shortcut 0 key. + */ KEY_LAUNCH0(4194400), + /** + * Launch Shortcut 1 key. + */ KEY_LAUNCH1(4194401), + /** + * Launch Shortcut 2 key. + */ KEY_LAUNCH2(4194402), + /** + * Launch Shortcut 3 key. + */ KEY_LAUNCH3(4194403), + /** + * Launch Shortcut 4 key. + */ KEY_LAUNCH4(4194404), + /** + * Launch Shortcut 5 key. + */ KEY_LAUNCH5(4194405), + /** + * Launch Shortcut 6 key. + */ KEY_LAUNCH6(4194406), + /** + * Launch Shortcut 7 key. + */ KEY_LAUNCH7(4194407), + /** + * Launch Shortcut 8 key. + */ KEY_LAUNCH8(4194408), + /** + * Launch Shortcut 9 key. + */ KEY_LAUNCH9(4194409), + /** + * Launch Shortcut A key. + */ KEY_LAUNCHA(4194410), + /** + * Launch Shortcut B key. + */ KEY_LAUNCHB(4194411), + /** + * Launch Shortcut C key. + */ KEY_LAUNCHC(4194412), + /** + * Launch Shortcut D key. + */ KEY_LAUNCHD(4194413), + /** + * Launch Shortcut E key. + */ KEY_LAUNCHE(4194414), + /** + * Launch Shortcut F key. + */ KEY_LAUNCHF(4194415), + /** + * "Globe" key on Mac / iPad keyboard. + */ KEY_GLOBE(4194416), + /** + * "On-screen keyboard" key on iPad keyboard. + */ KEY_KEYBOARD(4194417), + /** + * 英数 key on Mac keyboard. + */ KEY_JIS_EISU(4194418), + /** + * かな key on Mac keyboard. + */ KEY_JIS_KANA(4194419), + /** + * Unknown key. + */ KEY_UNKNOWN(8388607), + /** + * Space key. + */ KEY_SPACE(32), + /** + * ! key. + */ KEY_EXCLAM(33), + /** + * " key. + */ KEY_QUOTEDBL(34), + /** + * # key. + */ KEY_NUMBERSIGN(35), + /** + * $ key. + */ KEY_DOLLAR(36), + /** + * % key. + */ KEY_PERCENT(37), + /** + * & key. + */ KEY_AMPERSAND(38), + /** + * ' key. + */ KEY_APOSTROPHE(39), + /** + * ( key. + */ KEY_PARENLEFT(40), + /** + * ) key. + */ KEY_PARENRIGHT(41), + /** + * * key. + */ KEY_ASTERISK(42), + /** + * + key. + */ KEY_PLUS(43), + /** + * , key. + */ KEY_COMMA(44), + /** + * - key. + */ KEY_MINUS(45), + /** + * . key. + */ KEY_PERIOD(46), + /** + * / key. + */ KEY_SLASH(47), + /** + * Number 0 key. + */ KEY_0(48), + /** + * Number 1 key. + */ KEY_1(49), + /** + * Number 2 key. + */ KEY_2(50), + /** + * Number 3 key. + */ KEY_3(51), + /** + * Number 4 key. + */ KEY_4(52), + /** + * Number 5 key. + */ KEY_5(53), + /** + * Number 6 key. + */ KEY_6(54), + /** + * Number 7 key. + */ KEY_7(55), + /** + * Number 8 key. + */ KEY_8(56), + /** + * Number 9 key. + */ KEY_9(57), + /** + * : key. + */ KEY_COLON(58), + /** + * ; key. + */ KEY_SEMICOLON(59), + /** + * < key. + */ KEY_LESS(60), + /** + * = key. + */ KEY_EQUAL(61), + /** + * > key. + */ KEY_GREATER(62), + /** + * ? key. + */ KEY_QUESTION(63), + /** + * @ key. + */ KEY_AT(64), + /** + * A key. + */ KEY_A(65), + /** + * B key. + */ KEY_B(66), + /** + * C key. + */ KEY_C(67), + /** + * D key. + */ KEY_D(68), + /** + * E key. + */ KEY_E(69), + /** + * F key. + */ KEY_F(70), + /** + * G key. + */ KEY_G(71), + /** + * H key. + */ KEY_H(72), + /** + * I key. + */ KEY_I(73), + /** + * J key. + */ KEY_J(74), + /** + * K key. + */ KEY_K(75), + /** + * L key. + */ KEY_L(76), + /** + * M key. + */ KEY_M(77), + /** + * N key. + */ KEY_N(78), + /** + * O key. + */ KEY_O(79), + /** + * P key. + */ KEY_P(80), + /** + * Q key. + */ KEY_Q(81), + /** + * R key. + */ KEY_R(82), + /** + * S key. + */ KEY_S(83), + /** + * T key. + */ KEY_T(84), + /** + * U key. + */ KEY_U(85), + /** + * V key. + */ KEY_V(86), + /** + * W key. + */ KEY_W(87), + /** + * X key. + */ KEY_X(88), + /** + * Y key. + */ KEY_Y(89), + /** + * Z key. + */ KEY_Z(90), + /** + * [ key. + */ KEY_BRACKETLEFT(91), + /** + * \ key. + */ KEY_BACKSLASH(92), + /** + * ] key. + */ KEY_BRACKETRIGHT(93), + /** + * ^ key. + */ KEY_ASCIICIRCUM(94), + /** + * _ key. + */ KEY_UNDERSCORE(95), + /** + * ` key. + */ KEY_QUOTELEFT(96), + /** + * { key. + */ KEY_BRACELEFT(123), + /** + * | key. + */ KEY_BAR(124), + /** + * } key. + */ KEY_BRACERIGHT(125), + /** + * ~ key. + */ KEY_ASCIITILDE(126), + /** + * ¥ key. + */ KEY_YEN(165), + /** + * § key. + */ KEY_SECTION(167), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/KinematicCollision2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/KinematicCollision2D.kt index 5dc284a9a..fc946001d 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/KinematicCollision2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/KinematicCollision2D.kt @@ -26,11 +26,11 @@ import kotlin.Suppress import kotlin.jvm.JvmOverloads /** - * Holds collision data from the movement of a [godot.PhysicsBody2D]. - * - * Holds collision data from the movement of a [godot.PhysicsBody2D], usually from [godot.PhysicsBody2D.moveAndCollide]. When a [godot.PhysicsBody2D] is moved, it stops if it detects a collision with another body. If a collision is detected, a [godot.KinematicCollision2D] object is returned. - * - * The collision data includes the colliding object, the remaining motion, and the collision position. This data can be used to determine a custom response to the collision. + * Holds collision data from the movement of a [PhysicsBody2D], usually from + * [PhysicsBody2D.moveAndCollide]. When a [PhysicsBody2D] is moved, it stops if it detects a collision + * with another body. If a collision is detected, a [KinematicCollision2D] object is returned. + * The collision data includes the colliding object, the remaining motion, and the collision + * position. This data can be used to determine a custom response to the collision. */ @GodotBaseType public open class KinematicCollision2D : RefCounted() { @@ -76,7 +76,8 @@ public open class KinematicCollision2D : RefCounted() { } /** - * Returns the collision angle according to [upDirection], which is [godot.Vector2.UP] by default. This value is always positive. + * Returns the collision angle according to [param up_direction], which is [constant Vector2.UP] + * by default. This value is always positive. */ @JvmOverloads public fun getAngle(upDirection: Vector2 = Vector2(0, -1)): Float { @@ -104,7 +105,7 @@ public open class KinematicCollision2D : RefCounted() { } /** - * Returns the colliding body's attached [godot.Object]. + * Returns the colliding body's attached [Object]. */ public fun getCollider(): Object? { TransferContext.writeArguments() @@ -113,7 +114,8 @@ public open class KinematicCollision2D : RefCounted() { } /** - * Returns the unique instance ID of the colliding body's attached [godot.Object]. See [godot.Object.getInstanceId]. + * Returns the unique instance ID of the colliding body's attached [Object]. See + * [Object.getInstanceId]. */ public fun getColliderId(): Long { TransferContext.writeArguments() @@ -122,7 +124,7 @@ public open class KinematicCollision2D : RefCounted() { } /** - * Returns the colliding body's [RID] used by the [godot.PhysicsServer2D]. + * Returns the colliding body's [RID] used by the [PhysicsServer2D]. */ public fun getColliderRid(): RID { TransferContext.writeArguments() @@ -140,7 +142,7 @@ public open class KinematicCollision2D : RefCounted() { } /** - * Returns the colliding body's shape index. See [godot.CollisionObject2D]. + * Returns the colliding body's shape index. See [CollisionObject2D]. */ public fun getColliderShapeIndex(): Int { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/KinematicCollision3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/KinematicCollision3D.kt index 2ce202f35..31dc3b958 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/KinematicCollision3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/KinematicCollision3D.kt @@ -26,11 +26,11 @@ import kotlin.Suppress import kotlin.jvm.JvmOverloads /** - * Holds collision data from the movement of a [godot.PhysicsBody3D]. - * - * Holds collision data from the movement of a [godot.PhysicsBody3D], usually from [godot.PhysicsBody3D.moveAndCollide]. When a [godot.PhysicsBody3D] is moved, it stops if it detects a collision with another body. If a collision is detected, a [godot.KinematicCollision3D] object is returned. - * - * The collision data includes the colliding object, the remaining motion, and the collision position. This data can be used to determine a custom response to the collision. + * Holds collision data from the movement of a [PhysicsBody3D], usually from + * [PhysicsBody3D.moveAndCollide]. When a [PhysicsBody3D] is moved, it stops if it detects a collision + * with another body. If a collision is detected, a [KinematicCollision3D] object is returned. + * The collision data includes the colliding object, the remaining motion, and the collision + * position. This data can be used to determine a custom response to the collision. */ @GodotBaseType public open class KinematicCollision3D : RefCounted() { @@ -76,7 +76,8 @@ public open class KinematicCollision3D : RefCounted() { } /** - * Returns the point of collision in global coordinates given a collision index (the deepest collision by default). + * Returns the point of collision in global coordinates given a collision index (the deepest + * collision by default). */ @JvmOverloads public fun getPosition(collisionIndex: Int = 0): Vector3 { @@ -86,7 +87,8 @@ public open class KinematicCollision3D : RefCounted() { } /** - * Returns the colliding body's shape's normal at the point of collision given a collision index (the deepest collision by default). + * Returns the colliding body's shape's normal at the point of collision given a collision index + * (the deepest collision by default). */ @JvmOverloads public fun getNormal(collisionIndex: Int = 0): Vector3 { @@ -96,7 +98,8 @@ public open class KinematicCollision3D : RefCounted() { } /** - * Returns the collision angle according to [upDirection], which is [godot.Vector3.UP] by default. This value is always positive. + * Returns the collision angle according to [param up_direction], which is [constant Vector3.UP] + * by default. This value is always positive. */ @JvmOverloads public fun getAngle(collisionIndex: Int = 0, upDirection: Vector3 = Vector3(0, 1, 0)): Float { @@ -106,7 +109,8 @@ public open class KinematicCollision3D : RefCounted() { } /** - * Returns the moving object's colliding shape given a collision index (the deepest collision by default). + * Returns the moving object's colliding shape given a collision index (the deepest collision by + * default). */ @JvmOverloads public fun getLocalShape(collisionIndex: Int = 0): Object? { @@ -116,7 +120,8 @@ public open class KinematicCollision3D : RefCounted() { } /** - * Returns the colliding body's attached [godot.Object] given a collision index (the deepest collision by default). + * Returns the colliding body's attached [Object] given a collision index (the deepest collision + * by default). */ @JvmOverloads public fun getCollider(collisionIndex: Int = 0): Object? { @@ -126,7 +131,8 @@ public open class KinematicCollision3D : RefCounted() { } /** - * Returns the unique instance ID of the colliding body's attached [godot.Object] given a collision index (the deepest collision by default). See [godot.Object.getInstanceId]. + * Returns the unique instance ID of the colliding body's attached [Object] given a collision + * index (the deepest collision by default). See [Object.getInstanceId]. */ @JvmOverloads public fun getColliderId(collisionIndex: Int = 0): Long { @@ -136,7 +142,8 @@ public open class KinematicCollision3D : RefCounted() { } /** - * Returns the colliding body's [RID] used by the [godot.PhysicsServer3D] given a collision index (the deepest collision by default). + * Returns the colliding body's [RID] used by the [PhysicsServer3D] given a collision index (the + * deepest collision by default). */ @JvmOverloads public fun getColliderRid(collisionIndex: Int = 0): RID { @@ -156,7 +163,8 @@ public open class KinematicCollision3D : RefCounted() { } /** - * Returns the colliding body's shape index given a collision index (the deepest collision by default). See [godot.CollisionObject3D]. + * Returns the colliding body's shape index given a collision index (the deepest collision by + * default). See [CollisionObject3D]. */ @JvmOverloads public fun getColliderShapeIndex(collisionIndex: Int = 0): Int { @@ -166,7 +174,8 @@ public open class KinematicCollision3D : RefCounted() { } /** - * Returns the colliding body's velocity given a collision index (the deepest collision by default). + * Returns the colliding body's velocity given a collision index (the deepest collision by + * default). */ @JvmOverloads public fun getColliderVelocity(collisionIndex: Int = 0): Vector3 { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Label.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Label.kt index cf99a12bc..a42da3446 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Label.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Label.kt @@ -32,12 +32,9 @@ import kotlin.Suppress import kotlin.jvm.JvmOverloads /** - * A control for displaying plain text. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/515](https://godotengine.org/asset-library/asset/515) - * - * A control for displaying plain text. It gives you control over the horizontal and vertical alignment and can wrap the text inside the node's bounding rectangle. It doesn't support bold, italics, or other rich text formatting. For that, use [godot.RichTextLabel] instead. + * A control for displaying plain text. It gives you control over the horizontal and vertical + * alignment and can wrap the text inside the node's bounding rectangle. It doesn't support bold, + * italics, or other rich text formatting. For that, use [RichTextLabel] instead. */ @GodotBaseType public open class Label : Control() { @@ -56,7 +53,8 @@ public open class Label : Control() { } /** - * A [godot.LabelSettings] resource that can be shared between multiple [godot.Label] nodes. Takes priority over theme properties. + * A [LabelSettings] resource that can be shared between multiple [Label] nodes. Takes priority + * over theme properties. */ public var labelSettings: LabelSettings? get() { @@ -70,7 +68,8 @@ public open class Label : Control() { } /** - * Controls the text's horizontal alignment. Supports left, center, right, and fill, or justify. Set it to one of the [enum HorizontalAlignment] constants. + * Controls the text's horizontal alignment. Supports left, center, right, and fill, or justify. + * Set it to one of the [enum HorizontalAlignment] constants. */ public var horizontalAlignment: HorizontalAlignment get() { @@ -84,7 +83,8 @@ public open class Label : Control() { } /** - * Controls the text's vertical alignment. Supports top, center, bottom, and fill. Set it to one of the [enum VerticalAlignment] constants. + * Controls the text's vertical alignment. Supports top, center, bottom, and fill. Set it to one + * of the [enum VerticalAlignment] constants. */ public var verticalAlignment: VerticalAlignment get() { @@ -98,7 +98,9 @@ public open class Label : Control() { } /** - * If set to something other than [godot.TextServer.AUTOWRAP_OFF], the text gets wrapped inside the node's bounding rectangle. If you resize the node, it will change its height automatically to show all the text. To see how each mode behaves, see [enum TextServer.AutowrapMode]. + * If set to something other than [constant TextServer.AUTOWRAP_OFF], the text gets wrapped inside + * the node's bounding rectangle. If you resize the node, it will change its height automatically to + * show all the text. To see how each mode behaves, see [enum TextServer.AutowrapMode]. */ public var autowrapMode: TextServer.AutowrapMode get() { @@ -126,7 +128,8 @@ public open class Label : Control() { } /** - * If `true`, the Label only shows the text that fits inside its bounding rectangle and will clip text horizontally. + * If `true`, the Label only shows the text that fits inside its bounding rectangle and will clip + * text horizontally. */ public var clipText: Boolean get() { @@ -140,7 +143,8 @@ public open class Label : Control() { } /** - * Sets the clipping behavior when the text exceeds the node's bounding rectangle. See [enum TextServer.OverrunBehavior] for a description of all modes. + * Sets the clipping behavior when the text exceeds the node's bounding rectangle. See [enum + * TextServer.OverrunBehavior] for a description of all modes. */ public var textOverrunBehavior: TextServer.OverrunBehavior get() { @@ -210,8 +214,8 @@ public open class Label : Control() { } /** - * The number of characters to display. If set to `-1`, all characters are displayed. This can be useful when animating the text appearing in a dialog box. - * + * The number of characters to display. If set to `-1`, all characters are displayed. This can be + * useful when animating the text appearing in a dialog box. * **Note:** Setting this property updates [visibleRatio] accordingly. */ public var visibleCharacters: Int @@ -226,7 +230,8 @@ public open class Label : Control() { } /** - * Sets the clipping behavior when [visibleCharacters] or [visibleRatio] is set. See [enum TextServer.VisibleCharactersBehavior] for more info. + * Sets the clipping behavior when [visibleCharacters] or [visibleRatio] is set. See [enum + * TextServer.VisibleCharactersBehavior] for more info. */ public var visibleCharactersBehavior: TextServer.VisibleCharactersBehavior get() { @@ -240,8 +245,10 @@ public open class Label : Control() { } /** - * The fraction of characters to display, relative to the total number of characters (see [getTotalCharacterCount]). If set to `1.0`, all characters are displayed. If set to `0.5`, only half of the characters will be displayed. This can be useful when animating the text appearing in a dialog box. - * + * The fraction of characters to display, relative to the total number of characters (see + * [getTotalCharacterCount]). If set to `1.0`, all characters are displayed. If set to `0.5`, only + * half of the characters will be displayed. This can be useful when animating the text appearing in + * a dialog box. * **Note:** Setting this property updates [visibleCharacters] accordingly. */ public var visibleRatio: Float @@ -270,7 +277,8 @@ public open class Label : Control() { } /** - * Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead. + * Language code used for line-breaking and text shaping algorithms, if left empty current locale + * is used instead. */ public var language: String get() { @@ -319,10 +327,8 @@ public open class Label : Control() { } /** - * Returns the height of the line [line]. - * - * If [line] is set to `-1`, returns the biggest line height. - * + * Returns the height of the line [param line]. + * If [param line] is set to `-1`, returns the biggest line height. * If there are no lines, returns font size in pixels. */ @JvmOverloads @@ -342,7 +348,8 @@ public open class Label : Control() { } /** - * Returns the number of lines shown. Useful if the [godot.Label]'s height cannot currently display all lines. + * Returns the number of lines shown. Useful if the [Label]'s height cannot currently display all + * lines. */ public fun getVisibleLineCount(): Int { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Label3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Label3D.kt index 2e7813d65..cf5cfd805 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Label3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Label3D.kt @@ -36,17 +36,14 @@ import kotlin.Suppress import kotlin.Unit /** - * A node for displaying plain text in 3D space. - * - * Tutorials: - * [$DOCS_URL/tutorials/3d/3d_text.html]($DOCS_URL/tutorials/3d/3d_text.html) - * - * A node for displaying plain text in 3D space. By adjusting various properties of this node, you can configure things such as the text's appearance and whether it always faces the camera. + * A node for displaying plain text in 3D space. By adjusting various properties of this node, you + * can configure things such as the text's appearance and whether it always faces the camera. */ @GodotBaseType public open class Label3D : GeometryInstance3D() { /** - * The size of one pixel's width on the label to scale it in 3D. To make the font look more detailed when up close, increase [fontSize] while decreasing [pixelSize] at the same time. + * The size of one pixel's width on the label to scale it in 3D. To make the font look more + * detailed when up close, increase [fontSize] while decreasing [pixelSize] at the same time. */ public var pixelSize: Float get() { @@ -75,7 +72,8 @@ public open class Label3D : GeometryInstance3D() { } /** - * The billboard mode to use for the label. See [enum BaseMaterial3D.BillboardMode] for possible values. + * The billboard mode to use for the label. See [enum BaseMaterial3D.BillboardMode] for possible + * values. */ public var billboard: BaseMaterial3D.BillboardMode get() { @@ -89,7 +87,7 @@ public open class Label3D : GeometryInstance3D() { } /** - * If `true`, the [godot.Light3D] in the [godot.Environment] has effects on the label. + * If `true`, the [Light3D] in the [Environment] has effects on the label. */ public var shaded: Boolean get() { @@ -103,7 +101,8 @@ public open class Label3D : GeometryInstance3D() { } /** - * If `true`, text can be seen from the back as well, if `false`, it is invisible when looking at it from behind. + * If `true`, text can be seen from the back as well, if `false`, it is invisible when looking at + * it from behind. */ public var doubleSided: Boolean get() { @@ -229,11 +228,13 @@ public open class Label3D : GeometryInstance3D() { } /** - * Sets the render priority for the text. Higher priority objects will be sorted in front of lower priority objects. - * - * **Note:** This only applies if [alphaCut] is set to [ALPHA_CUT_DISABLED] (default value). - * - * **Note:** This only applies to sorting of transparent objects. This will not impact how transparent objects are sorted relative to opaque objects. This is because opaque objects are not sorted, while transparent objects are sorted from back to front (subject to priority). + * Sets the render priority for the text. Higher priority objects will be sorted in front of lower + * priority objects. + * **Note:** This only applies if [alphaCut] is set to [constant ALPHA_CUT_DISABLED] (default + * value). + * **Note:** This only applies to sorting of transparent objects. This will not impact how + * transparent objects are sorted relative to opaque objects. This is because opaque objects are not + * sorted, while transparent objects are sorted from back to front (subject to priority). */ public var renderPriority: Int get() { @@ -247,11 +248,13 @@ public open class Label3D : GeometryInstance3D() { } /** - * Sets the render priority for the text outline. Higher priority objects will be sorted in front of lower priority objects. - * - * **Note:** This only applies if [alphaCut] is set to [ALPHA_CUT_DISABLED] (default value). - * - * **Note:** This only applies to sorting of transparent objects. This will not impact how transparent objects are sorted relative to opaque objects. This is because opaque objects are not sorted, while transparent objects are sorted from back to front (subject to priority). + * Sets the render priority for the text outline. Higher priority objects will be sorted in front + * of lower priority objects. + * **Note:** This only applies if [alphaCut] is set to [constant ALPHA_CUT_DISABLED] (default + * value). + * **Note:** This only applies to sorting of transparent objects. This will not impact how + * transparent objects are sorted relative to opaque objects. This is because opaque objects are not + * sorted, while transparent objects are sorted from back to front (subject to priority). */ public var outlineRenderPriority: Int get() { @@ -265,7 +268,7 @@ public open class Label3D : GeometryInstance3D() { } /** - * Text [godot.core.Color] of the [godot.Label3D]. + * Text [Color] of the [Label3D]. */ @CoreTypeLocalCopy public var modulate: Color @@ -323,9 +326,10 @@ public open class Label3D : GeometryInstance3D() { } /** - * Font size of the [godot.Label3D]'s text. To make the font look more detailed when up close, increase [fontSize] while decreasing [pixelSize] at the same time. - * - * Higher font sizes require more time to render new characters, which can cause stuttering during gameplay. + * Font size of the [Label3D]'s text. To make the font look more detailed when up close, increase + * [fontSize] while decreasing [pixelSize] at the same time. + * Higher font sizes require more time to render new characters, which can cause stuttering during + * gameplay. */ public var fontSize: Int get() { @@ -353,7 +357,8 @@ public open class Label3D : GeometryInstance3D() { } /** - * Controls the text's horizontal alignment. Supports left, center, right, and fill, or justify. Set it to one of the [enum HorizontalAlignment] constants. + * Controls the text's horizontal alignment. Supports left, center, right, and fill, or justify. + * Set it to one of the [enum HorizontalAlignment] constants. */ public var horizontalAlignment: HorizontalAlignment get() { @@ -367,7 +372,8 @@ public open class Label3D : GeometryInstance3D() { } /** - * Controls the text's vertical alignment. Supports top, center, bottom. Set it to one of the [enum VerticalAlignment] constants. + * Controls the text's vertical alignment. Supports top, center, bottom. Set it to one of the + * [enum VerticalAlignment] constants. */ public var verticalAlignment: VerticalAlignment get() { @@ -395,7 +401,7 @@ public open class Label3D : GeometryInstance3D() { } /** - * Vertical space between lines in multiline [godot.Label3D]. + * Vertical space between lines in multiline [Label3D]. */ public var lineSpacing: Float get() { @@ -409,7 +415,9 @@ public open class Label3D : GeometryInstance3D() { } /** - * If set to something other than [godot.TextServer.AUTOWRAP_OFF], the text gets wrapped inside the node's bounding rectangle. If you resize the node, it will change its height automatically to show all the text. To see how each mode behaves, see [enum TextServer.AutowrapMode]. + * If set to something other than [constant TextServer.AUTOWRAP_OFF], the text gets wrapped inside + * the node's bounding rectangle. If you resize the node, it will change its height automatically to + * show all the text. To see how each mode behaves, see [enum TextServer.AutowrapMode]. */ public var autowrapMode: TextServer.AutowrapMode get() { @@ -465,7 +473,8 @@ public open class Label3D : GeometryInstance3D() { } /** - * Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead. + * Language code used for line-breaking and text shaping algorithms, if left empty current locale + * is used instead. */ public var language: String get() { @@ -538,7 +547,7 @@ public open class Label3D : GeometryInstance3D() { /** - * Text [godot.core.Color] of the [godot.Label3D]. + * Text [Color] of the [Label3D]. * * This is a helper function to make dealing with local copies easier. * @@ -586,7 +595,8 @@ public open class Label3D : GeometryInstance3D() { /** - * Returns a [godot.TriangleMesh] with the label's vertices following its current configuration (such as its [pixelSize]). + * Returns a [TriangleMesh] with the label's vertices following its current configuration (such as + * its [pixelSize]). */ public fun generateTriangleMesh(): TriangleMesh? { TransferContext.writeArguments() @@ -602,11 +612,13 @@ public open class Label3D : GeometryInstance3D() { */ FLAG_SHADED(0), /** - * If set, text can be seen from the back as well. If not, the text is invisible when looking at it from behind. + * If set, text can be seen from the back as well. If not, the text is invisible when looking at + * it from behind. */ FLAG_DOUBLE_SIDED(1), /** - * Disables the depth test, so this object is drawn on top of all others. However, objects drawn after it in the draw order may cover it. + * Disables the depth test, so this object is drawn on top of all others. However, objects drawn + * after it in the draw order may cover it. */ FLAG_DISABLE_DEPTH_TEST(2), /** @@ -633,25 +645,34 @@ public open class Label3D : GeometryInstance3D() { id: Long, ) { /** - * This mode performs standard alpha blending. It can display translucent areas, but transparency sorting issues may be visible when multiple transparent materials are overlapping. [godot.GeometryInstance3D.castShadow] has no effect when this transparency mode is used; the [godot.Label3D] will never cast shadows. + * This mode performs standard alpha blending. It can display translucent areas, but + * transparency sorting issues may be visible when multiple transparent materials are overlapping. + * [GeometryInstance3D.castShadow] has no effect when this transparency mode is used; the [Label3D] + * will never cast shadows. */ ALPHA_CUT_DISABLED(0), /** - * This mode only allows fully transparent or fully opaque pixels. Harsh edges will be visible unless some form of screen-space antialiasing is enabled (see [godot.ProjectSettings.rendering/antiAliasing/quality/screenSpaceAa]). This mode is also known as *alpha testing* or *1-bit transparency*. - * - * **Note:** This mode might have issues with anti-aliased fonts and outlines, try adjusting [alphaScissorThreshold] or using MSDF font. - * - * **Note:** When using text with overlapping glyphs (e.g., cursive scripts), this mode might have transparency sorting issues between the main text and the outline. + * This mode only allows fully transparent or fully opaque pixels. Harsh edges will be visible + * unless some form of screen-space antialiasing is enabled (see + * [ProjectSettings.rendering/antiAliasing/quality/screenSpaceAa]). This mode is also known as + * *alpha testing* or *1-bit transparency*. + * **Note:** This mode might have issues with anti-aliased fonts and outlines, try adjusting + * [alphaScissorThreshold] or using MSDF font. + * **Note:** When using text with overlapping glyphs (e.g., cursive scripts), this mode might + * have transparency sorting issues between the main text and the outline. */ ALPHA_CUT_DISCARD(1), /** - * This mode draws fully opaque pixels in the depth prepass. This is slower than [ALPHA_CUT_DISABLED] or [ALPHA_CUT_DISCARD], but it allows displaying translucent areas and smooth edges while using proper sorting. - * - * **Note:** When using text with overlapping glyphs (e.g., cursive scripts), this mode might have transparency sorting issues between the main text and the outline. + * This mode draws fully opaque pixels in the depth prepass. This is slower than [constant + * ALPHA_CUT_DISABLED] or [constant ALPHA_CUT_DISCARD], but it allows displaying translucent areas + * and smooth edges while using proper sorting. + * **Note:** When using text with overlapping glyphs (e.g., cursive scripts), this mode might + * have transparency sorting issues between the main text and the outline. */ ALPHA_CUT_OPAQUE_PREPASS(2), /** - * This mode draws cuts off all values below a spatially-deterministic threshold, the rest will remain opaque. + * This mode draws cuts off all values below a spatially-deterministic threshold, the rest will + * remain opaque. */ ALPHA_CUT_HASH(3), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/LabelSettings.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/LabelSettings.kt index 1860eb9c5..69b75cd81 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/LabelSettings.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/LabelSettings.kt @@ -29,9 +29,10 @@ import kotlin.Suppress import kotlin.Unit /** - * Provides common settings to customize the text in a [godot.Label]. - * - * [godot.LabelSettings] is a resource that provides common settings to customize the text in a [godot.Label]. It will take priority over the properties defined in [godot.Control.theme]. The resource can be shared between multiple labels and changed on the fly, so it's convenient and flexible way to setup text style. + * [LabelSettings] is a resource that provides common settings to customize the text in a [Label]. + * It will take priority over the properties defined in [Control.theme]. The resource can be shared + * between multiple labels and changed on the fly, so it's convenient and flexible way to setup text + * style. */ @GodotBaseType public open class LabelSettings : Resource() { @@ -50,7 +51,7 @@ public open class LabelSettings : Resource() { } /** - * [godot.Font] used for the text. + * [Font] used for the text. */ public var font: Font? get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Light2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Light2D.kt index 3d9b3b390..c825b1ada 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Light2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Light2D.kt @@ -27,12 +27,8 @@ import kotlin.Suppress import kotlin.Unit /** - * Casts light in a 2D environment. - * - * Tutorials: - * [$DOCS_URL/tutorials/2d/2d_lights_and_shadows.html]($DOCS_URL/tutorials/2d/2d_lights_and_shadows.html) - * - * Casts light in a 2D environment. A light is defined as a color, an energy value, a mode (see constants), and various other parameters (range and shadows-related). + * Casts light in a 2D environment. A light is defined as a color, an energy value, a mode (see + * constants), and various other parameters (range and shadows-related). */ @GodotBaseType public open class Light2D internal constructor() : Node2D() { @@ -65,7 +61,7 @@ public open class Light2D internal constructor() : Node2D() { } /** - * The Light2D's [godot.core.Color]. + * The Light2D's [Color]. */ @CoreTypeLocalCopy public var color: Color @@ -164,9 +160,10 @@ public open class Light2D internal constructor() : Node2D() { } /** - * The layer mask. Only objects with a matching [godot.CanvasItem.lightMask] will be affected by the Light2D. See also [shadowItemCullMask], which affects which objects can cast shadows. - * - * **Note:** [rangeItemCullMask] is ignored by [godot.DirectionalLight2D], which will always light a 2D node regardless of the 2D node's [godot.CanvasItem.lightMask]. + * The layer mask. Only objects with a matching [CanvasItem.lightMask] will be affected by the + * Light2D. See also [shadowItemCullMask], which affects which objects can cast shadows. + * **Note:** [rangeItemCullMask] is ignored by [DirectionalLight2D], which will always light a 2D + * node regardless of the 2D node's [CanvasItem.lightMask]. */ public var rangeItemCullMask: Int get() { @@ -194,7 +191,7 @@ public open class Light2D internal constructor() : Node2D() { } /** - * [godot.core.Color] of shadows cast by the Light2D. + * [Color] of shadows cast by the Light2D. */ @CoreTypeLocalCopy public var shadowColor: Color @@ -223,7 +220,9 @@ public open class Light2D internal constructor() : Node2D() { } /** - * Smoothing value for shadows. Higher values will result in softer shadows, at the cost of visible streaks that can appear in shadow rendering. [shadowFilterSmooth] only has an effect if [shadowFilter] is [godot.SHADOW_FILTER_PCF5] or [godot.SHADOW_FILTER_PCF13]. + * Smoothing value for shadows. Higher values will result in softer shadows, at the cost of + * visible streaks that can appear in shadow rendering. [shadowFilterSmooth] only has an effect if + * [shadowFilter] is [constant SHADOW_FILTER_PCF5] or [constant SHADOW_FILTER_PCF13]. */ public var shadowFilterSmooth: Float get() { @@ -237,7 +236,9 @@ public open class Light2D internal constructor() : Node2D() { } /** - * The shadow mask. Used with [godot.LightOccluder2D] to cast shadows. Only occluders with a matching [godot.CanvasItem.lightMask] will cast shadows. See also [rangeItemCullMask], which affects which objects can *receive* the light. + * The shadow mask. Used with [LightOccluder2D] to cast shadows. Only occluders with a matching + * [CanvasItem.lightMask] will cast shadows. See also [rangeItemCullMask], which affects which + * objects can *receive* the light. */ public var shadowItemCullMask: Int get() { @@ -256,7 +257,7 @@ public open class Light2D internal constructor() : Node2D() { } /** - * The Light2D's [godot.core.Color]. + * The Light2D's [Color]. * * This is a helper function to make dealing with local copies easier. * @@ -280,7 +281,7 @@ public open class Light2D internal constructor() : Node2D() { /** - * [godot.core.Color] of shadows cast by the Light2D. + * [Color] of shadows cast by the Light2D. * * This is a helper function to make dealing with local copies easier. * @@ -304,7 +305,8 @@ public open class Light2D internal constructor() : Node2D() { /** - * Sets the light's height, which is used in 2D normal mapping. See [godot.PointLight2D.height] and [godot.DirectionalLight2D.height]. + * Sets the light's height, which is used in 2D normal mapping. See [PointLight2D.height] and + * [DirectionalLight2D.height]. */ public fun setHeight(height: Float): Unit { TransferContext.writeArguments(DOUBLE to height.toDouble()) @@ -312,7 +314,8 @@ public open class Light2D internal constructor() : Node2D() { } /** - * Returns the light's height, which is used in 2D normal mapping. See [godot.PointLight2D.height] and [godot.DirectionalLight2D.height]. + * Returns the light's height, which is used in 2D normal mapping. See [PointLight2D.height] and + * [DirectionalLight2D.height]. */ public fun getHeight(): Float { TransferContext.writeArguments() @@ -324,15 +327,18 @@ public open class Light2D internal constructor() : Node2D() { id: Long, ) { /** - * No filter applies to the shadow map. This provides hard shadow edges and is the fastest to render. See [shadowFilter]. + * No filter applies to the shadow map. This provides hard shadow edges and is the fastest to + * render. See [shadowFilter]. */ SHADOW_FILTER_NONE(0), /** - * Percentage closer filtering (5 samples) applies to the shadow map. This is slower compared to hard shadow rendering. See [shadowFilter]. + * Percentage closer filtering (5 samples) applies to the shadow map. This is slower compared to + * hard shadow rendering. See [shadowFilter]. */ SHADOW_FILTER_PCF5(1), /** - * Percentage closer filtering (13 samples) applies to the shadow map. This is the slowest shadow filtering mode, and should be used sparingly. See [shadowFilter]. + * Percentage closer filtering (13 samples) applies to the shadow map. This is the slowest + * shadow filtering mode, and should be used sparingly. See [shadowFilter]. */ SHADOW_FILTER_PCF13(2), ; @@ -351,15 +357,18 @@ public open class Light2D internal constructor() : Node2D() { id: Long, ) { /** - * Adds the value of pixels corresponding to the Light2D to the values of pixels under it. This is the common behavior of a light. + * Adds the value of pixels corresponding to the Light2D to the values of pixels under it. This + * is the common behavior of a light. */ BLEND_MODE_ADD(0), /** - * Subtracts the value of pixels corresponding to the Light2D to the values of pixels under it, resulting in inversed light effect. + * Subtracts the value of pixels corresponding to the Light2D to the values of pixels under it, + * resulting in inversed light effect. */ BLEND_MODE_SUB(1), /** - * Mix the value of pixels corresponding to the Light2D to the values of pixels under it by linear interpolation. + * Mix the value of pixels corresponding to the Light2D to the values of pixels under it by + * linear interpolation. */ BLEND_MODE_MIX(2), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/LightmapGIData.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/LightmapGIData.kt index 57f387325..f558afcd5 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/LightmapGIData.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/LightmapGIData.kt @@ -27,9 +27,8 @@ import kotlin.Suppress import kotlin.Unit /** - * Contains baked lightmap and dynamic object probe data for [godot.LightmapGI]. - * - * [godot.LightmapGIData] contains baked lightmap and dynamic object probe data for [godot.LightmapGI]. It is replaced every time lightmaps are baked in [godot.LightmapGI]. + * [LightmapGIData] contains baked lightmap and dynamic object probe data for [LightmapGI]. It is + * replaced every time lightmaps are baked in [LightmapGI]. */ @GodotBaseType public open class LightmapGIData : Resource() { @@ -80,7 +79,7 @@ public open class LightmapGIData : Resource() { } /** - * Adds an object that is considered baked within this [godot.LightmapGIData]. + * Adds an object that is considered baked within this [LightmapGIData]. */ public fun addUser( path: NodePath, @@ -93,7 +92,7 @@ public open class LightmapGIData : Resource() { } /** - * Returns the number of objects that are considered baked within this [godot.LightmapGIData]. + * Returns the number of objects that are considered baked within this [LightmapGIData]. */ public fun getUserCount(): Int { TransferContext.writeArguments() @@ -102,7 +101,7 @@ public open class LightmapGIData : Resource() { } /** - * Returns the [godot.core.NodePath] of the baked object at index [userIdx]. + * Returns the [NodePath] of the baked object at index [param user_idx]. */ public fun getUserPath(userIdx: Int): NodePath { TransferContext.writeArguments(LONG to userIdx.toLong()) @@ -111,7 +110,7 @@ public open class LightmapGIData : Resource() { } /** - * Clear all objects that are considered baked within this [godot.LightmapGIData]. + * Clear all objects that are considered baked within this [LightmapGIData]. */ public fun clearUsers(): Unit { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/LightmapProbe.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/LightmapProbe.kt index 5606aee27..8d635c038 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/LightmapProbe.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/LightmapProbe.kt @@ -12,11 +12,13 @@ import kotlin.Int import kotlin.Suppress /** - * Represents a single manually placed probe for dynamic object lighting with [godot.LightmapGI]. - * - * [godot.LightmapProbe] represents the position of a single manually placed probe for dynamic object lighting with [godot.LightmapGI]. - * - * Typically, [godot.LightmapGI] probes are placed automatically by setting [godot.LightmapGI.generateProbesSubdiv] to a value other than [godot.LightmapGI.GENERATE_PROBES_DISABLED]. By creating [godot.LightmapProbe] nodes before baking lightmaps, you can add more probes in specific areas for greater detail, or disable automatic generation and rely only on manually placed probes instead. + * [LightmapProbe] represents the position of a single manually placed probe for dynamic object + * lighting with [LightmapGI]. + * Typically, [LightmapGI] probes are placed automatically by setting + * [LightmapGI.generateProbesSubdiv] to a value other than [constant + * LightmapGI.GENERATE_PROBES_DISABLED]. By creating [LightmapProbe] nodes before baking lightmaps, you + * can add more probes in specific areas for greater detail, or disable automatic generation and rely + * only on manually placed probes instead. */ @GodotBaseType public open class LightmapProbe : Node3D() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Lightmapper.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Lightmapper.kt index 1a4c23cc5..76658a5e7 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Lightmapper.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Lightmapper.kt @@ -12,11 +12,10 @@ import kotlin.Int import kotlin.Suppress /** - * Abstract class extended by lightmappers, for use in [godot.LightmapGI]. - * - * This class should be extended by custom lightmapper classes. Lightmappers can then be used with [godot.LightmapGI] to provide fast baked global illumination in 3D. - * - * Godot contains a built-in GPU-based lightmapper [godot.LightmapperRD] that uses compute shaders, but custom lightmappers can be implemented by C++ modules. + * This class should be extended by custom lightmapper classes. Lightmappers can then be used with + * [LightmapGI] to provide fast baked global illumination in 3D. + * Godot contains a built-in GPU-based lightmapper [LightmapperRD] that uses compute shaders, but + * custom lightmappers can be implemented by C++ modules. */ @GodotBaseType public open class Lightmapper internal constructor() : RefCounted() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/LightmapperRD.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/LightmapperRD.kt index 3bf73f773..042c768b5 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/LightmapperRD.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/LightmapperRD.kt @@ -12,10 +12,10 @@ import kotlin.Int import kotlin.Suppress /** - * The built-in GPU-based lightmapper for use with [godot.LightmapGI]. - * - * LightmapperRD ("RD" stands for [godot.RenderingDevice]) is the built-in GPU-based lightmapper for use with [godot.LightmapGI]. On most dedicated GPUs, it can bake lightmaps much faster than most CPU-based lightmappers. LightmapperRD uses compute shaders to bake lightmaps, so it does not require CUDA or OpenCL libraries to be installed to be usable. - * + * LightmapperRD ("RD" stands for [RenderingDevice]) is the built-in GPU-based lightmapper for use + * with [LightmapGI]. On most dedicated GPUs, it can bake lightmaps much faster than most CPU-based + * lightmappers. LightmapperRD uses compute shaders to bake lightmaps, so it does not require CUDA or + * OpenCL libraries to be installed to be usable. * **Note:** Only usable when using the Vulkan backend (Forward+ or Mobile), not OpenGL. */ @GodotBaseType diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Line2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Line2D.kt index aae6fa07e..c2bf2004a 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Line2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Line2D.kt @@ -33,21 +33,18 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * A 2D polyline that can optionally be textured. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/583](https://godotengine.org/asset-library/asset/583) - * - * This node draws a 2D polyline, i.e. a shape consisting of several points connected by segments. [godot.Line2D] is not a mathematical polyline, i.e. the segments are not infinitely thin. It is intended for rendering and it can be colored and optionally textured. - * - * **Warning:** Certain configurations may be impossible to draw nicely, such as very sharp angles. In these situations, the node uses fallback drawing logic to look decent. - * - * **Note:** [godot.Line2D] is drawn using a 2D mesh. + * This node draws a 2D polyline, i.e. a shape consisting of several points connected by segments. + * [Line2D] is not a mathematical polyline, i.e. the segments are not infinitely thin. It is intended + * for rendering and it can be colored and optionally textured. + * **Warning:** Certain configurations may be impossible to draw nicely, such as very sharp angles. + * In these situations, the node uses fallback drawing logic to look decent. + * **Note:** [Line2D] is drawn using a 2D mesh. */ @GodotBaseType public open class Line2D : Node2D() { /** - * The points of the polyline, interpreted in local 2D coordinates. Segments are drawn between the adjacent points in this array. + * The points of the polyline, interpreted in local 2D coordinates. Segments are drawn between the + * adjacent points in this array. */ public var points: PackedVector2Array get() { @@ -61,11 +58,13 @@ public open class Line2D : Node2D() { } /** - * If `true` and the polyline has more than 2 points, the last point and the first one will be connected by a segment. - * - * **Note:** The shape of the closing segment is not guaranteed to be seamless if a [widthCurve] is provided. - * - * **Note:** The joint between the closing segment and the first segment is drawn first and it samples the [gradient] and the [widthCurve] at the beginning. This is an implementation detail that might change in a future version. + * If `true` and the polyline has more than 2 points, the last point and the first one will be + * connected by a segment. + * **Note:** The shape of the closing segment is not guaranteed to be seamless if a [widthCurve] + * is provided. + * **Note:** The joint between the closing segment and the first segment is drawn first and it + * samples the [gradient] and the [widthCurve] at the beginning. This is an implementation detail + * that might change in a future version. */ public var closed: Boolean get() { @@ -93,7 +92,8 @@ public open class Line2D : Node2D() { } /** - * The polyline's width curve. The width of the polyline over its length will be equivalent to the value of the width curve over its domain. + * The polyline's width curve. The width of the polyline over its length will be equivalent to the + * value of the width curve over its domain. */ public var widthCurve: Curve? get() { @@ -122,7 +122,8 @@ public open class Line2D : Node2D() { } /** - * The gradient is drawn through the whole line from start to finish. The [defaultColor] will not be used if this property is set. + * The gradient is drawn through the whole line from start to finish. The [defaultColor] will not + * be used if this property is set. */ public var gradient: Gradient? get() { @@ -164,7 +165,8 @@ public open class Line2D : Node2D() { } /** - * The style of the connections between segments of the polyline. Use [enum LineJointMode] constants. + * The style of the connections between segments of the polyline. Use [enum LineJointMode] + * constants. */ public var jointMode: LineJointMode get() { @@ -178,7 +180,8 @@ public open class Line2D : Node2D() { } /** - * The style of the beginning of the polyline, if [closed] is `false`. Use [enum LineCapMode] constants. + * The style of the beginning of the polyline, if [closed] is `false`. Use [enum LineCapMode] + * constants. */ public var beginCapMode: LineCapMode get() { @@ -206,7 +209,10 @@ public open class Line2D : Node2D() { } /** - * Determines the miter limit of the polyline. Normally, when [jointMode] is set to [LINE_JOINT_SHARP], sharp angles fall back to using the logic of [LINE_JOINT_BEVEL] joints to prevent very long miters. Higher values of this property mean that the fallback to a bevel joint will happen at sharper angles. + * Determines the miter limit of the polyline. Normally, when [jointMode] is set to [constant + * LINE_JOINT_SHARP], sharp angles fall back to using the logic of [constant LINE_JOINT_BEVEL] joints + * to prevent very long miters. Higher values of this property mean that the fallback to a bevel + * joint will happen at sharper angles. */ public var sharpLimit: Float get() { @@ -220,7 +226,8 @@ public open class Line2D : Node2D() { } /** - * The smoothness used for rounded joints and caps. Higher values result in smoother corners, but are more demanding to render and update. + * The smoothness used for rounded joints and caps. Higher values result in smoother corners, but + * are more demanding to render and update. */ public var roundPrecision: Int get() { @@ -235,8 +242,7 @@ public open class Line2D : Node2D() { /** * If `true`, the polyline's border will be anti-aliased. - * - * **Note:** [godot.Line2D] is not accelerated by batching when being anti-aliased. + * **Note:** [Line2D] is not accelerated by batching when being anti-aliased. */ public var antialiased: Boolean get() { @@ -279,7 +285,8 @@ public open class Line2D : Node2D() { /** - * Overwrites the position of the point at the given [index] with the supplied [position]. + * Overwrites the position of the point at the given [param index] with the supplied [param + * position]. */ public fun setPointPosition(index: Int, position: Vector2): Unit { TransferContext.writeArguments(LONG to index.toLong(), VECTOR2 to position) @@ -287,7 +294,7 @@ public open class Line2D : Node2D() { } /** - * Returns the position of the point at index [index]. + * Returns the position of the point at index [param index]. */ public fun getPointPosition(index: Int): Vector2 { TransferContext.writeArguments(LONG to index.toLong()) @@ -305,9 +312,12 @@ public open class Line2D : Node2D() { } /** - * Adds a point with the specified [position] relative to the polyline's own position. If no [index] is provided, the new point will be added to the end of the points array. - * - * If [index] is given, the new point is inserted before the existing point identified by index [index]. The indices of the points after the new point get increased by 1. The provided [index] must not exceed the number of existing points in the polyline. See [getPointCount]. + * Adds a point with the specified [param position] relative to the polyline's own position. If no + * [param index] is provided, the new point will be added to the end of the points array. + * If [param index] is given, the new point is inserted before the existing point identified by + * index [param index]. The indices of the points after the new point get increased by 1. The + * provided [param index] must not exceed the number of existing points in the polyline. See + * [getPointCount]. */ @JvmOverloads public fun addPoint(position: Vector2, index: Int = -1): Unit { @@ -316,7 +326,7 @@ public open class Line2D : Node2D() { } /** - * Removes the point at index [index] from the polyline. + * Removes the point at index [param index] from the polyline. */ public fun removePoint(index: Int): Unit { TransferContext.writeArguments(LONG to index.toLong()) @@ -335,15 +345,19 @@ public open class Line2D : Node2D() { id: Long, ) { /** - * Makes the polyline's joints pointy, connecting the sides of the two segments by extending them until they intersect. If the rotation of a joint is too big (based on [sharpLimit]), the joint falls back to [LINE_JOINT_BEVEL] to prevent very long miters. + * Makes the polyline's joints pointy, connecting the sides of the two segments by extending + * them until they intersect. If the rotation of a joint is too big (based on [sharpLimit]), the + * joint falls back to [constant LINE_JOINT_BEVEL] to prevent very long miters. */ LINE_JOINT_SHARP(0), /** - * Makes the polyline's joints bevelled/chamfered, connecting the sides of the two segments with a simple line. + * Makes the polyline's joints bevelled/chamfered, connecting the sides of the two segments with + * a simple line. */ LINE_JOINT_BEVEL(1), /** - * Makes the polyline's joints rounded, connecting the sides of the two segments with an arc. The detail of this arc depends on [roundPrecision]. + * Makes the polyline's joints rounded, connecting the sides of the two segments with an arc. + * The detail of this arc depends on [roundPrecision]. */ LINE_JOINT_ROUND(2), ; @@ -393,11 +407,14 @@ public open class Line2D : Node2D() { */ LINE_TEXTURE_NONE(0), /** - * Tiles the texture over the polyline. [godot.CanvasItem.textureRepeat] of the [godot.Line2D] node must be [godot.CanvasItem.TEXTURE_REPEAT_ENABLED] or [godot.CanvasItem.TEXTURE_REPEAT_MIRROR] for it to work properly. + * Tiles the texture over the polyline. [CanvasItem.textureRepeat] of the [Line2D] node must be + * [constant CanvasItem.TEXTURE_REPEAT_ENABLED] or [constant CanvasItem.TEXTURE_REPEAT_MIRROR] for + * it to work properly. */ LINE_TEXTURE_TILE(1), /** - * Stretches the texture across the polyline. [godot.CanvasItem.textureRepeat] of the [godot.Line2D] node must be [godot.CanvasItem.TEXTURE_REPEAT_DISABLED] for best results. + * Stretches the texture across the polyline. [CanvasItem.textureRepeat] of the [Line2D] node + * must be [constant CanvasItem.TEXTURE_REPEAT_DISABLED] for best results. */ LINE_TEXTURE_STRETCH(2), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/LinkButton.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/LinkButton.kt index 49f497569..0fa1854fe 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/LinkButton.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/LinkButton.kt @@ -23,11 +23,9 @@ import kotlin.String import kotlin.Suppress /** - * A button that represents a link. - * - * A button that represents a link. This type of button is primarily used for interactions that cause a context change (like linking to a web page). - * - * See also [godot.BaseButton] which contains common properties and methods associated with this node. + * A button that represents a link. This type of button is primarily used for interactions that + * cause a context change (like linking to a web page). + * See also [BaseButton] which contains common properties and methods associated with this node. */ @GodotBaseType public open class LinkButton : BaseButton() { @@ -46,7 +44,8 @@ public open class LinkButton : BaseButton() { } /** - * The underline mode to use for the text. See [enum LinkButton.UnderlineMode] for the available modes. + * The underline mode to use for the text. See [enum LinkButton.UnderlineMode] for the available + * modes. */ public var underline: UnderlineMode get() { @@ -60,33 +59,24 @@ public open class LinkButton : BaseButton() { } /** - * The [URI](https://en.wikipedia.org/wiki/Uniform_Resource_Identifier) for this [godot.LinkButton]. If set to a valid URI, pressing the button opens the URI using the operating system's default program for the protocol (via [godot.OS.shellOpen]). HTTP and HTTPS URLs open the default web browser. - * + * The [url=https://en.wikipedia.org/wiki/Uniform_Resource_Identifier]URI[/url] for this + * [LinkButton]. If set to a valid URI, pressing the button opens the URI using the operating + * system's default program for the protocol (via [OS.shellOpen]). HTTP and HTTPS URLs open the + * default web browser. * **Examples:** * - * [codeblocks] - * - * [gdscript] - * + * gdscript: + * ```gdscript * uri = "https://godotengine.org" # Opens the URL in the default web browser. - * * uri = "C:\SomeFolder" # Opens the file explorer at the given path. - * * uri = "C:\SomeImage.png" # Opens the given image in the default viewing app. - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * Uri = "https://godotengine.org"; // Opens the URL in the default web browser. - * * Uri = "C:\SomeFolder"; // Opens the file explorer at the given path. - * * Uri = "C:\SomeImage.png"; // Opens the given image in the default viewing app. - * - * [/csharp] - * - * [/codeblocks] + * ``` */ public var uri: String get() { @@ -114,7 +104,8 @@ public open class LinkButton : BaseButton() { } /** - * Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead. + * Language code used for line-breaking and text shaping algorithms, if left empty current locale + * is used instead. */ public var language: String get() { @@ -170,7 +161,8 @@ public open class LinkButton : BaseButton() { */ UNDERLINE_MODE_ALWAYS(0), /** - * The LinkButton will show an underline at the bottom of its text when the mouse cursor is over it. + * The LinkButton will show an underline at the bottom of its text when the mouse cursor is over + * it. */ UNDERLINE_MODE_ON_HOVER(1), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/MIDIMessage.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/MIDIMessage.kt index 6e45cef9b..787204576 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/MIDIMessage.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/MIDIMessage.kt @@ -6,24 +6,99 @@ import kotlin.Long public enum class MIDIMessage( id: Long, ) { + /** + * Enum value which doesn't correspond to any MIDI message. This is used to initialize [enum + * MIDIMessage] properties with a generic state. + */ MIDI_MESSAGE_NONE(0), + /** + * MIDI note OFF message. Not all MIDI devices send this event; some send [constant + * MIDI_MESSAGE_NOTE_ON] with zero velocity instead. See the documentation of [InputEventMIDI] for + * information of how to use MIDI inputs. + */ MIDI_MESSAGE_NOTE_OFF(8), + /** + * MIDI note ON message. Some MIDI devices send this event with velocity zero instead of [constant + * MIDI_MESSAGE_NOTE_OFF], but implementations vary. See the documentation of [InputEventMIDI] for + * information of how to use MIDI inputs. + */ MIDI_MESSAGE_NOTE_ON(9), + /** + * MIDI aftertouch message. This message is most often sent by pressing down on the key after it + * "bottoms out". + */ MIDI_MESSAGE_AFTERTOUCH(10), + /** + * MIDI control change message. This message is sent when a controller value changes. Controllers + * include devices such as pedals and levers. + */ MIDI_MESSAGE_CONTROL_CHANGE(11), + /** + * MIDI program change message. This message sent when the program patch number changes. + */ MIDI_MESSAGE_PROGRAM_CHANGE(12), + /** + * MIDI channel pressure message. This message is most often sent by pressing down on the key + * after it "bottoms out". This message is different from polyphonic after-touch as it indicates the + * highest pressure across all keys. + */ MIDI_MESSAGE_CHANNEL_PRESSURE(13), + /** + * MIDI pitch bend message. This message is sent to indicate a change in the pitch bender (wheel + * or lever, typically). + */ MIDI_MESSAGE_PITCH_BEND(14), + /** + * MIDI system exclusive message. This has behavior exclusive to the device you're receiving input + * from. Getting this data is not implemented in Godot. + */ MIDI_MESSAGE_SYSTEM_EXCLUSIVE(240), + /** + * MIDI quarter frame message. Contains timing information that is used to synchronize MIDI + * devices. Getting this data is not implemented in Godot. + */ MIDI_MESSAGE_QUARTER_FRAME(241), + /** + * MIDI song position pointer message. Gives the number of 16th notes since the start of the song. + * Getting this data is not implemented in Godot. + */ MIDI_MESSAGE_SONG_POSITION_POINTER(242), + /** + * MIDI song select message. Specifies which sequence or song is to be played. Getting this data + * is not implemented in Godot. + */ MIDI_MESSAGE_SONG_SELECT(243), + /** + * MIDI tune request message. Upon receiving a tune request, all analog synthesizers should tune + * their oscillators. + */ MIDI_MESSAGE_TUNE_REQUEST(246), + /** + * MIDI timing clock message. Sent 24 times per quarter note when synchronization is required. + */ MIDI_MESSAGE_TIMING_CLOCK(248), + /** + * MIDI start message. Start the current sequence playing. This message will be followed with + * Timing Clocks. + */ MIDI_MESSAGE_START(250), + /** + * MIDI continue message. Continue at the point the sequence was stopped. + */ MIDI_MESSAGE_CONTINUE(251), + /** + * MIDI stop message. Stop the current sequence. + */ MIDI_MESSAGE_STOP(252), + /** + * MIDI active sensing message. This message is intended to be sent repeatedly to tell the + * receiver that a connection is alive. + */ MIDI_MESSAGE_ACTIVE_SENSING(254), + /** + * MIDI system reset message. Reset all receivers in the system to power-up status. It should not + * be sent on power-up itself. + */ MIDI_MESSAGE_SYSTEM_RESET(255), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/MarginContainer.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/MarginContainer.kt index 23e01670e..376062090 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/MarginContainer.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/MarginContainer.kt @@ -12,50 +12,30 @@ import kotlin.Int import kotlin.Suppress /** - * A container that keeps a margin around its child controls. - * - * Tutorials: - * [$DOCS_URL/tutorials/ui/gui_containers.html]($DOCS_URL/tutorials/ui/gui_containers.html) - * - * [godot.MarginContainer] adds an adjustable margin on each side of its child controls. The margins are added around all children, not around each individual one. To control the [godot.MarginContainer]'s margins, use the `margin_*` theme properties listed below. - * - * **Note:** The margin sizes are theme overrides, not normal properties. This is an example of how to change them in code: - * - * [codeblocks] - * - * [gdscript] - * + * [MarginContainer] adds an adjustable margin on each side of its child controls. The margins are + * added around all children, not around each individual one. To control the [MarginContainer]'s + * margins, use the `margin_*` theme properties listed below. + * **Note:** The margin sizes are theme overrides, not normal properties. This is an example of how + * to change them in code: + * + * gdscript: + * ```gdscript * # This code sample assumes the current script is extending MarginContainer. - * * var margin_value = 100 - * * add_theme_constant_override("margin_top", margin_value) - * * add_theme_constant_override("margin_left", margin_value) - * * add_theme_constant_override("margin_bottom", margin_value) - * * add_theme_constant_override("margin_right", margin_value) - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * // This code sample assumes the current script is extending MarginContainer. - * * int marginValue = 100; - * * AddThemeConstantOverride("margin_top", marginValue); - * * AddThemeConstantOverride("margin_left", marginValue); - * * AddThemeConstantOverride("margin_bottom", marginValue); - * * AddThemeConstantOverride("margin_right", marginValue); - * - * [/csharp] - * - * [/codeblocks] + * ``` */ @GodotBaseType public open class MarginContainer : Container() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Marker2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Marker2D.kt index 90d0c7a1f..0a7359f06 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Marker2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Marker2D.kt @@ -19,9 +19,9 @@ import kotlin.Int import kotlin.Suppress /** - * Generic 2D position hint for editing. - * - * Generic 2D position hint for editing. It's just like a plain [godot.Node2D], but it displays as a cross in the 2D editor at all times. You can set the cross' visual size by using the gizmo in the 2D editor while the node is selected. + * Generic 2D position hint for editing. It's just like a plain [Node2D], but it displays as a cross + * in the 2D editor at all times. You can set the cross' visual size by using the gizmo in the 2D + * editor while the node is selected. */ @GodotBaseType public open class Marker2D : Node2D() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Marker3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Marker3D.kt index f232f5554..59dffa227 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Marker3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Marker3D.kt @@ -19,9 +19,8 @@ import kotlin.Int import kotlin.Suppress /** - * Generic 3D position hint for editing. - * - * Generic 3D position hint for editing. It's just like a plain [godot.Node3D], but it displays as a cross in the 3D editor at all times. + * Generic 3D position hint for editing. It's just like a plain [Node3D], but it displays as a cross + * in the 3D editor at all times. */ @GodotBaseType public open class Marker3D : Node3D() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Marshalls.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Marshalls.kt index 835104089..d026abfd1 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Marshalls.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Marshalls.kt @@ -23,8 +23,6 @@ import kotlin.Suppress import kotlin.jvm.JvmOverloads /** - * Data transformation (marshaling) and encoding helpers. - * * Provides data transformation and encoding utility functions. */ @GodotBaseType @@ -35,8 +33,8 @@ public object Marshalls : Object() { } /** - * Returns a Base64-encoded string of the [Variant] [variant]. If [fullObjects] is `true`, encoding objects is allowed (and can potentially include code). - * + * Returns a Base64-encoded string of the [Variant] [param variant]. If [param full_objects] is + * `true`, encoding objects is allowed (and can potentially include code). * Internally, this uses the same encoding mechanism as the [@GlobalScope.varToBytes] method. */ @JvmOverloads @@ -47,11 +45,12 @@ public object Marshalls : Object() { } /** - * Returns a decoded [Variant] corresponding to the Base64-encoded string [base64Str]. If [allowObjects] is `true`, decoding objects is allowed. - * + * Returns a decoded [Variant] corresponding to the Base64-encoded string [param base64_str]. If + * [param allow_objects] is `true`, decoding objects is allowed. * Internally, this uses the same decoding mechanism as the [@GlobalScope.bytesToVar] method. - * - * **Warning:** Deserialized objects can contain code which gets executed. Do not use this option if the serialized object comes from untrusted sources to avoid potential security threats such as remote code execution. + * **Warning:** Deserialized objects can contain code which gets executed. Do not use this option + * if the serialized object comes from untrusted sources to avoid potential security threats such as + * remote code execution. */ @JvmOverloads public fun base64ToVariant(base64Str: String, allowObjects: Boolean = false): Any? { @@ -61,7 +60,7 @@ public object Marshalls : Object() { } /** - * Returns a Base64-encoded string of a given [godot.PackedByteArray]. + * Returns a Base64-encoded string of a given [PackedByteArray]. */ public fun rawToBase64(array: PackedByteArray): String { TransferContext.writeArguments(PACKED_BYTE_ARRAY to array) @@ -70,7 +69,8 @@ public object Marshalls : Object() { } /** - * Returns a decoded [godot.PackedByteArray] corresponding to the Base64-encoded string [base64Str]. + * Returns a decoded [PackedByteArray] corresponding to the Base64-encoded string [param + * base64_str]. */ public fun base64ToRaw(base64Str: String): PackedByteArray { TransferContext.writeArguments(STRING to base64Str) @@ -79,7 +79,7 @@ public object Marshalls : Object() { } /** - * Returns a Base64-encoded string of the UTF-8 string [utf8Str]. + * Returns a Base64-encoded string of the UTF-8 string [param utf8_str]. */ public fun utf8ToBase64(utf8Str: String): String { TransferContext.writeArguments(STRING to utf8Str) @@ -88,7 +88,7 @@ public object Marshalls : Object() { } /** - * Returns a decoded string corresponding to the Base64-encoded string [base64Str]. + * Returns a decoded string corresponding to the Base64-encoded string [param base64_str]. */ public fun base64ToUtf8(base64Str: String): String { TransferContext.writeArguments(STRING to base64Str) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/MenuBar.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/MenuBar.kt index aa29282f8..548a6edf1 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/MenuBar.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/MenuBar.kt @@ -23,14 +23,13 @@ import kotlin.Suppress import kotlin.Unit /** - * A horizontal menu bar that creates a [godot.MenuButton] for each [godot.PopupMenu] child. - * - * A horizontal menu bar that creates a [godot.MenuButton] for each [godot.PopupMenu] child. New items are created by adding [godot.PopupMenu]s to this node. + * A horizontal menu bar that creates a [MenuButton] for each [PopupMenu] child. New items are + * created by adding [PopupMenu]s to this node. */ @GodotBaseType public open class MenuBar : Control() { /** - * Flat [godot.MenuBar] don't display item decoration. + * Flat [MenuBar] don't display item decoration. */ public var flat: Boolean get() { @@ -44,7 +43,7 @@ public open class MenuBar : Control() { } /** - * Position in the global menu to insert first [godot.MenuBar] item at. + * Position in the global menu to insert first [MenuBar] item at. */ public var startIndex: Int get() { @@ -58,7 +57,8 @@ public open class MenuBar : Control() { } /** - * If `true`, when the cursor hovers above menu item, it will close the current [godot.PopupMenu] and open the other one. + * If `true`, when the cursor hovers above menu item, it will close the current [PopupMenu] and + * open the other one. */ public var switchOnHover: Boolean get() { @@ -72,7 +72,7 @@ public open class MenuBar : Control() { } /** - * If `true`, [godot.MenuBar] will use system global menu when supported. + * If `true`, [MenuBar] will use system global menu when supported. */ public var preferGlobalMenu: Boolean get() { @@ -100,7 +100,8 @@ public open class MenuBar : Control() { } /** - * Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead. + * Language code used for line-breaking and text shaping algorithms, if left empty current locale + * is used instead. */ public var language: String get() { @@ -127,7 +128,7 @@ public open class MenuBar : Control() { } /** - * Returns `true`, if system global menu is supported and used by this [godot.MenuBar]. + * Returns `true`, if system global menu is supported and used by this [MenuBar]. */ public fun isNativeMenu(): Boolean { TransferContext.writeArguments() @@ -213,7 +214,7 @@ public open class MenuBar : Control() { } /** - * Returns [godot.PopupMenu] associated with menu item. + * Returns [PopupMenu] associated with menu item. */ public fun getMenuPopup(menu: Int): PopupMenu? { TransferContext.writeArguments(LONG to menu.toLong()) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/MenuButton.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/MenuButton.kt index b7812e31c..7c348e2fb 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/MenuButton.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/MenuButton.kt @@ -23,21 +23,21 @@ import kotlin.Suppress import kotlin.Unit /** - * A button that brings up a [godot.PopupMenu] when clicked. - * - * A button that brings up a [godot.PopupMenu] when clicked. To create new items inside this [godot.PopupMenu], use `get_popup().add_item("My Item Name")`. You can also create them directly from Godot editor's inspector. - * - * See also [godot.BaseButton] which contains common properties and methods associated with this node. + * A button that brings up a [PopupMenu] when clicked. To create new items inside this [PopupMenu], + * use `get_popup().add_item("My Item Name")`. You can also create them directly from Godot editor's + * inspector. + * See also [BaseButton] which contains common properties and methods associated with this node. */ @GodotBaseType public open class MenuButton : Button() { /** - * Emitted when the [godot.PopupMenu] of this MenuButton is about to show. + * Emitted when the [PopupMenu] of this MenuButton is about to show. */ public val aboutToPopup: Signal0 by signal() /** - * If `true`, when the cursor hovers above another [godot.MenuButton] within the same parent which also has [switchOnHover] enabled, it will close the current [godot.MenuButton] and open the other one. + * If `true`, when the cursor hovers above another [MenuButton] within the same parent which also + * has [switchOnHover] enabled, it will close the current [MenuButton] and open the other one. */ public var switchOnHover: Boolean get() { @@ -70,9 +70,9 @@ public open class MenuButton : Button() { } /** - * Returns the [godot.PopupMenu] contained in this button. - * - * **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [godot.Window.visible] property. + * Returns the [PopupMenu] contained in this button. + * **Warning:** This is a required internal node, removing and freeing it may cause a crash. If + * you wish to hide it or any of its children, use their [Window.visible] property. */ public fun getPopup(): PopupMenu? { TransferContext.writeArguments() @@ -81,7 +81,8 @@ public open class MenuButton : Button() { } /** - * Adjusts popup position and sizing for the [godot.MenuButton], then shows the [godot.PopupMenu]. Prefer this over using `get_popup().popup()`. + * Adjusts popup position and sizing for the [MenuButton], then shows the [PopupMenu]. Prefer this + * over using `get_popup().popup()`. */ public fun showPopup(): Unit { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/MeshConvexDecompositionSettings.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/MeshConvexDecompositionSettings.kt index a0b4da3f5..bc8a89db5 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/MeshConvexDecompositionSettings.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/MeshConvexDecompositionSettings.kt @@ -22,9 +22,7 @@ import kotlin.Long import kotlin.Suppress /** - * Parameters to be used with a [godot.Mesh] convex decomposition operation. - * - * Parameters to be used with a [godot.Mesh] convex decomposition operation. + * Parameters to be used with a [Mesh] convex decomposition operation. */ @GodotBaseType public open class MeshConvexDecompositionSettings : RefCounted() { @@ -127,7 +125,8 @@ public open class MeshConvexDecompositionSettings : RefCounted() { } /** - * Controls the precision of the convex-hull generation process during the clipping plane selection stage. Ranges from `1` to `16`. + * Controls the precision of the convex-hull generation process during the clipping plane + * selection stage. Ranges from `1` to `16`. */ public var convexHullDownsampling: Long get() { @@ -197,7 +196,8 @@ public open class MeshConvexDecompositionSettings : RefCounted() { } /** - * If enabled projects output convex hull vertices onto original source mesh to increase floating point accuracy of the results. + * If enabled projects output convex hull vertices onto original source mesh to increase floating + * point accuracy of the results. */ public var projectHullVertices: Boolean get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/MeshDataTool.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/MeshDataTool.kt index 0d40d5c50..16a5f04eb 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/MeshDataTool.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/MeshDataTool.kt @@ -36,96 +36,56 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * Helper tool to access and edit [godot.Mesh] data. - * - * Tutorials: - * [$DOCS_URL/tutorials/3d/procedural_geometry/meshdatatool.html]($DOCS_URL/tutorials/3d/procedural_geometry/meshdatatool.html) - * - * MeshDataTool provides access to individual vertices in a [godot.Mesh]. It allows users to read and edit vertex data of meshes. It also creates an array of faces and edges. - * - * To use MeshDataTool, load a mesh with [createFromSurface]. When you are finished editing the data commit the data to a mesh with [commitToSurface]. - * + * MeshDataTool provides access to individual vertices in a [Mesh]. It allows users to read and edit + * vertex data of meshes. It also creates an array of faces and edges. + * To use MeshDataTool, load a mesh with [createFromSurface]. When you are finished editing the data + * commit the data to a mesh with [commitToSurface]. * Below is an example of how MeshDataTool may be used. * - * [codeblocks] - * - * [gdscript] - * + * gdscript: + * ```gdscript * var mesh = ArrayMesh.new() - * * mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, BoxMesh.new().get_mesh_arrays()) - * * var mdt = MeshDataTool.new() - * * mdt.create_from_surface(mesh, 0) - * * for i in range(mdt.get_vertex_count()): - * * var vertex = mdt.get_vertex(i) - * - * # In this example we extend the mesh by one unit, which results in separated faces as it is flat shaded. - * + * # In this example we extend the mesh by one unit, which results in separated faces as it is + * flat shaded. * vertex += mdt.get_vertex_normal(i) - * * # Save your change. - * * mdt.set_vertex(i, vertex) - * * mesh.clear_surfaces() - * * mdt.commit_to_surface(mesh) - * * var mi = MeshInstance.new() - * * mi.mesh = mesh - * * add_child(mi) - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * var mesh = new ArrayMesh(); - * * mesh.AddSurfaceFromArrays(Mesh.PrimitiveType.Triangles, new BoxMesh().GetMeshArrays()); - * * var mdt = new MeshDataTool(); - * * mdt.CreateFromSurface(mesh, 0); - * * for (var i = 0; i < mdt.GetVertexCount(); i++) - * * { - * * Vector3 vertex = mdt.GetVertex(i); - * - * // In this example we extend the mesh by one unit, which results in separated faces as it is flat shaded. - * + * // In this example we extend the mesh by one unit, which results in separated faces as it is + * flat shaded. * vertex += mdt.GetVertexNormal(i); - * * // Save your change. - * * mdt.SetVertex(i, vertex); - * * } - * * mesh.ClearSurfaces(); - * * mdt.CommitToSurface(mesh); - * * var mi = new MeshInstance(); - * * mi.Mesh = mesh; - * * AddChild(mi); + * ``` * - * [/csharp] - * - * [/codeblocks] - * - * See also [godot.ArrayMesh], [godot.ImmediateMesh] and [godot.SurfaceTool] for procedural geometry generation. - * - * **Note:** Godot uses clockwise [winding order](https://learnopengl.com/Advanced-OpenGL/Face-culling) for front faces of triangle primitive modes. + * See also [ArrayMesh], [ImmediateMesh] and [SurfaceTool] for procedural geometry generation. + * **Note:** Godot uses clockwise [url=https://learnopengl.com/Advanced-OpenGL/Face-culling]winding + * order[/url] for front faces of triangle primitive modes. */ @GodotBaseType public open class MeshDataTool : RefCounted() { @@ -143,9 +103,8 @@ public open class MeshDataTool : RefCounted() { } /** - * Uses specified surface of given [godot.Mesh] to populate data for MeshDataTool. - * - * Requires [godot.Mesh] with primitive type [godot.Mesh.PRIMITIVE_TRIANGLES]. + * Uses specified surface of given [Mesh] to populate data for MeshDataTool. + * Requires [Mesh] with primitive type [constant Mesh.PRIMITIVE_TRIANGLES]. */ public fun createFromSurface(mesh: ArrayMesh, surface: Int): GodotError { TransferContext.writeArguments(OBJECT to mesh, LONG to surface.toLong()) @@ -154,7 +113,7 @@ public open class MeshDataTool : RefCounted() { } /** - * Adds a new surface to specified [godot.Mesh] with edited data. + * Adds a new surface to specified [Mesh] with edited data. */ @JvmOverloads public fun commitToSurface(mesh: ArrayMesh, compressionFlags: Long = 0): GodotError { @@ -164,8 +123,9 @@ public open class MeshDataTool : RefCounted() { } /** - * Returns the [godot.Mesh]'s format. Format is an integer made up of [godot.Mesh] format flags combined together. For example, a mesh containing both vertices and normals would return a format of `3` because [godot.Mesh.ARRAY_FORMAT_VERTEX] is `1` and [godot.Mesh.ARRAY_FORMAT_NORMAL] is `2`. - * + * Returns the [Mesh]'s format. Format is an integer made up of [Mesh] format flags combined + * together. For example, a mesh containing both vertices and normals would return a format of `3` + * because [constant Mesh.ARRAY_FORMAT_VERTEX] is `1` and [constant Mesh.ARRAY_FORMAT_NORMAL] is `2`. * See [enum Mesh.ArrayFormat] for a list of format flags. */ public fun getFormat(): Long { @@ -175,7 +135,7 @@ public open class MeshDataTool : RefCounted() { } /** - * Returns the total number of vertices in [godot.Mesh]. + * Returns the total number of vertices in [Mesh]. */ public fun getVertexCount(): Int { TransferContext.writeArguments() @@ -184,7 +144,7 @@ public open class MeshDataTool : RefCounted() { } /** - * Returns the number of edges in this [godot.Mesh]. + * Returns the number of edges in this [Mesh]. */ public fun getEdgeCount(): Int { TransferContext.writeArguments() @@ -193,7 +153,7 @@ public open class MeshDataTool : RefCounted() { } /** - * Returns the number of faces in this [godot.Mesh]. + * Returns the number of faces in this [Mesh]. */ public fun getFaceCount(): Int { TransferContext.writeArguments() @@ -374,7 +334,6 @@ public open class MeshDataTool : RefCounted() { /** * Returns index of specified vertex connected to given edge. - * * Vertex argument can only be 0 or 1 because edges are comprised of two vertices. */ public fun getEdgeVertex(idx: Int, vertex: Int): Int { @@ -411,34 +370,23 @@ public open class MeshDataTool : RefCounted() { /** * Returns the specified vertex index of the given face. - * * Vertex argument must be either 0, 1, or 2 because faces contain three vertices. - * * **Example:** * - * [codeblocks] - * - * [gdscript] - * - * var index = mesh_data_tool.get_face_vertex(0, 1) # Gets the index of the second vertex of the first face. - * + * gdscript: + * ```gdscript + * var index = mesh_data_tool.get_face_vertex(0, 1) # Gets the index of the second vertex of the + * first face. * var position = mesh_data_tool.get_vertex(index) - * * var normal = mesh_data_tool.get_vertex_normal(index) - * - * [/gdscript] - * - * [csharp] - * - * int index = meshDataTool.GetFaceVertex(0, 1); // Gets the index of the second vertex of the first face. - * + * ``` + * csharp: + * ```csharp + * int index = meshDataTool.GetFaceVertex(0, 1); // Gets the index of the second vertex of the + * first face. * Vector3 position = meshDataTool.GetVertex(index); - * * Vector3 normal = meshDataTool.GetVertexNormal(index); - * - * [/csharp] - * - * [/codeblocks] + * ``` */ public fun getFaceVertex(idx: Int, vertex: Int): Int { TransferContext.writeArguments(LONG to idx.toLong(), LONG to vertex.toLong()) @@ -448,7 +396,6 @@ public open class MeshDataTool : RefCounted() { /** * Returns specified edge associated with given face. - * * Edge argument must be either 0, 1, or 2 because a face only has three edges. */ public fun getFaceEdge(idx: Int, edge: Int): Int { @@ -484,7 +431,7 @@ public open class MeshDataTool : RefCounted() { } /** - * Sets the material to be used by newly-constructed [godot.Mesh]. + * Sets the material to be used by newly-constructed [Mesh]. */ public fun setMaterial(material: Material): Unit { TransferContext.writeArguments(OBJECT to material) @@ -492,7 +439,7 @@ public open class MeshDataTool : RefCounted() { } /** - * Returns the material assigned to the [godot.Mesh]. + * Returns the material assigned to the [Mesh]. */ public fun getMaterial(): Material? { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/MeshInstance2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/MeshInstance2D.kt index 639cb5841..4278a4630 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/MeshInstance2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/MeshInstance2D.kt @@ -19,12 +19,9 @@ import kotlin.Int import kotlin.Suppress /** - * Node used for displaying a [godot.Mesh] in 2D. - * - * Tutorials: - * [$DOCS_URL/tutorials/2d/2d_meshes.html]($DOCS_URL/tutorials/2d/2d_meshes.html) - * - * Node used for displaying a [godot.Mesh] in 2D. A [godot.MeshInstance2D] can be automatically created from an existing [godot.Sprite2D] via a tool in the editor toolbar. Select the [godot.Sprite2D] node, then choose **Sprite2D > Convert to MeshInstance2D** at the top of the 2D editor viewport. + * Node used for displaying a [Mesh] in 2D. A [MeshInstance2D] can be automatically created from an + * existing [Sprite2D] via a tool in the editor toolbar. Select the [Sprite2D] node, then choose + * **Sprite2D > Convert to MeshInstance2D** at the top of the 2D editor viewport. */ @GodotBaseType public open class MeshInstance2D : Node2D() { @@ -34,7 +31,7 @@ public open class MeshInstance2D : Node2D() { public val textureChanged: Signal0 by signal() /** - * The [godot.Mesh] that will be drawn by the [godot.MeshInstance2D]. + * The [Mesh] that will be drawn by the [MeshInstance2D]. */ public var mesh: Mesh? get() { @@ -48,7 +45,8 @@ public open class MeshInstance2D : Node2D() { } /** - * The [godot.Texture2D] that will be used if using the default [godot.CanvasItemMaterial]. Can be accessed as `TEXTURE` in CanvasItem shader. + * The [Texture2D] that will be used if using the default [CanvasItemMaterial]. Can be accessed as + * `TEXTURE` in CanvasItem shader. */ public var texture: Texture2D? get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/MeshInstance3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/MeshInstance3D.kt index b0994810e..46945bfe4 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/MeshInstance3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/MeshInstance3D.kt @@ -29,17 +29,16 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * Node that instances meshes into a scenario. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/678](https://godotengine.org/asset-library/asset/678) - * - * MeshInstance3D is a node that takes a [godot.Mesh] resource and adds it to the current scenario by creating an instance of it. This is the class most often used render 3D geometry and can be used to instance a single [godot.Mesh] in many places. This allows reusing geometry, which can save on resources. When a [godot.Mesh] has to be instantiated more than thousands of times at close proximity, consider using a [godot.MultiMesh] in a [godot.MultiMeshInstance3D] instead. + * MeshInstance3D is a node that takes a [Mesh] resource and adds it to the current scenario by + * creating an instance of it. This is the class most often used render 3D geometry and can be used to + * instance a single [Mesh] in many places. This allows reusing geometry, which can save on resources. + * When a [Mesh] has to be instantiated more than thousands of times at close proximity, consider using + * a [MultiMesh] in a [MultiMeshInstance3D] instead. */ @GodotBaseType public open class MeshInstance3D : GeometryInstance3D() { /** - * The [godot.Mesh] resource for the instance. + * The [Mesh] resource for the instance. */ public var mesh: Mesh? get() { @@ -53,7 +52,7 @@ public open class MeshInstance3D : GeometryInstance3D() { } /** - * The [godot.Skin] to be used by this instance. + * The [Skin] to be used by this instance. */ public var skin: Skin? get() { @@ -67,7 +66,7 @@ public open class MeshInstance3D : GeometryInstance3D() { } /** - * [godot.core.NodePath] to the [godot.Skeleton3D] associated with the instance. + * [NodePath] to the [Skeleton3D] associated with the instance. */ public var skeleton: NodePath get() { @@ -86,7 +85,8 @@ public open class MeshInstance3D : GeometryInstance3D() { } /** - * Returns the number of surface override materials. This is equivalent to [godot.Mesh.getSurfaceCount]. See also [getSurfaceOverrideMaterial]. + * Returns the number of surface override materials. This is equivalent to [Mesh.getSurfaceCount]. + * See also [getSurfaceOverrideMaterial]. */ public fun getSurfaceOverrideMaterialCount(): Int { TransferContext.writeArguments() @@ -95,9 +95,11 @@ public open class MeshInstance3D : GeometryInstance3D() { } /** - * Sets the override [material] for the specified [surface] of the [godot.Mesh] resource. This material is associated with this [godot.MeshInstance3D] rather than with [mesh]. - * - * **Note:** This assigns the [godot.Material] associated to the [godot.MeshInstance3D]'s Surface Material Override properties, not the material within the [godot.Mesh] resource. To set the material within the [godot.Mesh] resource, use [godot.Mesh.surfaceGetMaterial] instead. + * Sets the override [param material] for the specified [param surface] of the [Mesh] resource. + * This material is associated with this [MeshInstance3D] rather than with [mesh]. + * **Note:** This assigns the [Material] associated to the [MeshInstance3D]'s Surface Material + * Override properties, not the material within the [Mesh] resource. To set the material within the + * [Mesh] resource, use [Mesh.surfaceGetMaterial] instead. */ public fun setSurfaceOverrideMaterial(surface: Int, material: Material): Unit { TransferContext.writeArguments(LONG to surface.toLong(), OBJECT to material) @@ -105,9 +107,11 @@ public open class MeshInstance3D : GeometryInstance3D() { } /** - * Returns the override [godot.Material] for the specified [surface] of the [godot.Mesh] resource. See also [getSurfaceOverrideMaterialCount]. - * - * **Note:** This returns the [godot.Material] associated to the [godot.MeshInstance3D]'s Surface Material Override properties, not the material within the [godot.Mesh] resource. To get the material within the [godot.Mesh] resource, use [godot.Mesh.surfaceGetMaterial] instead. + * Returns the override [Material] for the specified [param surface] of the [Mesh] resource. See + * also [getSurfaceOverrideMaterialCount]. + * **Note:** This returns the [Material] associated to the [MeshInstance3D]'s Surface Material + * Override properties, not the material within the [Mesh] resource. To get the material within the + * [Mesh] resource, use [Mesh.surfaceGetMaterial] instead. */ public fun getSurfaceOverrideMaterial(surface: Int): Material? { TransferContext.writeArguments(LONG to surface.toLong()) @@ -116,8 +120,10 @@ public open class MeshInstance3D : GeometryInstance3D() { } /** - * Returns the [godot.Material] that will be used by the [godot.Mesh] when drawing. This can return the [godot.GeometryInstance3D.materialOverride], the surface override [godot.Material] defined in this [godot.MeshInstance3D], or the surface [godot.Material] defined in the [mesh]. For example, if [godot.GeometryInstance3D.materialOverride] is used, all surfaces will return the override material. - * + * Returns the [Material] that will be used by the [Mesh] when drawing. This can return the + * [GeometryInstance3D.materialOverride], the surface override [Material] defined in this + * [MeshInstance3D], or the surface [Material] defined in the [mesh]. For example, if + * [GeometryInstance3D.materialOverride] is used, all surfaces will return the override material. * Returns `null` if no material is active, including when [mesh] is `null`. */ public fun getActiveMaterial(surface: Int): Material? { @@ -127,7 +133,8 @@ public open class MeshInstance3D : GeometryInstance3D() { } /** - * This helper creates a [godot.StaticBody3D] child node with a [godot.ConcavePolygonShape3D] collision shape calculated from the mesh geometry. It's mainly used for testing. + * This helper creates a [StaticBody3D] child node with a [ConcavePolygonShape3D] collision shape + * calculated from the mesh geometry. It's mainly used for testing. */ public fun createTrimeshCollision(): Unit { TransferContext.writeArguments() @@ -135,11 +142,12 @@ public open class MeshInstance3D : GeometryInstance3D() { } /** - * This helper creates a [godot.StaticBody3D] child node with a [godot.ConvexPolygonShape3D] collision shape calculated from the mesh geometry. It's mainly used for testing. - * - * If [clean] is `true` (default), duplicate and interior vertices are removed automatically. You can set it to `false` to make the process faster if not needed. - * - * If [simplify] is `true`, the geometry can be further simplified to reduce the number of vertices. Disabled by default. + * This helper creates a [StaticBody3D] child node with a [ConvexPolygonShape3D] collision shape + * calculated from the mesh geometry. It's mainly used for testing. + * If [param clean] is `true` (default), duplicate and interior vertices are removed + * automatically. You can set it to `false` to make the process faster if not needed. + * If [param simplify] is `true`, the geometry can be further simplified to reduce the number of + * vertices. Disabled by default. */ @JvmOverloads public fun createConvexCollision(clean: Boolean = true, simplify: Boolean = false): Unit { @@ -148,7 +156,9 @@ public open class MeshInstance3D : GeometryInstance3D() { } /** - * This helper creates a [godot.StaticBody3D] child node with multiple [godot.ConvexPolygonShape3D] collision shapes calculated from the mesh geometry via convex decomposition. The convex decomposition operation can be controlled with parameters from the optional [settings]. + * This helper creates a [StaticBody3D] child node with multiple [ConvexPolygonShape3D] collision + * shapes calculated from the mesh geometry via convex decomposition. The convex decomposition + * operation can be controlled with parameters from the optional [param settings]. */ @JvmOverloads public fun createMultipleConvexCollisions(settings: MeshConvexDecompositionSettings? = null): @@ -167,7 +177,8 @@ public open class MeshInstance3D : GeometryInstance3D() { } /** - * Returns the index of the blend shape with the given [name]. Returns `-1` if no blend shape with this name exists, including when [mesh] is `null`. + * Returns the index of the blend shape with the given [param name]. Returns `-1` if no blend + * shape with this name exists, including when [mesh] is `null`. */ public fun findBlendShapeByName(name: StringName): Int { TransferContext.writeArguments(STRING_NAME to name) @@ -176,7 +187,8 @@ public open class MeshInstance3D : GeometryInstance3D() { } /** - * Returns the value of the blend shape at the given [blendShapeIdx]. Returns `0.0` and produces an error if [mesh] is `null` or doesn't have a blend shape at that index. + * Returns the value of the blend shape at the given [param blend_shape_idx]. Returns `0.0` and + * produces an error if [mesh] is `null` or doesn't have a blend shape at that index. */ public fun getBlendShapeValue(blendShapeIdx: Int): Float { TransferContext.writeArguments(LONG to blendShapeIdx.toLong()) @@ -185,7 +197,8 @@ public open class MeshInstance3D : GeometryInstance3D() { } /** - * Sets the value of the blend shape at [blendShapeIdx] to [value]. Produces an error if [mesh] is `null` or doesn't have a blend shape at that index. + * Sets the value of the blend shape at [param blend_shape_idx] to [param value]. Produces an + * error if [mesh] is `null` or doesn't have a blend shape at that index. */ public fun setBlendShapeValue(blendShapeIdx: Int, `value`: Float): Unit { TransferContext.writeArguments(LONG to blendShapeIdx.toLong(), DOUBLE to value.toDouble()) @@ -193,7 +206,8 @@ public open class MeshInstance3D : GeometryInstance3D() { } /** - * This helper creates a [godot.MeshInstance3D] child node with gizmos at every vertex calculated from the mesh geometry. It's mainly used for testing. + * This helper creates a [MeshInstance3D] child node with gizmos at every vertex calculated from + * the mesh geometry. It's mainly used for testing. */ public fun createDebugTangents(): Unit { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/MeshLibrary.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/MeshLibrary.kt index 427c29a8d..8f6b3f89a 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/MeshLibrary.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/MeshLibrary.kt @@ -29,12 +29,8 @@ import kotlin.Suppress import kotlin.Unit /** - * Library of meshes. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/125](https://godotengine.org/asset-library/asset/125) - * - * A library of meshes. Contains a list of [godot.Mesh] resources, each with a name and ID. Each item can also include collision and navigation shapes. This resource is used in [godot.GridMap]. + * A library of meshes. Contains a list of [Mesh] resources, each with a name and ID. Each item can + * also include collision and navigation shapes. This resource is used in [GridMap]. */ @GodotBaseType public open class MeshLibrary : Resource() { @@ -45,7 +41,6 @@ public open class MeshLibrary : Resource() { /** * Creates a new item in the library with the given ID. - * * You can get an unused ID from [getLastUnusedItemId]. */ public fun createItem(id: Int): Unit { @@ -55,8 +50,8 @@ public open class MeshLibrary : Resource() { /** * Sets the item's name. - * - * This name is shown in the editor. It can also be used to look up the item later using [findItemByName]. + * This name is shown in the editor. It can also be used to look up the item later using + * [findItemByName]. */ public fun setItemName(id: Int, name: String): Unit { TransferContext.writeArguments(LONG to id.toLong(), STRING to name) @@ -105,8 +100,8 @@ public open class MeshLibrary : Resource() { /** * Sets an item's collision shapes. - * - * The array should consist of [godot.Shape3D] objects, each followed by a [godot.Transform3D] that will be applied to it. For shapes that should not have a transform, use [godot.Transform3D.IDENTITY]. + * The array should consist of [Shape3D] objects, each followed by a [Transform3D] that will be + * applied to it. For shapes that should not have a transform, use [constant Transform3D.IDENTITY]. */ public fun setItemShapes(id: Int, shapes: VariantArray): Unit { TransferContext.writeArguments(LONG to id.toLong(), ARRAY to shapes) @@ -178,8 +173,7 @@ public open class MeshLibrary : Resource() { /** * Returns an item's collision shapes. - * - * The array consists of each [godot.Shape3D] followed by its [godot.Transform3D]. + * The array consists of each [Shape3D] followed by its [Transform3D]. */ public fun getItemShapes(id: Int): VariantArray { TransferContext.writeArguments(LONG to id.toLong()) @@ -188,7 +182,10 @@ public open class MeshLibrary : Resource() { } /** - * When running in the editor, returns a generated item preview (a 3D rendering in isometric perspective). When used in a running project, returns the manually-defined item preview which can be set using [setItemPreview]. Returns an empty [godot.Texture2D] if no preview was manually set in a running project. + * When running in the editor, returns a generated item preview (a 3D rendering in isometric + * perspective). When used in a running project, returns the manually-defined item preview which can + * be set using [setItemPreview]. Returns an empty [Texture2D] if no preview was manually set in a + * running project. */ public fun getItemPreview(id: Int): Texture2D? { TransferContext.writeArguments(LONG to id.toLong()) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/MeshTexture.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/MeshTexture.kt index 93af7357e..287f63a92 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/MeshTexture.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/MeshTexture.kt @@ -22,9 +22,8 @@ import kotlin.Suppress import kotlin.Unit /** - * Simple texture that uses a mesh to draw itself. - * - * Simple texture that uses a mesh to draw itself. It's limited because flags can't be changed and region drawing is not supported. + * Simple texture that uses a mesh to draw itself. It's limited because flags can't be changed and + * region drawing is not supported. */ @GodotBaseType public open class MeshTexture : Texture2D() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/MethodTweener.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/MethodTweener.kt index 54763b7d4..33ca0870a 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/MethodTweener.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/MethodTweener.kt @@ -19,13 +19,12 @@ import kotlin.Int import kotlin.Suppress /** - * Interpolates an abstract value and supplies it to a method called over time. - * - * [godot.MethodTweener] is similar to a combination of [godot.CallbackTweener] and [godot.PropertyTweener]. It calls a method providing an interpolated value as a parameter. See [godot.Tween.tweenMethod] for more usage information. - * + * [MethodTweener] is similar to a combination of [CallbackTweener] and [PropertyTweener]. It calls + * a method providing an interpolated value as a parameter. See [Tween.tweenMethod] for more usage + * information. * The tweener will finish automatically if the callback's target object is freed. - * - * **Note:** [godot.Tween.tweenMethod] is the only correct way to create [godot.MethodTweener]. Any [godot.MethodTweener] created manually will not function correctly. + * **Note:** [Tween.tweenMethod] is the only correct way to create [MethodTweener]. Any + * [MethodTweener] created manually will not function correctly. */ @GodotBaseType public open class MethodTweener : Tweener() { @@ -35,7 +34,8 @@ public open class MethodTweener : Tweener() { } /** - * Sets the time in seconds after which the [godot.MethodTweener] will start interpolating. By default there's no delay. + * Sets the time in seconds after which the [MethodTweener] will start interpolating. By default + * there's no delay. */ public fun setDelay(delay: Double): MethodTweener? { TransferContext.writeArguments(DOUBLE to delay) @@ -44,7 +44,8 @@ public open class MethodTweener : Tweener() { } /** - * Sets the type of used transition from [enum Tween.TransitionType]. If not set, the default transition is used from the [godot.Tween] that contains this Tweener. + * Sets the type of used transition from [enum Tween.TransitionType]. If not set, the default + * transition is used from the [Tween] that contains this Tweener. */ public fun setTrans(trans: Tween.TransitionType): MethodTweener? { TransferContext.writeArguments(LONG to trans.id) @@ -53,7 +54,8 @@ public open class MethodTweener : Tweener() { } /** - * Sets the type of used easing from [enum Tween.EaseType]. If not set, the default easing is used from the [godot.Tween] that contains this Tweener. + * Sets the type of used easing from [enum Tween.EaseType]. If not set, the default easing is used + * from the [Tween] that contains this Tweener. */ public fun setEase(ease: Tween.EaseType): MethodTweener? { TransferContext.writeArguments(LONG to ease.id) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/MissingNode.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/MissingNode.kt index 2ada0ff54..656cf884c 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/MissingNode.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/MissingNode.kt @@ -19,9 +19,9 @@ import kotlin.String import kotlin.Suppress /** - * An internal editor class intended for keeping the data of unrecognized nodes. - * - * This is an internal editor class intended for keeping data of nodes of unknown type (most likely this type was supplied by an extension that is no longer loaded). It can't be manually instantiated or placed in the scene. Ignore it if you don't know what it is. + * This is an internal editor class intended for keeping data of nodes of unknown type (most likely + * this type was supplied by an extension that is no longer loaded). It can't be manually instantiated + * or placed in the scene. Ignore it if you don't know what it is. */ @GodotBaseType public open class MissingNode : Node() { @@ -39,9 +39,6 @@ public open class MissingNode : Node() { TransferContext.callMethod(rawPtr, MethodBindings.setOriginalClassPtr, NIL) } - /** - * - */ public var recordingProperties: Boolean get() { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/MissingResource.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/MissingResource.kt index 9713d840d..2b6f523d4 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/MissingResource.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/MissingResource.kt @@ -19,9 +19,9 @@ import kotlin.String import kotlin.Suppress /** - * An internal editor class intended for keeping the data of unrecognized resources. - * - * This is an internal editor class intended for keeping data of resources of unknown type (most likely this type was supplied by an extension that is no longer loaded). It can't be manually instantiated or placed in the scene. Ignore it if you don't know what it is. + * This is an internal editor class intended for keeping data of resources of unknown type (most + * likely this type was supplied by an extension that is no longer loaded). It can't be manually + * instantiated or placed in the scene. Ignore it if you don't know what it is. */ @GodotBaseType public open class MissingResource : Resource() { @@ -39,9 +39,6 @@ public open class MissingResource : Resource() { TransferContext.callMethod(rawPtr, MethodBindings.setOriginalClassPtr, NIL) } - /** - * - */ public var recordingProperties: Boolean get() { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/MobileVRInterface.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/MobileVRInterface.kt index e9acb50f9..7738cf06f 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/MobileVRInterface.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/MobileVRInterface.kt @@ -17,8 +17,24 @@ import kotlin.Double import kotlin.Int import kotlin.Suppress +/** + * This is a generic mobile VR implementation where you need to provide details about the phone and + * HMD used. It does not rely on any existing framework. This is the most basic interface we have. For + * the best effect, you need a mobile phone with a gyroscope and accelerometer. + * Note that even though there is no positional tracking, the camera will assume the headset is at a + * height of 1.85 meters. You can change this by setting [eyeHeight]. + * You can initialize this interface as follows: + * [codeblock] + * var interface = XRServer.find_interface("Native mobile") + * if interface and interface.initialize(): + * get_viewport().xr = true + * [/codeblock] + */ @GodotBaseType public open class MobileVRInterface : XRInterface() { + /** + * The height at which the camera is placed in relation to the ground (i.e. [XROrigin3D] node). + */ public var eyeHeight: Double get() { TransferContext.writeArguments() @@ -30,6 +46,10 @@ public open class MobileVRInterface : XRInterface() { TransferContext.callMethod(rawPtr, MethodBindings.setEyeHeightPtr, NIL) } + /** + * The interocular distance, also known as the interpupillary distance. The distance between the + * pupils of the left and right eye. + */ public var iod: Double get() { TransferContext.writeArguments() @@ -41,6 +61,9 @@ public open class MobileVRInterface : XRInterface() { TransferContext.callMethod(rawPtr, MethodBindings.setIodPtr, NIL) } + /** + * The width of the display in centimeters. + */ public var displayWidth: Double get() { TransferContext.writeArguments() @@ -52,6 +75,9 @@ public open class MobileVRInterface : XRInterface() { TransferContext.callMethod(rawPtr, MethodBindings.setDisplayWidthPtr, NIL) } + /** + * The distance between the display and the lenses inside of the device in centimeters. + */ public var displayToLens: Double get() { TransferContext.writeArguments() @@ -63,6 +89,11 @@ public open class MobileVRInterface : XRInterface() { TransferContext.callMethod(rawPtr, MethodBindings.setDisplayToLensPtr, NIL) } + /** + * The oversample setting. Because of the lens distortion we have to render our buffers at a + * higher resolution then the screen can natively handle. A value between 1.5 and 2.0 often provides + * good results but at the cost of performance. + */ public var oversample: Double get() { TransferContext.writeArguments() @@ -74,6 +105,10 @@ public open class MobileVRInterface : XRInterface() { TransferContext.callMethod(rawPtr, MethodBindings.setOversamplePtr, NIL) } + /** + * The k1 lens factor is one of the two constants that define the strength of the lens used and + * directly influences the lens distortion effect. + */ public var k1: Double get() { TransferContext.writeArguments() @@ -85,6 +120,9 @@ public open class MobileVRInterface : XRInterface() { TransferContext.callMethod(rawPtr, MethodBindings.setK1Ptr, NIL) } + /** + * The k2 lens factor, see k1. + */ public var k2: Double get() { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/MouseButton.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/MouseButton.kt index 517066eb9..ebb112ab6 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/MouseButton.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/MouseButton.kt @@ -6,15 +6,46 @@ import kotlin.Long public enum class MouseButton( id: Long, ) { + /** + * Enum value which doesn't correspond to any mouse button. This is used to initialize [enum + * MouseButton] properties with a generic state. + */ MOUSE_BUTTON_NONE(0), + /** + * Primary mouse button, usually assigned to the left button. + */ MOUSE_BUTTON_LEFT(1), + /** + * Secondary mouse button, usually assigned to the right button. + */ MOUSE_BUTTON_RIGHT(2), + /** + * Middle mouse button. + */ MOUSE_BUTTON_MIDDLE(3), + /** + * Mouse wheel scrolling up. + */ MOUSE_BUTTON_WHEEL_UP(4), + /** + * Mouse wheel scrolling down. + */ MOUSE_BUTTON_WHEEL_DOWN(5), + /** + * Mouse wheel left button (only present on some mice). + */ MOUSE_BUTTON_WHEEL_LEFT(6), + /** + * Mouse wheel right button (only present on some mice). + */ MOUSE_BUTTON_WHEEL_RIGHT(7), + /** + * Extra mouse button 1. This is sometimes present, usually to the sides of the mouse. + */ MOUSE_BUTTON_XBUTTON1(8), + /** + * Extra mouse button 2. This is sometimes present, usually to the sides of the mouse. + */ MOUSE_BUTTON_XBUTTON2(9), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/MovieWriter.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/MovieWriter.kt index 50d2cbee1..b432da983 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/MovieWriter.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/MovieWriter.kt @@ -23,21 +23,37 @@ import kotlin.Suppress import kotlin.Unit /** - * Abstract class for non-real-time video recording encoders. - * - * Godot can record videos with non-real-time simulation. Like the `--fixed-fps` [command line argument]($DOCS_URL/tutorials/editor/command_line_tutorial.html), this forces the reported `delta` in [godot.Node.Process] functions to be identical across frames, regardless of how long it actually took to render the frame. This can be used to record high-quality videos with perfect frame pacing regardless of your hardware's capabilities. - * - * Godot has 2 built-in [godot.MovieWriter]s: - * - * - AVI container with MJPEG for video and uncompressed audio (`.avi` file extension). Lossy compression, medium file sizes, fast encoding. The lossy compression quality can be adjusted by changing [godot.ProjectSettings.editor/movieWriter/mjpegQuality]. The resulting file can be viewed in most video players, but it must be converted to another format for viewing on the web or by Godot with [godot.VideoStreamPlayer]. MJPEG does not support transparency. AVI output is currently limited to a file of 4 GB in size at most. - * - * - PNG image sequence for video and WAV for audio (`.png` file extension). Lossless compression, large file sizes, slow encoding. Designed to be encoded to a video file with another tool such as [godot.FFmpeg](https://ffmpeg.org/) after recording. Transparency is currently not supported, even if the root viewport is set to be transparent. - * - * If you need to encode to a different format or pipe a stream through third-party software, you can extend the [godot.MovieWriter] class to create your own movie writers. This should typically be done using GDExtension for performance reasons. - * - * **Editor usage:** A default movie file path can be specified in [godot.ProjectSettings.editor/movieWriter/movieFile]. Alternatively, for running single scenes, a `movie_file` metadata can be added to the root node, specifying the path to a movie file that will be used when recording that scene. Once a path is set, click the video reel icon in the top-right corner of the editor to enable Movie Maker mode, then run any scene as usual. The engine will start recording as soon as the splash screen is finished, and it will only stop recording when the engine quits. Click the video reel icon again to disable Movie Maker mode. Note that toggling Movie Maker mode does not affect project instances that are already running. - * - * **Note:** MovieWriter is available for use in both the editor and exported projects, but it is *not* designed for use by end users to record videos while playing. Players wishing to record gameplay videos should install tools such as [godot.OBS Studio](https://obsproject.com/) or [godot.SimpleScreenRecorder](https://www.maartenbaert.be/simplescreenrecorder/) instead. + * Godot can record videos with non-real-time simulation. Like the `--fixed-fps` + * [url=$DOCS_URL/tutorials/editor/command_line_tutorial.html]command line argument[/url], this forces + * the reported `delta` in [Node.Process] functions to be identical across frames, regardless of how + * long it actually took to render the frame. This can be used to record high-quality videos with + * perfect frame pacing regardless of your hardware's capabilities. + * Godot has 2 built-in [MovieWriter]s: + * - AVI container with MJPEG for video and uncompressed audio (`.avi` file extension). Lossy + * compression, medium file sizes, fast encoding. The lossy compression quality can be adjusted by + * changing [ProjectSettings.editor/movieWriter/mjpegQuality]. The resulting file can be viewed in most + * video players, but it must be converted to another format for viewing on the web or by Godot with + * [VideoStreamPlayer]. MJPEG does not support transparency. AVI output is currently limited to a file + * of 4 GB in size at most. + * - PNG image sequence for video and WAV for audio (`.png` file extension). Lossless compression, + * large file sizes, slow encoding. Designed to be encoded to a video file with another tool such as + * [url=https://ffmpeg.org/]FFmpeg[/url] after recording. Transparency is currently not supported, even + * if the root viewport is set to be transparent. + * If you need to encode to a different format or pipe a stream through third-party software, you + * can extend the [MovieWriter] class to create your own movie writers. This should typically be done + * using GDExtension for performance reasons. + * **Editor usage:** A default movie file path can be specified in + * [ProjectSettings.editor/movieWriter/movieFile]. Alternatively, for running single scenes, a + * `movie_file` metadata can be added to the root node, specifying the path to a movie file that will + * be used when recording that scene. Once a path is set, click the video reel icon in the top-right + * corner of the editor to enable Movie Maker mode, then run any scene as usual. The engine will start + * recording as soon as the splash screen is finished, and it will only stop recording when the engine + * quits. Click the video reel icon again to disable Movie Maker mode. Note that toggling Movie Maker + * mode does not affect project instances that are already running. + * **Note:** MovieWriter is available for use in both the editor and exported projects, but it is + * *not* designed for use by end users to record videos while playing. Players wishing to record + * gameplay videos should install tools such as [url=https://obsproject.com/]OBS Studio[/url] or + * [url=https://www.maartenbaert.be/simplescreenrecorder/]SimpleScreenRecorder[/url] instead. */ @GodotBaseType public open class MovieWriter : Object() { @@ -47,35 +63,44 @@ public open class MovieWriter : Object() { } /** - * Called when the audio sample rate used for recording the audio is requested by the engine. The value returned must be specified in Hz. Defaults to 48000 Hz if [_getAudioMixRate] is not overridden. + * Called when the audio sample rate used for recording the audio is requested by the engine. The + * value returned must be specified in Hz. Defaults to 48000 Hz if [_getAudioMixRate] is not + * overridden. */ public open fun _getAudioMixRate(): Long { throw NotImplementedError("_get_audio_mix_rate is not implemented for MovieWriter") } /** - * Called when the audio speaker mode used for recording the audio is requested by the engine. This can affect the number of output channels in the resulting audio file/stream. Defaults to [godot.AudioServer.SPEAKER_MODE_STEREO] if [_getAudioSpeakerMode] is not overridden. + * Called when the audio speaker mode used for recording the audio is requested by the engine. + * This can affect the number of output channels in the resulting audio file/stream. Defaults to + * [constant AudioServer.SPEAKER_MODE_STEREO] if [_getAudioSpeakerMode] is not overridden. */ public open fun _getAudioSpeakerMode(): AudioServer.SpeakerMode { throw NotImplementedError("_get_audio_speaker_mode is not implemented for MovieWriter") } /** - * Called when the engine determines whether this [godot.MovieWriter] is able to handle the file at [path]. Must return `true` if this [godot.MovieWriter] is able to handle the given file path, `false` otherwise. Typically, [_handlesFile] is overridden as follows to allow the user to record a file at any path with a given file extension: - * - * ``` - * func _handles_file(path): - * # Allows specifying an output file with a `.mkv` file extension (case-insensitive), - * # either in the Project Settings or with the `--write-movie ` command line argument. - * return path.get_extension().to_lower() == "mkv" - * ``` + * Called when the engine determines whether this [MovieWriter] is able to handle the file at + * [param path]. Must return `true` if this [MovieWriter] is able to handle the given file path, + * `false` otherwise. Typically, [_handlesFile] is overridden as follows to allow the user to record + * a file at any path with a given file extension: + * [codeblock] + * func _handles_file(path): + * # Allows specifying an output file with a `.mkv` file extension (case-insensitive), + * # either in the Project Settings or with the `--write-movie ` command line argument. + * return path.get_extension().to_lower() == "mkv" + * [/codeblock] */ public open fun _handlesFile(path: String): Boolean { throw NotImplementedError("_handles_file is not implemented for MovieWriter") } /** - * Called once before the engine starts writing video and audio data. [movieSize] is the width and height of the video to save. [fps] is the number of frames per second specified in the project settings or using the `--fixed-fps ` [command line argument]($DOCS_URL/tutorials/editor/command_line_tutorial.html). + * Called once before the engine starts writing video and audio data. [param movie_size] is the + * width and height of the video to save. [param fps] is the number of frames per second specified in + * the project settings or using the `--fixed-fps ` + * [url=$DOCS_URL/tutorials/editor/command_line_tutorial.html]command line argument[/url]. */ public open fun _writeBegin( movieSize: Vector2i, @@ -86,18 +111,20 @@ public open class MovieWriter : Object() { } /** - * Called when the engine finishes writing. This occurs when the engine quits by pressing the window manager's close button, or when [godot.SceneTree.quit] is called. - * - * **Note:** Pressing [kbd]Ctrl + C[/kbd] on the terminal running the editor/project does *not* result in [_writeEnd] being called. + * Called when the engine finishes writing. This occurs when the engine quits by pressing the + * window manager's close button, or when [SceneTree.quit] is called. + * **Note:** Pressing [kbd]Ctrl + C[/kbd] on the terminal running the editor/project does *not* + * result in [_writeEnd] being called. */ public open fun _writeEnd(): Unit { } public companion object { /** - * Adds a writer to be usable by the engine. The supported file extensions can be set by overriding [_handlesFile]. - * - * **Note:** [addWriter] must be called early enough in the engine initialization to work, as movie writing is designed to start at the same time as the rest of the engine. + * Adds a writer to be usable by the engine. The supported file extensions can be set by + * overriding [_handlesFile]. + * **Note:** [addWriter] must be called early enough in the engine initialization to work, as + * movie writing is designed to start at the same time as the rest of the engine. */ public fun addWriter(writer: MovieWriter): Unit { TransferContext.writeArguments(OBJECT to writer) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/MultiMesh.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/MultiMesh.kt index 55284deb4..3ace56319 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/MultiMesh.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/MultiMesh.kt @@ -30,21 +30,16 @@ import kotlin.Suppress import kotlin.Unit /** - * Provides high-performance drawing of a mesh multiple times using GPU instancing. - * - * Tutorials: - * [$DOCS_URL/tutorials/performance/vertex_animation/animating_thousands_of_fish.html]($DOCS_URL/tutorials/performance/vertex_animation/animating_thousands_of_fish.html) - * - * MultiMesh provides low-level mesh instancing. Drawing thousands of [godot.MeshInstance3D] nodes can be slow, since each object is submitted to the GPU then drawn individually. - * - * MultiMesh is much faster as it can draw thousands of instances with a single draw call, resulting in less API overhead. - * - * As a drawback, if the instances are too far away from each other, performance may be reduced as every single instance will always render (they are spatially indexed as one, for the whole object). - * + * MultiMesh provides low-level mesh instancing. Drawing thousands of [MeshInstance3D] nodes can be + * slow, since each object is submitted to the GPU then drawn individually. + * MultiMesh is much faster as it can draw thousands of instances with a single draw call, resulting + * in less API overhead. + * As a drawback, if the instances are too far away from each other, performance may be reduced as + * every single instance will always render (they are spatially indexed as one, for the whole object). * Since instances may have any behavior, the AABB used for visibility must be provided by the user. - * - * **Note:** A MultiMesh is a single object, therefore the same maximum lights per object restriction applies. This means, that once the maximum lights are consumed by one or more instances, the rest of the MultiMesh instances will **not** receive any lighting. - * + * **Note:** A MultiMesh is a single object, therefore the same maximum lights per object + * restriction applies. This means, that once the maximum lights are consumed by one or more instances, + * the rest of the MultiMesh instances will **not** receive any lighting. * **Note:** Blend Shapes will be ignored if used in a MultiMesh. */ @GodotBaseType @@ -64,7 +59,9 @@ public open class MultiMesh : Resource() { } /** - * If `true`, the [godot.MultiMesh] will use color data (see [setInstanceColor]). Can only be set when [instanceCount] is `0` or less. This means that you need to call this method before setting the instance count, or temporarily reset it to `0`. + * If `true`, the [MultiMesh] will use color data (see [setInstanceColor]). Can only be set when + * [instanceCount] is `0` or less. This means that you need to call this method before setting the + * instance count, or temporarily reset it to `0`. */ public var useColors: Boolean get() { @@ -78,7 +75,9 @@ public open class MultiMesh : Resource() { } /** - * If `true`, the [godot.MultiMesh] will use custom data (see [setInstanceCustomData]). Can only be set when [instanceCount] is `0` or less. This means that you need to call this method before setting the instance count, or temporarily reset it to `0`. + * If `true`, the [MultiMesh] will use custom data (see [setInstanceCustomData]). Can only be set + * when [instanceCount] is `0` or less. This means that you need to call this method before setting + * the instance count, or temporarily reset it to `0`. */ public var useCustomData: Boolean get() { @@ -92,8 +91,8 @@ public open class MultiMesh : Resource() { } /** - * Number of instances that will get drawn. This clears and (re)sizes the buffers. Setting data format or flags afterwards will have no effect. - * + * Number of instances that will get drawn. This clears and (re)sizes the buffers. Setting data + * format or flags afterwards will have no effect. * By default, all instances are drawn but you can limit this with [visibleInstanceCount]. */ public var instanceCount: Int @@ -108,7 +107,8 @@ public open class MultiMesh : Resource() { } /** - * Limits the number of instances drawn, -1 draws all instances. Changing this does not change the sizes of the buffers. + * Limits the number of instances drawn, -1 draws all instances. Changing this does not change the + * sizes of the buffers. */ public var visibleInstanceCount: Int get() { @@ -122,9 +122,9 @@ public open class MultiMesh : Resource() { } /** - * [godot.Mesh] resource to be instanced. - * - * The looks of the individual instances can be modified using [setInstanceColor] and [setInstanceCustomData]. + * [Mesh] resource to be instanced. + * The looks of the individual instances can be modified using [setInstanceColor] and + * [setInstanceCustomData]. */ public var mesh: Mesh? get() { @@ -137,9 +137,6 @@ public open class MultiMesh : Resource() { TransferContext.callMethod(rawPtr, MethodBindings.setMeshPtr, NIL) } - /** - * - */ public var buffer: PackedFloat32Array get() { TransferContext.writeArguments() @@ -157,7 +154,7 @@ public open class MultiMesh : Resource() { } /** - * Sets the [godot.Transform3D] for a specific instance. + * Sets the [Transform3D] for a specific instance. */ public fun setInstanceTransform(instance: Int, transform: Transform3D): Unit { TransferContext.writeArguments(LONG to instance.toLong(), TRANSFORM3D to transform) @@ -165,7 +162,7 @@ public open class MultiMesh : Resource() { } /** - * Sets the [godot.core.Transform2D] for a specific instance. + * Sets the [Transform2D] for a specific instance. */ public fun setInstanceTransform2d(instance: Int, transform: Transform2D): Unit { TransferContext.writeArguments(LONG to instance.toLong(), TRANSFORM2D to transform) @@ -173,7 +170,7 @@ public open class MultiMesh : Resource() { } /** - * Returns the [godot.Transform3D] of a specific instance. + * Returns the [Transform3D] of a specific instance. */ public fun getInstanceTransform(instance: Int): Transform3D { TransferContext.writeArguments(LONG to instance.toLong()) @@ -182,7 +179,7 @@ public open class MultiMesh : Resource() { } /** - * Returns the [godot.core.Transform2D] of a specific instance. + * Returns the [Transform2D] of a specific instance. */ public fun getInstanceTransform2d(instance: Int): Transform2D { TransferContext.writeArguments(LONG to instance.toLong()) @@ -191,9 +188,12 @@ public open class MultiMesh : Resource() { } /** - * Sets the color of a specific instance by *multiplying* the mesh's existing vertex colors. This allows for different color tinting per instance. - * - * For the color to take effect, ensure that [useColors] is `true` on the [godot.MultiMesh] and [godot.BaseMaterial3D.vertexColorUseAsAlbedo] is `true` on the material. If you intend to set an absolute color instead of tinting, make sure the material's albedo color is set to pure white (`Color(1, 1, 1)`). + * Sets the color of a specific instance by *multiplying* the mesh's existing vertex colors. This + * allows for different color tinting per instance. + * For the color to take effect, ensure that [useColors] is `true` on the [MultiMesh] and + * [BaseMaterial3D.vertexColorUseAsAlbedo] is `true` on the material. If you intend to set an + * absolute color instead of tinting, make sure the material's albedo color is set to pure white + * (`Color(1, 1, 1)`). */ public fun setInstanceColor(instance: Int, color: Color): Unit { TransferContext.writeArguments(LONG to instance.toLong(), COLOR to color) @@ -210,11 +210,11 @@ public open class MultiMesh : Resource() { } /** - * Sets custom data for a specific instance. Although [godot.core.Color] is used, it is just a container for 4 floating point numbers. - * + * Sets custom data for a specific instance. Although [Color] is used, it is just a container for + * 4 floating point numbers. * For the custom data to be used, ensure that [useCustomData] is `true`. - * - * This custom instance data has to be manually accessed in your custom shader using `INSTANCE_CUSTOM`. + * This custom instance data has to be manually accessed in your custom shader using + * `INSTANCE_CUSTOM`. */ public fun setInstanceCustomData(instance: Int, customData: Color): Unit { TransferContext.writeArguments(LONG to instance.toLong(), COLOR to customData) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/MultiMeshInstance2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/MultiMeshInstance2D.kt index 536be4342..69928ac58 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/MultiMeshInstance2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/MultiMeshInstance2D.kt @@ -19,11 +19,8 @@ import kotlin.Int import kotlin.Suppress /** - * Node that instances a [godot.MultiMesh] in 2D. - * - * [godot.MultiMeshInstance2D] is a specialized node to instance a [godot.MultiMesh] resource in 2D. - * - * Usage is the same as [godot.MultiMeshInstance3D]. + * [MultiMeshInstance2D] is a specialized node to instance a [MultiMesh] resource in 2D. + * Usage is the same as [MultiMeshInstance3D]. */ @GodotBaseType public open class MultiMeshInstance2D : Node2D() { @@ -33,7 +30,7 @@ public open class MultiMeshInstance2D : Node2D() { public val textureChanged: Signal0 by signal() /** - * The [godot.MultiMesh] that will be drawn by the [godot.MultiMeshInstance2D]. + * The [MultiMesh] that will be drawn by the [MultiMeshInstance2D]. */ public var multimesh: MultiMesh? get() { @@ -47,7 +44,8 @@ public open class MultiMeshInstance2D : Node2D() { } /** - * The [godot.Texture2D] that will be used if using the default [godot.CanvasItemMaterial]. Can be accessed as `TEXTURE` in CanvasItem shader. + * The [Texture2D] that will be used if using the default [CanvasItemMaterial]. Can be accessed as + * `TEXTURE` in CanvasItem shader. */ public var texture: Texture2D? get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/MultiMeshInstance3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/MultiMeshInstance3D.kt index 4a4936163..2c44ccf43 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/MultiMeshInstance3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/MultiMeshInstance3D.kt @@ -17,19 +17,16 @@ import kotlin.Int import kotlin.Suppress /** - * Node that instances a [godot.MultiMesh]. - * - * Tutorials: - * [$DOCS_URL/tutorials/performance/vertex_animation/animating_thousands_of_fish.html]($DOCS_URL/tutorials/performance/vertex_animation/animating_thousands_of_fish.html) - * - * [godot.MultiMeshInstance3D] is a specialized node to instance [godot.GeometryInstance3D]s based on a [godot.MultiMesh] resource. - * - * This is useful to optimize the rendering of a high number of instances of a given mesh (for example trees in a forest or grass strands). + * [MultiMeshInstance3D] is a specialized node to instance [GeometryInstance3D]s based on a + * [MultiMesh] resource. + * This is useful to optimize the rendering of a high number of instances of a given mesh (for + * example trees in a forest or grass strands). */ @GodotBaseType public open class MultiMeshInstance3D : GeometryInstance3D() { /** - * The [godot.MultiMesh] resource that will be used and shared among all instances of the [godot.MultiMeshInstance3D]. + * The [MultiMesh] resource that will be used and shared among all instances of the + * [MultiMeshInstance3D]. */ public var multimesh: MultiMesh? get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/MultiplayerAPI.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/MultiplayerAPI.kt index f73d91354..dd80ebeec 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/MultiplayerAPI.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/MultiplayerAPI.kt @@ -34,45 +34,55 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * High-level multiplayer API interface. - * - * Base class for high-level multiplayer API implementations. See also [godot.MultiplayerPeer]. - * - * By default, [godot.SceneTree] has a reference to an implementation of this class and uses it to provide multiplayer capabilities (i.e. RPCs) across the whole scene. - * - * It is possible to override the MultiplayerAPI instance used by specific tree branches by calling the [godot.SceneTree.setMultiplayer] method, effectively allowing to run both client and server in the same scene. - * - * It is also possible to extend or replace the default implementation via scripting or native extensions. See [godot.MultiplayerAPIExtension] for details about extensions, [godot.SceneMultiplayer] for the details about the default implementation. + * Base class for high-level multiplayer API implementations. See also [MultiplayerPeer]. + * By default, [SceneTree] has a reference to an implementation of this class and uses it to provide + * multiplayer capabilities (i.e. RPCs) across the whole scene. + * It is possible to override the MultiplayerAPI instance used by specific tree branches by calling + * the [SceneTree.setMultiplayer] method, effectively allowing to run both client and server in the + * same scene. + * It is also possible to extend or replace the default implementation via scripting or native + * extensions. See [MultiplayerAPIExtension] for details about extensions, [SceneMultiplayer] for the + * details about the default implementation. */ @GodotBaseType public open class MultiplayerAPI internal constructor() : RefCounted() { /** - * Emitted when this MultiplayerAPI's [multiplayerPeer] connects with a new peer. ID is the peer ID of the new peer. Clients get notified when other clients connect to the same server. Upon connecting to a server, a client also receives this signal for the server (with ID being 1). + * Emitted when this MultiplayerAPI's [multiplayerPeer] connects with a new peer. ID is the peer + * ID of the new peer. Clients get notified when other clients connect to the same server. Upon + * connecting to a server, a client also receives this signal for the server (with ID being 1). */ public val peerConnected: Signal1 by signal("id") /** - * Emitted when this MultiplayerAPI's [multiplayerPeer] disconnects from a peer. Clients get notified when other clients disconnect from the same server. + * Emitted when this MultiplayerAPI's [multiplayerPeer] disconnects from a peer. Clients get + * notified when other clients disconnect from the same server. */ public val peerDisconnected: Signal1 by signal("id") /** - * Emitted when this MultiplayerAPI's [multiplayerPeer] successfully connected to a server. Only emitted on clients. + * Emitted when this MultiplayerAPI's [multiplayerPeer] successfully connected to a server. Only + * emitted on clients. */ public val connectedToServer: Signal0 by signal() /** - * Emitted when this MultiplayerAPI's [multiplayerPeer] fails to establish a connection to a server. Only emitted on clients. + * Emitted when this MultiplayerAPI's [multiplayerPeer] fails to establish a connection to a + * server. Only emitted on clients. */ public val connectionFailed: Signal0 by signal() /** - * Emitted when this MultiplayerAPI's [multiplayerPeer] disconnects from server. Only emitted on clients. + * Emitted when this MultiplayerAPI's [multiplayerPeer] disconnects from server. Only emitted on + * clients. */ public val serverDisconnected: Signal0 by signal() /** - * The peer object to handle the RPC system (effectively enabling networking when set). Depending on the peer itself, the MultiplayerAPI will become a network server (check with [isServer]) and will set root node's network mode to authority, or it will become a regular client peer. All child nodes are set to inherit the network mode by default. Handling of networking-related events (connection, disconnection, new clients) is done by connecting to MultiplayerAPI's signals. + * The peer object to handle the RPC system (effectively enabling networking when set). Depending + * on the peer itself, the MultiplayerAPI will become a network server (check with [isServer]) and + * will set root node's network mode to authority, or it will become a regular client peer. All child + * nodes are set to inherit the network mode by default. Handling of networking-related events + * (connection, disconnection, new clients) is done by connecting to MultiplayerAPI's signals. */ public var multiplayerPeer: MultiplayerPeer? get() { @@ -109,7 +119,8 @@ public open class MultiplayerAPI internal constructor() : RefCounted() { } /** - * Returns `true` if this MultiplayerAPI's [multiplayerPeer] is valid and in server mode (listening for connections). + * Returns `true` if this MultiplayerAPI's [multiplayerPeer] is valid and in server mode + * (listening for connections). */ public fun isServer(): Boolean { TransferContext.writeArguments() @@ -119,7 +130,6 @@ public open class MultiplayerAPI internal constructor() : RefCounted() { /** * Returns the sender's peer ID for the RPC currently being executed. - * * **Note:** If not inside an RPC this method will return 0. */ public fun getRemoteSenderId(): Int { @@ -129,9 +139,11 @@ public open class MultiplayerAPI internal constructor() : RefCounted() { } /** - * Method used for polling the MultiplayerAPI. You only need to worry about this if you set [godot.SceneTree.multiplayerPoll] to `false`. By default, [godot.SceneTree] will poll its MultiplayerAPI(s) for you. - * - * **Note:** This method results in RPCs being called, so they will be executed in the same context of this function (e.g. `_process`, `physics`, [godot.Thread]). + * Method used for polling the MultiplayerAPI. You only need to worry about this if you set + * [SceneTree.multiplayerPoll] to `false`. By default, [SceneTree] will poll its MultiplayerAPI(s) + * for you. + * **Note:** This method results in RPCs being called, so they will be executed in the same + * context of this function (e.g. `_process`, `physics`, [Thread]). */ public fun poll(): GodotError { TransferContext.writeArguments() @@ -140,9 +152,12 @@ public open class MultiplayerAPI internal constructor() : RefCounted() { } /** - * Sends an RPC to the target [peer]. The given [method] will be called on the remote [object] with the provided [arguments]. The RPC may also be called locally depending on the implementation and RPC configuration. See [godot.Node.rpc] and [godot.Node.rpcConfig]. - * - * **Note:** Prefer using [godot.Node.rpc], [godot.Node.rpcId], or `my_method.rpc(peer, arg1, arg2, ...)` (in GDScript), since they are faster. This method is mostly useful in conjunction with [godot.MultiplayerAPIExtension] when augmenting or replacing the multiplayer capabilities. + * Sends an RPC to the target [param peer]. The given [param method] will be called on the remote + * [param object] with the provided [param arguments]. The RPC may also be called locally depending + * on the implementation and RPC configuration. See [Node.rpc] and [Node.rpcConfig]. + * **Note:** Prefer using [Node.rpc], [Node.rpcId], or `my_method.rpc(peer, arg1, arg2, ...)` (in + * GDScript), since they are faster. This method is mostly useful in conjunction with + * [MultiplayerAPIExtension] when augmenting or replacing the multiplayer capabilities. */ @JvmOverloads public fun rpc( @@ -157,9 +172,13 @@ public open class MultiplayerAPI internal constructor() : RefCounted() { } /** - * Notifies the MultiplayerAPI of a new [configuration] for the given [object]. This method is used internally by [godot.SceneTree] to configure the root path for this MultiplayerAPI (passing `null` and a valid [godot.core.NodePath] as [configuration]). This method can be further used by MultiplayerAPI implementations to provide additional features, refer to specific implementation (e.g. [godot.SceneMultiplayer]) for details on how they use it. - * - * **Note:** This method is mostly relevant when extending or overriding the MultiplayerAPI behavior via [godot.MultiplayerAPIExtension]. + * Notifies the MultiplayerAPI of a new [param configuration] for the given [param object]. This + * method is used internally by [SceneTree] to configure the root path for this MultiplayerAPI + * (passing `null` and a valid [NodePath] as [param configuration]). This method can be further used + * by MultiplayerAPI implementations to provide additional features, refer to specific implementation + * (e.g. [SceneMultiplayer]) for details on how they use it. + * **Note:** This method is mostly relevant when extending or overriding the MultiplayerAPI + * behavior via [MultiplayerAPIExtension]. */ public fun objectConfigurationAdd(_object: Object, configuration: Any?): GodotError { TransferContext.writeArguments(OBJECT to _object, ANY to configuration) @@ -168,9 +187,13 @@ public open class MultiplayerAPI internal constructor() : RefCounted() { } /** - * Notifies the MultiplayerAPI to remove a [configuration] for the given [object]. This method is used internally by [godot.SceneTree] to configure the root path for this MultiplayerAPI (passing `null` and an empty [godot.core.NodePath] as [configuration]). This method can be further used by MultiplayerAPI implementations to provide additional features, refer to specific implementation (e.g. [godot.SceneMultiplayer]) for details on how they use it. - * - * **Note:** This method is mostly relevant when extending or overriding the MultiplayerAPI behavior via [godot.MultiplayerAPIExtension]. + * Notifies the MultiplayerAPI to remove a [param configuration] for the given [param object]. + * This method is used internally by [SceneTree] to configure the root path for this MultiplayerAPI + * (passing `null` and an empty [NodePath] as [param configuration]). This method can be further used + * by MultiplayerAPI implementations to provide additional features, refer to specific implementation + * (e.g. [SceneMultiplayer]) for details on how they use it. + * **Note:** This method is mostly relevant when extending or overriding the MultiplayerAPI + * behavior via [MultiplayerAPIExtension]. */ public fun objectConfigurationRemove(_object: Object, configuration: Any?): GodotError { TransferContext.writeArguments(OBJECT to _object, ANY to configuration) @@ -191,15 +214,20 @@ public open class MultiplayerAPI internal constructor() : RefCounted() { id: Long, ) { /** - * Used with [godot.Node.rpcConfig] to disable a method or property for all RPC calls, making it unavailable. Default for all methods. + * Used with [Node.rpcConfig] to disable a method or property for all RPC calls, making it + * unavailable. Default for all methods. */ RPC_MODE_DISABLED(0), /** - * Used with [godot.Node.rpcConfig] to set a method to be callable remotely by any peer. Analogous to the `@rpc("any_peer")` annotation. Calls are accepted from all remote peers, no matter if they are node's authority or not. + * Used with [Node.rpcConfig] to set a method to be callable remotely by any peer. Analogous to + * the `@rpc("any_peer")` annotation. Calls are accepted from all remote peers, no matter if they + * are node's authority or not. */ RPC_MODE_ANY_PEER(1), /** - * Used with [godot.Node.rpcConfig] to set a method to be callable remotely only by the current multiplayer authority (which is the server by default). Analogous to the `@rpc("authority")` annotation. See [godot.Node.setMultiplayerAuthority]. + * Used with [Node.rpcConfig] to set a method to be callable remotely only by the current + * multiplayer authority (which is the server by default). Analogous to the `@rpc("authority")` + * annotation. See [Node.setMultiplayerAuthority]. */ RPC_MODE_AUTHORITY(2), ; @@ -216,7 +244,8 @@ public open class MultiplayerAPI internal constructor() : RefCounted() { public companion object { /** - * Sets the default MultiplayerAPI implementation class. This method can be used by modules and extensions to configure which implementation will be used by [godot.SceneTree] when the engine starts. + * Sets the default MultiplayerAPI implementation class. This method can be used by modules and + * extensions to configure which implementation will be used by [SceneTree] when the engine starts. */ public fun setDefaultInterface(interfaceName: StringName): Unit { TransferContext.writeArguments(STRING_NAME to interfaceName) @@ -224,7 +253,8 @@ public open class MultiplayerAPI internal constructor() : RefCounted() { } /** - * Returns the default MultiplayerAPI implementation class name. This is usually `"SceneMultiplayer"` when [godot.SceneMultiplayer] is available. See [setDefaultInterface]. + * Returns the default MultiplayerAPI implementation class name. This is usually + * `"SceneMultiplayer"` when [SceneMultiplayer] is available. See [setDefaultInterface]. */ public fun getDefaultInterface(): StringName { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/MultiplayerPeer.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/MultiplayerPeer.kt index 7b0a0a933..ee0dbc025 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/MultiplayerPeer.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/MultiplayerPeer.kt @@ -23,16 +23,13 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * Abstract class for specialized [godot.PacketPeer]s used by the [godot.MultiplayerAPI]. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/537](https://godotengine.org/asset-library/asset/537) - * - * Manages the connection with one or more remote peers acting as server or client and assigning unique IDs to each of them. See also [godot.MultiplayerAPI]. - * - * **Note:** The [godot.MultiplayerAPI] protocol is an implementation detail and isn't meant to be used by non-Godot servers. It may change without notice. - * - * **Note:** When exporting to Android, make sure to enable the `INTERNET` permission in the Android export preset before exporting the project or using one-click deploy. Otherwise, network communication of any kind will be blocked by Android. + * Manages the connection with one or more remote peers acting as server or client and assigning + * unique IDs to each of them. See also [MultiplayerAPI]. + * **Note:** The [MultiplayerAPI] protocol is an implementation detail and isn't meant to be used by + * non-Godot servers. It may change without notice. + * **Note:** When exporting to Android, make sure to enable the `INTERNET` permission in the Android + * export preset before exporting the project or using one-click deploy. Otherwise, network + * communication of any kind will be blocked by Android. */ @GodotBaseType public open class MultiplayerPeer internal constructor() : PacketPeer() { @@ -47,7 +44,7 @@ public open class MultiplayerPeer internal constructor() : PacketPeer() { public val peerDisconnected: Signal1 by signal("id") /** - * If `true`, this [godot.MultiplayerPeer] refuses new connections. + * If `true`, this [MultiplayerPeer] refuses new connections. */ public var refuseNewConnections: Boolean get() { @@ -61,7 +58,8 @@ public open class MultiplayerPeer internal constructor() : PacketPeer() { } /** - * The manner in which to send packets to the target peer. See [enum TransferMode], and the [setTargetPeer] method. + * The manner in which to send packets to the target peer. See [enum TransferMode], and the + * [setTargetPeer] method. */ public var transferMode: TransferMode get() { @@ -75,9 +73,17 @@ public open class MultiplayerPeer internal constructor() : PacketPeer() { } /** - * The channel to use to send packets. Many network APIs such as ENet and WebRTC allow the creation of multiple independent channels which behaves, in a way, like separate connections. This means that reliable data will only block delivery of other packets on that channel, and ordering will only be in respect to the channel the packet is being sent on. Using different channels to send **different and independent** state updates is a common way to optimize network usage and decrease latency in fast-paced games. - * - * **Note:** The default channel (`0`) actually works as 3 separate channels (one for each [enum TransferMode]) so that [TRANSFER_MODE_RELIABLE] and [TRANSFER_MODE_UNRELIABLE_ORDERED] does not interact with each other by default. Refer to the specific network API documentation (e.g. ENet or WebRTC) to learn how to set up channels correctly. + * The channel to use to send packets. Many network APIs such as ENet and WebRTC allow the + * creation of multiple independent channels which behaves, in a way, like separate connections. This + * means that reliable data will only block delivery of other packets on that channel, and ordering + * will only be in respect to the channel the packet is being sent on. Using different channels to + * send **different and independent** state updates is a common way to optimize network usage and + * decrease latency in fast-paced games. + * **Note:** The default channel (`0`) actually works as 3 separate channels (one for each [enum + * TransferMode]) so that [constant TRANSFER_MODE_RELIABLE] and [constant + * TRANSFER_MODE_UNRELIABLE_ORDERED] does not interact with each other by default. Refer to the + * specific network API documentation (e.g. ENet or WebRTC) to learn how to set up channels + * correctly. */ public var transferChannel: Int get() { @@ -97,8 +103,10 @@ public open class MultiplayerPeer internal constructor() : PacketPeer() { /** * Sets the peer to which packets will be sent. - * - * The [id] can be one of: [TARGET_PEER_BROADCAST] to send to all connected peers, [TARGET_PEER_SERVER] to send to the peer acting as server, a valid peer ID to send to that specific peer, a negative peer ID to send to all peers except that one. By default, the target peer is [TARGET_PEER_BROADCAST]. + * The [param id] can be one of: [constant TARGET_PEER_BROADCAST] to send to all connected peers, + * [constant TARGET_PEER_SERVER] to send to the peer acting as server, a valid peer ID to send to + * that specific peer, a negative peer ID to send to all peers except that one. By default, the + * target peer is [constant TARGET_PEER_BROADCAST]. */ public fun setTargetPeer(id: Int): Unit { TransferContext.writeArguments(LONG to id.toLong()) @@ -106,7 +114,8 @@ public open class MultiplayerPeer internal constructor() : PacketPeer() { } /** - * Returns the ID of the [godot.MultiplayerPeer] who sent the next available packet. See [godot.PacketPeer.getAvailablePacketCount]. + * Returns the ID of the [MultiplayerPeer] who sent the next available packet. See + * [PacketPeer.getAvailablePacketCount]. */ public fun getPacketPeer(): Int { TransferContext.writeArguments() @@ -115,7 +124,8 @@ public open class MultiplayerPeer internal constructor() : PacketPeer() { } /** - * Returns the channel over which the next available packet was received. See [godot.PacketPeer.getAvailablePacketCount]. + * Returns the channel over which the next available packet was received. See + * [PacketPeer.getAvailablePacketCount]. */ public fun getPacketChannel(): Int { TransferContext.writeArguments() @@ -124,7 +134,8 @@ public open class MultiplayerPeer internal constructor() : PacketPeer() { } /** - * Returns the [enum MultiplayerPeer.TransferMode] the remote peer used to send the next available packet. See [godot.PacketPeer.getAvailablePacketCount]. + * Returns the [enum MultiplayerPeer.TransferMode] the remote peer used to send the next available + * packet. See [PacketPeer.getAvailablePacketCount]. */ public fun getPacketMode(): TransferMode { TransferContext.writeArguments() @@ -141,7 +152,9 @@ public open class MultiplayerPeer internal constructor() : PacketPeer() { } /** - * Immediately close the multiplayer peer returning to the state [CONNECTION_DISCONNECTED]. Connected peers will be dropped without emitting [peerDisconnected]. + * Immediately close the multiplayer peer returning to the state [constant + * CONNECTION_DISCONNECTED]. Connected peers will be dropped without emitting [signal + * peer_disconnected]. */ public fun close(): Unit { TransferContext.writeArguments() @@ -149,7 +162,8 @@ public open class MultiplayerPeer internal constructor() : PacketPeer() { } /** - * Disconnects the given [peer] from this host. If [force] is `true` the [peerDisconnected] signal will not be emitted for this peer. + * Disconnects the given [param peer] from this host. If [param force] is `true` the [signal + * peer_disconnected] signal will not be emitted for this peer. */ @JvmOverloads public fun disconnectPeer(peer: Int, force: Boolean = false): Unit { @@ -167,7 +181,7 @@ public open class MultiplayerPeer internal constructor() : PacketPeer() { } /** - * Returns the ID of this [godot.MultiplayerPeer]. + * Returns the ID of this [MultiplayerPeer]. */ public fun getUniqueId(): Int { TransferContext.writeArguments() @@ -185,7 +199,9 @@ public open class MultiplayerPeer internal constructor() : PacketPeer() { } /** - * Returns true if the server can act as a relay in the current configuration (i.e. if the higher level [godot.MultiplayerAPI] should notify connected clients of other peers, and implement a relay protocol to allow communication between them). + * Returns true if the server can act as a relay in the current configuration (i.e. if the higher + * level [MultiplayerAPI] should notify connected clients of other peers, and implement a relay + * protocol to allow communication between them). */ public fun isServerRelaySupported(): Boolean { TransferContext.writeArguments() @@ -224,15 +240,24 @@ public open class MultiplayerPeer internal constructor() : PacketPeer() { id: Long, ) { /** - * Packets are not acknowledged, no resend attempts are made for lost packets. Packets may arrive in any order. Potentially faster than [TRANSFER_MODE_UNRELIABLE_ORDERED]. Use for non-critical data, and always consider whether the order matters. + * Packets are not acknowledged, no resend attempts are made for lost packets. Packets may + * arrive in any order. Potentially faster than [constant TRANSFER_MODE_UNRELIABLE_ORDERED]. Use + * for non-critical data, and always consider whether the order matters. */ TRANSFER_MODE_UNRELIABLE(0), /** - * Packets are not acknowledged, no resend attempts are made for lost packets. Packets are received in the order they were sent in. Potentially faster than [TRANSFER_MODE_RELIABLE]. Use for non-critical data or data that would be outdated if received late due to resend attempt(s) anyway, for example movement and positional data. + * Packets are not acknowledged, no resend attempts are made for lost packets. Packets are + * received in the order they were sent in. Potentially faster than [constant + * TRANSFER_MODE_RELIABLE]. Use for non-critical data or data that would be outdated if received + * late due to resend attempt(s) anyway, for example movement and positional data. */ TRANSFER_MODE_UNRELIABLE_ORDERED(1), /** - * Packets must be received and resend attempts should be made until the packets are acknowledged. Packets must be received in the order they were sent in. Most reliable transfer mode, but potentially the slowest due to the overhead. Use for critical data that must be transmitted and arrive in order, for example an ability being triggered or a chat message. Consider carefully if the information really is critical, and use sparingly. + * Packets must be received and resend attempts should be made until the packets are + * acknowledged. Packets must be received in the order they were sent in. Most reliable transfer + * mode, but potentially the slowest due to the overhead. Use for critical data that must be + * transmitted and arrive in order, for example an ability being triggered or a chat message. + * Consider carefully if the information really is critical, and use sparingly. */ TRANSFER_MODE_RELIABLE(2), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/MultiplayerPeerExtension.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/MultiplayerPeerExtension.kt index d13a6003a..4dcaeb4e3 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/MultiplayerPeerExtension.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/MultiplayerPeerExtension.kt @@ -18,9 +18,9 @@ import kotlin.Suppress import kotlin.Unit /** - * Class that can be inherited to implement custom multiplayer API networking layers via GDExtension. - * - * This class is designed to be inherited from a GDExtension plugin to implement custom networking layers for the multiplayer API (such as WebRTC). All the methods below **must** be implemented to have a working custom multiplayer implementation. See also [godot.MultiplayerAPI]. + * This class is designed to be inherited from a GDExtension plugin to implement custom networking + * layers for the multiplayer API (such as WebRTC). All the methods below **must** be implemented to + * have a working custom multiplayer implementation. See also [MultiplayerAPI]. */ @GodotBaseType public open class MultiplayerPeerExtension : MultiplayerPeer() { @@ -30,140 +30,157 @@ public open class MultiplayerPeerExtension : MultiplayerPeer() { } /** - * Called when the available packet count is internally requested by the [godot.MultiplayerAPI]. + * Called when the available packet count is internally requested by the [MultiplayerAPI]. */ public open fun _getAvailablePacketCount(): Int { throw NotImplementedError("_get_available_packet_count is not implemented for MultiplayerPeerExtension") } /** - * Called when the maximum allowed packet size (in bytes) is requested by the [godot.MultiplayerAPI]. + * Called when the maximum allowed packet size (in bytes) is requested by the [MultiplayerAPI]. */ public open fun _getMaxPacketSize(): Int { throw NotImplementedError("_get_max_packet_size is not implemented for MultiplayerPeerExtension") } /** - * Called when a packet needs to be received by the [godot.MultiplayerAPI], if [_getPacket] isn't implemented. Use this when extending this class via GDScript. + * Called when a packet needs to be received by the [MultiplayerAPI], if [_getPacket] isn't + * implemented. Use this when extending this class via GDScript. */ public open fun _getPacketScript(): PackedByteArray { throw NotImplementedError("_get_packet_script is not implemented for MultiplayerPeerExtension") } /** - * Called when a packet needs to be sent by the [godot.MultiplayerAPI], if [_putPacket] isn't implemented. Use this when extending this class via GDScript. + * Called when a packet needs to be sent by the [MultiplayerAPI], if [_putPacket] isn't + * implemented. Use this when extending this class via GDScript. */ public open fun _putPacketScript(pBuffer: PackedByteArray): GodotError { throw NotImplementedError("_put_packet_script is not implemented for MultiplayerPeerExtension") } /** - * Called to get the channel over which the next available packet was received. See [godot.MultiplayerPeer.getPacketChannel]. + * Called to get the channel over which the next available packet was received. See + * [MultiplayerPeer.getPacketChannel]. */ public open fun _getPacketChannel(): Int { throw NotImplementedError("_get_packet_channel is not implemented for MultiplayerPeerExtension") } /** - * Called to get the [enum MultiplayerPeer.TransferMode] the remote peer used to send the next available packet. See [godot.MultiplayerPeer.getPacketMode]. + * Called to get the [enum MultiplayerPeer.TransferMode] the remote peer used to send the next + * available packet. See [MultiplayerPeer.getPacketMode]. */ public open fun _getPacketMode(): MultiplayerPeer.TransferMode { throw NotImplementedError("_get_packet_mode is not implemented for MultiplayerPeerExtension") } /** - * Called when the channel to use is set for this [godot.MultiplayerPeer] (see [godot.MultiplayerPeer.transferChannel]). + * Called when the channel to use is set for this [MultiplayerPeer] (see + * [MultiplayerPeer.transferChannel]). */ public open fun _setTransferChannel(pChannel: Int): Unit { } /** - * Called when the transfer channel to use is read on this [godot.MultiplayerPeer] (see [godot.MultiplayerPeer.transferChannel]). + * Called when the transfer channel to use is read on this [MultiplayerPeer] (see + * [MultiplayerPeer.transferChannel]). */ public open fun _getTransferChannel(): Int { throw NotImplementedError("_get_transfer_channel is not implemented for MultiplayerPeerExtension") } /** - * Called when the transfer mode is set on this [godot.MultiplayerPeer] (see [godot.MultiplayerPeer.transferMode]). + * Called when the transfer mode is set on this [MultiplayerPeer] (see + * [MultiplayerPeer.transferMode]). */ public open fun _setTransferMode(pMode: MultiplayerPeer.TransferMode): Unit { } /** - * Called when the transfer mode to use is read on this [godot.MultiplayerPeer] (see [godot.MultiplayerPeer.transferMode]). + * Called when the transfer mode to use is read on this [MultiplayerPeer] (see + * [MultiplayerPeer.transferMode]). */ public open fun _getTransferMode(): MultiplayerPeer.TransferMode { throw NotImplementedError("_get_transfer_mode is not implemented for MultiplayerPeerExtension") } /** - * Called when the target peer to use is set for this [godot.MultiplayerPeer] (see [godot.MultiplayerPeer.setTargetPeer]). + * Called when the target peer to use is set for this [MultiplayerPeer] (see + * [MultiplayerPeer.setTargetPeer]). */ public open fun _setTargetPeer(pPeer: Int): Unit { } /** - * Called when the ID of the [godot.MultiplayerPeer] who sent the most recent packet is requested (see [godot.MultiplayerPeer.getPacketPeer]). + * Called when the ID of the [MultiplayerPeer] who sent the most recent packet is requested (see + * [MultiplayerPeer.getPacketPeer]). */ public open fun _getPacketPeer(): Int { throw NotImplementedError("_get_packet_peer is not implemented for MultiplayerPeerExtension") } /** - * Called when the "is server" status is requested on the [godot.MultiplayerAPI]. See [godot.MultiplayerAPI.isServer]. + * Called when the "is server" status is requested on the [MultiplayerAPI]. See + * [MultiplayerAPI.isServer]. */ public open fun _isServer(): Boolean { throw NotImplementedError("_is_server is not implemented for MultiplayerPeerExtension") } /** - * Called when the [godot.MultiplayerAPI] is polled. See [godot.MultiplayerAPI.poll]. + * Called when the [MultiplayerAPI] is polled. See [MultiplayerAPI.poll]. */ public open fun _poll(): Unit { } /** - * Called when the multiplayer peer should be immediately closed (see [godot.MultiplayerPeer.close]). + * Called when the multiplayer peer should be immediately closed (see [MultiplayerPeer.close]). */ public open fun _close(): Unit { } /** - * Called when the connected [pPeer] should be forcibly disconnected (see [godot.MultiplayerPeer.disconnectPeer]). + * Called when the connected [param p_peer] should be forcibly disconnected (see + * [MultiplayerPeer.disconnectPeer]). */ public open fun _disconnectPeer(pPeer: Int, pForce: Boolean): Unit { } /** - * Called when the unique ID of this [godot.MultiplayerPeer] is requested (see [godot.MultiplayerPeer.getUniqueId]). The value must be between `1` and `2147483647`. + * Called when the unique ID of this [MultiplayerPeer] is requested (see + * [MultiplayerPeer.getUniqueId]). The value must be between `1` and `2147483647`. */ public open fun _getUniqueId(): Int { throw NotImplementedError("_get_unique_id is not implemented for MultiplayerPeerExtension") } /** - * Called when the "refuse new connections" status is set on this [godot.MultiplayerPeer] (see [godot.MultiplayerPeer.refuseNewConnections]). + * Called when the "refuse new connections" status is set on this [MultiplayerPeer] (see + * [MultiplayerPeer.refuseNewConnections]). */ public open fun _setRefuseNewConnections(pEnable: Boolean): Unit { } /** - * Called when the "refuse new connections" status is requested on this [godot.MultiplayerPeer] (see [godot.MultiplayerPeer.refuseNewConnections]). + * Called when the "refuse new connections" status is requested on this [MultiplayerPeer] (see + * [MultiplayerPeer.refuseNewConnections]). */ public open fun _isRefusingNewConnections(): Boolean { throw NotImplementedError("_is_refusing_new_connections is not implemented for MultiplayerPeerExtension") } /** - * Called to check if the server can act as a relay in the current configuration. See [godot.MultiplayerPeer.isServerRelaySupported]. + * Called to check if the server can act as a relay in the current configuration. See + * [MultiplayerPeer.isServerRelaySupported]. */ public open fun _isServerRelaySupported(): Boolean { throw NotImplementedError("_is_server_relay_supported is not implemented for MultiplayerPeerExtension") } /** - * Called when the connection status is requested on the [godot.MultiplayerPeer] (see [godot.MultiplayerPeer.getConnectionStatus]). + * Called when the connection status is requested on the [MultiplayerPeer] (see + * [MultiplayerPeer.getConnectionStatus]). */ public open fun _getConnectionStatus(): MultiplayerPeer.ConnectionStatus { throw NotImplementedError("_get_connection_status is not implemented for MultiplayerPeerExtension") diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/MultiplayerSpawner.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/MultiplayerSpawner.kt index 109e2f41b..457a6fe87 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/MultiplayerSpawner.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/MultiplayerSpawner.kt @@ -30,12 +30,31 @@ import kotlin.Suppress import kotlin.Unit import kotlin.jvm.JvmOverloads +/** + * Spawnable scenes can be configured in the editor or through code (see [addSpawnableScene]). + * Also supports custom node spawns through [spawn], calling [spawnFunction] on all peers. + * Internally, [MultiplayerSpawner] uses [MultiplayerAPI.objectConfigurationAdd] to notify spawns + * passing the spawned node as the `object` and itself as the `configuration`, and + * [MultiplayerAPI.objectConfigurationRemove] to notify despawns in a similar way. + */ @GodotBaseType public open class MultiplayerSpawner : Node() { + /** + * Emitted when a spawnable scene or custom spawn was despawned by the multiplayer authority. Only + * called on puppets. + */ public val despawned: Signal1 by signal("node") + /** + * Emitted when a spawnable scene or custom spawn was spawned by the multiplayer authority. Only + * called on puppets. + */ public val spawned: Signal1 by signal("node") + /** + * Path to the spawn root. Spawnable scenes that are added as direct children are replicated to + * other peers. + */ public var spawnPath: NodePath get() { TransferContext.writeArguments() @@ -47,6 +66,11 @@ public open class MultiplayerSpawner : Node() { TransferContext.callMethod(rawPtr, MethodBindings.setSpawnPathPtr, NIL) } + /** + * Maximum nodes that is allowed to be spawned by this spawner. Includes both spawnable scenes and + * custom spawns. + * When set to `0` (the default), there is no limit. + */ public var spawnLimit: Long get() { TransferContext.writeArguments() @@ -58,6 +82,12 @@ public open class MultiplayerSpawner : Node() { TransferContext.callMethod(rawPtr, MethodBindings.setSpawnLimitPtr, NIL) } + /** + * Method called on all peers when for every custom [spawn] requested by the authority. Will + * receive the `data` parameter, and should return a [Node] that is not in the scene tree. + * **Note:** The returned node should **not** be added to the scene with [Node.addChild]. This is + * done automatically. + */ public var spawnFunction: Callable get() { TransferContext.writeArguments() @@ -74,28 +104,47 @@ public open class MultiplayerSpawner : Node() { return true } + /** + * Adds a scene path to spawnable scenes, making it automatically replicated from the multiplayer + * authority to other peers when added as children of the node pointed by [spawnPath]. + */ public fun addSpawnableScene(path: String): Unit { TransferContext.writeArguments(STRING to path) TransferContext.callMethod(rawPtr, MethodBindings.addSpawnableScenePtr, NIL) } + /** + * Returns the count of spawnable scene paths. + */ public fun getSpawnableSceneCount(): Int { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getSpawnableSceneCountPtr, LONG) return (TransferContext.readReturnValue(LONG, false) as Long).toInt() } + /** + * Returns the spawnable scene path by index. + */ public fun getSpawnableScene(index: Int): String { TransferContext.writeArguments(LONG to index.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.getSpawnableScenePtr, STRING) return (TransferContext.readReturnValue(STRING, false) as String) } + /** + * Clears all spawnable scenes. Does not despawn existing instances on remote peers. + */ public fun clearSpawnableScenes(): Unit { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.clearSpawnableScenesPtr, NIL) } + /** + * Requests a custom spawn, with [param data] passed to [spawnFunction] on all peers. Returns the + * locally spawned node instance already inside the scene tree, and added as a child of the node + * pointed by [spawnPath]. + * **Note:** Spawnable scenes are spawned automatically. [spawn] is only needed for custom spawns. + */ @JvmOverloads public fun spawn(`data`: Any? = null): Node? { TransferContext.writeArguments(ANY to data) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/MultiplayerSynchronizer.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/MultiplayerSynchronizer.kt index 237bd6520..f3c7e76da 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/MultiplayerSynchronizer.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/MultiplayerSynchronizer.kt @@ -30,14 +30,44 @@ import kotlin.Suppress import kotlin.Unit import kotlin.jvm.JvmOverloads +/** + * By default, [MultiplayerSynchronizer] synchronizes configured properties to all peers. + * Visibility can be handled directly with [setVisibilityFor] or as-needed with + * [addVisibilityFilter] and [updateVisibility]. + * [MultiplayerSpawner]s will handle nodes according to visibility of synchronizers as long as the + * node at [rootPath] was spawned by one. + * Internally, [MultiplayerSynchronizer] uses [MultiplayerAPI.objectConfigurationAdd] to notify + * synchronization start passing the [Node] at [rootPath] as the `object` and itself as the + * `configuration`, and uses [MultiplayerAPI.objectConfigurationRemove] to notify synchronization end + * in a similar way. + * **Note:** Synchronization is not supported for [Object] type properties, like [Resource]. + * Properties that are unique to each peer, like the instance IDs of [Object]s (see + * [Object.getInstanceId]) or [RID]s, will also not work in synchronization. + */ @GodotBaseType public open class MultiplayerSynchronizer : Node() { + /** + * Emitted when a new synchronization state is received by this synchronizer after the properties + * have been updated. + */ public val synchronized: Signal0 by signal() + /** + * Emitted when a new delta synchronization state is received by this synchronizer after the + * properties have been updated. + */ public val deltaSynchronized: Signal0 by signal() + /** + * Emitted when visibility of [param for_peer] is updated. See [updateVisibility]. + */ public val visibilityChanged: Signal1 by signal("forPeer") + /** + * Node path that replicated properties are relative to. + * If [rootPath] was spawned by a [MultiplayerSpawner], the node will be also be spawned and + * despawned based on this synchronizer visibility options. + */ public var rootPath: NodePath get() { TransferContext.writeArguments() @@ -49,6 +79,10 @@ public open class MultiplayerSynchronizer : Node() { TransferContext.callMethod(rawPtr, MethodBindings.setRootPathPtr, NIL) } + /** + * Time interval between synchronizations. When set to `0.0` (the default), synchronizations + * happen every network process frame. + */ public var replicationInterval: Double get() { TransferContext.writeArguments() @@ -60,6 +94,10 @@ public open class MultiplayerSynchronizer : Node() { TransferContext.callMethod(rawPtr, MethodBindings.setReplicationIntervalPtr, NIL) } + /** + * Time interval between delta synchronizations. When set to `0.0` (the default), delta + * synchronizations happen every network process frame. + */ public var deltaInterval: Double get() { TransferContext.writeArguments() @@ -71,6 +109,9 @@ public open class MultiplayerSynchronizer : Node() { TransferContext.callMethod(rawPtr, MethodBindings.setDeltaIntervalPtr, NIL) } + /** + * Resource containing which properties to synchronize. + */ public var replicationConfig: SceneReplicationConfig? get() { TransferContext.writeArguments() @@ -82,6 +123,9 @@ public open class MultiplayerSynchronizer : Node() { TransferContext.callMethod(rawPtr, MethodBindings.setReplicationConfigPtr, NIL) } + /** + * Specifies when visibility filters are updated (see [enum VisibilityUpdateMode] for options). + */ public var visibilityUpdateMode: VisibilityUpdateMode get() { TransferContext.writeArguments() @@ -93,6 +137,10 @@ public open class MultiplayerSynchronizer : Node() { TransferContext.callMethod(rawPtr, MethodBindings.setVisibilityUpdateModePtr, NIL) } + /** + * Whether synchronization should be visible to all peers by default. See [setVisibilityFor] and + * [addVisibilityFilter] for ways of configuring fine-grained visibility options. + */ public var publicVisibility: Boolean get() { TransferContext.writeArguments() @@ -109,27 +157,45 @@ public open class MultiplayerSynchronizer : Node() { return true } + /** + * Updates the visibility of [param for_peer] according to visibility filters. If [param for_peer] + * is `0` (the default), all peers' visibilties are updated. + */ @JvmOverloads public fun updateVisibility(forPeer: Int = 0): Unit { TransferContext.writeArguments(LONG to forPeer.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.updateVisibilityPtr, NIL) } + /** + * Adds a peer visibility filter for this synchronizer. + * [param filter] should take a peer ID [int] and return a [bool]. + */ public fun addVisibilityFilter(filter: Callable): Unit { TransferContext.writeArguments(CALLABLE to filter) TransferContext.callMethod(rawPtr, MethodBindings.addVisibilityFilterPtr, NIL) } + /** + * Removes a peer visibility filter from this synchronizer. + */ public fun removeVisibilityFilter(filter: Callable): Unit { TransferContext.writeArguments(CALLABLE to filter) TransferContext.callMethod(rawPtr, MethodBindings.removeVisibilityFilterPtr, NIL) } + /** + * Sets the visibility of [param peer] to [param visible]. If [param peer] is `0`, the value of + * [publicVisibility] will be updated instead. + */ public fun setVisibilityFor(peer: Int, visible: Boolean): Unit { TransferContext.writeArguments(LONG to peer.toLong(), BOOL to visible) TransferContext.callMethod(rawPtr, MethodBindings.setVisibilityForPtr, NIL) } + /** + * Queries the current visibility for peer [param peer]. + */ public fun getVisibilityFor(peer: Int): Boolean { TransferContext.writeArguments(LONG to peer.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.getVisibilityForPtr, BOOL) @@ -139,8 +205,20 @@ public open class MultiplayerSynchronizer : Node() { public enum class VisibilityUpdateMode( id: Long, ) { + /** + * Visibility filters are updated during process frames (see [constant + * Node.NOTIFICATION_INTERNAL_PROCESS]). + */ VISIBILITY_PROCESS_IDLE(0), + /** + * Visibility filters are updated during physics frames (see [constant + * Node.NOTIFICATION_INTERNAL_PHYSICS_PROCESS]). + */ VISIBILITY_PROCESS_PHYSICS(1), + /** + * Visibility filters are not updated automatically, and must be updated manually by calling + * [updateVisibility]. + */ VISIBILITY_PROCESS_NONE(2), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Mutex.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Mutex.kt index beed4c0e3..201efe542 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Mutex.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Mutex.kt @@ -18,22 +18,18 @@ import kotlin.Suppress import kotlin.Unit /** - * A binary [godot.Semaphore] for synchronization of multiple [godot.Thread]s. - * - * Tutorials: - * [$DOCS_URL/tutorials/performance/thread_safe_apis.html]($DOCS_URL/tutorials/performance/thread_safe_apis.html) - * - * A synchronization mutex (mutual exclusion). This is used to synchronize multiple [godot.Thread]s, and is equivalent to a binary [godot.Semaphore]. It guarantees that only one thread can access a critical section at a time. - * - * This is a reentrant mutex, meaning that it can be locked multiple times by one thread, provided it also unlocks it as many times. - * + * A synchronization mutex (mutual exclusion). This is used to synchronize multiple [Thread]s, and + * is equivalent to a binary [Semaphore]. It guarantees that only one thread can access a critical + * section at a time. + * This is a reentrant mutex, meaning that it can be locked multiple times by one thread, provided + * it also unlocks it as many times. * **Warning:** Mutexes must be used carefully to avoid deadlocks. - * - * **Warning:** To ensure proper cleanup without crashes or deadlocks, the following conditions must be met: - * - * - When a [godot.Mutex]'s reference count reaches zero and it is therefore destroyed, no threads (including the one on which the destruction will happen) must have it locked. - * - * - When a [godot.Thread]'s reference count reaches zero and it is therefore destroyed, it must not have any mutex locked. + * **Warning:** To ensure proper cleanup without crashes or deadlocks, the following conditions must + * be met: + * - When a [Mutex]'s reference count reaches zero and it is therefore destroyed, no threads + * (including the one on which the destruction will happen) must have it locked. + * - When a [Thread]'s reference count reaches zero and it is therefore destroyed, it must not have + * any mutex locked. */ @GodotBaseType public open class Mutex : RefCounted() { @@ -43,9 +39,9 @@ public open class Mutex : RefCounted() { } /** - * Locks this [godot.Mutex], blocks until it is unlocked by the current owner. - * - * **Note:** This function returns without blocking if the thread already has ownership of the mutex. + * Locks this [Mutex], blocks until it is unlocked by the current owner. + * **Note:** This function returns without blocking if the thread already has ownership of the + * mutex. */ public fun lock(): Unit { TransferContext.writeArguments() @@ -53,8 +49,7 @@ public open class Mutex : RefCounted() { } /** - * Tries locking this [godot.Mutex], but does not block. Returns `true` on success, `false` otherwise. - * + * Tries locking this [Mutex], but does not block. Returns `true` on success, `false` otherwise. * **Note:** This function returns `true` if the thread already has ownership of the mutex. */ public fun tryLock(): Boolean { @@ -64,11 +59,11 @@ public open class Mutex : RefCounted() { } /** - * Unlocks this [godot.Mutex], leaving it to other threads. - * - * **Note:** If a thread called [lock] or [tryLock] multiple times while already having ownership of the mutex, it must also call [unlock] the same number of times in order to unlock it correctly. - * - * **Warning:** Calling [unlock] more times that [lock] on a given thread, thus ending up trying to unlock a non-locked mutex, is wrong and may causes crashes or deadlocks. + * Unlocks this [Mutex], leaving it to other threads. + * **Note:** If a thread called [lock] or [tryLock] multiple times while already having ownership + * of the mutex, it must also call [unlock] the same number of times in order to unlock it correctly. + * **Warning:** Calling [unlock] more times that [lock] on a given thread, thus ending up trying + * to unlock a non-locked mutex, is wrong and may causes crashes or deadlocks. */ public fun unlock(): Unit { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationAgent2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationAgent2D.kt index b212c8ae0..3f20f8976 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationAgent2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationAgent2D.kt @@ -40,81 +40,73 @@ import kotlin.Suppress import kotlin.Unit /** - * A 2D agent used to pathfind to a position while avoiding obstacles. - * - * Tutorials: - * [$DOCS_URL/tutorials/navigation/navigation_using_navigationagents.html]($DOCS_URL/tutorials/navigation/navigation_using_navigationagents.html) - * - * A 2D agent used to pathfind to a position while avoiding static and dynamic obstacles. The calculation can be used by the parent node to dynamically move it along the path. Requires navigation data to work correctly. - * - * Dynamic obstacles are avoided using RVO collision avoidance. Avoidance is computed before physics, so the pathfinding information can be used safely in the physics step. - * - * **Note:** After setting the [targetPosition] property, the [getNextPathPosition] method must be used once every physics frame to update the internal path logic of the navigation agent. The vector position it returns should be used as the next movement position for the agent's parent node. + * A 2D agent used to pathfind to a position while avoiding static and dynamic obstacles. The + * calculation can be used by the parent node to dynamically move it along the path. Requires + * navigation data to work correctly. + * Dynamic obstacles are avoided using RVO collision avoidance. Avoidance is computed before + * physics, so the pathfinding information can be used safely in the physics step. + * **Note:** After setting the [targetPosition] property, the [getNextPathPosition] method must be + * used once every physics frame to update the internal path logic of the navigation agent. The vector + * position it returns should be used as the next movement position for the agent's parent node. */ @GodotBaseType public open class NavigationAgent2D : Node() { /** * Emitted when the agent had to update the loaded path: - * * - because path was previously empty. - * * - because navigation map has changed. - * * - because agent pushed further away from the current path segment than the [pathMaxDistance]. */ public val pathChanged: Signal0 by signal() /** - * Emitted once per loaded path when the agent's global position is the first time within [targetDesiredDistance] to the [targetPosition]. + * Emitted once per loaded path when the agent's global position is the first time within + * [targetDesiredDistance] to the [targetPosition]. */ public val targetReached: Signal0 by signal() /** * Notifies when a waypoint along the path has been reached. - * - * The details dictionary may contain the following keys depending on the value of [pathMetadataFlags]: - * + * The details dictionary may contain the following keys depending on the value of + * [pathMetadataFlags]: * - `position`: The position of the waypoint that was reached. - * * - `type`: The type of navigation primitive (region or link) that contains this waypoint. - * * - `rid`: The [RID] of the containing navigation primitive (region or link). - * * - `owner`: The object which manages the containing navigation primitive (region or link). */ public val waypointReached: Signal1> by signal("details") /** * Notifies when a navigation link has been reached. - * - * The details dictionary may contain the following keys depending on the value of [pathMetadataFlags]: - * + * The details dictionary may contain the following keys depending on the value of + * [pathMetadataFlags]: * - `position`: The start position of the link that was reached. - * - * - `type`: Always [godot.NavigationPathQueryResult2D.PATH_SEGMENT_TYPE_LINK]. - * + * - `type`: Always [constant NavigationPathQueryResult2D.PATH_SEGMENT_TYPE_LINK]. * - `rid`: The [RID] of the link. - * - * - `owner`: The object which manages the link (usually [godot.NavigationLink2D]). - * - * - `link_entry_position`: If `owner` is available and the owner is a [godot.NavigationLink2D], it will contain the global position of the link's point the agent is entering. - * - * - `link_exit_position`: If `owner` is available and the owner is a [godot.NavigationLink2D], it will contain the global position of the link's point which the agent is exiting. + * - `owner`: The object which manages the link (usually [NavigationLink2D]). + * - `link_entry_position`: If `owner` is available and the owner is a [NavigationLink2D], it will + * contain the global position of the link's point the agent is entering. + * - `link_exit_position`: If `owner` is available and the owner is a [NavigationLink2D], it will + * contain the global position of the link's point which the agent is exiting. */ public val linkReached: Signal1> by signal("details") /** - * Emitted once per loaded path when the agent internal navigation path index reaches the last index of the loaded path array. The agent internal navigation path index can be received with [getCurrentNavigationPathIndex]. + * Emitted once per loaded path when the agent internal navigation path index reaches the last + * index of the loaded path array. The agent internal navigation path index can be received with + * [getCurrentNavigationPathIndex]. */ public val navigationFinished: Signal0 by signal() /** - * Notifies when the collision avoidance velocity is calculated. Emitted when [velocity] is set. Only emitted when [avoidanceEnabled] is true. + * Notifies when the collision avoidance velocity is calculated. Emitted when [velocity] is set. + * Only emitted when [avoidanceEnabled] is true. */ public val velocityComputed: Signal1 by signal("safeVelocity") /** - * If set, a new navigation path from the current agent position to the [targetPosition] is requested from the NavigationServer. + * If set, a new navigation path from the current agent position to the [targetPosition] is + * requested from the NavigationServer. */ @CoreTypeLocalCopy public var targetPosition: Vector2 @@ -129,7 +121,12 @@ public open class NavigationAgent2D : Node() { } /** - * The distance threshold before a path point is considered to be reached. This allows agents to not have to hit a path point on the path exactly, but only to reach its general area. If this value is set too high, the NavigationAgent will skip points on the path, which can lead to leaving the navigation mesh. If this value is set too low, the NavigationAgent will be stuck in a repath loop because it will constantly overshoot or undershoot the distance to the next point on each physics frame update. + * The distance threshold before a path point is considered to be reached. This allows agents to + * not have to hit a path point on the path exactly, but only to reach its general area. If this + * value is set too high, the NavigationAgent will skip points on the path, which can lead to leaving + * the navigation mesh. If this value is set too low, the NavigationAgent will be stuck in a repath + * loop because it will constantly overshoot or undershoot the distance to the next point on each + * physics frame update. */ public var pathDesiredDistance: Float get() { @@ -143,7 +140,11 @@ public open class NavigationAgent2D : Node() { } /** - * The distance threshold before the final target point is considered to be reached. This allows agents to not have to hit the point of the final target exactly, but only to reach its general area. If this value is set too low, the NavigationAgent will be stuck in a repath loop because it will constantly overshoot or undershoot the distance to the final target point on each physics frame update. + * The distance threshold before the final target point is considered to be reached. This allows + * agents to not have to hit the point of the final target exactly, but only to reach its general + * area. If this value is set too low, the NavigationAgent will be stuck in a repath loop because it + * will constantly overshoot or undershoot the distance to the final target point on each physics + * frame update. */ public var targetDesiredDistance: Float get() { @@ -157,7 +158,9 @@ public open class NavigationAgent2D : Node() { } /** - * The maximum distance the agent is allowed away from the ideal path to the final position. This can happen due to trying to avoid collisions. When the maximum distance is exceeded, it recalculates the ideal path. + * The maximum distance the agent is allowed away from the ideal path to the final position. This + * can happen due to trying to avoid collisions. When the maximum distance is exceeded, it + * recalculates the ideal path. */ public var pathMaxDistance: Float get() { @@ -171,7 +174,9 @@ public open class NavigationAgent2D : Node() { } /** - * A bitfield determining which navigation layers of navigation regions this agent will use to calculate a path. Changing it during runtime will clear the current navigation path and generate a new one, according to the new navigation layers. + * A bitfield determining which navigation layers of navigation regions this agent will use to + * calculate a path. Changing it during runtime will clear the current navigation path and generate a + * new one, according to the new navigation layers. */ public var navigationLayers: Long get() { @@ -227,7 +232,11 @@ public open class NavigationAgent2D : Node() { } /** - * If `true` the agent is registered for an RVO avoidance callback on the [godot.NavigationServer2D]. When [velocity] is used and the processing is completed a `safe_velocity` Vector2 is received with a signal connection to [velocityComputed]. Avoidance processing with many registered agents has a significant performance cost and should only be enabled on agents that currently require it. + * If `true` the agent is registered for an RVO avoidance callback on the [NavigationServer2D]. + * When [velocity] is used and the processing is completed a `safe_velocity` Vector2 is received with + * a signal connection to [signal velocity_computed]. Avoidance processing with many registered + * agents has a significant performance cost and should only be enabled on agents that currently + * require it. */ public var avoidanceEnabled: Boolean get() { @@ -241,7 +250,10 @@ public open class NavigationAgent2D : Node() { } /** - * Sets the new wanted velocity for the agent. The avoidance simulation will try to fulfill this velocity if possible but will modify it to avoid collision with other agents and obstacles. When an agent is teleported to a new position, use [setVelocityForced] as well to reset the internal simulation velocity. + * Sets the new wanted velocity for the agent. The avoidance simulation will try to fulfill this + * velocity if possible but will modify it to avoid collision with other agents and obstacles. When + * an agent is teleported to a new position, use [setVelocityForced] as well to reset the internal + * simulation velocity. */ @CoreTypeLocalCopy public var velocity: Vector2 @@ -256,9 +268,11 @@ public open class NavigationAgent2D : Node() { } /** - * The radius of the avoidance agent. This is the "body" of the avoidance agent and not the avoidance maneuver starting radius (which is controlled by [neighborDistance]). - * - * Does not affect normal pathfinding. To change an actor's pathfinding radius bake [godot.NavigationMesh] resources with a different [godot.NavigationMesh.agentRadius] property and use different navigation maps for each actor size. + * The radius of the avoidance agent. This is the "body" of the avoidance agent and not the + * avoidance maneuver starting radius (which is controlled by [neighborDistance]). + * Does not affect normal pathfinding. To change an actor's pathfinding radius bake + * [NavigationMesh] resources with a different [NavigationMesh.agentRadius] property and use + * different navigation maps for each actor size. */ public var radius: Float get() { @@ -300,7 +314,10 @@ public open class NavigationAgent2D : Node() { } /** - * The minimal amount of time for which this agent's velocities, that are computed with the collision avoidance algorithm, are safe with respect to other agents. The larger the number, the sooner the agent will respond to other agents, but less freedom in choosing its velocities. A too high value will slow down agents movement considerably. Must be positive. + * The minimal amount of time for which this agent's velocities, that are computed with the + * collision avoidance algorithm, are safe with respect to other agents. The larger the number, the + * sooner the agent will respond to other agents, but less freedom in choosing its velocities. A too + * high value will slow down agents movement considerably. Must be positive. */ public var timeHorizonAgents: Float get() { @@ -314,7 +331,11 @@ public open class NavigationAgent2D : Node() { } /** - * The minimal amount of time for which this agent's velocities, that are computed with the collision avoidance algorithm, are safe with respect to static avoidance obstacles. The larger the number, the sooner the agent will respond to static avoidance obstacles, but less freedom in choosing its velocities. A too high value will slow down agents movement considerably. Must be positive. + * The minimal amount of time for which this agent's velocities, that are computed with the + * collision avoidance algorithm, are safe with respect to static avoidance obstacles. The larger the + * number, the sooner the agent will respond to static avoidance obstacles, but less freedom in + * choosing its velocities. A too high value will slow down agents movement considerably. Must be + * positive. */ public var timeHorizonObstacles: Float get() { @@ -342,7 +363,8 @@ public open class NavigationAgent2D : Node() { } /** - * A bitfield determining the avoidance layers for this NavigationAgent. Other agents with a matching bit on the [avoidanceMask] will avoid this agent. + * A bitfield determining the avoidance layers for this NavigationAgent. Other agents with a + * matching bit on the [avoidanceMask] will avoid this agent. */ public var avoidanceLayers: Long get() { @@ -356,7 +378,8 @@ public open class NavigationAgent2D : Node() { } /** - * A bitfield determining what other avoidance agents and obstacles this NavigationAgent will avoid when a bit matches at least one of their [avoidanceLayers]. + * A bitfield determining what other avoidance agents and obstacles this NavigationAgent will + * avoid when a bit matches at least one of their [avoidanceLayers]. */ public var avoidanceMask: Long get() { @@ -370,7 +393,9 @@ public open class NavigationAgent2D : Node() { } /** - * The agent does not adjust the velocity for other agents that would match the [avoidanceMask] but have a lower [avoidancePriority]. This in turn makes the other agents with lower priority adjust their velocities even more to avoid collision with this agent. + * The agent does not adjust the velocity for other agents that would match the [avoidanceMask] + * but have a lower [avoidancePriority]. This in turn makes the other agents with lower priority + * adjust their velocities even more to avoid collision with this agent. */ public var avoidancePriority: Float get() { @@ -427,7 +452,8 @@ public open class NavigationAgent2D : Node() { } /** - * If [debugUseCustom] is `true` uses this rasterized point size for rendering path points for this agent instead of global point size. + * If [debugUseCustom] is `true` uses this rasterized point size for rendering path points for + * this agent instead of global point size. */ public var debugPathCustomPointSize: Float get() { @@ -441,7 +467,8 @@ public open class NavigationAgent2D : Node() { } /** - * If [debugUseCustom] is `true` uses this line width for rendering paths for this agent instead of global line width. + * If [debugUseCustom] is `true` uses this line width for rendering paths for this agent instead + * of global line width. */ public var debugPathCustomLineWidth: Float get() { @@ -460,7 +487,8 @@ public open class NavigationAgent2D : Node() { } /** - * If set, a new navigation path from the current agent position to the [targetPosition] is requested from the NavigationServer. + * If set, a new navigation path from the current agent position to the [targetPosition] is + * requested from the NavigationServer. * * This is a helper function to make dealing with local copies easier. * @@ -484,7 +512,10 @@ public open class NavigationAgent2D : Node() { /** - * Sets the new wanted velocity for the agent. The avoidance simulation will try to fulfill this velocity if possible but will modify it to avoid collision with other agents and obstacles. When an agent is teleported to a new position, use [setVelocityForced] as well to reset the internal simulation velocity. + * Sets the new wanted velocity for the agent. The avoidance simulation will try to fulfill this + * velocity if possible but will modify it to avoid collision with other agents and obstacles. When + * an agent is teleported to a new position, use [setVelocityForced] as well to reset the internal + * simulation velocity. * * This is a helper function to make dealing with local copies easier. * @@ -533,7 +564,7 @@ public open class NavigationAgent2D : Node() { /** - * Returns the [RID] of this agent on the [godot.NavigationServer2D]. + * Returns the [RID] of this agent on the [NavigationServer2D]. */ public fun getRid(): RID { TransferContext.writeArguments() @@ -542,7 +573,8 @@ public open class NavigationAgent2D : Node() { } /** - * Based on [value], enables or disables the specified layer in the [navigationLayers] bitmask, given a [layerNumber] between 1 and 32. + * Based on [param value], enables or disables the specified layer in the [navigationLayers] + * bitmask, given a [param layer_number] between 1 and 32. */ public fun setNavigationLayerValue(layerNumber: Int, `value`: Boolean): Unit { TransferContext.writeArguments(LONG to layerNumber.toLong(), BOOL to value) @@ -550,7 +582,8 @@ public open class NavigationAgent2D : Node() { } /** - * Returns whether or not the specified layer of the [navigationLayers] bitmask is enabled, given a [layerNumber] between 1 and 32. + * Returns whether or not the specified layer of the [navigationLayers] bitmask is enabled, given + * a [param layer_number] between 1 and 32. */ public fun getNavigationLayerValue(layerNumber: Int): Boolean { TransferContext.writeArguments(LONG to layerNumber.toLong()) @@ -559,7 +592,8 @@ public open class NavigationAgent2D : Node() { } /** - * Sets the [RID] of the navigation map this NavigationAgent node should use and also updates the `agent` on the NavigationServer. + * Sets the [RID] of the navigation map this NavigationAgent node should use and also updates the + * `agent` on the NavigationServer. */ public fun setNavigationMap(navigationMap: RID): Unit { TransferContext.writeArguments(_RID to navigationMap) @@ -567,7 +601,11 @@ public open class NavigationAgent2D : Node() { } /** - * Returns the [RID] of the navigation map for this NavigationAgent node. This function returns always the map set on the NavigationAgent node and not the map of the abstract agent on the NavigationServer. If the agent map is changed directly with the NavigationServer API the NavigationAgent node will not be aware of the map change. Use [setNavigationMap] to change the navigation map for the NavigationAgent and also update the agent on the NavigationServer. + * Returns the [RID] of the navigation map for this NavigationAgent node. This function returns + * always the map set on the NavigationAgent node and not the map of the abstract agent on the + * NavigationServer. If the agent map is changed directly with the NavigationServer API the + * NavigationAgent node will not be aware of the map change. Use [setNavigationMap] to change the + * navigation map for the NavigationAgent and also update the agent on the NavigationServer. */ public fun getNavigationMap(): RID { TransferContext.writeArguments() @@ -576,7 +614,10 @@ public open class NavigationAgent2D : Node() { } /** - * Returns the next position in global coordinates that can be moved to, making sure that there are no static objects in the way. If the agent does not have a navigation path, it will return the position of the agent's parent. The use of this function once every physics frame is required to update the internal path logic of the NavigationAgent. + * Returns the next position in global coordinates that can be moved to, making sure that there + * are no static objects in the way. If the agent does not have a navigation path, it will return the + * position of the agent's parent. The use of this function once every physics frame is required to + * update the internal path logic of the NavigationAgent. */ public fun getNextPathPosition(): Vector2 { TransferContext.writeArguments() @@ -585,7 +626,9 @@ public open class NavigationAgent2D : Node() { } /** - * Replaces the internal velocity in the collision avoidance simulation with [velocity]. When an agent is teleported to a new position this function should be used in the same frame. If called frequently this function can get agents stuck. + * Replaces the internal velocity in the collision avoidance simulation with [param velocity]. + * When an agent is teleported to a new position this function should be used in the same frame. If + * called frequently this function can get agents stuck. */ public fun setVelocityForced(velocity: Vector2): Unit { TransferContext.writeArguments(VECTOR2 to velocity) @@ -593,7 +636,8 @@ public open class NavigationAgent2D : Node() { } /** - * Returns the distance to the target position, using the agent's global position. The user must set [targetPosition] in order for this to be accurate. + * Returns the distance to the target position, using the agent's global position. The user must + * set [targetPosition] in order for this to be accurate. */ public fun distanceToTarget(): Float { TransferContext.writeArguments() @@ -611,7 +655,12 @@ public open class NavigationAgent2D : Node() { } /** - * Returns this agent's current path from start to finish in global coordinates. The path only updates when the target position is changed or the agent requires a repath. The path array is not intended to be used in direct path movement as the agent has its own internal path logic that would get corrupted by changing the path array manually. Use the intended [getNextPathPosition] once every physics frame to receive the next path point for the agents movement as this function also updates the internal path logic. + * Returns this agent's current path from start to finish in global coordinates. The path only + * updates when the target position is changed or the agent requires a repath. The path array is not + * intended to be used in direct path movement as the agent has its own internal path logic that + * would get corrupted by changing the path array manually. Use the intended [getNextPathPosition] + * once every physics frame to receive the next path point for the agents movement as this function + * also updates the internal path logic. */ public fun getCurrentNavigationPath(): PackedVector2Array { TransferContext.writeArguments() @@ -621,7 +670,7 @@ public open class NavigationAgent2D : Node() { } /** - * Returns which index the agent is currently on in the navigation path's [godot.PackedVector2Array]. + * Returns which index the agent is currently on in the navigation path's [PackedVector2Array]. */ public fun getCurrentNavigationPathIndex(): Int { TransferContext.writeArguments() @@ -630,7 +679,8 @@ public open class NavigationAgent2D : Node() { } /** - * Returns true if [targetPosition] is reached. It may not always be possible to reach the target position. It should always be possible to reach the final position though. See [getFinalPosition]. + * Returns true if [targetPosition] is reached. It may not always be possible to reach the target + * position. It should always be possible to reach the final position though. See [getFinalPosition]. */ public fun isTargetReached(): Boolean { TransferContext.writeArguments() @@ -649,8 +699,8 @@ public open class NavigationAgent2D : Node() { /** * Returns `true` if the end of the currently loaded navigation path has been reached. - * - * **Note:** While true prefer to stop calling update functions like [getNextPathPosition]. This avoids jittering the standing agent due to calling repeated path updates. + * **Note:** While true prefer to stop calling update functions like [getNextPathPosition]. This + * avoids jittering the standing agent due to calling repeated path updates. */ public fun isNavigationFinished(): Boolean { TransferContext.writeArguments() @@ -659,7 +709,9 @@ public open class NavigationAgent2D : Node() { } /** - * Returns the reachable final position of the current navigation path in global coordinates. This position can change if the agent needs to update the navigation path which makes the agent emit the [pathChanged] signal. + * Returns the reachable final position of the current navigation path in global coordinates. This + * position can change if the agent needs to update the navigation path which makes the agent emit + * the [signal path_changed] signal. */ public fun getFinalPosition(): Vector2 { TransferContext.writeArguments() @@ -668,7 +720,8 @@ public open class NavigationAgent2D : Node() { } /** - * Based on [value], enables or disables the specified layer in the [avoidanceLayers] bitmask, given a [layerNumber] between 1 and 32. + * Based on [param value], enables or disables the specified layer in the [avoidanceLayers] + * bitmask, given a [param layer_number] between 1 and 32. */ public fun setAvoidanceLayerValue(layerNumber: Int, `value`: Boolean): Unit { TransferContext.writeArguments(LONG to layerNumber.toLong(), BOOL to value) @@ -676,7 +729,8 @@ public open class NavigationAgent2D : Node() { } /** - * Returns whether or not the specified layer of the [avoidanceLayers] bitmask is enabled, given a [layerNumber] between 1 and 32. + * Returns whether or not the specified layer of the [avoidanceLayers] bitmask is enabled, given a + * [param layer_number] between 1 and 32. */ public fun getAvoidanceLayerValue(layerNumber: Int): Boolean { TransferContext.writeArguments(LONG to layerNumber.toLong()) @@ -685,7 +739,8 @@ public open class NavigationAgent2D : Node() { } /** - * Based on [value], enables or disables the specified mask in the [avoidanceMask] bitmask, given a [maskNumber] between 1 and 32. + * Based on [param value], enables or disables the specified mask in the [avoidanceMask] bitmask, + * given a [param mask_number] between 1 and 32. */ public fun setAvoidanceMaskValue(maskNumber: Int, `value`: Boolean): Unit { TransferContext.writeArguments(LONG to maskNumber.toLong(), BOOL to value) @@ -693,7 +748,8 @@ public open class NavigationAgent2D : Node() { } /** - * Returns whether or not the specified mask of the [avoidanceMask] bitmask is enabled, given a [maskNumber] between 1 and 32. + * Returns whether or not the specified mask of the [avoidanceMask] bitmask is enabled, given a + * [param mask_number] between 1 and 32. */ public fun getAvoidanceMaskValue(maskNumber: Int): Boolean { TransferContext.writeArguments(LONG to maskNumber.toLong()) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationAgent3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationAgent3D.kt index 128a3053e..4b494cdb8 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationAgent3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationAgent3D.kt @@ -40,81 +40,73 @@ import kotlin.Suppress import kotlin.Unit /** - * A 3D agent used to pathfind to a position while avoiding obstacles. - * - * Tutorials: - * [$DOCS_URL/tutorials/navigation/navigation_using_navigationagents.html]($DOCS_URL/tutorials/navigation/navigation_using_navigationagents.html) - * - * A 3D agent used to pathfind to a position while avoiding static and dynamic obstacles. The calculation can be used by the parent node to dynamically move it along the path. Requires navigation data to work correctly. - * - * Dynamic obstacles are avoided using RVO collision avoidance. Avoidance is computed before physics, so the pathfinding information can be used safely in the physics step. - * - * **Note:** After setting the [targetPosition] property, the [getNextPathPosition] method must be used once every physics frame to update the internal path logic of the navigation agent. The vector position it returns should be used as the next movement position for the agent's parent node. + * A 3D agent used to pathfind to a position while avoiding static and dynamic obstacles. The + * calculation can be used by the parent node to dynamically move it along the path. Requires + * navigation data to work correctly. + * Dynamic obstacles are avoided using RVO collision avoidance. Avoidance is computed before + * physics, so the pathfinding information can be used safely in the physics step. + * **Note:** After setting the [targetPosition] property, the [getNextPathPosition] method must be + * used once every physics frame to update the internal path logic of the navigation agent. The vector + * position it returns should be used as the next movement position for the agent's parent node. */ @GodotBaseType public open class NavigationAgent3D : Node() { /** * Emitted when the agent had to update the loaded path: - * * - because path was previously empty. - * * - because navigation map has changed. - * * - because agent pushed further away from the current path segment than the [pathMaxDistance]. */ public val pathChanged: Signal0 by signal() /** - * Emitted once per loaded path when the agent's global position is the first time within [targetDesiredDistance] to the [targetPosition]. + * Emitted once per loaded path when the agent's global position is the first time within + * [targetDesiredDistance] to the [targetPosition]. */ public val targetReached: Signal0 by signal() /** * Notifies when a waypoint along the path has been reached. - * - * The details dictionary may contain the following keys depending on the value of [pathMetadataFlags]: - * + * The details dictionary may contain the following keys depending on the value of + * [pathMetadataFlags]: * - `position`: The position of the waypoint that was reached. - * * - `type`: The type of navigation primitive (region or link) that contains this waypoint. - * * - `rid`: The [RID] of the containing navigation primitive (region or link). - * * - `owner`: The object which manages the containing navigation primitive (region or link). */ public val waypointReached: Signal1> by signal("details") /** * Notifies when a navigation link has been reached. - * - * The details dictionary may contain the following keys depending on the value of [pathMetadataFlags]: - * + * The details dictionary may contain the following keys depending on the value of + * [pathMetadataFlags]: * - `position`: The start position of the link that was reached. - * - * - `type`: Always [godot.NavigationPathQueryResult3D.PATH_SEGMENT_TYPE_LINK]. - * + * - `type`: Always [constant NavigationPathQueryResult3D.PATH_SEGMENT_TYPE_LINK]. * - `rid`: The [RID] of the link. - * - * - `owner`: The object which manages the link (usually [godot.NavigationLink3D]). - * - * - `link_entry_position`: If `owner` is available and the owner is a [godot.NavigationLink3D], it will contain the global position of the link's point the agent is entering. - * - * - `link_exit_position`: If `owner` is available and the owner is a [godot.NavigationLink3D], it will contain the global position of the link's point which the agent is exiting. + * - `owner`: The object which manages the link (usually [NavigationLink3D]). + * - `link_entry_position`: If `owner` is available and the owner is a [NavigationLink3D], it will + * contain the global position of the link's point the agent is entering. + * - `link_exit_position`: If `owner` is available and the owner is a [NavigationLink3D], it will + * contain the global position of the link's point which the agent is exiting. */ public val linkReached: Signal1> by signal("details") /** - * Emitted once per loaded path when the agent internal navigation path index reaches the last index of the loaded path array. The agent internal navigation path index can be received with [getCurrentNavigationPathIndex]. + * Emitted once per loaded path when the agent internal navigation path index reaches the last + * index of the loaded path array. The agent internal navigation path index can be received with + * [getCurrentNavigationPathIndex]. */ public val navigationFinished: Signal0 by signal() /** - * Notifies when the collision avoidance velocity is calculated. Emitted when [velocity] is set. Only emitted when [avoidanceEnabled] is true. + * Notifies when the collision avoidance velocity is calculated. Emitted when [velocity] is set. + * Only emitted when [avoidanceEnabled] is true. */ public val velocityComputed: Signal1 by signal("safeVelocity") /** - * If set, a new navigation path from the current agent position to the [targetPosition] is requested from the NavigationServer. + * If set, a new navigation path from the current agent position to the [targetPosition] is + * requested from the NavigationServer. */ @CoreTypeLocalCopy public var targetPosition: Vector3 @@ -129,7 +121,12 @@ public open class NavigationAgent3D : Node() { } /** - * The distance threshold before a path point is considered to be reached. This allows agents to not have to hit a path point on the path exactly, but only to reach its general area. If this value is set too high, the NavigationAgent will skip points on the path, which can lead to leaving the navigation mesh. If this value is set too low, the NavigationAgent will be stuck in a repath loop because it will constantly overshoot or undershoot the distance to the next point on each physics frame update. + * The distance threshold before a path point is considered to be reached. This allows agents to + * not have to hit a path point on the path exactly, but only to reach its general area. If this + * value is set too high, the NavigationAgent will skip points on the path, which can lead to leaving + * the navigation mesh. If this value is set too low, the NavigationAgent will be stuck in a repath + * loop because it will constantly overshoot or undershoot the distance to the next point on each + * physics frame update. */ public var pathDesiredDistance: Float get() { @@ -143,7 +140,11 @@ public open class NavigationAgent3D : Node() { } /** - * The distance threshold before the final target point is considered to be reached. This allows agents to not have to hit the point of the final target exactly, but only to reach its general area. If this value is set too low, the NavigationAgent will be stuck in a repath loop because it will constantly overshoot or undershoot the distance to the final target point on each physics frame update. + * The distance threshold before the final target point is considered to be reached. This allows + * agents to not have to hit the point of the final target exactly, but only to reach its general + * area. If this value is set too low, the NavigationAgent will be stuck in a repath loop because it + * will constantly overshoot or undershoot the distance to the final target point on each physics + * frame update. */ public var targetDesiredDistance: Float get() { @@ -157,7 +158,11 @@ public open class NavigationAgent3D : Node() { } /** - * The height offset is subtracted from the y-axis value of any vector path position for this NavigationAgent. The NavigationAgent height offset does not change or influence the navigation mesh or pathfinding query result. Additional navigation maps that use regions with navigation meshes that the developer baked with appropriate agent radius or height values are required to support different-sized agents. + * The height offset is subtracted from the y-axis value of any vector path position for this + * NavigationAgent. The NavigationAgent height offset does not change or influence the navigation + * mesh or pathfinding query result. Additional navigation maps that use regions with navigation + * meshes that the developer baked with appropriate agent radius or height values are required to + * support different-sized agents. */ public var pathHeightOffset: Float get() { @@ -171,7 +176,9 @@ public open class NavigationAgent3D : Node() { } /** - * The maximum distance the agent is allowed away from the ideal path to the final position. This can happen due to trying to avoid collisions. When the maximum distance is exceeded, it recalculates the ideal path. + * The maximum distance the agent is allowed away from the ideal path to the final position. This + * can happen due to trying to avoid collisions. When the maximum distance is exceeded, it + * recalculates the ideal path. */ public var pathMaxDistance: Float get() { @@ -185,7 +192,9 @@ public open class NavigationAgent3D : Node() { } /** - * A bitfield determining which navigation layers of navigation regions this agent will use to calculate a path. Changing it during runtime will clear the current navigation path and generate a new one, according to the new navigation layers. + * A bitfield determining which navigation layers of navigation regions this agent will use to + * calculate a path. Changing it during runtime will clear the current navigation path and generate a + * new one, according to the new navigation layers. */ public var navigationLayers: Long get() { @@ -241,7 +250,11 @@ public open class NavigationAgent3D : Node() { } /** - * If `true` the agent is registered for an RVO avoidance callback on the [godot.NavigationServer3D]. When [velocity] is set and the processing is completed a `safe_velocity` Vector3 is received with a signal connection to [velocityComputed]. Avoidance processing with many registered agents has a significant performance cost and should only be enabled on agents that currently require it. + * If `true` the agent is registered for an RVO avoidance callback on the [NavigationServer3D]. + * When [velocity] is set and the processing is completed a `safe_velocity` Vector3 is received with + * a signal connection to [signal velocity_computed]. Avoidance processing with many registered + * agents has a significant performance cost and should only be enabled on agents that currently + * require it. */ public var avoidanceEnabled: Boolean get() { @@ -255,7 +268,10 @@ public open class NavigationAgent3D : Node() { } /** - * Sets the new wanted velocity for the agent. The avoidance simulation will try to fulfill this velocity if possible but will modify it to avoid collision with other agents and obstacles. When an agent is teleported to a new position, use [setVelocityForced] as well to reset the internal simulation velocity. + * Sets the new wanted velocity for the agent. The avoidance simulation will try to fulfill this + * velocity if possible but will modify it to avoid collision with other agents and obstacles. When + * an agent is teleported to a new position, use [setVelocityForced] as well to reset the internal + * simulation velocity. */ @CoreTypeLocalCopy public var velocity: Vector3 @@ -270,7 +286,9 @@ public open class NavigationAgent3D : Node() { } /** - * The height of the avoidance agent. Agents will ignore other agents or obstacles that are above or below their current position + height in 2D avoidance. Does nothing in 3D avoidance which uses radius spheres alone. + * The height of the avoidance agent. Agents will ignore other agents or obstacles that are above + * or below their current position + height in 2D avoidance. Does nothing in 3D avoidance which uses + * radius spheres alone. */ public var height: Float get() { @@ -284,9 +302,11 @@ public open class NavigationAgent3D : Node() { } /** - * The radius of the avoidance agent. This is the "body" of the avoidance agent and not the avoidance maneuver starting radius (which is controlled by [neighborDistance]). - * - * Does not affect normal pathfinding. To change an actor's pathfinding radius bake [godot.NavigationMesh] resources with a different [godot.NavigationMesh.agentRadius] property and use different navigation maps for each actor size. + * The radius of the avoidance agent. This is the "body" of the avoidance agent and not the + * avoidance maneuver starting radius (which is controlled by [neighborDistance]). + * Does not affect normal pathfinding. To change an actor's pathfinding radius bake + * [NavigationMesh] resources with a different [NavigationMesh.agentRadius] property and use + * different navigation maps for each actor size. */ public var radius: Float get() { @@ -328,7 +348,10 @@ public open class NavigationAgent3D : Node() { } /** - * The minimal amount of time for which this agent's velocities, that are computed with the collision avoidance algorithm, are safe with respect to other agents. The larger the number, the sooner the agent will respond to other agents, but less freedom in choosing its velocities. A too high value will slow down agents movement considerably. Must be positive. + * The minimal amount of time for which this agent's velocities, that are computed with the + * collision avoidance algorithm, are safe with respect to other agents. The larger the number, the + * sooner the agent will respond to other agents, but less freedom in choosing its velocities. A too + * high value will slow down agents movement considerably. Must be positive. */ public var timeHorizonAgents: Float get() { @@ -342,7 +365,11 @@ public open class NavigationAgent3D : Node() { } /** - * The minimal amount of time for which this agent's velocities, that are computed with the collision avoidance algorithm, are safe with respect to static avoidance obstacles. The larger the number, the sooner the agent will respond to static avoidance obstacles, but less freedom in choosing its velocities. A too high value will slow down agents movement considerably. Must be positive. + * The minimal amount of time for which this agent's velocities, that are computed with the + * collision avoidance algorithm, are safe with respect to static avoidance obstacles. The larger the + * number, the sooner the agent will respond to static avoidance obstacles, but less freedom in + * choosing its velocities. A too high value will slow down agents movement considerably. Must be + * positive. */ public var timeHorizonObstacles: Float get() { @@ -370,9 +397,14 @@ public open class NavigationAgent3D : Node() { } /** - * If `true`, the agent calculates avoidance velocities in 3D omnidirectionally, e.g. for games that take place in air, underwater or space. Agents using 3D avoidance only avoid other agents using 3D avoidance, and react to radius-based avoidance obstacles. They ignore any vertex-based obstacles. - * - * If `false`, the agent calculates avoidance velocities in 2D along the x and z-axes, ignoring the y-axis. Agents using 2D avoidance only avoid other agents using 2D avoidance, and react to radius-based avoidance obstacles or vertex-based avoidance obstacles. Other agents using 2D avoidance that are below or above their current position including [height] are ignored. + * If `true`, the agent calculates avoidance velocities in 3D omnidirectionally, e.g. for games + * that take place in air, underwater or space. Agents using 3D avoidance only avoid other agents + * using 3D avoidance, and react to radius-based avoidance obstacles. They ignore any vertex-based + * obstacles. + * If `false`, the agent calculates avoidance velocities in 2D along the x and z-axes, ignoring + * the y-axis. Agents using 2D avoidance only avoid other agents using 2D avoidance, and react to + * radius-based avoidance obstacles or vertex-based avoidance obstacles. Other agents using 2D + * avoidance that are below or above their current position including [height] are ignored. */ public var use3dAvoidance: Boolean get() { @@ -400,7 +432,8 @@ public open class NavigationAgent3D : Node() { } /** - * A bitfield determining the avoidance layers for this NavigationAgent. Other agents with a matching bit on the [avoidanceMask] will avoid this agent. + * A bitfield determining the avoidance layers for this NavigationAgent. Other agents with a + * matching bit on the [avoidanceMask] will avoid this agent. */ public var avoidanceLayers: Long get() { @@ -414,7 +447,8 @@ public open class NavigationAgent3D : Node() { } /** - * A bitfield determining what other avoidance agents and obstacles this NavigationAgent will avoid when a bit matches at least one of their [avoidanceLayers]. + * A bitfield determining what other avoidance agents and obstacles this NavigationAgent will + * avoid when a bit matches at least one of their [avoidanceLayers]. */ public var avoidanceMask: Long get() { @@ -428,7 +462,9 @@ public open class NavigationAgent3D : Node() { } /** - * The agent does not adjust the velocity for other agents that would match the [avoidanceMask] but have a lower [avoidancePriority]. This in turn makes the other agents with lower priority adjust their velocities even more to avoid collision with this agent. + * The agent does not adjust the velocity for other agents that would match the [avoidanceMask] + * but have a lower [avoidancePriority]. This in turn makes the other agents with lower priority + * adjust their velocities even more to avoid collision with this agent. */ public var avoidancePriority: Float get() { @@ -485,7 +521,8 @@ public open class NavigationAgent3D : Node() { } /** - * If [debugUseCustom] is `true` uses this rasterized point size for rendering path points for this agent instead of global point size. + * If [debugUseCustom] is `true` uses this rasterized point size for rendering path points for + * this agent instead of global point size. */ public var debugPathCustomPointSize: Float get() { @@ -504,7 +541,8 @@ public open class NavigationAgent3D : Node() { } /** - * If set, a new navigation path from the current agent position to the [targetPosition] is requested from the NavigationServer. + * If set, a new navigation path from the current agent position to the [targetPosition] is + * requested from the NavigationServer. * * This is a helper function to make dealing with local copies easier. * @@ -528,7 +566,10 @@ public open class NavigationAgent3D : Node() { /** - * Sets the new wanted velocity for the agent. The avoidance simulation will try to fulfill this velocity if possible but will modify it to avoid collision with other agents and obstacles. When an agent is teleported to a new position, use [setVelocityForced] as well to reset the internal simulation velocity. + * Sets the new wanted velocity for the agent. The avoidance simulation will try to fulfill this + * velocity if possible but will modify it to avoid collision with other agents and obstacles. When + * an agent is teleported to a new position, use [setVelocityForced] as well to reset the internal + * simulation velocity. * * This is a helper function to make dealing with local copies easier. * @@ -577,7 +618,7 @@ public open class NavigationAgent3D : Node() { /** - * Returns the [RID] of this agent on the [godot.NavigationServer3D]. + * Returns the [RID] of this agent on the [NavigationServer3D]. */ public fun getRid(): RID { TransferContext.writeArguments() @@ -586,7 +627,8 @@ public open class NavigationAgent3D : Node() { } /** - * Based on [value], enables or disables the specified layer in the [navigationLayers] bitmask, given a [layerNumber] between 1 and 32. + * Based on [param value], enables or disables the specified layer in the [navigationLayers] + * bitmask, given a [param layer_number] between 1 and 32. */ public fun setNavigationLayerValue(layerNumber: Int, `value`: Boolean): Unit { TransferContext.writeArguments(LONG to layerNumber.toLong(), BOOL to value) @@ -594,7 +636,8 @@ public open class NavigationAgent3D : Node() { } /** - * Returns whether or not the specified layer of the [navigationLayers] bitmask is enabled, given a [layerNumber] between 1 and 32. + * Returns whether or not the specified layer of the [navigationLayers] bitmask is enabled, given + * a [param layer_number] between 1 and 32. */ public fun getNavigationLayerValue(layerNumber: Int): Boolean { TransferContext.writeArguments(LONG to layerNumber.toLong()) @@ -603,7 +646,8 @@ public open class NavigationAgent3D : Node() { } /** - * Sets the [RID] of the navigation map this NavigationAgent node should use and also updates the `agent` on the NavigationServer. + * Sets the [RID] of the navigation map this NavigationAgent node should use and also updates the + * `agent` on the NavigationServer. */ public fun setNavigationMap(navigationMap: RID): Unit { TransferContext.writeArguments(_RID to navigationMap) @@ -611,7 +655,11 @@ public open class NavigationAgent3D : Node() { } /** - * Returns the [RID] of the navigation map for this NavigationAgent node. This function returns always the map set on the NavigationAgent node and not the map of the abstract agent on the NavigationServer. If the agent map is changed directly with the NavigationServer API the NavigationAgent node will not be aware of the map change. Use [setNavigationMap] to change the navigation map for the NavigationAgent and also update the agent on the NavigationServer. + * Returns the [RID] of the navigation map for this NavigationAgent node. This function returns + * always the map set on the NavigationAgent node and not the map of the abstract agent on the + * NavigationServer. If the agent map is changed directly with the NavigationServer API the + * NavigationAgent node will not be aware of the map change. Use [setNavigationMap] to change the + * navigation map for the NavigationAgent and also update the agent on the NavigationServer. */ public fun getNavigationMap(): RID { TransferContext.writeArguments() @@ -620,7 +668,10 @@ public open class NavigationAgent3D : Node() { } /** - * Returns the next position in global coordinates that can be moved to, making sure that there are no static objects in the way. If the agent does not have a navigation path, it will return the position of the agent's parent. The use of this function once every physics frame is required to update the internal path logic of the NavigationAgent. + * Returns the next position in global coordinates that can be moved to, making sure that there + * are no static objects in the way. If the agent does not have a navigation path, it will return the + * position of the agent's parent. The use of this function once every physics frame is required to + * update the internal path logic of the NavigationAgent. */ public fun getNextPathPosition(): Vector3 { TransferContext.writeArguments() @@ -629,7 +680,9 @@ public open class NavigationAgent3D : Node() { } /** - * Replaces the internal velocity in the collision avoidance simulation with [velocity]. When an agent is teleported to a new position this function should be used in the same frame. If called frequently this function can get agents stuck. + * Replaces the internal velocity in the collision avoidance simulation with [param velocity]. + * When an agent is teleported to a new position this function should be used in the same frame. If + * called frequently this function can get agents stuck. */ public fun setVelocityForced(velocity: Vector3): Unit { TransferContext.writeArguments(VECTOR3 to velocity) @@ -637,7 +690,8 @@ public open class NavigationAgent3D : Node() { } /** - * Returns the distance to the target position, using the agent's global position. The user must set [targetPosition] in order for this to be accurate. + * Returns the distance to the target position, using the agent's global position. The user must + * set [targetPosition] in order for this to be accurate. */ public fun distanceToTarget(): Float { TransferContext.writeArguments() @@ -655,7 +709,12 @@ public open class NavigationAgent3D : Node() { } /** - * Returns this agent's current path from start to finish in global coordinates. The path only updates when the target position is changed or the agent requires a repath. The path array is not intended to be used in direct path movement as the agent has its own internal path logic that would get corrupted by changing the path array manually. Use the intended [getNextPathPosition] once every physics frame to receive the next path point for the agents movement as this function also updates the internal path logic. + * Returns this agent's current path from start to finish in global coordinates. The path only + * updates when the target position is changed or the agent requires a repath. The path array is not + * intended to be used in direct path movement as the agent has its own internal path logic that + * would get corrupted by changing the path array manually. Use the intended [getNextPathPosition] + * once every physics frame to receive the next path point for the agents movement as this function + * also updates the internal path logic. */ public fun getCurrentNavigationPath(): PackedVector3Array { TransferContext.writeArguments() @@ -665,7 +724,7 @@ public open class NavigationAgent3D : Node() { } /** - * Returns which index the agent is currently on in the navigation path's [godot.PackedVector3Array]. + * Returns which index the agent is currently on in the navigation path's [PackedVector3Array]. */ public fun getCurrentNavigationPathIndex(): Int { TransferContext.writeArguments() @@ -674,7 +733,8 @@ public open class NavigationAgent3D : Node() { } /** - * Returns true if [targetPosition] is reached. It may not always be possible to reach the target position. It should always be possible to reach the final position though. See [getFinalPosition]. + * Returns true if [targetPosition] is reached. It may not always be possible to reach the target + * position. It should always be possible to reach the final position though. See [getFinalPosition]. */ public fun isTargetReached(): Boolean { TransferContext.writeArguments() @@ -693,8 +753,8 @@ public open class NavigationAgent3D : Node() { /** * Returns `true` if the end of the currently loaded navigation path has been reached. - * - * **Note:** While true prefer to stop calling update functions like [getNextPathPosition]. This avoids jittering the standing agent due to calling repeated path updates. + * **Note:** While true prefer to stop calling update functions like [getNextPathPosition]. This + * avoids jittering the standing agent due to calling repeated path updates. */ public fun isNavigationFinished(): Boolean { TransferContext.writeArguments() @@ -703,7 +763,9 @@ public open class NavigationAgent3D : Node() { } /** - * Returns the reachable final position of the current navigation path in global coordinates. This position can change if the agent needs to update the navigation path which makes the agent emit the [pathChanged] signal. + * Returns the reachable final position of the current navigation path in global coordinates. This + * position can change if the agent needs to update the navigation path which makes the agent emit + * the [signal path_changed] signal. */ public fun getFinalPosition(): Vector3 { TransferContext.writeArguments() @@ -712,7 +774,8 @@ public open class NavigationAgent3D : Node() { } /** - * Based on [value], enables or disables the specified layer in the [avoidanceLayers] bitmask, given a [layerNumber] between 1 and 32. + * Based on [param value], enables or disables the specified layer in the [avoidanceLayers] + * bitmask, given a [param layer_number] between 1 and 32. */ public fun setAvoidanceLayerValue(layerNumber: Int, `value`: Boolean): Unit { TransferContext.writeArguments(LONG to layerNumber.toLong(), BOOL to value) @@ -720,7 +783,8 @@ public open class NavigationAgent3D : Node() { } /** - * Returns whether or not the specified layer of the [avoidanceLayers] bitmask is enabled, given a [layerNumber] between 1 and 32. + * Returns whether or not the specified layer of the [avoidanceLayers] bitmask is enabled, given a + * [param layer_number] between 1 and 32. */ public fun getAvoidanceLayerValue(layerNumber: Int): Boolean { TransferContext.writeArguments(LONG to layerNumber.toLong()) @@ -729,7 +793,8 @@ public open class NavigationAgent3D : Node() { } /** - * Based on [value], enables or disables the specified mask in the [avoidanceMask] bitmask, given a [maskNumber] between 1 and 32. + * Based on [param value], enables or disables the specified mask in the [avoidanceMask] bitmask, + * given a [param mask_number] between 1 and 32. */ public fun setAvoidanceMaskValue(maskNumber: Int, `value`: Boolean): Unit { TransferContext.writeArguments(LONG to maskNumber.toLong(), BOOL to value) @@ -737,7 +802,8 @@ public open class NavigationAgent3D : Node() { } /** - * Returns whether or not the specified mask of the [avoidanceMask] bitmask is enabled, given a [maskNumber] between 1 and 32. + * Returns whether or not the specified mask of the [avoidanceMask] bitmask is enabled, given a + * [param mask_number] between 1 and 32. */ public fun getAvoidanceMaskValue(maskNumber: Int): Boolean { TransferContext.writeArguments(LONG to maskNumber.toLong()) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationMesh.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationMesh.kt index d6f64367c..8591ff8ee 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationMesh.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationMesh.kt @@ -35,12 +35,8 @@ import kotlin.Suppress import kotlin.Unit /** - * A navigation mesh that defines traversable areas and obstacles. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/124](https://godotengine.org/asset-library/asset/124) - * - * A navigation mesh is a collection of polygons that define which areas of an environment are traversable to aid agents in pathfinding through complicated spaces. + * A navigation mesh is a collection of polygons that define which areas of an environment are + * traversable to aid agents in pathfinding through complicated spaces. */ @GodotBaseType public open class NavigationMesh : Resource() { @@ -56,7 +52,8 @@ public open class NavigationMesh : Resource() { } /** - * Partitioning algorithm for creating the navigation mesh polys. See [enum SamplePartitionType] for possible values. + * Partitioning algorithm for creating the navigation mesh polys. See [enum SamplePartitionType] + * for possible values. */ public var samplePartitionType: SamplePartitionType get() { @@ -70,7 +67,8 @@ public open class NavigationMesh : Resource() { } /** - * Determines which type of nodes will be parsed as geometry. See [enum ParsedGeometryType] for possible values. + * Determines which type of nodes will be parsed as geometry. See [enum ParsedGeometryType] for + * possible values. */ public var geometryParsedGeometryType: ParsedGeometryType get() { @@ -85,8 +83,8 @@ public open class NavigationMesh : Resource() { /** * The physics layers to scan for static colliders. - * - * Only used when [geometryParsedGeometryType] is [PARSED_GEOMETRY_STATIC_COLLIDERS] or [PARSED_GEOMETRY_BOTH]. + * Only used when [geometryParsedGeometryType] is [constant PARSED_GEOMETRY_STATIC_COLLIDERS] or + * [constant PARSED_GEOMETRY_BOTH]. */ public var geometryCollisionMask: Long get() { @@ -115,8 +113,8 @@ public open class NavigationMesh : Resource() { /** * The name of the group to scan for geometry. - * - * Only used when [geometrySourceGeometryMode] is [SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN] or [SOURCE_GEOMETRY_GROUPS_EXPLICIT]. + * Only used when [geometrySourceGeometryMode] is [constant SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN] + * or [constant SOURCE_GEOMETRY_GROUPS_EXPLICIT]. */ public var geometrySourceGroupName: StringName get() { @@ -130,7 +128,8 @@ public open class NavigationMesh : Resource() { } /** - * The cell size used to rasterize the navigation mesh vertices on the XZ plane. Must match with the cell size on the navigation map. + * The cell size used to rasterize the navigation mesh vertices on the XZ plane. Must match with + * the cell size on the navigation map. */ public var cellSize: Float get() { @@ -144,7 +143,8 @@ public open class NavigationMesh : Resource() { } /** - * The cell height used to rasterize the navigation mesh vertices on the Y axis. Must match with the cell height on the navigation map. + * The cell height used to rasterize the navigation mesh vertices on the Y axis. Must match with + * the cell height on the navigation map. */ public var cellHeight: Float get() { @@ -158,8 +158,8 @@ public open class NavigationMesh : Resource() { } /** - * The minimum floor to ceiling height that will still allow the floor area to be considered walkable. - * + * The minimum floor to ceiling height that will still allow the floor area to be considered + * walkable. * **Note:** While baking, this value will be rounded up to the nearest multiple of [cellHeight]. */ public var agentHeight: Float @@ -175,7 +175,6 @@ public open class NavigationMesh : Resource() { /** * The distance to erode/shrink the walkable area of the heightfield away from obstructions. - * * **Note:** While baking, this value will be rounded up to the nearest multiple of [cellSize]. */ public var agentRadius: Float @@ -191,8 +190,8 @@ public open class NavigationMesh : Resource() { /** * The minimum ledge height that is considered to still be traversable. - * - * **Note:** While baking, this value will be rounded down to the nearest multiple of [cellHeight]. + * **Note:** While baking, this value will be rounded down to the nearest multiple of + * [cellHeight]. */ public var agentMaxClimb: Float get() { @@ -221,8 +220,8 @@ public open class NavigationMesh : Resource() { /** * The minimum size of a region for it to be created. - * - * **Note:** This value will be squared to calculate the minimum number of cells allowed to form isolated island areas. For example, a value of 8 will set the number of cells to 64. + * **Note:** This value will be squared to calculate the minimum number of cells allowed to form + * isolated island areas. For example, a value of 8 will set the number of cells to 64. */ public var regionMinSize: Float get() { @@ -237,8 +236,8 @@ public open class NavigationMesh : Resource() { /** * Any regions with a size smaller than this will be merged with larger regions if possible. - * - * **Note:** This value will be squared to calculate the number of cells. For example, a value of 20 will set the number of cells to 400. + * **Note:** This value will be squared to calculate the number of cells. For example, a value of + * 20 will set the number of cells to 400. */ public var regionMergeSize: Float get() { @@ -252,8 +251,8 @@ public open class NavigationMesh : Resource() { } /** - * The maximum allowed length for contour edges along the border of the mesh. A value of `0.0` disables this feature. - * + * The maximum allowed length for contour edges along the border of the mesh. A value of `0.0` + * disables this feature. * **Note:** While baking, this value will be rounded up to the nearest multiple of [cellSize]. */ public var edgeMaxLength: Float @@ -268,7 +267,8 @@ public open class NavigationMesh : Resource() { } /** - * The maximum distance a simplified contour's border edges should deviate the original raw contour. + * The maximum distance a simplified contour's border edges should deviate the original raw + * contour. */ public var edgeMaxError: Float get() { @@ -282,7 +282,8 @@ public open class NavigationMesh : Resource() { } /** - * The maximum number of vertices allowed for polygons generated during the contour to polygon conversion process. + * The maximum number of vertices allowed for polygons generated during the contour to polygon + * conversion process. */ public var verticesPerPolygon: Float get() { @@ -324,7 +325,8 @@ public open class NavigationMesh : Resource() { } /** - * If `true`, marks non-walkable spans as walkable if their maximum is within [agentMaxClimb] of a walkable neighbor. + * If `true`, marks non-walkable spans as walkable if their maximum is within [agentMaxClimb] of a + * walkable neighbor. */ public var filterLowHangingObstacles: Boolean get() { @@ -352,7 +354,8 @@ public open class NavigationMesh : Resource() { } /** - * If `true`, marks walkable spans as not walkable if the clearance above the span is less than [agentHeight]. + * If `true`, marks walkable spans as not walkable if the clearance above the span is less than + * [agentHeight]. */ public var filterWalkableLowHeightSpans: Boolean get() { @@ -366,7 +369,8 @@ public open class NavigationMesh : Resource() { } /** - * If the baking [AABB] has a volume the navigation mesh baking will be restricted to its enclosing area. + * If the baking [AABB] has a volume the navigation mesh baking will be restricted to its + * enclosing area. */ @CoreTypeLocalCopy public var filterBakingAabb: AABB @@ -402,7 +406,8 @@ public open class NavigationMesh : Resource() { } /** - * If the baking [AABB] has a volume the navigation mesh baking will be restricted to its enclosing area. + * If the baking [AABB] has a volume the navigation mesh baking will be restricted to its + * enclosing area. * * This is a helper function to make dealing with local copies easier. * @@ -451,7 +456,8 @@ public open class NavigationMesh : Resource() { /** - * Based on [value], enables or disables the specified layer in the [geometryCollisionMask], given a [layerNumber] between 1 and 32. + * Based on [param value], enables or disables the specified layer in the [geometryCollisionMask], + * given a [param layer_number] between 1 and 32. */ public fun setCollisionMaskValue(layerNumber: Int, `value`: Boolean): Unit { TransferContext.writeArguments(LONG to layerNumber.toLong(), BOOL to value) @@ -459,7 +465,8 @@ public open class NavigationMesh : Resource() { } /** - * Returns whether or not the specified layer of the [geometryCollisionMask] is enabled, given a [layerNumber] between 1 and 32. + * Returns whether or not the specified layer of the [geometryCollisionMask] is enabled, given a + * [param layer_number] between 1 and 32. */ public fun getCollisionMaskValue(layerNumber: Int): Boolean { TransferContext.writeArguments(LONG to layerNumber.toLong()) @@ -485,7 +492,7 @@ public open class NavigationMesh : Resource() { } /** - * Returns a [godot.PackedInt32Array] containing the indices of the vertices of a created polygon. + * Returns a [PackedInt32Array] containing the indices of the vertices of a created polygon. */ public fun getPolygon(idx: Int): PackedInt32Array { TransferContext.writeArguments(LONG to idx.toLong()) @@ -502,9 +509,9 @@ public open class NavigationMesh : Resource() { } /** - * Initializes the navigation mesh by setting the vertices and indices according to a [godot.Mesh]. - * - * **Note:** The given [mesh] must be of type [godot.Mesh.PRIMITIVE_TRIANGLES] and have an index array. + * Initializes the navigation mesh by setting the vertices and indices according to a [Mesh]. + * **Note:** The given [param mesh] must be of type [constant Mesh.PRIMITIVE_TRIANGLES] and have + * an index array. */ public fun createFromMesh(mesh: Mesh): Unit { TransferContext.writeArguments(OBJECT to mesh) @@ -523,7 +530,8 @@ public open class NavigationMesh : Resource() { id: Long, ) { /** - * Watershed partitioning. Generally the best choice if you precompute the navigation mesh, use this if you have large open areas. + * Watershed partitioning. Generally the best choice if you precompute the navigation mesh, use + * this if you have large open areas. */ SAMPLE_PARTITION_WATERSHED(0), /** @@ -531,7 +539,8 @@ public open class NavigationMesh : Resource() { */ SAMPLE_PARTITION_MONOTONE(1), /** - * Layer partitioning. Good choice to use for tiled navigation mesh with medium and small sized tiles. + * Layer partitioning. Good choice to use for tiled navigation mesh with medium and small sized + * tiles. */ SAMPLE_PARTITION_LAYERS(2), /** @@ -554,15 +563,18 @@ public open class NavigationMesh : Resource() { id: Long, ) { /** - * Parses mesh instances as geometry. This includes [godot.MeshInstance3D], [godot.CSGShape3D], and [godot.GridMap] nodes. + * Parses mesh instances as geometry. This includes [MeshInstance3D], [CSGShape3D], and + * [GridMap] nodes. */ PARSED_GEOMETRY_MESH_INSTANCES(0), /** - * Parses [godot.StaticBody3D] colliders as geometry. The collider should be in any of the layers specified by [geometryCollisionMask]. + * Parses [StaticBody3D] colliders as geometry. The collider should be in any of the layers + * specified by [geometryCollisionMask]. */ PARSED_GEOMETRY_STATIC_COLLIDERS(1), /** - * Both [PARSED_GEOMETRY_MESH_INSTANCES] and [PARSED_GEOMETRY_STATIC_COLLIDERS]. + * Both [constant PARSED_GEOMETRY_MESH_INSTANCES] and [constant + * PARSED_GEOMETRY_STATIC_COLLIDERS]. */ PARSED_GEOMETRY_BOTH(2), /** @@ -589,7 +601,8 @@ public open class NavigationMesh : Resource() { */ SOURCE_GEOMETRY_ROOT_NODE_CHILDREN(0), /** - * Scans nodes in a group and their child nodes recursively for geometry. The group is specified by [geometrySourceGroupName]. + * Scans nodes in a group and their child nodes recursively for geometry. The group is specified + * by [geometrySourceGroupName]. */ SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN(1), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationMeshGenerator.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationMeshGenerator.kt index 1a13ff90b..ef89cee3a 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationMeshGenerator.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationMeshGenerator.kt @@ -21,20 +21,35 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * Helper class for creating and clearing navigation meshes. - * - * Tutorials: - * [$DOCS_URL/tutorials/navigation/navigation_using_navigationmeshes.html]($DOCS_URL/tutorials/navigation/navigation_using_navigationmeshes.html) - * - * This class is responsible for creating and clearing 3D navigation meshes used as [godot.NavigationMesh] resources inside [godot.NavigationRegion3D]. The [godot.NavigationMeshGenerator] has very limited to no use for 2D as the navigation mesh baking process expects 3D node types and 3D source geometry to parse. - * - * The entire navigation mesh baking is best done in a separate thread as the voxelization, collision tests and mesh optimization steps involved are very performance and time hungry operations. - * - * Navigation mesh baking happens in multiple steps and the result depends on 3D source geometry and properties of the [godot.NavigationMesh] resource. In the first step, starting from a root node and depending on [godot.NavigationMesh] properties all valid 3D source geometry nodes are collected from the [godot.SceneTree]. Second, all collected nodes are parsed for their relevant 3D geometry data and a combined 3D mesh is build. Due to the many different types of parsable objects, from normal [godot.MeshInstance3D]s to [godot.CSGShape3D]s or various [godot.CollisionObject3D]s, some operations to collect geometry data can trigger [godot.RenderingServer] and [godot.PhysicsServer3D] synchronizations. Server synchronization can have a negative effect on baking time or framerate as it often involves [godot.Mutex] locking for thread security. Many parsable objects and the continuous synchronization with other threaded Servers can increase the baking time significantly. On the other hand only a few but very large and complex objects will take some time to prepare for the Servers which can noticeably stall the next frame render. As a general rule the total number of parsable objects and their individual size and complexity should be balanced to avoid framerate issues or very long baking times. The combined mesh is then passed to the Recast Navigation Object to test the source geometry for walkable terrain suitable to [godot.NavigationMesh] agent properties by creating a voxel world around the meshes bounding area. - * - * The finalized navigation mesh is then returned and stored inside the [godot.NavigationMesh] for use as a resource inside [godot.NavigationRegion3D] nodes. - * - * **Note:** Using meshes to not only define walkable surfaces but also obstruct navigation baking does not always work. The navigation baking has no concept of what is a geometry "inside" when dealing with mesh source geometry and this is intentional. Depending on current baking parameters, as soon as the obstructing mesh is large enough to fit a navigation mesh area inside, the baking will generate navigation mesh areas that are inside the obstructing source geometry mesh. + * This class is responsible for creating and clearing 3D navigation meshes used as [NavigationMesh] + * resources inside [NavigationRegion3D]. The [NavigationMeshGenerator] has very limited to no use for + * 2D as the navigation mesh baking process expects 3D node types and 3D source geometry to parse. + * The entire navigation mesh baking is best done in a separate thread as the voxelization, + * collision tests and mesh optimization steps involved are very performance and time hungry + * operations. + * Navigation mesh baking happens in multiple steps and the result depends on 3D source geometry and + * properties of the [NavigationMesh] resource. In the first step, starting from a root node and + * depending on [NavigationMesh] properties all valid 3D source geometry nodes are collected from the + * [SceneTree]. Second, all collected nodes are parsed for their relevant 3D geometry data and a + * combined 3D mesh is build. Due to the many different types of parsable objects, from normal + * [MeshInstance3D]s to [CSGShape3D]s or various [CollisionObject3D]s, some operations to collect + * geometry data can trigger [RenderingServer] and [PhysicsServer3D] synchronizations. Server + * synchronization can have a negative effect on baking time or framerate as it often involves [Mutex] + * locking for thread security. Many parsable objects and the continuous synchronization with other + * threaded Servers can increase the baking time significantly. On the other hand only a few but very + * large and complex objects will take some time to prepare for the Servers which can noticeably stall + * the next frame render. As a general rule the total number of parsable objects and their individual + * size and complexity should be balanced to avoid framerate issues or very long baking times. The + * combined mesh is then passed to the Recast Navigation Object to test the source geometry for + * walkable terrain suitable to [NavigationMesh] agent properties by creating a voxel world around the + * meshes bounding area. + * The finalized navigation mesh is then returned and stored inside the [NavigationMesh] for use as + * a resource inside [NavigationRegion3D] nodes. + * **Note:** Using meshes to not only define walkable surfaces but also obstruct navigation baking + * does not always work. The navigation baking has no concept of what is a geometry "inside" when + * dealing with mesh source geometry and this is intentional. Depending on current baking parameters, + * as soon as the obstructing mesh is large enough to fit a navigation mesh area inside, the baking + * will generate navigation mesh areas that are inside the obstructing source geometry mesh. */ @GodotBaseType public object NavigationMeshGenerator : Object() { @@ -44,7 +59,11 @@ public object NavigationMeshGenerator : Object() { } /** - * The bake function is deprecated due to core threading changes. To upgrade existing code, first create a [godot.NavigationMeshSourceGeometryData3D] resource. Use this resource with [parseSourceGeometryData] to parse the SceneTree for nodes that should contribute to the navigation mesh baking. The SceneTree parsing needs to happen on the main thread. After the parsing is finished use the resource with [bakeFromSourceGeometryData] to bake a navigation mesh. + * The bake function is deprecated due to core threading changes. To upgrade existing code, first + * create a [NavigationMeshSourceGeometryData3D] resource. Use this resource with + * [parseSourceGeometryData] to parse the SceneTree for nodes that should contribute to the + * navigation mesh baking. The SceneTree parsing needs to happen on the main thread. After the + * parsing is finished use the resource with [bakeFromSourceGeometryData] to bake a navigation mesh. */ public fun bake(navigationMesh: NavigationMesh, rootNode: Node): Unit { TransferContext.writeArguments(OBJECT to navigationMesh, OBJECT to rootNode) @@ -52,7 +71,7 @@ public object NavigationMeshGenerator : Object() { } /** - * Removes all polygons and vertices from the provided [navigationMesh] resource. + * Removes all polygons and vertices from the provided [param navigation_mesh] resource. */ public fun clear(navigationMesh: NavigationMesh): Unit { TransferContext.writeArguments(OBJECT to navigationMesh) @@ -60,11 +79,16 @@ public object NavigationMeshGenerator : Object() { } /** - * Parses the [godot.SceneTree] for source geometry according to the properties of [navigationMesh]. Updates the provided [sourceGeometryData] resource with the resulting data. The resource can then be used to bake a navigation mesh with [bakeFromSourceGeometryData]. After the process is finished the optional [callback] will be called. - * - * **Note:** This function needs to run on the main thread or with a deferred call as the SceneTree is not thread-safe. - * - * **Performance:** While convenient, reading data arrays from [godot.Mesh] resources can affect the frame rate negatively. The data needs to be received from the GPU, stalling the [godot.RenderingServer] in the process. For performance prefer the use of e.g. collision shapes or creating the data arrays entirely in code. + * Parses the [SceneTree] for source geometry according to the properties of [param + * navigation_mesh]. Updates the provided [param source_geometry_data] resource with the resulting + * data. The resource can then be used to bake a navigation mesh with [bakeFromSourceGeometryData]. + * After the process is finished the optional [param callback] will be called. + * **Note:** This function needs to run on the main thread or with a deferred call as the + * SceneTree is not thread-safe. + * **Performance:** While convenient, reading data arrays from [Mesh] resources can affect the + * frame rate negatively. The data needs to be received from the GPU, stalling the [RenderingServer] + * in the process. For performance prefer the use of e.g. collision shapes or creating the data + * arrays entirely in code. */ @JvmOverloads public fun parseSourceGeometryData( @@ -78,7 +102,8 @@ public object NavigationMeshGenerator : Object() { } /** - * Bakes the provided [navigationMesh] with the data from the provided [sourceGeometryData]. After the process is finished the optional [callback] will be called. + * Bakes the provided [param navigation_mesh] with the data from the provided [param + * source_geometry_data]. After the process is finished the optional [param callback] will be called. */ @JvmOverloads public fun bakeFromSourceGeometryData( diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationMeshSourceGeometryData2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationMeshSourceGeometryData2D.kt index eb1dc9420..9464aee3b 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationMeshSourceGeometryData2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationMeshSourceGeometryData2D.kt @@ -22,8 +22,6 @@ import kotlin.Suppress import kotlin.Unit /** - * Container for parsed source geometry data used in navigation mesh baking. - * * Container for parsed source geometry data used in navigation mesh baking. */ @GodotBaseType diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationMeshSourceGeometryData3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationMeshSourceGeometryData3D.kt index 6bfce624c..b2555b936 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationMeshSourceGeometryData3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationMeshSourceGeometryData3D.kt @@ -30,8 +30,6 @@ import kotlin.Suppress import kotlin.Unit /** - * Container for parsed source geometry data used in navigation mesh baking. - * * Container for parsed source geometry data used in navigation mesh baking. */ @GodotBaseType @@ -81,7 +79,9 @@ public open class NavigationMeshSourceGeometryData3D : Resource() { } /** - * Adds the geometry data of a [godot.Mesh] resource to the navigation mesh baking data. The mesh must have valid triangulated mesh data to be considered. Since [godot.NavigationMesh] resources have no transform, all vertex positions need to be offset by the node's transform using [xform]. + * Adds the geometry data of a [Mesh] resource to the navigation mesh baking data. The mesh must + * have valid triangulated mesh data to be considered. Since [NavigationMesh] resources have no + * transform, all vertex positions need to be offset by the node's transform using [param xform]. */ public fun addMesh(mesh: Mesh, xform: Transform3D): Unit { TransferContext.writeArguments(OBJECT to mesh, TRANSFORM3D to xform) @@ -89,7 +89,11 @@ public open class NavigationMeshSourceGeometryData3D : Resource() { } /** - * Adds an [godot.Array] the size of [godot.Mesh.ARRAY_MAX] and with vertices at index [godot.Mesh.ARRAY_VERTEX] and indices at index [godot.Mesh.ARRAY_INDEX] to the navigation mesh baking data. The array must have valid triangulated mesh data to be considered. Since [godot.NavigationMesh] resources have no transform, all vertex positions need to be offset by the node's transform using [xform]. + * Adds an [Array] the size of [constant Mesh.ARRAY_MAX] and with vertices at index [constant + * Mesh.ARRAY_VERTEX] and indices at index [constant Mesh.ARRAY_INDEX] to the navigation mesh baking + * data. The array must have valid triangulated mesh data to be considered. Since [NavigationMesh] + * resources have no transform, all vertex positions need to be offset by the node's transform using + * [param xform]. */ public fun addMeshArray(meshArray: VariantArray, xform: Transform3D): Unit { TransferContext.writeArguments(ARRAY to meshArray, TRANSFORM3D to xform) @@ -97,7 +101,10 @@ public open class NavigationMeshSourceGeometryData3D : Resource() { } /** - * Adds an array of vertex positions to the geometry data for navigation mesh baking to form triangulated faces. For each face the array must have three vertex positions in clockwise winding order. Since [godot.NavigationMesh] resources have no transform, all vertex positions need to be offset by the node's transform using [xform]. + * Adds an array of vertex positions to the geometry data for navigation mesh baking to form + * triangulated faces. For each face the array must have three vertex positions in clockwise winding + * order. Since [NavigationMesh] resources have no transform, all vertex positions need to be offset + * by the node's transform using [param xform]. */ public fun addFaces(faces: PackedVector3Array, xform: Transform3D): Unit { TransferContext.writeArguments(PACKED_VECTOR3_ARRAY to faces, TRANSFORM3D to xform) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationObstacle2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationObstacle2D.kt index 6eb148ef2..44ec38776 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationObstacle2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationObstacle2D.kt @@ -31,18 +31,15 @@ import kotlin.Suppress import kotlin.Unit /** - * 2D Obstacle used in navigation to constrain avoidance controlled agents outside or inside an area. - * - * Tutorials: - * [$DOCS_URL/tutorials/navigation/navigation_using_navigationobstacles.html]($DOCS_URL/tutorials/navigation/navigation_using_navigationobstacles.html) - * - * 2D Obstacle used in navigation to constrain avoidance controlled agents outside or inside an area. The obstacle needs a navigation map and outline vertices defined to work correctly. - * - * If the obstacle's vertices are winded in clockwise order, avoidance agents will be pushed in by the obstacle, otherwise, avoidance agents will be pushed out. Outlines must not cross or overlap. - * - * Obstacles are **not** a replacement for a (re)baked navigation mesh. Obstacles **don't** change the resulting path from the pathfinding, obstacles only affect the navigation avoidance agent movement by altering the suggested velocity of the avoidance agent. - * - * Obstacles using vertices can warp to a new position but should not moved every frame as each move requires a rebuild of the avoidance map. + * 2D Obstacle used in navigation to constrain avoidance controlled agents outside or inside an + * area. The obstacle needs a navigation map and outline vertices defined to work correctly. + * If the obstacle's vertices are winded in clockwise order, avoidance agents will be pushed in by + * the obstacle, otherwise, avoidance agents will be pushed out. Outlines must not cross or overlap. + * Obstacles are **not** a replacement for a (re)baked navigation mesh. Obstacles **don't** change + * the resulting path from the pathfinding, obstacles only affect the navigation avoidance agent + * movement by altering the suggested velocity of the avoidance agent. + * Obstacles using vertices can warp to a new position but should not moved every frame as each move + * requires a rebuild of the avoidance map. */ @GodotBaseType public open class NavigationObstacle2D : Node2D() { @@ -61,7 +58,9 @@ public open class NavigationObstacle2D : Node2D() { } /** - * Sets the wanted velocity for the obstacle so other agent's can better predict the obstacle if it is moved with a velocity regularly (every frame) instead of warped to a new position. Does only affect avoidance for the obstacles [radius]. Does nothing for the obstacles static vertices. + * Sets the wanted velocity for the obstacle so other agent's can better predict the obstacle if + * it is moved with a velocity regularly (every frame) instead of warped to a new position. Does only + * affect avoidance for the obstacles [radius]. Does nothing for the obstacles static vertices. */ @CoreTypeLocalCopy public var velocity: Vector2 @@ -90,7 +89,10 @@ public open class NavigationObstacle2D : Node2D() { } /** - * The outline vertices of the obstacle. If the vertices are winded in clockwise order agents will be pushed in by the obstacle, else they will be pushed out. Outlines can not be crossed or overlap. Should the vertices using obstacle be warped to a new position agent's can not predict this movement and may get trapped inside the obstacle. + * The outline vertices of the obstacle. If the vertices are winded in clockwise order agents will + * be pushed in by the obstacle, else they will be pushed out. Outlines can not be crossed or + * overlap. Should the vertices using obstacle be warped to a new position agent's can not predict + * this movement and may get trapped inside the obstacle. */ public var vertices: PackedVector2Array get() { @@ -104,7 +106,8 @@ public open class NavigationObstacle2D : Node2D() { } /** - * A bitfield determining the avoidance layers for this obstacle. Agents with a matching bit on the their avoidance mask will avoid this obstacle. + * A bitfield determining the avoidance layers for this obstacle. Agents with a matching bit on + * the their avoidance mask will avoid this obstacle. */ public var avoidanceLayers: Long get() { @@ -123,7 +126,9 @@ public open class NavigationObstacle2D : Node2D() { } /** - * Sets the wanted velocity for the obstacle so other agent's can better predict the obstacle if it is moved with a velocity regularly (every frame) instead of warped to a new position. Does only affect avoidance for the obstacles [radius]. Does nothing for the obstacles static vertices. + * Sets the wanted velocity for the obstacle so other agent's can better predict the obstacle if + * it is moved with a velocity regularly (every frame) instead of warped to a new position. Does only + * affect avoidance for the obstacles [radius]. Does nothing for the obstacles static vertices. * * This is a helper function to make dealing with local copies easier. * @@ -147,7 +152,7 @@ public open class NavigationObstacle2D : Node2D() { /** - * Returns the [RID] of this obstacle on the [godot.NavigationServer2D]. + * Returns the [RID] of this obstacle on the [NavigationServer2D]. */ public fun getRid(): RID { TransferContext.writeArguments() @@ -156,7 +161,8 @@ public open class NavigationObstacle2D : Node2D() { } /** - * Sets the [RID] of the navigation map this NavigationObstacle node should use and also updates the `obstacle` on the NavigationServer. + * Sets the [RID] of the navigation map this NavigationObstacle node should use and also updates + * the `obstacle` on the NavigationServer. */ public fun setNavigationMap(navigationMap: RID): Unit { TransferContext.writeArguments(_RID to navigationMap) @@ -164,7 +170,11 @@ public open class NavigationObstacle2D : Node2D() { } /** - * Returns the [RID] of the navigation map for this NavigationObstacle node. This function returns always the map set on the NavigationObstacle node and not the map of the abstract obstacle on the NavigationServer. If the obstacle map is changed directly with the NavigationServer API the NavigationObstacle node will not be aware of the map change. Use [setNavigationMap] to change the navigation map for the NavigationObstacle and also update the obstacle on the NavigationServer. + * Returns the [RID] of the navigation map for this NavigationObstacle node. This function returns + * always the map set on the NavigationObstacle node and not the map of the abstract obstacle on the + * NavigationServer. If the obstacle map is changed directly with the NavigationServer API the + * NavigationObstacle node will not be aware of the map change. Use [setNavigationMap] to change the + * navigation map for the NavigationObstacle and also update the obstacle on the NavigationServer. */ public fun getNavigationMap(): RID { TransferContext.writeArguments() @@ -173,7 +183,8 @@ public open class NavigationObstacle2D : Node2D() { } /** - * Based on [value], enables or disables the specified layer in the [avoidanceLayers] bitmask, given a [layerNumber] between 1 and 32. + * Based on [param value], enables or disables the specified layer in the [avoidanceLayers] + * bitmask, given a [param layer_number] between 1 and 32. */ public fun setAvoidanceLayerValue(layerNumber: Int, `value`: Boolean): Unit { TransferContext.writeArguments(LONG to layerNumber.toLong(), BOOL to value) @@ -181,7 +192,8 @@ public open class NavigationObstacle2D : Node2D() { } /** - * Returns whether or not the specified layer of the [avoidanceLayers] bitmask is enabled, given a [layerNumber] between 1 and 32. + * Returns whether or not the specified layer of the [avoidanceLayers] bitmask is enabled, given a + * [param layer_number] between 1 and 32. */ public fun getAvoidanceLayerValue(layerNumber: Int): Boolean { TransferContext.writeArguments(LONG to layerNumber.toLong()) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationObstacle3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationObstacle3D.kt index 279894fc9..5a70ffab3 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationObstacle3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationObstacle3D.kt @@ -31,18 +31,15 @@ import kotlin.Suppress import kotlin.Unit /** - * 3D Obstacle used in navigation to constrain avoidance controlled agents outside or inside an area. - * - * Tutorials: - * [$DOCS_URL/tutorials/navigation/navigation_using_navigationobstacles.html]($DOCS_URL/tutorials/navigation/navigation_using_navigationobstacles.html) - * - * 3D Obstacle used in navigation to constrain avoidance controlled agents outside or inside an area. The obstacle needs a navigation map and outline vertices defined to work correctly. - * - * If the obstacle's vertices are winded in clockwise order, avoidance agents will be pushed in by the obstacle, otherwise, avoidance agents will be pushed out. Outlines must not cross or overlap. - * - * Obstacles are **not** a replacement for a (re)baked navigation mesh. Obstacles **don't** change the resulting path from the pathfinding, obstacles only affect the navigation avoidance agent movement by altering the suggested velocity of the avoidance agent. - * - * Obstacles using vertices can warp to a new position but should not moved every frame as each move requires a rebuild of the avoidance map. + * 3D Obstacle used in navigation to constrain avoidance controlled agents outside or inside an + * area. The obstacle needs a navigation map and outline vertices defined to work correctly. + * If the obstacle's vertices are winded in clockwise order, avoidance agents will be pushed in by + * the obstacle, otherwise, avoidance agents will be pushed out. Outlines must not cross or overlap. + * Obstacles are **not** a replacement for a (re)baked navigation mesh. Obstacles **don't** change + * the resulting path from the pathfinding, obstacles only affect the navigation avoidance agent + * movement by altering the suggested velocity of the avoidance agent. + * Obstacles using vertices can warp to a new position but should not moved every frame as each move + * requires a rebuild of the avoidance map. */ @GodotBaseType public open class NavigationObstacle3D : Node3D() { @@ -61,7 +58,9 @@ public open class NavigationObstacle3D : Node3D() { } /** - * Sets the wanted velocity for the obstacle so other agent's can better predict the obstacle if it is moved with a velocity regularly (every frame) instead of warped to a new position. Does only affect avoidance for the obstacles [radius]. Does nothing for the obstacles static vertices. + * Sets the wanted velocity for the obstacle so other agent's can better predict the obstacle if + * it is moved with a velocity regularly (every frame) instead of warped to a new position. Does only + * affect avoidance for the obstacles [radius]. Does nothing for the obstacles static vertices. */ @CoreTypeLocalCopy public var velocity: Vector3 @@ -90,7 +89,8 @@ public open class NavigationObstacle3D : Node3D() { } /** - * Sets the obstacle height used in 2D avoidance. 2D avoidance using agent's ignore obstacles that are below or above them. + * Sets the obstacle height used in 2D avoidance. 2D avoidance using agent's ignore obstacles that + * are below or above them. */ public var height: Float get() { @@ -104,7 +104,10 @@ public open class NavigationObstacle3D : Node3D() { } /** - * The outline vertices of the obstacle. If the vertices are winded in clockwise order agents will be pushed in by the obstacle, else they will be pushed out. Outlines can not be crossed or overlap. Should the vertices using obstacle be warped to a new position agent's can not predict this movement and may get trapped inside the obstacle. + * The outline vertices of the obstacle. If the vertices are winded in clockwise order agents will + * be pushed in by the obstacle, else they will be pushed out. Outlines can not be crossed or + * overlap. Should the vertices using obstacle be warped to a new position agent's can not predict + * this movement and may get trapped inside the obstacle. */ public var vertices: PackedVector3Array get() { @@ -118,7 +121,8 @@ public open class NavigationObstacle3D : Node3D() { } /** - * A bitfield determining the avoidance layers for this obstacle. Agents with a matching bit on the their avoidance mask will avoid this obstacle. + * A bitfield determining the avoidance layers for this obstacle. Agents with a matching bit on + * the their avoidance mask will avoid this obstacle. */ public var avoidanceLayers: Long get() { @@ -133,8 +137,8 @@ public open class NavigationObstacle3D : Node3D() { /** * If `true` the obstacle affects 3D avoidance using agent's with obstacle [radius]. - * - * If `false` the obstacle affects 2D avoidance using agent's with both obstacle [vertices] as well as obstacle [radius]. + * If `false` the obstacle affects 2D avoidance using agent's with both obstacle [vertices] as + * well as obstacle [radius]. */ public var use3dAvoidance: Boolean get() { @@ -153,7 +157,9 @@ public open class NavigationObstacle3D : Node3D() { } /** - * Sets the wanted velocity for the obstacle so other agent's can better predict the obstacle if it is moved with a velocity regularly (every frame) instead of warped to a new position. Does only affect avoidance for the obstacles [radius]. Does nothing for the obstacles static vertices. + * Sets the wanted velocity for the obstacle so other agent's can better predict the obstacle if + * it is moved with a velocity regularly (every frame) instead of warped to a new position. Does only + * affect avoidance for the obstacles [radius]. Does nothing for the obstacles static vertices. * * This is a helper function to make dealing with local copies easier. * @@ -177,7 +183,7 @@ public open class NavigationObstacle3D : Node3D() { /** - * Returns the [RID] of this obstacle on the [godot.NavigationServer3D]. + * Returns the [RID] of this obstacle on the [NavigationServer3D]. */ public fun getRid(): RID { TransferContext.writeArguments() @@ -186,7 +192,8 @@ public open class NavigationObstacle3D : Node3D() { } /** - * Sets the [RID] of the navigation map this NavigationObstacle node should use and also updates the `obstacle` on the NavigationServer. + * Sets the [RID] of the navigation map this NavigationObstacle node should use and also updates + * the `obstacle` on the NavigationServer. */ public fun setNavigationMap(navigationMap: RID): Unit { TransferContext.writeArguments(_RID to navigationMap) @@ -194,7 +201,11 @@ public open class NavigationObstacle3D : Node3D() { } /** - * Returns the [RID] of the navigation map for this NavigationObstacle node. This function returns always the map set on the NavigationObstacle node and not the map of the abstract obstacle on the NavigationServer. If the obstacle map is changed directly with the NavigationServer API the NavigationObstacle node will not be aware of the map change. Use [setNavigationMap] to change the navigation map for the NavigationObstacle and also update the obstacle on the NavigationServer. + * Returns the [RID] of the navigation map for this NavigationObstacle node. This function returns + * always the map set on the NavigationObstacle node and not the map of the abstract obstacle on the + * NavigationServer. If the obstacle map is changed directly with the NavigationServer API the + * NavigationObstacle node will not be aware of the map change. Use [setNavigationMap] to change the + * navigation map for the NavigationObstacle and also update the obstacle on the NavigationServer. */ public fun getNavigationMap(): RID { TransferContext.writeArguments() @@ -203,7 +214,8 @@ public open class NavigationObstacle3D : Node3D() { } /** - * Based on [value], enables or disables the specified layer in the [avoidanceLayers] bitmask, given a [layerNumber] between 1 and 32. + * Based on [param value], enables or disables the specified layer in the [avoidanceLayers] + * bitmask, given a [param layer_number] between 1 and 32. */ public fun setAvoidanceLayerValue(layerNumber: Int, `value`: Boolean): Unit { TransferContext.writeArguments(LONG to layerNumber.toLong(), BOOL to value) @@ -211,7 +223,8 @@ public open class NavigationObstacle3D : Node3D() { } /** - * Returns whether or not the specified layer of the [avoidanceLayers] bitmask is enabled, given a [layerNumber] between 1 and 32. + * Returns whether or not the specified layer of the [avoidanceLayers] bitmask is enabled, given a + * [param layer_number] between 1 and 32. */ public fun getAvoidanceLayerValue(layerNumber: Int): Boolean { TransferContext.writeArguments(LONG to layerNumber.toLong()) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationPathQueryParameters2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationPathQueryParameters2D.kt index 352892559..fc1e0a914 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationPathQueryParameters2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationPathQueryParameters2D.kt @@ -26,12 +26,8 @@ import kotlin.Unit import kotlin.jvm.JvmInline /** - * Provides parameters for 2D navigation path queries. - * - * Tutorials: - * [$DOCS_URL/tutorials/navigation/navigation_using_navigationpathqueryobjects.html]($DOCS_URL/tutorials/navigation/navigation_using_navigationpathqueryobjects.html) - * - * By changing various properties of this object, such as the start and target position, you can configure path queries to the [godot.NavigationServer2D]. + * By changing various properties of this object, such as the start and target position, you can + * configure path queries to the [NavigationServer2D]. */ @GodotBaseType public open class NavigationPathQueryParameters2D : RefCounted() { @@ -211,11 +207,17 @@ public open class NavigationPathQueryParameters2D : RefCounted() { id: Long, ) { /** - * Applies a funnel algorithm to the raw path corridor found by the pathfinding algorithm. This will result in the shortest path possible inside the path corridor. This postprocessing very much depends on the navigation mesh polygon layout and the created corridor. Especially tile- or gridbased layouts can face artificial corners with diagonal movement due to a jagged path corridor imposed by the cell shapes. + * Applies a funnel algorithm to the raw path corridor found by the pathfinding algorithm. This + * will result in the shortest path possible inside the path corridor. This postprocessing very + * much depends on the navigation mesh polygon layout and the created corridor. Especially tile- or + * gridbased layouts can face artificial corners with diagonal movement due to a jagged path + * corridor imposed by the cell shapes. */ PATH_POSTPROCESSING_CORRIDORFUNNEL(0), /** - * Centers every path position in the middle of the traveled navigation mesh polygon edge. This creates better paths for tile- or gridbased layouts that restrict the movement to the cells center. + * Centers every path position in the middle of the traveled navigation mesh polygon edge. This + * creates better paths for tile- or gridbased layouts that restrict the movement to the cells + * center. */ PATH_POSTPROCESSING_EDGECENTERED(1), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationPathQueryParameters3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationPathQueryParameters3D.kt index 9f5079b9b..08a0c7f98 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationPathQueryParameters3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationPathQueryParameters3D.kt @@ -26,12 +26,8 @@ import kotlin.Unit import kotlin.jvm.JvmInline /** - * Provides parameters for 3D navigation path queries. - * - * Tutorials: - * [$DOCS_URL/tutorials/navigation/navigation_using_navigationpathqueryobjects.html]($DOCS_URL/tutorials/navigation/navigation_using_navigationpathqueryobjects.html) - * - * By changing various properties of this object, such as the start and target position, you can configure path queries to the [godot.NavigationServer3D]. + * By changing various properties of this object, such as the start and target position, you can + * configure path queries to the [NavigationServer3D]. */ @GodotBaseType public open class NavigationPathQueryParameters3D : RefCounted() { @@ -211,11 +207,17 @@ public open class NavigationPathQueryParameters3D : RefCounted() { id: Long, ) { /** - * Applies a funnel algorithm to the raw path corridor found by the pathfinding algorithm. This will result in the shortest path possible inside the path corridor. This postprocessing very much depends on the navigation mesh polygon layout and the created corridor. Especially tile- or gridbased layouts can face artificial corners with diagonal movement due to a jagged path corridor imposed by the cell shapes. + * Applies a funnel algorithm to the raw path corridor found by the pathfinding algorithm. This + * will result in the shortest path possible inside the path corridor. This postprocessing very + * much depends on the navigation mesh polygon layout and the created corridor. Especially tile- or + * gridbased layouts can face artificial corners with diagonal movement due to a jagged path + * corridor imposed by the cell shapes. */ PATH_POSTPROCESSING_CORRIDORFUNNEL(0), /** - * Centers every path position in the middle of the traveled navigation mesh polygon edge. This creates better paths for tile- or gridbased layouts that restrict the movement to the cells center. + * Centers every path position in the middle of the traveled navigation mesh polygon edge. This + * creates better paths for tile- or gridbased layouts that restrict the movement to the cells + * center. */ PATH_POSTPROCESSING_EDGECENTERED(1), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationPathQueryResult2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationPathQueryResult2D.kt index 21fb7d821..425538ece 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationPathQueryResult2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationPathQueryResult2D.kt @@ -27,17 +27,14 @@ import kotlin.Suppress import kotlin.Unit /** - * Represents the result of a 2D pathfinding query. - * - * Tutorials: - * [$DOCS_URL/tutorials/navigation/navigation_using_navigationpathqueryobjects.html]($DOCS_URL/tutorials/navigation/navigation_using_navigationpathqueryobjects.html) - * - * This class stores the result of a 2D navigation path query from the [godot.NavigationServer2D]. + * This class stores the result of a 2D navigation path query from the [NavigationServer2D]. */ @GodotBaseType public open class NavigationPathQueryResult2D : RefCounted() { /** - * The resulting path array from the navigation query. All path array positions are in global coordinates. Without customized query parameters this is the same path as returned by [godot.NavigationServer2D.mapGetPath]. + * The resulting path array from the navigation query. All path array positions are in global + * coordinates. Without customized query parameters this is the same path as returned by + * [NavigationServer2D.mapGetPath]. */ public var path: PackedVector2Array get() { @@ -79,7 +76,8 @@ public open class NavigationPathQueryResult2D : RefCounted() { } /** - * The `ObjectID`s of the [godot.Object]s which manage the regions and links each point of the path goes through. + * The `ObjectID`s of the [Object]s which manage the regions and links each point of the path goes + * through. */ public var pathOwnerIds: PackedInt64Array get() { @@ -98,7 +96,8 @@ public open class NavigationPathQueryResult2D : RefCounted() { } /** - * Reset the result object to its initial state. This is useful to reuse the object across multiple queries. + * Reset the result object to its initial state. This is useful to reuse the object across + * multiple queries. */ public fun reset(): Unit { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationPathQueryResult3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationPathQueryResult3D.kt index c830ebafb..85f2aa45f 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationPathQueryResult3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationPathQueryResult3D.kt @@ -27,17 +27,14 @@ import kotlin.Suppress import kotlin.Unit /** - * Represents the result of a 3D pathfinding query. - * - * Tutorials: - * [$DOCS_URL/tutorials/navigation/navigation_using_navigationpathqueryobjects.html]($DOCS_URL/tutorials/navigation/navigation_using_navigationpathqueryobjects.html) - * - * This class stores the result of a 3D navigation path query from the [godot.NavigationServer3D]. + * This class stores the result of a 3D navigation path query from the [NavigationServer3D]. */ @GodotBaseType public open class NavigationPathQueryResult3D : RefCounted() { /** - * The resulting path array from the navigation query. All path array positions are in global coordinates. Without customized query parameters this is the same path as returned by [godot.NavigationServer3D.mapGetPath]. + * The resulting path array from the navigation query. All path array positions are in global + * coordinates. Without customized query parameters this is the same path as returned by + * [NavigationServer3D.mapGetPath]. */ public var path: PackedVector3Array get() { @@ -79,7 +76,8 @@ public open class NavigationPathQueryResult3D : RefCounted() { } /** - * The `ObjectID`s of the [godot.Object]s which manage the regions and links each point of the path goes through. + * The `ObjectID`s of the [Object]s which manage the regions and links each point of the path goes + * through. */ public var pathOwnerIds: PackedInt64Array get() { @@ -98,7 +96,8 @@ public open class NavigationPathQueryResult3D : RefCounted() { } /** - * Reset the result object to its initial state. This is useful to reuse the object across multiple queries. + * Reset the result object to its initial state. This is useful to reuse the object across + * multiple queries. */ public fun reset(): Unit { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationPolygon.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationPolygon.kt index 6aee49e8d..0678b0c26 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationPolygon.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/NavigationPolygon.kt @@ -30,84 +30,54 @@ import kotlin.Suppress import kotlin.Unit /** - * A 2D navigation mesh that describes a traversable surface for pathfinding. - * - * Tutorials: - * [$DOCS_URL/tutorials/navigation/navigation_using_navigationmeshes.html]($DOCS_URL/tutorials/navigation/navigation_using_navigationmeshes.html) - * - * A navigation mesh can be created either by baking it with the help of the [godot.NavigationServer2D], or by adding vertices and convex polygon indices arrays manually. - * - * To bake a navigation mesh at least one outline needs to be added that defines the outer bounds of the baked area. - * - * [codeblocks] - * - * [gdscript] + * A navigation mesh can be created either by baking it with the help of the [NavigationServer2D], + * or by adding vertices and convex polygon indices arrays manually. + * To bake a navigation mesh at least one outline needs to be added that defines the outer bounds of + * the baked area. * + * gdscript: + * ```gdscript * var new_navigation_mesh = NavigationPolygon.new() - * - * var bounding_outline = PackedVector2Array([godot.Vector2(0, 0), Vector2(0, 50), Vector2(50, 50), Vector2(50, 0)]) - * + * var bounding_outline = PackedVector2Array([Vector2(0, 0), Vector2(0, 50), Vector2(50, 50), + * Vector2(50, 0)]) * new_navigation_mesh.add_outline(bounding_outline) - * - * NavigationServer2D.bake_from_source_geometry_data(new_navigation_mesh, NavigationMeshSourceGeometryData2D.new()); - * + * NavigationServer2D.bake_from_source_geometry_data(new_navigation_mesh, + * NavigationMeshSourceGeometryData2D.new()); * $NavigationRegion2D.navigation_polygon = new_navigation_mesh - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * var newNavigationMesh = new NavigationPolygon(); - * - * var boundingOutline = new Vector2[] { new Vector2(0, 0), new Vector2(0, 50), new Vector2(50, 50), new Vector2(50, 0) }; - * + * var boundingOutline = new Vector2[] { new Vector2(0, 0), new Vector2(0, 50), new Vector2(50, 50), + * new Vector2(50, 0) }; * newNavigationMesh.AddOutline(boundingOutline); - * - * NavigationServer2D.BakeFromSourceGeometryData(newNavigationMesh, new NavigationMeshSourceGeometryData2D()); - * + * NavigationServer2D.BakeFromSourceGeometryData(newNavigationMesh, new + * NavigationMeshSourceGeometryData2D()); * GetNode("NavigationRegion2D").NavigationPolygon = newNavigationMesh; - * - * [/csharp] - * - * [/codeblocks] + * ``` * * Adding vertices and polygon indices manually. * - * [codeblocks] - * - * [gdscript] - * + * gdscript: + * ```gdscript * var new_navigation_mesh = NavigationPolygon.new() - * - * var new_vertices = PackedVector2Array([godot.Vector2(0, 0), Vector2(0, 50), Vector2(50, 50), Vector2(50, 0)]) - * + * var new_vertices = PackedVector2Array([Vector2(0, 0), Vector2(0, 50), Vector2(50, 50), + * Vector2(50, 0)]) * new_navigation_mesh.vertices = new_vertices - * * var new_polygon_indices = PackedInt32Array([0, 1, 2, 3]) - * * new_navigation_mesh.add_polygon(new_polygon_indices) - * * $NavigationRegion2D.navigation_polygon = new_navigation_mesh - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * var newNavigationMesh = new NavigationPolygon(); - * - * var newVertices = new Vector2[] { new Vector2(0, 0), new Vector2(0, 50), new Vector2(50, 50), new Vector2(50, 0) }; - * + * var newVertices = new Vector2[] { new Vector2(0, 0), new Vector2(0, 50), new Vector2(50, 50), new + * Vector2(50, 0) }; * newNavigationMesh.Vertices = newVertices; - * * var newPolygonIndices = new int[] { 0, 1, 2, 3 }; - * * newNavigationMesh.AddPolygon(newPolygonIndices); - * * GetNode("NavigationRegion2D").NavigationPolygon = newNavigationMesh; - * - * [/csharp] - * - * [/codeblocks] + * ``` */ @GodotBaseType public open class NavigationPolygon : Resource() { @@ -123,7 +93,8 @@ public open class NavigationPolygon : Resource() { } /** - * Determines which type of nodes will be parsed as geometry. See [enum ParsedGeometryType] for possible values. + * Determines which type of nodes will be parsed as geometry. See [enum ParsedGeometryType] for + * possible values. */ public var parsedGeometryType: ParsedGeometryType get() { @@ -138,8 +109,8 @@ public open class NavigationPolygon : Resource() { /** * The physics layers to scan for static colliders. - * - * Only used when [parsedGeometryType] is [PARSED_GEOMETRY_STATIC_COLLIDERS] or [PARSED_GEOMETRY_BOTH]. + * Only used when [parsedGeometryType] is [constant PARSED_GEOMETRY_STATIC_COLLIDERS] or [constant + * PARSED_GEOMETRY_BOTH]. */ public var parsedCollisionMask: Long get() { @@ -168,8 +139,8 @@ public open class NavigationPolygon : Resource() { /** * The group name of nodes that should be parsed for baking source geometry. - * - * Only used when [sourceGeometryMode] is [SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN] or [SOURCE_GEOMETRY_GROUPS_EXPLICIT]. + * Only used when [sourceGeometryMode] is [constant SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN] or + * [constant SOURCE_GEOMETRY_GROUPS_EXPLICIT]. */ public var sourceGeometryGroupName: StringName get() { @@ -183,7 +154,8 @@ public open class NavigationPolygon : Resource() { } /** - * The cell size used to rasterize the navigation mesh vertices. Must match with the cell size on the navigation map. + * The cell size used to rasterize the navigation mesh vertices. Must match with the cell size on + * the navigation map. */ public var cellSize: Float get() { @@ -233,7 +205,7 @@ public open class NavigationPolygon : Resource() { } /** - * Returns a [godot.PackedInt32Array] containing the indices of the vertices of a created polygon. + * Returns a [PackedInt32Array] containing the indices of the vertices of a created polygon. */ public fun getPolygon(idx: Int): PackedInt32Array { TransferContext.writeArguments(LONG to idx.toLong()) @@ -250,7 +222,10 @@ public open class NavigationPolygon : Resource() { } /** - * Returns the [godot.NavigationMesh] resulting from this navigation polygon. This navigation mesh can be used to update the navigation mesh of a region with the [godot.NavigationServer3D.regionSetNavigationMesh] API directly (as 2D uses the 3D server behind the scene). + * Returns the [NavigationMesh] resulting from this navigation polygon. This navigation mesh can + * be used to update the navigation mesh of a region with the + * [NavigationServer3D.regionSetNavigationMesh] API directly (as 2D uses the 3D server behind the + * scene). */ public fun getNavigationMesh(): NavigationMesh? { TransferContext.writeArguments() @@ -259,7 +234,8 @@ public open class NavigationPolygon : Resource() { } /** - * Appends a [godot.PackedVector2Array] that contains the vertices of an outline to the internal array that contains all the outlines. + * Appends a [PackedVector2Array] that contains the vertices of an outline to the internal array + * that contains all the outlines. */ public fun addOutline(outline: PackedVector2Array): Unit { TransferContext.writeArguments(PACKED_VECTOR2_ARRAY to outline) @@ -267,7 +243,8 @@ public open class NavigationPolygon : Resource() { } /** - * Adds a [godot.PackedVector2Array] that contains the vertices of an outline to the internal array that contains all the outlines at a fixed position. + * Adds a [PackedVector2Array] that contains the vertices of an outline to the internal array that + * contains all the outlines at a fixed position. */ public fun addOutlineAtIndex(outline: PackedVector2Array, index: Int): Unit { TransferContext.writeArguments(PACKED_VECTOR2_ARRAY to outline, LONG to index.toLong()) @@ -284,7 +261,8 @@ public open class NavigationPolygon : Resource() { } /** - * Changes an outline created in the editor or by script. You have to call [makePolygonsFromOutlines] for the polygons to update. + * Changes an outline created in the editor or by script. You have to call + * [makePolygonsFromOutlines] for the polygons to update. */ public fun setOutline(idx: Int, outline: PackedVector2Array): Unit { TransferContext.writeArguments(LONG to idx.toLong(), PACKED_VECTOR2_ARRAY to outline) @@ -292,7 +270,8 @@ public open class NavigationPolygon : Resource() { } /** - * Returns a [godot.PackedVector2Array] containing the vertices of an outline that was created in the editor or by script. + * Returns a [PackedVector2Array] containing the vertices of an outline that was created in the + * editor or by script. */ public fun getOutline(idx: Int): PackedVector2Array { TransferContext.writeArguments(LONG to idx.toLong()) @@ -301,7 +280,8 @@ public open class NavigationPolygon : Resource() { } /** - * Removes an outline created in the editor or by script. You have to call [makePolygonsFromOutlines] for the polygons to update. + * Removes an outline created in the editor or by script. You have to call + * [makePolygonsFromOutlines] for the polygons to update. */ public fun removeOutline(idx: Int): Unit { TransferContext.writeArguments(LONG to idx.toLong()) @@ -309,7 +289,8 @@ public open class NavigationPolygon : Resource() { } /** - * Clears the array of the outlines, but it doesn't clear the vertices and the polygons that were created by them. + * Clears the array of the outlines, but it doesn't clear the vertices and the polygons that were + * created by them. */ public fun clearOutlines(): Unit { TransferContext.writeArguments() @@ -318,8 +299,9 @@ public open class NavigationPolygon : Resource() { /** * Creates polygons from the outlines added in the editor or by script. - * - * *Deprecated.* This function is deprecated, and might be removed in a future release. Use [godot.NavigationServer2D.parseSourceGeometryData] and [godot.NavigationServer2D.bakeFromSourceGeometryData] instead. + * *Deprecated.* This function is deprecated, and might be removed in a future release. Use + * [NavigationServer2D.parseSourceGeometryData] and [NavigationServer2D.bakeFromSourceGeometryData] + * instead. */ public fun makePolygonsFromOutlines(): Unit { TransferContext.writeArguments() @@ -327,7 +309,8 @@ public open class NavigationPolygon : Resource() { } /** - * Based on [value], enables or disables the specified layer in the [parsedCollisionMask], given a [layerNumber] between 1 and 32. + * Based on [param value], enables or disables the specified layer in the [parsedCollisionMask], + * given a [param layer_number] between 1 and 32. */ public fun setParsedCollisionMaskValue(layerNumber: Int, `value`: Boolean): Unit { TransferContext.writeArguments(LONG to layerNumber.toLong(), BOOL to value) @@ -335,7 +318,8 @@ public open class NavigationPolygon : Resource() { } /** - * Returns whether or not the specified layer of the [parsedCollisionMask] is enabled, given a [layerNumber] between 1 and 32. + * Returns whether or not the specified layer of the [parsedCollisionMask] is enabled, given a + * [param layer_number] between 1 and 32. */ public fun getParsedCollisionMaskValue(layerNumber: Int): Boolean { TransferContext.writeArguments(LONG to layerNumber.toLong()) @@ -355,17 +339,19 @@ public open class NavigationPolygon : Resource() { id: Long, ) { /** - * Parses mesh instances as obstruction geometry. This includes [godot.Polygon2D], [godot.MeshInstance2D], [godot.MultiMeshInstance2D], and [godot.TileMap] nodes. - * + * Parses mesh instances as obstruction geometry. This includes [Polygon2D], [MeshInstance2D], + * [MultiMeshInstance2D], and [TileMap] nodes. * Meshes are only parsed when they use a 2D vertices surface format. */ PARSED_GEOMETRY_MESH_INSTANCES(0), /** - * Parses [godot.StaticBody2D] and [godot.TileMap] colliders as obstruction geometry. The collider should be in any of the layers specified by [parsedCollisionMask]. + * Parses [StaticBody2D] and [TileMap] colliders as obstruction geometry. The collider should be + * in any of the layers specified by [parsedCollisionMask]. */ PARSED_GEOMETRY_STATIC_COLLIDERS(1), /** - * Both [PARSED_GEOMETRY_MESH_INSTANCES] and [PARSED_GEOMETRY_STATIC_COLLIDERS]. + * Both [constant PARSED_GEOMETRY_MESH_INSTANCES] and [constant + * PARSED_GEOMETRY_STATIC_COLLIDERS]. */ PARSED_GEOMETRY_BOTH(2), /** @@ -392,7 +378,8 @@ public open class NavigationPolygon : Resource() { */ SOURCE_GEOMETRY_ROOT_NODE_CHILDREN(0), /** - * Scans nodes in a group and their child nodes recursively for geometry. The group is specified by [sourceGeometryGroupName]. + * Scans nodes in a group and their child nodes recursively for geometry. The group is specified + * by [sourceGeometryGroupName]. */ SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN(1), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/NinePatchRect.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/NinePatchRect.kt index 633ffb6de..0b0712623 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/NinePatchRect.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/NinePatchRect.kt @@ -27,9 +27,10 @@ import kotlin.Suppress import kotlin.Unit /** - * A control that displays a texture by keeping its corners intact, but tiling its edges and center. - * - * Also known as 9-slice panels, [godot.NinePatchRect] produces clean panels of any size based on a small texture. To do so, it splits the texture in a 3×3 grid. When you scale the node, it tiles the texture's edges horizontally or vertically, tiles the center on both axes, and leaves the corners unchanged. + * Also known as 9-slice panels, [NinePatchRect] produces clean panels of any size based on a small + * texture. To do so, it splits the texture in a 3×3 grid. When you scale the node, it tiles the + * texture's edges horizontally or vertically, tiles the center on both axes, and leaves the corners + * unchanged. */ @GodotBaseType public open class NinePatchRect : Control() { @@ -67,7 +68,9 @@ public open class NinePatchRect : Control() { } /** - * Rectangular region of the texture to sample from. If you're working with an atlas, use this property to define the area the 9-slice should use. All other properties are relative to this one. If the rect is empty, NinePatchRect will use the whole texture. + * Rectangular region of the texture to sample from. If you're working with an atlas, use this + * property to define the area the 9-slice should use. All other properties are relative to this one. + * If the rect is empty, NinePatchRect will use the whole texture. */ @CoreTypeLocalCopy public var regionRect: Rect2 @@ -82,7 +85,9 @@ public open class NinePatchRect : Control() { } /** - * The width of the 9-slice's left column. A margin of 16 means the 9-slice's left corners and side will have a width of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders. + * The width of the 9-slice's left column. A margin of 16 means the 9-slice's left corners and + * side will have a width of 16 pixels. You can set all 4 margin values individually to create panels + * with non-uniform borders. */ public var patchMarginLeft: Int get() { @@ -96,7 +101,9 @@ public open class NinePatchRect : Control() { } /** - * The height of the 9-slice's top row. A margin of 16 means the 9-slice's top corners and side will have a height of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders. + * The height of the 9-slice's top row. A margin of 16 means the 9-slice's top corners and side + * will have a height of 16 pixels. You can set all 4 margin values individually to create panels + * with non-uniform borders. */ public var patchMarginTop: Int get() { @@ -110,7 +117,9 @@ public open class NinePatchRect : Control() { } /** - * The width of the 9-slice's right column. A margin of 16 means the 9-slice's right corners and side will have a width of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders. + * The width of the 9-slice's right column. A margin of 16 means the 9-slice's right corners and + * side will have a width of 16 pixels. You can set all 4 margin values individually to create panels + * with non-uniform borders. */ public var patchMarginRight: Int get() { @@ -124,7 +133,9 @@ public open class NinePatchRect : Control() { } /** - * The height of the 9-slice's bottom row. A margin of 16 means the 9-slice's bottom corners and side will have a height of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders. + * The height of the 9-slice's bottom row. A margin of 16 means the 9-slice's bottom corners and + * side will have a height of 16 pixels. You can set all 4 margin values individually to create + * panels with non-uniform borders. */ public var patchMarginBottom: Int get() { @@ -138,7 +149,8 @@ public open class NinePatchRect : Control() { } /** - * The stretch mode to use for horizontal stretching/tiling. See [enum NinePatchRect.AxisStretchMode] for possible values. + * The stretch mode to use for horizontal stretching/tiling. See [enum + * NinePatchRect.AxisStretchMode] for possible values. */ public var axisStretchHorizontal: AxisStretchMode get() { @@ -152,7 +164,8 @@ public open class NinePatchRect : Control() { } /** - * The stretch mode to use for vertical stretching/tiling. See [enum NinePatchRect.AxisStretchMode] for possible values. + * The stretch mode to use for vertical stretching/tiling. See [enum + * NinePatchRect.AxisStretchMode] for possible values. */ public var axisStretchVertical: AxisStretchMode get() { @@ -171,7 +184,9 @@ public open class NinePatchRect : Control() { } /** - * Rectangular region of the texture to sample from. If you're working with an atlas, use this property to define the area the 9-slice should use. All other properties are relative to this one. If the rect is empty, NinePatchRect will use the whole texture. + * Rectangular region of the texture to sample from. If you're working with an atlas, use this + * property to define the area the 9-slice should use. All other properties are relative to this one. + * If the rect is empty, NinePatchRect will use the whole texture. * * This is a helper function to make dealing with local copies easier. * @@ -198,15 +213,20 @@ public open class NinePatchRect : Control() { id: Long, ) { /** - * Stretches the center texture across the NinePatchRect. This may cause the texture to be distorted. + * Stretches the center texture across the NinePatchRect. This may cause the texture to be + * distorted. */ AXIS_STRETCH_MODE_STRETCH(0), /** - * Repeats the center texture across the NinePatchRect. This won't cause any visible distortion. The texture must be seamless for this to work without displaying artifacts between edges. + * Repeats the center texture across the NinePatchRect. This won't cause any visible distortion. + * The texture must be seamless for this to work without displaying artifacts between edges. */ AXIS_STRETCH_MODE_TILE(1), /** - * Repeats the center texture across the NinePatchRect, but will also stretch the texture to make sure each tile is visible in full. This may cause the texture to be distorted, but less than [AXIS_STRETCH_MODE_STRETCH]. The texture must be seamless for this to work without displaying artifacts between edges. + * Repeats the center texture across the NinePatchRect, but will also stretch the texture to + * make sure each tile is visible in full. This may cause the texture to be distorted, but less + * than [constant AXIS_STRETCH_MODE_STRETCH]. The texture must be seamless for this to work without + * displaying artifacts between edges. */ AXIS_STRETCH_MODE_TILE_FIT(2), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Node2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Node2D.kt index 5be36b417..0a40b29a9 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Node2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Node2D.kt @@ -30,12 +30,9 @@ import kotlin.jvm.JvmName import kotlin.jvm.JvmOverloads /** - * A 2D game object, inherited by all 2D-related nodes. Has a position, rotation, scale, and Z index. - * - * Tutorials: - * [https://github.com/godotengine/godot-demo-projects/tree/master/2d](https://github.com/godotengine/godot-demo-projects/tree/master/2d) - * - * A 2D game object, with a transform (position, rotation, and scale). All 2D nodes, including physics objects and sprites, inherit from Node2D. Use Node2D as a parent node to move, scale and rotate children in a 2D project. Also gives control of the node's render order. + * A 2D game object, with a transform (position, rotation, and scale). All 2D nodes, including + * physics objects and sprites, inherit from Node2D. Use Node2D as a parent node to move, scale and + * rotate children in a 2D project. Also gives control of the node's render order. */ @GodotBaseType public open class Node2D : CanvasItem() { @@ -56,8 +53,8 @@ public open class Node2D : CanvasItem() { /** * Rotation in radians, relative to the node's parent. - * - * **Note:** This property is edited in the inspector in degrees. If you want to use degrees in a script, use [rotationDegrees]. + * **Note:** This property is edited in the inspector in degrees. If you want to use degrees in a + * script, use [rotationDegrees]. */ public var rotation: Float get() { @@ -86,8 +83,9 @@ public open class Node2D : CanvasItem() { /** * The node's scale. Unscaled value: `(1, 1)`. - * - * **Note:** Negative X scales in 2D are not decomposable from the transformation matrix. Due to the way scale is represented with transformation matrices in Godot, negative scales on the X axis will be changed to negative scales on the Y axis and a rotation of 180 degrees when decomposed. + * **Note:** Negative X scales in 2D are not decomposable from the transformation matrix. Due to + * the way scale is represented with transformation matrices in Godot, negative scales on the X axis + * will be changed to negative scales on the Y axis and a rotation of 180 degrees when decomposed. */ @CoreTypeLocalCopy public var scale: Vector2 @@ -103,7 +101,6 @@ public open class Node2D : CanvasItem() { /** * Slants the node. - * * **Note:** Skew is X axis only. */ public var skew: Float @@ -118,7 +115,7 @@ public open class Node2D : CanvasItem() { } /** - * Local [godot.core.Transform2D]. + * Local [Transform2D]. */ @CoreTypeLocalCopy public var transform: Transform2D @@ -202,7 +199,7 @@ public open class Node2D : CanvasItem() { } /** - * Global [godot.core.Transform2D]. + * Global [Transform2D]. */ @CoreTypeLocalCopy public var globalTransform: Transform2D @@ -244,8 +241,9 @@ public open class Node2D : CanvasItem() { /** * The node's scale. Unscaled value: `(1, 1)`. - * - * **Note:** Negative X scales in 2D are not decomposable from the transformation matrix. Due to the way scale is represented with transformation matrices in Godot, negative scales on the X axis will be changed to negative scales on the Y axis and a rotation of 180 degrees when decomposed. + * **Note:** Negative X scales in 2D are not decomposable from the transformation matrix. Due to + * the way scale is represented with transformation matrices in Godot, negative scales on the X axis + * will be changed to negative scales on the Y axis and a rotation of 180 degrees when decomposed. * * This is a helper function to make dealing with local copies easier. * @@ -269,7 +267,7 @@ public open class Node2D : CanvasItem() { /** - * Local [godot.core.Transform2D]. + * Local [Transform2D]. * * This is a helper function to make dealing with local copies easier. * @@ -341,7 +339,7 @@ public open class Node2D : CanvasItem() { /** - * Global [godot.core.Transform2D]. + * Global [Transform2D]. * * This is a helper function to make dealing with local copies easier. * @@ -374,7 +372,8 @@ public open class Node2D : CanvasItem() { } /** - * Applies a local translation on the node's X axis based on the [godot.Node.Process]'s [delta]. If [scaled] is `false`, normalizes the movement. + * Applies a local translation on the node's X axis based on the [Node.Process]'s [param delta]. + * If [param scaled] is `false`, normalizes the movement. */ @JvmOverloads public fun moveLocalX(delta: Float, scaled: Boolean = false): Unit { @@ -383,7 +382,8 @@ public open class Node2D : CanvasItem() { } /** - * Applies a local translation on the node's Y axis based on the [godot.Node.Process]'s [delta]. If [scaled] is `false`, normalizes the movement. + * Applies a local translation on the node's Y axis based on the [Node.Process]'s [param delta]. + * If [param scaled] is `false`, normalizes the movement. */ @JvmOverloads public fun moveLocalY(delta: Float, scaled: Boolean = false): Unit { @@ -392,7 +392,7 @@ public open class Node2D : CanvasItem() { } /** - * Translates the node by the given [offset] in local coordinates. + * Translates the node by the given [param offset] in local coordinates. */ public fun translate(offset: Vector2): Unit { TransferContext.writeArguments(VECTOR2 to offset) @@ -400,7 +400,7 @@ public open class Node2D : CanvasItem() { } /** - * Adds the [offset] vector to the node's global position. + * Adds the [param offset] vector to the node's global position. */ public fun globalTranslate(offset: Vector2): Unit { TransferContext.writeArguments(VECTOR2 to offset) @@ -408,7 +408,7 @@ public open class Node2D : CanvasItem() { } /** - * Multiplies the current scale by the [ratio] vector. + * Multiplies the current scale by the [param ratio] vector. */ public fun applyScale(ratio: Vector2): Unit { TransferContext.writeArguments(VECTOR2 to ratio) @@ -416,7 +416,8 @@ public open class Node2D : CanvasItem() { } /** - * Rotates the node so it points towards the [point], which is expected to use global coordinates. + * Rotates the node so it points towards the [param point], which is expected to use global + * coordinates. */ public fun lookAt(point: Vector2): Unit { TransferContext.writeArguments(VECTOR2 to point) @@ -424,9 +425,9 @@ public open class Node2D : CanvasItem() { } /** - * Returns the angle between the node and the [point] in radians. - * - * [godot.Illustration of the returned angle.](https://raw.githubusercontent.com/godotengine/godot-docs/master/img/node2d_get_angle_to.png) + * Returns the angle between the node and the [param point] in radians. + * [url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/node2d_get_angle_to.png]Illustration + * of the returned angle.[/url] */ public fun getAngleTo(point: Vector2): Float { TransferContext.writeArguments(VECTOR2 to point) @@ -435,7 +436,10 @@ public open class Node2D : CanvasItem() { } /** - * Transforms the provided global position into a position in local coordinate space. The output will be local relative to the [godot.Node2D] it is called on. e.g. It is appropriate for determining the positions of child nodes, but it is not appropriate for determining its own position relative to its parent. + * Transforms the provided global position into a position in local coordinate space. The output + * will be local relative to the [Node2D] it is called on. e.g. It is appropriate for determining the + * positions of child nodes, but it is not appropriate for determining its own position relative to + * its parent. */ public fun toLocal(globalPoint: Vector2): Vector2 { TransferContext.writeArguments(VECTOR2 to globalPoint) @@ -444,7 +448,11 @@ public open class Node2D : CanvasItem() { } /** - * Transforms the provided local position into a position in global coordinate space. The input is expected to be local relative to the [godot.Node2D] it is called on. e.g. Applying this method to the positions of child nodes will correctly transform their positions into the global coordinate space, but applying it to a node's own position will give an incorrect result, as it will incorporate the node's own transformation into its global position. + * Transforms the provided local position into a position in global coordinate space. The input is + * expected to be local relative to the [Node2D] it is called on. e.g. Applying this method to the + * positions of child nodes will correctly transform their positions into the global coordinate + * space, but applying it to a node's own position will give an incorrect result, as it will + * incorporate the node's own transformation into its global position. */ public fun toGlobal(localPoint: Vector2): Vector2 { TransferContext.writeArguments(VECTOR2 to localPoint) @@ -453,7 +461,7 @@ public open class Node2D : CanvasItem() { } /** - * Returns the [godot.core.Transform2D] relative to this node's parent. + * Returns the [Transform2D] relative to this node's parent. */ public fun getRelativeTransformToParent(parent: Node): Transform2D { TransferContext.writeArguments(OBJECT to parent) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Node3DGizmo.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Node3DGizmo.kt index 3fe06e531..d80fc0a15 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Node3DGizmo.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Node3DGizmo.kt @@ -12,11 +12,10 @@ import kotlin.Int import kotlin.Suppress /** - * Abstract class to expose editor gizmos for [godot.Node3D]. - * - * This abstract class helps connect the [godot.Node3D] scene with the editor-specific [godot.EditorNode3DGizmo] class. - * - * [godot.Node3DGizmo] by itself has no exposed API, refer to [godot.Node3D.addGizmo] and pass it an [godot.EditorNode3DGizmo] instance. + * This abstract class helps connect the [Node3D] scene with the editor-specific [EditorNode3DGizmo] + * class. + * [Node3DGizmo] by itself has no exposed API, refer to [Node3D.addGizmo] and pass it an + * [EditorNode3DGizmo] instance. */ @GodotBaseType public open class Node3DGizmo internal constructor() : RefCounted() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Noise.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Noise.kt index 622ecdc2c..e147c7982 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Noise.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Noise.kt @@ -27,6 +27,14 @@ import kotlin.Int import kotlin.Suppress import kotlin.jvm.JvmOverloads +/** + * This class defines the interface for noise generation libraries to inherit from. + * A default [getSeamlessImage] implementation is provided for libraries that do not provide + * seamless noise. This function requests a larger image from the [getImage] method, reverses the + * quadrants of the image, then uses the strips of extra width to blend over the seams. + * Inheriting noise classes can optionally override this function to provide a more optimal + * algorithm. + */ @GodotBaseType public open class Noise internal constructor() : Resource() { public override fun new(scriptIndex: Int): Boolean { @@ -34,24 +42,36 @@ public open class Noise internal constructor() : Resource() { return true } + /** + * Returns the 1D noise value at the given (x) coordinate. + */ public fun getNoise1d(x: Float): Float { TransferContext.writeArguments(DOUBLE to x.toDouble()) TransferContext.callMethod(rawPtr, MethodBindings.getNoise1dPtr, DOUBLE) return (TransferContext.readReturnValue(DOUBLE, false) as Double).toFloat() } + /** + * Returns the 2D noise value at the given position. + */ public fun getNoise2d(x: Float, y: Float): Float { TransferContext.writeArguments(DOUBLE to x.toDouble(), DOUBLE to y.toDouble()) TransferContext.callMethod(rawPtr, MethodBindings.getNoise2dPtr, DOUBLE) return (TransferContext.readReturnValue(DOUBLE, false) as Double).toFloat() } + /** + * Returns the 2D noise value at the given position. + */ public fun getNoise2dv(v: Vector2): Float { TransferContext.writeArguments(VECTOR2 to v) TransferContext.callMethod(rawPtr, MethodBindings.getNoise2dvPtr, DOUBLE) return (TransferContext.readReturnValue(DOUBLE, false) as Double).toFloat() } + /** + * Returns the 3D noise value at the given position. + */ public fun getNoise3d( x: Float, y: Float, @@ -62,12 +82,20 @@ public open class Noise internal constructor() : Resource() { return (TransferContext.readReturnValue(DOUBLE, false) as Double).toFloat() } + /** + * Returns the 3D noise value at the given position. + */ public fun getNoise3dv(v: Vector3): Float { TransferContext.writeArguments(VECTOR3 to v) TransferContext.callMethod(rawPtr, MethodBindings.getNoise3dvPtr, DOUBLE) return (TransferContext.readReturnValue(DOUBLE, false) as Double).toFloat() } + /** + * Returns an [Image] containing 2D noise values. + * **Note:** With [param normalize] set to `false`, the default implementation expects the noise + * generator to return values in the range `-1.0` to `1.0`. + */ @JvmOverloads public fun getImage( width: Int, @@ -81,6 +109,11 @@ public open class Noise internal constructor() : Resource() { return (TransferContext.readReturnValue(OBJECT, true) as Image?) } + /** + * Returns an [Image] containing seamless 2D noise values. + * **Note:** With [param normalize] set to `false`, the default implementation expects the noise + * generator to return values in the range `-1.0` to `1.0`. + */ @JvmOverloads public fun getSeamlessImage( width: Int, @@ -95,6 +128,11 @@ public open class Noise internal constructor() : Resource() { return (TransferContext.readReturnValue(OBJECT, true) as Image?) } + /** + * Returns an [Array] of [Image]s containing 3D noise values for use with [ImageTexture3D.create]. + * **Note:** With [param normalize] set to `false`, the default implementation expects the noise + * generator to return values in the range `-1.0` to `1.0`. + */ @JvmOverloads public fun getImage3d( width: Int, @@ -108,6 +146,12 @@ public open class Noise internal constructor() : Resource() { return (TransferContext.readReturnValue(ARRAY, false) as VariantArray) } + /** + * Returns an [Array] of [Image]s containing seamless 3D noise values for use with + * [ImageTexture3D.create]. + * **Note:** With [param normalize] set to `false`, the default implementation expects the noise + * generator to return values in the range `-1.0` to `1.0`. + */ @JvmOverloads public fun getSeamlessImage3d( width: Int, diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/NoiseTexture2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/NoiseTexture2D.kt index 562518d91..5b873a993 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/NoiseTexture2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/NoiseTexture2D.kt @@ -22,8 +22,25 @@ import kotlin.Int import kotlin.Suppress import kotlin.jvm.JvmName +/** + * Uses the [FastNoiseLite] library or other noise generators to fill the texture data of your + * desired size. [NoiseTexture2D] can also generate normal map textures. + * The class uses [Thread]s to generate the texture data internally, so [Texture2D.getImage] may + * return `null` if the generation process has not completed yet. In that case, you need to wait for + * the texture to be generated before accessing the image and the generated byte data: + * [codeblock] + * var texture = NoiseTexture2D.new() + * texture.noise = FastNoiseLite.new() + * await texture.changed + * var image = texture.get_image() + * var data = image.get_data() + * [/codeblock] + */ @GodotBaseType public open class NoiseTexture2D : Texture2D() { + /** + * Width of the generated texture (in pixels). + */ public var width: Int @JvmName("getWidth_prop") get() = super.getWidth() @@ -32,6 +49,9 @@ public open class NoiseTexture2D : Texture2D() { TransferContext.callMethod(rawPtr, MethodBindings.setWidthPtr, NIL) } + /** + * Height of the generated texture (in pixels). + */ public var height: Int @JvmName("getHeight_prop") get() = super.getHeight() @@ -40,6 +60,9 @@ public open class NoiseTexture2D : Texture2D() { TransferContext.callMethod(rawPtr, MethodBindings.setHeightPtr, NIL) } + /** + * If `true`, inverts the noise texture. White becomes black, black becomes white. + */ public var invert: Boolean get() { TransferContext.writeArguments() @@ -51,6 +74,9 @@ public open class NoiseTexture2D : Texture2D() { TransferContext.callMethod(rawPtr, MethodBindings.setInvertPtr, NIL) } + /** + * Determines whether the noise image is calculated in 3D space. May result in reduced contrast. + */ public var in3dSpace: Boolean get() { TransferContext.writeArguments() @@ -62,6 +88,13 @@ public open class NoiseTexture2D : Texture2D() { TransferContext.callMethod(rawPtr, MethodBindings.setIn3dSpacePtr, NIL) } + /** + * Determines whether mipmaps are generated for this texture. Enabling this results in less + * texture aliasing in the distance, at the cost of increasing memory usage by roughly 33% and + * making the noise texture generation take longer. + * **Note:** [generateMipmaps] requires mipmap filtering to be enabled on the material using the + * [NoiseTexture2D] to have an effect. + */ public var generateMipmaps: Boolean get() { TransferContext.writeArguments() @@ -73,6 +106,15 @@ public open class NoiseTexture2D : Texture2D() { TransferContext.callMethod(rawPtr, MethodBindings.setGenerateMipmapsPtr, NIL) } + /** + * If `true`, a seamless texture is requested from the [Noise] resource. + * **Note:** Seamless noise textures may take longer to generate and/or can have a lower contrast + * compared to non-seamless noise depending on the used [Noise] resource. This is because some + * implementations use higher dimensions for generating seamless noise. + * **Note:** The default [FastNoiseLite] implementation uses the fallback path for seamless + * generation. If using a [width] or [height] lower than the default, you may need to increase + * [seamlessBlendSkirt] to make seamless blending more effective. + */ public var seamless: Boolean get() { TransferContext.writeArguments() @@ -84,6 +126,13 @@ public open class NoiseTexture2D : Texture2D() { TransferContext.callMethod(rawPtr, MethodBindings.setSeamlessPtr, NIL) } + /** + * Used for the default/fallback implementation of the seamless texture generation. It determines + * the distance over which the seams are blended. High values may result in less details and + * contrast. See [Noise] for further details. + * **Note:** If using a [width] or [height] lower than the default, you may need to increase + * [seamlessBlendSkirt] to make seamless blending more effective. + */ public var seamlessBlendSkirt: Float get() { TransferContext.writeArguments() @@ -95,6 +144,10 @@ public open class NoiseTexture2D : Texture2D() { TransferContext.callMethod(rawPtr, MethodBindings.setSeamlessBlendSkirtPtr, NIL) } + /** + * If `true`, the resulting texture contains a normal map created from the original noise + * interpreted as a bump map. + */ public var asNormalMap: Boolean get() { TransferContext.writeArguments() @@ -106,6 +159,10 @@ public open class NoiseTexture2D : Texture2D() { TransferContext.callMethod(rawPtr, MethodBindings.setAsNormalMapPtr, NIL) } + /** + * Strength of the bump maps used in this texture. A higher value will make the bump maps appear + * larger while a lower value will make them appear softer. + */ public var bumpStrength: Float get() { TransferContext.writeArguments() @@ -117,6 +174,12 @@ public open class NoiseTexture2D : Texture2D() { TransferContext.callMethod(rawPtr, MethodBindings.setBumpStrengthPtr, NIL) } + /** + * If `true`, the noise image coming from the noise generator is normalized to the range `0.0` to + * `1.0`. + * Turning normalization off can affect the contrast and allows you to generate non repeating + * tileable noise textures. + */ public var normalize: Boolean get() { TransferContext.writeArguments() @@ -128,6 +191,9 @@ public open class NoiseTexture2D : Texture2D() { TransferContext.callMethod(rawPtr, MethodBindings.setNormalizePtr, NIL) } + /** + * A [Gradient] which is used to map the luminance of each pixel to a color value. + */ public var colorRamp: Gradient? get() { TransferContext.writeArguments() @@ -139,6 +205,9 @@ public open class NoiseTexture2D : Texture2D() { TransferContext.callMethod(rawPtr, MethodBindings.setColorRampPtr, NIL) } + /** + * The instance of the [Noise] object. + */ public var noise: Noise? get() { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/NoiseTexture3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/NoiseTexture3D.kt index 77db69c42..fe5fd4f9a 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/NoiseTexture3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/NoiseTexture3D.kt @@ -22,8 +22,24 @@ import kotlin.Int import kotlin.Suppress import kotlin.jvm.JvmName +/** + * Uses the [FastNoiseLite] library or other noise generators to fill the texture data of your + * desired size. + * The class uses [Thread]s to generate the texture data internally, so [Texture3D.getData] may + * return `null` if the generation process has not completed yet. In that case, you need to wait for + * the texture to be generated before accessing the image: + * [codeblock] + * var texture = NoiseTexture3D.new() + * texture.noise = FastNoiseLite.new() + * await texture.changed + * var data = texture.get_data() + * [/codeblock] + */ @GodotBaseType public open class NoiseTexture3D : Texture3D() { + /** + * Width of the generated texture (in pixels). + */ public var width: Int @JvmName("getWidth_prop") get() = super.getWidth() @@ -32,6 +48,9 @@ public open class NoiseTexture3D : Texture3D() { TransferContext.callMethod(rawPtr, MethodBindings.setWidthPtr, NIL) } + /** + * Height of the generated texture (in pixels). + */ public var height: Int @JvmName("getHeight_prop") get() = super.getHeight() @@ -40,6 +59,9 @@ public open class NoiseTexture3D : Texture3D() { TransferContext.callMethod(rawPtr, MethodBindings.setHeightPtr, NIL) } + /** + * Depth of the generated texture (in pixels). + */ public var depth: Int @JvmName("getDepth_prop") get() = super.getDepth() @@ -48,6 +70,9 @@ public open class NoiseTexture3D : Texture3D() { TransferContext.callMethod(rawPtr, MethodBindings.setDepthPtr, NIL) } + /** + * If `true`, inverts the noise texture. White becomes black, black becomes white. + */ public var invert: Boolean get() { TransferContext.writeArguments() @@ -59,6 +84,15 @@ public open class NoiseTexture3D : Texture3D() { TransferContext.callMethod(rawPtr, MethodBindings.setInvertPtr, NIL) } + /** + * If `true`, a seamless texture is requested from the [Noise] resource. + * **Note:** Seamless noise textures may take longer to generate and/or can have a lower contrast + * compared to non-seamless noise depending on the used [Noise] resource. This is because some + * implementations use higher dimensions for generating seamless noise. + * **Note:** The default [FastNoiseLite] implementation uses the fallback path for seamless + * generation. If using a [width], [height] or [depth] lower than the default, you may need to + * increase [seamlessBlendSkirt] to make seamless blending more effective. + */ public var seamless: Boolean get() { TransferContext.writeArguments() @@ -70,6 +104,13 @@ public open class NoiseTexture3D : Texture3D() { TransferContext.callMethod(rawPtr, MethodBindings.setSeamlessPtr, NIL) } + /** + * Used for the default/fallback implementation of the seamless texture generation. It determines + * the distance over which the seams are blended. High values may result in less details and + * contrast. See [Noise] for further details. + * **Note:** If using a [width], [height] or [depth] lower than the default, you may need to + * increase [seamlessBlendSkirt] to make seamless blending more effective. + */ public var seamlessBlendSkirt: Float get() { TransferContext.writeArguments() @@ -81,6 +122,12 @@ public open class NoiseTexture3D : Texture3D() { TransferContext.callMethod(rawPtr, MethodBindings.setSeamlessBlendSkirtPtr, NIL) } + /** + * If `true`, the noise image coming from the noise generator is normalized to the range `0.0` to + * `1.0`. + * Turning normalization off can affect the contrast and allows you to generate non repeating + * tileable noise textures. + */ public var normalize: Boolean get() { TransferContext.writeArguments() @@ -92,6 +139,9 @@ public open class NoiseTexture3D : Texture3D() { TransferContext.callMethod(rawPtr, MethodBindings.setNormalizePtr, NIL) } + /** + * A [Gradient] which is used to map the luminance of each pixel to a color value. + */ public var colorRamp: Gradient? get() { TransferContext.writeArguments() @@ -103,6 +153,9 @@ public open class NoiseTexture3D : Texture3D() { TransferContext.callMethod(rawPtr, MethodBindings.setColorRampPtr, NIL) } + /** + * The instance of the [Noise] object. + */ public var noise: Noise? get() { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ORMMaterial3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ORMMaterial3D.kt index 6afff987b..699e3bb28 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ORMMaterial3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ORMMaterial3D.kt @@ -12,12 +12,9 @@ import kotlin.Int import kotlin.Suppress /** - * A PBR (Physically Based Rendering) material to be used on 3D objects. Uses an ORM texture. - * - * Tutorials: - * [$DOCS_URL/tutorials/3d/standard_material_3d.html]($DOCS_URL/tutorials/3d/standard_material_3d.html) - * - * ORMMaterial3D's properties are inherited from [godot.BaseMaterial3D]. Unlike [godot.StandardMaterial3D], ORMMaterial3D uses a single texture for ambient occlusion, roughness and metallic maps, known as an ORM texture. + * ORMMaterial3D's properties are inherited from [BaseMaterial3D]. Unlike [StandardMaterial3D], + * ORMMaterial3D uses a single texture for ambient occlusion, roughness and metallic maps, known as an + * ORM texture. */ @GodotBaseType public open class ORMMaterial3D : BaseMaterial3D() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Occluder3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Occluder3D.kt index f206ee54a..1669b5fc6 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Occluder3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Occluder3D.kt @@ -19,14 +19,8 @@ import kotlin.Int import kotlin.Suppress /** - * Occluder shape resource for use with occlusion culling in [godot.OccluderInstance3D]. - * - * Tutorials: - * [$DOCS_URL/tutorials/3d/occlusion_culling.html]($DOCS_URL/tutorials/3d/occlusion_culling.html) - * - * [godot.Occluder3D] stores an occluder shape that can be used by the engine's occlusion culling system. - * - * See [godot.OccluderInstance3D]'s documentation for instructions on setting up occlusion culling. + * [Occluder3D] stores an occluder shape that can be used by the engine's occlusion culling system. + * See [OccluderInstance3D]'s documentation for instructions on setting up occlusion culling. */ @GodotBaseType public open class Occluder3D internal constructor() : Resource() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/OccluderInstance3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/OccluderInstance3D.kt index 66aee6861..29bb7b244 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/OccluderInstance3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/OccluderInstance3D.kt @@ -24,31 +24,41 @@ import kotlin.Suppress import kotlin.Unit /** - * Provides occlusion culling for 3D nodes, which improves performance in closed areas. - * - * Tutorials: - * [$DOCS_URL/tutorials/3d/occlusion_culling.html]($DOCS_URL/tutorials/3d/occlusion_culling.html) - * - * Occlusion culling can improve rendering performance in closed/semi-open areas by hiding geometry that is occluded by other objects. - * - * The occlusion culling system is mostly static. [godot.OccluderInstance3D]s can be moved or hidden at run-time, but doing so will trigger a background recomputation that can take several frames. It is recommended to only move [godot.OccluderInstance3D]s sporadically (e.g. for procedural generation purposes), rather than doing so every frame. - * - * The occlusion culling system works by rendering the occluders on the CPU in parallel using [godot.Embree](https://www.embree.org/), drawing the result to a low-resolution buffer then using this to cull 3D nodes individually. In the 3D editor, you can preview the occlusion culling buffer by choosing **Perspective > Debug Advanced... > Occlusion Culling Buffer** in the top-left corner of the 3D viewport. The occlusion culling buffer quality can be adjusted in the Project Settings. - * - * **Baking:** Select an [godot.OccluderInstance3D] node, then use the **Bake Occluders** button at the top of the 3D editor. Only opaque materials will be taken into account; transparent materials (alpha-blended or alpha-tested) will be ignored by the occluder generation. - * - * **Note:** Occlusion culling is only effective if [godot.ProjectSettings.rendering/occlusionCulling/useOcclusionCulling] is `true`. Enabling occlusion culling has a cost on the CPU. Only enable occlusion culling if you actually plan to use it. Large open scenes with few or no objects blocking the view will generally not benefit much from occlusion culling. Large open scenes generally benefit more from mesh LOD and visibility ranges ([godot.GeometryInstance3D.visibilityRangeBegin] and [godot.GeometryInstance3D.visibilityRangeEnd]) compared to occlusion culling. - * - * **Note:** Due to memory constraints, occlusion culling is not supported by default in Web export templates. It can be enabled by compiling custom Web export templates with `module_raycast_enabled=yes`. + * Occlusion culling can improve rendering performance in closed/semi-open areas by hiding geometry + * that is occluded by other objects. + * The occlusion culling system is mostly static. [OccluderInstance3D]s can be moved or hidden at + * run-time, but doing so will trigger a background recomputation that can take several frames. It is + * recommended to only move [OccluderInstance3D]s sporadically (e.g. for procedural generation + * purposes), rather than doing so every frame. + * The occlusion culling system works by rendering the occluders on the CPU in parallel using + * [url=https://www.embree.org/]Embree[/url], drawing the result to a low-resolution buffer then using + * this to cull 3D nodes individually. In the 3D editor, you can preview the occlusion culling buffer + * by choosing **Perspective > Debug Advanced... > Occlusion Culling Buffer** in the top-left corner of + * the 3D viewport. The occlusion culling buffer quality can be adjusted in the Project Settings. + * **Baking:** Select an [OccluderInstance3D] node, then use the **Bake Occluders** button at the + * top of the 3D editor. Only opaque materials will be taken into account; transparent materials + * (alpha-blended or alpha-tested) will be ignored by the occluder generation. + * **Note:** Occlusion culling is only effective if + * [ProjectSettings.rendering/occlusionCulling/useOcclusionCulling] is `true`. Enabling occlusion + * culling has a cost on the CPU. Only enable occlusion culling if you actually plan to use it. Large + * open scenes with few or no objects blocking the view will generally not benefit much from occlusion + * culling. Large open scenes generally benefit more from mesh LOD and visibility ranges + * ([GeometryInstance3D.visibilityRangeBegin] and [GeometryInstance3D.visibilityRangeEnd]) compared to + * occlusion culling. + * **Note:** Due to memory constraints, occlusion culling is not supported by default in Web export + * templates. It can be enabled by compiling custom Web export templates with + * `module_raycast_enabled=yes`. */ @GodotBaseType public open class OccluderInstance3D : Node3D() { /** - * The occluder resource for this [godot.OccluderInstance3D]. You can generate an occluder resource by selecting an [godot.OccluderInstance3D] node then using the **Bake Occluders** button at the top of the editor. - * - * You can also draw your own 2D occluder polygon by adding a new [godot.PolygonOccluder3D] resource to the [occluder] property in the Inspector. - * - * Alternatively, you can select a primitive occluder to use: [godot.QuadOccluder3D], [godot.BoxOccluder3D] or [godot.SphereOccluder3D]. + * The occluder resource for this [OccluderInstance3D]. You can generate an occluder resource by + * selecting an [OccluderInstance3D] node then using the **Bake Occluders** button at the top of the + * editor. + * You can also draw your own 2D occluder polygon by adding a new [PolygonOccluder3D] resource to + * the [occluder] property in the Inspector. + * Alternatively, you can select a primitive occluder to use: [QuadOccluder3D], [BoxOccluder3D] or + * [SphereOccluder3D]. */ public var occluder: Occluder3D? get() { @@ -62,9 +72,13 @@ public open class OccluderInstance3D : Node3D() { } /** - * The visual layers to account for when baking for occluders. Only [godot.MeshInstance3D]s whose [godot.VisualInstance3D.layers] match with this [bakeMask] will be included in the generated occluder mesh. By default, all objects with *opaque* materials are taken into account for the occluder baking. - * - * To improve performance and avoid artifacts, it is recommended to exclude dynamic objects, small objects and fixtures from the baking process by moving them to a separate visual layer and excluding this layer in [bakeMask]. + * The visual layers to account for when baking for occluders. Only [MeshInstance3D]s whose + * [VisualInstance3D.layers] match with this [bakeMask] will be included in the generated occluder + * mesh. By default, all objects with *opaque* materials are taken into account for the occluder + * baking. + * To improve performance and avoid artifacts, it is recommended to exclude dynamic objects, small + * objects and fixtures from the baking process by moving them to a separate visual layer and + * excluding this layer in [bakeMask]. */ public var bakeMask: Long get() { @@ -78,13 +92,21 @@ public open class OccluderInstance3D : Node3D() { } /** - * The simplification distance to use for simplifying the generated occluder polygon (in 3D units). Higher values result in a less detailed occluder mesh, which improves performance but reduces culling accuracy. - * - * The occluder geometry is rendered on the CPU, so it is important to keep its geometry as simple as possible. Since the buffer is rendered at a low resolution, less detailed occluder meshes generally still work well. The default value is fairly aggressive, so you may have to decrease it if you run into false negatives (objects being occluded even though they are visible by the camera). A value of `0.01` will act conservatively, and will keep geometry *perceptually* unaffected in the occlusion culling buffer. Depending on the scene, a value of `0.01` may still simplify the mesh noticeably compared to disabling simplification entirely. - * - * Setting this to `0.0` disables simplification entirely, but vertices in the exact same position will still be merged. The mesh will also be re-indexed to reduce both the number of vertices and indices. - * - * **Note:** This uses the [meshoptimizer](https://meshoptimizer.org/) library under the hood, similar to LOD generation. + * The simplification distance to use for simplifying the generated occluder polygon (in 3D + * units). Higher values result in a less detailed occluder mesh, which improves performance but + * reduces culling accuracy. + * The occluder geometry is rendered on the CPU, so it is important to keep its geometry as simple + * as possible. Since the buffer is rendered at a low resolution, less detailed occluder meshes + * generally still work well. The default value is fairly aggressive, so you may have to decrease it + * if you run into false negatives (objects being occluded even though they are visible by the + * camera). A value of `0.01` will act conservatively, and will keep geometry *perceptually* + * unaffected in the occlusion culling buffer. Depending on the scene, a value of `0.01` may still + * simplify the mesh noticeably compared to disabling simplification entirely. + * Setting this to `0.0` disables simplification entirely, but vertices in the exact same position + * will still be merged. The mesh will also be re-indexed to reduce both the number of vertices and + * indices. + * **Note:** This uses the [url=https://meshoptimizer.org/]meshoptimizer[/url] library under the + * hood, similar to LOD generation. */ public var bakeSimplificationDistance: Float get() { @@ -103,7 +125,8 @@ public open class OccluderInstance3D : Node3D() { } /** - * Based on [value], enables or disables the specified layer in the [bakeMask], given a [layerNumber] between 1 and 32. + * Based on [param value], enables or disables the specified layer in the [bakeMask], given a + * [param layer_number] between 1 and 32. */ public fun setBakeMaskValue(layerNumber: Int, `value`: Boolean): Unit { TransferContext.writeArguments(LONG to layerNumber.toLong(), BOOL to value) @@ -111,7 +134,8 @@ public open class OccluderInstance3D : Node3D() { } /** - * Returns whether or not the specified layer of the [bakeMask] is enabled, given a [layerNumber] between 1 and 32. + * Returns whether or not the specified layer of the [bakeMask] is enabled, given a [param + * layer_number] between 1 and 32. */ public fun getBakeMaskValue(layerNumber: Int): Boolean { TransferContext.writeArguments(LONG to layerNumber.toLong()) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/OccluderPolygon2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/OccluderPolygon2D.kt index 6e00df7e8..58bf92bcf 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/OccluderPolygon2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/OccluderPolygon2D.kt @@ -21,14 +21,13 @@ import kotlin.Long import kotlin.Suppress /** - * Defines a 2D polygon for LightOccluder2D. - * - * Editor facility that helps you draw a 2D polygon used as resource for [godot.LightOccluder2D]. + * Editor facility that helps you draw a 2D polygon used as resource for [LightOccluder2D]. */ @GodotBaseType public open class OccluderPolygon2D : Resource() { /** - * If `true`, closes the polygon. A closed OccluderPolygon2D occludes the light coming from any direction. An opened OccluderPolygon2D occludes the light only at its outline's direction. + * If `true`, closes the polygon. A closed OccluderPolygon2D occludes the light coming from any + * direction. An opened OccluderPolygon2D occludes the light only at its outline's direction. */ public var closed: Boolean get() { @@ -56,8 +55,7 @@ public open class OccluderPolygon2D : Resource() { } /** - * A [godot.core.Vector2] array with the index for polygon's vertices positions. - * + * A [Vector2] array with the index for polygon's vertices positions. * **Note:** The returned value is a copy of the underlying array, rather than a reference. */ public var polygon: PackedVector2Array diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/OfflineMultiplayerPeer.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/OfflineMultiplayerPeer.kt index 6fc13e0bf..a1178eca4 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/OfflineMultiplayerPeer.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/OfflineMultiplayerPeer.kt @@ -12,11 +12,11 @@ import kotlin.Int import kotlin.Suppress /** - * A [godot.MultiplayerPeer] which is always connected and acts as a server. - * - * This is the default [godot.MultiplayerAPI.multiplayerPeer] for the [godot.Node.multiplayer]. It mimics the behavior of a server with no peers connected. - * - * This means that the [godot.SceneTree] will act as the multiplayer authority by default. Calls to [godot.MultiplayerAPI.isServer] will return `true`, and calls to [godot.MultiplayerAPI.getUniqueId] will return [godot.MultiplayerPeer.TARGET_PEER_SERVER]. + * This is the default [MultiplayerAPI.multiplayerPeer] for the [Node.multiplayer]. It mimics the + * behavior of a server with no peers connected. + * This means that the [SceneTree] will act as the multiplayer authority by default. Calls to + * [MultiplayerAPI.isServer] will return `true`, and calls to [MultiplayerAPI.getUniqueId] will return + * [constant MultiplayerPeer.TARGET_PEER_SERVER]. */ @GodotBaseType public open class OfflineMultiplayerPeer : MultiplayerPeer() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/OggPacketSequence.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/OggPacketSequence.kt index 538adf043..a010f1161 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/OggPacketSequence.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/OggPacketSequence.kt @@ -23,8 +23,14 @@ import kotlin.Float import kotlin.Int import kotlin.Suppress +/** + * A sequence of Ogg packets. + */ @GodotBaseType public open class OggPacketSequence : Resource() { + /** + * Contains the raw packets that make up this OggPacketSequence. + */ public var packetData: VariantArray> get() { TransferContext.writeArguments() @@ -36,6 +42,9 @@ public open class OggPacketSequence : Resource() { TransferContext.callMethod(rawPtr, MethodBindings.setPacketDataPtr, NIL) } + /** + * Contains the granule positions for each page in this packet sequence. + */ public var granulePositions: PackedInt64Array get() { TransferContext.writeArguments() @@ -48,6 +57,10 @@ public open class OggPacketSequence : Resource() { TransferContext.callMethod(rawPtr, MethodBindings.setPacketGranulePositionsPtr, NIL) } + /** + * Holds sample rate information about this sequence. Must be set by another class that actually + * understands the codec. + */ public var samplingRate: Float get() { TransferContext.writeArguments() @@ -64,6 +77,9 @@ public open class OggPacketSequence : Resource() { return true } + /** + * The length of this stream, in seconds. + */ public fun getLength(): Float { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getLengthPtr, DOUBLE) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/OggPacketSequencePlayback.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/OggPacketSequencePlayback.kt index 8d4b6099f..b75bba11f 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/OggPacketSequencePlayback.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/OggPacketSequencePlayback.kt @@ -11,6 +11,18 @@ import kotlin.Boolean import kotlin.Int import kotlin.Suppress +/** + * Imports Blender scenes in the `.blend` file format through the glTF 2.0 3D import pipeline. This + * importer requires Blender to be installed by the user, so that it can be used to export the scene as + * glTF 2.0. + * The location of the Blender binary is set via the `filesystem/import/blender/blender3_path` + * editor setting. + * This importer is only used if [ProjectSettings.filesystem/import/blender/enabled] is enabled, + * otherwise `.blend` files present in the project folder are not imported. + * Blend import requires Blender 3.0. + * Internally, the EditorSceneFormatImporterBlend uses the Blender glTF "Use Original" mode to + * reference external textures. + */ @GodotBaseType public open class OggPacketSequencePlayback : RefCounted() { public override fun new(scriptIndex: Int): Boolean { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/OmniLight3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/OmniLight3D.kt index 41143e84b..520b35543 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/OmniLight3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/OmniLight3D.kt @@ -18,16 +18,18 @@ import kotlin.Long import kotlin.Suppress /** - * Omnidirectional light, such as a light bulb or a candle. - * - * Tutorials: - * [$DOCS_URL/tutorials/3d/global_illumination/faking_global_illumination.html]($DOCS_URL/tutorials/3d/global_illumination/faking_global_illumination.html) - * - * An Omnidirectional light is a type of [godot.Light3D] that emits light in all directions. The light is attenuated by distance and this attenuation can be configured by changing its energy, radius, and attenuation parameters. - * - * **Note:** When using the Mobile rendering method, only 8 omni lights can be displayed on each mesh resource. Attempting to display more than 8 omni lights on a single mesh resource will result in omni lights flickering in and out as the camera moves. When using the Compatibility rendering method, only 8 omni lights can be displayed on each mesh resource by default, but this can be increased by adjusting [godot.ProjectSettings.rendering/limits/opengl/maxLightsPerObject]. - * - * **Note:** When using the Mobile or Compatibility rendering methods, omni lights will only correctly affect meshes whose visibility AABB intersects with the light's AABB. If using a shader to deform the mesh in a way that makes it go outside its AABB, [godot.GeometryInstance3D.extraCullMargin] must be increased on the mesh. Otherwise, the light may not be visible on the mesh. + * An Omnidirectional light is a type of [Light3D] that emits light in all directions. The light is + * attenuated by distance and this attenuation can be configured by changing its energy, radius, and + * attenuation parameters. + * **Note:** When using the Mobile rendering method, only 8 omni lights can be displayed on each + * mesh resource. Attempting to display more than 8 omni lights on a single mesh resource will result + * in omni lights flickering in and out as the camera moves. When using the Compatibility rendering + * method, only 8 omni lights can be displayed on each mesh resource by default, but this can be + * increased by adjusting [ProjectSettings.rendering/limits/opengl/maxLightsPerObject]. + * **Note:** When using the Mobile or Compatibility rendering methods, omni lights will only + * correctly affect meshes whose visibility AABB intersects with the light's AABB. If using a shader to + * deform the mesh in a way that makes it go outside its AABB, [GeometryInstance3D.extraCullMargin] + * must be increased on the mesh. Otherwise, the light may not be visible on the mesh. */ @GodotBaseType public open class OmniLight3D : Light3D() { @@ -54,11 +56,13 @@ public open class OmniLight3D : Light3D() { id: Long, ) { /** - * Shadows are rendered to a dual-paraboloid texture. Faster than [SHADOW_CUBE], but lower-quality. + * Shadows are rendered to a dual-paraboloid texture. Faster than [constant SHADOW_CUBE], but + * lower-quality. */ SHADOW_DUAL_PARABOLOID(0), /** - * Shadows are rendered to a cubemap. Slower than [SHADOW_DUAL_PARABOLOID], but higher-quality. + * Shadows are rendered to a cubemap. Slower than [constant SHADOW_DUAL_PARABOLOID], but + * higher-quality. */ SHADOW_CUBE(1), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/OpenXRAPIExtension.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/OpenXRAPIExtension.kt index 64a9981b8..1f8d54eff 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/OpenXRAPIExtension.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/OpenXRAPIExtension.kt @@ -22,6 +22,12 @@ import kotlin.Long import kotlin.String import kotlin.Suppress +/** + * [OpenXRAPIExtension] makes OpenXR available for GDExtension. It provides the OpenXR API to + * GDExtension through the [getInstanceProcAddr] method, and the OpenXR instance through [getInstance]. + * It also provides methods for querying the status of OpenXR initialization, and helper methods for + * ease of use of the API with GDExtension. + */ @GodotBaseType public open class OpenXRAPIExtension : RefCounted() { public override fun new(scriptIndex: Int): Boolean { @@ -29,24 +35,46 @@ public open class OpenXRAPIExtension : RefCounted() { return true } + /** + * Returns the + * [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrInstance.html]XrInstance[/url] + * created during the initialization of the OpenXR API. + */ public fun getInstance(): Long { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getInstancePtr, LONG) return (TransferContext.readReturnValue(LONG, false) as Long) } + /** + * Returns the id of the system, which is a + * [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrSystemId.html]XrSystemId[/url] cast + * to an integer. + */ public fun getSystemId(): Long { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getSystemIdPtr, LONG) return (TransferContext.readReturnValue(LONG, false) as Long) } + /** + * Returns the OpenXR session, which is an + * [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrSession.html]XrSession[/url] cast to + * an integer. + */ public fun getSession(): Long { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getSessionPtr, LONG) return (TransferContext.readReturnValue(LONG, false) as Long) } + /** + * Returns `true` if the provided + * [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrResult.html]XrResult[/url] (cast to + * an integer) is successful. Otherwise returns `false` and prints the + * [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrResult.html]XrResult[/url] converted + * to a string, with the specified additional information. + */ public fun xrResult( result: Long, format: String, @@ -57,48 +85,80 @@ public open class OpenXRAPIExtension : RefCounted() { return (TransferContext.readReturnValue(BOOL, false) as Boolean) } + /** + * Returns the function pointer of the OpenXR function with the specified name, cast to an + * integer. If the function with the given name does not exist, the method returns `0`. + * **Note:** `openxr/util.h` contains utility macros for acquiring OpenXR functions, e.g. + * `GDEXTENSION_INIT_XR_FUNC_V(xrCreateAction)`. + */ public fun getInstanceProcAddr(name: String): Long { TransferContext.writeArguments(STRING to name) TransferContext.callMethod(rawPtr, MethodBindings.getInstanceProcAddrPtr, LONG) return (TransferContext.readReturnValue(LONG, false) as Long) } + /** + * Returns an error string for the given + * [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrResult.html]XrResult[/url]. + */ public fun getErrorString(result: Long): String { TransferContext.writeArguments(LONG to result) TransferContext.callMethod(rawPtr, MethodBindings.getErrorStringPtr, STRING) return (TransferContext.readReturnValue(STRING, false) as String) } + /** + * Returns the name of the specified swapchain format. + */ public fun getSwapchainFormatName(swapchainFormat: Long): String { TransferContext.writeArguments(LONG to swapchainFormat) TransferContext.callMethod(rawPtr, MethodBindings.getSwapchainFormatNamePtr, STRING) return (TransferContext.readReturnValue(STRING, false) as String) } + /** + * Returns `true` if OpenXR is initialized. + */ public fun isInitialized(): Boolean { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.isInitializedPtr, BOOL) return (TransferContext.readReturnValue(BOOL, false) as Boolean) } + /** + * Returns `true` if OpenXR is running + * ([url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/xrBeginSession.html]xrBeginSession[/url] + * was successfully called and the swapchains were created). + */ public fun isRunning(): Boolean { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.isRunningPtr, BOOL) return (TransferContext.readReturnValue(BOOL, false) as Boolean) } + /** + * Returns the play space, which is an + * [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrSpace.html]XrSpace[/url] cast to an + * integer. + */ public fun getPlaySpace(): Long { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getPlaySpacePtr, LONG) return (TransferContext.readReturnValue(LONG, false) as Long) } + /** + * Returns the timing for the next frame. + */ public fun getNextFrameTime(): Long { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getNextFrameTimePtr, LONG) return (TransferContext.readReturnValue(LONG, false) as Long) } + /** + * Returns `true` if OpenXR is initialized for rendering with an XR viewport. + */ public fun canRender(): Boolean { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.canRenderPtr, BOOL) @@ -106,6 +166,9 @@ public open class OpenXRAPIExtension : RefCounted() { } public companion object { + /** + * Returns `true` if OpenXR is enabled. + */ public fun openxrIsEnabled(checkRunInEditor: Boolean): Boolean { TransferContext.writeArguments(BOOL to checkRunInEditor) TransferContext.callMethod(0, MethodBindings.openxrIsEnabledPtr, BOOL) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/OpenXRAction.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/OpenXRAction.kt index 70660cf6c..8171cd0ea 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/OpenXRAction.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/OpenXRAction.kt @@ -21,8 +21,26 @@ import kotlin.Long import kotlin.String import kotlin.Suppress +/** + * This resource defines an OpenXR action. Actions can be used both for inputs + * (buttons/joystick/trigger/etc) and outputs (haptics). + * OpenXR performs automatic conversion between action type and input type whenever possible. An + * analog trigger bound to a boolean action will thus return `false` if the trigger is depressed and + * `true` if pressed fully. + * Actions are not directly bound to specific devices, instead OpenXR recognizes a limited number of + * top level paths that identify devices by usage. We can restrict which devices an action can be bound + * to by these top level paths. For instance an action that should only be used for hand held + * controllers can have the top level paths "/user/hand/left" and "/user/hand/right" associated with + * them. See the + * [url=https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#semantic-path-reserved]reserved + * path section in the OpenXR specification[/url] for more info on the top level paths. + * Note that the name of the resource is used to register the action with. + */ @GodotBaseType public open class OpenXRAction : Resource() { + /** + * The localized description of this action. + */ public var localizedName: String get() { TransferContext.writeArguments() @@ -34,6 +52,9 @@ public open class OpenXRAction : Resource() { TransferContext.callMethod(rawPtr, MethodBindings.setLocalizedNamePtr, NIL) } + /** + * The type of action. + */ public var actionType: ActionType get() { TransferContext.writeArguments() @@ -45,6 +66,9 @@ public open class OpenXRAction : Resource() { TransferContext.callMethod(rawPtr, MethodBindings.setActionTypePtr, NIL) } + /** + * A collections of toplevel paths to which this action can be bound. + */ public var toplevelPaths: PackedStringArray get() { TransferContext.writeArguments() @@ -64,8 +88,18 @@ public open class OpenXRAction : Resource() { public enum class ActionType( id: Long, ) { + /** + * This action provides a boolean value. + */ OPENXR_ACTION_BOOL(0), + /** + * This action provides a float value between `0.0` and `1.0` for any analog input such as + * triggers. + */ OPENXR_ACTION_FLOAT(1), + /** + * This action provides a [Vector2] value and can be bound to embedded trackpads and joysticks. + */ OPENXR_ACTION_VECTOR2(2), OPENXR_ACTION_POSE(3), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/OpenXRActionMap.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/OpenXRActionMap.kt index 34c7a2ee5..48c7e1df1 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/OpenXRActionMap.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/OpenXRActionMap.kt @@ -24,8 +24,21 @@ import kotlin.String import kotlin.Suppress import kotlin.Unit +/** + * OpenXR uses an action system similar to Godots Input map system to bind inputs and outputs on + * various types of XR controllers to named actions. OpenXR specifies more detail on these inputs and + * outputs than Godot supports. + * Another important distinction is that OpenXR offers no control over these bindings. The bindings + * we register are suggestions, it is up to the XR runtime to offer users the ability to change these + * bindings. This allows the XR runtime to fill in the gaps if new hardware becomes available. + * The action map therefore needs to be loaded at startup and can't be changed afterwards. This + * resource is a container for the entire action map. + */ @GodotBaseType public open class OpenXRActionMap : Resource() { + /** + * Collection of [OpenXRActionSet]s that are part of this action map. + */ public var actionSets: VariantArray? get() { TransferContext.writeArguments() @@ -37,6 +50,9 @@ public open class OpenXRActionMap : Resource() { TransferContext.callMethod(rawPtr, MethodBindings.setActionSetsPtr, NIL) } + /** + * Collection of [OpenXRInteractionProfile]s that are part of this action map. + */ public var interactionProfiles: VariantArray? get() { TransferContext.writeArguments() @@ -53,62 +69,95 @@ public open class OpenXRActionMap : Resource() { return true } + /** + * Retrieve the number of actions sets in our action map. + */ public fun getActionSetCount(): Int { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getActionSetCountPtr, LONG) return (TransferContext.readReturnValue(LONG, false) as Long).toInt() } + /** + * Retrieve an action set by name. + */ public fun findActionSet(name: String): OpenXRActionSet? { TransferContext.writeArguments(STRING to name) TransferContext.callMethod(rawPtr, MethodBindings.findActionSetPtr, OBJECT) return (TransferContext.readReturnValue(OBJECT, true) as OpenXRActionSet?) } + /** + * Retrieve the action set at this index. + */ public fun getActionSet(idx: Int): OpenXRActionSet? { TransferContext.writeArguments(LONG to idx.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.getActionSetPtr, OBJECT) return (TransferContext.readReturnValue(OBJECT, true) as OpenXRActionSet?) } + /** + * Add an action set. + */ public fun addActionSet(actionSet: OpenXRActionSet): Unit { TransferContext.writeArguments(OBJECT to actionSet) TransferContext.callMethod(rawPtr, MethodBindings.addActionSetPtr, NIL) } + /** + * Remove an action set. + */ public fun removeActionSet(actionSet: OpenXRActionSet): Unit { TransferContext.writeArguments(OBJECT to actionSet) TransferContext.callMethod(rawPtr, MethodBindings.removeActionSetPtr, NIL) } + /** + * Retrieve the number of interaction profiles in our action map. + */ public fun getInteractionProfileCount(): Int { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getInteractionProfileCountPtr, LONG) return (TransferContext.readReturnValue(LONG, false) as Long).toInt() } + /** + * Find an interaction profile by its name (path). + */ public fun findInteractionProfile(name: String): OpenXRInteractionProfile? { TransferContext.writeArguments(STRING to name) TransferContext.callMethod(rawPtr, MethodBindings.findInteractionProfilePtr, OBJECT) return (TransferContext.readReturnValue(OBJECT, true) as OpenXRInteractionProfile?) } + /** + * Get the interaction profile at this index. + */ public fun getInteractionProfile(idx: Int): OpenXRInteractionProfile? { TransferContext.writeArguments(LONG to idx.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.getInteractionProfilePtr, OBJECT) return (TransferContext.readReturnValue(OBJECT, true) as OpenXRInteractionProfile?) } + /** + * Add an interaction profile. + */ public fun addInteractionProfile(interactionProfile: OpenXRInteractionProfile): Unit { TransferContext.writeArguments(OBJECT to interactionProfile) TransferContext.callMethod(rawPtr, MethodBindings.addInteractionProfilePtr, NIL) } + /** + * Remove an interaction profile. + */ public fun removeInteractionProfile(interactionProfile: OpenXRInteractionProfile): Unit { TransferContext.writeArguments(OBJECT to interactionProfile) TransferContext.callMethod(rawPtr, MethodBindings.removeInteractionProfilePtr, NIL) } + /** + * Setup this action set with our default actions. + */ public fun createDefaultActionSets(): Unit { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.createDefaultActionSetsPtr, NIL) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/OpenXRActionSet.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/OpenXRActionSet.kt index a9ade8d8f..622f945a8 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/OpenXRActionSet.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/OpenXRActionSet.kt @@ -24,8 +24,20 @@ import kotlin.String import kotlin.Suppress import kotlin.Unit +/** + * Action sets in OpenXR define a collection of actions that can be activated in unison. This allows + * games to easily change between different states that require different inputs or need to reinterpret + * inputs. For instance we could have an action set that is active when a menu is open, an action set + * that is active when the player is freely walking around and an action set that is active when the + * player is controlling a vehicle. + * Action sets can contain the same action with the same name, if such action sets are active at the + * same time the action set with the highest priority defines which binding is active. + */ @GodotBaseType public open class OpenXRActionSet : Resource() { + /** + * The localized name of this action set. + */ public var localizedName: String get() { TransferContext.writeArguments() @@ -37,6 +49,9 @@ public open class OpenXRActionSet : Resource() { TransferContext.callMethod(rawPtr, MethodBindings.setLocalizedNamePtr, NIL) } + /** + * The priority for this action set. + */ public var priority: Int get() { TransferContext.writeArguments() @@ -48,6 +63,9 @@ public open class OpenXRActionSet : Resource() { TransferContext.callMethod(rawPtr, MethodBindings.setPriorityPtr, NIL) } + /** + * Collection of actions for this action set. + */ public var actions: VariantArray? get() { TransferContext.writeArguments() @@ -64,17 +82,26 @@ public open class OpenXRActionSet : Resource() { return true } + /** + * Retrieve the number of actions in our action set. + */ public fun getActionCount(): Int { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getActionCountPtr, LONG) return (TransferContext.readReturnValue(LONG, false) as Long).toInt() } + /** + * Add an action to this action set. + */ public fun addAction(action: OpenXRAction): Unit { TransferContext.writeArguments(OBJECT to action) TransferContext.callMethod(rawPtr, MethodBindings.addActionPtr, NIL) } + /** + * Remove an action from this action set. + */ public fun removeAction(action: OpenXRAction): Unit { TransferContext.writeArguments(OBJECT to action) TransferContext.callMethod(rawPtr, MethodBindings.removeActionPtr, NIL) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/OpenXRExtensionWrapperExtension.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/OpenXRExtensionWrapperExtension.kt index dd547d314..f43f19617 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/OpenXRExtensionWrapperExtension.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/OpenXRExtensionWrapperExtension.kt @@ -21,6 +21,10 @@ import kotlin.NotImplementedError import kotlin.Suppress import kotlin.Unit +/** + * [OpenXRExtensionWrapperExtension] allows clients to implement OpenXR extensions with GDExtension. + * The extension should be registered with [registerExtensionWrapper]. + */ @GodotBaseType public open class OpenXRExtensionWrapperExtension : Object() { public override fun new(scriptIndex: Int): Boolean { @@ -28,64 +32,135 @@ public open class OpenXRExtensionWrapperExtension : Object() { return true } + /** + * Returns a [Dictionary] of OpenXR extensions related to this extension. The [Dictionary] should + * contain the name of the extension, mapped to a `bool *` cast to an integer: + * - If the `bool *` is a `nullptr` this extension is mandatory. + * - If the `bool *` points to a boolean, the boolean will be updated to `true` if the extension + * is enabled. + */ public open fun _getRequestedExtensions(): Dictionary { throw NotImplementedError("_get_requested_extensions is not implemented for OpenXRExtensionWrapperExtension") } + /** + * Allows extensions to register additional controller metadata. This function is called even when + * the OpenXR API is not constructed as the metadata needs to be available to the editor. + * Extensions should also provide metadata regardless of whether they are supported on the host + * system. The controller data is used to setup action maps for users who may have access to the + * relevant hardware. + */ public open fun _onRegisterMetadata(): Unit { } + /** + * Called before the OpenXR instance is created. + */ public open fun _onBeforeInstanceCreated(): Unit { } + /** + * Called right after the OpenXR instance is created. + */ public open fun _onInstanceCreated(instance: Long): Unit { } + /** + * Called right before the OpenXR instance is destroyed. + */ public open fun _onInstanceDestroyed(): Unit { } + /** + * Called right after the OpenXR session is created. + */ public open fun _onSessionCreated(session: Long): Unit { } + /** + * Called as part of the OpenXR process handling. This happens right before general and physics + * processing steps of the main loop. During this step controller data is queried and made available + * to game logic. + */ public open fun _onProcess(): Unit { } + /** + * Called right before the XR viewports begin their rendering step. + */ public open fun _onPreRender(): Unit { } + /** + * Called right before the OpenXR session is destroyed. + */ public open fun _onSessionDestroyed(): Unit { } + /** + * Called when the OpenXR session state is changed to idle. + */ public open fun _onStateIdle(): Unit { } + /** + * Called when the OpenXR session state is changed to ready. This means OpenXR is ready to set up + * the session. + */ public open fun _onStateReady(): Unit { } + /** + * Called when the OpenXR session state is changed to synchronized. OpenXR also returns to this + * state when the application loses focus. + */ public open fun _onStateSynchronized(): Unit { } + /** + * Called when the OpenXR session state is changed to visible. This means OpenXR is now ready to + * receive frames. + */ public open fun _onStateVisible(): Unit { } + /** + * Called when the OpenXR session state is changed to focused. This state is the active state when + * the game runs. + */ public open fun _onStateFocused(): Unit { } + /** + * Called when the OpenXR session state is changed to stopping. + */ public open fun _onStateStopping(): Unit { } + /** + * Called when the OpenXR session state is changed to loss pending. + */ public open fun _onStateLossPending(): Unit { } + /** + * Called when the OpenXR session state is changed to exiting. + */ public open fun _onStateExiting(): Unit { } + /** + * Returns the created [OpenXRAPIExtension], which can be used to access the OpenXR API. + */ public fun getOpenxrApi(): OpenXRAPIExtension? { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getOpenxrApiPtr, OBJECT) return (TransferContext.readReturnValue(OBJECT, true) as OpenXRAPIExtension?) } + /** + * Registers the extension. This should happen at core module initialization level. + */ public fun registerExtensionWrapper(): Unit { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.registerExtensionWrapperPtr, NIL) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/OpenXRHand.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/OpenXRHand.kt index fd891e171..7b32e65b3 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/OpenXRHand.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/OpenXRHand.kt @@ -19,8 +19,17 @@ import kotlin.Int import kotlin.Long import kotlin.Suppress +/** + * This node enables OpenXR's hand tracking functionality. The node should be a child node of an + * [XROrigin3D] node, tracking will update its position to where the player's actual hand is + * positioned. This node also updates the skeleton of a properly skinned hand model. The hand mesh + * should be a child node of this node. + */ @GodotBaseType public open class OpenXRHand : Node3D() { + /** + * Specifies whether this node tracks the left or right hand of the player. + */ public var hand: Hands get() { TransferContext.writeArguments() @@ -32,6 +41,9 @@ public open class OpenXRHand : Node3D() { TransferContext.callMethod(rawPtr, MethodBindings.setHandPtr, NIL) } + /** + * Set the motion range (if supported) limiting the hand motion. + */ public var motionRange: MotionRange get() { TransferContext.writeArguments() @@ -43,6 +55,9 @@ public open class OpenXRHand : Node3D() { TransferContext.callMethod(rawPtr, MethodBindings.setMotionRangePtr, NIL) } + /** + * Set a [Skeleton3D] node for which the pose positions will be updated. + */ public var handSkeleton: NodePath get() { TransferContext.writeArguments() @@ -62,8 +77,17 @@ public open class OpenXRHand : Node3D() { public enum class Hands( id: Long, ) { + /** + * Tracking the player's left hand. + */ HAND_LEFT(0), + /** + * Tracking the player's right hand. + */ HAND_RIGHT(1), + /** + * Maximum supported hands. + */ HAND_MAX(2), ; @@ -80,8 +104,17 @@ public open class OpenXRHand : Node3D() { public enum class MotionRange( id: Long, ) { + /** + * When player grips, hand skeleton will form a full fist. + */ MOTION_RANGE_UNOBSTRUCTED(0), + /** + * When player grips, hand skeleton conforms to the controller the player is holding. + */ MOTION_RANGE_CONFORM_TO_CONTROLLER(1), + /** + * Maximum supported motion ranges. + */ MOTION_RANGE_MAX(2), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/OpenXRIPBinding.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/OpenXRIPBinding.kt index 7fc8ab90c..2a4f3de1f 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/OpenXRIPBinding.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/OpenXRIPBinding.kt @@ -24,8 +24,17 @@ import kotlin.String import kotlin.Suppress import kotlin.Unit +/** + * This binding resource binds an [OpenXRAction] to inputs or outputs. As most controllers have left + * hand and right versions that are handled by the same interaction profile we can specify multiple + * bindings. For instance an action "Fire" could be bound to both "/user/hand/left/input/trigger" and + * "/user/hand/right/input/trigger". + */ @GodotBaseType public open class OpenXRIPBinding : Resource() { + /** + * [OpenXRAction] that is bound to these paths. + */ public var action: OpenXRAction? get() { TransferContext.writeArguments() @@ -37,6 +46,9 @@ public open class OpenXRIPBinding : Resource() { TransferContext.callMethod(rawPtr, MethodBindings.setActionPtr, NIL) } + /** + * Paths that define the inputs or outputs bound on the device. + */ public var paths: PackedStringArray get() { TransferContext.writeArguments() @@ -53,23 +65,35 @@ public open class OpenXRIPBinding : Resource() { return true } + /** + * Get the number of input/output paths in this binding. + */ public fun getPathCount(): Int { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getPathCountPtr, LONG) return (TransferContext.readReturnValue(LONG, false) as Long).toInt() } + /** + * Returns `true` if this input/output path is part of this binding. + */ public fun hasPath(path: String): Boolean { TransferContext.writeArguments(STRING to path) TransferContext.callMethod(rawPtr, MethodBindings.hasPathPtr, BOOL) return (TransferContext.readReturnValue(BOOL, false) as Boolean) } + /** + * Add an input/output path to this binding. + */ public fun addPath(path: String): Unit { TransferContext.writeArguments(STRING to path) TransferContext.callMethod(rawPtr, MethodBindings.addPathPtr, NIL) } + /** + * Removes this input/output path from this binding. + */ public fun removePath(path: String): Unit { TransferContext.writeArguments(STRING to path) TransferContext.callMethod(rawPtr, MethodBindings.removePathPtr, NIL) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/OpenXRInteractionProfile.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/OpenXRInteractionProfile.kt index b386e2284..3bf140005 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/OpenXRInteractionProfile.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/OpenXRInteractionProfile.kt @@ -23,8 +23,18 @@ import kotlin.Long import kotlin.String import kotlin.Suppress +/** + * This object stores suggested bindings for an interaction profile. Interaction profiles define the + * metadata for a tracked XR device such as an XR controller. + * For more information see the + * [url=https://www.khronos.org/registry/OpenXR/specs/1.0/html/xrspec.html#semantic-path-interaction-profiles]interaction + * profiles info in the OpenXR specification[/url]. + */ @GodotBaseType public open class OpenXRInteractionProfile : Resource() { + /** + * The interaction profile path identifying the XR device. + */ public var interactionProfilePath: String get() { TransferContext.writeArguments() @@ -36,6 +46,9 @@ public open class OpenXRInteractionProfile : Resource() { TransferContext.callMethod(rawPtr, MethodBindings.setInteractionProfilePathPtr, NIL) } + /** + * Action bindings for this interaction profile. + */ public var bindings: VariantArray? get() { TransferContext.writeArguments() @@ -52,12 +65,18 @@ public open class OpenXRInteractionProfile : Resource() { return true } + /** + * Get the number of bindings in this interaction profile. + */ public fun getBindingCount(): Int { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getBindingCountPtr, LONG) return (TransferContext.readReturnValue(LONG, false) as Long).toInt() } + /** + * Retrieve the binding at this index. + */ public fun getBinding(index: Int): OpenXRIPBinding? { TransferContext.writeArguments(LONG to index.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.getBindingPtr, OBJECT) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/OpenXRInteractionProfileMetadata.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/OpenXRInteractionProfileMetadata.kt index 3e150ff97..945e903b4 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/OpenXRInteractionProfileMetadata.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/OpenXRInteractionProfileMetadata.kt @@ -19,6 +19,12 @@ import kotlin.String import kotlin.Suppress import kotlin.Unit +/** + * This class allows OpenXR core and extensions to register metadata relating to supported + * interaction devices such as controllers, trackers, haptic devices, etc. It is primarily used by the + * action map editor and to sanitize any action map by removing extension-dependent entries when + * applicable. + */ @GodotBaseType public open class OpenXRInteractionProfileMetadata : Object() { public override fun new(scriptIndex: Int): Boolean { @@ -26,11 +32,25 @@ public open class OpenXRInteractionProfileMetadata : Object() { return true } + /** + * Allows for renaming old interaction profile paths to new paths to maintain backwards + * compatibility with older action maps. + */ public fun registerProfileRename(oldName: String, newName: String): Unit { TransferContext.writeArguments(STRING to oldName, STRING to newName) TransferContext.callMethod(rawPtr, MethodBindings.registerProfileRenamePtr, NIL) } + /** + * Registers a top level path to which profiles can be bound. For instance `/user/hand/left` + * refers to the bind point for the player's left hand. Extensions can register additional top level + * paths, for instance a haptic vest extension might register `/user/body/vest`. + * [param display_name] is the name shown to the user. [param openxr_path] is the top level path + * being registered. [param openxr_extension_name] is optional and ensures the top level path is only + * used if the specified extension is available/enabled. + * When a top level path ends up being bound by OpenXR, a [XRPositionalTracker] is instantiated to + * manage the state of the device. + */ public fun registerTopLevelPath( displayName: String, openxrPath: String, @@ -40,6 +60,15 @@ public open class OpenXRInteractionProfileMetadata : Object() { TransferContext.callMethod(rawPtr, MethodBindings.registerTopLevelPathPtr, NIL) } + /** + * Registers an interaction profile using its OpenXR designation (e.g. + * `/interaction_profiles/khr/simple_controller` is the profile for OpenXR's simple controller + * profile). + * [param display_name] is the description shown to the user. [param openxr_path] is the + * interaction profile path being registered. [param openxr_extension_name] optionally restricts this + * profile to the given extension being enabled/available. If the extension is not available, the + * profile and all related entries used in an action map are filtered out. + */ public fun registerInteractionProfile( displayName: String, openxrPath: String, @@ -49,6 +78,17 @@ public open class OpenXRInteractionProfileMetadata : Object() { TransferContext.callMethod(rawPtr, MethodBindings.registerInteractionProfilePtr, NIL) } + /** + * Registers an input/output path for the given [param interaction_profile]. The profile should + * previously have been registered using [registerInteractionProfile]. [param display_name] is the + * description shown to the user. [param toplevel_path] specifies the bind path this input/output can + * be bound to (e.g. `/user/hand/left` or `/user/hand/right`). [param openxr_path] is the action + * input/output being registered (e.g. `/user/hand/left/input/aim/pose`). [param + * openxr_extension_name] restricts this input/output to an enabled/available extension, this doesn't + * need to repeat the extension on the profile but relates to overlapping extension (e.g. + * `XR_EXT_palm_pose` that introduces `…/input/palm_ext/pose` input paths). [param action_type] + * defines the type of input or output provided by OpenXR. + */ public fun registerIoPath( interactionProfile: String, displayName: String, diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/OpenXRInterface.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/OpenXRInterface.kt index a12985ad2..e69dc3ad0 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/OpenXRInterface.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/OpenXRInterface.kt @@ -34,18 +34,46 @@ import kotlin.Suppress import kotlin.Unit import kotlin.jvm.JvmInline +/** + * The OpenXR interface allows Godot to interact with OpenXR runtimes and make it possible to create + * XR experiences and games. + * Due to the needs of OpenXR this interface works slightly different than other plugin based XR + * interfaces. It needs to be initialized when Godot starts. You need to enable OpenXR, settings for + * this can be found in your games project settings under the XR heading. You do need to mark a + * viewport for use with XR in order for Godot to know which render result should be output to the + * headset. + */ @GodotBaseType public open class OpenXRInterface : XRInterface() { + /** + * Informs our OpenXR session has been started. + */ public val sessionBegun: Signal0 by signal() + /** + * Informs our OpenXR session is stopping. + */ public val sessionStopping: Signal0 by signal() + /** + * Informs our OpenXR session now has focus. + */ public val sessionFocussed: Signal0 by signal() + /** + * Informs our OpenXR session is now visible (output is being sent to the HMD). + */ public val sessionVisible: Signal0 by signal() + /** + * Informs the user queued a recenter of the player position. + */ public val poseRecentered: Signal0 by signal() + /** + * The display refresh rate for the current HMD. Only functional if this feature is supported by + * the OpenXR runtime and after the interface has been initialized. + */ public var displayRefreshRate: Float get() { TransferContext.writeArguments() @@ -57,6 +85,10 @@ public open class OpenXRInterface : XRInterface() { TransferContext.callMethod(rawPtr, MethodBindings.setDisplayRefreshRatePtr, NIL) } + /** + * The render size multiplier for the current HMD. Must be set before the interface has been + * initialized. + */ public var renderTargetSizeMultiplier: Double get() { TransferContext.writeArguments() @@ -68,6 +100,10 @@ public open class OpenXRInterface : XRInterface() { TransferContext.callMethod(rawPtr, MethodBindings.setRenderTargetSizeMultiplierPtr, NIL) } + /** + * Set foveation level from 0 (off) to 3 (high), the interface must be initialized before this is + * accessible. + */ public var foveationLevel: Int get() { TransferContext.writeArguments() @@ -79,6 +115,10 @@ public open class OpenXRInterface : XRInterface() { TransferContext.callMethod(rawPtr, MethodBindings.setFoveationLevelPtr, NIL) } + /** + * Enable dynamic foveation adjustment, the interface must be initialized before this is + * accessible. If enabled foveation will automatically adjusted between low and [foveationLevel]. + */ public var foveationDynamic: Boolean get() { TransferContext.writeArguments() @@ -95,88 +135,146 @@ public open class OpenXRInterface : XRInterface() { return true } + /** + * Returns `true` if OpenXR's foveation extension is supported, the interface must be initialized + * before this returns a valid value. + * **Note:** This feature is only available on the compatibility renderer and currently only + * available on some stand alone headsets. For Vulkan set [Viewport.vrsMode] to `VRS_XR` on desktop. + */ public fun isFoveationSupported(): Boolean { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.isFoveationSupportedPtr, BOOL) return (TransferContext.readReturnValue(BOOL, false) as Boolean) } + /** + * Returns `true` if the given action set is active. + */ public fun isActionSetActive(name: String): Boolean { TransferContext.writeArguments(STRING to name) TransferContext.callMethod(rawPtr, MethodBindings.isActionSetActivePtr, BOOL) return (TransferContext.readReturnValue(BOOL, false) as Boolean) } + /** + * Sets the given action set as active or inactive. + */ public fun setActionSetActive(name: String, active: Boolean): Unit { TransferContext.writeArguments(STRING to name, BOOL to active) TransferContext.callMethod(rawPtr, MethodBindings.setActionSetActivePtr, NIL) } + /** + * Returns a list of action sets registered with Godot (loaded from the action map at runtime). + */ public fun getActionSets(): VariantArray { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getActionSetsPtr, ARRAY) return (TransferContext.readReturnValue(ARRAY, false) as VariantArray) } + /** + * Returns display refresh rates supported by the current HMD. Only returned if this feature is + * supported by the OpenXR runtime and after the interface has been initialized. + */ public fun getAvailableDisplayRefreshRates(): VariantArray { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getAvailableDisplayRefreshRatesPtr, ARRAY) return (TransferContext.readReturnValue(ARRAY, false) as VariantArray) } + /** + * If handtracking is enabled and motion range is supported, sets the currently configured motion + * range for [param hand] to [param motion_range]. + */ public fun setMotionRange(hand: Hand, motionRange: HandMotionRange): Unit { TransferContext.writeArguments(LONG to hand.id, LONG to motionRange.id) TransferContext.callMethod(rawPtr, MethodBindings.setMotionRangePtr, NIL) } + /** + * If handtracking is enabled and motion range is supported, gets the currently configured motion + * range for [param hand]. + */ public fun getMotionRange(hand: Hand): HandMotionRange { TransferContext.writeArguments(LONG to hand.id) TransferContext.callMethod(rawPtr, MethodBindings.getMotionRangePtr, LONG) return OpenXRInterface.HandMotionRange.from(TransferContext.readReturnValue(LONG) as Long) } + /** + * If handtracking is enabled, returns flags that inform us of the validity of the tracking data. + */ public fun getHandJointFlags(hand: Hand, joint: HandJoints): HandJointFlags { TransferContext.writeArguments(LONG to hand.id, LONG to joint.id) TransferContext.callMethod(rawPtr, MethodBindings.getHandJointFlagsPtr, LONG) return HandJointFlagsValue(TransferContext.readReturnValue(LONG) as Long) } + /** + * If handtracking is enabled, returns the rotation of a joint ([param joint]) of a hand ([param + * hand]) as provided by OpenXR. + */ public fun getHandJointRotation(hand: Hand, joint: HandJoints): Quaternion { TransferContext.writeArguments(LONG to hand.id, LONG to joint.id) TransferContext.callMethod(rawPtr, MethodBindings.getHandJointRotationPtr, QUATERNION) return (TransferContext.readReturnValue(QUATERNION, false) as Quaternion) } + /** + * If handtracking is enabled, returns the position of a joint ([param joint]) of a hand ([param + * hand]) as provided by OpenXR. This is relative to [XROrigin3D] without worldscale applied! + */ public fun getHandJointPosition(hand: Hand, joint: HandJoints): Vector3 { TransferContext.writeArguments(LONG to hand.id, LONG to joint.id) TransferContext.callMethod(rawPtr, MethodBindings.getHandJointPositionPtr, VECTOR3) return (TransferContext.readReturnValue(VECTOR3, false) as Vector3) } + /** + * If handtracking is enabled, returns the radius of a joint ([param joint]) of a hand ([param + * hand]) as provided by OpenXR. This is without worldscale applied! + */ public fun getHandJointRadius(hand: Hand, joint: HandJoints): Float { TransferContext.writeArguments(LONG to hand.id, LONG to joint.id) TransferContext.callMethod(rawPtr, MethodBindings.getHandJointRadiusPtr, DOUBLE) return (TransferContext.readReturnValue(DOUBLE, false) as Double).toFloat() } + /** + * If handtracking is enabled, returns the linear velocity of a joint ([param joint]) of a hand + * ([param hand]) as provided by OpenXR. This is relative to [XROrigin3D] without worldscale applied! + */ public fun getHandJointLinearVelocity(hand: Hand, joint: HandJoints): Vector3 { TransferContext.writeArguments(LONG to hand.id, LONG to joint.id) TransferContext.callMethod(rawPtr, MethodBindings.getHandJointLinearVelocityPtr, VECTOR3) return (TransferContext.readReturnValue(VECTOR3, false) as Vector3) } + /** + * If handtracking is enabled, returns the angular velocity of a joint ([param joint]) of a hand + * ([param hand]) as provided by OpenXR. This is relative to [XROrigin3D]! + */ public fun getHandJointAngularVelocity(hand: Hand, joint: HandJoints): Vector3 { TransferContext.writeArguments(LONG to hand.id, LONG to joint.id) TransferContext.callMethod(rawPtr, MethodBindings.getHandJointAngularVelocityPtr, VECTOR3) return (TransferContext.readReturnValue(VECTOR3, false) as Vector3) } + /** + * Returns `true` if OpenXR's hand tracking is supported and enabled. + * **Note:** This only returns a valid value after OpenXR has been initialized. + */ public fun isHandTrackingSupported(): Boolean { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.isHandTrackingSupportedPtr, BOOL) return (TransferContext.readReturnValue(BOOL, false) as Boolean) } + /** + * Returns the capabilities of the eye gaze interaction extension. + * **Note:** This only returns a valid value after OpenXR has been initialized. + */ public fun isEyeGazeInteractionSupported(): Boolean { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.isEyeGazeInteractionSupportedPtr, BOOL) @@ -186,8 +284,17 @@ public open class OpenXRInterface : XRInterface() { public enum class Hand( id: Long, ) { + /** + * Left hand. + */ HAND_LEFT(0), + /** + * Right hand. + */ HAND_RIGHT(1), + /** + * Maximum value for the hand enum. + */ HAND_MAX(2), ; @@ -222,32 +329,113 @@ public open class OpenXRInterface : XRInterface() { public enum class HandJoints( id: Long, ) { + /** + * Palm joint. + */ HAND_JOINT_PALM(0), + /** + * Wrist joint. + */ HAND_JOINT_WRIST(1), + /** + * Thumb metacarpal joint. + */ HAND_JOINT_THUMB_METACARPAL(2), + /** + * Thumb proximal joint. + */ HAND_JOINT_THUMB_PROXIMAL(3), + /** + * Thumb distal joint. + */ HAND_JOINT_THUMB_DISTAL(4), + /** + * Thumb tip joint. + */ HAND_JOINT_THUMB_TIP(5), + /** + * Index metacarpal joint. + */ HAND_JOINT_INDEX_METACARPAL(6), + /** + * Index proximal joint. + */ HAND_JOINT_INDEX_PROXIMAL(7), + /** + * Index intermediate joint. + */ HAND_JOINT_INDEX_INTERMEDIATE(8), + /** + * Index distal joint. + */ HAND_JOINT_INDEX_DISTAL(9), + /** + * Index tip joint. + */ HAND_JOINT_INDEX_TIP(10), + /** + * Middle metacarpal joint. + */ HAND_JOINT_MIDDLE_METACARPAL(11), + /** + * Middle proximal joint. + */ HAND_JOINT_MIDDLE_PROXIMAL(12), + /** + * Middle intermediate joint. + */ HAND_JOINT_MIDDLE_INTERMEDIATE(13), + /** + * Middle distal joint. + */ HAND_JOINT_MIDDLE_DISTAL(14), + /** + * Middle tip joint. + */ HAND_JOINT_MIDDLE_TIP(15), + /** + * Ring metacarpal joint. + */ HAND_JOINT_RING_METACARPAL(16), + /** + * Ring proximal joint. + */ HAND_JOINT_RING_PROXIMAL(17), + /** + * Ring intermediate joint. + */ HAND_JOINT_RING_INTERMEDIATE(18), + /** + * Ring distal joint. + */ HAND_JOINT_RING_DISTAL(19), + /** + * Ring tip joint. + */ HAND_JOINT_RING_TIP(20), + /** + * Little metacarpal joint. + */ HAND_JOINT_LITTLE_METACARPAL(21), + /** + * Little proximal joint. + */ HAND_JOINT_LITTLE_PROXIMAL(22), + /** + * Little intermediate joint. + */ HAND_JOINT_LITTLE_INTERMEDIATE(23), + /** + * Little distal joint. + */ HAND_JOINT_LITTLE_DISTAL(24), + /** + * Little tip joint. + */ HAND_JOINT_LITTLE_TIP(25), + /** + * Maximum value for the hand joint enum. + */ HAND_JOINT_MAX(26), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/OptimizedTranslation.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/OptimizedTranslation.kt index b80e4076f..158e53fa3 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/OptimizedTranslation.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/OptimizedTranslation.kt @@ -18,9 +18,8 @@ import kotlin.Suppress import kotlin.Unit /** - * An optimized translation, used by default for CSV Translations. - * - * An optimized translation, used by default for CSV Translations. Uses real-time compressed translations, which results in very small dictionaries. + * An optimized translation, used by default for CSV Translations. Uses real-time compressed + * translations, which results in very small dictionaries. */ @GodotBaseType public open class OptimizedTranslation : Translation() { @@ -30,7 +29,7 @@ public open class OptimizedTranslation : Translation() { } /** - * Generates and sets an optimized translation from the given [godot.Translation] resource. + * Generates and sets an optimized translation from the given [Translation] resource. */ public fun generate(from: Translation): Unit { TransferContext.writeArguments(OBJECT to from) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/OptionButton.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/OptionButton.kt index 79231eafc..e6c6a12bb 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/OptionButton.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/OptionButton.kt @@ -28,27 +28,27 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * A button that brings up a dropdown with selectable options when pressed. - * - * [godot.OptionButton] is a type of button that brings up a dropdown with selectable items when pressed. The item selected becomes the "current" item and is displayed as the button text. - * - * See also [godot.BaseButton] which contains common properties and methods associated with this node. - * - * **Note:** The ID values used for items are limited to 32 bits, not full 64 bits of [int]. This has a range of `-2^32` to `2^32 - 1`, i.e. `-2147483648` to `2147483647`. - * - * **Note:** The [godot.Button.text] and [godot.Button.icon] properties are set automatically based on the selected item. They shouldn't be changed manually. + * [OptionButton] is a type of button that brings up a dropdown with selectable items when pressed. + * The item selected becomes the "current" item and is displayed as the button text. + * See also [BaseButton] which contains common properties and methods associated with this node. + * **Note:** The ID values used for items are limited to 32 bits, not full 64 bits of [int]. This + * has a range of `-2^32` to `2^32 - 1`, i.e. `-2147483648` to `2147483647`. + * **Note:** The [Button.text] and [Button.icon] properties are set automatically based on the + * selected item. They shouldn't be changed manually. */ @GodotBaseType public open class OptionButton : Button() { /** - * Emitted when the current item has been changed by the user. The index of the item selected is passed as argument. - * + * Emitted when the current item has been changed by the user. The index of the item selected is + * passed as argument. * [allowReselect] must be enabled to reselect an item. */ public val itemSelected: Signal1 by signal("index") /** - * Emitted when the user navigates to an item using the [godot.ProjectSettings.input/uiUp] or [godot.ProjectSettings.input/uiDown] input actions. The index of the item selected is passed as argument. + * Emitted when the user navigates to an item using the [ProjectSettings.input/uiUp] or + * [ProjectSettings.input/uiDown] input actions. The index of the item selected is passed as + * argument. */ public val itemFocused: Signal1 by signal("index") @@ -77,9 +77,10 @@ public open class OptionButton : Button() { } /** - * If `true`, minimum size will be determined by the longest item's text, instead of the currently selected one's. - * - * **Note:** For performance reasons, the minimum size doesn't update immediately when adding, removing or modifying items. + * If `true`, minimum size will be determined by the longest item's text, instead of the currently + * selected one's. + * **Note:** For performance reasons, the minimum size doesn't update immediately when adding, + * removing or modifying items. */ public var fitToLongestItem: Boolean get() { @@ -112,7 +113,8 @@ public open class OptionButton : Button() { } /** - * Adds an item, with text [label] and (optionally) [id]. If no [id] is passed, the item index will be used as the item's ID. New items are appended at the end. + * Adds an item, with text [param label] and (optionally) [param id]. If no [param id] is passed, + * the item index will be used as the item's ID. New items are appended at the end. */ @JvmOverloads public fun addItem(label: String, id: Int = -1): Unit { @@ -121,7 +123,9 @@ public open class OptionButton : Button() { } /** - * Adds an item, with a [texture] icon, text [label] and (optionally) [id]. If no [id] is passed, the item index will be used as the item's ID. New items are appended at the end. + * Adds an item, with a [param texture] icon, text [param label] and (optionally) [param id]. If + * no [param id] is passed, the item index will be used as the item's ID. New items are appended at + * the end. */ @JvmOverloads public fun addIconItem( @@ -134,7 +138,7 @@ public open class OptionButton : Button() { } /** - * Sets the text of the item at index [idx]. + * Sets the text of the item at index [param idx]. */ public fun setItemText(idx: Int, text: String): Unit { TransferContext.writeArguments(LONG to idx.toLong(), STRING to text) @@ -142,7 +146,7 @@ public open class OptionButton : Button() { } /** - * Sets the icon of the item at index [idx]. + * Sets the icon of the item at index [param idx]. */ public fun setItemIcon(idx: Int, texture: Texture2D): Unit { TransferContext.writeArguments(LONG to idx.toLong(), OBJECT to texture) @@ -150,9 +154,9 @@ public open class OptionButton : Button() { } /** - * Sets whether the item at index [idx] is disabled. - * - * Disabled items are drawn differently in the dropdown and are not selectable by the user. If the current selected item is set as disabled, it will remain selected. + * Sets whether the item at index [param idx] is disabled. + * Disabled items are drawn differently in the dropdown and are not selectable by the user. If the + * current selected item is set as disabled, it will remain selected. */ public fun setItemDisabled(idx: Int, disabled: Boolean): Unit { TransferContext.writeArguments(LONG to idx.toLong(), BOOL to disabled) @@ -160,7 +164,7 @@ public open class OptionButton : Button() { } /** - * Sets the ID of the item at index [idx]. + * Sets the ID of the item at index [param idx]. */ public fun setItemId(idx: Int, id: Int): Unit { TransferContext.writeArguments(LONG to idx.toLong(), LONG to id.toLong()) @@ -168,7 +172,8 @@ public open class OptionButton : Button() { } /** - * Sets the metadata of an item. Metadata may be of any type and can be used to store extra information about an item, such as an external string ID. + * Sets the metadata of an item. Metadata may be of any type and can be used to store extra + * information about an item, such as an external string ID. */ public fun setItemMetadata(idx: Int, metadata: Any?): Unit { TransferContext.writeArguments(LONG to idx.toLong(), ANY to metadata) @@ -176,7 +181,7 @@ public open class OptionButton : Button() { } /** - * Sets the tooltip of the item at index [idx]. + * Sets the tooltip of the item at index [param idx]. */ public fun setItemTooltip(idx: Int, tooltip: String): Unit { TransferContext.writeArguments(LONG to idx.toLong(), STRING to tooltip) @@ -184,7 +189,7 @@ public open class OptionButton : Button() { } /** - * Returns the text of the item at index [idx]. + * Returns the text of the item at index [param idx]. */ public fun getItemText(idx: Int): String { TransferContext.writeArguments(LONG to idx.toLong()) @@ -193,7 +198,7 @@ public open class OptionButton : Button() { } /** - * Returns the icon of the item at index [idx]. + * Returns the icon of the item at index [param idx]. */ public fun getItemIcon(idx: Int): Texture2D? { TransferContext.writeArguments(LONG to idx.toLong()) @@ -202,7 +207,7 @@ public open class OptionButton : Button() { } /** - * Returns the ID of the item at index [idx]. + * Returns the ID of the item at index [param idx]. */ public fun getItemId(idx: Int): Int { TransferContext.writeArguments(LONG to idx.toLong()) @@ -211,7 +216,7 @@ public open class OptionButton : Button() { } /** - * Returns the index of the item with the given [id]. + * Returns the index of the item with the given [param id]. */ public fun getItemIndex(id: Int): Int { TransferContext.writeArguments(LONG to id.toLong()) @@ -220,7 +225,8 @@ public open class OptionButton : Button() { } /** - * Retrieves the metadata of an item. Metadata may be any type and can be used to store extra information about an item, such as an external string ID. + * Retrieves the metadata of an item. Metadata may be any type and can be used to store extra + * information about an item, such as an external string ID. */ public fun getItemMetadata(idx: Int): Any? { TransferContext.writeArguments(LONG to idx.toLong()) @@ -229,7 +235,7 @@ public open class OptionButton : Button() { } /** - * Returns the tooltip of the item at index [idx]. + * Returns the tooltip of the item at index [param idx]. */ public fun getItemTooltip(idx: Int): String { TransferContext.writeArguments(LONG to idx.toLong()) @@ -238,7 +244,7 @@ public open class OptionButton : Button() { } /** - * Returns `true` if the item at index [idx] is disabled. + * Returns `true` if the item at index [param idx] is disabled. */ public fun isItemDisabled(idx: Int): Boolean { TransferContext.writeArguments(LONG to idx.toLong()) @@ -247,7 +253,7 @@ public open class OptionButton : Button() { } /** - * Returns `true` if the item at index [idx] is marked as a separator. + * Returns `true` if the item at index [param idx] is marked as a separator. */ public fun isItemSeparator(idx: Int): Boolean { TransferContext.writeArguments(LONG to idx.toLong()) @@ -256,7 +262,9 @@ public open class OptionButton : Button() { } /** - * Adds a separator to the list of items. Separators help to group items, and can optionally be given a [text] header. A separator also gets an index assigned, and is appended at the end of the item list. + * Adds a separator to the list of items. Separators help to group items, and can optionally be + * given a [param text] header. A separator also gets an index assigned, and is appended at the end + * of the item list. */ @JvmOverloads public fun addSeparator(text: String = ""): Unit { @@ -265,7 +273,7 @@ public open class OptionButton : Button() { } /** - * Clears all the items in the [godot.OptionButton]. + * Clears all the items in the [OptionButton]. */ public fun clear(): Unit { TransferContext.writeArguments() @@ -273,8 +281,8 @@ public open class OptionButton : Button() { } /** - * Selects an item by index and makes it the current item. This will work even if the item is disabled. - * + * Selects an item by index and makes it the current item. This will work even if the item is + * disabled. * Passing `-1` as the index deselects any currently selected item. */ public fun select(idx: Int): Unit { @@ -301,7 +309,7 @@ public open class OptionButton : Button() { } /** - * Removes the item at index [idx]. + * Removes the item at index [param idx]. */ public fun removeItem(idx: Int): Unit { TransferContext.writeArguments(LONG to idx.toLong()) @@ -309,9 +317,9 @@ public open class OptionButton : Button() { } /** - * Returns the [godot.PopupMenu] contained in this button. - * - * **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their [godot.Window.visible] property. + * Returns the [PopupMenu] contained in this button. + * **Warning:** This is a required internal node, removing and freeing it may cause a crash. If + * you wish to hide it or any of its children, use their [Window.visible] property. */ public fun getPopup(): PopupMenu? { TransferContext.writeArguments() @@ -320,7 +328,8 @@ public open class OptionButton : Button() { } /** - * Adjusts popup position and sizing for the [godot.OptionButton], then shows the [godot.PopupMenu]. Prefer this over using `get_popup().popup()`. + * Adjusts popup position and sizing for the [OptionButton], then shows the [PopupMenu]. Prefer + * this over using `get_popup().popup()`. */ public fun showPopup(): Unit { TransferContext.writeArguments() @@ -328,7 +337,8 @@ public open class OptionButton : Button() { } /** - * Returns `true` if this button contains at least one item which is not disabled, or marked as a separator. + * Returns `true` if this button contains at least one item which is not disabled, or marked as a + * separator. */ public fun hasSelectableItems(): Boolean { TransferContext.writeArguments() @@ -337,8 +347,8 @@ public open class OptionButton : Button() { } /** - * Returns the index of the first item which is not disabled, or marked as a separator. If [fromLast] is `true`, the items will be searched in reverse order. - * + * Returns the index of the first item which is not disabled, or marked as a separator. If [param + * from_last] is `true`, the items will be searched in reverse order. * Returns `-1` if no item is found. */ @JvmOverloads diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Orientation.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Orientation.kt index dcc91faf6..95c8d72ed 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Orientation.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Orientation.kt @@ -6,7 +6,13 @@ import kotlin.Long public enum class Orientation( id: Long, ) { + /** + * General vertical alignment, usually used for [Separator], [ScrollBar], [Slider], etc. + */ VERTICAL(1), + /** + * General horizontal alignment, usually used for [Separator], [ScrollBar], [Slider], etc. + */ HORIZONTAL(0), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PackedDataContainer.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PackedDataContainer.kt index 16e42c68c..2f931a9d8 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PackedDataContainer.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PackedDataContainer.kt @@ -20,31 +20,30 @@ import kotlin.Long import kotlin.Suppress /** - * Efficiently packs and serializes [godot.Array] or [godot.core.Dictionary]. + * [PackedDataContainer] can be used to efficiently store data from untyped containers. The data is + * packed into raw bytes and can be saved to file. Only [Array] and [Dictionary] can be stored this + * way. + * You can retrieve the data by iterating on the container, which will work as if iterating on the + * packed data itself. If the packed container is a [Dictionary], the data can be retrieved by key + * names ([String]/[StringName] only). + * [codeblock] + * var data = { "key": "value", "another_key": 123, "lock": Vector2() } + * var packed = PackedDataContainer.new() + * packed.pack(data) + * ResourceSaver.save(packed, "packed_data.res") + * [/codeblock] + * [codeblock] + * var container = load("packed_data.res") + * for key in container: + * prints(key, container[key]) * - * [godot.PackedDataContainer] can be used to efficiently store data from untyped containers. The data is packed into raw bytes and can be saved to file. Only [godot.Array] and [godot.core.Dictionary] can be stored this way. - * - * You can retrieve the data by iterating on the container, which will work as if iterating on the packed data itself. If the packed container is a [godot.core.Dictionary], the data can be retrieved by key names ([godot.String]/[godot.StringName] only). - * - * ``` - * var data = { "key": "value", "another_key": 123, "lock": Vector2() } - * var packed = PackedDataContainer.new() - * packed.pack(data) - * ResourceSaver.save(packed, "packed_data.res") - * ``` - * - * ``` - * var container = load("packed_data.res") - * for key in container: - * prints(key, container[key]) - * - * # Prints: - * # key value - * # lock (0, 0) - * # another_key 123 - * ``` - * - * Nested containers will be packed recursively. While iterating, they will be returned as [godot.PackedDataContainerRef]. + * # Prints: + * # key value + * # lock (0, 0) + * # another_key 123 + * [/codeblock] + * Nested containers will be packed recursively. While iterating, they will be returned as + * [PackedDataContainerRef]. */ @GodotBaseType public open class PackedDataContainer : Resource() { @@ -54,8 +53,8 @@ public open class PackedDataContainer : Resource() { } /** - * Packs the given container into a binary representation. The [value] must be either [godot.Array] or [godot.core.Dictionary], any other type will result in invalid data error. - * + * Packs the given container into a binary representation. The [param value] must be either + * [Array] or [Dictionary], any other type will result in invalid data error. * **Note:** Subsequent calls to this method will overwrite the existing data. */ public fun pack(`value`: Any?): GodotError { @@ -65,7 +64,7 @@ public open class PackedDataContainer : Resource() { } /** - * Returns the size of the packed container (see [godot.Array.size] and [godot.Dictionary.size]). + * Returns the size of the packed container (see [Array.size] and [Dictionary.size]). */ public fun size(): Int { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PackedDataContainerRef.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PackedDataContainerRef.kt index 4818d9d55..67f2b39f9 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PackedDataContainerRef.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PackedDataContainerRef.kt @@ -17,31 +17,30 @@ import kotlin.Long import kotlin.Suppress /** - * An internal class used by [godot.PackedDataContainer] to pack nested arrays and dictionaries. + * When packing nested containers using [PackedDataContainer], they are recursively packed into + * [PackedDataContainerRef] (only applies to [Array] and [Dictionary]). Their data can be retrieved the + * same way as from [PackedDataContainer]. + * [codeblock] + * var packed = PackedDataContainer.new() + * packed.pack([1, 2, 3, ["abc", "def"], 4, 5, 6]) * - * When packing nested containers using [godot.PackedDataContainer], they are recursively packed into [godot.PackedDataContainerRef] (only applies to [godot.Array] and [godot.core.Dictionary]). Their data can be retrieved the same way as from [godot.PackedDataContainer]. + * for element in packed: + * if element is PackedDataContainerRef: + * for subelement in element: + * print("::", subelement) + * else: + * print(element) * - * ``` - * var packed = PackedDataContainer.new() - * packed.pack([1, 2, 3, ["abc", "def"], 4, 5, 6]) - * - * for element in packed: - * if element is PackedDataContainerRef: - * for subelement in element: - * print("::", subelement) - * else: - * print(element) - * - * # Prints: - * # 1 - * # 2 - * # 3 - * # ::abc - * # ::def - * # 4 - * # 5 - * # 6 - * ``` + * # Prints: + * # 1 + * # 2 + * # 3 + * # ::abc + * # ::def + * # 4 + * # 5 + * # 6 + * [/codeblock] */ @GodotBaseType public open class PackedDataContainerRef internal constructor() : RefCounted() { @@ -51,7 +50,7 @@ public open class PackedDataContainerRef internal constructor() : RefCounted() { } /** - * Returns the size of the packed container (see [godot.Array.size] and [godot.Dictionary.size]). + * Returns the size of the packed container (see [Array.size] and [Dictionary.size]). */ public fun size(): Int { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PackedScene.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PackedScene.kt index ea5f14efd..41e773aaa 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PackedScene.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PackedScene.kt @@ -21,144 +21,81 @@ import kotlin.Suppress import kotlin.jvm.JvmOverloads /** - * An abstraction of a serialized scene. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/520](https://godotengine.org/asset-library/asset/520) - * - * A simplified interface to a scene file. Provides access to operations and checks that can be performed on the scene resource itself. - * - * Can be used to save a node to a file. When saving, the node as well as all the nodes it owns get saved (see [godot.Node.owner] property). - * + * A simplified interface to a scene file. Provides access to operations and checks that can be + * performed on the scene resource itself. + * Can be used to save a node to a file. When saving, the node as well as all the nodes it owns get + * saved (see [Node.owner] property). * **Note:** The node doesn't need to own itself. - * * **Example of loading a saved scene:** * - * [codeblocks] - * - * [gdscript] - * + * gdscript: + * ```gdscript * # Use load() instead of preload() if the path isn't known at compile-time. - * * var scene = preload("res://scene.tscn").instantiate() - * * # Add the node as a child of the node the script is attached to. - * * add_child(scene) - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * // C# has no preload, so you have to always use ResourceLoader.Load(). - * * var scene = ResourceLoader.Load("res://scene.tscn").Instantiate(); - * * // Add the node as a child of the node the script is attached to. - * * AddChild(scene); + * ``` * - * [/csharp] - * - * [/codeblocks] - * - * **Example of saving a node with different owners:** The following example creates 3 objects: [godot.Node2D] (`node`), [godot.RigidBody2D] (`body`) and [godot.CollisionObject2D] (`collision`). `collision` is a child of `body` which is a child of `node`. Only `body` is owned by `node` and [pack] will therefore only save those two nodes, but not `collision`. - * - * [codeblocks] - * - * [gdscript] + * **Example of saving a node with different owners:** The following example creates 3 objects: + * [Node2D] (`node`), [RigidBody2D] (`body`) and [CollisionObject2D] (`collision`). `collision` is a + * child of `body` which is a child of `node`. Only `body` is owned by `node` and [pack] will therefore + * only save those two nodes, but not `collision`. * + * gdscript: + * ```gdscript * # Create the objects. - * * var node = Node2D.new() - * * var body = RigidBody2D.new() - * * var collision = CollisionShape2D.new() * - * - * * # Create the object hierarchy. - * * body.add_child(collision) - * * node.add_child(body) * - * - * * # Change owner of `body`, but not of `collision`. - * * body.owner = node - * * var scene = PackedScene.new() * - * - * * # Only `node` and `body` are now packed. - * * var result = scene.pack(node) - * * if result == OK: - * * var error = ResourceSaver.save(scene, "res://path/name.tscn") # Or "user://..." - * * if error != OK: - * * push_error("An error occurred while saving the scene to disk.") - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * // Create the objects. - * * var node = new Node2D(); - * * var body = new RigidBody2D(); - * * var collision = new CollisionShape2D(); * - * - * * // Create the object hierarchy. - * * body.AddChild(collision); - * * node.AddChild(body); * - * - * * // Change owner of `body`, but not of `collision`. - * * body.Owner = node; - * * var scene = new PackedScene(); * - * - * * // Only `node` and `body` are now packed. - * * Error result = scene.Pack(node); - * * if (result == Error.Ok) - * * { - * * Error error = ResourceSaver.Save(scene, "res://path/name.tscn"); // Or "user://..." - * * if (error != Error.Ok) - * * { - * * GD.PushError("An error occurred while saving the scene to disk."); - * * } - * * } - * - * [/csharp] - * - * [/codeblocks] + * ``` */ @GodotBaseType public open class PackedScene : Resource() { @@ -168,7 +105,7 @@ public open class PackedScene : Resource() { } /** - * Pack will ignore any sub-nodes not owned by given node. See [godot.Node.owner]. + * Pack will ignore any sub-nodes not owned by given node. See [Node.owner]. */ public fun pack(path: Node): GodotError { TransferContext.writeArguments(OBJECT to path) @@ -177,7 +114,8 @@ public open class PackedScene : Resource() { } /** - * Instantiates the scene's node hierarchy. Triggers child scene instantiation(s). Triggers a [godot.Node.NOTIFICATION_SCENE_INSTANTIATED] notification on the root node. + * Instantiates the scene's node hierarchy. Triggers child scene instantiation(s). Triggers a + * [constant Node.NOTIFICATION_SCENE_INSTANTIATED] notification on the root node. */ @JvmOverloads public fun instantiate(editState: GenEditState = @@ -197,7 +135,7 @@ public open class PackedScene : Resource() { } /** - * Returns the [godot.SceneState] representing the scene file contents. + * Returns the [SceneState] representing the scene file contents. */ public fun getState(): SceneState? { TransferContext.writeArguments() @@ -214,19 +152,18 @@ public open class PackedScene : Resource() { GEN_EDIT_STATE_DISABLED(0), /** * If passed to [instantiate], provides local scene resources to the local scene. - * * **Note:** Only available in editor builds. */ GEN_EDIT_STATE_INSTANCE(1), /** - * If passed to [instantiate], provides local scene resources to the local scene. Only the main scene should receive the main edit state. - * + * If passed to [instantiate], provides local scene resources to the local scene. Only the main + * scene should receive the main edit state. * **Note:** Only available in editor builds. */ GEN_EDIT_STATE_MAIN(2), /** - * It's similar to [GEN_EDIT_STATE_MAIN], but for the case where the scene is being instantiated to be the base of another one. - * + * It's similar to [constant GEN_EDIT_STATE_MAIN], but for the case where the scene is being + * instantiated to be the base of another one. * **Note:** Only available in editor builds. */ GEN_EDIT_STATE_MAIN_INHERITED(3), diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PacketPeer.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PacketPeer.kt index 2b73b9832..572edf80e 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PacketPeer.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PacketPeer.kt @@ -25,18 +25,22 @@ import kotlin.Suppress import kotlin.jvm.JvmOverloads /** - * Abstraction and base class for packet-based protocols. - * - * PacketPeer is an abstraction and base class for packet-based protocols (such as UDP). It provides an API for sending and receiving packets both as raw data or variables. This makes it easy to transfer data over a protocol, without having to encode data as low-level bytes or having to worry about network ordering. - * - * **Note:** When exporting to Android, make sure to enable the `INTERNET` permission in the Android export preset before exporting the project or using one-click deploy. Otherwise, network communication of any kind will be blocked by Android. + * PacketPeer is an abstraction and base class for packet-based protocols (such as UDP). It provides + * an API for sending and receiving packets both as raw data or variables. This makes it easy to + * transfer data over a protocol, without having to encode data as low-level bytes or having to worry + * about network ordering. + * **Note:** When exporting to Android, make sure to enable the `INTERNET` permission in the Android + * export preset before exporting the project or using one-click deploy. Otherwise, network + * communication of any kind will be blocked by Android. */ @GodotBaseType public open class PacketPeer internal constructor() : RefCounted() { /** - * Maximum buffer size allowed when encoding [Variant]s. Raise this value to support heavier memory allocations. - * - * The [putVar] method allocates memory on the stack, and the buffer used will grow automatically to the closest power of two to match the size of the [Variant]. If the [Variant] is bigger than [encodeBufferMaxSize], the method will error out with [ERR_OUT_OF_MEMORY]. + * Maximum buffer size allowed when encoding [Variant]s. Raise this value to support heavier + * memory allocations. + * The [putVar] method allocates memory on the stack, and the buffer used will grow automatically + * to the closest power of two to match the size of the [Variant]. If the [Variant] is bigger than + * [encodeBufferMaxSize], the method will error out with [constant ERR_OUT_OF_MEMORY]. */ public var encodeBufferMaxSize: Int get() { @@ -55,11 +59,11 @@ public open class PacketPeer internal constructor() : RefCounted() { } /** - * Gets a Variant. If [allowObjects] is `true`, decoding objects is allowed. - * + * Gets a Variant. If [param allow_objects] is `true`, decoding objects is allowed. * Internally, this uses the same decoding mechanism as the [@GlobalScope.bytesToVar] method. - * - * **Warning:** Deserialized objects can contain code which gets executed. Do not use this option if the serialized object comes from untrusted sources to avoid potential security threats such as remote code execution. + * **Warning:** Deserialized objects can contain code which gets executed. Do not use this option + * if the serialized object comes from untrusted sources to avoid potential security threats such as + * remote code execution. */ @JvmOverloads public fun getVar(allowObjects: Boolean = false): Any? { @@ -69,8 +73,8 @@ public open class PacketPeer internal constructor() : RefCounted() { } /** - * Sends a [Variant] as a packet. If [fullObjects] is `true`, encoding objects is allowed (and can potentially include code). - * + * Sends a [Variant] as a packet. If [param full_objects] is `true`, encoding objects is allowed + * (and can potentially include code). * Internally, this uses the same encoding mechanism as the [@GlobalScope.varToBytes] method. */ @JvmOverloads diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PacketPeerDTLS.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PacketPeerDTLS.kt index d9825d66e..bfccfc901 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PacketPeerDTLS.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PacketPeerDTLS.kt @@ -24,13 +24,14 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * DTLS packet peer. - * - * This class represents a DTLS peer connection. It can be used to connect to a DTLS server, and is returned by [godot.DTLSServer.takeConnection]. - * - * **Note:** When exporting to Android, make sure to enable the `INTERNET` permission in the Android export preset before exporting the project or using one-click deploy. Otherwise, network communication of any kind will be blocked by Android. - * - * **Warning:** TLS certificate revocation and certificate pinning are currently not supported. Revoked certificates are accepted as long as they are otherwise valid. If this is a concern, you may want to use automatically managed certificates with a short validity period. + * This class represents a DTLS peer connection. It can be used to connect to a DTLS server, and is + * returned by [DTLSServer.takeConnection]. + * **Note:** When exporting to Android, make sure to enable the `INTERNET` permission in the Android + * export preset before exporting the project or using one-click deploy. Otherwise, network + * communication of any kind will be blocked by Android. + * **Warning:** TLS certificate revocation and certificate pinning are currently not supported. + * Revoked certificates are accepted as long as they are otherwise valid. If this is a concern, you may + * want to use automatically managed certificates with a short validity period. */ @GodotBaseType public open class PacketPeerDTLS : PacketPeer() { @@ -40,7 +41,8 @@ public open class PacketPeerDTLS : PacketPeer() { } /** - * Poll the connection to check for incoming packets. Call this frequently to update the status and keep the connection working. + * Poll the connection to check for incoming packets. Call this frequently to update the status + * and keep the connection working. */ public fun poll(): Unit { TransferContext.writeArguments() @@ -48,7 +50,10 @@ public open class PacketPeerDTLS : PacketPeer() { } /** - * Connects a [packetPeer] beginning the DTLS handshake using the underlying [godot.PacketPeerUDP] which must be connected (see [godot.PacketPeerUDP.connectToHost]). You can optionally specify the [clientOptions] to be used while verifying the TLS connections. See [godot.TLSOptions.client] and [godot.TLSOptions.clientUnsafe]. + * Connects a [param packet_peer] beginning the DTLS handshake using the underlying + * [PacketPeerUDP] which must be connected (see [PacketPeerUDP.connectToHost]). You can optionally + * specify the [param client_options] to be used while verifying the TLS connections. See + * [TLSOptions.client] and [TLSOptions.clientUnsafe]. */ @JvmOverloads public fun connectToPeer( @@ -82,23 +87,25 @@ public open class PacketPeerDTLS : PacketPeer() { id: Long, ) { /** - * A status representing a [godot.PacketPeerDTLS] that is disconnected. + * A status representing a [PacketPeerDTLS] that is disconnected. */ STATUS_DISCONNECTED(0), /** - * A status representing a [godot.PacketPeerDTLS] that is currently performing the handshake with a remote peer. + * A status representing a [PacketPeerDTLS] that is currently performing the handshake with a + * remote peer. */ STATUS_HANDSHAKING(1), /** - * A status representing a [godot.PacketPeerDTLS] that is connected to a remote peer. + * A status representing a [PacketPeerDTLS] that is connected to a remote peer. */ STATUS_CONNECTED(2), /** - * A status representing a [godot.PacketPeerDTLS] in a generic error state. + * A status representing a [PacketPeerDTLS] in a generic error state. */ STATUS_ERROR(3), /** - * An error status that shows a mismatch in the DTLS certificate domain presented by the host and the domain requested for validation. + * An error status that shows a mismatch in the DTLS certificate domain presented by the host + * and the domain requested for validation. */ STATUS_ERROR_HOSTNAME_MISMATCH(4), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PacketPeerExtension.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PacketPeerExtension.kt index d048f3e06..58c6b7f72 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PacketPeerExtension.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PacketPeerExtension.kt @@ -14,9 +14,6 @@ import kotlin.Int import kotlin.NotImplementedError import kotlin.Suppress -/** - * - */ @GodotBaseType public open class PacketPeerExtension : PacketPeer() { public override fun new(scriptIndex: Int): Boolean { @@ -24,16 +21,10 @@ public open class PacketPeerExtension : PacketPeer() { return true } - /** - * - */ public open fun _getAvailablePacketCount(): Int { throw NotImplementedError("_get_available_packet_count is not implemented for PacketPeerExtension") } - /** - * - */ public open fun _getMaxPacketSize(): Int { throw NotImplementedError("_get_max_packet_size is not implemented for PacketPeerExtension") } diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PacketPeerStream.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PacketPeerStream.kt index e03f8cc16..3bca8184f 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PacketPeerStream.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PacketPeerStream.kt @@ -19,17 +19,15 @@ import kotlin.Long import kotlin.Suppress /** - * Wrapper to use a PacketPeer over a StreamPeer. - * - * PacketStreamPeer provides a wrapper for working using packets over a stream. This allows for using packet based code with StreamPeers. PacketPeerStream implements a custom protocol over the StreamPeer, so the user should not read or write to the wrapped StreamPeer directly. - * - * **Note:** When exporting to Android, make sure to enable the `INTERNET` permission in the Android export preset before exporting the project or using one-click deploy. Otherwise, network communication of any kind will be blocked by Android. + * PacketStreamPeer provides a wrapper for working using packets over a stream. This allows for + * using packet based code with StreamPeers. PacketPeerStream implements a custom protocol over the + * StreamPeer, so the user should not read or write to the wrapped StreamPeer directly. + * **Note:** When exporting to Android, make sure to enable the `INTERNET` permission in the Android + * export preset before exporting the project or using one-click deploy. Otherwise, network + * communication of any kind will be blocked by Android. */ @GodotBaseType public open class PacketPeerStream : PacketPeer() { - /** - * - */ public var inputBufferMaxSize: Int get() { TransferContext.writeArguments() @@ -41,9 +39,6 @@ public open class PacketPeerStream : PacketPeer() { TransferContext.callMethod(rawPtr, MethodBindings.setInputBufferMaxSizePtr, NIL) } - /** - * - */ public var outputBufferMaxSize: Int get() { TransferContext.writeArguments() @@ -56,7 +51,7 @@ public open class PacketPeerStream : PacketPeer() { } /** - * The wrapped [godot.StreamPeer] object. + * The wrapped [StreamPeer] object. */ public var streamPeer: StreamPeer? get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Panel.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Panel.kt index 9ed40374a..113295969 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Panel.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Panel.kt @@ -12,12 +12,7 @@ import kotlin.Int import kotlin.Suppress /** - * A GUI control that displays a [godot.StyleBox]. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/523](https://godotengine.org/asset-library/asset/523) - * - * [godot.Panel] is a GUI control that displays a [godot.StyleBox]. See also [godot.PanelContainer]. + * [Panel] is a GUI control that displays a [StyleBox]. See also [PanelContainer]. */ @GodotBaseType public open class Panel : Control() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PanelContainer.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PanelContainer.kt index c7f0df42b..f972268ef 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PanelContainer.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PanelContainer.kt @@ -12,12 +12,8 @@ import kotlin.Int import kotlin.Suppress /** - * A container that keeps its child controls within the area of a [godot.StyleBox]. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/520](https://godotengine.org/asset-library/asset/520) - * - * A container that keeps its child controls within the area of a [godot.StyleBox]. Useful for giving controls an outline. + * A container that keeps its child controls within the area of a [StyleBox]. Useful for giving + * controls an outline. */ @GodotBaseType public open class PanelContainer : Container() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PanoramaSkyMaterial.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PanoramaSkyMaterial.kt index 7ba6ce59d..b15f6d382 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PanoramaSkyMaterial.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PanoramaSkyMaterial.kt @@ -18,18 +18,19 @@ import kotlin.Int import kotlin.Suppress /** - * A material that provides a special texture to a [godot.Sky], usually an HDR panorama. - * - * A resource referenced in a [godot.Sky] that is used to draw a background. [godot.PanoramaSkyMaterial] functions similar to skyboxes in other engines, except it uses an equirectangular sky map instead of a [godot.Cubemap]. - * - * Using an HDR panorama is strongly recommended for accurate, high-quality reflections. Godot supports the Radiance HDR (`.hdr`) and OpenEXR (`.exr`) image formats for this purpose. - * - * You can use [this tool](https://danilw.github.io/GLSL-howto/cubemap_to_panorama_js/cubemap_to_panorama.html) to convert a cubemap to an equirectangular sky map. + * A resource referenced in a [Sky] that is used to draw a background. [PanoramaSkyMaterial] + * functions similar to skyboxes in other engines, except it uses an equirectangular sky map instead of + * a [Cubemap]. + * Using an HDR panorama is strongly recommended for accurate, high-quality reflections. Godot + * supports the Radiance HDR (`.hdr`) and OpenEXR (`.exr`) image formats for this purpose. + * You can use + * [url=https://danilw.github.io/GLSL-howto/cubemap_to_panorama_js/cubemap_to_panorama.html]this + * tool[/url] to convert a cubemap to an equirectangular sky map. */ @GodotBaseType public open class PanoramaSkyMaterial : Material() { /** - * [godot.Texture2D] to be applied to the [godot.PanoramaSkyMaterial]. + * [Texture2D] to be applied to the [PanoramaSkyMaterial]. */ public var panorama: Texture2D? get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ParallaxBackground.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ParallaxBackground.kt index ac204985b..a68c4bf4e 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ParallaxBackground.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ParallaxBackground.kt @@ -22,16 +22,20 @@ import kotlin.Suppress import kotlin.Unit /** - * A node used to create a parallax scrolling background. - * - * A ParallaxBackground uses one or more [godot.ParallaxLayer] child nodes to create a parallax effect. Each [godot.ParallaxLayer] can move at a different speed using [godot.ParallaxLayer.motionOffset]. This creates an illusion of depth in a 2D game. If not used with a [godot.Camera2D], you must manually calculate the [scrollOffset]. - * - * **Note:** Each [godot.ParallaxBackground] is drawn on one specific [godot.Viewport] and cannot be shared between multiple [godot.Viewport]s, see [godot.CanvasLayer.customViewport]. When using multiple [godot.Viewport]s, for example in a split-screen game, you need create an individual [godot.ParallaxBackground] for each [godot.Viewport] you want it to be drawn on. + * A ParallaxBackground uses one or more [ParallaxLayer] child nodes to create a parallax effect. + * Each [ParallaxLayer] can move at a different speed using [ParallaxLayer.motionOffset]. This creates + * an illusion of depth in a 2D game. If not used with a [Camera2D], you must manually calculate the + * [scrollOffset]. + * **Note:** Each [ParallaxBackground] is drawn on one specific [Viewport] and cannot be shared + * between multiple [Viewport]s, see [CanvasLayer.customViewport]. When using multiple [Viewport]s, for + * example in a split-screen game, you need create an individual [ParallaxBackground] for each + * [Viewport] you want it to be drawn on. */ @GodotBaseType public open class ParallaxBackground : CanvasLayer() { /** - * The ParallaxBackground's scroll value. Calculated automatically when using a [godot.Camera2D], but can be used to manually manage scrolling when no camera is present. + * The ParallaxBackground's scroll value. Calculated automatically when using a [Camera2D], but + * can be used to manually manage scrolling when no camera is present. */ @CoreTypeLocalCopy public var scrollOffset: Vector2 @@ -46,7 +50,7 @@ public open class ParallaxBackground : CanvasLayer() { } /** - * The base position offset for all [godot.ParallaxLayer] children. + * The base position offset for all [ParallaxLayer] children. */ @CoreTypeLocalCopy public var scrollBaseOffset: Vector2 @@ -61,7 +65,7 @@ public open class ParallaxBackground : CanvasLayer() { } /** - * The base motion scale for all [godot.ParallaxLayer] children. + * The base motion scale for all [ParallaxLayer] children. */ @CoreTypeLocalCopy public var scrollBaseScale: Vector2 @@ -76,7 +80,8 @@ public open class ParallaxBackground : CanvasLayer() { } /** - * Top-left limits for scrolling to begin. If the camera is outside of this limit, the background will stop scrolling. Must be lower than [scrollLimitEnd] to work. + * Top-left limits for scrolling to begin. If the camera is outside of this limit, the background + * will stop scrolling. Must be lower than [scrollLimitEnd] to work. */ @CoreTypeLocalCopy public var scrollLimitBegin: Vector2 @@ -91,7 +96,8 @@ public open class ParallaxBackground : CanvasLayer() { } /** - * Bottom-right limits for scrolling to end. If the camera is outside of this limit, the background will stop scrolling. Must be higher than [scrollLimitBegin] to work. + * Bottom-right limits for scrolling to end. If the camera is outside of this limit, the + * background will stop scrolling. Must be higher than [scrollLimitBegin] to work. */ @CoreTypeLocalCopy public var scrollLimitEnd: Vector2 @@ -106,7 +112,7 @@ public open class ParallaxBackground : CanvasLayer() { } /** - * If `true`, elements in [godot.ParallaxLayer] child aren't affected by the zoom level of the camera. + * If `true`, elements in [ParallaxLayer] child aren't affected by the zoom level of the camera. */ public var scrollIgnoreCameraZoom: Boolean get() { @@ -125,7 +131,8 @@ public open class ParallaxBackground : CanvasLayer() { } /** - * The ParallaxBackground's scroll value. Calculated automatically when using a [godot.Camera2D], but can be used to manually manage scrolling when no camera is present. + * The ParallaxBackground's scroll value. Calculated automatically when using a [Camera2D], but + * can be used to manually manage scrolling when no camera is present. * * This is a helper function to make dealing with local copies easier. * @@ -149,7 +156,7 @@ public open class ParallaxBackground : CanvasLayer() { /** - * The base position offset for all [godot.ParallaxLayer] children. + * The base position offset for all [ParallaxLayer] children. * * This is a helper function to make dealing with local copies easier. * @@ -174,7 +181,7 @@ public open class ParallaxBackground : CanvasLayer() { /** - * The base motion scale for all [godot.ParallaxLayer] children. + * The base motion scale for all [ParallaxLayer] children. * * This is a helper function to make dealing with local copies easier. * @@ -198,7 +205,8 @@ public open class ParallaxBackground : CanvasLayer() { /** - * Top-left limits for scrolling to begin. If the camera is outside of this limit, the background will stop scrolling. Must be lower than [scrollLimitEnd] to work. + * Top-left limits for scrolling to begin. If the camera is outside of this limit, the background + * will stop scrolling. Must be lower than [scrollLimitEnd] to work. * * This is a helper function to make dealing with local copies easier. * @@ -223,7 +231,8 @@ public open class ParallaxBackground : CanvasLayer() { /** - * Bottom-right limits for scrolling to end. If the camera is outside of this limit, the background will stop scrolling. Must be higher than [scrollLimitBegin] to work. + * Bottom-right limits for scrolling to end. If the camera is outside of this limit, the + * background will stop scrolling. Must be higher than [scrollLimitBegin] to work. * * This is a helper function to make dealing with local copies easier. * diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Path2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Path2D.kt index 7d6afe869..7337d881e 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Path2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Path2D.kt @@ -17,16 +17,15 @@ import kotlin.Int import kotlin.Suppress /** - * Contains a [godot.Curve2D] path for [godot.PathFollow2D] nodes to follow. - * - * Can have [godot.PathFollow2D] child nodes moving along the [godot.Curve2D]. See [godot.PathFollow2D] for more information on usage. - * - * **Note:** The path is considered as relative to the moved nodes (children of [godot.PathFollow2D]). As such, the curve should usually start with a zero vector (`(0, 0)`). + * Can have [PathFollow2D] child nodes moving along the [Curve2D]. See [PathFollow2D] for more + * information on usage. + * **Note:** The path is considered as relative to the moved nodes (children of [PathFollow2D]). As + * such, the curve should usually start with a zero vector (`(0, 0)`). */ @GodotBaseType public open class Path2D : Node2D() { /** - * A [godot.Curve2D] describing the path. + * A [Curve2D] describing the path. */ public var curve: Curve2D? get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Path3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Path3D.kt index 8091e5518..ba0339e8e 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Path3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Path3D.kt @@ -19,11 +19,10 @@ import kotlin.Int import kotlin.Suppress /** - * Contains a [godot.Curve3D] path for [godot.PathFollow3D] nodes to follow. - * - * Can have [godot.PathFollow3D] child nodes moving along the [godot.Curve3D]. See [godot.PathFollow3D] for more information on the usage. - * - * Note that the path is considered as relative to the moved nodes (children of [godot.PathFollow3D]). As such, the curve should usually start with a zero vector `(0, 0, 0)`. + * Can have [PathFollow3D] child nodes moving along the [Curve3D]. See [PathFollow3D] for more + * information on the usage. + * Note that the path is considered as relative to the moved nodes (children of [PathFollow3D]). As + * such, the curve should usually start with a zero vector `(0, 0, 0)`. */ @GodotBaseType public open class Path3D : Node3D() { @@ -33,7 +32,7 @@ public open class Path3D : Node3D() { public val curveChanged: Signal0 by signal() /** - * A [godot.Curve3D] describing the path. + * A [Curve3D] describing the path. */ public var curve: Curve3D? get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PathFollow2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PathFollow2D.kt index 8115b3b1e..1b229f7a0 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PathFollow2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PathFollow2D.kt @@ -20,16 +20,17 @@ import kotlin.Int import kotlin.Suppress /** - * Point sampler for a [godot.Path2D]. - * - * This node takes its parent [godot.Path2D], and returns the coordinates of a point within it, given a distance from the first vertex. - * - * It is useful for making other nodes follow a path, without coding the movement pattern. For that, the nodes must be children of this node. The descendant nodes will then move accordingly when setting the [progress] in this node. + * This node takes its parent [Path2D], and returns the coordinates of a point within it, given a + * distance from the first vertex. + * It is useful for making other nodes follow a path, without coding the movement pattern. For that, + * the nodes must be children of this node. The descendant nodes will then move accordingly when + * setting the [progress] in this node. */ @GodotBaseType public open class PathFollow2D : Node2D() { /** - * The distance along the path, in pixels. Changing this value sets this node's position to a point within the path. + * The distance along the path, in pixels. Changing this value sets this node's position to a + * point within the path. */ public var progress: Float get() { @@ -43,7 +44,9 @@ public open class PathFollow2D : Node2D() { } /** - * The distance along the path as a number in the range 0.0 (for the first vertex) to 1.0 (for the last). This is just another way of expressing the progress within the path, as the offset supplied is multiplied internally by the path's length. + * The distance along the path as a number in the range 0.0 (for the first vertex) to 1.0 (for the + * last). This is just another way of expressing the progress within the path, as the offset supplied + * is multiplied internally by the path's length. */ public var progressRatio: Float get() { @@ -85,7 +88,8 @@ public open class PathFollow2D : Node2D() { } /** - * If `true`, this node rotates to follow the path, with the +X direction facing forward on the path. + * If `true`, this node rotates to follow the path, with the +X direction facing forward on the + * path. */ public var rotates: Boolean get() { @@ -99,11 +103,15 @@ public open class PathFollow2D : Node2D() { } /** - * If `true`, the position between two cached points is interpolated cubically, and linearly otherwise. - * - * The points along the [godot.Curve2D] of the [godot.Path2D] are precomputed before use, for faster calculations. The point at the requested offset is then calculated interpolating between two adjacent cached points. This may present a problem if the curve makes sharp turns, as the cached points may not follow the curve closely enough. - * - * There are two answers to this problem: either increase the number of cached points and increase memory consumption, or make a cubic interpolation between two points at the cost of (slightly) slower calculations. + * If `true`, the position between two cached points is interpolated cubically, and linearly + * otherwise. + * The points along the [Curve2D] of the [Path2D] are precomputed before use, for faster + * calculations. The point at the requested offset is then calculated interpolating between two + * adjacent cached points. This may present a problem if the curve makes sharp turns, as the cached + * points may not follow the curve closely enough. + * There are two answers to this problem: either increase the number of cached points and increase + * memory consumption, or make a cubic interpolation between two points at the cost of (slightly) + * slower calculations. */ public var cubicInterp: Boolean get() { @@ -117,7 +125,8 @@ public open class PathFollow2D : Node2D() { } /** - * If `true`, any offset outside the path's length will wrap around, instead of stopping at the ends. Use it for cyclic paths. + * If `true`, any offset outside the path's length will wrap around, instead of stopping at the + * ends. Use it for cyclic paths. */ public var loop: Boolean get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PathFollow3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PathFollow3D.kt index 801182d1a..bc66972d6 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PathFollow3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PathFollow3D.kt @@ -24,16 +24,17 @@ import kotlin.Long import kotlin.Suppress /** - * Point sampler for a [godot.Path3D]. - * - * This node takes its parent [godot.Path3D], and returns the coordinates of a point within it, given a distance from the first vertex. - * - * It is useful for making other nodes follow a path, without coding the movement pattern. For that, the nodes must be children of this node. The descendant nodes will then move accordingly when setting the [progress] in this node. + * This node takes its parent [Path3D], and returns the coordinates of a point within it, given a + * distance from the first vertex. + * It is useful for making other nodes follow a path, without coding the movement pattern. For that, + * the nodes must be children of this node. The descendant nodes will then move accordingly when + * setting the [progress] in this node. */ @GodotBaseType public open class PathFollow3D : Node3D() { /** - * The distance from the first vertex, measured in 3D units along the path. Changing this value sets this node's position to a point within the path. + * The distance from the first vertex, measured in 3D units along the path. Changing this value + * sets this node's position to a point within the path. */ public var progress: Float get() { @@ -47,7 +48,9 @@ public open class PathFollow3D : Node3D() { } /** - * The distance from the first vertex, considering 0.0 as the first vertex and 1.0 as the last. This is just another way of expressing the progress within the path, as the progress supplied is multiplied internally by the path's length. + * The distance from the first vertex, considering 0.0 as the first vertex and 1.0 as the last. + * This is just another way of expressing the progress within the path, as the progress supplied is + * multiplied internally by the path's length. */ public var progressRatio: Float get() { @@ -89,7 +92,8 @@ public open class PathFollow3D : Node3D() { } /** - * Allows or forbids rotation on one or more axes, depending on the [enum RotationMode] constants being used. + * Allows or forbids rotation on one or more axes, depending on the [enum RotationMode] constants + * being used. */ public var rotationMode: RotationMode get() { @@ -103,7 +107,8 @@ public open class PathFollow3D : Node3D() { } /** - * If `true`, the node moves on the travel path with orienting the +Z axis as forward. See also [godot.Vector3.FORWARD] and [godot.Vector3.MODEL_FRONT]. + * If `true`, the node moves on the travel path with orienting the +Z axis as forward. See also + * [constant Vector3.FORWARD] and [constant Vector3.MODEL_FRONT]. */ public var useModelFront: Boolean get() { @@ -117,11 +122,15 @@ public open class PathFollow3D : Node3D() { } /** - * If `true`, the position between two cached points is interpolated cubically, and linearly otherwise. - * - * The points along the [godot.Curve3D] of the [godot.Path3D] are precomputed before use, for faster calculations. The point at the requested offset is then calculated interpolating between two adjacent cached points. This may present a problem if the curve makes sharp turns, as the cached points may not follow the curve closely enough. - * - * There are two answers to this problem: either increase the number of cached points and increase memory consumption, or make a cubic interpolation between two points at the cost of (slightly) slower calculations. + * If `true`, the position between two cached points is interpolated cubically, and linearly + * otherwise. + * The points along the [Curve3D] of the [Path3D] are precomputed before use, for faster + * calculations. The point at the requested offset is then calculated interpolating between two + * adjacent cached points. This may present a problem if the curve makes sharp turns, as the cached + * points may not follow the curve closely enough. + * There are two answers to this problem: either increase the number of cached points and increase + * memory consumption, or make a cubic interpolation between two points at the cost of (slightly) + * slower calculations. */ public var cubicInterp: Boolean get() { @@ -135,7 +144,8 @@ public open class PathFollow3D : Node3D() { } /** - * If `true`, any offset outside the path's length will wrap around, instead of stopping at the ends. Use it for cyclic paths. + * If `true`, any offset outside the path's length will wrap around, instead of stopping at the + * ends. Use it for cyclic paths. */ public var loop: Boolean get() { @@ -149,7 +159,7 @@ public open class PathFollow3D : Node3D() { } /** - * If `true`, the tilt property of [godot.Curve3D] takes effect. + * If `true`, the tilt property of [Curve3D] takes effect. */ public var tiltEnabled: Boolean get() { @@ -187,7 +197,8 @@ public open class PathFollow3D : Node3D() { */ ROTATION_XYZ(3), /** - * Uses the up vector information in a [godot.Curve3D] to enforce orientation. This rotation mode requires the [godot.Path3D]'s [godot.Curve3D.upVectorEnabled] property to be set to `true`. + * Uses the up vector information in a [Curve3D] to enforce orientation. This rotation mode + * requires the [Path3D]'s [Curve3D.upVectorEnabled] property to be set to `true`. */ ROTATION_ORIENTED(4), ; @@ -204,7 +215,8 @@ public open class PathFollow3D : Node3D() { public companion object { /** - * Correct the [transform]. [rotationMode] implicitly specifies how posture (forward, up and sideway direction) is calculated. + * Correct the [param transform]. [param rotation_mode] implicitly specifies how posture + * (forward, up and sideway direction) is calculated. */ public fun correctPosture(transform: Transform3D, rotationMode: RotationMode): Transform3D { TransferContext.writeArguments(TRANSFORM3D to transform, LONG to rotationMode.id) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Performance.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Performance.kt index 578a6c8bf..8a50e102c 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Performance.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Performance.kt @@ -31,16 +31,16 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * Exposes performance-related data. - * - * This class provides access to a number of different monitors related to performance, such as memory usage, draw calls, and FPS. These are the same as the values displayed in the **Monitor** tab in the editor's **Debugger** panel. By using the [getMonitor] method of this class, you can access this data from your code. - * - * You can add custom monitors using the [addCustomMonitor] method. Custom monitors are available in **Monitor** tab in the editor's **Debugger** panel together with built-in monitors. - * - * **Note:** Some of the built-in monitors are only available in debug mode and will always return `0` when used in a project exported in release mode. - * - * **Note:** Some of the built-in monitors are not updated in real-time for performance reasons, so there may be a delay of up to 1 second between changes. - * + * This class provides access to a number of different monitors related to performance, such as + * memory usage, draw calls, and FPS. These are the same as the values displayed in the **Monitor** tab + * in the editor's **Debugger** panel. By using the [getMonitor] method of this class, you can access + * this data from your code. + * You can add custom monitors using the [addCustomMonitor] method. Custom monitors are available in + * **Monitor** tab in the editor's **Debugger** panel together with built-in monitors. + * **Note:** Some of the built-in monitors are only available in debug mode and will always return + * `0` when used in a project exported in release mode. + * **Note:** Some of the built-in monitors are not updated in real-time for performance reasons, so + * there may be a delay of up to 1 second between changes. * **Note:** Custom monitors do not support negative values. Negative values are clamped to 0. */ @GodotBaseType @@ -51,23 +51,18 @@ public object Performance : Object() { } /** - * Returns the value of one of the available built-in monitors. You should provide one of the [enum Monitor] constants as the argument, like this: - * - * [codeblocks] - * - * [gdscript] + * Returns the value of one of the available built-in monitors. You should provide one of the + * [enum Monitor] constants as the argument, like this: * + * gdscript: + * ```gdscript * print(Performance.get_monitor(Performance.TIME_FPS)) # Prints the FPS to the console. - * - * [/gdscript] - * - * [csharp] - * - * GD.Print(Performance.GetMonitor(Performance.Monitor.TimeFps)); // Prints the FPS to the console. - * - * [/csharp] - * - * [/codeblocks] + * ``` + * csharp: + * ```csharp + * GD.Print(Performance.GetMonitor(Performance.Monitor.TimeFps)); // Prints the FPS to the + * console. + * ``` * * See [getCustomMonitor] to query custom performance monitors' values. */ @@ -78,104 +73,65 @@ public object Performance : Object() { } /** - * Adds a custom monitor with the name [id]. You can specify the category of the monitor using slash delimiters in [id] (for example: `"Game/NumberOfNPCs"`). If there is more than one slash delimiter, then the default category is used. The default category is `"Custom"`. Prints an error if given [id] is already present. - * - * [codeblocks] - * - * [gdscript] + * Adds a custom monitor with the name [param id]. You can specify the category of the monitor + * using slash delimiters in [param id] (for example: `"Game/NumberOfNPCs"`). If there is more than + * one slash delimiter, then the default category is used. The default category is `"Custom"`. Prints + * an error if given [param id] is already present. * + * gdscript: + * ```gdscript * func _ready(): - * * var monitor_value = Callable(self, "get_monitor_value") * - * - * * # Adds monitor with name "MyName" to category "MyCategory". - * * Performance.add_custom_monitor("MyCategory/MyMonitor", monitor_value) * - * - * * # Adds monitor with name "MyName" to category "Custom". - * - * # Note: "MyCategory/MyMonitor" and "MyMonitor" have same name but different IDs, so the code is valid. - * + * # Note: "MyCategory/MyMonitor" and "MyMonitor" have same name but different IDs, so the + * code is valid. * Performance.add_custom_monitor("MyMonitor", monitor_value) * - * - * * # Adds monitor with name "MyName" to category "Custom". - * - * # Note: "MyMonitor" and "Custom/MyMonitor" have same name and same category but different IDs, so the code is valid. - * + * # Note: "MyMonitor" and "Custom/MyMonitor" have same name and same category but different + * IDs, so the code is valid. * Performance.add_custom_monitor("Custom/MyMonitor", monitor_value) * - * - * * # Adds monitor with name "MyCategoryOne/MyCategoryTwo/MyMonitor" to category "Custom". - * * Performance.add_custom_monitor("MyCategoryOne/MyCategoryTwo/MyMonitor", monitor_value) * - * - * * func get_monitor_value(): - * - * return randi() % 25 - * - * [/gdscript] - * - * [csharp] - * + * return randi() % 25 + * ``` + * csharp: + * ```csharp * public override void _Ready() - * * { - * * var monitorValue = new Callable(this, MethodName.GetMonitorValue); * - * - * * // Adds monitor with name "MyName" to category "MyCategory". - * * Performance.AddCustomMonitor("MyCategory/MyMonitor", monitorValue); - * * // Adds monitor with name "MyName" to category "Custom". - * - * // Note: "MyCategory/MyMonitor" and "MyMonitor" have same name but different ids so the code is valid. - * + * // Note: "MyCategory/MyMonitor" and "MyMonitor" have same name but different ids so the + * code is valid. * Performance.AddCustomMonitor("MyMonitor", monitorValue); * - * - * * // Adds monitor with name "MyName" to category "Custom". - * - * // Note: "MyMonitor" and "Custom/MyMonitor" have same name and same category but different ids so the code is valid. - * + * // Note: "MyMonitor" and "Custom/MyMonitor" have same name and same category but different + * ids so the code is valid. * Performance.AddCustomMonitor("Custom/MyMonitor", monitorValue); * - * - * * // Adds monitor with name "MyCategoryOne/MyCategoryTwo/MyMonitor" to category "Custom". - * * Performance.AddCustomMonitor("MyCategoryOne/MyCategoryTwo/MyMonitor", monitorValue); - * * } * - * - * * public int GetMonitorValue() - * * { - * - * return GD.Randi() % 25; - * + * return GD.Randi() % 25; * } + * ``` * - * [/csharp] - * - * [/codeblocks] - * - * The debugger calls the callable to get the value of custom monitor. The callable must return a zero or positive integer or floating-point number. - * + * The debugger calls the callable to get the value of custom monitor. The callable must return a + * zero or positive integer or floating-point number. * Callables are called with arguments supplied in argument array. */ @JvmOverloads @@ -189,7 +145,8 @@ public object Performance : Object() { } /** - * Removes the custom monitor with given [id]. Prints an error if the given [id] is already absent. + * Removes the custom monitor with given [param id]. Prints an error if the given [param id] is + * already absent. */ public fun removeCustomMonitor(id: StringName): Unit { TransferContext.writeArguments(STRING_NAME to id) @@ -197,7 +154,7 @@ public object Performance : Object() { } /** - * Returns `true` if custom monitor with the given [id] is present, `false` otherwise. + * Returns `true` if custom monitor with the given [param id] is present, `false` otherwise. */ public fun hasCustomMonitor(id: StringName): Boolean { TransferContext.writeArguments(STRING_NAME to id) @@ -206,7 +163,9 @@ public object Performance : Object() { } /** - * Returns the value of custom monitor with given [id]. The callable is called to get the value of custom monitor. See also [hasCustomMonitor]. Prints an error if the given [id] is absent. + * Returns the value of custom monitor with given [param id]. The callable is called to get the + * value of custom monitor. See also [hasCustomMonitor]. Prints an error if the given [param id] is + * absent. */ public fun getCustomMonitor(id: StringName): Any? { TransferContext.writeArguments(STRING_NAME to id) @@ -215,7 +174,8 @@ public object Performance : Object() { } /** - * Returns the last tick in which custom monitor was added/removed (in microseconds since the engine started). This is set to [godot.Time.getTicksUsec] when the monitor is updated. + * Returns the last tick in which custom monitor was added/removed (in microseconds since the + * engine started). This is set to [Time.getTicksUsec] when the monitor is updated. */ public fun getMonitorModificationTime(): Long { TransferContext.writeArguments() @@ -224,7 +184,7 @@ public object Performance : Object() { } /** - * Returns the names of active custom monitors in an [godot.Array]. + * Returns the names of active custom monitors in an [Array]. */ public fun getCustomMonitorNames(): VariantArray { TransferContext.writeArguments() @@ -236,7 +196,8 @@ public object Performance : Object() { id: Long, ) { /** - * The number of frames rendered in the last second. This metric is only updated once per second, even if queried more often. *Higher is better.* + * The number of frames rendered in the last second. This metric is only updated once per + * second, even if queried more often. *Higher is better.* */ TIME_FPS(0), /** @@ -248,7 +209,8 @@ public object Performance : Object() { */ TIME_PHYSICS_PROCESS(2), /** - * Time it took to complete one navigation step, in seconds. This includes navigation map updates as well as agent avoidance calculations. *Lower is better.* + * Time it took to complete one navigation step, in seconds. This includes navigation map + * updates as well as agent avoidance calculations. *Lower is better.* */ TIME_NAVIGATION_PROCESS(3), /** @@ -260,7 +222,8 @@ public object Performance : Object() { */ MEMORY_STATIC_MAX(5), /** - * Largest amount of memory the message queue buffer has used, in bytes. The message queue is used for deferred functions calls and notifications. *Lower is better.* + * Largest amount of memory the message queue buffer has used, in bytes. The message queue is + * used for deferred functions calls and notifications. *Lower is better.* */ MEMORY_MESSAGE_BUFFER_MAX(6), /** @@ -272,27 +235,38 @@ public object Performance : Object() { */ OBJECT_RESOURCE_COUNT(8), /** - * Number of nodes currently instantiated in the scene tree. This also includes the root node. *Lower is better.* + * Number of nodes currently instantiated in the scene tree. This also includes the root node. + * *Lower is better.* */ OBJECT_NODE_COUNT(9), /** - * Number of orphan nodes, i.e. nodes which are not parented to a node of the scene tree. *Lower is better.* + * Number of orphan nodes, i.e. nodes which are not parented to a node of the scene tree. *Lower + * is better.* */ OBJECT_ORPHAN_NODE_COUNT(10), /** - * The total number of objects in the last rendered frame. This metric doesn't include culled objects (either via hiding nodes, frustum culling or occlusion culling). *Lower is better.* + * The total number of objects in the last rendered frame. This metric doesn't include culled + * objects (either via hiding nodes, frustum culling or occlusion culling). *Lower is better.* */ RENDER_TOTAL_OBJECTS_IN_FRAME(11), /** - * The total number of vertices or indices rendered in the last rendered frame. This metric doesn't include primitives from culled objects (either via hiding nodes, frustum culling or occlusion culling). Due to the depth prepass and shadow passes, the number of primitives is always higher than the actual number of vertices in the scene (typically double or triple the original vertex count). *Lower is better.* + * The total number of vertices or indices rendered in the last rendered frame. This metric + * doesn't include primitives from culled objects (either via hiding nodes, frustum culling or + * occlusion culling). Due to the depth prepass and shadow passes, the number of primitives is + * always higher than the actual number of vertices in the scene (typically double or triple the + * original vertex count). *Lower is better.* */ RENDER_TOTAL_PRIMITIVES_IN_FRAME(12), /** - * The total number of draw calls performed in the last rendered frame. This metric doesn't include culled objects (either via hiding nodes, frustum culling or occlusion culling), since they do not result in draw calls. *Lower is better.* + * The total number of draw calls performed in the last rendered frame. This metric doesn't + * include culled objects (either via hiding nodes, frustum culling or occlusion culling), since + * they do not result in draw calls. *Lower is better.* */ RENDER_TOTAL_DRAW_CALLS_IN_FRAME(13), /** - * The amount of video memory used (texture and vertex memory combined, in bytes). Since this metric also includes miscellaneous allocations, this value is always greater than the sum of [RENDER_TEXTURE_MEM_USED] and [RENDER_BUFFER_MEM_USED]. *Lower is better.* + * The amount of video memory used (texture and vertex memory combined, in bytes). Since this + * metric also includes miscellaneous allocations, this value is always greater than the sum of + * [constant RENDER_TEXTURE_MEM_USED] and [constant RENDER_BUFFER_MEM_USED]. *Lower is better.* */ RENDER_VIDEO_MEM_USED(14), /** @@ -304,7 +278,7 @@ public object Performance : Object() { */ RENDER_BUFFER_MEM_USED(16), /** - * Number of active [godot.RigidBody2D] nodes in the game. *Lower is better.* + * Number of active [RigidBody2D] nodes in the game. *Lower is better.* */ PHYSICS_2D_ACTIVE_OBJECTS(17), /** @@ -316,7 +290,7 @@ public object Performance : Object() { */ PHYSICS_2D_ISLAND_COUNT(19), /** - * Number of active [godot.RigidBody3D] and [godot.VehicleBody3D] nodes in the game. *Lower is better.* + * Number of active [RigidBody3D] and [VehicleBody3D] nodes in the game. *Lower is better.* */ PHYSICS_3D_ACTIVE_OBJECTS(20), /** @@ -328,43 +302,47 @@ public object Performance : Object() { */ PHYSICS_3D_ISLAND_COUNT(22), /** - * Output latency of the [godot.AudioServer]. Equivalent to calling [godot.AudioServer.getOutputLatency], it is not recommended to call this every frame. + * Output latency of the [AudioServer]. Equivalent to calling [AudioServer.getOutputLatency], it + * is not recommended to call this every frame. */ AUDIO_OUTPUT_LATENCY(23), /** - * Number of active navigation maps in the [godot.NavigationServer3D]. This also includes the two empty default navigation maps created by World2D and World3D. + * Number of active navigation maps in the [NavigationServer3D]. This also includes the two + * empty default navigation maps created by World2D and World3D. */ NAVIGATION_ACTIVE_MAPS(24), /** - * Number of active navigation regions in the [godot.NavigationServer3D]. + * Number of active navigation regions in the [NavigationServer3D]. */ NAVIGATION_REGION_COUNT(25), /** - * Number of active navigation agents processing avoidance in the [godot.NavigationServer3D]. + * Number of active navigation agents processing avoidance in the [NavigationServer3D]. */ NAVIGATION_AGENT_COUNT(26), /** - * Number of active navigation links in the [godot.NavigationServer3D]. + * Number of active navigation links in the [NavigationServer3D]. */ NAVIGATION_LINK_COUNT(27), /** - * Number of navigation mesh polygons in the [godot.NavigationServer3D]. + * Number of navigation mesh polygons in the [NavigationServer3D]. */ NAVIGATION_POLYGON_COUNT(28), /** - * Number of navigation mesh polygon edges in the [godot.NavigationServer3D]. + * Number of navigation mesh polygon edges in the [NavigationServer3D]. */ NAVIGATION_EDGE_COUNT(29), /** - * Number of navigation mesh polygon edges that were merged due to edge key overlap in the [godot.NavigationServer3D]. + * Number of navigation mesh polygon edges that were merged due to edge key overlap in the + * [NavigationServer3D]. */ NAVIGATION_EDGE_MERGE_COUNT(30), /** - * Number of polygon edges that are considered connected by edge proximity [godot.NavigationServer3D]. + * Number of polygon edges that are considered connected by edge proximity [NavigationServer3D]. */ NAVIGATION_EDGE_CONNECTION_COUNT(31), /** - * Number of navigation mesh polygon edges that could not be merged in the [godot.NavigationServer3D]. The edges still may be connected by edge proximity or with links. + * Number of navigation mesh polygon edges that could not be merged in the [NavigationServer3D]. + * The edges still may be connected by edge proximity or with links. */ NAVIGATION_EDGE_FREE_COUNT(32), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicalBone2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicalBone2D.kt index 0ba83297a..50f95ead8 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicalBone2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicalBone2D.kt @@ -22,18 +22,19 @@ import kotlin.Long import kotlin.Suppress /** - * A [godot.RigidBody2D]-derived node used to make [godot.Bone2D]s in a [godot.Skeleton2D] react to physics. - * - * The [godot.PhysicalBone2D] node is a [godot.RigidBody2D]-based node that can be used to make [godot.Bone2D]s in a [godot.Skeleton2D] react to physics. - * - * **Note:** To make the [godot.Bone2D]s visually follow the [godot.PhysicalBone2D] node, use a [godot.SkeletonModification2DPhysicalBones] modification on the [godot.Skeleton2D] parent. - * - * **Note:** The [godot.PhysicalBone2D] node does not automatically create a [godot.Joint2D] node to keep [godot.PhysicalBone2D] nodes together. They must be created manually. For most cases, you want to use a [godot.PinJoint2D] node. The [godot.PhysicalBone2D] node will automatically configure the [godot.Joint2D] node once it's been added as a child node. + * The [PhysicalBone2D] node is a [RigidBody2D]-based node that can be used to make [Bone2D]s in a + * [Skeleton2D] react to physics. + * **Note:** To make the [Bone2D]s visually follow the [PhysicalBone2D] node, use a + * [SkeletonModification2DPhysicalBones] modification on the [Skeleton2D] parent. + * **Note:** The [PhysicalBone2D] node does not automatically create a [Joint2D] node to keep + * [PhysicalBone2D] nodes together. They must be created manually. For most cases, you want to use a + * [PinJoint2D] node. The [PhysicalBone2D] node will automatically configure the [Joint2D] node once + * it's been added as a child node. */ @GodotBaseType public open class PhysicalBone2D : RigidBody2D() { /** - * The [godot.core.NodePath] to the [godot.Bone2D] that this [godot.PhysicalBone2D] should simulate. + * The [NodePath] to the [Bone2D] that this [PhysicalBone2D] should simulate. */ public var bone2dNodepath: NodePath get() { @@ -47,7 +48,7 @@ public open class PhysicalBone2D : RigidBody2D() { } /** - * The index of the [godot.Bone2D] that this [godot.PhysicalBone2D] should simulate. + * The index of the [Bone2D] that this [PhysicalBone2D] should simulate. */ public var bone2dIndex: Int get() { @@ -61,7 +62,9 @@ public open class PhysicalBone2D : RigidBody2D() { } /** - * If `true`, the [godot.PhysicalBone2D] will automatically configure the first [godot.Joint2D] child node. The automatic configuration is limited to setting up the node properties and positioning the [godot.Joint2D]. + * If `true`, the [PhysicalBone2D] will automatically configure the first [Joint2D] child node. + * The automatic configuration is limited to setting up the node properties and positioning the + * [Joint2D]. */ public var autoConfigureJoint: Boolean get() { @@ -75,9 +78,11 @@ public open class PhysicalBone2D : RigidBody2D() { } /** - * If `true`, the [godot.PhysicalBone2D] will start simulating using physics. If `false`, the [godot.PhysicalBone2D] will follow the transform of the [godot.Bone2D] node. - * - * **Note:** To have the [godot.Bone2D]s visually follow the [godot.PhysicalBone2D], use a [godot.SkeletonModification2DPhysicalBones] modification on the [godot.Skeleton2D] node with the [godot.Bone2D] nodes. + * If `true`, the [PhysicalBone2D] will start simulating using physics. If `false`, the + * [PhysicalBone2D] will follow the transform of the [Bone2D] node. + * **Note:** To have the [Bone2D]s visually follow the [PhysicalBone2D], use a + * [SkeletonModification2DPhysicalBones] modification on the [Skeleton2D] node with the [Bone2D] + * nodes. */ public var simulatePhysics: Boolean get() { @@ -91,7 +96,8 @@ public open class PhysicalBone2D : RigidBody2D() { } /** - * If `true`, the [godot.PhysicalBone2D] will keep the transform of the bone it is bound to when simulating physics. + * If `true`, the [PhysicalBone2D] will keep the transform of the bone it is bound to when + * simulating physics. */ public var followBoneWhenSimulating: Boolean get() { @@ -110,7 +116,8 @@ public open class PhysicalBone2D : RigidBody2D() { } /** - * Returns the first [godot.Joint2D] child node, if one exists. This is mainly a helper function to make it easier to get the [godot.Joint2D] that the [godot.PhysicalBone2D] is autoconfiguring. + * Returns the first [Joint2D] child node, if one exists. This is mainly a helper function to make + * it easier to get the [Joint2D] that the [PhysicalBone2D] is autoconfiguring. */ public fun getJoint(): Joint2D? { TransferContext.writeArguments() @@ -119,7 +126,8 @@ public open class PhysicalBone2D : RigidBody2D() { } /** - * Returns a boolean that indicates whether the [godot.PhysicalBone2D] is running and simulating using the Godot 2D physics engine. When `true`, the PhysicalBone2D node is using physics. + * Returns a boolean that indicates whether the [PhysicalBone2D] is running and simulating using + * the Godot 2D physics engine. When `true`, the PhysicalBone2D node is using physics. */ public fun isSimulatingPhysics(): Boolean { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicalBone3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicalBone3D.kt index 6eb91bc39..366edf0ed 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicalBone3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicalBone3D.kt @@ -30,9 +30,8 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * A physics body used to make bones in a [godot.Skeleton3D] react to physics. - * - * The [godot.PhysicalBone3D] node is a physics body that can be used to make bones in a [godot.Skeleton3D] react to physics. + * The [PhysicalBone3D] node is a physics body that can be used to make bones in a [Skeleton3D] + * react to physics. */ @GodotBaseType public open class PhysicalBone3D : PhysicsBody3D() { @@ -140,7 +139,9 @@ public open class PhysicalBone3D : PhysicsBody3D() { } /** - * This is multiplied by the global 3D gravity setting found in **Project > Project Settings > Physics > 3d** to produce the body's gravity. For example, a value of 1 will be normal gravity, 2 will apply double gravity, and 0.5 will apply half gravity to this object. + * This is multiplied by the global 3D gravity setting found in **Project > Project Settings > + * Physics > 3d** to produce the body's gravity. For example, a value of 1 will be normal gravity, 2 + * will apply double gravity, and 0.5 will apply half gravity to this object. */ public var gravityScale: Float get() { @@ -154,7 +155,9 @@ public open class PhysicalBone3D : PhysicsBody3D() { } /** - * If `true`, internal force integration will be disabled (like gravity or air friction) for this body. Other than collision response, the body will only move as determined by the [_integrateForces] function, if defined. + * If `true`, internal force integration will be disabled (like gravity or air friction) for this + * body. Other than collision response, the body will only move as determined by the + * [_integrateForces] function, if defined. */ public var customIntegrator: Boolean get() { @@ -182,9 +185,11 @@ public open class PhysicalBone3D : PhysicsBody3D() { } /** - * Damps the body's movement. By default, the body will use the **Default Linear Damp** in **Project > Project Settings > Physics > 3d** or any value override set by an [godot.Area3D] the body is in. Depending on [linearDampMode], you can set [linearDamp] to be added to or to replace the body's damping value. - * - * See [godot.ProjectSettings.physics/3d/defaultLinearDamp] for more details about damping. + * Damps the body's movement. By default, the body will use the **Default Linear Damp** in + * **Project > Project Settings > Physics > 3d** or any value override set by an [Area3D] the body is + * in. Depending on [linearDampMode], you can set [linearDamp] to be added to or to replace the + * body's damping value. + * See [ProjectSettings.physics/3d/defaultLinearDamp] for more details about damping. */ public var linearDamp: Float get() { @@ -212,9 +217,11 @@ public open class PhysicalBone3D : PhysicsBody3D() { } /** - * Damps the body's rotation. By default, the body will use the **Default Angular Damp** in **Project > Project Settings > Physics > 3d** or any value override set by an [godot.Area3D] the body is in. Depending on [angularDampMode], you can set [angularDamp] to be added to or to replace the body's damping value. - * - * See [godot.ProjectSettings.physics/3d/defaultAngularDamp] for more details about damping. + * Damps the body's rotation. By default, the body will use the **Default Angular Damp** in + * **Project > Project Settings > Physics > 3d** or any value override set by an [Area3D] the body is + * in. Depending on [angularDampMode], you can set [angularDamp] to be added to or to replace the + * body's damping value. + * See [ProjectSettings.physics/3d/defaultAngularDamp] for more details about damping. */ public var angularDamp: Float get() { @@ -228,7 +235,9 @@ public open class PhysicalBone3D : PhysicsBody3D() { } /** - * The body's linear velocity in units per second. Can be used sporadically, but **don't set this every frame**, because physics may run in another thread and runs at a different granularity. Use [_integrateForces] as your process loop for precise control of the body state. + * The body's linear velocity in units per second. Can be used sporadically, but **don't set this + * every frame**, because physics may run in another thread and runs at a different granularity. Use + * [_integrateForces] as your process loop for precise control of the body state. */ @CoreTypeLocalCopy public var linearVelocity: Vector3 @@ -258,7 +267,8 @@ public open class PhysicalBone3D : PhysicsBody3D() { } /** - * If `true`, the body is deactivated when there is no movement, so it will not take part in the simulation until it is awakened by an external force. + * If `true`, the body is deactivated when there is no movement, so it will not take part in the + * simulation until it is awakened by an external force. */ public var canSleep: Boolean get() { @@ -349,7 +359,9 @@ public open class PhysicalBone3D : PhysicsBody3D() { /** - * The body's linear velocity in units per second. Can be used sporadically, but **don't set this every frame**, because physics may run in another thread and runs at a different granularity. Use [_integrateForces] as your process loop for precise control of the body state. + * The body's linear velocity in units per second. Can be used sporadically, but **don't set this + * every frame**, because physics may run in another thread and runs at a different granularity. Use + * [_integrateForces] as your process loop for precise control of the body state. * * This is a helper function to make dealing with local copies easier. * @@ -397,49 +409,37 @@ public open class PhysicalBone3D : PhysicsBody3D() { /** - * Called during physics processing, allowing you to read and safely modify the simulation state for the object. By default, it works in addition to the usual physics behavior, but the [customIntegrator] property allows you to disable the default behavior and do fully custom force integration for a body. + * Called during physics processing, allowing you to read and safely modify the simulation state + * for the object. By default, it works in addition to the usual physics behavior, but the + * [customIntegrator] property allows you to disable the default behavior and do fully custom force + * integration for a body. */ public open fun _integrateForces(state: PhysicsDirectBodyState3D): Unit { } - /** - * - */ public fun applyCentralImpulse(impulse: Vector3): Unit { TransferContext.writeArguments(VECTOR3 to impulse) TransferContext.callMethod(rawPtr, MethodBindings.applyCentralImpulsePtr, NIL) } - /** - * - */ @JvmOverloads public fun applyImpulse(impulse: Vector3, position: Vector3 = Vector3(0, 0, 0)): Unit { TransferContext.writeArguments(VECTOR3 to impulse, VECTOR3 to position) TransferContext.callMethod(rawPtr, MethodBindings.applyImpulsePtr, NIL) } - /** - * - */ public fun getSimulatePhysics(): Boolean { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getSimulatePhysicsPtr, BOOL) return (TransferContext.readReturnValue(BOOL, false) as Boolean) } - /** - * - */ public fun isSimulatingPhysics(): Boolean { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.isSimulatingPhysicsPtr, BOOL) return (TransferContext.readReturnValue(BOOL, false) as Boolean) } - /** - * - */ public fun getBoneId(): Int { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getBoneIdPtr, LONG) @@ -450,7 +450,8 @@ public open class PhysicalBone3D : PhysicsBody3D() { id: Long, ) { /** - * In this mode, the body's damping value is added to any value set in areas or the default value. + * In this mode, the body's damping value is added to any value set in areas or the default + * value. */ DAMP_MODE_COMBINE(0), /** @@ -472,29 +473,11 @@ public open class PhysicalBone3D : PhysicsBody3D() { public enum class JointType( id: Long, ) { - /** - * - */ JOINT_TYPE_NONE(0), - /** - * - */ JOINT_TYPE_PIN(1), - /** - * - */ JOINT_TYPE_CONE(2), - /** - * - */ JOINT_TYPE_HINGE(3), - /** - * - */ JOINT_TYPE_SLIDER(4), - /** - * - */ JOINT_TYPE_6DOF(5), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicalSkyMaterial.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicalSkyMaterial.kt index 5fee5cec4..84cf642ef 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicalSkyMaterial.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicalSkyMaterial.kt @@ -26,18 +26,21 @@ import kotlin.Suppress import kotlin.Unit /** - * A material that defines a sky for a [godot.Sky] resource by a set of physical properties. - * - * The [godot.PhysicalSkyMaterial] uses the Preetham analytic daylight model to draw a sky based on physical properties. This results in a substantially more realistic sky than the [godot.ProceduralSkyMaterial], but it is slightly slower and less flexible. - * - * The [godot.PhysicalSkyMaterial] only supports one sun. The color, energy, and direction of the sun are taken from the first [godot.DirectionalLight3D] in the scene tree. - * - * As it is based on a daylight model, the sky fades to black as the sunset ends. If you want a full day/night cycle, you will have to add a night sky by converting this to a [godot.ShaderMaterial] and adding a night sky directly into the resulting shader. + * The [PhysicalSkyMaterial] uses the Preetham analytic daylight model to draw a sky based on + * physical properties. This results in a substantially more realistic sky than the + * [ProceduralSkyMaterial], but it is slightly slower and less flexible. + * The [PhysicalSkyMaterial] only supports one sun. The color, energy, and direction of the sun are + * taken from the first [DirectionalLight3D] in the scene tree. + * As it is based on a daylight model, the sky fades to black as the sunset ends. If you want a full + * day/night cycle, you will have to add a night sky by converting this to a [ShaderMaterial] and + * adding a night sky directly into the resulting shader. */ @GodotBaseType public open class PhysicalSkyMaterial : Material() { /** - * Controls the strength of the [godot.Rayleigh scattering](https://en.wikipedia.org/wiki/Rayleigh_scattering). Rayleigh scattering results from light colliding with small particles. It is responsible for the blue color of the sky. + * Controls the strength of the [url=https://en.wikipedia.org/wiki/Rayleigh_scattering]Rayleigh + * scattering[/url]. Rayleigh scattering results from light colliding with small particles. It is + * responsible for the blue color of the sky. */ public var rayleighCoefficient: Float get() { @@ -51,7 +54,10 @@ public open class PhysicalSkyMaterial : Material() { } /** - * Controls the [godot.core.Color] of the [godot.Rayleigh scattering](https://en.wikipedia.org/wiki/Rayleigh_scattering). While not physically accurate, this allows for the creation of alien-looking planets. For example, setting this to a red [godot.core.Color] results in a Mars-looking atmosphere with a corresponding blue sunset. + * Controls the [Color] of the [url=https://en.wikipedia.org/wiki/Rayleigh_scattering]Rayleigh + * scattering[/url]. While not physically accurate, this allows for the creation of alien-looking + * planets. For example, setting this to a red [Color] results in a Mars-looking atmosphere with a + * corresponding blue sunset. */ @CoreTypeLocalCopy public var rayleighColor: Color @@ -66,7 +72,9 @@ public open class PhysicalSkyMaterial : Material() { } /** - * Controls the strength of [godot.Mie scattering](https://en.wikipedia.org/wiki/Mie_scattering) for the sky. Mie scattering results from light colliding with larger particles (like water). On earth, Mie scattering results in a whitish color around the sun and horizon. + * Controls the strength of [url=https://en.wikipedia.org/wiki/Mie_scattering]Mie scattering[/url] + * for the sky. Mie scattering results from light colliding with larger particles (like water). On + * earth, Mie scattering results in a whitish color around the sun and horizon. */ public var mieCoefficient: Float get() { @@ -80,7 +88,9 @@ public open class PhysicalSkyMaterial : Material() { } /** - * Controls the direction of the [godot.Mie scattering](https://en.wikipedia.org/wiki/Mie_scattering). A value of `1` means that when light hits a particle it's passing through straight forward. A value of `-1` means that all light is scatter backwards. + * Controls the direction of the [url=https://en.wikipedia.org/wiki/Mie_scattering]Mie + * scattering[/url]. A value of `1` means that when light hits a particle it's passing through + * straight forward. A value of `-1` means that all light is scatter backwards. */ public var mieEccentricity: Float get() { @@ -94,7 +104,9 @@ public open class PhysicalSkyMaterial : Material() { } /** - * Controls the [godot.core.Color] of the [godot.Mie scattering](https://en.wikipedia.org/wiki/Mie_scattering) effect. While not physically accurate, this allows for the creation of alien-looking planets. + * Controls the [Color] of the [url=https://en.wikipedia.org/wiki/Mie_scattering]Mie + * scattering[/url] effect. While not physically accurate, this allows for the creation of + * alien-looking planets. */ @CoreTypeLocalCopy public var mieColor: Color @@ -109,7 +121,8 @@ public open class PhysicalSkyMaterial : Material() { } /** - * Sets the thickness of the atmosphere. High turbidity creates a foggy-looking atmosphere, while a low turbidity results in a clearer atmosphere. + * Sets the thickness of the atmosphere. High turbidity creates a foggy-looking atmosphere, while + * a low turbidity results in a clearer atmosphere. */ public var turbidity: Float get() { @@ -137,7 +150,7 @@ public open class PhysicalSkyMaterial : Material() { } /** - * Modulates the [godot.core.Color] on the bottom half of the sky to represent the ground. + * Modulates the [Color] on the bottom half of the sky to represent the ground. */ @CoreTypeLocalCopy public var groundColor: Color @@ -166,7 +179,8 @@ public open class PhysicalSkyMaterial : Material() { } /** - * If `true`, enables debanding. Debanding adds a small amount of noise which helps reduce banding that appears from the smooth changes in color in the sky. + * If `true`, enables debanding. Debanding adds a small amount of noise which helps reduce banding + * that appears from the smooth changes in color in the sky. */ public var useDebanding: Boolean get() { @@ -180,7 +194,8 @@ public open class PhysicalSkyMaterial : Material() { } /** - * [godot.Texture2D] for the night sky. This is added to the sky, so if it is bright enough, it may be visible during the day. + * [Texture2D] for the night sky. This is added to the sky, so if it is bright enough, it may be + * visible during the day. */ public var nightSky: Texture2D? get() { @@ -199,7 +214,10 @@ public open class PhysicalSkyMaterial : Material() { } /** - * Controls the [godot.core.Color] of the [godot.Rayleigh scattering](https://en.wikipedia.org/wiki/Rayleigh_scattering). While not physically accurate, this allows for the creation of alien-looking planets. For example, setting this to a red [godot.core.Color] results in a Mars-looking atmosphere with a corresponding blue sunset. + * Controls the [Color] of the [url=https://en.wikipedia.org/wiki/Rayleigh_scattering]Rayleigh + * scattering[/url]. While not physically accurate, this allows for the creation of alien-looking + * planets. For example, setting this to a red [Color] results in a Mars-looking atmosphere with a + * corresponding blue sunset. * * This is a helper function to make dealing with local copies easier. * @@ -223,7 +241,9 @@ public open class PhysicalSkyMaterial : Material() { /** - * Controls the [godot.core.Color] of the [godot.Mie scattering](https://en.wikipedia.org/wiki/Mie_scattering) effect. While not physically accurate, this allows for the creation of alien-looking planets. + * Controls the [Color] of the [url=https://en.wikipedia.org/wiki/Mie_scattering]Mie + * scattering[/url] effect. While not physically accurate, this allows for the creation of + * alien-looking planets. * * This is a helper function to make dealing with local copies easier. * @@ -247,7 +267,7 @@ public open class PhysicalSkyMaterial : Material() { /** - * Modulates the [godot.core.Color] on the bottom half of the sky to represent the ground. + * Modulates the [Color] on the bottom half of the sky to represent the ground. * * This is a helper function to make dealing with local copies easier. * diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsBody2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsBody2D.kt index c18abb7a2..1328e9a90 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsBody2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsBody2D.kt @@ -28,12 +28,8 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * Abstract base class for 2D game objects affected by physics. - * - * Tutorials: - * [$DOCS_URL/tutorials/physics/physics_introduction.html]($DOCS_URL/tutorials/physics/physics_introduction.html) - * - * [godot.PhysicsBody2D] is an abstract base class for 2D game objects affected by physics. All 2D physics bodies inherit from it. + * [PhysicsBody2D] is an abstract base class for 2D game objects affected by physics. All 2D physics + * bodies inherit from it. */ @GodotBaseType public open class PhysicsBody2D internal constructor() : CollisionObject2D() { @@ -43,15 +39,17 @@ public open class PhysicsBody2D internal constructor() : CollisionObject2D() { } /** - * Moves the body along the vector [motion]. In order to be frame rate independent in [godot.Node.PhysicsProcess] or [godot.Node.Process], [motion] should be computed using `delta`. - * - * Returns a [godot.KinematicCollision2D], which contains information about the collision when stopped, or when touching another body along the motion. - * - * If [testOnly] is `true`, the body does not move but the would-be collision information is given. - * - * [safeMargin] is the extra margin used for collision recovery (see [godot.CharacterBody2D.safeMargin] for more details). - * - * If [recoveryAsCollision] is `true`, any depenetration from the recovery phase is also reported as a collision; this is used e.g. by [godot.CharacterBody2D] for improving floor detection during floor snapping. + * Moves the body along the vector [param motion]. In order to be frame rate independent in + * [Node.PhysicsProcess] or [Node.Process], [param motion] should be computed using `delta`. + * Returns a [KinematicCollision2D], which contains information about the collision when stopped, + * or when touching another body along the motion. + * If [param test_only] is `true`, the body does not move but the would-be collision information + * is given. + * [param safe_margin] is the extra margin used for collision recovery (see + * [CharacterBody2D.safeMargin] for more details). + * If [param recovery_as_collision] is `true`, any depenetration from the recovery phase is also + * reported as a collision; this is used e.g. by [CharacterBody2D] for improving floor detection + * during floor snapping. */ @JvmOverloads public fun moveAndCollide( @@ -66,15 +64,19 @@ public open class PhysicsBody2D internal constructor() : CollisionObject2D() { } /** - * Checks for collisions without moving the body. In order to be frame rate independent in [godot.Node.PhysicsProcess] or [godot.Node.Process], [motion] should be computed using `delta`. - * - * Virtually sets the node's position, scale and rotation to that of the given [godot.core.Transform2D], then tries to move the body along the vector [motion]. Returns `true` if a collision would stop the body from moving along the whole path. - * - * [collision] is an optional object of type [godot.KinematicCollision2D], which contains additional information about the collision when stopped, or when touching another body along the motion. - * - * [safeMargin] is the extra margin used for collision recovery (see [godot.CharacterBody2D.safeMargin] for more details). - * - * If [recoveryAsCollision] is `true`, any depenetration from the recovery phase is also reported as a collision; this is useful for checking whether the body would *touch* any other bodies. + * Checks for collisions without moving the body. In order to be frame rate independent in + * [Node.PhysicsProcess] or [Node.Process], [param motion] should be computed using `delta`. + * Virtually sets the node's position, scale and rotation to that of the given [Transform2D], then + * tries to move the body along the vector [param motion]. Returns `true` if a collision would stop + * the body from moving along the whole path. + * [param collision] is an optional object of type [KinematicCollision2D], which contains + * additional information about the collision when stopped, or when touching another body along the + * motion. + * [param safe_margin] is the extra margin used for collision recovery (see + * [CharacterBody2D.safeMargin] for more details). + * If [param recovery_as_collision] is `true`, any depenetration from the recovery phase is also + * reported as a collision; this is useful for checking whether the body would *touch* any other + * bodies. */ @JvmOverloads public fun testMove( diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsBody3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsBody3D.kt index 8b7455b88..0dfb58a21 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsBody3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsBody3D.kt @@ -29,14 +29,10 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * Abstract base class for 3D game objects affected by physics. - * - * Tutorials: - * [$DOCS_URL/tutorials/physics/physics_introduction.html]($DOCS_URL/tutorials/physics/physics_introduction.html) - * - * [godot.PhysicsBody3D] is an abstract base class for 3D game objects affected by physics. All 3D physics bodies inherit from it. - * - * **Warning:** With a non-uniform scale, this node will likely not behave as expected. It is advised to keep its scale the same on all axes and adjust its collision shape(s) instead. + * [PhysicsBody3D] is an abstract base class for 3D game objects affected by physics. All 3D physics + * bodies inherit from it. + * **Warning:** With a non-uniform scale, this node will likely not behave as expected. It is + * advised to keep its scale the same on all axes and adjust its collision shape(s) instead. */ @GodotBaseType public open class PhysicsBody3D internal constructor() : CollisionObject3D() { @@ -130,17 +126,18 @@ public open class PhysicsBody3D internal constructor() : CollisionObject3D() { } /** - * Moves the body along the vector [motion]. In order to be frame rate independent in [godot.Node.PhysicsProcess] or [godot.Node.Process], [motion] should be computed using `delta`. - * - * The body will stop if it collides. Returns a [godot.KinematicCollision3D], which contains information about the collision when stopped, or when touching another body along the motion. - * - * If [testOnly] is `true`, the body does not move but the would-be collision information is given. - * - * [safeMargin] is the extra margin used for collision recovery (see [godot.CharacterBody3D.safeMargin] for more details). - * - * If [recoveryAsCollision] is `true`, any depenetration from the recovery phase is also reported as a collision; this is used e.g. by [godot.CharacterBody3D] for improving floor detection during floor snapping. - * - * [maxCollisions] allows to retrieve more than one collision result. + * Moves the body along the vector [param motion]. In order to be frame rate independent in + * [Node.PhysicsProcess] or [Node.Process], [param motion] should be computed using `delta`. + * The body will stop if it collides. Returns a [KinematicCollision3D], which contains information + * about the collision when stopped, or when touching another body along the motion. + * If [param test_only] is `true`, the body does not move but the would-be collision information + * is given. + * [param safe_margin] is the extra margin used for collision recovery (see + * [CharacterBody3D.safeMargin] for more details). + * If [param recovery_as_collision] is `true`, any depenetration from the recovery phase is also + * reported as a collision; this is used e.g. by [CharacterBody3D] for improving floor detection + * during floor snapping. + * [param max_collisions] allows to retrieve more than one collision result. */ @JvmOverloads public fun moveAndCollide( @@ -156,17 +153,20 @@ public open class PhysicsBody3D internal constructor() : CollisionObject3D() { } /** - * Checks for collisions without moving the body. In order to be frame rate independent in [godot.Node.PhysicsProcess] or [godot.Node.Process], [motion] should be computed using `delta`. - * - * Virtually sets the node's position, scale and rotation to that of the given [godot.Transform3D], then tries to move the body along the vector [motion]. Returns `true` if a collision would stop the body from moving along the whole path. - * - * [collision] is an optional object of type [godot.KinematicCollision3D], which contains additional information about the collision when stopped, or when touching another body along the motion. - * - * [safeMargin] is the extra margin used for collision recovery (see [godot.CharacterBody3D.safeMargin] for more details). - * - * If [recoveryAsCollision] is `true`, any depenetration from the recovery phase is also reported as a collision; this is useful for checking whether the body would *touch* any other bodies. - * - * [maxCollisions] allows to retrieve more than one collision result. + * Checks for collisions without moving the body. In order to be frame rate independent in + * [Node.PhysicsProcess] or [Node.Process], [param motion] should be computed using `delta`. + * Virtually sets the node's position, scale and rotation to that of the given [Transform3D], then + * tries to move the body along the vector [param motion]. Returns `true` if a collision would stop + * the body from moving along the whole path. + * [param collision] is an optional object of type [KinematicCollision3D], which contains + * additional information about the collision when stopped, or when touching another body along the + * motion. + * [param safe_margin] is the extra margin used for collision recovery (see + * [CharacterBody3D.safeMargin] for more details). + * If [param recovery_as_collision] is `true`, any depenetration from the recovery phase is also + * reported as a collision; this is useful for checking whether the body would *touch* any other + * bodies. + * [param max_collisions] allows to retrieve more than one collision result. */ @JvmOverloads public fun testMove( diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsDirectBodyState2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsDirectBodyState2D.kt index f8f4e9476..d4ef34b10 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsDirectBodyState2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsDirectBodyState2D.kt @@ -33,12 +33,9 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * Provides direct access to a physics body in the [godot.PhysicsServer2D]. - * - * Tutorials: - * [$DOCS_URL/tutorials/physics/ray-casting.html]($DOCS_URL/tutorials/physics/ray-casting.html) - * - * Provides direct access to a physics body in the [godot.PhysicsServer2D], allowing safe changes to physics properties. This object is passed via the direct state callback of [godot.RigidBody2D], and is intended for changing the direct state of that body. See [godot.RigidBody2D.IntegrateForces]. + * Provides direct access to a physics body in the [PhysicsServer2D], allowing safe changes to + * physics properties. This object is passed via the direct state callback of [RigidBody2D], and is + * intended for changing the direct state of that body. See [RigidBody2D.IntegrateForces]. */ @GodotBaseType public open class PhysicsDirectBodyState2D internal constructor() : Object() { @@ -104,7 +101,8 @@ public open class PhysicsDirectBodyState2D internal constructor() : Object() { } /** - * The body's center of mass position relative to the body's center in the global coordinate system. + * The body's center of mass position relative to the body's center in the global coordinate + * system. */ @CoreTypeLocalCopy public val centerOfMass: Vector2 @@ -237,7 +235,8 @@ public open class PhysicsDirectBodyState2D internal constructor() : Object() { /** - * Returns the body's velocity at the given relative position, including both translation and rotation. + * Returns the body's velocity at the given relative position, including both translation and + * rotation. */ public fun getVelocityAtLocalPosition(localPosition: Vector2): Vector2 { TransferContext.writeArguments(VECTOR2 to localPosition) @@ -247,9 +246,9 @@ public open class PhysicsDirectBodyState2D internal constructor() : Object() { /** * Applies a directional impulse without affecting rotation. - * - * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). - * + * An impulse is time-independent! Applying an impulse every frame would result in a + * framerate-dependent force. For this reason, it should only be used when simulating one-time + * impacts (use the "_force" functions otherwise). * This is equivalent to using [applyImpulse] at the body's center of mass. */ public fun applyCentralImpulse(impulse: Vector2): Unit { @@ -259,10 +258,11 @@ public open class PhysicsDirectBodyState2D internal constructor() : Object() { /** * Applies a rotational impulse to the body without affecting the position. - * - * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). - * - * **Note:** [inverseInertia] is required for this to work. To have [inverseInertia], an active [godot.CollisionShape2D] must be a child of the node, or you can manually set [inverseInertia]. + * An impulse is time-independent! Applying an impulse every frame would result in a + * framerate-dependent force. For this reason, it should only be used when simulating one-time + * impacts (use the "_force" functions otherwise). + * **Note:** [inverseInertia] is required for this to work. To have [inverseInertia], an active + * [CollisionShape2D] must be a child of the node, or you can manually set [inverseInertia]. */ public fun applyTorqueImpulse(impulse: Float): Unit { TransferContext.writeArguments(DOUBLE to impulse.toDouble()) @@ -271,10 +271,10 @@ public open class PhysicsDirectBodyState2D internal constructor() : Object() { /** * Applies a positioned impulse to the body. - * - * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). - * - * [position] is the offset from the body origin in global coordinates. + * An impulse is time-independent! Applying an impulse every frame would result in a + * framerate-dependent force. For this reason, it should only be used when simulating one-time + * impacts (use the "_force" functions otherwise). + * [param position] is the offset from the body origin in global coordinates. */ @JvmOverloads public fun applyImpulse(impulse: Vector2, position: Vector2 = Vector2(0, 0)): Unit { @@ -283,8 +283,8 @@ public open class PhysicsDirectBodyState2D internal constructor() : Object() { } /** - * Applies a directional force without affecting rotation. A force is time dependent and meant to be applied every physics update. - * + * Applies a directional force without affecting rotation. A force is time dependent and meant to + * be applied every physics update. * This is equivalent to using [applyForce] at the body's center of mass. */ @JvmOverloads @@ -294,9 +294,9 @@ public open class PhysicsDirectBodyState2D internal constructor() : Object() { } /** - * Applies a positioned force to the body. A force is time dependent and meant to be applied every physics update. - * - * [position] is the offset from the body origin in global coordinates. + * Applies a positioned force to the body. A force is time dependent and meant to be applied every + * physics update. + * [param position] is the offset from the body origin in global coordinates. */ @JvmOverloads public fun applyForce(force: Vector2, position: Vector2 = Vector2(0, 0)): Unit { @@ -305,9 +305,10 @@ public open class PhysicsDirectBodyState2D internal constructor() : Object() { } /** - * Applies a rotational force without affecting position. A force is time dependent and meant to be applied every physics update. - * - * **Note:** [inverseInertia] is required for this to work. To have [inverseInertia], an active [godot.CollisionShape2D] must be a child of the node, or you can manually set [inverseInertia]. + * Applies a rotational force without affecting position. A force is time dependent and meant to + * be applied every physics update. + * **Note:** [inverseInertia] is required for this to work. To have [inverseInertia], an active + * [CollisionShape2D] must be a child of the node, or you can manually set [inverseInertia]. */ public fun applyTorque(torque: Float): Unit { TransferContext.writeArguments(DOUBLE to torque.toDouble()) @@ -315,8 +316,8 @@ public open class PhysicsDirectBodyState2D internal constructor() : Object() { } /** - * Adds a constant directional force without affecting rotation that keeps being applied over time until cleared with `constant_force = Vector2(0, 0)`. - * + * Adds a constant directional force without affecting rotation that keeps being applied over time + * until cleared with `constant_force = Vector2(0, 0)`. * This is equivalent to using [addConstantForce] at the body's center of mass. */ @JvmOverloads @@ -326,9 +327,9 @@ public open class PhysicsDirectBodyState2D internal constructor() : Object() { } /** - * Adds a constant positioned force to the body that keeps being applied over time until cleared with `constant_force = Vector2(0, 0)`. - * - * [position] is the offset from the body origin in global coordinates. + * Adds a constant positioned force to the body that keeps being applied over time until cleared + * with `constant_force = Vector2(0, 0)`. + * [param position] is the offset from the body origin in global coordinates. */ @JvmOverloads public fun addConstantForce(force: Vector2, position: Vector2 = Vector2(0, 0)): Unit { @@ -337,7 +338,8 @@ public open class PhysicsDirectBodyState2D internal constructor() : Object() { } /** - * Adds a constant rotational force without affecting position that keeps being applied over time until cleared with `constant_torque = 0`. + * Adds a constant rotational force without affecting position that keeps being applied over time + * until cleared with `constant_torque = 0`. */ public fun addConstantTorque(torque: Float): Unit { TransferContext.writeArguments(DOUBLE to torque.toDouble()) @@ -346,7 +348,6 @@ public open class PhysicsDirectBodyState2D internal constructor() : Object() { /** * Sets the body's total constant positional forces applied during each physics update. - * * See [addConstantForce] and [addConstantCentralForce]. */ public fun setConstantForce(force: Vector2): Unit { @@ -356,7 +357,6 @@ public open class PhysicsDirectBodyState2D internal constructor() : Object() { /** * Returns the body's total constant positional forces applied during each physics update. - * * See [addConstantForce] and [addConstantCentralForce]. */ public fun getConstantForce(): Vector2 { @@ -367,7 +367,6 @@ public open class PhysicsDirectBodyState2D internal constructor() : Object() { /** * Sets the body's total constant rotational forces applied during each physics update. - * * See [addConstantTorque]. */ public fun setConstantTorque(torque: Float): Unit { @@ -377,7 +376,6 @@ public open class PhysicsDirectBodyState2D internal constructor() : Object() { /** * Returns the body's total constant rotational forces applied during each physics update. - * * See [addConstantTorque]. */ public fun getConstantTorque(): Float { @@ -388,8 +386,8 @@ public open class PhysicsDirectBodyState2D internal constructor() : Object() { /** * Returns the number of contacts this body has with other bodies. - * - * **Note:** By default, this returns 0 unless bodies are configured to monitor contacts. See [godot.RigidBody2D.contactMonitor]. + * **Note:** By default, this returns 0 unless bodies are configured to monitor contacts. See + * [RigidBody2D.contactMonitor]. */ public fun getContactCount(): Int { TransferContext.writeArguments() @@ -461,7 +459,8 @@ public open class PhysicsDirectBodyState2D internal constructor() : Object() { } /** - * Returns the collider object. This depends on how it was created (will return a scene node if such was used to create it). + * Returns the collider object. This depends on how it was created (will return a scene node if + * such was used to create it). */ public fun getContactColliderObject(contactIdx: Int): Object? { TransferContext.writeArguments(LONG to contactIdx.toLong()) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsDirectBodyState3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsDirectBodyState3D.kt index 3a9405712..27c23b191 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsDirectBodyState3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsDirectBodyState3D.kt @@ -35,12 +35,9 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * Provides direct access to a physics body in the [godot.PhysicsServer3D]. - * - * Tutorials: - * [$DOCS_URL/tutorials/physics/ray-casting.html]($DOCS_URL/tutorials/physics/ray-casting.html) - * - * Provides direct access to a physics body in the [godot.PhysicsServer3D], allowing safe changes to physics properties. This object is passed via the direct state callback of [godot.RigidBody3D], and is intended for changing the direct state of that body. See [godot.RigidBody3D.IntegrateForces]. + * Provides direct access to a physics body in the [PhysicsServer3D], allowing safe changes to + * physics properties. This object is passed via the direct state callback of [RigidBody3D], and is + * intended for changing the direct state of that body. See [RigidBody3D.IntegrateForces]. */ @GodotBaseType public open class PhysicsDirectBodyState3D internal constructor() : Object() { @@ -118,7 +115,8 @@ public open class PhysicsDirectBodyState3D internal constructor() : Object() { } /** - * The body's center of mass position relative to the body's center in the global coordinate system. + * The body's center of mass position relative to the body's center in the global coordinate + * system. */ @CoreTypeLocalCopy public val centerOfMass: Vector3 @@ -139,9 +137,6 @@ public open class PhysicsDirectBodyState3D internal constructor() : Object() { return (TransferContext.readReturnValue(VECTOR3, false) as Vector3) } - /** - * - */ @CoreTypeLocalCopy public val principalInertiaAxes: Basis get() { @@ -287,7 +282,8 @@ public open class PhysicsDirectBodyState3D internal constructor() : Object() { /** - * Returns the body's velocity at the given relative position, including both translation and rotation. + * Returns the body's velocity at the given relative position, including both translation and + * rotation. */ public fun getVelocityAtLocalPosition(localPosition: Vector3): Vector3 { TransferContext.writeArguments(VECTOR3 to localPosition) @@ -297,9 +293,9 @@ public open class PhysicsDirectBodyState3D internal constructor() : Object() { /** * Applies a directional impulse without affecting rotation. - * - * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). - * + * An impulse is time-independent! Applying an impulse every frame would result in a + * framerate-dependent force. For this reason, it should only be used when simulating one-time + * impacts (use the "_force" functions otherwise). * This is equivalent to using [applyImpulse] at the body's center of mass. */ @JvmOverloads @@ -310,10 +306,10 @@ public open class PhysicsDirectBodyState3D internal constructor() : Object() { /** * Applies a positioned impulse to the body. - * - * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). - * - * [position] is the offset from the body origin in global coordinates. + * An impulse is time-independent! Applying an impulse every frame would result in a + * framerate-dependent force. For this reason, it should only be used when simulating one-time + * impacts (use the "_force" functions otherwise). + * [param position] is the offset from the body origin in global coordinates. */ @JvmOverloads public fun applyImpulse(impulse: Vector3, position: Vector3 = Vector3(0, 0, 0)): Unit { @@ -323,10 +319,11 @@ public open class PhysicsDirectBodyState3D internal constructor() : Object() { /** * Applies a rotational impulse to the body without affecting the position. - * - * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). - * - * **Note:** [inverseInertia] is required for this to work. To have [inverseInertia], an active [godot.CollisionShape3D] must be a child of the node, or you can manually set [inverseInertia]. + * An impulse is time-independent! Applying an impulse every frame would result in a + * framerate-dependent force. For this reason, it should only be used when simulating one-time + * impacts (use the "_force" functions otherwise). + * **Note:** [inverseInertia] is required for this to work. To have [inverseInertia], an active + * [CollisionShape3D] must be a child of the node, or you can manually set [inverseInertia]. */ public fun applyTorqueImpulse(impulse: Vector3): Unit { TransferContext.writeArguments(VECTOR3 to impulse) @@ -334,8 +331,8 @@ public open class PhysicsDirectBodyState3D internal constructor() : Object() { } /** - * Applies a directional force without affecting rotation. A force is time dependent and meant to be applied every physics update. - * + * Applies a directional force without affecting rotation. A force is time dependent and meant to + * be applied every physics update. * This is equivalent to using [applyForce] at the body's center of mass. */ @JvmOverloads @@ -345,9 +342,9 @@ public open class PhysicsDirectBodyState3D internal constructor() : Object() { } /** - * Applies a positioned force to the body. A force is time dependent and meant to be applied every physics update. - * - * [position] is the offset from the body origin in global coordinates. + * Applies a positioned force to the body. A force is time dependent and meant to be applied every + * physics update. + * [param position] is the offset from the body origin in global coordinates. */ @JvmOverloads public fun applyForce(force: Vector3, position: Vector3 = Vector3(0, 0, 0)): Unit { @@ -356,9 +353,10 @@ public open class PhysicsDirectBodyState3D internal constructor() : Object() { } /** - * Applies a rotational force without affecting position. A force is time dependent and meant to be applied every physics update. - * - * **Note:** [inverseInertia] is required for this to work. To have [inverseInertia], an active [godot.CollisionShape3D] must be a child of the node, or you can manually set [inverseInertia]. + * Applies a rotational force without affecting position. A force is time dependent and meant to + * be applied every physics update. + * **Note:** [inverseInertia] is required for this to work. To have [inverseInertia], an active + * [CollisionShape3D] must be a child of the node, or you can manually set [inverseInertia]. */ public fun applyTorque(torque: Vector3): Unit { TransferContext.writeArguments(VECTOR3 to torque) @@ -366,8 +364,8 @@ public open class PhysicsDirectBodyState3D internal constructor() : Object() { } /** - * Adds a constant directional force without affecting rotation that keeps being applied over time until cleared with `constant_force = Vector3(0, 0, 0)`. - * + * Adds a constant directional force without affecting rotation that keeps being applied over time + * until cleared with `constant_force = Vector3(0, 0, 0)`. * This is equivalent to using [addConstantForce] at the body's center of mass. */ @JvmOverloads @@ -377,9 +375,9 @@ public open class PhysicsDirectBodyState3D internal constructor() : Object() { } /** - * Adds a constant positioned force to the body that keeps being applied over time until cleared with `constant_force = Vector3(0, 0, 0)`. - * - * [position] is the offset from the body origin in global coordinates. + * Adds a constant positioned force to the body that keeps being applied over time until cleared + * with `constant_force = Vector3(0, 0, 0)`. + * [param position] is the offset from the body origin in global coordinates. */ @JvmOverloads public fun addConstantForce(force: Vector3, position: Vector3 = Vector3(0, 0, 0)): Unit { @@ -388,7 +386,8 @@ public open class PhysicsDirectBodyState3D internal constructor() : Object() { } /** - * Adds a constant rotational force without affecting position that keeps being applied over time until cleared with `constant_torque = Vector3(0, 0, 0)`. + * Adds a constant rotational force without affecting position that keeps being applied over time + * until cleared with `constant_torque = Vector3(0, 0, 0)`. */ public fun addConstantTorque(torque: Vector3): Unit { TransferContext.writeArguments(VECTOR3 to torque) @@ -397,7 +396,6 @@ public open class PhysicsDirectBodyState3D internal constructor() : Object() { /** * Sets the body's total constant positional forces applied during each physics update. - * * See [addConstantForce] and [addConstantCentralForce]. */ public fun setConstantForce(force: Vector3): Unit { @@ -407,7 +405,6 @@ public open class PhysicsDirectBodyState3D internal constructor() : Object() { /** * Returns the body's total constant positional forces applied during each physics update. - * * See [addConstantForce] and [addConstantCentralForce]. */ public fun getConstantForce(): Vector3 { @@ -418,7 +415,6 @@ public open class PhysicsDirectBodyState3D internal constructor() : Object() { /** * Sets the body's total constant rotational forces applied during each physics update. - * * See [addConstantTorque]. */ public fun setConstantTorque(torque: Vector3): Unit { @@ -428,7 +424,6 @@ public open class PhysicsDirectBodyState3D internal constructor() : Object() { /** * Returns the body's total constant rotational forces applied during each physics update. - * * See [addConstantTorque]. */ public fun getConstantTorque(): Vector3 { @@ -439,8 +434,8 @@ public open class PhysicsDirectBodyState3D internal constructor() : Object() { /** * Returns the number of contacts this body has with other bodies. - * - * **Note:** By default, this returns 0 unless bodies are configured to monitor contacts. See [godot.RigidBody3D.contactMonitor]. + * **Note:** By default, this returns 0 unless bodies are configured to monitor contacts. See + * [RigidBody3D.contactMonitor]. */ public fun getContactCount(): Int { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsDirectBodyState3DExtension.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsDirectBodyState3DExtension.kt index c37a83b4d..7ee3a18f1 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsDirectBodyState3DExtension.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsDirectBodyState3DExtension.kt @@ -22,11 +22,10 @@ import kotlin.Suppress import kotlin.Unit /** - * Provides virtual methods that can be overridden to create custom [godot.PhysicsDirectBodyState3D] implementations. - * - * This class extends [godot.PhysicsDirectBodyState3D] by providing additional virtual methods that can be overridden. When these methods are overridden, they will be called instead of the internal methods of the physics server. - * - * Intended for use with GDExtension to create custom implementations of [godot.PhysicsDirectBodyState3D]. + * This class extends [PhysicsDirectBodyState3D] by providing additional virtual methods that can be + * overridden. When these methods are overridden, they will be called instead of the internal methods + * of the physics server. + * Intended for use with GDExtension to create custom implementations of [PhysicsDirectBodyState3D]. */ @GodotBaseType public open class PhysicsDirectBodyState3DExtension : PhysicsDirectBodyState3D() { @@ -35,308 +34,170 @@ public open class PhysicsDirectBodyState3DExtension : PhysicsDirectBodyState3D() return true } - /** - * - */ public open fun _getTotalGravity(): Vector3 { throw NotImplementedError("_get_total_gravity is not implemented for PhysicsDirectBodyState3DExtension") } - /** - * - */ public open fun _getTotalLinearDamp(): Float { throw NotImplementedError("_get_total_linear_damp is not implemented for PhysicsDirectBodyState3DExtension") } - /** - * - */ public open fun _getTotalAngularDamp(): Float { throw NotImplementedError("_get_total_angular_damp is not implemented for PhysicsDirectBodyState3DExtension") } - /** - * - */ public open fun _getCenterOfMass(): Vector3 { throw NotImplementedError("_get_center_of_mass is not implemented for PhysicsDirectBodyState3DExtension") } - /** - * - */ public open fun _getCenterOfMassLocal(): Vector3 { throw NotImplementedError("_get_center_of_mass_local is not implemented for PhysicsDirectBodyState3DExtension") } - /** - * - */ public open fun _getPrincipalInertiaAxes(): Basis { throw NotImplementedError("_get_principal_inertia_axes is not implemented for PhysicsDirectBodyState3DExtension") } - /** - * - */ public open fun _getInverseMass(): Float { throw NotImplementedError("_get_inverse_mass is not implemented for PhysicsDirectBodyState3DExtension") } - /** - * - */ public open fun _getInverseInertia(): Vector3 { throw NotImplementedError("_get_inverse_inertia is not implemented for PhysicsDirectBodyState3DExtension") } - /** - * - */ public open fun _getInverseInertiaTensor(): Basis { throw NotImplementedError("_get_inverse_inertia_tensor is not implemented for PhysicsDirectBodyState3DExtension") } - /** - * - */ public open fun _setLinearVelocity(velocity: Vector3): Unit { } - /** - * - */ public open fun _getLinearVelocity(): Vector3 { throw NotImplementedError("_get_linear_velocity is not implemented for PhysicsDirectBodyState3DExtension") } - /** - * - */ public open fun _setAngularVelocity(velocity: Vector3): Unit { } - /** - * - */ public open fun _getAngularVelocity(): Vector3 { throw NotImplementedError("_get_angular_velocity is not implemented for PhysicsDirectBodyState3DExtension") } - /** - * - */ public open fun _setTransform(transform: Transform3D): Unit { } - /** - * - */ public open fun _getTransform(): Transform3D { throw NotImplementedError("_get_transform is not implemented for PhysicsDirectBodyState3DExtension") } - /** - * - */ public open fun _getVelocityAtLocalPosition(localPosition: Vector3): Vector3 { throw NotImplementedError("_get_velocity_at_local_position is not implemented for PhysicsDirectBodyState3DExtension") } - /** - * - */ public open fun _applyCentralImpulse(impulse: Vector3): Unit { } - /** - * - */ public open fun _applyImpulse(impulse: Vector3, position: Vector3): Unit { } - /** - * - */ public open fun _applyTorqueImpulse(impulse: Vector3): Unit { } - /** - * - */ public open fun _applyCentralForce(force: Vector3): Unit { } - /** - * - */ public open fun _applyForce(force: Vector3, position: Vector3): Unit { } - /** - * - */ public open fun _applyTorque(torque: Vector3): Unit { } - /** - * - */ public open fun _addConstantCentralForce(force: Vector3): Unit { } - /** - * - */ public open fun _addConstantForce(force: Vector3, position: Vector3): Unit { } - /** - * - */ public open fun _addConstantTorque(torque: Vector3): Unit { } - /** - * - */ public open fun _setConstantForce(force: Vector3): Unit { } - /** - * - */ public open fun _getConstantForce(): Vector3 { throw NotImplementedError("_get_constant_force is not implemented for PhysicsDirectBodyState3DExtension") } - /** - * - */ public open fun _setConstantTorque(torque: Vector3): Unit { } - /** - * - */ public open fun _getConstantTorque(): Vector3 { throw NotImplementedError("_get_constant_torque is not implemented for PhysicsDirectBodyState3DExtension") } - /** - * - */ public open fun _setSleepState(enabled: Boolean): Unit { } - /** - * - */ public open fun _isSleeping(): Boolean { throw NotImplementedError("_is_sleeping is not implemented for PhysicsDirectBodyState3DExtension") } - /** - * - */ public open fun _getContactCount(): Int { throw NotImplementedError("_get_contact_count is not implemented for PhysicsDirectBodyState3DExtension") } - /** - * - */ public open fun _getContactLocalPosition(contactIdx: Int): Vector3 { throw NotImplementedError("_get_contact_local_position is not implemented for PhysicsDirectBodyState3DExtension") } - /** - * - */ public open fun _getContactLocalNormal(contactIdx: Int): Vector3 { throw NotImplementedError("_get_contact_local_normal is not implemented for PhysicsDirectBodyState3DExtension") } - /** - * - */ public open fun _getContactImpulse(contactIdx: Int): Vector3 { throw NotImplementedError("_get_contact_impulse is not implemented for PhysicsDirectBodyState3DExtension") } - /** - * - */ public open fun _getContactLocalShape(contactIdx: Int): Int { throw NotImplementedError("_get_contact_local_shape is not implemented for PhysicsDirectBodyState3DExtension") } - /** - * - */ public open fun _getContactLocalVelocityAtPosition(contactIdx: Int): Vector3 { throw NotImplementedError("_get_contact_local_velocity_at_position is not implemented for PhysicsDirectBodyState3DExtension") } - /** - * - */ public open fun _getContactCollider(contactIdx: Int): RID { throw NotImplementedError("_get_contact_collider is not implemented for PhysicsDirectBodyState3DExtension") } - /** - * - */ public open fun _getContactColliderPosition(contactIdx: Int): Vector3 { throw NotImplementedError("_get_contact_collider_position is not implemented for PhysicsDirectBodyState3DExtension") } - /** - * - */ public open fun _getContactColliderId(contactIdx: Int): Long { throw NotImplementedError("_get_contact_collider_id is not implemented for PhysicsDirectBodyState3DExtension") } - /** - * - */ public open fun _getContactColliderObject(contactIdx: Int): Object? { throw NotImplementedError("_get_contact_collider_object is not implemented for PhysicsDirectBodyState3DExtension") } - /** - * - */ public open fun _getContactColliderShape(contactIdx: Int): Int { throw NotImplementedError("_get_contact_collider_shape is not implemented for PhysicsDirectBodyState3DExtension") } - /** - * - */ public open fun _getContactColliderVelocityAtPosition(contactIdx: Int): Vector3 { throw NotImplementedError("_get_contact_collider_velocity_at_position is not implemented for PhysicsDirectBodyState3DExtension") } - /** - * - */ public open fun _getStep(): Float { throw NotImplementedError("_get_step is not implemented for PhysicsDirectBodyState3DExtension") } - /** - * - */ public open fun _integrateForces(): Unit { } - /** - * - */ public open fun _getSpaceState(): PhysicsDirectSpaceState3D? { throw NotImplementedError("_get_space_state is not implemented for PhysicsDirectBodyState3DExtension") } diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsDirectSpaceState2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsDirectSpaceState2D.kt index 78aaa11f4..52b63e838 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsDirectSpaceState2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsDirectSpaceState2D.kt @@ -26,12 +26,8 @@ import kotlin.Suppress import kotlin.jvm.JvmOverloads /** - * Provides direct access to a physics space in the [godot.PhysicsServer2D]. - * - * Tutorials: - * [$DOCS_URL/tutorials/physics/ray-casting.html]($DOCS_URL/tutorials/physics/ray-casting.html) - * - * Provides direct access to a physics space in the [godot.PhysicsServer2D]. It's used mainly to do queries against objects and areas residing in a given space. + * Provides direct access to a physics space in the [PhysicsServer2D]. It's used mainly to do + * queries against objects and areas residing in a given space. */ @GodotBaseType public open class PhysicsDirectSpaceState2D internal constructor() : Object() { @@ -41,19 +37,17 @@ public open class PhysicsDirectSpaceState2D internal constructor() : Object() { } /** - * Checks whether a point is inside any solid shape. Position and other parameters are defined through [godot.PhysicsPointQueryParameters2D]. The shapes the point is inside of are returned in an array containing dictionaries with the following fields: - * + * Checks whether a point is inside any solid shape. Position and other parameters are defined + * through [PhysicsPointQueryParameters2D]. The shapes the point is inside of are returned in an + * array containing dictionaries with the following fields: * `collider`: The colliding object. - * * `collider_id`: The colliding object's ID. - * * `rid`: The intersecting object's [RID]. - * * `shape`: The shape index of the colliding shape. - * - * The number of intersections can be limited with the [maxResults] parameter, to reduce the processing time. - * - * **Note:** [godot.ConcavePolygonShape2D]s and [godot.CollisionPolygon2D]s in `Segments` build mode are not solid shapes. Therefore, they will not be detected. + * The number of intersections can be limited with the [param max_results] parameter, to reduce + * the processing time. + * **Note:** [ConcavePolygonShape2D]s and [CollisionPolygon2D]s in `Segments` build mode are not + * solid shapes. Therefore, they will not be detected. */ @JvmOverloads public fun intersectPoint(parameters: PhysicsPointQueryParameters2D, maxResults: Int = 32): @@ -64,20 +58,15 @@ public open class PhysicsDirectSpaceState2D internal constructor() : Object() { } /** - * Intersects a ray in a given space. Ray position and other parameters are defined through [godot.PhysicsRayQueryParameters2D]. The returned object is a dictionary with the following fields: - * + * Intersects a ray in a given space. Ray position and other parameters are defined through + * [PhysicsRayQueryParameters2D]. The returned object is a dictionary with the following fields: * `collider`: The colliding object. - * * `collider_id`: The colliding object's ID. - * - * `normal`: The object's surface normal at the intersection point, or `Vector2(0, 0)` if the ray starts inside the shape and [godot.PhysicsRayQueryParameters2D.hitFromInside] is `true`. - * + * `normal`: The object's surface normal at the intersection point, or `Vector2(0, 0)` if the ray + * starts inside the shape and [PhysicsRayQueryParameters2D.hitFromInside] is `true`. * `position`: The intersection point. - * * `rid`: The intersecting object's [RID]. - * * `shape`: The shape index of the colliding shape. - * * If the ray did not intersect anything, then an empty dictionary is returned instead. */ public fun intersectRay(parameters: PhysicsRayQueryParameters2D): Dictionary { @@ -87,17 +76,15 @@ public open class PhysicsDirectSpaceState2D internal constructor() : Object() { } /** - * Checks the intersections of a shape, given through a [godot.PhysicsShapeQueryParameters2D] object, against the space. The intersected shapes are returned in an array containing dictionaries with the following fields: - * + * Checks the intersections of a shape, given through a [PhysicsShapeQueryParameters2D] object, + * against the space. The intersected shapes are returned in an array containing dictionaries with + * the following fields: * `collider`: The colliding object. - * * `collider_id`: The colliding object's ID. - * * `rid`: The intersecting object's [RID]. - * * `shape`: The shape index of the colliding shape. - * - * The number of intersections can be limited with the [maxResults] parameter, to reduce the processing time. + * The number of intersections can be limited with the [param max_results] parameter, to reduce + * the processing time. */ @JvmOverloads public fun intersectShape(parameters: PhysicsShapeQueryParameters2D, maxResults: Int = 32): @@ -108,11 +95,14 @@ public open class PhysicsDirectSpaceState2D internal constructor() : Object() { } /** - * Checks how far a [godot.Shape2D] can move without colliding. All the parameters for the query, including the shape and the motion, are supplied through a [godot.PhysicsShapeQueryParameters2D] object. - * - * Returns an array with the safe and unsafe proportions (between 0 and 1) of the motion. The safe proportion is the maximum fraction of the motion that can be made without a collision. The unsafe proportion is the minimum fraction of the distance that must be moved for a collision. If no collision is detected a result of `[1.0, 1.0]` will be returned. - * - * **Note:** Any [godot.Shape2D]s that the shape is already colliding with e.g. inside of, will be ignored. Use [collideShape] to determine the [godot.Shape2D]s that the shape is already colliding with. + * Checks how far a [Shape2D] can move without colliding. All the parameters for the query, + * including the shape and the motion, are supplied through a [PhysicsShapeQueryParameters2D] object. + * Returns an array with the safe and unsafe proportions (between 0 and 1) of the motion. The safe + * proportion is the maximum fraction of the motion that can be made without a collision. The unsafe + * proportion is the minimum fraction of the distance that must be moved for a collision. If no + * collision is detected a result of `[1.0, 1.0]` will be returned. + * **Note:** Any [Shape2D]s that the shape is already colliding with e.g. inside of, will be + * ignored. Use [collideShape] to determine the [Shape2D]s that the shape is already colliding with. */ public fun castMotion(parameters: PhysicsShapeQueryParameters2D): PackedFloat32Array { TransferContext.writeArguments(OBJECT to parameters) @@ -121,9 +111,13 @@ public open class PhysicsDirectSpaceState2D internal constructor() : Object() { } /** - * Checks the intersections of a shape, given through a [godot.PhysicsShapeQueryParameters2D] object, against the space. The resulting array contains a list of points where the shape intersects another. Like with [intersectShape], the number of returned results can be limited to save processing time. - * - * Returned points are a list of pairs of contact points. For each pair the first one is in the shape passed in [godot.PhysicsShapeQueryParameters2D] object, second one is in the collided shape from the physics space. + * Checks the intersections of a shape, given through a [PhysicsShapeQueryParameters2D] object, + * against the space. The resulting array contains a list of points where the shape intersects + * another. Like with [intersectShape], the number of returned results can be limited to save + * processing time. + * Returned points are a list of pairs of contact points. For each pair the first one is in the + * shape passed in [PhysicsShapeQueryParameters2D] object, second one is in the collided shape from + * the physics space. */ @JvmOverloads public fun collideShape(parameters: PhysicsShapeQueryParameters2D, maxResults: Int = 32): @@ -134,20 +128,17 @@ public open class PhysicsDirectSpaceState2D internal constructor() : Object() { } /** - * Checks the intersections of a shape, given through a [godot.PhysicsShapeQueryParameters2D] object, against the space. If it collides with more than one shape, the nearest one is selected. If the shape did not intersect anything, then an empty dictionary is returned instead. - * - * **Note:** This method does not take into account the `motion` property of the object. The returned object is a dictionary containing the following fields: - * + * Checks the intersections of a shape, given through a [PhysicsShapeQueryParameters2D] object, + * against the space. If it collides with more than one shape, the nearest one is selected. If the + * shape did not intersect anything, then an empty dictionary is returned instead. + * **Note:** This method does not take into account the `motion` property of the object. The + * returned object is a dictionary containing the following fields: * `collider_id`: The colliding object's ID. - * - * `linear_velocity`: The colliding object's velocity [godot.core.Vector2]. If the object is an [godot.Area2D], the result is `(0, 0)`. - * + * `linear_velocity`: The colliding object's velocity [Vector2]. If the object is an [Area2D], the + * result is `(0, 0)`. * `normal`: The object's surface normal at the intersection point. - * * `point`: The intersection point. - * * `rid`: The intersecting object's [RID]. - * * `shape`: The shape index of the colliding shape. */ public fun getRestInfo(parameters: PhysicsShapeQueryParameters2D): Dictionary { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsDirectSpaceState2DExtension.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsDirectSpaceState2DExtension.kt index ced0c3f52..62d3d13e8 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsDirectSpaceState2DExtension.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsDirectSpaceState2DExtension.kt @@ -18,11 +18,11 @@ import kotlin.Int import kotlin.Suppress /** - * Provides virtual methods that can be overridden to create custom [godot.PhysicsDirectSpaceState2D] implementations. - * - * This class extends [godot.PhysicsDirectSpaceState2D] by providing additional virtual methods that can be overridden. When these methods are overridden, they will be called instead of the internal methods of the physics server. - * - * Intended for use with GDExtension to create custom implementations of [godot.PhysicsDirectSpaceState2D]. + * This class extends [PhysicsDirectSpaceState2D] by providing additional virtual methods that can + * be overridden. When these methods are overridden, they will be called instead of the internal + * methods of the physics server. + * Intended for use with GDExtension to create custom implementations of + * [PhysicsDirectSpaceState2D]. */ @GodotBaseType public open class PhysicsDirectSpaceState2DExtension : PhysicsDirectSpaceState2D() { @@ -31,9 +31,6 @@ public open class PhysicsDirectSpaceState2DExtension : PhysicsDirectSpaceState2D return true } - /** - * - */ public fun isBodyExcludedFromQuery(body: RID): Boolean { TransferContext.writeArguments(_RID to body) TransferContext.callMethod(rawPtr, MethodBindings.isBodyExcludedFromQueryPtr, BOOL) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsDirectSpaceState3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsDirectSpaceState3D.kt index 73e24adab..8cdfc759f 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsDirectSpaceState3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsDirectSpaceState3D.kt @@ -26,12 +26,8 @@ import kotlin.Suppress import kotlin.jvm.JvmOverloads /** - * Provides direct access to a physics space in the [godot.PhysicsServer3D]. - * - * Tutorials: - * [$DOCS_URL/tutorials/physics/ray-casting.html]($DOCS_URL/tutorials/physics/ray-casting.html) - * - * Provides direct access to a physics space in the [godot.PhysicsServer3D]. It's used mainly to do queries against objects and areas residing in a given space. + * Provides direct access to a physics space in the [PhysicsServer3D]. It's used mainly to do + * queries against objects and areas residing in a given space. */ @GodotBaseType public open class PhysicsDirectSpaceState3D internal constructor() : Object() { @@ -41,17 +37,15 @@ public open class PhysicsDirectSpaceState3D internal constructor() : Object() { } /** - * Checks whether a point is inside any solid shape. Position and other parameters are defined through [godot.PhysicsPointQueryParameters3D]. The shapes the point is inside of are returned in an array containing dictionaries with the following fields: - * + * Checks whether a point is inside any solid shape. Position and other parameters are defined + * through [PhysicsPointQueryParameters3D]. The shapes the point is inside of are returned in an + * array containing dictionaries with the following fields: * `collider`: The colliding object. - * * `collider_id`: The colliding object's ID. - * * `rid`: The intersecting object's [RID]. - * * `shape`: The shape index of the colliding shape. - * - * The number of intersections can be limited with the [maxResults] parameter, to reduce the processing time. + * The number of intersections can be limited with the [param max_results] parameter, to reduce + * the processing time. */ @JvmOverloads public fun intersectPoint(parameters: PhysicsPointQueryParameters3D, maxResults: Int = 32): @@ -62,24 +56,18 @@ public open class PhysicsDirectSpaceState3D internal constructor() : Object() { } /** - * Intersects a ray in a given space. Ray position and other parameters are defined through [godot.PhysicsRayQueryParameters3D]. The returned object is a dictionary with the following fields: - * + * Intersects a ray in a given space. Ray position and other parameters are defined through + * [PhysicsRayQueryParameters3D]. The returned object is a dictionary with the following fields: * `collider`: The colliding object. - * * `collider_id`: The colliding object's ID. - * - * `normal`: The object's surface normal at the intersection point, or `Vector3(0, 0, 0)` if the ray starts inside the shape and [godot.PhysicsRayQueryParameters3D.hitFromInside] is `true`. - * + * `normal`: The object's surface normal at the intersection point, or `Vector3(0, 0, 0)` if the + * ray starts inside the shape and [PhysicsRayQueryParameters3D.hitFromInside] is `true`. * `position`: The intersection point. - * * `face_index`: The face index at the intersection point. - * - * **Note:** Returns a valid number only if the intersected shape is a [godot.ConcavePolygonShape3D]. Otherwise, `-1` is returned. - * + * **Note:** Returns a valid number only if the intersected shape is a [ConcavePolygonShape3D]. + * Otherwise, `-1` is returned. * `rid`: The intersecting object's [RID]. - * * `shape`: The shape index of the colliding shape. - * * If the ray did not intersect anything, then an empty dictionary is returned instead. */ public fun intersectRay(parameters: PhysicsRayQueryParameters3D): Dictionary { @@ -89,18 +77,15 @@ public open class PhysicsDirectSpaceState3D internal constructor() : Object() { } /** - * Checks the intersections of a shape, given through a [godot.PhysicsShapeQueryParameters3D] object, against the space. The intersected shapes are returned in an array containing dictionaries with the following fields: - * + * Checks the intersections of a shape, given through a [PhysicsShapeQueryParameters3D] object, + * against the space. The intersected shapes are returned in an array containing dictionaries with + * the following fields: * `collider`: The colliding object. - * * `collider_id`: The colliding object's ID. - * * `rid`: The intersecting object's [RID]. - * * `shape`: The shape index of the colliding shape. - * - * The number of intersections can be limited with the [maxResults] parameter, to reduce the processing time. - * + * The number of intersections can be limited with the [param max_results] parameter, to reduce + * the processing time. * **Note:** This method does not take into account the `motion` property of the object. */ @JvmOverloads @@ -112,11 +97,14 @@ public open class PhysicsDirectSpaceState3D internal constructor() : Object() { } /** - * Checks how far a [godot.Shape3D] can move without colliding. All the parameters for the query, including the shape, are supplied through a [godot.PhysicsShapeQueryParameters3D] object. - * - * Returns an array with the safe and unsafe proportions (between 0 and 1) of the motion. The safe proportion is the maximum fraction of the motion that can be made without a collision. The unsafe proportion is the minimum fraction of the distance that must be moved for a collision. If no collision is detected a result of `[1.0, 1.0]` will be returned. - * - * **Note:** Any [godot.Shape3D]s that the shape is already colliding with e.g. inside of, will be ignored. Use [collideShape] to determine the [godot.Shape3D]s that the shape is already colliding with. + * Checks how far a [Shape3D] can move without colliding. All the parameters for the query, + * including the shape, are supplied through a [PhysicsShapeQueryParameters3D] object. + * Returns an array with the safe and unsafe proportions (between 0 and 1) of the motion. The safe + * proportion is the maximum fraction of the motion that can be made without a collision. The unsafe + * proportion is the minimum fraction of the distance that must be moved for a collision. If no + * collision is detected a result of `[1.0, 1.0]` will be returned. + * **Note:** Any [Shape3D]s that the shape is already colliding with e.g. inside of, will be + * ignored. Use [collideShape] to determine the [Shape3D]s that the shape is already colliding with. */ public fun castMotion(parameters: PhysicsShapeQueryParameters3D): PackedFloat32Array { TransferContext.writeArguments(OBJECT to parameters) @@ -125,10 +113,13 @@ public open class PhysicsDirectSpaceState3D internal constructor() : Object() { } /** - * Checks the intersections of a shape, given through a [godot.PhysicsShapeQueryParameters3D] object, against the space. The resulting array contains a list of points where the shape intersects another. Like with [intersectShape], the number of returned results can be limited to save processing time. - * - * Returned points are a list of pairs of contact points. For each pair the first one is in the shape passed in [godot.PhysicsShapeQueryParameters3D] object, second one is in the collided shape from the physics space. - * + * Checks the intersections of a shape, given through a [PhysicsShapeQueryParameters3D] object, + * against the space. The resulting array contains a list of points where the shape intersects + * another. Like with [intersectShape], the number of returned results can be limited to save + * processing time. + * Returned points are a list of pairs of contact points. For each pair the first one is in the + * shape passed in [PhysicsShapeQueryParameters3D] object, second one is in the collided shape from + * the physics space. * **Note:** This method does not take into account the `motion` property of the object. */ @JvmOverloads @@ -140,22 +131,17 @@ public open class PhysicsDirectSpaceState3D internal constructor() : Object() { } /** - * Checks the intersections of a shape, given through a [godot.PhysicsShapeQueryParameters3D] object, against the space. If it collides with more than one shape, the nearest one is selected. The returned object is a dictionary containing the following fields: - * + * Checks the intersections of a shape, given through a [PhysicsShapeQueryParameters3D] object, + * against the space. If it collides with more than one shape, the nearest one is selected. The + * returned object is a dictionary containing the following fields: * `collider_id`: The colliding object's ID. - * - * `linear_velocity`: The colliding object's velocity [godot.core.Vector3]. If the object is an [godot.Area3D], the result is `(0, 0, 0)`. - * + * `linear_velocity`: The colliding object's velocity [Vector3]. If the object is an [Area3D], the + * result is `(0, 0, 0)`. * `normal`: The object's surface normal at the intersection point. - * * `point`: The intersection point. - * * `rid`: The intersecting object's [RID]. - * * `shape`: The shape index of the colliding shape. - * * If the shape did not intersect anything, then an empty dictionary is returned instead. - * * **Note:** This method does not take into account the `motion` property of the object. */ public fun getRestInfo(parameters: PhysicsShapeQueryParameters3D): Dictionary { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsDirectSpaceState3DExtension.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsDirectSpaceState3DExtension.kt index f10d847e7..614e5a39a 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsDirectSpaceState3DExtension.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsDirectSpaceState3DExtension.kt @@ -20,11 +20,11 @@ import kotlin.NotImplementedError import kotlin.Suppress /** - * Provides virtual methods that can be overridden to create custom [godot.PhysicsDirectSpaceState3D] implementations. - * - * This class extends [godot.PhysicsDirectSpaceState3D] by providing additional virtual methods that can be overridden. When these methods are overridden, they will be called instead of the internal methods of the physics server. - * - * Intended for use with GDExtension to create custom implementations of [godot.PhysicsDirectSpaceState3D]. + * This class extends [PhysicsDirectSpaceState3D] by providing additional virtual methods that can + * be overridden. When these methods are overridden, they will be called instead of the internal + * methods of the physics server. + * Intended for use with GDExtension to create custom implementations of + * [PhysicsDirectSpaceState3D]. */ @GodotBaseType public open class PhysicsDirectSpaceState3DExtension : PhysicsDirectSpaceState3D() { @@ -33,16 +33,10 @@ public open class PhysicsDirectSpaceState3DExtension : PhysicsDirectSpaceState3D return true } - /** - * - */ public open fun _getClosestPointToObjectVolume(_object: RID, point: Vector3): Vector3 { throw NotImplementedError("_get_closest_point_to_object_volume is not implemented for PhysicsDirectSpaceState3DExtension") } - /** - * - */ public fun isBodyExcludedFromQuery(body: RID): Boolean { TransferContext.writeArguments(_RID to body) TransferContext.callMethod(rawPtr, MethodBindings.isBodyExcludedFromQueryPtr, BOOL) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsMaterial.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsMaterial.kt index 03b45edf6..4cb1f9478 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsMaterial.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsMaterial.kt @@ -20,9 +20,8 @@ import kotlin.Int import kotlin.Suppress /** - * Holds physics-related properties of a surface, namely its roughness and bounciness. - * - * Holds physics-related properties of a surface, namely its roughness and bounciness. This class is used to apply these properties to a physics body. + * Holds physics-related properties of a surface, namely its roughness and bounciness. This class is + * used to apply these properties to a physics body. */ @GodotBaseType public open class PhysicsMaterial : Resource() { @@ -41,7 +40,10 @@ public open class PhysicsMaterial : Resource() { } /** - * If `true`, the physics engine will use the friction of the object marked as "rough" when two objects collide. If `false`, the physics engine will use the lowest friction of all colliding objects instead. If `true` for both colliding objects, the physics engine will use the highest friction. + * If `true`, the physics engine will use the friction of the object marked as "rough" when two + * objects collide. If `false`, the physics engine will use the lowest friction of all colliding + * objects instead. If `true` for both colliding objects, the physics engine will use the highest + * friction. */ public var rough: Boolean get() { @@ -71,7 +73,8 @@ public open class PhysicsMaterial : Resource() { } /** - * If `true`, subtracts the bounciness from the colliding object's bounciness instead of adding it. + * If `true`, subtracts the bounciness from the colliding object's bounciness instead of adding + * it. */ public var absorbent: Boolean get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsPointQueryParameters2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsPointQueryParameters2D.kt index b4727eb02..7d173d35d 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsPointQueryParameters2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsPointQueryParameters2D.kt @@ -27,9 +27,8 @@ import kotlin.Suppress import kotlin.Unit /** - * Provides parameters for [godot.PhysicsDirectSpaceState2D.intersectPoint]. - * - * By changing various properties of this object, such as the point position, you can configure the parameters for [godot.PhysicsDirectSpaceState2D.intersectPoint]. + * By changing various properties of this object, such as the point position, you can configure the + * parameters for [PhysicsDirectSpaceState2D.intersectPoint]. */ @GodotBaseType public open class PhysicsPointQueryParameters2D : RefCounted() { @@ -49,8 +48,8 @@ public open class PhysicsPointQueryParameters2D : RefCounted() { } /** - * If different from `0`, restricts the query to a specific canvas layer specified by its instance ID. See [godot.Object.getInstanceId]. - * + * If different from `0`, restricts the query to a specific canvas layer specified by its instance + * ID. See [Object.getInstanceId]. * If `0`, restricts the query to the Viewport's default canvas layer. */ public var canvasInstanceId: Long @@ -65,7 +64,10 @@ public open class PhysicsPointQueryParameters2D : RefCounted() { } /** - * The physics layers the query will detect (as a bitmask). By default, all collision layers are detected. See [godot.Collision layers and masks]($DOCS_URL/tutorials/physics/physics_introduction.html#collision-layers-and-masks) in the documentation for more information. + * The physics layers the query will detect (as a bitmask). By default, all collision layers are + * detected. See + * [url=$DOCS_URL/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision + * layers and masks[/url] in the documentation for more information. */ public var collisionMask: Long get() { @@ -79,7 +81,8 @@ public open class PhysicsPointQueryParameters2D : RefCounted() { } /** - * The list of object [RID]s that will be excluded from collisions. Use [godot.CollisionObject2D.getRid] to get the [RID] associated with a [godot.CollisionObject2D]-derived node. + * The list of object [RID]s that will be excluded from collisions. Use [CollisionObject2D.getRid] + * to get the [RID] associated with a [CollisionObject2D]-derived node. */ public var exclude: VariantArray get() { @@ -93,7 +96,7 @@ public open class PhysicsPointQueryParameters2D : RefCounted() { } /** - * If `true`, the query will take [godot.PhysicsBody2D]s into account. + * If `true`, the query will take [PhysicsBody2D]s into account. */ public var collideWithBodies: Boolean get() { @@ -107,7 +110,7 @@ public open class PhysicsPointQueryParameters2D : RefCounted() { } /** - * If `true`, the query will take [godot.Area2D]s into account. + * If `true`, the query will take [Area2D]s into account. */ public var collideWithAreas: Boolean get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsPointQueryParameters3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsPointQueryParameters3D.kt index 9e64ff72e..ff428bf71 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsPointQueryParameters3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsPointQueryParameters3D.kt @@ -27,9 +27,8 @@ import kotlin.Suppress import kotlin.Unit /** - * Provides parameters for [godot.PhysicsDirectSpaceState3D.intersectPoint]. - * - * By changing various properties of this object, such as the point position, you can configure the parameters for [godot.PhysicsDirectSpaceState3D.intersectPoint]. + * By changing various properties of this object, such as the point position, you can configure the + * parameters for [PhysicsDirectSpaceState3D.intersectPoint]. */ @GodotBaseType public open class PhysicsPointQueryParameters3D : RefCounted() { @@ -49,7 +48,10 @@ public open class PhysicsPointQueryParameters3D : RefCounted() { } /** - * The physics layers the query will detect (as a bitmask). By default, all collision layers are detected. See [godot.Collision layers and masks]($DOCS_URL/tutorials/physics/physics_introduction.html#collision-layers-and-masks) in the documentation for more information. + * The physics layers the query will detect (as a bitmask). By default, all collision layers are + * detected. See + * [url=$DOCS_URL/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision + * layers and masks[/url] in the documentation for more information. */ public var collisionMask: Long get() { @@ -63,7 +65,8 @@ public open class PhysicsPointQueryParameters3D : RefCounted() { } /** - * The list of object [RID]s that will be excluded from collisions. Use [godot.CollisionObject3D.getRid] to get the [RID] associated with a [godot.CollisionObject3D]-derived node. + * The list of object [RID]s that will be excluded from collisions. Use [CollisionObject3D.getRid] + * to get the [RID] associated with a [CollisionObject3D]-derived node. */ public var exclude: VariantArray get() { @@ -77,7 +80,7 @@ public open class PhysicsPointQueryParameters3D : RefCounted() { } /** - * If `true`, the query will take [godot.PhysicsBody3D]s into account. + * If `true`, the query will take [PhysicsBody3D]s into account. */ public var collideWithBodies: Boolean get() { @@ -91,7 +94,7 @@ public open class PhysicsPointQueryParameters3D : RefCounted() { } /** - * If `true`, the query will take [godot.Area3D]s into account. + * If `true`, the query will take [Area3D]s into account. */ public var collideWithAreas: Boolean get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsRayQueryParameters2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsRayQueryParameters2D.kt index c6b951cf5..fe41f2e76 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsRayQueryParameters2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsRayQueryParameters2D.kt @@ -29,9 +29,8 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * Provides parameters for [godot.PhysicsDirectSpaceState2D.intersectRay]. - * - * By changing various properties of this object, such as the ray position, you can configure the parameters for [godot.PhysicsDirectSpaceState2D.intersectRay]. + * By changing various properties of this object, such as the ray position, you can configure the + * parameters for [PhysicsDirectSpaceState2D.intersectRay]. */ @GodotBaseType public open class PhysicsRayQueryParameters2D : RefCounted() { @@ -66,7 +65,10 @@ public open class PhysicsRayQueryParameters2D : RefCounted() { } /** - * The physics layers the query will detect (as a bitmask). By default, all collision layers are detected. See [godot.Collision layers and masks]($DOCS_URL/tutorials/physics/physics_introduction.html#collision-layers-and-masks) in the documentation for more information. + * The physics layers the query will detect (as a bitmask). By default, all collision layers are + * detected. See + * [url=$DOCS_URL/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision + * layers and masks[/url] in the documentation for more information. */ public var collisionMask: Long get() { @@ -80,7 +82,8 @@ public open class PhysicsRayQueryParameters2D : RefCounted() { } /** - * The list of object [RID]s that will be excluded from collisions. Use [godot.CollisionObject2D.getRid] to get the [RID] associated with a [godot.CollisionObject2D]-derived node. + * The list of object [RID]s that will be excluded from collisions. Use [CollisionObject2D.getRid] + * to get the [RID] associated with a [CollisionObject2D]-derived node. */ public var exclude: VariantArray get() { @@ -94,7 +97,7 @@ public open class PhysicsRayQueryParameters2D : RefCounted() { } /** - * If `true`, the query will take [godot.PhysicsBody2D]s into account. + * If `true`, the query will take [PhysicsBody2D]s into account. */ public var collideWithBodies: Boolean get() { @@ -108,7 +111,7 @@ public open class PhysicsRayQueryParameters2D : RefCounted() { } /** - * If `true`, the query will take [godot.Area2D]s into account. + * If `true`, the query will take [Area2D]s into account. */ public var collideWithAreas: Boolean get() { @@ -122,7 +125,8 @@ public open class PhysicsRayQueryParameters2D : RefCounted() { } /** - * If `true`, the query will detect a hit when starting inside shapes. In this case the collision normal will be `Vector2(0, 0)`. Does not affect concave polygon shapes. + * If `true`, the query will detect a hit when starting inside shapes. In this case the collision + * normal will be `Vector2(0, 0)`. Does not affect concave polygon shapes. */ public var hitFromInside: Boolean get() { @@ -190,12 +194,13 @@ public open class PhysicsRayQueryParameters2D : RefCounted() { public companion object { /** - * Returns a new, pre-configured [godot.PhysicsRayQueryParameters2D] object. Use it to quickly create query parameters using the most common options. - * - * ``` - * var query = PhysicsRayQueryParameters2D.create(global_position, global_position + Vector2(0, 100)) - * var collision = get_world_2d().direct_space_state.intersect_ray(query) - * ``` + * Returns a new, pre-configured [PhysicsRayQueryParameters2D] object. Use it to quickly create + * query parameters using the most common options. + * [codeblock] + * var query = PhysicsRayQueryParameters2D.create(global_position, global_position + Vector2(0, + * 100)) + * var collision = get_world_2d().direct_space_state.intersect_ray(query) + * [/codeblock] */ @JvmOverloads public fun create( diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsRayQueryParameters3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsRayQueryParameters3D.kt index 150c54d45..699bf57c2 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsRayQueryParameters3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsRayQueryParameters3D.kt @@ -29,9 +29,8 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * Provides parameters for [godot.PhysicsDirectSpaceState3D.intersectRay]. - * - * By changing various properties of this object, such as the ray position, you can configure the parameters for [godot.PhysicsDirectSpaceState3D.intersectRay]. + * By changing various properties of this object, such as the ray position, you can configure the + * parameters for [PhysicsDirectSpaceState3D.intersectRay]. */ @GodotBaseType public open class PhysicsRayQueryParameters3D : RefCounted() { @@ -66,7 +65,10 @@ public open class PhysicsRayQueryParameters3D : RefCounted() { } /** - * The physics layers the query will detect (as a bitmask). By default, all collision layers are detected. See [godot.Collision layers and masks]($DOCS_URL/tutorials/physics/physics_introduction.html#collision-layers-and-masks) in the documentation for more information. + * The physics layers the query will detect (as a bitmask). By default, all collision layers are + * detected. See + * [url=$DOCS_URL/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision + * layers and masks[/url] in the documentation for more information. */ public var collisionMask: Long get() { @@ -80,7 +82,8 @@ public open class PhysicsRayQueryParameters3D : RefCounted() { } /** - * The list of object [RID]s that will be excluded from collisions. Use [godot.CollisionObject3D.getRid] to get the [RID] associated with a [godot.CollisionObject3D]-derived node. + * The list of object [RID]s that will be excluded from collisions. Use [CollisionObject3D.getRid] + * to get the [RID] associated with a [CollisionObject3D]-derived node. */ public var exclude: VariantArray get() { @@ -94,7 +97,7 @@ public open class PhysicsRayQueryParameters3D : RefCounted() { } /** - * If `true`, the query will take [godot.PhysicsBody3D]s into account. + * If `true`, the query will take [PhysicsBody3D]s into account. */ public var collideWithBodies: Boolean get() { @@ -108,7 +111,7 @@ public open class PhysicsRayQueryParameters3D : RefCounted() { } /** - * If `true`, the query will take [godot.Area3D]s into account. + * If `true`, the query will take [Area3D]s into account. */ public var collideWithAreas: Boolean get() { @@ -122,7 +125,8 @@ public open class PhysicsRayQueryParameters3D : RefCounted() { } /** - * If `true`, the query will detect a hit when starting inside shapes. In this case the collision normal will be `Vector3(0, 0, 0)`. Does not affect concave polygon shapes or heightmap shapes. + * If `true`, the query will detect a hit when starting inside shapes. In this case the collision + * normal will be `Vector3(0, 0, 0)`. Does not affect concave polygon shapes or heightmap shapes. */ public var hitFromInside: Boolean get() { @@ -136,7 +140,8 @@ public open class PhysicsRayQueryParameters3D : RefCounted() { } /** - * If `true`, the query will hit back faces with concave polygon shapes with back face enabled or heightmap shapes. + * If `true`, the query will hit back faces with concave polygon shapes with back face enabled or + * heightmap shapes. */ public var hitBackFaces: Boolean get() { @@ -204,12 +209,12 @@ public open class PhysicsRayQueryParameters3D : RefCounted() { public companion object { /** - * Returns a new, pre-configured [godot.PhysicsRayQueryParameters3D] object. Use it to quickly create query parameters using the most common options. - * - * ``` - * var query = PhysicsRayQueryParameters3D.create(position, position + Vector3(0, -10, 0)) - * var collision = get_world_3d().direct_space_state.intersect_ray(query) - * ``` + * Returns a new, pre-configured [PhysicsRayQueryParameters3D] object. Use it to quickly create + * query parameters using the most common options. + * [codeblock] + * var query = PhysicsRayQueryParameters3D.create(position, position + Vector3(0, -10, 0)) + * var collision = get_world_3d().direct_space_state.intersect_ray(query) + * [/codeblock] */ @JvmOverloads public fun create( diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsServer2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsServer2D.kt index 3c3f67100..815af1a82 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsServer2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsServer2D.kt @@ -35,23 +35,33 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * A server interface for low-level 2D physics access. - * - * PhysicsServer2D is the server responsible for all 2D physics. It can directly create and manipulate all physics objects: - * - * - A *space* is a self-contained world for a physics simulation. It contains bodies, areas, and joints. Its state can be queried for collision and intersection information, and several parameters of the simulation can be modified. - * - * - A *shape* is a geometric shape such as a circle, a rectangle, a capsule, or a polygon. It can be used for collision detection by adding it to a body/area, possibly with an extra transformation relative to the body/area's origin. Bodies/areas can have multiple (transformed) shapes added to them, and a single shape can be added to bodies/areas multiple times with different local transformations. - * - * - A *body* is a physical object which can be in static, kinematic, or rigid mode. Its state (such as position and velocity) can be queried and updated. A force integration callback can be set to customize the body's physics. - * - * - An *area* is a region in space which can be used to detect bodies and areas entering and exiting it. A body monitoring callback can be set to report entering/exiting body shapes, and similarly an area monitoring callback can be set. Gravity and damping can be overridden within the area by setting area parameters. - * - * - A *joint* is a constraint, either between two bodies or on one body relative to a point. Parameters such as the joint bias and the rest length of a spring joint can be adjusted. - * - * Physics objects in [godot.PhysicsServer2D] may be created and manipulated independently; they do not have to be tied to nodes in the scene tree. - * - * **Note:** All the 2D physics nodes use the physics server internally. Adding a physics node to the scene tree will cause a corresponding physics object to be created in the physics server. A rigid body node registers a callback that updates the node's transform with the transform of the respective body object in the physics server (every physics update). An area node registers a callback to inform the area node about overlaps with the respective area object in the physics server. The raycast node queries the direct state of the relevant space in the physics server. + * PhysicsServer2D is the server responsible for all 2D physics. It can directly create and + * manipulate all physics objects: + * - A *space* is a self-contained world for a physics simulation. It contains bodies, areas, and + * joints. Its state can be queried for collision and intersection information, and several parameters + * of the simulation can be modified. + * - A *shape* is a geometric shape such as a circle, a rectangle, a capsule, or a polygon. It can + * be used for collision detection by adding it to a body/area, possibly with an extra transformation + * relative to the body/area's origin. Bodies/areas can have multiple (transformed) shapes added to + * them, and a single shape can be added to bodies/areas multiple times with different local + * transformations. + * - A *body* is a physical object which can be in static, kinematic, or rigid mode. Its state (such + * as position and velocity) can be queried and updated. A force integration callback can be set to + * customize the body's physics. + * - An *area* is a region in space which can be used to detect bodies and areas entering and + * exiting it. A body monitoring callback can be set to report entering/exiting body shapes, and + * similarly an area monitoring callback can be set. Gravity and damping can be overridden within the + * area by setting area parameters. + * - A *joint* is a constraint, either between two bodies or on one body relative to a point. + * Parameters such as the joint bias and the rest length of a spring joint can be adjusted. + * Physics objects in [PhysicsServer2D] may be created and manipulated independently; they do not + * have to be tied to nodes in the scene tree. + * **Note:** All the 2D physics nodes use the physics server internally. Adding a physics node to + * the scene tree will cause a corresponding physics object to be created in the physics server. A + * rigid body node registers a callback that updates the node's transform with the transform of the + * respective body object in the physics server (every physics update). An area node registers a + * callback to inform the area node about overlaps with the respective area object in the physics + * server. The raycast node queries the direct state of the relevant space in the physics server. */ @GodotBaseType public object PhysicsServer2D : Object() { @@ -61,7 +71,8 @@ public object PhysicsServer2D : Object() { } /** - * Creates a 2D world boundary shape in the physics server, and returns the [RID] that identifies it. Use [shapeSetData] to set the shape's normal direction and distance properties. + * Creates a 2D world boundary shape in the physics server, and returns the [RID] that identifies + * it. Use [shapeSetData] to set the shape's normal direction and distance properties. */ public fun worldBoundaryShapeCreate(): RID { TransferContext.writeArguments() @@ -70,7 +81,8 @@ public object PhysicsServer2D : Object() { } /** - * Creates a 2D separation ray shape in the physics server, and returns the [RID] that identifies it. Use [shapeSetData] to set the shape's `length` and `slide_on_slope` properties. + * Creates a 2D separation ray shape in the physics server, and returns the [RID] that identifies + * it. Use [shapeSetData] to set the shape's `length` and `slide_on_slope` properties. */ public fun separationRayShapeCreate(): RID { TransferContext.writeArguments() @@ -79,7 +91,8 @@ public object PhysicsServer2D : Object() { } /** - * Creates a 2D segment shape in the physics server, and returns the [RID] that identifies it. Use [shapeSetData] to set the segment's start and end points. + * Creates a 2D segment shape in the physics server, and returns the [RID] that identifies it. Use + * [shapeSetData] to set the segment's start and end points. */ public fun segmentShapeCreate(): RID { TransferContext.writeArguments() @@ -88,7 +101,8 @@ public object PhysicsServer2D : Object() { } /** - * Creates a 2D circle shape in the physics server, and returns the [RID] that identifies it. Use [shapeSetData] to set the circle's radius. + * Creates a 2D circle shape in the physics server, and returns the [RID] that identifies it. Use + * [shapeSetData] to set the circle's radius. */ public fun circleShapeCreate(): RID { TransferContext.writeArguments() @@ -97,7 +111,8 @@ public object PhysicsServer2D : Object() { } /** - * Creates a 2D rectangle shape in the physics server, and returns the [RID] that identifies it. Use [shapeSetData] to set the rectangle's half-extents. + * Creates a 2D rectangle shape in the physics server, and returns the [RID] that identifies it. + * Use [shapeSetData] to set the rectangle's half-extents. */ public fun rectangleShapeCreate(): RID { TransferContext.writeArguments() @@ -106,7 +121,8 @@ public object PhysicsServer2D : Object() { } /** - * Creates a 2D capsule shape in the physics server, and returns the [RID] that identifies it. Use [shapeSetData] to set the capsule's height and radius. + * Creates a 2D capsule shape in the physics server, and returns the [RID] that identifies it. Use + * [shapeSetData] to set the capsule's height and radius. */ public fun capsuleShapeCreate(): RID { TransferContext.writeArguments() @@ -115,7 +131,8 @@ public object PhysicsServer2D : Object() { } /** - * Creates a 2D convex polygon shape in the physics server, and returns the [RID] that identifies it. Use [shapeSetData] to set the convex polygon's points. + * Creates a 2D convex polygon shape in the physics server, and returns the [RID] that identifies + * it. Use [shapeSetData] to set the convex polygon's points. */ public fun convexPolygonShapeCreate(): RID { TransferContext.writeArguments() @@ -124,7 +141,8 @@ public object PhysicsServer2D : Object() { } /** - * Creates a 2D concave polygon shape in the physics server, and returns the [RID] that identifies it. Use [shapeSetData] to set the concave polygon's segments. + * Creates a 2D concave polygon shape in the physics server, and returns the [RID] that identifies + * it. Use [shapeSetData] to set the concave polygon's segments. */ public fun concavePolygonShapeCreate(): RID { TransferContext.writeArguments() @@ -133,25 +151,28 @@ public object PhysicsServer2D : Object() { } /** - * Sets the shape data that defines the configuration of the shape. The [data] to be passed depends on the shape's type (see [shapeGetType]): - * - * - [SHAPE_WORLD_BOUNDARY]: an array of length two containing a [godot.core.Vector2] `normal` direction and a [float] distance `d`, - * - * - [SHAPE_SEPARATION_RAY]: a dictionary containing the key `length` with a [float] value and the key `slide_on_slope` with a [bool] value, - * - * - [SHAPE_SEGMENT]: a [godot.core.Rect2] `rect` containing the first point of the segment in `rect.position` and the second point of the segment in `rect.size`, - * - * - [SHAPE_CIRCLE]: a [float] `radius`, - * - * - [SHAPE_RECTANGLE]: a [godot.core.Vector2] `half_extents`, - * - * - [SHAPE_CAPSULE]: an array of length two (or a [godot.core.Vector2]) containing a [float] `height` and a [float] `radius`, - * - * - [SHAPE_CONVEX_POLYGON]: either a [godot.PackedVector2Array] of points defining a convex polygon in counterclockwise order (the clockwise outward normal of each segment formed by consecutive points is calculated internally), or a [godot.PackedFloat32Array] of length divisible by four so that every 4-tuple of [float]s contains the coordinates of a point followed by the coordinates of the clockwise outward normal vector to the segment between the current point and the next point, - * - * - [SHAPE_CONCAVE_POLYGON]: a [godot.PackedVector2Array] of length divisible by two (each pair of points forms one segment). - * - * **Warning:** In the case of [SHAPE_CONVEX_POLYGON], this method does not check if the points supplied actually form a convex polygon (unlike the [godot.CollisionPolygon2D.polygon] property). + * Sets the shape data that defines the configuration of the shape. The [param data] to be passed + * depends on the shape's type (see [shapeGetType]): + * - [constant SHAPE_WORLD_BOUNDARY]: an array of length two containing a [Vector2] `normal` + * direction and a [float] distance `d`, + * - [constant SHAPE_SEPARATION_RAY]: a dictionary containing the key `length` with a [float] + * value and the key `slide_on_slope` with a [bool] value, + * - [constant SHAPE_SEGMENT]: a [Rect2] `rect` containing the first point of the segment in + * `rect.position` and the second point of the segment in `rect.size`, + * - [constant SHAPE_CIRCLE]: a [float] `radius`, + * - [constant SHAPE_RECTANGLE]: a [Vector2] `half_extents`, + * - [constant SHAPE_CAPSULE]: an array of length two (or a [Vector2]) containing a [float] + * `height` and a [float] `radius`, + * - [constant SHAPE_CONVEX_POLYGON]: either a [PackedVector2Array] of points defining a convex + * polygon in counterclockwise order (the clockwise outward normal of each segment formed by + * consecutive points is calculated internally), or a [PackedFloat32Array] of length divisible by + * four so that every 4-tuple of [float]s contains the coordinates of a point followed by the + * coordinates of the clockwise outward normal vector to the segment between the current point and + * the next point, + * - [constant SHAPE_CONCAVE_POLYGON]: a [PackedVector2Array] of length divisible by two (each + * pair of points forms one segment). + * **Warning:** In the case of [constant SHAPE_CONVEX_POLYGON], this method does not check if the + * points supplied actually form a convex polygon (unlike the [CollisionPolygon2D.polygon] property). */ public fun shapeSetData(shape: RID, `data`: Any?): Unit { TransferContext.writeArguments(_RID to shape, ANY to data) @@ -168,7 +189,9 @@ public object PhysicsServer2D : Object() { } /** - * Returns the shape data that defines the configuration of the shape, such as the half-extents of a rectangle or the segments of a concave shape. See [shapeSetData] for the precise format of this data in each case. + * Returns the shape data that defines the configuration of the shape, such as the half-extents of + * a rectangle or the segments of a concave shape. See [shapeSetData] for the precise format of this + * data in each case. */ public fun shapeGetData(shape: RID): Any? { TransferContext.writeArguments(_RID to shape) @@ -177,7 +200,9 @@ public object PhysicsServer2D : Object() { } /** - * Creates a 2D space in the physics server, and returns the [RID] that identifies it. A space contains bodies and areas, and controls the stepping of the physics simulation of the objects in it. + * Creates a 2D space in the physics server, and returns the [RID] that identifies it. A space + * contains bodies and areas, and controls the stepping of the physics simulation of the objects in + * it. */ public fun spaceCreate(): RID { TransferContext.writeArguments() @@ -186,7 +211,8 @@ public object PhysicsServer2D : Object() { } /** - * Activates or deactivates the space. If [active] is `false`, then the physics server will not do anything with this space in its physics step. + * Activates or deactivates the space. If [param active] is `false`, then the physics server will + * not do anything with this space in its physics step. */ public fun spaceSetActive(space: RID, active: Boolean): Unit { TransferContext.writeArguments(_RID to space, BOOL to active) @@ -203,7 +229,8 @@ public object PhysicsServer2D : Object() { } /** - * Sets the value of the given space parameter. See [enum SpaceParameter] for the list of available parameters. + * Sets the value of the given space parameter. See [enum SpaceParameter] for the list of + * available parameters. */ public fun spaceSetParam( space: RID, @@ -215,7 +242,8 @@ public object PhysicsServer2D : Object() { } /** - * Returns the value of the given space parameter. See [enum SpaceParameter] for the list of available parameters. + * Returns the value of the given space parameter. See [enum SpaceParameter] for the list of + * available parameters. */ public fun spaceGetParam(space: RID, `param`: SpaceParameter): Float { TransferContext.writeArguments(_RID to space, LONG to param.id) @@ -224,7 +252,8 @@ public object PhysicsServer2D : Object() { } /** - * Returns the state of a space, a [godot.PhysicsDirectSpaceState2D]. This object can be used for collision/intersection queries. + * Returns the state of a space, a [PhysicsDirectSpaceState2D]. This object can be used for + * collision/intersection queries. */ public fun spaceGetDirectState(space: RID): PhysicsDirectSpaceState2D? { TransferContext.writeArguments(_RID to space) @@ -233,7 +262,9 @@ public object PhysicsServer2D : Object() { } /** - * Creates a 2D area object in the physics server, and returns the [RID] that identifies it. Use [areaAddShape] to add shapes to it, use [areaSetTransform] to set its transform, and use [areaSetSpace] to add the area to a space. + * Creates a 2D area object in the physics server, and returns the [RID] that identifies it. Use + * [areaAddShape] to add shapes to it, use [areaSetTransform] to set its transform, and use + * [areaSetSpace] to add the area to a space. */ public fun areaCreate(): RID { TransferContext.writeArguments() @@ -242,9 +273,10 @@ public object PhysicsServer2D : Object() { } /** - * Adds the area to the given space, after removing the area from the previously assigned space (if any). - * - * **Note:** To remove an area from a space without immediately adding it back elsewhere, use `PhysicsServer2D.area_set_space(area, RID())`. + * Adds the area to the given space, after removing the area from the previously assigned space + * (if any). + * **Note:** To remove an area from a space without immediately adding it back elsewhere, use + * `PhysicsServer2D.area_set_space(area, RID())`. */ public fun areaSetSpace(area: RID, space: RID): Unit { TransferContext.writeArguments(_RID to area, _RID to space) @@ -252,7 +284,8 @@ public object PhysicsServer2D : Object() { } /** - * Returns the [RID] of the space assigned to the area. Returns an empty [RID] if no space is assigned. + * Returns the [RID] of the space assigned to the area. Returns an empty [RID] if no space is + * assigned. */ public fun areaGetSpace(area: RID): RID { TransferContext.writeArguments(_RID to area) @@ -261,7 +294,9 @@ public object PhysicsServer2D : Object() { } /** - * Adds a shape to the area, with the given local transform. The shape (together with its [transform] and [disabled] properties) is added to an array of shapes, and the shapes of an area are usually referenced by their index in this array. + * Adds a shape to the area, with the given local transform. The shape (together with its [param + * transform] and [param disabled] properties) is added to an array of shapes, and the shapes of an + * area are usually referenced by their index in this array. */ @JvmOverloads public fun areaAddShape( @@ -275,7 +310,8 @@ public object PhysicsServer2D : Object() { } /** - * Replaces the area's shape at the given index by another shape, while not affecting the `transform` and `disabled` properties at the same index. + * Replaces the area's shape at the given index by another shape, while not affecting the + * `transform` and `disabled` properties at the same index. */ public fun areaSetShape( area: RID, @@ -299,7 +335,8 @@ public object PhysicsServer2D : Object() { } /** - * Sets the disabled property of the area's shape with the given index. If [disabled] is `true`, then the shape will not detect any other shapes entering or exiting it. + * Sets the disabled property of the area's shape with the given index. If [param disabled] is + * `true`, then the shape will not detect any other shapes entering or exiting it. */ public fun areaSetShapeDisabled( area: RID, @@ -329,7 +366,8 @@ public object PhysicsServer2D : Object() { } /** - * Returns the local transform matrix of the shape with the given index in the area's array of shapes. + * Returns the local transform matrix of the shape with the given index in the area's array of + * shapes. */ public fun areaGetShapeTransform(area: RID, shapeIdx: Int): Transform2D { TransferContext.writeArguments(_RID to area, LONG to shapeIdx.toLong()) @@ -338,7 +376,10 @@ public object PhysicsServer2D : Object() { } /** - * Removes the shape with the given index from the area's array of shapes. The shape itself is not deleted, so it can continue to be used elsewhere or added back later. As a result of this operation, the area's shapes which used to have indices higher than [shapeIdx] will have their index decreased by one. + * Removes the shape with the given index from the area's array of shapes. The shape itself is not + * deleted, so it can continue to be used elsewhere or added back later. As a result of this + * operation, the area's shapes which used to have indices higher than [param shape_idx] will have + * their index decreased by one. */ public fun areaRemoveShape(area: RID, shapeIdx: Int): Unit { TransferContext.writeArguments(_RID to area, LONG to shapeIdx.toLong()) @@ -346,7 +387,8 @@ public object PhysicsServer2D : Object() { } /** - * Removes all shapes from the area. This does not delete the shapes themselves, so they can continue to be used elsewhere or added back later. + * Removes all shapes from the area. This does not delete the shapes themselves, so they can + * continue to be used elsewhere or added back later. */ public fun areaClearShapes(area: RID): Unit { TransferContext.writeArguments(_RID to area) @@ -388,7 +430,8 @@ public object PhysicsServer2D : Object() { } /** - * Sets the value of the given area parameter. See [enum AreaParameter] for the list of available parameters. + * Sets the value of the given area parameter. See [enum AreaParameter] for the list of available + * parameters. */ public fun areaSetParam( area: RID, @@ -408,7 +451,8 @@ public object PhysicsServer2D : Object() { } /** - * Returns the value of the given area parameter. See [enum AreaParameter] for the list of available parameters. + * Returns the value of the given area parameter. See [enum AreaParameter] for the list of + * available parameters. */ public fun areaGetParam(area: RID, `param`: AreaParameter): Any? { TransferContext.writeArguments(_RID to area, LONG to param.id) @@ -426,7 +470,8 @@ public object PhysicsServer2D : Object() { } /** - * Attaches the `ObjectID` of an [godot.Object] to the area. Use [godot.Object.getInstanceId] to get the `ObjectID` of a [godot.CollisionObject2D]. + * Attaches the `ObjectID` of an [Object] to the area. Use [Object.getInstanceId] to get the + * `ObjectID` of a [CollisionObject2D]. */ public fun areaAttachObjectInstanceId(area: RID, id: Long): Unit { TransferContext.writeArguments(_RID to area, LONG to id) @@ -434,7 +479,8 @@ public object PhysicsServer2D : Object() { } /** - * Returns the `ObjectID` attached to the area. Use [@GlobalScope.instanceFromId] to retrieve an [godot.Object] from a nonzero `ObjectID`. + * Returns the `ObjectID` attached to the area. Use [@GlobalScope.instanceFromId] to retrieve an + * [Object] from a nonzero `ObjectID`. */ public fun areaGetObjectInstanceId(area: RID): Long { TransferContext.writeArguments(_RID to area) @@ -443,7 +489,8 @@ public object PhysicsServer2D : Object() { } /** - * Attaches the `ObjectID` of a canvas to the area. Use [godot.Object.getInstanceId] to get the `ObjectID` of a [godot.CanvasLayer]. + * Attaches the `ObjectID` of a canvas to the area. Use [Object.getInstanceId] to get the + * `ObjectID` of a [CanvasLayer]. */ public fun areaAttachCanvasInstanceId(area: RID, id: Long): Unit { TransferContext.writeArguments(_RID to area, LONG to id) @@ -451,7 +498,8 @@ public object PhysicsServer2D : Object() { } /** - * Returns the `ObjectID` of the canvas attached to the area. Use [@GlobalScope.instanceFromId] to retrieve a [godot.CanvasLayer] from a nonzero `ObjectID`. + * Returns the `ObjectID` of the canvas attached to the area. Use [@GlobalScope.instanceFromId] to + * retrieve a [CanvasLayer] from a nonzero `ObjectID`. */ public fun areaGetCanvasInstanceId(area: RID): Long { TransferContext.writeArguments(_RID to area) @@ -460,19 +508,18 @@ public object PhysicsServer2D : Object() { } /** - * Sets the area's body monitor callback. This callback will be called when any other (shape of a) body enters or exits (a shape of) the given area, and must take the following five parameters: - * - * 1. an integer `status`: either [AREA_BODY_ADDED] or [AREA_BODY_REMOVED] depending on whether the other body shape entered or exited the area, - * + * Sets the area's body monitor callback. This callback will be called when any other (shape of a) + * body enters or exits (a shape of) the given area, and must take the following five parameters: + * 1. an integer `status`: either [constant AREA_BODY_ADDED] or [constant AREA_BODY_REMOVED] + * depending on whether the other body shape entered or exited the area, * 2. an [RID] `body_rid`: the [RID] of the body that entered or exited the area, - * * 3. an integer `instance_id`: the `ObjectID` attached to the body, - * - * 4. an integer `body_shape_idx`: the index of the shape of the body that entered or exited the area, - * - * 5. an integer `self_shape_idx`: the index of the shape of the area where the body entered or exited. - * - * By counting (or keeping track of) the shapes that enter and exit, it can be determined if a body (with all its shapes) is entering for the first time or exiting for the last time. + * 4. an integer `body_shape_idx`: the index of the shape of the body that entered or exited the + * area, + * 5. an integer `self_shape_idx`: the index of the shape of the area where the body entered or + * exited. + * By counting (or keeping track of) the shapes that enter and exit, it can be determined if a + * body (with all its shapes) is entering for the first time or exiting for the last time. */ public fun areaSetMonitorCallback(area: RID, callback: Callable): Unit { TransferContext.writeArguments(_RID to area, CALLABLE to callback) @@ -480,19 +527,18 @@ public object PhysicsServer2D : Object() { } /** - * Sets the area's area monitor callback. This callback will be called when any other (shape of an) area enters or exits (a shape of) the given area, and must take the following five parameters: - * - * 1. an integer `status`: either [AREA_BODY_ADDED] or [AREA_BODY_REMOVED] depending on whether the other area's shape entered or exited the area, - * + * Sets the area's area monitor callback. This callback will be called when any other (shape of + * an) area enters or exits (a shape of) the given area, and must take the following five parameters: + * 1. an integer `status`: either [constant AREA_BODY_ADDED] or [constant AREA_BODY_REMOVED] + * depending on whether the other area's shape entered or exited the area, * 2. an [RID] `area_rid`: the [RID] of the other area that entered or exited the area, - * * 3. an integer `instance_id`: the `ObjectID` attached to the other area, - * - * 4. an integer `area_shape_idx`: the index of the shape of the other area that entered or exited the area, - * - * 5. an integer `self_shape_idx`: the index of the shape of the area where the other area entered or exited. - * - * By counting (or keeping track of) the shapes that enter and exit, it can be determined if an area (with all its shapes) is entering for the first time or exiting for the last time. + * 4. an integer `area_shape_idx`: the index of the shape of the other area that entered or exited + * the area, + * 5. an integer `self_shape_idx`: the index of the shape of the area where the other area entered + * or exited. + * By counting (or keeping track of) the shapes that enter and exit, it can be determined if an + * area (with all its shapes) is entering for the first time or exiting for the last time. */ public fun areaSetAreaMonitorCallback(area: RID, callback: Callable): Unit { TransferContext.writeArguments(_RID to area, CALLABLE to callback) @@ -500,7 +546,8 @@ public object PhysicsServer2D : Object() { } /** - * Sets whether the area is monitorable or not. If [monitorable] is `true`, the area monitoring callback of other areas will be called when this area enters or exits them. + * Sets whether the area is monitorable or not. If [param monitorable] is `true`, the area + * monitoring callback of other areas will be called when this area enters or exits them. */ public fun areaSetMonitorable(area: RID, monitorable: Boolean): Unit { TransferContext.writeArguments(_RID to area, BOOL to monitorable) @@ -508,7 +555,9 @@ public object PhysicsServer2D : Object() { } /** - * Creates a 2D body object in the physics server, and returns the [RID] that identifies it. Use [bodyAddShape] to add shapes to it, use [bodySetState] to set its transform, and use [bodySetSpace] to add the body to a space. + * Creates a 2D body object in the physics server, and returns the [RID] that identifies it. Use + * [bodyAddShape] to add shapes to it, use [bodySetState] to set its transform, and use + * [bodySetSpace] to add the body to a space. */ public fun bodyCreate(): RID { TransferContext.writeArguments() @@ -517,13 +566,15 @@ public object PhysicsServer2D : Object() { } /** - * Adds the body to the given space, after removing the body from the previously assigned space (if any). If the body's mode is set to [BODY_MODE_RIGID], then adding the body to a space will have the following additional effects: - * - * - If the parameter [BODY_PARAM_CENTER_OF_MASS] has never been set explicitly, then the value of that parameter will be recalculated based on the body's shapes. - * - * - If the parameter [BODY_PARAM_INERTIA] is set to a value `<= 0.0`, then the value of that parameter will be recalculated based on the body's shapes, mass, and center of mass. - * - * **Note:** To remove a body from a space without immediately adding it back elsewhere, use `PhysicsServer2D.body_set_space(body, RID())`. + * Adds the body to the given space, after removing the body from the previously assigned space + * (if any). If the body's mode is set to [constant BODY_MODE_RIGID], then adding the body to a space + * will have the following additional effects: + * - If the parameter [constant BODY_PARAM_CENTER_OF_MASS] has never been set explicitly, then the + * value of that parameter will be recalculated based on the body's shapes. + * - If the parameter [constant BODY_PARAM_INERTIA] is set to a value `<= 0.0`, then the value of + * that parameter will be recalculated based on the body's shapes, mass, and center of mass. + * **Note:** To remove a body from a space without immediately adding it back elsewhere, use + * `PhysicsServer2D.body_set_space(body, RID())`. */ public fun bodySetSpace(body: RID, space: RID): Unit { TransferContext.writeArguments(_RID to body, _RID to space) @@ -531,7 +582,8 @@ public object PhysicsServer2D : Object() { } /** - * Returns the [RID] of the space assigned to the body. Returns an empty [RID] if no space is assigned. + * Returns the [RID] of the space assigned to the body. Returns an empty [RID] if no space is + * assigned. */ public fun bodyGetSpace(body: RID): RID { TransferContext.writeArguments(_RID to body) @@ -557,7 +609,9 @@ public object PhysicsServer2D : Object() { } /** - * Adds a shape to the area, with the given local transform. The shape (together with its [transform] and [disabled] properties) is added to an array of shapes, and the shapes of a body are usually referenced by their index in this array. + * Adds a shape to the area, with the given local transform. The shape (together with its [param + * transform] and [param disabled] properties) is added to an array of shapes, and the shapes of a + * body are usually referenced by their index in this array. */ @JvmOverloads public fun bodyAddShape( @@ -571,7 +625,8 @@ public object PhysicsServer2D : Object() { } /** - * Replaces the body's shape at the given index by another shape, while not affecting the `transform`, `disabled`, and one-way collision properties at the same index. + * Replaces the body's shape at the given index by another shape, while not affecting the + * `transform`, `disabled`, and one-way collision properties at the same index. */ public fun bodySetShape( body: RID, @@ -613,7 +668,8 @@ public object PhysicsServer2D : Object() { } /** - * Returns the local transform matrix of the shape with the given index in the area's array of shapes. + * Returns the local transform matrix of the shape with the given index in the area's array of + * shapes. */ public fun bodyGetShapeTransform(body: RID, shapeIdx: Int): Transform2D { TransferContext.writeArguments(_RID to body, LONG to shapeIdx.toLong()) @@ -622,7 +678,10 @@ public object PhysicsServer2D : Object() { } /** - * Removes the shape with the given index from the body's array of shapes. The shape itself is not deleted, so it can continue to be used elsewhere or added back later. As a result of this operation, the body's shapes which used to have indices higher than [shapeIdx] will have their index decreased by one. + * Removes the shape with the given index from the body's array of shapes. The shape itself is not + * deleted, so it can continue to be used elsewhere or added back later. As a result of this + * operation, the body's shapes which used to have indices higher than [param shape_idx] will have + * their index decreased by one. */ public fun bodyRemoveShape(body: RID, shapeIdx: Int): Unit { TransferContext.writeArguments(_RID to body, LONG to shapeIdx.toLong()) @@ -630,7 +689,8 @@ public object PhysicsServer2D : Object() { } /** - * Removes all shapes from the body. This does not delete the shapes themselves, so they can continue to be used elsewhere or added back later. + * Removes all shapes from the body. This does not delete the shapes themselves, so they can + * continue to be used elsewhere or added back later. */ public fun bodyClearShapes(body: RID): Unit { TransferContext.writeArguments(_RID to body) @@ -638,7 +698,8 @@ public object PhysicsServer2D : Object() { } /** - * Sets the disabled property of the body's shape with the given index. If [disabled] is `true`, then the shape will be ignored in all collision detection. + * Sets the disabled property of the body's shape with the given index. If [param disabled] is + * `true`, then the shape will be ignored in all collision detection. */ public fun bodySetShapeDisabled( body: RID, @@ -650,7 +711,10 @@ public object PhysicsServer2D : Object() { } /** - * Sets the one-way collision properties of the body's shape with the given index. If [enable] is `true`, the one-way collision direction given by the shape's local upward axis `body_get_shape_transform(body, shape_idx).y` will be used to ignore collisions with the shape in the opposite direction, and to ensure depenetration of kinematic bodies happens in this direction. + * Sets the one-way collision properties of the body's shape with the given index. If [param + * enable] is `true`, the one-way collision direction given by the shape's local upward axis + * `body_get_shape_transform(body, shape_idx).y` will be used to ignore collisions with the shape in + * the opposite direction, and to ensure depenetration of kinematic bodies happens in this direction. */ public fun bodySetShapeAsOneWayCollision( body: RID, @@ -663,7 +727,8 @@ public object PhysicsServer2D : Object() { } /** - * Attaches the `ObjectID` of an [godot.Object] to the body. Use [godot.Object.getInstanceId] to get the `ObjectID` of a [godot.CollisionObject2D]. + * Attaches the `ObjectID` of an [Object] to the body. Use [Object.getInstanceId] to get the + * `ObjectID` of a [CollisionObject2D]. */ public fun bodyAttachObjectInstanceId(body: RID, id: Long): Unit { TransferContext.writeArguments(_RID to body, LONG to id) @@ -671,7 +736,8 @@ public object PhysicsServer2D : Object() { } /** - * Returns the `ObjectID` attached to the body. Use [@GlobalScope.instanceFromId] to retrieve an [godot.Object] from a nonzero `ObjectID`. + * Returns the `ObjectID` attached to the body. Use [@GlobalScope.instanceFromId] to retrieve an + * [Object] from a nonzero `ObjectID`. */ public fun bodyGetObjectInstanceId(body: RID): Long { TransferContext.writeArguments(_RID to body) @@ -680,7 +746,8 @@ public object PhysicsServer2D : Object() { } /** - * Attaches the `ObjectID` of a canvas to the body. Use [godot.Object.getInstanceId] to get the `ObjectID` of a [godot.CanvasLayer]. + * Attaches the `ObjectID` of a canvas to the body. Use [Object.getInstanceId] to get the + * `ObjectID` of a [CanvasLayer]. */ public fun bodyAttachCanvasInstanceId(body: RID, id: Long): Unit { TransferContext.writeArguments(_RID to body, LONG to id) @@ -688,7 +755,8 @@ public object PhysicsServer2D : Object() { } /** - * Returns the `ObjectID` of the canvas attached to the body. Use [@GlobalScope.instanceFromId] to retrieve a [godot.CanvasLayer] from a nonzero `ObjectID`. + * Returns the `ObjectID` of the canvas attached to the body. Use [@GlobalScope.instanceFromId] to + * retrieve a [CanvasLayer] from a nonzero `ObjectID`. */ public fun bodyGetCanvasInstanceId(body: RID): Long { TransferContext.writeArguments(_RID to body) @@ -698,8 +766,8 @@ public object PhysicsServer2D : Object() { /** * Sets the continuous collision detection mode using one of the [enum CCDMode] constants. - * - * Continuous collision detection tries to predict where a moving body would collide in between physics updates, instead of moving it and correcting its movement if it collided. + * Continuous collision detection tries to predict where a moving body would collide in between + * physics updates, instead of moving it and correcting its movement if it collided. */ public fun bodySetContinuousCollisionDetectionMode(body: RID, mode: CCDMode): Unit { TransferContext.writeArguments(_RID to body, LONG to mode.id) @@ -752,7 +820,8 @@ public object PhysicsServer2D : Object() { } /** - * Sets the body's collision priority. This is used in the depenetration phase of [bodyTestMotion]. The higher the priority is, the lower the penetration into the body will be. + * Sets the body's collision priority. This is used in the depenetration phase of + * [bodyTestMotion]. The higher the priority is, the lower the penetration into the body will be. */ public fun bodySetCollisionPriority(body: RID, priority: Float): Unit { TransferContext.writeArguments(_RID to body, DOUBLE to priority.toDouble()) @@ -760,7 +829,8 @@ public object PhysicsServer2D : Object() { } /** - * Returns the body's collision priority. This is used in the depenetration phase of [bodyTestMotion]. The higher the priority is, the lower the penetration into the body will be. + * Returns the body's collision priority. This is used in the depenetration phase of + * [bodyTestMotion]. The higher the priority is, the lower the penetration into the body will be. */ public fun bodyGetCollisionPriority(body: RID): Float { TransferContext.writeArguments(_RID to body) @@ -769,7 +839,8 @@ public object PhysicsServer2D : Object() { } /** - * Sets the value of the given body parameter. See [enum BodyParameter] for the list of available parameters. + * Sets the value of the given body parameter. See [enum BodyParameter] for the list of available + * parameters. */ public fun bodySetParam( body: RID, @@ -781,7 +852,8 @@ public object PhysicsServer2D : Object() { } /** - * Returns the value of the given body parameter. See [enum BodyParameter] for the list of available parameters. + * Returns the value of the given body parameter. See [enum BodyParameter] for the list of + * available parameters. */ public fun bodyGetParam(body: RID, `param`: BodyParameter): Any? { TransferContext.writeArguments(_RID to body, LONG to param.id) @@ -790,7 +862,8 @@ public object PhysicsServer2D : Object() { } /** - * Restores the default inertia and center of mass of the body based on its shapes. This undoes any custom values previously set using [bodySetParam]. + * Restores the default inertia and center of mass of the body based on its shapes. This undoes + * any custom values previously set using [bodySetParam]. */ public fun bodyResetMassProperties(body: RID): Unit { TransferContext.writeArguments(_RID to body) @@ -799,8 +872,8 @@ public object PhysicsServer2D : Object() { /** * Sets the value of a body's state. See [enum BodyState] for the list of available states. - * - * **Note:** The state change doesn't take effect immediately. The state will change on the next physics frame. + * **Note:** The state change doesn't take effect immediately. The state will change on the next + * physics frame. */ public fun bodySetState( body: RID, @@ -812,7 +885,8 @@ public object PhysicsServer2D : Object() { } /** - * Returns the value of the given state of the body. See [enum BodyState] for the list of available states. + * Returns the value of the given state of the body. See [enum BodyState] for the list of + * available states. */ public fun bodyGetState(body: RID, state: BodyState): Any? { TransferContext.writeArguments(_RID to body, LONG to state.id) @@ -821,10 +895,11 @@ public object PhysicsServer2D : Object() { } /** - * Applies a directional impulse to the body, at the body's center of mass. The impulse does not affect rotation. - * - * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). - * + * Applies a directional impulse to the body, at the body's center of mass. The impulse does not + * affect rotation. + * An impulse is time-independent! Applying an impulse every frame would result in a + * framerate-dependent force. For this reason, it should only be used when simulating one-time + * impacts (use the "_force" functions otherwise). * This is equivalent to using [bodyApplyImpulse] at the body's center of mass. */ public fun bodyApplyCentralImpulse(body: RID, impulse: Vector2): Unit { @@ -834,8 +909,9 @@ public object PhysicsServer2D : Object() { /** * Applies a rotational impulse to the body. The impulse does not affect position. - * - * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). + * An impulse is time-independent! Applying an impulse every frame would result in a + * framerate-dependent force. For this reason, it should only be used when simulating one-time + * impacts (use the "_force" functions otherwise). */ public fun bodyApplyTorqueImpulse(body: RID, impulse: Float): Unit { TransferContext.writeArguments(_RID to body, DOUBLE to impulse.toDouble()) @@ -843,11 +919,12 @@ public object PhysicsServer2D : Object() { } /** - * Applies a positioned impulse to the body. The impulse can affect rotation if [position] is different from the body's center of mass. - * - * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). - * - * [position] is the offset from the body origin in global coordinates. + * Applies a positioned impulse to the body. The impulse can affect rotation if [param position] + * is different from the body's center of mass. + * An impulse is time-independent! Applying an impulse every frame would result in a + * framerate-dependent force. For this reason, it should only be used when simulating one-time + * impacts (use the "_force" functions otherwise). + * [param position] is the offset from the body origin in global coordinates. */ @JvmOverloads public fun bodyApplyImpulse( @@ -860,8 +937,8 @@ public object PhysicsServer2D : Object() { } /** - * Applies a directional force to the body, at the body's center of mass. The force does not affect rotation. A force is time dependent and meant to be applied every physics update. - * + * Applies a directional force to the body, at the body's center of mass. The force does not + * affect rotation. A force is time dependent and meant to be applied every physics update. * This is equivalent to using [bodyApplyForce] at the body's center of mass. */ public fun bodyApplyCentralForce(body: RID, force: Vector2): Unit { @@ -870,9 +947,10 @@ public object PhysicsServer2D : Object() { } /** - * Applies a positioned force to the body. The force can affect rotation if [position] is different from the body's center of mass. A force is time dependent and meant to be applied every physics update. - * - * [position] is the offset from the body origin in global coordinates. + * Applies a positioned force to the body. The force can affect rotation if [param position] is + * different from the body's center of mass. A force is time dependent and meant to be applied every + * physics update. + * [param position] is the offset from the body origin in global coordinates. */ @JvmOverloads public fun bodyApplyForce( @@ -885,7 +963,8 @@ public object PhysicsServer2D : Object() { } /** - * Applies a rotational force to the body. The force does not affect position. A force is time dependent and meant to be applied every physics update. + * Applies a rotational force to the body. The force does not affect position. A force is time + * dependent and meant to be applied every physics update. */ public fun bodyApplyTorque(body: RID, torque: Float): Unit { TransferContext.writeArguments(_RID to body, DOUBLE to torque.toDouble()) @@ -893,8 +972,9 @@ public object PhysicsServer2D : Object() { } /** - * Adds a constant directional force to the body. The force does not affect rotation. The force remains applied over time until cleared with `PhysicsServer2D.body_set_constant_force(body, Vector2(0, 0))`. - * + * Adds a constant directional force to the body. The force does not affect rotation. The force + * remains applied over time until cleared with `PhysicsServer2D.body_set_constant_force(body, + * Vector2(0, 0))`. * This is equivalent to using [bodyAddConstantForce] at the body's center of mass. */ public fun bodyAddConstantCentralForce(body: RID, force: Vector2): Unit { @@ -903,9 +983,10 @@ public object PhysicsServer2D : Object() { } /** - * Adds a constant positioned force to the body. The force can affect rotation if [position] is different from the body's center of mass. The force remains applied over time until cleared with `PhysicsServer2D.body_set_constant_force(body, Vector2(0, 0))`. - * - * [position] is the offset from the body origin in global coordinates. + * Adds a constant positioned force to the body. The force can affect rotation if [param position] + * is different from the body's center of mass. The force remains applied over time until cleared + * with `PhysicsServer2D.body_set_constant_force(body, Vector2(0, 0))`. + * [param position] is the offset from the body origin in global coordinates. */ @JvmOverloads public fun bodyAddConstantForce( @@ -918,7 +999,8 @@ public object PhysicsServer2D : Object() { } /** - * Adds a constant rotational force to the body. The force does not affect position. The force remains applied over time until cleared with `PhysicsServer2D.body_set_constant_torque(body, 0)`. + * Adds a constant rotational force to the body. The force does not affect position. The force + * remains applied over time until cleared with `PhysicsServer2D.body_set_constant_torque(body, 0)`. */ public fun bodyAddConstantTorque(body: RID, torque: Float): Unit { TransferContext.writeArguments(_RID to body, DOUBLE to torque.toDouble()) @@ -927,7 +1009,6 @@ public object PhysicsServer2D : Object() { /** * Sets the body's total constant positional force applied during each physics update. - * * See [bodyAddConstantForce] and [bodyAddConstantCentralForce]. */ public fun bodySetConstantForce(body: RID, force: Vector2): Unit { @@ -937,7 +1018,6 @@ public object PhysicsServer2D : Object() { /** * Returns the body's total constant positional force applied during each physics update. - * * See [bodyAddConstantForce] and [bodyAddConstantCentralForce]. */ public fun bodyGetConstantForce(body: RID): Vector2 { @@ -948,7 +1028,6 @@ public object PhysicsServer2D : Object() { /** * Sets the body's total constant rotational force applied during each physics update. - * * See [bodyAddConstantTorque]. */ public fun bodySetConstantTorque(body: RID, torque: Float): Unit { @@ -958,7 +1037,6 @@ public object PhysicsServer2D : Object() { /** * Returns the body's total constant rotational force applied during each physics update. - * * See [bodyAddConstantTorque]. */ public fun bodyGetConstantTorque(body: RID): Float { @@ -968,7 +1046,9 @@ public object PhysicsServer2D : Object() { } /** - * Modifies the body's linear velocity so that its projection to the axis `axis_velocity.normalized()` is exactly `axis_velocity.length()`. This is useful for jumping behavior. + * Modifies the body's linear velocity so that its projection to the axis + * `axis_velocity.normalized()` is exactly `axis_velocity.length()`. This is useful for jumping + * behavior. */ public fun bodySetAxisVelocity(body: RID, axisVelocity: Vector2): Unit { TransferContext.writeArguments(_RID to body, VECTOR2 to axisVelocity) @@ -976,7 +1056,8 @@ public object PhysicsServer2D : Object() { } /** - * Adds [exceptedBody] to the body's list of collision exceptions, so that collisions with it are ignored. + * Adds [param excepted_body] to the body's list of collision exceptions, so that collisions with + * it are ignored. */ public fun bodyAddCollisionException(body: RID, exceptedBody: RID): Unit { TransferContext.writeArguments(_RID to body, _RID to exceptedBody) @@ -984,7 +1065,8 @@ public object PhysicsServer2D : Object() { } /** - * Removes [exceptedBody] from the body's list of collision exceptions, so that collisions with it are no longer ignored. + * Removes [param excepted_body] from the body's list of collision exceptions, so that collisions + * with it are no longer ignored. */ public fun bodyRemoveCollisionException(body: RID, exceptedBody: RID): Unit { TransferContext.writeArguments(_RID to body, _RID to exceptedBody) @@ -992,7 +1074,8 @@ public object PhysicsServer2D : Object() { } /** - * Sets the maximum number of contacts that the body can report. If [amount] is greater than zero, then the body will keep track of at most this many contacts with other bodies. + * Sets the maximum number of contacts that the body can report. If [param amount] is greater than + * zero, then the body will keep track of at most this many contacts with other bodies. */ public fun bodySetMaxContactsReported(body: RID, amount: Int): Unit { TransferContext.writeArguments(_RID to body, LONG to amount.toLong()) @@ -1000,7 +1083,8 @@ public object PhysicsServer2D : Object() { } /** - * Returns the maximum number of contacts that the body can report. See [bodySetMaxContactsReported]. + * Returns the maximum number of contacts that the body can report. See + * [bodySetMaxContactsReported]. */ public fun bodyGetMaxContactsReported(body: RID): Int { TransferContext.writeArguments(_RID to body) @@ -1009,7 +1093,8 @@ public object PhysicsServer2D : Object() { } /** - * Sets whether the body uses a callback function to calculate its own physics (see [bodySetForceIntegrationCallback]). + * Sets whether the body uses a callback function to calculate its own physics (see + * [bodySetForceIntegrationCallback]). */ public fun bodySetOmitForceIntegration(body: RID, enable: Boolean): Unit { TransferContext.writeArguments(_RID to body, BOOL to enable) @@ -1017,7 +1102,8 @@ public object PhysicsServer2D : Object() { } /** - * Returns `true` if the body uses a callback function to calculate its own physics (see [bodySetForceIntegrationCallback]). + * Returns `true` if the body uses a callback function to calculate its own physics (see + * [bodySetForceIntegrationCallback]). */ public fun bodyIsOmittingForceIntegration(body: RID): Boolean { TransferContext.writeArguments(_RID to body) @@ -1026,14 +1112,11 @@ public object PhysicsServer2D : Object() { } /** - * Sets the function used to calculate physics for the body, if that body allows it (see [bodySetOmitForceIntegration]). - * + * Sets the function used to calculate physics for the body, if that body allows it (see + * [bodySetOmitForceIntegration]). * The force integration function takes the following two parameters: - * - * 1. a [godot.PhysicsDirectBodyState2D] `state`: used to retrieve and modify the body's state, - * - * 2. a [Variant] [userdata]: optional user data. - * + * 1. a [PhysicsDirectBodyState2D] `state`: used to retrieve and modify the body's state, + * 2. a [Variant] [param userdata]: optional user data. * **Note:** This callback is currently not called in Godot Physics. */ @JvmOverloads @@ -1047,7 +1130,10 @@ public object PhysicsServer2D : Object() { } /** - * Returns `true` if a collision would result from moving the body along a motion vector from a given point in space. See [godot.PhysicsTestMotionParameters2D] for the available motion parameters. Optionally a [godot.PhysicsTestMotionResult2D] object can be passed, which will be used to store the information about the resulting collision. + * Returns `true` if a collision would result from moving the body along a motion vector from a + * given point in space. See [PhysicsTestMotionParameters2D] for the available motion parameters. + * Optionally a [PhysicsTestMotionResult2D] object can be passed, which will be used to store the + * information about the resulting collision. */ @JvmOverloads public fun bodyTestMotion( @@ -1061,7 +1147,8 @@ public object PhysicsServer2D : Object() { } /** - * Returns the [godot.PhysicsDirectBodyState2D] of the body. Returns `null` if the body is destroyed or not assigned to a space. + * Returns the [PhysicsDirectBodyState2D] of the body. Returns `null` if the body is destroyed or + * not assigned to a space. */ public fun bodyGetDirectState(body: RID): PhysicsDirectBodyState2D? { TransferContext.writeArguments(_RID to body) @@ -1070,7 +1157,9 @@ public object PhysicsServer2D : Object() { } /** - * Creates a 2D joint in the physics server, and returns the [RID] that identifies it. To set the joint type, use [jointMakeDampedSpring], [jointMakeGroove] or [jointMakePin]. Use [jointSetParam] to set generic joint parameters. + * Creates a 2D joint in the physics server, and returns the [RID] that identifies it. To set the + * joint type, use [jointMakeDampedSpring], [jointMakeGroove] or [jointMakePin]. Use [jointSetParam] + * to set generic joint parameters. */ public fun jointCreate(): RID { TransferContext.writeArguments() @@ -1079,7 +1168,8 @@ public object PhysicsServer2D : Object() { } /** - * Destroys the joint with the given [RID], creates a new uninitialized joint, and makes the [RID] refer to this new joint. + * Destroys the joint with the given [RID], creates a new uninitialized joint, and makes the [RID] + * refer to this new joint. */ public fun jointClear(joint: RID): Unit { TransferContext.writeArguments(_RID to joint) @@ -1087,7 +1177,8 @@ public object PhysicsServer2D : Object() { } /** - * Sets the value of the given joint parameter. See [enum JointParam] for the list of available parameters. + * Sets the value of the given joint parameter. See [enum JointParam] for the list of available + * parameters. */ public fun jointSetParam( joint: RID, @@ -1099,7 +1190,8 @@ public object PhysicsServer2D : Object() { } /** - * Returns the value of the given joint parameter. See [enum JointParam] for the list of available parameters. + * Returns the value of the given joint parameter. See [enum JointParam] for the list of available + * parameters. */ public fun jointGetParam(joint: RID, `param`: JointParam): Float { TransferContext.writeArguments(_RID to joint, LONG to param.id) @@ -1108,7 +1200,7 @@ public object PhysicsServer2D : Object() { } /** - * Sets whether the bodies attached to the [godot.Joint2D] will collide with each other. + * Sets whether the bodies attached to the [Joint2D] will collide with each other. */ public fun jointDisableCollisionsBetweenBodies(joint: RID, disable: Boolean): Unit { TransferContext.writeArguments(_RID to joint, BOOL to disable) @@ -1116,7 +1208,7 @@ public object PhysicsServer2D : Object() { } /** - * Returns whether the bodies attached to the [godot.Joint2D] will collide with each other. + * Returns whether the bodies attached to the [Joint2D] will collide with each other. */ public fun jointIsDisabledCollisionsBetweenBodies(joint: RID): Boolean { TransferContext.writeArguments(_RID to joint) @@ -1126,7 +1218,10 @@ public object PhysicsServer2D : Object() { } /** - * Makes the joint a pin joint. If [bodyB] is an empty [RID], then [bodyA] is pinned to the point [anchor] (given in global coordinates); otherwise, [bodyA] is pinned to [bodyB] at the point [anchor] (given in global coordinates). To set the parameters which are specific to the pin joint, see [pinJointSetParam]. + * Makes the joint a pin joint. If [param body_b] is an empty [RID], then [param body_a] is pinned + * to the point [param anchor] (given in global coordinates); otherwise, [param body_a] is pinned to + * [param body_b] at the point [param anchor] (given in global coordinates). To set the parameters + * which are specific to the pin joint, see [pinJointSetParam]. */ @JvmOverloads public fun jointMakePin( @@ -1156,7 +1251,10 @@ public object PhysicsServer2D : Object() { } /** - * Makes the joint a damped spring joint, attached at the point [anchorA] (given in global coordinates) on the body [bodyA] and at the point [anchorB] (given in global coordinates) on the body [bodyB]. To set the parameters which are specific to the damped spring, see [dampedSpringJointSetParam]. + * Makes the joint a damped spring joint, attached at the point [param anchor_a] (given in global + * coordinates) on the body [param body_a] and at the point [param anchor_b] (given in global + * coordinates) on the body [param body_b]. To set the parameters which are specific to the damped + * spring, see [dampedSpringJointSetParam]. */ @JvmOverloads public fun jointMakeDampedSpring( @@ -1204,7 +1302,8 @@ public object PhysicsServer2D : Object() { } /** - * Returns the value of a pin joint parameter. See [enum PinJointParam] for a list of available parameters. + * Returns the value of a pin joint parameter. See [enum PinJointParam] for a list of available + * parameters. */ public fun pinJointGetParam(joint: RID, `param`: PinJointParam): Float { TransferContext.writeArguments(_RID to joint, LONG to param.id) @@ -1213,7 +1312,8 @@ public object PhysicsServer2D : Object() { } /** - * Sets the value of the given damped spring joint parameter. See [enum DampedSpringParam] for the list of available parameters. + * Sets the value of the given damped spring joint parameter. See [enum DampedSpringParam] for the + * list of available parameters. */ public fun dampedSpringJointSetParam( joint: RID, @@ -1225,7 +1325,8 @@ public object PhysicsServer2D : Object() { } /** - * Returns the value of the given damped spring joint parameter. See [enum DampedSpringParam] for the list of available parameters. + * Returns the value of the given damped spring joint parameter. See [enum DampedSpringParam] for + * the list of available parameters. */ public fun dampedSpringJointGetParam(joint: RID, `param`: DampedSpringParam): Float { TransferContext.writeArguments(_RID to joint, LONG to param.id) @@ -1243,7 +1344,8 @@ public object PhysicsServer2D : Object() { } /** - * Destroys any of the objects created by PhysicsServer2D. If the [RID] passed is not one of the objects that can be created by PhysicsServer2D, an error will be printed to the console. + * Destroys any of the objects created by PhysicsServer2D. If the [RID] passed is not one of the + * objects that can be created by PhysicsServer2D, an error will be printed to the console. */ public fun freeRid(rid: RID): Unit { TransferContext.writeArguments(_RID to rid) @@ -1251,7 +1353,8 @@ public object PhysicsServer2D : Object() { } /** - * Activates or deactivates the 2D physics server. If [active] is `false`, then the physics server will not do anything in its physics step. + * Activates or deactivates the 2D physics server. If [param active] is `false`, then the physics + * server will not do anything in its physics step. */ public fun setActive(active: Boolean): Unit { TransferContext.writeArguments(BOOL to active) @@ -1259,7 +1362,8 @@ public object PhysicsServer2D : Object() { } /** - * Returns information about the current state of the 2D physics engine. See [enum ProcessInfo] for the list of available states. + * Returns information about the current state of the 2D physics engine. See [enum ProcessInfo] + * for the list of available states. */ public fun getProcessInfo(processInfo: ProcessInfo): Int { TransferContext.writeArguments(LONG to processInfo.id) @@ -1271,39 +1375,60 @@ public object PhysicsServer2D : Object() { id: Long, ) { /** - * Constant to set/get the maximum distance a pair of bodies has to move before their collision status has to be recalculated. The default value of this parameter is [godot.ProjectSettings.physics/2d/solver/contactRecycleRadius]. + * Constant to set/get the maximum distance a pair of bodies has to move before their collision + * status has to be recalculated. The default value of this parameter is + * [ProjectSettings.physics/2d/solver/contactRecycleRadius]. */ SPACE_PARAM_CONTACT_RECYCLE_RADIUS(0), /** - * Constant to set/get the maximum distance a shape can be from another before they are considered separated and the contact is discarded. The default value of this parameter is [godot.ProjectSettings.physics/2d/solver/contactMaxSeparation]. + * Constant to set/get the maximum distance a shape can be from another before they are + * considered separated and the contact is discarded. The default value of this parameter is + * [ProjectSettings.physics/2d/solver/contactMaxSeparation]. */ SPACE_PARAM_CONTACT_MAX_SEPARATION(1), /** - * Constant to set/get the maximum distance a shape can penetrate another shape before it is considered a collision. The default value of this parameter is [godot.ProjectSettings.physics/2d/solver/contactMaxAllowedPenetration]. + * Constant to set/get the maximum distance a shape can penetrate another shape before it is + * considered a collision. The default value of this parameter is + * [ProjectSettings.physics/2d/solver/contactMaxAllowedPenetration]. */ SPACE_PARAM_CONTACT_MAX_ALLOWED_PENETRATION(2), /** - * Constant to set/get the default solver bias for all physics contacts. A solver bias is a factor controlling how much two objects "rebound", after overlapping, to avoid leaving them in that state because of numerical imprecision. The default value of this parameter is [godot.ProjectSettings.physics/2d/solver/defaultContactBias]. + * Constant to set/get the default solver bias for all physics contacts. A solver bias is a + * factor controlling how much two objects "rebound", after overlapping, to avoid leaving them in + * that state because of numerical imprecision. The default value of this parameter is + * [ProjectSettings.physics/2d/solver/defaultContactBias]. */ SPACE_PARAM_CONTACT_DEFAULT_BIAS(3), /** - * Constant to set/get the threshold linear velocity of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after the time given. The default value of this parameter is [godot.ProjectSettings.physics/2d/sleepThresholdLinear]. + * Constant to set/get the threshold linear velocity of activity. A body marked as potentially + * inactive for both linear and angular velocity will be put to sleep after the time given. The + * default value of this parameter is [ProjectSettings.physics/2d/sleepThresholdLinear]. */ SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_THRESHOLD(4), /** - * Constant to set/get the threshold angular velocity of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after the time given. The default value of this parameter is [godot.ProjectSettings.physics/2d/sleepThresholdAngular]. + * Constant to set/get the threshold angular velocity of activity. A body marked as potentially + * inactive for both linear and angular velocity will be put to sleep after the time given. The + * default value of this parameter is [ProjectSettings.physics/2d/sleepThresholdAngular]. */ SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_THRESHOLD(5), /** - * Constant to set/get the maximum time of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after this time. The default value of this parameter is [godot.ProjectSettings.physics/2d/timeBeforeSleep]. + * Constant to set/get the maximum time of activity. A body marked as potentially inactive for + * both linear and angular velocity will be put to sleep after this time. The default value of this + * parameter is [ProjectSettings.physics/2d/timeBeforeSleep]. */ SPACE_PARAM_BODY_TIME_TO_SLEEP(6), /** - * Constant to set/get the default solver bias for all physics constraints. A solver bias is a factor controlling how much two objects "rebound", after violating a constraint, to avoid leaving them in that state because of numerical imprecision. The default value of this parameter is [godot.ProjectSettings.physics/2d/solver/defaultConstraintBias]. + * Constant to set/get the default solver bias for all physics constraints. A solver bias is a + * factor controlling how much two objects "rebound", after violating a constraint, to avoid + * leaving them in that state because of numerical imprecision. The default value of this parameter + * is [ProjectSettings.physics/2d/solver/defaultConstraintBias]. */ SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS(7), /** - * Constant to set/get the number of solver iterations for all contacts and constraints. The greater the number of iterations, the more accurate the collisions will be. However, a greater number of iterations requires more CPU power, which can decrease performance. The default value of this parameter is [godot.ProjectSettings.physics/2d/solver/solverIterations]. + * Constant to set/get the number of solver iterations for all contacts and constraints. The + * greater the number of iterations, the more accurate the collisions will be. However, a greater + * number of iterations requires more CPU power, which can decrease performance. The default value + * of this parameter is [ProjectSettings.physics/2d/solver/solverIterations]. */ SPACE_PARAM_SOLVER_ITERATIONS(8), ; @@ -1322,39 +1447,50 @@ public object PhysicsServer2D : Object() { id: Long, ) { /** - * This is the constant for creating world boundary shapes. A world boundary shape is an *infinite* line with an origin point, and a normal. Thus, it can be used for front/behind checks. + * This is the constant for creating world boundary shapes. A world boundary shape is an + * *infinite* line with an origin point, and a normal. Thus, it can be used for front/behind + * checks. */ SHAPE_WORLD_BOUNDARY(0), /** - * This is the constant for creating separation ray shapes. A separation ray is defined by a length and separates itself from what is touching its far endpoint. Useful for character controllers. + * This is the constant for creating separation ray shapes. A separation ray is defined by a + * length and separates itself from what is touching its far endpoint. Useful for character + * controllers. */ SHAPE_SEPARATION_RAY(1), /** - * This is the constant for creating segment shapes. A segment shape is a *finite* line from a point A to a point B. It can be checked for intersections. + * This is the constant for creating segment shapes. A segment shape is a *finite* line from a + * point A to a point B. It can be checked for intersections. */ SHAPE_SEGMENT(2), /** - * This is the constant for creating circle shapes. A circle shape only has a radius. It can be used for intersections and inside/outside checks. + * This is the constant for creating circle shapes. A circle shape only has a radius. It can be + * used for intersections and inside/outside checks. */ SHAPE_CIRCLE(3), /** - * This is the constant for creating rectangle shapes. A rectangle shape is defined by a width and a height. It can be used for intersections and inside/outside checks. + * This is the constant for creating rectangle shapes. A rectangle shape is defined by a width + * and a height. It can be used for intersections and inside/outside checks. */ SHAPE_RECTANGLE(4), /** - * This is the constant for creating capsule shapes. A capsule shape is defined by a radius and a length. It can be used for intersections and inside/outside checks. + * This is the constant for creating capsule shapes. A capsule shape is defined by a radius and + * a length. It can be used for intersections and inside/outside checks. */ SHAPE_CAPSULE(5), /** - * This is the constant for creating convex polygon shapes. A polygon is defined by a list of points. It can be used for intersections and inside/outside checks. + * This is the constant for creating convex polygon shapes. A polygon is defined by a list of + * points. It can be used for intersections and inside/outside checks. */ SHAPE_CONVEX_POLYGON(6), /** - * This is the constant for creating concave polygon shapes. A polygon is defined by a list of points. It can be used for intersections checks, but not for inside/outside checks. + * This is the constant for creating concave polygon shapes. A polygon is defined by a list of + * points. It can be used for intersections checks, but not for inside/outside checks. */ SHAPE_CONCAVE_POLYGON(7), /** - * This constant is used internally by the engine. Any attempt to create this kind of shape results in an error. + * This constant is used internally by the engine. Any attempt to create this kind of shape + * results in an error. */ SHAPE_CUSTOM(8), ; @@ -1373,45 +1509,62 @@ public object PhysicsServer2D : Object() { id: Long, ) { /** - * Constant to set/get gravity override mode in an area. See [enum AreaSpaceOverrideMode] for possible values. The default value of this parameter is [AREA_SPACE_OVERRIDE_DISABLED]. + * Constant to set/get gravity override mode in an area. See [enum AreaSpaceOverrideMode] for + * possible values. The default value of this parameter is [constant AREA_SPACE_OVERRIDE_DISABLED]. */ AREA_PARAM_GRAVITY_OVERRIDE_MODE(0), /** - * Constant to set/get gravity strength in an area. The default value of this parameter is `9.80665`. + * Constant to set/get gravity strength in an area. The default value of this parameter is + * `9.80665`. */ AREA_PARAM_GRAVITY(1), /** - * Constant to set/get gravity vector/center in an area. The default value of this parameter is `Vector2(0, -1)`. + * Constant to set/get gravity vector/center in an area. The default value of this parameter is + * `Vector2(0, -1)`. */ AREA_PARAM_GRAVITY_VECTOR(2), /** - * Constant to set/get whether the gravity vector of an area is a direction, or a center point. The default value of this parameter is `false`. + * Constant to set/get whether the gravity vector of an area is a direction, or a center point. + * The default value of this parameter is `false`. */ AREA_PARAM_GRAVITY_IS_POINT(3), /** - * Constant to set/get the distance at which the gravity strength is equal to the gravity controlled by [AREA_PARAM_GRAVITY]. For example, on a planet 100 pixels in radius with a surface gravity of 4.0 px/s², set the gravity to 4.0 and the unit distance to 100.0. The gravity will have falloff according to the inverse square law, so in the example, at 200 pixels from the center the gravity will be 1.0 px/s² (twice the distance, 1/4th the gravity), at 50 pixels it will be 16.0 px/s² (half the distance, 4x the gravity), and so on. - * - * The above is true only when the unit distance is a positive number. When the unit distance is set to 0.0, the gravity will be constant regardless of distance. The default value of this parameter is `0.0`. + * Constant to set/get the distance at which the gravity strength is equal to the gravity + * controlled by [constant AREA_PARAM_GRAVITY]. For example, on a planet 100 pixels in radius with + * a surface gravity of 4.0 px/s², set the gravity to 4.0 and the unit distance to 100.0. The + * gravity will have falloff according to the inverse square law, so in the example, at 200 pixels + * from the center the gravity will be 1.0 px/s² (twice the distance, 1/4th the gravity), at 50 + * pixels it will be 16.0 px/s² (half the distance, 4x the gravity), and so on. + * The above is true only when the unit distance is a positive number. When the unit distance is + * set to 0.0, the gravity will be constant regardless of distance. The default value of this + * parameter is `0.0`. */ AREA_PARAM_GRAVITY_POINT_UNIT_DISTANCE(4), /** - * Constant to set/get linear damping override mode in an area. See [enum AreaSpaceOverrideMode] for possible values. The default value of this parameter is [AREA_SPACE_OVERRIDE_DISABLED]. + * Constant to set/get linear damping override mode in an area. See [enum AreaSpaceOverrideMode] + * for possible values. The default value of this parameter is [constant + * AREA_SPACE_OVERRIDE_DISABLED]. */ AREA_PARAM_LINEAR_DAMP_OVERRIDE_MODE(5), /** - * Constant to set/get the linear damping factor of an area. The default value of this parameter is `0.1`. + * Constant to set/get the linear damping factor of an area. The default value of this parameter + * is `0.1`. */ AREA_PARAM_LINEAR_DAMP(6), /** - * Constant to set/get angular damping override mode in an area. See [enum AreaSpaceOverrideMode] for possible values. The default value of this parameter is [AREA_SPACE_OVERRIDE_DISABLED]. + * Constant to set/get angular damping override mode in an area. See [enum + * AreaSpaceOverrideMode] for possible values. The default value of this parameter is [constant + * AREA_SPACE_OVERRIDE_DISABLED]. */ AREA_PARAM_ANGULAR_DAMP_OVERRIDE_MODE(7), /** - * Constant to set/get the angular damping factor of an area. The default value of this parameter is `1.0`. + * Constant to set/get the angular damping factor of an area. The default value of this + * parameter is `1.0`. */ AREA_PARAM_ANGULAR_DAMP(8), /** - * Constant to set/get the priority (order of processing) of an area. The default value of this parameter is `0`. + * Constant to set/get the priority (order of processing) of an area. The default value of this + * parameter is `0`. */ AREA_PARAM_PRIORITY(9), ; @@ -1430,23 +1583,28 @@ public object PhysicsServer2D : Object() { id: Long, ) { /** - * This area does not affect gravity/damp. These are generally areas that exist only to detect collisions, and objects entering or exiting them. + * This area does not affect gravity/damp. These are generally areas that exist only to detect + * collisions, and objects entering or exiting them. */ AREA_SPACE_OVERRIDE_DISABLED(0), /** - * This area adds its gravity/damp values to whatever has been calculated so far. This way, many overlapping areas can combine their physics to make interesting effects. + * This area adds its gravity/damp values to whatever has been calculated so far. This way, many + * overlapping areas can combine their physics to make interesting effects. */ AREA_SPACE_OVERRIDE_COMBINE(1), /** - * This area adds its gravity/damp values to whatever has been calculated so far. Then stops taking into account the rest of the areas, even the default one. + * This area adds its gravity/damp values to whatever has been calculated so far. Then stops + * taking into account the rest of the areas, even the default one. */ AREA_SPACE_OVERRIDE_COMBINE_REPLACE(2), /** - * This area replaces any gravity/damp, even the default one, and stops taking into account the rest of the areas. + * This area replaces any gravity/damp, even the default one, and stops taking into account the + * rest of the areas. */ AREA_SPACE_OVERRIDE_REPLACE(3), /** - * This area replaces any gravity/damp calculated so far, but keeps calculating the rest of the areas, down to the default one. + * This area replaces any gravity/damp calculated so far, but keeps calculating the rest of the + * areas, down to the default one. */ AREA_SPACE_OVERRIDE_REPLACE_COMBINE(4), ; @@ -1465,19 +1623,23 @@ public object PhysicsServer2D : Object() { id: Long, ) { /** - * Constant for static bodies. In this mode, a body can be only moved by user code and doesn't collide with other bodies along its path when moved. + * Constant for static bodies. In this mode, a body can be only moved by user code and doesn't + * collide with other bodies along its path when moved. */ BODY_MODE_STATIC(0), /** - * Constant for kinematic bodies. In this mode, a body can be only moved by user code and collides with other bodies along its path. + * Constant for kinematic bodies. In this mode, a body can be only moved by user code and + * collides with other bodies along its path. */ BODY_MODE_KINEMATIC(1), /** - * Constant for rigid bodies. In this mode, a body can be pushed by other bodies and has forces applied. + * Constant for rigid bodies. In this mode, a body can be pushed by other bodies and has forces + * applied. */ BODY_MODE_RIGID(2), /** - * Constant for linear rigid bodies. In this mode, a body can not rotate, and only its linear velocity is affected by external forces. + * Constant for linear rigid bodies. In this mode, a body can not rotate, and only its linear + * velocity is affected by external forces. */ BODY_MODE_RIGID_LINEAR(3), ; @@ -1504,39 +1666,51 @@ public object PhysicsServer2D : Object() { */ BODY_PARAM_FRICTION(1), /** - * Constant to set/get a body's mass. The default value of this parameter is `1.0`. If the body's mode is set to [BODY_MODE_RIGID], then setting this parameter will have the following additional effects: - * - * - If the parameter [BODY_PARAM_CENTER_OF_MASS] has never been set explicitly, then the value of that parameter will be recalculated based on the body's shapes. - * - * - If the parameter [BODY_PARAM_INERTIA] is set to a value `<= 0.0`, then the value of that parameter will be recalculated based on the body's shapes, mass, and center of mass. + * Constant to set/get a body's mass. The default value of this parameter is `1.0`. If the + * body's mode is set to [constant BODY_MODE_RIGID], then setting this parameter will have the + * following additional effects: + * - If the parameter [constant BODY_PARAM_CENTER_OF_MASS] has never been set explicitly, then + * the value of that parameter will be recalculated based on the body's shapes. + * - If the parameter [constant BODY_PARAM_INERTIA] is set to a value `<= 0.0`, then the value + * of that parameter will be recalculated based on the body's shapes, mass, and center of mass. */ BODY_PARAM_MASS(2), /** - * Constant to set/get a body's inertia. The default value of this parameter is `0.0`. If the body's inertia is set to a value `<= 0.0`, then the inertia will be recalculated based on the body's shapes, mass, and center of mass. + * Constant to set/get a body's inertia. The default value of this parameter is `0.0`. If the + * body's inertia is set to a value `<= 0.0`, then the inertia will be recalculated based on the + * body's shapes, mass, and center of mass. */ BODY_PARAM_INERTIA(3), /** - * Constant to set/get a body's center of mass position in the body's local coordinate system. The default value of this parameter is `Vector2(0,0)`. If this parameter is never set explicitly, then it is recalculated based on the body's shapes when setting the parameter [BODY_PARAM_MASS] or when calling [bodySetSpace]. + * Constant to set/get a body's center of mass position in the body's local coordinate system. + * The default value of this parameter is `Vector2(0,0)`. If this parameter is never set + * explicitly, then it is recalculated based on the body's shapes when setting the parameter + * [constant BODY_PARAM_MASS] or when calling [bodySetSpace]. */ BODY_PARAM_CENTER_OF_MASS(4), /** - * Constant to set/get a body's gravity multiplier. The default value of this parameter is `1.0`. + * Constant to set/get a body's gravity multiplier. The default value of this parameter is + * `1.0`. */ BODY_PARAM_GRAVITY_SCALE(5), /** - * Constant to set/get a body's linear damping mode. See [enum BodyDampMode] for possible values. The default value of this parameter is [BODY_DAMP_MODE_COMBINE]. + * Constant to set/get a body's linear damping mode. See [enum BodyDampMode] for possible + * values. The default value of this parameter is [constant BODY_DAMP_MODE_COMBINE]. */ BODY_PARAM_LINEAR_DAMP_MODE(6), /** - * Constant to set/get a body's angular damping mode. See [enum BodyDampMode] for possible values. The default value of this parameter is [BODY_DAMP_MODE_COMBINE]. + * Constant to set/get a body's angular damping mode. See [enum BodyDampMode] for possible + * values. The default value of this parameter is [constant BODY_DAMP_MODE_COMBINE]. */ BODY_PARAM_ANGULAR_DAMP_MODE(7), /** - * Constant to set/get a body's linear damping factor. The default value of this parameter is `0.0`. + * Constant to set/get a body's linear damping factor. The default value of this parameter is + * `0.0`. */ BODY_PARAM_LINEAR_DAMP(8), /** - * Constant to set/get a body's angular damping factor. The default value of this parameter is `0.0`. + * Constant to set/get a body's angular damping factor. The default value of this parameter is + * `0.0`. */ BODY_PARAM_ANGULAR_DAMP(9), /** @@ -1648,20 +1822,21 @@ public object PhysicsServer2D : Object() { id: Long, ) { /** - * Constant to set/get how fast the joint pulls the bodies back to satisfy the joint constraint. The lower the value, the more the two bodies can pull on the joint. The default value of this parameter is `0.0`. - * + * Constant to set/get how fast the joint pulls the bodies back to satisfy the joint constraint. + * The lower the value, the more the two bodies can pull on the joint. The default value of this + * parameter is `0.0`. * **Note:** In Godot Physics, this parameter is only used for pin joints and groove joints. */ JOINT_PARAM_BIAS(0), /** - * Constant to set/get the maximum speed with which the joint can apply corrections. The default value of this parameter is `3.40282e+38`. - * + * Constant to set/get the maximum speed with which the joint can apply corrections. The default + * value of this parameter is `3.40282e+38`. * **Note:** In Godot Physics, this parameter is only used for groove joints. */ JOINT_PARAM_MAX_BIAS(1), /** - * Constant to set/get the maximum force that the joint can use to act on the two bodies. The default value of this parameter is `3.40282e+38`. - * + * Constant to set/get the maximum force that the joint can use to act on the two bodies. The + * default value of this parameter is `3.40282e+38`. * **Note:** In Godot Physics, this parameter is only used for groove joints. */ JOINT_PARAM_MAX_FORCE(2), @@ -1681,7 +1856,8 @@ public object PhysicsServer2D : Object() { id: Long, ) { /** - * Constant to set/get a how much the bond of the pin joint can flex. The default value of this parameter is `0.0`. + * Constant to set/get a how much the bond of the pin joint can flex. The default value of this + * parameter is `0.0`. */ PIN_JOINT_SOFTNESS(0), /** @@ -1735,15 +1911,20 @@ public object PhysicsServer2D : Object() { id: Long, ) { /** - * Sets the resting length of the spring joint. The joint will always try to go to back this length when pulled apart. The default value of this parameter is the distance between the joint's anchor points. + * Sets the resting length of the spring joint. The joint will always try to go to back this + * length when pulled apart. The default value of this parameter is the distance between the + * joint's anchor points. */ DAMPED_SPRING_REST_LENGTH(0), /** - * Sets the stiffness of the spring joint. The joint applies a force equal to the stiffness times the distance from its resting length. The default value of this parameter is `20.0`. + * Sets the stiffness of the spring joint. The joint applies a force equal to the stiffness + * times the distance from its resting length. The default value of this parameter is `20.0`. */ DAMPED_SPRING_STIFFNESS(1), /** - * Sets the damping ratio of the spring joint. A value of 0 indicates an undamped spring, while 1 causes the system to reach equilibrium as fast as possible (critical damping). The default value of this parameter is `1.5`. + * Sets the damping ratio of the spring joint. A value of 0 indicates an undamped spring, while + * 1 causes the system to reach equilibrium as fast as possible (critical damping). The default + * value of this parameter is `1.5`. */ DAMPED_SPRING_DAMPING(2), ; @@ -1762,15 +1943,18 @@ public object PhysicsServer2D : Object() { id: Long, ) { /** - * Disables continuous collision detection. This is the fastest way to detect body collisions, but it can miss small and/or fast-moving objects. + * Disables continuous collision detection. This is the fastest way to detect body collisions, + * but it can miss small and/or fast-moving objects. */ CCD_MODE_DISABLED(0), /** - * Enables continuous collision detection by raycasting. It is faster than shapecasting, but less precise. + * Enables continuous collision detection by raycasting. It is faster than shapecasting, but + * less precise. */ CCD_MODE_CAST_RAY(1), /** - * Enables continuous collision detection by shapecasting. It is the slowest CCD method, and the most precise. + * Enables continuous collision detection by shapecasting. It is the slowest CCD method, and the + * most precise. */ CCD_MODE_CAST_SHAPE(2), ; @@ -1789,11 +1973,13 @@ public object PhysicsServer2D : Object() { id: Long, ) { /** - * The value of the first parameter and area callback function receives, when an object enters one of its shapes. + * The value of the first parameter and area callback function receives, when an object enters + * one of its shapes. */ AREA_BODY_ADDED(0), /** - * The value of the first parameter and area callback function receives, when an object exits one of its shapes. + * The value of the first parameter and area callback function receives, when an object exits + * one of its shapes. */ AREA_BODY_REMOVED(1), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsServer2DManager.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsServer2DManager.kt index 1e2438b2d..f009ca372 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsServer2DManager.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsServer2DManager.kt @@ -22,11 +22,10 @@ import kotlin.Suppress import kotlin.Unit /** - * A singleton for managing [godot.PhysicsServer2D] implementations. - * - * [godot.PhysicsServer2DManager] is the API for registering [godot.PhysicsServer2D] implementations and for setting the default implementation. - * - * **Note:** It is not possible to switch physics servers at runtime. This class is only used on startup at the server initialization level, by Godot itself and possibly by GDExtensions. + * [PhysicsServer2DManager] is the API for registering [PhysicsServer2D] implementations and for + * setting the default implementation. + * **Note:** It is not possible to switch physics servers at runtime. This class is only used on + * startup at the server initialization level, by Godot itself and possibly by GDExtensions. */ @GodotBaseType public object PhysicsServer2DManager : Object() { @@ -36,7 +35,8 @@ public object PhysicsServer2DManager : Object() { } /** - * Register a [godot.PhysicsServer2D] implementation by passing a [name] and a [godot.Callable] that returns a [godot.PhysicsServer2D] object. + * Register a [PhysicsServer2D] implementation by passing a [param name] and a [Callable] that + * returns a [PhysicsServer2D] object. */ public fun registerServer(name: String, createCallback: Callable): Unit { TransferContext.writeArguments(STRING to name, CALLABLE to createCallback) @@ -44,7 +44,8 @@ public object PhysicsServer2DManager : Object() { } /** - * Set the default [godot.PhysicsServer2D] implementation to the one identified by [name], if [priority] is greater than the priority of the current default implementation. + * Set the default [PhysicsServer2D] implementation to the one identified by [param name], if + * [param priority] is greater than the priority of the current default implementation. */ public fun setDefaultServer(name: String, priority: Int): Unit { TransferContext.writeArguments(STRING to name, LONG to priority.toLong()) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsServer3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsServer3D.kt index ab80c5c68..2611c7f72 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsServer3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsServer3D.kt @@ -36,23 +36,33 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * A server interface for low-level 3D physics access. - * - * PhysicsServer3D is the server responsible for all 3D physics. It can directly create and manipulate all physics objects: - * - * - A *space* is a self-contained world for a physics simulation. It contains bodies, areas, and joints. Its state can be queried for collision and intersection information, and several parameters of the simulation can be modified. - * - * - A *shape* is a geometric shape such as a sphere, a box, a cylinder, or a polygon. It can be used for collision detection by adding it to a body/area, possibly with an extra transformation relative to the body/area's origin. Bodies/areas can have multiple (transformed) shapes added to them, and a single shape can be added to bodies/areas multiple times with different local transformations. - * - * - A *body* is a physical object which can be in static, kinematic, or rigid mode. Its state (such as position and velocity) can be queried and updated. A force integration callback can be set to customize the body's physics. - * - * - An *area* is a region in space which can be used to detect bodies and areas entering and exiting it. A body monitoring callback can be set to report entering/exiting body shapes, and similarly an area monitoring callback can be set. Gravity and damping can be overridden within the area by setting area parameters. - * - * - A *joint* is a constraint, either between two bodies or on one body relative to a point. Parameters such as the joint bias and the rest length of a spring joint can be adjusted. - * - * Physics objects in [godot.PhysicsServer3D] may be created and manipulated independently; they do not have to be tied to nodes in the scene tree. - * - * **Note:** All the 3D physics nodes use the physics server internally. Adding a physics node to the scene tree will cause a corresponding physics object to be created in the physics server. A rigid body node registers a callback that updates the node's transform with the transform of the respective body object in the physics server (every physics update). An area node registers a callback to inform the area node about overlaps with the respective area object in the physics server. The raycast node queries the direct state of the relevant space in the physics server. + * PhysicsServer3D is the server responsible for all 3D physics. It can directly create and + * manipulate all physics objects: + * - A *space* is a self-contained world for a physics simulation. It contains bodies, areas, and + * joints. Its state can be queried for collision and intersection information, and several parameters + * of the simulation can be modified. + * - A *shape* is a geometric shape such as a sphere, a box, a cylinder, or a polygon. It can be + * used for collision detection by adding it to a body/area, possibly with an extra transformation + * relative to the body/area's origin. Bodies/areas can have multiple (transformed) shapes added to + * them, and a single shape can be added to bodies/areas multiple times with different local + * transformations. + * - A *body* is a physical object which can be in static, kinematic, or rigid mode. Its state (such + * as position and velocity) can be queried and updated. A force integration callback can be set to + * customize the body's physics. + * - An *area* is a region in space which can be used to detect bodies and areas entering and + * exiting it. A body monitoring callback can be set to report entering/exiting body shapes, and + * similarly an area monitoring callback can be set. Gravity and damping can be overridden within the + * area by setting area parameters. + * - A *joint* is a constraint, either between two bodies or on one body relative to a point. + * Parameters such as the joint bias and the rest length of a spring joint can be adjusted. + * Physics objects in [PhysicsServer3D] may be created and manipulated independently; they do not + * have to be tied to nodes in the scene tree. + * **Note:** All the 3D physics nodes use the physics server internally. Adding a physics node to + * the scene tree will cause a corresponding physics object to be created in the physics server. A + * rigid body node registers a callback that updates the node's transform with the transform of the + * respective body object in the physics server (every physics update). An area node registers a + * callback to inform the area node about overlaps with the respective area object in the physics + * server. The raycast node queries the direct state of the relevant space in the physics server. */ @GodotBaseType public object PhysicsServer3D : Object() { @@ -61,90 +71,60 @@ public object PhysicsServer3D : Object() { return false } - /** - * - */ public fun worldBoundaryShapeCreate(): RID { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.worldBoundaryShapeCreatePtr, _RID) return (TransferContext.readReturnValue(_RID, false) as RID) } - /** - * - */ public fun separationRayShapeCreate(): RID { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.separationRayShapeCreatePtr, _RID) return (TransferContext.readReturnValue(_RID, false) as RID) } - /** - * - */ public fun sphereShapeCreate(): RID { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.sphereShapeCreatePtr, _RID) return (TransferContext.readReturnValue(_RID, false) as RID) } - /** - * - */ public fun boxShapeCreate(): RID { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.boxShapeCreatePtr, _RID) return (TransferContext.readReturnValue(_RID, false) as RID) } - /** - * - */ public fun capsuleShapeCreate(): RID { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.capsuleShapeCreatePtr, _RID) return (TransferContext.readReturnValue(_RID, false) as RID) } - /** - * - */ public fun cylinderShapeCreate(): RID { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.cylinderShapeCreatePtr, _RID) return (TransferContext.readReturnValue(_RID, false) as RID) } - /** - * - */ public fun convexPolygonShapeCreate(): RID { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.convexPolygonShapeCreatePtr, _RID) return (TransferContext.readReturnValue(_RID, false) as RID) } - /** - * - */ public fun concavePolygonShapeCreate(): RID { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.concavePolygonShapeCreatePtr, _RID) return (TransferContext.readReturnValue(_RID, false) as RID) } - /** - * - */ public fun heightmapShapeCreate(): RID { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.heightmapShapeCreatePtr, _RID) return (TransferContext.readReturnValue(_RID, false) as RID) } - /** - * - */ public fun customShapeCreate(): RID { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.customShapeCreatePtr, _RID) @@ -152,7 +132,8 @@ public object PhysicsServer3D : Object() { } /** - * Sets the shape data that defines its shape and size. The data to be passed depends on the kind of shape created [shapeGetType]. + * Sets the shape data that defines its shape and size. The data to be passed depends on the kind + * of shape created [shapeGetType]. */ public fun shapeSetData(shape: RID, `data`: Any?): Unit { TransferContext.writeArguments(_RID to shape, ANY to data) @@ -178,7 +159,9 @@ public object PhysicsServer3D : Object() { } /** - * Creates a space. A space is a collection of parameters for the physics engine that can be assigned to an area or a body. It can be assigned to an area with [areaSetSpace], or to a body with [bodySetSpace]. + * Creates a space. A space is a collection of parameters for the physics engine that can be + * assigned to an area or a body. It can be assigned to an area with [areaSetSpace], or to a body + * with [bodySetSpace]. */ public fun spaceCreate(): RID { TransferContext.writeArguments() @@ -204,7 +187,8 @@ public object PhysicsServer3D : Object() { } /** - * Sets the value for a space parameter. A list of available parameters is on the [enum SpaceParameter] constants. + * Sets the value for a space parameter. A list of available parameters is on the [enum + * SpaceParameter] constants. */ public fun spaceSetParam( space: RID, @@ -225,7 +209,8 @@ public object PhysicsServer3D : Object() { } /** - * Returns the state of a space, a [godot.PhysicsDirectSpaceState3D]. This object can be used to make collision/intersection queries. + * Returns the state of a space, a [PhysicsDirectSpaceState3D]. This object can be used to make + * collision/intersection queries. */ public fun spaceGetDirectState(space: RID): PhysicsDirectSpaceState3D? { TransferContext.writeArguments(_RID to space) @@ -234,7 +219,7 @@ public object PhysicsServer3D : Object() { } /** - * Creates an [godot.Area3D]. + * Creates an [Area3D]. */ public fun areaCreate(): RID { TransferContext.writeArguments() @@ -260,7 +245,8 @@ public object PhysicsServer3D : Object() { } /** - * Adds a shape to the area, along with a transform matrix. Shapes are usually referenced by their index, so you should track which shape has a given index. + * Adds a shape to the area, along with a transform matrix. Shapes are usually referenced by their + * index, so you should track which shape has a given index. */ @JvmOverloads public fun areaAddShape( @@ -274,7 +260,8 @@ public object PhysicsServer3D : Object() { } /** - * Substitutes a given area shape by another. The old shape is selected by its index, the new one by its [RID]. + * Substitutes a given area shape by another. The old shape is selected by its index, the new one + * by its [RID]. */ public fun areaSetShape( area: RID, @@ -297,9 +284,6 @@ public object PhysicsServer3D : Object() { TransferContext.callMethod(rawPtr, MethodBindings.areaSetShapeTransformPtr, NIL) } - /** - * - */ public fun areaSetShapeDisabled( area: RID, shapeIdx: Int, @@ -345,7 +329,8 @@ public object PhysicsServer3D : Object() { } /** - * Removes all shapes from an area. It does not delete the shapes, so they can be reassigned later. + * Removes all shapes from an area. It does not delete the shapes, so they can be reassigned + * later. */ public fun areaClearShapes(area: RID): Unit { TransferContext.writeArguments(_RID to area) @@ -387,7 +372,8 @@ public object PhysicsServer3D : Object() { } /** - * Sets the value for an area parameter. A list of available parameters is on the [enum AreaParameter] constants. + * Sets the value for an area parameter. A list of available parameters is on the [enum + * AreaParameter] constants. */ public fun areaSetParam( area: RID, @@ -407,7 +393,8 @@ public object PhysicsServer3D : Object() { } /** - * Returns an area parameter value. A list of available parameters is on the [enum AreaParameter] constants. + * Returns an area parameter value. A list of available parameters is on the [enum AreaParameter] + * constants. */ public fun areaGetParam(area: RID, `param`: AreaParameter): Any? { TransferContext.writeArguments(_RID to area, LONG to param.id) @@ -425,7 +412,7 @@ public object PhysicsServer3D : Object() { } /** - * Assigns the area to a descendant of [godot.Object], so it can exist in the node tree. + * Assigns the area to a descendant of [Object], so it can exist in the node tree. */ public fun areaAttachObjectInstanceId(area: RID, id: Long): Unit { TransferContext.writeArguments(_RID to area, LONG to id) @@ -442,19 +429,18 @@ public object PhysicsServer3D : Object() { } /** - * Sets the area's body monitor callback. This callback will be called when any other (shape of a) body enters or exits (a shape of) the given area, and must take the following five parameters: - * - * 1. an integer `status`: either [AREA_BODY_ADDED] or [AREA_BODY_REMOVED] depending on whether the other body shape entered or exited the area, - * + * Sets the area's body monitor callback. This callback will be called when any other (shape of a) + * body enters or exits (a shape of) the given area, and must take the following five parameters: + * 1. an integer `status`: either [constant AREA_BODY_ADDED] or [constant AREA_BODY_REMOVED] + * depending on whether the other body shape entered or exited the area, * 2. an [RID] `body_rid`: the [RID] of the body that entered or exited the area, - * * 3. an integer `instance_id`: the `ObjectID` attached to the body, - * - * 4. an integer `body_shape_idx`: the index of the shape of the body that entered or exited the area, - * - * 5. an integer `self_shape_idx`: the index of the shape of the area where the body entered or exited. - * - * By counting (or keeping track of) the shapes that enter and exit, it can be determined if a body (with all its shapes) is entering for the first time or exiting for the last time. + * 4. an integer `body_shape_idx`: the index of the shape of the body that entered or exited the + * area, + * 5. an integer `self_shape_idx`: the index of the shape of the area where the body entered or + * exited. + * By counting (or keeping track of) the shapes that enter and exit, it can be determined if a + * body (with all its shapes) is entering for the first time or exiting for the last time. */ public fun areaSetMonitorCallback(area: RID, callback: Callable): Unit { TransferContext.writeArguments(_RID to area, CALLABLE to callback) @@ -462,28 +448,24 @@ public object PhysicsServer3D : Object() { } /** - * Sets the area's area monitor callback. This callback will be called when any other (shape of an) area enters or exits (a shape of) the given area, and must take the following five parameters: - * - * 1. an integer `status`: either [AREA_BODY_ADDED] or [AREA_BODY_REMOVED] depending on whether the other area's shape entered or exited the area, - * + * Sets the area's area monitor callback. This callback will be called when any other (shape of + * an) area enters or exits (a shape of) the given area, and must take the following five parameters: + * 1. an integer `status`: either [constant AREA_BODY_ADDED] or [constant AREA_BODY_REMOVED] + * depending on whether the other area's shape entered or exited the area, * 2. an [RID] `area_rid`: the [RID] of the other area that entered or exited the area, - * * 3. an integer `instance_id`: the `ObjectID` attached to the other area, - * - * 4. an integer `area_shape_idx`: the index of the shape of the other area that entered or exited the area, - * - * 5. an integer `self_shape_idx`: the index of the shape of the area where the other area entered or exited. - * - * By counting (or keeping track of) the shapes that enter and exit, it can be determined if an area (with all its shapes) is entering for the first time or exiting for the last time. + * 4. an integer `area_shape_idx`: the index of the shape of the other area that entered or exited + * the area, + * 5. an integer `self_shape_idx`: the index of the shape of the area where the other area entered + * or exited. + * By counting (or keeping track of) the shapes that enter and exit, it can be determined if an + * area (with all its shapes) is entering for the first time or exiting for the last time. */ public fun areaSetAreaMonitorCallback(area: RID, callback: Callable): Unit { TransferContext.writeArguments(_RID to area, CALLABLE to callback) TransferContext.callMethod(rawPtr, MethodBindings.areaSetAreaMonitorCallbackPtr, NIL) } - /** - * - */ public fun areaSetMonitorable(area: RID, monitorable: Boolean): Unit { TransferContext.writeArguments(_RID to area, BOOL to monitorable) TransferContext.callMethod(rawPtr, MethodBindings.areaSetMonitorablePtr, NIL) @@ -497,9 +479,6 @@ public object PhysicsServer3D : Object() { TransferContext.callMethod(rawPtr, MethodBindings.areaSetRayPickablePtr, NIL) } - /** - * - */ public fun bodyCreate(): RID { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.bodyCreatePtr, _RID) @@ -592,7 +571,8 @@ public object PhysicsServer3D : Object() { } /** - * Adds a shape to the body, along with a transform matrix. Shapes are usually referenced by their index, so you should track which shape has a given index. + * Adds a shape to the body, along with a transform matrix. Shapes are usually referenced by their + * index, so you should track which shape has a given index. */ @JvmOverloads public fun bodyAddShape( @@ -606,7 +586,8 @@ public object PhysicsServer3D : Object() { } /** - * Substitutes a given body shape by another. The old shape is selected by its index, the new one by its [RID]. + * Substitutes a given body shape by another. The old shape is selected by its index, the new one + * by its [RID]. */ public fun bodySetShape( body: RID, @@ -629,9 +610,6 @@ public object PhysicsServer3D : Object() { TransferContext.callMethod(rawPtr, MethodBindings.bodySetShapeTransformPtr, NIL) } - /** - * - */ public fun bodySetShapeDisabled( body: RID, shapeIdx: Int, @@ -685,7 +663,7 @@ public object PhysicsServer3D : Object() { } /** - * Assigns the area to a descendant of [godot.Object], so it can exist in the node tree. + * Assigns the area to a descendant of [Object], so it can exist in the node tree. */ public fun bodyAttachObjectInstanceId(body: RID, id: Long): Unit { TransferContext.writeArguments(_RID to body, LONG to id) @@ -703,8 +681,8 @@ public object PhysicsServer3D : Object() { /** * If `true`, the continuous collision detection mode is enabled. - * - * Continuous collision detection tries to predict where a moving body will collide, instead of moving it and correcting its movement if it collided. + * Continuous collision detection tries to predict where a moving body will collide, instead of + * moving it and correcting its movement if it collided. */ public fun bodySetEnableContinuousCollisionDetection(body: RID, enable: Boolean): Unit { TransferContext.writeArguments(_RID to body, BOOL to enable) @@ -735,7 +713,8 @@ public object PhysicsServer3D : Object() { } /** - * Returns the value of a body parameter. A list of available parameters is on the [enum BodyParameter] constants. + * Returns the value of a body parameter. A list of available parameters is on the [enum + * BodyParameter] constants. */ public fun bodyGetParam(body: RID, `param`: BodyParameter): Any? { TransferContext.writeArguments(_RID to body, LONG to param.id) @@ -744,7 +723,8 @@ public object PhysicsServer3D : Object() { } /** - * Restores the default inertia and center of mass based on shapes to cancel any custom values previously set using [bodySetParam]. + * Restores the default inertia and center of mass based on shapes to cancel any custom values + * previously set using [bodySetParam]. */ public fun bodyResetMassProperties(body: RID): Unit { TransferContext.writeArguments(_RID to body) @@ -774,9 +754,9 @@ public object PhysicsServer3D : Object() { /** * Applies a directional impulse without affecting rotation. - * - * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). - * + * An impulse is time-independent! Applying an impulse every frame would result in a + * framerate-dependent force. For this reason, it should only be used when simulating one-time + * impacts (use the "_force" functions otherwise). * This is equivalent to using [bodyApplyImpulse] at the body's center of mass. */ public fun bodyApplyCentralImpulse(body: RID, impulse: Vector3): Unit { @@ -786,10 +766,10 @@ public object PhysicsServer3D : Object() { /** * Applies a positioned impulse to the body. - * - * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). - * - * [position] is the offset from the body origin in global coordinates. + * An impulse is time-independent! Applying an impulse every frame would result in a + * framerate-dependent force. For this reason, it should only be used when simulating one-time + * impacts (use the "_force" functions otherwise). + * [param position] is the offset from the body origin in global coordinates. */ @JvmOverloads public fun bodyApplyImpulse( @@ -803,8 +783,9 @@ public object PhysicsServer3D : Object() { /** * Applies a rotational impulse to the body without affecting the position. - * - * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). + * An impulse is time-independent! Applying an impulse every frame would result in a + * framerate-dependent force. For this reason, it should only be used when simulating one-time + * impacts (use the "_force" functions otherwise). */ public fun bodyApplyTorqueImpulse(body: RID, impulse: Vector3): Unit { TransferContext.writeArguments(_RID to body, VECTOR3 to impulse) @@ -812,8 +793,8 @@ public object PhysicsServer3D : Object() { } /** - * Applies a directional force without affecting rotation. A force is time dependent and meant to be applied every physics update. - * + * Applies a directional force without affecting rotation. A force is time dependent and meant to + * be applied every physics update. * This is equivalent to using [bodyApplyForce] at the body's center of mass. */ public fun bodyApplyCentralForce(body: RID, force: Vector3): Unit { @@ -822,9 +803,9 @@ public object PhysicsServer3D : Object() { } /** - * Applies a positioned force to the body. A force is time dependent and meant to be applied every physics update. - * - * [position] is the offset from the body origin in global coordinates. + * Applies a positioned force to the body. A force is time dependent and meant to be applied every + * physics update. + * [param position] is the offset from the body origin in global coordinates. */ @JvmOverloads public fun bodyApplyForce( @@ -837,7 +818,8 @@ public object PhysicsServer3D : Object() { } /** - * Applies a rotational force without affecting position. A force is time dependent and meant to be applied every physics update. + * Applies a rotational force without affecting position. A force is time dependent and meant to + * be applied every physics update. */ public fun bodyApplyTorque(body: RID, torque: Vector3): Unit { TransferContext.writeArguments(_RID to body, VECTOR3 to torque) @@ -845,8 +827,8 @@ public object PhysicsServer3D : Object() { } /** - * Adds a constant directional force without affecting rotation that keeps being applied over time until cleared with `body_set_constant_force(body, Vector3(0, 0, 0))`. - * + * Adds a constant directional force without affecting rotation that keeps being applied over time + * until cleared with `body_set_constant_force(body, Vector3(0, 0, 0))`. * This is equivalent to using [bodyAddConstantForce] at the body's center of mass. */ public fun bodyAddConstantCentralForce(body: RID, force: Vector3): Unit { @@ -855,9 +837,9 @@ public object PhysicsServer3D : Object() { } /** - * Adds a constant positioned force to the body that keeps being applied over time until cleared with `body_set_constant_force(body, Vector3(0, 0, 0))`. - * - * [position] is the offset from the body origin in global coordinates. + * Adds a constant positioned force to the body that keeps being applied over time until cleared + * with `body_set_constant_force(body, Vector3(0, 0, 0))`. + * [param position] is the offset from the body origin in global coordinates. */ @JvmOverloads public fun bodyAddConstantForce( @@ -870,7 +852,8 @@ public object PhysicsServer3D : Object() { } /** - * Adds a constant rotational force without affecting position that keeps being applied over time until cleared with `body_set_constant_torque(body, Vector3(0, 0, 0))`. + * Adds a constant rotational force without affecting position that keeps being applied over time + * until cleared with `body_set_constant_torque(body, Vector3(0, 0, 0))`. */ public fun bodyAddConstantTorque(body: RID, torque: Vector3): Unit { TransferContext.writeArguments(_RID to body, VECTOR3 to torque) @@ -879,7 +862,6 @@ public object PhysicsServer3D : Object() { /** * Sets the body's total constant positional forces applied during each physics update. - * * See [bodyAddConstantForce] and [bodyAddConstantCentralForce]. */ public fun bodySetConstantForce(body: RID, force: Vector3): Unit { @@ -889,7 +871,6 @@ public object PhysicsServer3D : Object() { /** * Returns the body's total constant positional forces applied during each physics update. - * * See [bodyAddConstantForce] and [bodyAddConstantCentralForce]. */ public fun bodyGetConstantForce(body: RID): Vector3 { @@ -900,7 +881,6 @@ public object PhysicsServer3D : Object() { /** * Sets the body's total constant rotational forces applied during each physics update. - * * See [bodyAddConstantTorque]. */ public fun bodySetConstantTorque(body: RID, torque: Vector3): Unit { @@ -910,7 +890,6 @@ public object PhysicsServer3D : Object() { /** * Returns the body's total constant rotational forces applied during each physics update. - * * See [bodyAddConstantTorque]. */ public fun bodyGetConstantTorque(body: RID): Vector3 { @@ -920,16 +899,14 @@ public object PhysicsServer3D : Object() { } /** - * Sets an axis velocity. The velocity in the given vector axis will be set as the given vector length. This is useful for jumping behavior. + * Sets an axis velocity. The velocity in the given vector axis will be set as the given vector + * length. This is useful for jumping behavior. */ public fun bodySetAxisVelocity(body: RID, axisVelocity: Vector3): Unit { TransferContext.writeArguments(_RID to body, VECTOR3 to axisVelocity) TransferContext.callMethod(rawPtr, MethodBindings.bodySetAxisVelocityPtr, NIL) } - /** - * - */ public fun bodySetAxisLock( body: RID, axis: BodyAxis, @@ -939,9 +916,6 @@ public object PhysicsServer3D : Object() { TransferContext.callMethod(rawPtr, MethodBindings.bodySetAxisLockPtr, NIL) } - /** - * - */ public fun bodyIsAxisLocked(body: RID, axis: BodyAxis): Boolean { TransferContext.writeArguments(_RID to body, LONG to axis.id) TransferContext.callMethod(rawPtr, MethodBindings.bodyIsAxisLockedPtr, BOOL) @@ -958,8 +932,8 @@ public object PhysicsServer3D : Object() { /** * Removes a body from the list of bodies exempt from collisions. - * - * Continuous collision detection tries to predict where a moving body will collide, instead of moving it and correcting its movement if it collided. + * Continuous collision detection tries to predict where a moving body will collide, instead of + * moving it and correcting its movement if it collided. */ public fun bodyRemoveCollisionException(body: RID, exceptedBody: RID): Unit { TransferContext.writeArguments(_RID to body, _RID to exceptedBody) @@ -967,7 +941,8 @@ public object PhysicsServer3D : Object() { } /** - * Sets the maximum contacts to report. Bodies can keep a log of the contacts with other bodies. This is enabled by setting the maximum number of contacts reported to a number greater than 0. + * Sets the maximum contacts to report. Bodies can keep a log of the contacts with other bodies. + * This is enabled by setting the maximum number of contacts reported to a number greater than 0. */ public fun bodySetMaxContactsReported(body: RID, amount: Int): Unit { TransferContext.writeArguments(_RID to body, LONG to amount.toLong()) @@ -984,7 +959,8 @@ public object PhysicsServer3D : Object() { } /** - * Sets whether a body uses a callback function to calculate its own physics (see [bodySetForceIntegrationCallback]). + * Sets whether a body uses a callback function to calculate its own physics (see + * [bodySetForceIntegrationCallback]). */ public fun bodySetOmitForceIntegration(body: RID, enable: Boolean): Unit { TransferContext.writeArguments(_RID to body, BOOL to enable) @@ -992,7 +968,8 @@ public object PhysicsServer3D : Object() { } /** - * Returns whether a body uses a callback function to calculate its own physics (see [bodySetForceIntegrationCallback]). + * Returns whether a body uses a callback function to calculate its own physics (see + * [bodySetForceIntegrationCallback]). */ public fun bodyIsOmittingForceIntegration(body: RID): Boolean { TransferContext.writeArguments(_RID to body) @@ -1001,11 +978,11 @@ public object PhysicsServer3D : Object() { } /** - * Sets the function used to calculate physics for an object, if that object allows it (see [bodySetOmitForceIntegration]). The force integration function takes 2 arguments: - * - * - `state` — [godot.PhysicsDirectBodyState3D] used to retrieve and modify the body's state. - * - * - [code skip-lint]userdata` — optional user data passed to [bodySetForceIntegrationCallback]. + * Sets the function used to calculate physics for an object, if that object allows it (see + * [bodySetOmitForceIntegration]). The force integration function takes 2 arguments: + * - `state` — [PhysicsDirectBodyState3D] used to retrieve and modify the body's state. + * - [code skip-lint]userdata[/code] — optional user data passed to + * [bodySetForceIntegrationCallback]. */ @JvmOverloads public fun bodySetForceIntegrationCallback( @@ -1018,7 +995,7 @@ public object PhysicsServer3D : Object() { } /** - * Sets the body pickable with rays if [enable] is set. + * Sets the body pickable with rays if [param enable] is set. */ public fun bodySetRayPickable(body: RID, enable: Boolean): Unit { TransferContext.writeArguments(_RID to body, BOOL to enable) @@ -1026,7 +1003,9 @@ public object PhysicsServer3D : Object() { } /** - * Returns `true` if a collision would result from moving along a motion vector from a given point in space. [godot.PhysicsTestMotionParameters3D] is passed to set motion parameters. [godot.PhysicsTestMotionResult3D] can be passed to return additional information. + * Returns `true` if a collision would result from moving along a motion vector from a given point + * in space. [PhysicsTestMotionParameters3D] is passed to set motion parameters. + * [PhysicsTestMotionResult3D] can be passed to return additional information. */ @JvmOverloads public fun bodyTestMotion( @@ -1040,7 +1019,8 @@ public object PhysicsServer3D : Object() { } /** - * Returns the [godot.PhysicsDirectBodyState3D] of the body. Returns `null` if the body is destroyed or removed from the physics space. + * Returns the [PhysicsDirectBodyState3D] of the body. Returns `null` if the body is destroyed or + * removed from the physics space. */ public fun bodyGetDirectState(body: RID): PhysicsDirectBodyState3D? { TransferContext.writeArguments(_RID to body) @@ -1048,9 +1028,6 @@ public object PhysicsServer3D : Object() { return (TransferContext.readReturnValue(OBJECT, true) as PhysicsDirectBodyState3D?) } - /** - * - */ public fun softBodyGetBounds(body: RID): AABB { TransferContext.writeArguments(_RID to body) TransferContext.callMethod(rawPtr, MethodBindings.softBodyGetBoundsPtr, @@ -1058,26 +1035,17 @@ public object PhysicsServer3D : Object() { return (TransferContext.readReturnValue(godot.core.VariantType.AABB, false) as AABB) } - /** - * - */ public fun jointCreate(): RID { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.jointCreatePtr, _RID) return (TransferContext.readReturnValue(_RID, false) as RID) } - /** - * - */ public fun jointClear(joint: RID): Unit { TransferContext.writeArguments(_RID to joint) TransferContext.callMethod(rawPtr, MethodBindings.jointClearPtr, NIL) } - /** - * - */ public fun jointMakePin( joint: RID, bodyA: RID, @@ -1144,9 +1112,6 @@ public object PhysicsServer3D : Object() { return (TransferContext.readReturnValue(VECTOR3, false) as Vector3) } - /** - * - */ public fun jointMakeHinge( joint: RID, bodyA: RID, @@ -1200,9 +1165,6 @@ public object PhysicsServer3D : Object() { return (TransferContext.readReturnValue(BOOL, false) as Boolean) } - /** - * - */ public fun jointMakeSlider( joint: RID, bodyA: RID, @@ -1235,9 +1197,6 @@ public object PhysicsServer3D : Object() { return (TransferContext.readReturnValue(DOUBLE, false) as Double).toFloat() } - /** - * - */ public fun jointMakeConeTwist( joint: RID, bodyA: RID, @@ -1297,7 +1256,7 @@ public object PhysicsServer3D : Object() { } /** - * Sets whether the bodies attached to the [godot.Joint3D] will collide with each other. + * Sets whether the bodies attached to the [Joint3D] will collide with each other. */ public fun jointDisableCollisionsBetweenBodies(joint: RID, disable: Boolean): Unit { TransferContext.writeArguments(_RID to joint, BOOL to disable) @@ -1305,7 +1264,7 @@ public object PhysicsServer3D : Object() { } /** - * Returns whether the bodies attached to the [godot.Joint3D] will collide with each other. + * Returns whether the bodies attached to the [Joint3D] will collide with each other. */ public fun jointIsDisabledCollisionsBetweenBodies(joint: RID): Boolean { TransferContext.writeArguments(_RID to joint) @@ -1314,9 +1273,6 @@ public object PhysicsServer3D : Object() { return (TransferContext.readReturnValue(BOOL, false) as Boolean) } - /** - * - */ public fun jointMakeGeneric6dof( joint: RID, bodyA: RID, @@ -1381,7 +1337,8 @@ public object PhysicsServer3D : Object() { } /** - * Destroys any of the objects created by PhysicsServer3D. If the [RID] passed is not one of the objects that can be created by PhysicsServer3D, an error will be sent to the console. + * Destroys any of the objects created by PhysicsServer3D. If the [RID] passed is not one of the + * objects that can be created by PhysicsServer3D, an error will be sent to the console. */ public fun freeRid(rid: RID): Unit { TransferContext.writeArguments(_RID to rid) @@ -1397,7 +1354,8 @@ public object PhysicsServer3D : Object() { } /** - * Returns information about the current state of the 3D physics engine. See [enum ProcessInfo] for a list of available states. + * Returns information about the current state of the 3D physics engine. See [enum ProcessInfo] + * for a list of available states. */ public fun getProcessInfo(processInfo: ProcessInfo): Int { TransferContext.writeArguments(LONG to processInfo.id) @@ -1409,23 +1367,23 @@ public object PhysicsServer3D : Object() { id: Long, ) { /** - * The [godot.Joint3D] is a [godot.PinJoint3D]. + * The [Joint3D] is a [PinJoint3D]. */ JOINT_TYPE_PIN(0), /** - * The [godot.Joint3D] is a [godot.HingeJoint3D]. + * The [Joint3D] is a [HingeJoint3D]. */ JOINT_TYPE_HINGE(1), /** - * The [godot.Joint3D] is a [godot.SliderJoint3D]. + * The [Joint3D] is a [SliderJoint3D]. */ JOINT_TYPE_SLIDER(2), /** - * The [godot.Joint3D] is a [godot.ConeTwistJoint3D]. + * The [Joint3D] is a [ConeTwistJoint3D]. */ JOINT_TYPE_CONE_TWIST(3), /** - * The [godot.Joint3D] is a [godot.Generic6DOFJoint3D]. + * The [Joint3D] is a [Generic6DOFJoint3D]. */ JOINT_TYPE_6DOF(4), /** @@ -1449,18 +1407,17 @@ public object PhysicsServer3D : Object() { ) { /** * The strength with which the pinned objects try to stay in positional relation to each other. - * * The higher, the stronger. */ PIN_JOINT_BIAS(0), /** * The strength with which the pinned objects try to stay in velocity relation to each other. - * * The higher, the stronger. */ PIN_JOINT_DAMPING(1), /** - * If above 0, this value is the maximum value for an impulse that this Joint3D puts on its ends. + * If above 0, this value is the maximum value for an impulse that this Joint3D puts on its + * ends. */ PIN_JOINT_IMPULSE_CLAMP(2), ; @@ -1479,7 +1436,8 @@ public object PhysicsServer3D : Object() { id: Long, ) { /** - * The speed with which the two bodies get pulled together when they move in different directions. + * The speed with which the two bodies get pulled together when they move in different + * directions. */ HINGE_JOINT_BIAS(0), /** @@ -1494,9 +1452,6 @@ public object PhysicsServer3D : Object() { * The speed with which the rotation across the axis perpendicular to the hinge gets corrected. */ HINGE_JOINT_LIMIT_BIAS(3), - /** - * - */ HINGE_JOINT_LIMIT_SOFTNESS(4), /** * The lower this value, the more the rotation gets slowed down. @@ -1557,11 +1512,13 @@ public object PhysicsServer3D : Object() { */ SLIDER_JOINT_LINEAR_LIMIT_LOWER(1), /** - * A factor applied to the movement across the slider axis once the limits get surpassed. The lower, the slower the movement. + * A factor applied to the movement across the slider axis once the limits get surpassed. The + * lower, the slower the movement. */ SLIDER_JOINT_LINEAR_LIMIT_SOFTNESS(2), /** - * The amount of restitution once the limits are surpassed. The lower, the more velocity-energy gets lost. + * The amount of restitution once the limits are surpassed. The lower, the more velocity-energy + * gets lost. */ SLIDER_JOINT_LINEAR_LIMIT_RESTITUTION(3), /** @@ -1569,7 +1526,8 @@ public object PhysicsServer3D : Object() { */ SLIDER_JOINT_LINEAR_LIMIT_DAMPING(4), /** - * A factor applied to the movement across the slider axis as long as the slider is in the limits. The lower, the slower the movement. + * A factor applied to the movement across the slider axis as long as the slider is in the + * limits. The lower, the slower the movement. */ SLIDER_JOINT_LINEAR_MOTION_SOFTNESS(5), /** @@ -1657,28 +1615,24 @@ public object PhysicsServer3D : Object() { ) { /** * Swing is rotation from side to side, around the axis perpendicular to the twist axis. - * * The swing span defines, how much rotation will not get corrected along the swing axis. - * - * Could be defined as looseness in the [godot.ConeTwistJoint3D]. - * + * Could be defined as looseness in the [ConeTwistJoint3D]. * If below 0.05, this behavior is locked. */ CONE_TWIST_JOINT_SWING_SPAN(0), /** * Twist is the rotation around the twist axis, this value defined how far the joint can twist. - * * Twist is locked if below 0.05. */ CONE_TWIST_JOINT_TWIST_SPAN(1), /** * The speed with which the swing or twist will take place. - * * The higher, the faster. */ CONE_TWIST_JOINT_BIAS(2), /** - * The ease with which the Joint3D twists, if it's too low, it takes more force to twist the joint. + * The ease with which the Joint3D twists, if it's too low, it takes more force to twist the + * joint. */ CONE_TWIST_JOINT_SOFTNESS(3), /** @@ -1709,11 +1663,13 @@ public object PhysicsServer3D : Object() { */ G6DOF_JOINT_LINEAR_UPPER_LIMIT(1), /** - * A factor that gets applied to the movement across the axes. The lower, the slower the movement. + * A factor that gets applied to the movement across the axes. The lower, the slower the + * movement. */ G6DOF_JOINT_LINEAR_LIMIT_SOFTNESS(2), /** - * The amount of restitution on the axes movement. The lower, the more velocity-energy gets lost. + * The amount of restitution on the axes movement. The lower, the more velocity-energy gets + * lost. */ G6DOF_JOINT_LINEAR_RESTITUTION(3), /** @@ -1753,7 +1709,8 @@ public object PhysicsServer3D : Object() { */ G6DOF_JOINT_ANGULAR_FORCE_LIMIT(15), /** - * When correcting the crossing of limits in rotation across the axes, this error tolerance factor defines how much the correction gets slowed down. The lower, the slower. + * When correcting the crossing of limits in rotation across the axes, this error tolerance + * factor defines how much the correction gets slowed down. The lower, the slower. */ G6DOF_JOINT_ANGULAR_ERP(16), /** @@ -1811,47 +1768,49 @@ public object PhysicsServer3D : Object() { id: Long, ) { /** - * The [godot.Shape3D] is a [godot.WorldBoundaryShape3D]. + * The [Shape3D] is a [WorldBoundaryShape3D]. */ SHAPE_WORLD_BOUNDARY(0), /** - * The [godot.Shape3D] is a [godot.SeparationRayShape3D]. + * The [Shape3D] is a [SeparationRayShape3D]. */ SHAPE_SEPARATION_RAY(1), /** - * The [godot.Shape3D] is a [godot.SphereShape3D]. + * The [Shape3D] is a [SphereShape3D]. */ SHAPE_SPHERE(2), /** - * The [godot.Shape3D] is a [godot.BoxShape3D]. + * The [Shape3D] is a [BoxShape3D]. */ SHAPE_BOX(3), /** - * The [godot.Shape3D] is a [godot.CapsuleShape3D]. + * The [Shape3D] is a [CapsuleShape3D]. */ SHAPE_CAPSULE(4), /** - * The [godot.Shape3D] is a [godot.CylinderShape3D]. + * The [Shape3D] is a [CylinderShape3D]. */ SHAPE_CYLINDER(5), /** - * The [godot.Shape3D] is a [godot.ConvexPolygonShape3D]. + * The [Shape3D] is a [ConvexPolygonShape3D]. */ SHAPE_CONVEX_POLYGON(6), /** - * The [godot.Shape3D] is a [godot.ConcavePolygonShape3D]. + * The [Shape3D] is a [ConcavePolygonShape3D]. */ SHAPE_CONCAVE_POLYGON(7), /** - * The [godot.Shape3D] is a [godot.HeightMapShape3D]. + * The [Shape3D] is a [HeightMapShape3D]. */ SHAPE_HEIGHTMAP(8), /** - * The [godot.Shape3D] is used internally for a soft body. Any attempt to create this kind of shape results in an error. + * The [Shape3D] is used internally for a soft body. Any attempt to create this kind of shape + * results in an error. */ SHAPE_SOFT_BODY(9), /** - * This constant is used internally by the engine. Any attempt to create this kind of shape results in an error. + * This constant is used internally by the engine. Any attempt to create this kind of shape + * results in an error. */ SHAPE_CUSTOM(10), ; @@ -1870,7 +1829,8 @@ public object PhysicsServer3D : Object() { id: Long, ) { /** - * Constant to set/get gravity override mode in an area. See [enum AreaSpaceOverrideMode] for possible values. + * Constant to set/get gravity override mode in an area. See [enum AreaSpaceOverrideMode] for + * possible values. */ AREA_PARAM_GRAVITY_OVERRIDE_MODE(0), /** @@ -1886,13 +1846,19 @@ public object PhysicsServer3D : Object() { */ AREA_PARAM_GRAVITY_IS_POINT(3), /** - * Constant to set/get the distance at which the gravity strength is equal to the gravity controlled by [AREA_PARAM_GRAVITY]. For example, on a planet 100 meters in radius with a surface gravity of 4.0 m/s², set the gravity to 4.0 and the unit distance to 100.0. The gravity will have falloff according to the inverse square law, so in the example, at 200 meters from the center the gravity will be 1.0 m/s² (twice the distance, 1/4th the gravity), at 50 meters it will be 16.0 m/s² (half the distance, 4x the gravity), and so on. - * - * The above is true only when the unit distance is a positive number. When this is set to 0.0, the gravity will be constant regardless of distance. + * Constant to set/get the distance at which the gravity strength is equal to the gravity + * controlled by [constant AREA_PARAM_GRAVITY]. For example, on a planet 100 meters in radius with + * a surface gravity of 4.0 m/s², set the gravity to 4.0 and the unit distance to 100.0. The + * gravity will have falloff according to the inverse square law, so in the example, at 200 meters + * from the center the gravity will be 1.0 m/s² (twice the distance, 1/4th the gravity), at 50 + * meters it will be 16.0 m/s² (half the distance, 4x the gravity), and so on. + * The above is true only when the unit distance is a positive number. When this is set to 0.0, + * the gravity will be constant regardless of distance. */ AREA_PARAM_GRAVITY_POINT_UNIT_DISTANCE(4), /** - * Constant to set/get linear damping override mode in an area. See [enum AreaSpaceOverrideMode] for possible values. + * Constant to set/get linear damping override mode in an area. See [enum AreaSpaceOverrideMode] + * for possible values. */ AREA_PARAM_LINEAR_DAMP_OVERRIDE_MODE(5), /** @@ -1900,7 +1866,8 @@ public object PhysicsServer3D : Object() { */ AREA_PARAM_LINEAR_DAMP(6), /** - * Constant to set/get angular damping override mode in an area. See [enum AreaSpaceOverrideMode] for possible values. + * Constant to set/get angular damping override mode in an area. See [enum + * AreaSpaceOverrideMode] for possible values. */ AREA_PARAM_ANGULAR_DAMP_OVERRIDE_MODE(7), /** @@ -1916,15 +1883,18 @@ public object PhysicsServer3D : Object() { */ AREA_PARAM_WIND_FORCE_MAGNITUDE(10), /** - * Constant to set/get the 3D vector that specifies the origin from which an area-specific wind blows. + * Constant to set/get the 3D vector that specifies the origin from which an area-specific wind + * blows. */ AREA_PARAM_WIND_SOURCE(11), /** - * Constant to set/get the 3D vector that specifies the direction in which an area-specific wind blows. + * Constant to set/get the 3D vector that specifies the direction in which an area-specific wind + * blows. */ AREA_PARAM_WIND_DIRECTION(12), /** - * Constant to set/get the exponential rate at which wind force decreases with distance from its origin. + * Constant to set/get the exponential rate at which wind force decreases with distance from its + * origin. */ AREA_PARAM_WIND_ATTENUATION_FACTOR(13), ; @@ -1943,23 +1913,28 @@ public object PhysicsServer3D : Object() { id: Long, ) { /** - * This area does not affect gravity/damp. These are generally areas that exist only to detect collisions, and objects entering or exiting them. + * This area does not affect gravity/damp. These are generally areas that exist only to detect + * collisions, and objects entering or exiting them. */ AREA_SPACE_OVERRIDE_DISABLED(0), /** - * This area adds its gravity/damp values to whatever has been calculated so far. This way, many overlapping areas can combine their physics to make interesting effects. + * This area adds its gravity/damp values to whatever has been calculated so far. This way, many + * overlapping areas can combine their physics to make interesting effects. */ AREA_SPACE_OVERRIDE_COMBINE(1), /** - * This area adds its gravity/damp values to whatever has been calculated so far. Then stops taking into account the rest of the areas, even the default one. + * This area adds its gravity/damp values to whatever has been calculated so far. Then stops + * taking into account the rest of the areas, even the default one. */ AREA_SPACE_OVERRIDE_COMBINE_REPLACE(2), /** - * This area replaces any gravity/damp, even the default one, and stops taking into account the rest of the areas. + * This area replaces any gravity/damp, even the default one, and stops taking into account the + * rest of the areas. */ AREA_SPACE_OVERRIDE_REPLACE(3), /** - * This area replaces any gravity/damp calculated so far, but keeps calculating the rest of the areas, down to the default one. + * This area replaces any gravity/damp calculated so far, but keeps calculating the rest of the + * areas, down to the default one. */ AREA_SPACE_OVERRIDE_REPLACE_COMBINE(4), ; @@ -1978,19 +1953,23 @@ public object PhysicsServer3D : Object() { id: Long, ) { /** - * Constant for static bodies. In this mode, a body can be only moved by user code and doesn't collide with other bodies along its path when moved. + * Constant for static bodies. In this mode, a body can be only moved by user code and doesn't + * collide with other bodies along its path when moved. */ BODY_MODE_STATIC(0), /** - * Constant for kinematic bodies. In this mode, a body can be only moved by user code and collides with other bodies along its path. + * Constant for kinematic bodies. In this mode, a body can be only moved by user code and + * collides with other bodies along its path. */ BODY_MODE_KINEMATIC(1), /** - * Constant for rigid bodies. In this mode, a body can be pushed by other bodies and has forces applied. + * Constant for rigid bodies. In this mode, a body can be pushed by other bodies and has forces + * applied. */ BODY_MODE_RIGID(2), /** - * Constant for linear rigid bodies. In this mode, a body can not rotate, and only its linear velocity is affected by external forces. + * Constant for linear rigid bodies. In this mode, a body can not rotate, and only its linear + * velocity is affected by external forces. */ BODY_MODE_RIGID_LINEAR(3), ; @@ -2033,11 +2012,13 @@ public object PhysicsServer3D : Object() { */ BODY_PARAM_GRAVITY_SCALE(5), /** - * Constant to set/get a body's linear damping mode. See [enum BodyDampMode] for possible values. + * Constant to set/get a body's linear damping mode. See [enum BodyDampMode] for possible + * values. */ BODY_PARAM_LINEAR_DAMP_MODE(6), /** - * Constant to set/get a body's angular damping mode. See [enum BodyDampMode] for possible values. + * Constant to set/get a body's angular damping mode. See [enum BodyDampMode] for possible + * values. */ BODY_PARAM_ANGULAR_DAMP_MODE(7), /** @@ -2126,11 +2107,13 @@ public object PhysicsServer3D : Object() { id: Long, ) { /** - * The value of the first parameter and area callback function receives, when an object enters one of its shapes. + * The value of the first parameter and area callback function receives, when an object enters + * one of its shapes. */ AREA_BODY_ADDED(0), /** - * The value of the first parameter and area callback function receives, when an object exits one of its shapes. + * The value of the first parameter and area callback function receives, when an object exits + * one of its shapes. */ AREA_BODY_REMOVED(1), ; @@ -2176,35 +2159,45 @@ public object PhysicsServer3D : Object() { id: Long, ) { /** - * Constant to set/get the maximum distance a pair of bodies has to move before their collision status has to be recalculated. + * Constant to set/get the maximum distance a pair of bodies has to move before their collision + * status has to be recalculated. */ SPACE_PARAM_CONTACT_RECYCLE_RADIUS(0), /** - * Constant to set/get the maximum distance a shape can be from another before they are considered separated and the contact is discarded. + * Constant to set/get the maximum distance a shape can be from another before they are + * considered separated and the contact is discarded. */ SPACE_PARAM_CONTACT_MAX_SEPARATION(1), /** - * Constant to set/get the maximum distance a shape can penetrate another shape before it is considered a collision. + * Constant to set/get the maximum distance a shape can penetrate another shape before it is + * considered a collision. */ SPACE_PARAM_CONTACT_MAX_ALLOWED_PENETRATION(2), /** - * Constant to set/get the default solver bias for all physics contacts. A solver bias is a factor controlling how much two objects "rebound", after overlapping, to avoid leaving them in that state because of numerical imprecision. + * Constant to set/get the default solver bias for all physics contacts. A solver bias is a + * factor controlling how much two objects "rebound", after overlapping, to avoid leaving them in + * that state because of numerical imprecision. */ SPACE_PARAM_CONTACT_DEFAULT_BIAS(3), /** - * Constant to set/get the threshold linear velocity of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after the time given. + * Constant to set/get the threshold linear velocity of activity. A body marked as potentially + * inactive for both linear and angular velocity will be put to sleep after the time given. */ SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_THRESHOLD(4), /** - * Constant to set/get the threshold angular velocity of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after the time given. + * Constant to set/get the threshold angular velocity of activity. A body marked as potentially + * inactive for both linear and angular velocity will be put to sleep after the time given. */ SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_THRESHOLD(5), /** - * Constant to set/get the maximum time of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after this time. + * Constant to set/get the maximum time of activity. A body marked as potentially inactive for + * both linear and angular velocity will be put to sleep after this time. */ SPACE_PARAM_BODY_TIME_TO_SLEEP(6), /** - * Constant to set/get the number of solver iterations for contacts and constraints. The greater the number of iterations, the more accurate the collisions and constraints will be. However, a greater number of iterations requires more CPU power, which can decrease performance. + * Constant to set/get the number of solver iterations for contacts and constraints. The greater + * the number of iterations, the more accurate the collisions and constraints will be. However, a + * greater number of iterations requires more CPU power, which can decrease performance. */ SPACE_PARAM_SOLVER_ITERATIONS(7), ; @@ -2222,29 +2215,11 @@ public object PhysicsServer3D : Object() { public enum class BodyAxis( id: Long, ) { - /** - * - */ BODY_AXIS_LINEAR_X(1), - /** - * - */ BODY_AXIS_LINEAR_Y(2), - /** - * - */ BODY_AXIS_LINEAR_Z(4), - /** - * - */ BODY_AXIS_ANGULAR_X(8), - /** - * - */ BODY_AXIS_ANGULAR_Y(16), - /** - * - */ BODY_AXIS_ANGULAR_Z(32), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsServer3DManager.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsServer3DManager.kt index 88e98c7ba..01007eedd 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsServer3DManager.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsServer3DManager.kt @@ -22,11 +22,10 @@ import kotlin.Suppress import kotlin.Unit /** - * A singleton for managing [godot.PhysicsServer3D] implementations. - * - * [godot.PhysicsServer3DManager] is the API for registering [godot.PhysicsServer3D] implementations and for setting the default implementation. - * - * **Note:** It is not possible to switch physics servers at runtime. This class is only used on startup at the server initialization level, by Godot itself and possibly by GDExtensions. + * [PhysicsServer3DManager] is the API for registering [PhysicsServer3D] implementations and for + * setting the default implementation. + * **Note:** It is not possible to switch physics servers at runtime. This class is only used on + * startup at the server initialization level, by Godot itself and possibly by GDExtensions. */ @GodotBaseType public object PhysicsServer3DManager : Object() { @@ -36,7 +35,8 @@ public object PhysicsServer3DManager : Object() { } /** - * Register a [godot.PhysicsServer3D] implementation by passing a [name] and a [godot.Callable] that returns a [godot.PhysicsServer3D] object. + * Register a [PhysicsServer3D] implementation by passing a [param name] and a [Callable] that + * returns a [PhysicsServer3D] object. */ public fun registerServer(name: String, createCallback: Callable): Unit { TransferContext.writeArguments(STRING to name, CALLABLE to createCallback) @@ -44,7 +44,8 @@ public object PhysicsServer3DManager : Object() { } /** - * Set the default [godot.PhysicsServer3D] implementation to the one identified by [name], if [priority] is greater than the priority of the current default implementation. + * Set the default [PhysicsServer3D] implementation to the one identified by [param name], if + * [param priority] is greater than the priority of the current default implementation. */ public fun setDefaultServer(name: String, priority: Int): Unit { TransferContext.writeArguments(STRING to name, LONG to priority.toLong()) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsServer3DRenderingServerHandler.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsServer3DRenderingServerHandler.kt index 7bb17e894..d4ff72e23 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsServer3DRenderingServerHandler.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsServer3DRenderingServerHandler.kt @@ -20,9 +20,6 @@ import kotlin.Int import kotlin.Suppress import kotlin.Unit -/** - * A class used to provide [godot.PhysicsServer3DExtension.SoftBodyUpdateRenderingServer] with a rendering handler for soft bodies. - */ @GodotBaseType public open class PhysicsServer3DRenderingServerHandler : Object() { public override fun new(scriptIndex: Int): Boolean { @@ -31,29 +28,29 @@ public open class PhysicsServer3DRenderingServerHandler : Object() { } /** - * Called by the [godot.PhysicsServer3D] to set the position for the [godot.SoftBody3D] vertex at the index specified by [vertexId]. - * - * **Note:** The [vertex] parameter used to be of type `const void*` prior to Godot 4.2. + * Called by the [PhysicsServer3D] to set the position for the [SoftBody3D] vertex at the index + * specified by [param vertex_id]. + * **Note:** The [param vertex] parameter used to be of type `const void*` prior to Godot 4.2. */ public open fun _setVertex(vertexId: Int, vertex: Vector3): Unit { } /** - * Called by the [godot.PhysicsServer3D] to set the normal for the [godot.SoftBody3D] vertex at the index specified by [vertexId]. - * - * **Note:** The [normal] parameter used to be of type `const void*` prior to Godot 4.2. + * Called by the [PhysicsServer3D] to set the normal for the [SoftBody3D] vertex at the index + * specified by [param vertex_id]. + * **Note:** The [param normal] parameter used to be of type `const void*` prior to Godot 4.2. */ public open fun _setNormal(vertexId: Int, normal: Vector3): Unit { } /** - * Called by the [godot.PhysicsServer3D] to set the bounding box for the [godot.SoftBody3D]. + * Called by the [PhysicsServer3D] to set the bounding box for the [SoftBody3D]. */ public open fun _setAabb(aabb: AABB): Unit { } /** - * Sets the position for the [godot.SoftBody3D] vertex at the index specified by [vertexId]. + * Sets the position for the [SoftBody3D] vertex at the index specified by [param vertex_id]. */ public fun setVertex(vertexId: Int, vertex: Vector3): Unit { TransferContext.writeArguments(LONG to vertexId.toLong(), VECTOR3 to vertex) @@ -61,7 +58,7 @@ public open class PhysicsServer3DRenderingServerHandler : Object() { } /** - * Sets the normal for the [godot.SoftBody3D] vertex at the index specified by [vertexId]. + * Sets the normal for the [SoftBody3D] vertex at the index specified by [param vertex_id]. */ public fun setNormal(vertexId: Int, normal: Vector3): Unit { TransferContext.writeArguments(LONG to vertexId.toLong(), VECTOR3 to normal) @@ -69,7 +66,7 @@ public open class PhysicsServer3DRenderingServerHandler : Object() { } /** - * Sets the bounding box for the [godot.SoftBody3D]. + * Sets the bounding box for the [SoftBody3D]. */ public fun setAabb(aabb: AABB): Unit { TransferContext.writeArguments(godot.core.VariantType.AABB to aabb) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsShapeQueryParameters2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsShapeQueryParameters2D.kt index 694a56f23..45f388e96 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsShapeQueryParameters2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsShapeQueryParameters2D.kt @@ -34,14 +34,16 @@ import kotlin.Suppress import kotlin.Unit /** - * Provides parameters for [godot.PhysicsDirectSpaceState2D.intersectShape]. - * - * By changing various properties of this object, such as the shape, you can configure the parameters for [godot.PhysicsDirectSpaceState2D.intersectShape]. + * By changing various properties of this object, such as the shape, you can configure the + * parameters for [PhysicsDirectSpaceState2D.intersectShape]. */ @GodotBaseType public open class PhysicsShapeQueryParameters2D : RefCounted() { /** - * The physics layers the query will detect (as a bitmask). By default, all collision layers are detected. See [godot.Collision layers and masks]($DOCS_URL/tutorials/physics/physics_introduction.html#collision-layers-and-masks) in the documentation for more information. + * The physics layers the query will detect (as a bitmask). By default, all collision layers are + * detected. See + * [url=$DOCS_URL/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision + * layers and masks[/url] in the documentation for more information. */ public var collisionMask: Long get() { @@ -55,7 +57,8 @@ public open class PhysicsShapeQueryParameters2D : RefCounted() { } /** - * The list of object [RID]s that will be excluded from collisions. Use [godot.CollisionObject2D.getRid] to get the [RID] associated with a [godot.CollisionObject2D]-derived node. + * The list of object [RID]s that will be excluded from collisions. Use [CollisionObject2D.getRid] + * to get the [RID] associated with a [CollisionObject2D]-derived node. */ public var exclude: VariantArray get() { @@ -98,7 +101,9 @@ public open class PhysicsShapeQueryParameters2D : RefCounted() { } /** - * The [godot.Shape2D] that will be used for collision/intersection queries. This stores the actual reference which avoids the shape to be released while being used for queries, so always prefer using this over [shapeRid]. + * The [Shape2D] that will be used for collision/intersection queries. This stores the actual + * reference which avoids the shape to be released while being used for queries, so always prefer + * using this over [shapeRid]. */ public var shape: Resource? get() { @@ -112,63 +117,37 @@ public open class PhysicsShapeQueryParameters2D : RefCounted() { } /** - * The queried shape's [RID] that will be used for collision/intersection queries. Use this over [shape] if you want to optimize for performance using the Servers API: - * - * [codeblocks] - * - * [gdscript] + * The queried shape's [RID] that will be used for collision/intersection queries. Use this over + * [shape] if you want to optimize for performance using the Servers API: * + * gdscript: + * ```gdscript * var shape_rid = PhysicsServer2D.circle_shape_create() - * * var radius = 64 - * * PhysicsServer2D.shape_set_data(shape_rid, radius) * - * - * * var params = PhysicsShapeQueryParameters2D.new() - * * params.shape_rid = shape_rid * - * - * * # Execute physics queries here... * - * - * * # Release the shape when done with physics queries. - * * PhysicsServer2D.free_rid(shape_rid) - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * RID shapeRid = PhysicsServer2D.CircleShapeCreate(); - * * int radius = 64; - * * PhysicsServer2D.ShapeSetData(shapeRid, radius); * - * - * * var params = new PhysicsShapeQueryParameters2D(); - * * params.ShapeRid = shapeRid; * - * - * * // Execute physics queries here... * - * - * * // Release the shape when done with physics queries. - * * PhysicsServer2D.FreeRid(shapeRid); - * - * [/csharp] - * - * [/codeblocks] + * ``` */ public var shapeRid: RID get() { @@ -197,7 +176,7 @@ public open class PhysicsShapeQueryParameters2D : RefCounted() { } /** - * If `true`, the query will take [godot.PhysicsBody2D]s into account. + * If `true`, the query will take [PhysicsBody2D]s into account. */ public var collideWithBodies: Boolean get() { @@ -211,7 +190,7 @@ public open class PhysicsShapeQueryParameters2D : RefCounted() { } /** - * If `true`, the query will take [godot.Area2D]s into account. + * If `true`, the query will take [Area2D]s into account. */ public var collideWithAreas: Boolean get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsShapeQueryParameters3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsShapeQueryParameters3D.kt index 39c26ca6d..285315ad8 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsShapeQueryParameters3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsShapeQueryParameters3D.kt @@ -34,14 +34,16 @@ import kotlin.Suppress import kotlin.Unit /** - * Provides parameters for [godot.PhysicsDirectSpaceState3D.intersectShape]. - * - * By changing various properties of this object, such as the shape, you can configure the parameters for [godot.PhysicsDirectSpaceState3D.intersectShape]. + * By changing various properties of this object, such as the shape, you can configure the + * parameters for [PhysicsDirectSpaceState3D.intersectShape]. */ @GodotBaseType public open class PhysicsShapeQueryParameters3D : RefCounted() { /** - * The physics layers the query will detect (as a bitmask). By default, all collision layers are detected. See [godot.Collision layers and masks]($DOCS_URL/tutorials/physics/physics_introduction.html#collision-layers-and-masks) in the documentation for more information. + * The physics layers the query will detect (as a bitmask). By default, all collision layers are + * detected. See + * [url=$DOCS_URL/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision + * layers and masks[/url] in the documentation for more information. */ public var collisionMask: Long get() { @@ -55,7 +57,8 @@ public open class PhysicsShapeQueryParameters3D : RefCounted() { } /** - * The list of object [RID]s that will be excluded from collisions. Use [godot.CollisionObject3D.getRid] to get the [RID] associated with a [godot.CollisionObject3D]-derived node. + * The list of object [RID]s that will be excluded from collisions. Use [CollisionObject3D.getRid] + * to get the [RID] associated with a [CollisionObject3D]-derived node. */ public var exclude: VariantArray get() { @@ -98,7 +101,9 @@ public open class PhysicsShapeQueryParameters3D : RefCounted() { } /** - * The [godot.Shape3D] that will be used for collision/intersection queries. This stores the actual reference which avoids the shape to be released while being used for queries, so always prefer using this over [shapeRid]. + * The [Shape3D] that will be used for collision/intersection queries. This stores the actual + * reference which avoids the shape to be released while being used for queries, so always prefer + * using this over [shapeRid]. */ public var shape: Resource? get() { @@ -112,63 +117,37 @@ public open class PhysicsShapeQueryParameters3D : RefCounted() { } /** - * The queried shape's [RID] that will be used for collision/intersection queries. Use this over [shape] if you want to optimize for performance using the Servers API: - * - * [codeblocks] - * - * [gdscript] + * The queried shape's [RID] that will be used for collision/intersection queries. Use this over + * [shape] if you want to optimize for performance using the Servers API: * + * gdscript: + * ```gdscript * var shape_rid = PhysicsServer3D.shape_create(PhysicsServer3D.SHAPE_SPHERE) - * * var radius = 2.0 - * * PhysicsServer3D.shape_set_data(shape_rid, radius) * - * - * * var params = PhysicsShapeQueryParameters3D.new() - * * params.shape_rid = shape_rid * - * - * * # Execute physics queries here... * - * - * * # Release the shape when done with physics queries. - * * PhysicsServer3D.free_rid(shape_rid) - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * RID shapeRid = PhysicsServer3D.ShapeCreate(PhysicsServer3D.ShapeType.Sphere); - * * float radius = 2.0f; - * * PhysicsServer3D.ShapeSetData(shapeRid, radius); * - * - * * var params = new PhysicsShapeQueryParameters3D(); - * * params.ShapeRid = shapeRid; * - * - * * // Execute physics queries here... * - * - * * // Release the shape when done with physics queries. - * * PhysicsServer3D.FreeRid(shapeRid); - * - * [/csharp] - * - * [/codeblocks] + * ``` */ public var shapeRid: RID get() { @@ -197,7 +176,7 @@ public open class PhysicsShapeQueryParameters3D : RefCounted() { } /** - * If `true`, the query will take [godot.PhysicsBody3D]s into account. + * If `true`, the query will take [PhysicsBody3D]s into account. */ public var collideWithBodies: Boolean get() { @@ -211,7 +190,7 @@ public open class PhysicsShapeQueryParameters3D : RefCounted() { } /** - * If `true`, the query will take [godot.Area3D]s into account. + * If `true`, the query will take [Area3D]s into account. */ public var collideWithAreas: Boolean get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsTestMotionParameters2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsTestMotionParameters2D.kt index 94ddeba25..2e0291421 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsTestMotionParameters2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsTestMotionParameters2D.kt @@ -31,14 +31,14 @@ import kotlin.Suppress import kotlin.Unit /** - * Provides parameters for [godot.PhysicsServer2D.bodyTestMotion]. - * - * By changing various properties of this object, such as the motion, you can configure the parameters for [godot.PhysicsServer2D.bodyTestMotion]. + * By changing various properties of this object, such as the motion, you can configure the + * parameters for [PhysicsServer2D.bodyTestMotion]. */ @GodotBaseType public open class PhysicsTestMotionParameters2D : RefCounted() { /** - * Transform in global space where the motion should start. Usually set to [godot.Node2D.globalTransform] for the current body's transform. + * Transform in global space where the motion should start. Usually set to + * [Node2D.globalTransform] for the current body's transform. */ @CoreTypeLocalCopy public var from: Transform2D @@ -82,9 +82,10 @@ public open class PhysicsTestMotionParameters2D : RefCounted() { } /** - * If set to `true`, shapes of type [godot.PhysicsServer2D.SHAPE_SEPARATION_RAY] are used to detect collisions and can stop the motion. Can be useful when snapping to the ground. - * - * If set to `false`, shapes of type [godot.PhysicsServer2D.SHAPE_SEPARATION_RAY] are only used for separation when overlapping with other bodies. That's the main use for separation ray shapes. + * If set to `true`, shapes of type [constant PhysicsServer2D.SHAPE_SEPARATION_RAY] are used to + * detect collisions and can stop the motion. Can be useful when snapping to the ground. + * If set to `false`, shapes of type [constant PhysicsServer2D.SHAPE_SEPARATION_RAY] are only used + * for separation when overlapping with other bodies. That's the main use for separation ray shapes. */ public var collideSeparationRay: Boolean get() { @@ -98,7 +99,8 @@ public open class PhysicsTestMotionParameters2D : RefCounted() { } /** - * Optional array of body [RID] to exclude from collision. Use [godot.CollisionObject2D.getRid] to get the [RID] associated with a [godot.CollisionObject2D]-derived node. + * Optional array of body [RID] to exclude from collision. Use [CollisionObject2D.getRid] to get + * the [RID] associated with a [CollisionObject2D]-derived node. */ public var excludeBodies: VariantArray get() { @@ -112,7 +114,8 @@ public open class PhysicsTestMotionParameters2D : RefCounted() { } /** - * Optional array of object unique instance ID to exclude from collision. See [godot.Object.getInstanceId]. + * Optional array of object unique instance ID to exclude from collision. See + * [Object.getInstanceId]. */ public var excludeObjects: VariantArray get() { @@ -126,9 +129,10 @@ public open class PhysicsTestMotionParameters2D : RefCounted() { } /** - * If set to `true`, any depenetration from the recovery phase is reported as a collision; this is used e.g. by [godot.CharacterBody2D] for improving floor detection during floor snapping. - * - * If set to `false`, only collisions resulting from the motion are reported, which is generally the desired behavior. + * If set to `true`, any depenetration from the recovery phase is reported as a collision; this is + * used e.g. by [CharacterBody2D] for improving floor detection during floor snapping. + * If set to `false`, only collisions resulting from the motion are reported, which is generally + * the desired behavior. */ public var recoveryAsCollision: Boolean get() { @@ -147,7 +151,8 @@ public open class PhysicsTestMotionParameters2D : RefCounted() { } /** - * Transform in global space where the motion should start. Usually set to [godot.Node2D.globalTransform] for the current body's transform. + * Transform in global space where the motion should start. Usually set to + * [Node2D.globalTransform] for the current body's transform. * * This is a helper function to make dealing with local copies easier. * diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsTestMotionParameters3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsTestMotionParameters3D.kt index f2f5e7bcf..bf4de6bb6 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsTestMotionParameters3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsTestMotionParameters3D.kt @@ -32,14 +32,14 @@ import kotlin.Suppress import kotlin.Unit /** - * Provides parameters for [godot.PhysicsServer3D.bodyTestMotion]. - * - * By changing various properties of this object, such as the motion, you can configure the parameters for [godot.PhysicsServer3D.bodyTestMotion]. + * By changing various properties of this object, such as the motion, you can configure the + * parameters for [PhysicsServer3D.bodyTestMotion]. */ @GodotBaseType public open class PhysicsTestMotionParameters3D : RefCounted() { /** - * Transform in global space where the motion should start. Usually set to [godot.Node3D.globalTransform] for the current body's transform. + * Transform in global space where the motion should start. Usually set to + * [Node3D.globalTransform] for the current body's transform. */ @CoreTypeLocalCopy public var from: Transform3D @@ -83,7 +83,8 @@ public open class PhysicsTestMotionParameters3D : RefCounted() { } /** - * Maximum number of returned collisions, between `1` and `32`. Always returns the deepest detected collisions. + * Maximum number of returned collisions, between `1` and `32`. Always returns the deepest + * detected collisions. */ public var maxCollisions: Int get() { @@ -97,9 +98,10 @@ public open class PhysicsTestMotionParameters3D : RefCounted() { } /** - * If set to `true`, shapes of type [godot.PhysicsServer3D.SHAPE_SEPARATION_RAY] are used to detect collisions and can stop the motion. Can be useful when snapping to the ground. - * - * If set to `false`, shapes of type [godot.PhysicsServer3D.SHAPE_SEPARATION_RAY] are only used for separation when overlapping with other bodies. That's the main use for separation ray shapes. + * If set to `true`, shapes of type [constant PhysicsServer3D.SHAPE_SEPARATION_RAY] are used to + * detect collisions and can stop the motion. Can be useful when snapping to the ground. + * If set to `false`, shapes of type [constant PhysicsServer3D.SHAPE_SEPARATION_RAY] are only used + * for separation when overlapping with other bodies. That's the main use for separation ray shapes. */ public var collideSeparationRay: Boolean get() { @@ -113,7 +115,8 @@ public open class PhysicsTestMotionParameters3D : RefCounted() { } /** - * Optional array of body [RID] to exclude from collision. Use [godot.CollisionObject3D.getRid] to get the [RID] associated with a [godot.CollisionObject3D]-derived node. + * Optional array of body [RID] to exclude from collision. Use [CollisionObject3D.getRid] to get + * the [RID] associated with a [CollisionObject3D]-derived node. */ public var excludeBodies: VariantArray get() { @@ -127,7 +130,8 @@ public open class PhysicsTestMotionParameters3D : RefCounted() { } /** - * Optional array of object unique instance ID to exclude from collision. See [godot.Object.getInstanceId]. + * Optional array of object unique instance ID to exclude from collision. See + * [Object.getInstanceId]. */ public var excludeObjects: VariantArray get() { @@ -141,9 +145,10 @@ public open class PhysicsTestMotionParameters3D : RefCounted() { } /** - * If set to `true`, any depenetration from the recovery phase is reported as a collision; this is used e.g. by [godot.CharacterBody3D] for improving floor detection during floor snapping. - * - * If set to `false`, only collisions resulting from the motion are reported, which is generally the desired behavior. + * If set to `true`, any depenetration from the recovery phase is reported as a collision; this is + * used e.g. by [CharacterBody3D] for improving floor detection during floor snapping. + * If set to `false`, only collisions resulting from the motion are reported, which is generally + * the desired behavior. */ public var recoveryAsCollision: Boolean get() { @@ -162,7 +167,8 @@ public open class PhysicsTestMotionParameters3D : RefCounted() { } /** - * Transform in global space where the motion should start. Usually set to [godot.Node3D.globalTransform] for the current body's transform. + * Transform in global space where the motion should start. Usually set to + * [Node3D.globalTransform] for the current body's transform. * * This is a helper function to make dealing with local copies easier. * diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsTestMotionResult2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsTestMotionResult2D.kt index 480a5c3c5..202b03bf6 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsTestMotionResult2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsTestMotionResult2D.kt @@ -25,9 +25,7 @@ import kotlin.Long import kotlin.Suppress /** - * Describes the motion and collision result from [godot.PhysicsServer2D.bodyTestMotion]. - * - * Describes the motion and collision result from [godot.PhysicsServer2D.bodyTestMotion]. + * Describes the motion and collision result from [PhysicsServer2D.bodyTestMotion]. */ @GodotBaseType public open class PhysicsTestMotionResult2D : RefCounted() { @@ -82,7 +80,8 @@ public open class PhysicsTestMotionResult2D : RefCounted() { } /** - * Returns the unique instance ID of the colliding body's attached [godot.Object], if a collision occurred. See [godot.Object.getInstanceId]. + * Returns the unique instance ID of the colliding body's attached [Object], if a collision + * occurred. See [Object.getInstanceId]. */ public fun getColliderId(): Long { TransferContext.writeArguments() @@ -91,7 +90,7 @@ public open class PhysicsTestMotionResult2D : RefCounted() { } /** - * Returns the colliding body's [RID] used by the [godot.PhysicsServer2D], if a collision occurred. + * Returns the colliding body's [RID] used by the [PhysicsServer2D], if a collision occurred. */ public fun getColliderRid(): RID { TransferContext.writeArguments() @@ -100,7 +99,7 @@ public open class PhysicsTestMotionResult2D : RefCounted() { } /** - * Returns the colliding body's attached [godot.Object], if a collision occurred. + * Returns the colliding body's attached [Object], if a collision occurred. */ public fun getCollider(): Object? { TransferContext.writeArguments() @@ -109,7 +108,7 @@ public open class PhysicsTestMotionResult2D : RefCounted() { } /** - * Returns the colliding body's shape index, if a collision occurred. See [godot.CollisionObject2D]. + * Returns the colliding body's shape index, if a collision occurred. See [CollisionObject2D]. */ public fun getColliderShape(): Int { TransferContext.writeArguments() @@ -136,7 +135,8 @@ public open class PhysicsTestMotionResult2D : RefCounted() { } /** - * Returns the maximum fraction of the motion that can occur without a collision, between `0` and `1`. + * Returns the maximum fraction of the motion that can occur without a collision, between `0` and + * `1`. */ public fun getCollisionSafeFraction(): Float { TransferContext.writeArguments() @@ -145,7 +145,8 @@ public open class PhysicsTestMotionResult2D : RefCounted() { } /** - * Returns the minimum fraction of the motion needed to collide, if a collision occurred, between `0` and `1`. + * Returns the minimum fraction of the motion needed to collide, if a collision occurred, between + * `0` and `1`. */ public fun getCollisionUnsafeFraction(): Float { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsTestMotionResult3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsTestMotionResult3D.kt index 97eeee47b..90b5f2573 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsTestMotionResult3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PhysicsTestMotionResult3D.kt @@ -26,9 +26,7 @@ import kotlin.Suppress import kotlin.jvm.JvmOverloads /** - * Describes the motion and collision result from [godot.PhysicsServer3D.bodyTestMotion]. - * - * Describes the motion and collision result from [godot.PhysicsServer3D.bodyTestMotion]. + * Describes the motion and collision result from [PhysicsServer3D.bodyTestMotion]. */ @GodotBaseType public open class PhysicsTestMotionResult3D : RefCounted() { @@ -56,7 +54,8 @@ public open class PhysicsTestMotionResult3D : RefCounted() { } /** - * Returns the maximum fraction of the motion that can occur without a collision, between `0` and `1`. + * Returns the maximum fraction of the motion that can occur without a collision, between `0` and + * `1`. */ public fun getCollisionSafeFraction(): Float { TransferContext.writeArguments() @@ -65,7 +64,8 @@ public open class PhysicsTestMotionResult3D : RefCounted() { } /** - * Returns the minimum fraction of the motion needed to collide, if a collision occurred, between `0` and `1`. + * Returns the minimum fraction of the motion needed to collide, if a collision occurred, between + * `0` and `1`. */ public fun getCollisionUnsafeFraction(): Float { TransferContext.writeArguments() @@ -83,7 +83,8 @@ public open class PhysicsTestMotionResult3D : RefCounted() { } /** - * Returns the point of collision in global coordinates given a collision index (the deepest collision by default), if a collision occurred. + * Returns the point of collision in global coordinates given a collision index (the deepest + * collision by default), if a collision occurred. */ @JvmOverloads public fun getCollisionPoint(collisionIndex: Int = 0): Vector3 { @@ -93,7 +94,8 @@ public open class PhysicsTestMotionResult3D : RefCounted() { } /** - * Returns the colliding body's shape's normal at the point of collision given a collision index (the deepest collision by default), if a collision occurred. + * Returns the colliding body's shape's normal at the point of collision given a collision index + * (the deepest collision by default), if a collision occurred. */ @JvmOverloads public fun getCollisionNormal(collisionIndex: Int = 0): Vector3 { @@ -103,7 +105,8 @@ public open class PhysicsTestMotionResult3D : RefCounted() { } /** - * Returns the colliding body's velocity given a collision index (the deepest collision by default), if a collision occurred. + * Returns the colliding body's velocity given a collision index (the deepest collision by + * default), if a collision occurred. */ @JvmOverloads public fun getColliderVelocity(collisionIndex: Int = 0): Vector3 { @@ -113,7 +116,8 @@ public open class PhysicsTestMotionResult3D : RefCounted() { } /** - * Returns the unique instance ID of the colliding body's attached [godot.Object] given a collision index (the deepest collision by default), if a collision occurred. See [godot.Object.getInstanceId]. + * Returns the unique instance ID of the colliding body's attached [Object] given a collision + * index (the deepest collision by default), if a collision occurred. See [Object.getInstanceId]. */ @JvmOverloads public fun getColliderId(collisionIndex: Int = 0): Long { @@ -123,7 +127,8 @@ public open class PhysicsTestMotionResult3D : RefCounted() { } /** - * Returns the colliding body's [RID] used by the [godot.PhysicsServer3D] given a collision index (the deepest collision by default), if a collision occurred. + * Returns the colliding body's [RID] used by the [PhysicsServer3D] given a collision index (the + * deepest collision by default), if a collision occurred. */ @JvmOverloads public fun getColliderRid(collisionIndex: Int = 0): RID { @@ -133,7 +138,8 @@ public open class PhysicsTestMotionResult3D : RefCounted() { } /** - * Returns the colliding body's attached [godot.Object] given a collision index (the deepest collision by default), if a collision occurred. + * Returns the colliding body's attached [Object] given a collision index (the deepest collision + * by default), if a collision occurred. */ @JvmOverloads public fun getCollider(collisionIndex: Int = 0): Object? { @@ -143,7 +149,8 @@ public open class PhysicsTestMotionResult3D : RefCounted() { } /** - * Returns the colliding body's shape index given a collision index (the deepest collision by default), if a collision occurred. See [godot.CollisionObject3D]. + * Returns the colliding body's shape index given a collision index (the deepest collision by + * default), if a collision occurred. See [CollisionObject3D]. */ @JvmOverloads public fun getColliderShape(collisionIndex: Int = 0): Int { @@ -153,7 +160,8 @@ public open class PhysicsTestMotionResult3D : RefCounted() { } /** - * Returns the moving object's colliding shape given a collision index (the deepest collision by default), if a collision occurred. + * Returns the moving object's colliding shape given a collision index (the deepest collision by + * default), if a collision occurred. */ @JvmOverloads public fun getCollisionLocalShape(collisionIndex: Int = 0): Int { @@ -163,7 +171,8 @@ public open class PhysicsTestMotionResult3D : RefCounted() { } /** - * Returns the length of overlap along the collision normal given a collision index (the deepest collision by default), if a collision occurred. + * Returns the length of overlap along the collision normal given a collision index (the deepest + * collision by default), if a collision occurred. */ @JvmOverloads public fun getCollisionDepth(collisionIndex: Int = 0): Float { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PinJoint2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PinJoint2D.kt index 53aba30fb..0d1eb5d10 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PinJoint2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PinJoint2D.kt @@ -20,9 +20,9 @@ import kotlin.Int import kotlin.Suppress /** - * A physics joint that attaches two 2D physics bodies at a single point, allowing them to freely rotate. - * - * A physics joint that attaches two 2D physics bodies at a single point, allowing them to freely rotate. For example, a [godot.RigidBody2D] can be attached to a [godot.StaticBody2D] to create a pendulum or a seesaw. + * A physics joint that attaches two 2D physics bodies at a single point, allowing them to freely + * rotate. For example, a [RigidBody2D] can be attached to a [StaticBody2D] to create a pendulum or a + * seesaw. */ @GodotBaseType public open class PinJoint2D : Joint2D() { @@ -41,7 +41,8 @@ public open class PinJoint2D : Joint2D() { } /** - * If `true`, the pin maximum and minimum rotation, defined by [angularLimitLower] and [angularLimitUpper] are applied. + * If `true`, the pin maximum and minimum rotation, defined by [angularLimitLower] and + * [angularLimitUpper] are applied. */ public var angularLimitEnabled: Boolean get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PinJoint3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PinJoint3D.kt index 88727a526..add629d22 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PinJoint3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PinJoint3D.kt @@ -22,9 +22,9 @@ import kotlin.Suppress import kotlin.Unit /** - * A physics joint that attaches two 3D physics bodies at a single point, allowing them to freely rotate. - * - * A physics joint that attaches two 3D physics bodies at a single point, allowing them to freely rotate. For example, a [godot.RigidBody3D] can be attached to a [godot.StaticBody3D] to create a pendulum or a seesaw. + * A physics joint that attaches two 3D physics bodies at a single point, allowing them to freely + * rotate. For example, a [RigidBody3D] can be attached to a [StaticBody3D] to create a pendulum or a + * seesaw. */ @GodotBaseType public open class PinJoint3D : Joint3D() { @@ -54,11 +54,13 @@ public open class PinJoint3D : Joint3D() { id: Long, ) { /** - * The force with which the pinned objects stay in positional relation to each other. The higher, the stronger. + * The force with which the pinned objects stay in positional relation to each other. The + * higher, the stronger. */ PARAM_BIAS(0), /** - * The force with which the pinned objects stay in velocity relation to each other. The higher, the stronger. + * The force with which the pinned objects stay in velocity relation to each other. The higher, + * the stronger. */ PARAM_DAMPING(1), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PlaceholderCubemap.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PlaceholderCubemap.kt index 6e4b56f6c..27b1d83d9 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PlaceholderCubemap.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PlaceholderCubemap.kt @@ -12,15 +12,12 @@ import kotlin.Int import kotlin.Suppress /** - * A [godot.Cubemap] without image data. - * - * This class replaces a [godot.Cubemap] or a [godot.Cubemap]-derived class in 2 conditions: - * - * - In dedicated server mode, where the image data shouldn't affect game logic. This allows reducing the exported PCK's size significantly. - * - * - When the [godot.Cubemap]-derived class is missing, for example when using a different engine version. - * - * **Note:** This class is not intended for rendering or for use in shaders. Operations like calculating UV are not guaranteed to work. + * This class replaces a [Cubemap] or a [Cubemap]-derived class in 2 conditions: + * - In dedicated server mode, where the image data shouldn't affect game logic. This allows + * reducing the exported PCK's size significantly. + * - When the [Cubemap]-derived class is missing, for example when using a different engine version. + * **Note:** This class is not intended for rendering or for use in shaders. Operations like + * calculating UV are not guaranteed to work. */ @GodotBaseType public open class PlaceholderCubemap : PlaceholderTextureLayered() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PlaceholderCubemapArray.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PlaceholderCubemapArray.kt index 6081ffcca..4550dba27 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PlaceholderCubemapArray.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PlaceholderCubemapArray.kt @@ -12,15 +12,13 @@ import kotlin.Int import kotlin.Suppress /** - * A [godot.CubemapArray] without image data. - * - * This class replaces a [godot.CubemapArray] or a [godot.CubemapArray]-derived class in 2 conditions: - * - * - In dedicated server mode, where the image data shouldn't affect game logic. This allows reducing the exported PCK's size significantly. - * - * - When the [godot.CubemapArray]-derived class is missing, for example when using a different engine version. - * - * **Note:** This class is not intended for rendering or for use in shaders. Operations like calculating UV are not guaranteed to work. + * This class replaces a [CubemapArray] or a [CubemapArray]-derived class in 2 conditions: + * - In dedicated server mode, where the image data shouldn't affect game logic. This allows + * reducing the exported PCK's size significantly. + * - When the [CubemapArray]-derived class is missing, for example when using a different engine + * version. + * **Note:** This class is not intended for rendering or for use in shaders. Operations like + * calculating UV are not guaranteed to work. */ @GodotBaseType public open class PlaceholderCubemapArray : PlaceholderTextureLayered() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PlaceholderMaterial.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PlaceholderMaterial.kt index 8d55b155b..0838a7823 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PlaceholderMaterial.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PlaceholderMaterial.kt @@ -12,13 +12,12 @@ import kotlin.Int import kotlin.Suppress /** - * Placeholder class for a material. - * - * This class is used when loading a project that uses a [godot.Material] subclass in 2 conditions: - * - * - When running the project exported in dedicated server mode, only the texture's dimensions are kept (as they may be relied upon for gameplay purposes or positioning of other elements). This allows reducing the exported PCK's size significantly. - * - * - When this subclass is missing due to using a different engine version or build (e.g. modules disabled). + * This class is used when loading a project that uses a [Material] subclass in 2 conditions: + * - When running the project exported in dedicated server mode, only the texture's dimensions are + * kept (as they may be relied upon for gameplay purposes or positioning of other elements). This + * allows reducing the exported PCK's size significantly. + * - When this subclass is missing due to using a different engine version or build (e.g. modules + * disabled). */ @GodotBaseType public open class PlaceholderMaterial : Material() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PlaceholderMesh.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PlaceholderMesh.kt index b38610dea..4b6641a78 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PlaceholderMesh.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PlaceholderMesh.kt @@ -21,13 +21,12 @@ import kotlin.Unit import kotlin.jvm.JvmName /** - * Placeholder class for a mesh. - * - * This class is used when loading a project that uses a [godot.Mesh] subclass in 2 conditions: - * - * - When running the project exported in dedicated server mode, only the texture's dimensions are kept (as they may be relied upon for gameplay purposes or positioning of other elements). This allows reducing the exported PCK's size significantly. - * - * - When this subclass is missing due to using a different engine version or build (e.g. modules disabled). + * This class is used when loading a project that uses a [Mesh] subclass in 2 conditions: + * - When running the project exported in dedicated server mode, only the texture's dimensions are + * kept (as they may be relied upon for gameplay purposes or positioning of other elements). This + * allows reducing the exported PCK's size significantly. + * - When this subclass is missing due to using a different engine version or build (e.g. modules + * disabled). */ @GodotBaseType public open class PlaceholderMesh : Mesh() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PlaceholderTexture2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PlaceholderTexture2D.kt index 47d0e257c..6d616160c 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PlaceholderTexture2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PlaceholderTexture2D.kt @@ -22,15 +22,14 @@ import kotlin.Unit import kotlin.jvm.JvmName /** - * Placeholder class for a 2-dimensional texture. - * - * This class is used when loading a project that uses a [godot.Texture2D] subclass in 2 conditions: - * - * - When running the project exported in dedicated server mode, only the texture's dimensions are kept (as they may be relied upon for gameplay purposes or positioning of other elements). This allows reducing the exported PCK's size significantly. - * - * - When this subclass is missing due to using a different engine version or build (e.g. modules disabled). - * - * **Note:** This is not intended to be used as an actual texture for rendering. It is not guaranteed to work like one in shaders or materials (for example when calculating UV). + * This class is used when loading a project that uses a [Texture2D] subclass in 2 conditions: + * - When running the project exported in dedicated server mode, only the texture's dimensions are + * kept (as they may be relied upon for gameplay purposes or positioning of other elements). This + * allows reducing the exported PCK's size significantly. + * - When this subclass is missing due to using a different engine version or build (e.g. modules + * disabled). + * **Note:** This is not intended to be used as an actual texture for rendering. It is not + * guaranteed to work like one in shaders or materials (for example when calculating UV). */ @GodotBaseType public open class PlaceholderTexture2D : Texture2D() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PlaceholderTexture2DArray.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PlaceholderTexture2DArray.kt index f8afbabbd..91f1f3e93 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PlaceholderTexture2DArray.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PlaceholderTexture2DArray.kt @@ -12,15 +12,14 @@ import kotlin.Int import kotlin.Suppress /** - * Placeholder class for a 2-dimensional texture array. - * - * This class is used when loading a project that uses a [godot.Texture2D] subclass in 2 conditions: - * - * - When running the project exported in dedicated server mode, only the texture's dimensions are kept (as they may be relied upon for gameplay purposes or positioning of other elements). This allows reducing the exported PCK's size significantly. - * - * - When this subclass is missing due to using a different engine version or build (e.g. modules disabled). - * - * **Note:** This is not intended to be used as an actual texture for rendering. It is not guaranteed to work like one in shaders or materials (for example when calculating UV). + * This class is used when loading a project that uses a [Texture2D] subclass in 2 conditions: + * - When running the project exported in dedicated server mode, only the texture's dimensions are + * kept (as they may be relied upon for gameplay purposes or positioning of other elements). This + * allows reducing the exported PCK's size significantly. + * - When this subclass is missing due to using a different engine version or build (e.g. modules + * disabled). + * **Note:** This is not intended to be used as an actual texture for rendering. It is not + * guaranteed to work like one in shaders or materials (for example when calculating UV). */ @GodotBaseType public open class PlaceholderTexture2DArray : PlaceholderTextureLayered() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PlaceholderTexture3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PlaceholderTexture3D.kt index 9e03fc9a6..d7f13f8f9 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PlaceholderTexture3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PlaceholderTexture3D.kt @@ -21,15 +21,14 @@ import kotlin.Suppress import kotlin.Unit /** - * Placeholder class for a 3-dimensional texture. - * - * This class is used when loading a project that uses a [godot.Texture3D] subclass in 2 conditions: - * - * - When running the project exported in dedicated server mode, only the texture's dimensions are kept (as they may be relied upon for gameplay purposes or positioning of other elements). This allows reducing the exported PCK's size significantly. - * - * - When this subclass is missing due to using a different engine version or build (e.g. modules disabled). - * - * **Note:** This is not intended to be used as an actual texture for rendering. It is not guaranteed to work like one in shaders or materials (for example when calculating UV). + * This class is used when loading a project that uses a [Texture3D] subclass in 2 conditions: + * - When running the project exported in dedicated server mode, only the texture's dimensions are + * kept (as they may be relied upon for gameplay purposes or positioning of other elements). This + * allows reducing the exported PCK's size significantly. + * - When this subclass is missing due to using a different engine version or build (e.g. modules + * disabled). + * **Note:** This is not intended to be used as an actual texture for rendering. It is not + * guaranteed to work like one in shaders or materials (for example when calculating UV). */ @GodotBaseType public open class PlaceholderTexture3D : Texture3D() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PlaceholderTextureLayered.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PlaceholderTextureLayered.kt index 9ee9efcd8..cf74005a8 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PlaceholderTextureLayered.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PlaceholderTextureLayered.kt @@ -23,15 +23,14 @@ import kotlin.Unit import kotlin.jvm.JvmName /** - * Placeholder class for a 2-dimensional texture array. - * - * This class is used when loading a project that uses a [godot.TextureLayered] subclass in 2 conditions: - * - * - When running the project exported in dedicated server mode, only the texture's dimensions are kept (as they may be relied upon for gameplay purposes or positioning of other elements). This allows reducing the exported PCK's size significantly. - * - * - When this subclass is missing due to using a different engine version or build (e.g. modules disabled). - * - * **Note:** This is not intended to be used as an actual texture for rendering. It is not guaranteed to work like one in shaders or materials (for example when calculating UV). + * This class is used when loading a project that uses a [TextureLayered] subclass in 2 conditions: + * - When running the project exported in dedicated server mode, only the texture's dimensions are + * kept (as they may be relied upon for gameplay purposes or positioning of other elements). This + * allows reducing the exported PCK's size significantly. + * - When this subclass is missing due to using a different engine version or build (e.g. modules + * disabled). + * **Note:** This is not intended to be used as an actual texture for rendering. It is not + * guaranteed to work like one in shaders or materials (for example when calculating UV). */ @GodotBaseType public open class PlaceholderTextureLayered internal constructor() : TextureLayered() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PlaneMesh.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PlaneMesh.kt index d7398c280..2ccf2cd59 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PlaneMesh.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PlaneMesh.kt @@ -25,11 +25,12 @@ import kotlin.Suppress import kotlin.Unit /** - * Class representing a planar [godot.PrimitiveMesh]. - * - * Class representing a planar [godot.PrimitiveMesh]. This flat mesh does not have a thickness. By default, this mesh is aligned on the X and Z axes; this default rotation isn't suited for use with billboarded materials. For billboarded materials, change [orientation] to [FACE_Z]. - * - * **Note:** When using a large textured [godot.PlaneMesh] (e.g. as a floor), you may stumble upon UV jittering issues depending on the camera angle. To solve this, increase [subdivideDepth] and [subdivideWidth] until you no longer notice UV jittering. + * Class representing a planar [PrimitiveMesh]. This flat mesh does not have a thickness. By + * default, this mesh is aligned on the X and Z axes; this default rotation isn't suited for use with + * billboarded materials. For billboarded materials, change [orientation] to [constant FACE_Z]. + * **Note:** When using a large textured [PlaneMesh] (e.g. as a floor), you may stumble upon UV + * jittering issues depending on the camera angle. To solve this, increase [subdivideDepth] and + * [subdivideWidth] until you no longer notice UV jittering. */ @GodotBaseType public open class PlaneMesh : PrimitiveMesh() { @@ -92,7 +93,7 @@ public open class PlaneMesh : PrimitiveMesh() { } /** - * Direction that the [godot.PlaneMesh] is facing. See [enum Orientation] for options. + * Direction that the [PlaneMesh] is facing. See [enum Orientation] for options. */ public var orientation: Orientation get() { @@ -162,15 +163,17 @@ public open class PlaneMesh : PrimitiveMesh() { id: Long, ) { /** - * [godot.PlaneMesh] will face the positive X-axis. + * [PlaneMesh] will face the positive X-axis. */ FACE_X(0), /** - * [godot.PlaneMesh] will face the positive Y-axis. This matches the behavior of the [godot.PlaneMesh] in Godot 3.x. + * [PlaneMesh] will face the positive Y-axis. This matches the behavior of the [PlaneMesh] in + * Godot 3.x. */ FACE_Y(1), /** - * [godot.PlaneMesh] will face the positive Z-axis. This matches the behavior of the QuadMesh in Godot 3.x. + * [PlaneMesh] will face the positive Z-axis. This matches the behavior of the QuadMesh in Godot + * 3.x. */ FACE_Z(2), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PointLight2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PointLight2D.kt index 44495e9ae..2f7761af7 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PointLight2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PointLight2D.kt @@ -26,17 +26,12 @@ import kotlin.Unit import kotlin.jvm.JvmName /** - * Positional 2D light source. - * - * Tutorials: - * [$DOCS_URL/tutorials/2d/2d_lights_and_shadows.html]($DOCS_URL/tutorials/2d/2d_lights_and_shadows.html) - * * Casts light in a 2D environment. This light's shape is defined by a (usually grayscale) texture. */ @GodotBaseType public open class PointLight2D : Light2D() { /** - * [godot.Texture2D] used for the light's appearance. + * [Texture2D] used for the light's appearance. */ public var texture: Texture2D? get() { @@ -79,7 +74,8 @@ public open class PointLight2D : Light2D() { } /** - * The height of the light. Used with 2D normal mapping. The units are in pixels, e.g. if the height is 100, then it will illuminate an object 100 pixels away at a 45° angle to the plane. + * The height of the light. Used with 2D normal mapping. The units are in pixels, e.g. if the + * height is 100, then it will illuminate an object 100 pixels away at a 45° angle to the plane. */ public var height: Float @JvmName("getHeight_prop") diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PointMesh.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PointMesh.kt index 454794b2e..6a0d5a9b2 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PointMesh.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PointMesh.kt @@ -12,13 +12,15 @@ import kotlin.Int import kotlin.Suppress /** - * Mesh with a single Point primitive. - * - * The PointMesh is made from a single point. Instead of relying on triangles, points are rendered as a single rectangle on the screen with a constant size. They are intended to be used with Particle systems, but can be used as a cheap way to render constant size billboarded sprites (for example in a point cloud). - * - * PointMeshes, must be used with a material that has a point size. Point size can be accessed in a shader with `POINT_SIZE`, or in a [godot.BaseMaterial3D] by setting [godot.BaseMaterial3D.usePointSize] and the variable [godot.BaseMaterial3D.pointSize]. - * - * When using PointMeshes, properties that normally alter vertices will be ignored, including billboard mode, grow, and cull face. + * The PointMesh is made from a single point. Instead of relying on triangles, points are rendered + * as a single rectangle on the screen with a constant size. They are intended to be used with Particle + * systems, but can be used as a cheap way to render constant size billboarded sprites (for example in + * a point cloud). + * PointMeshes, must be used with a material that has a point size. Point size can be accessed in a + * shader with `POINT_SIZE`, or in a [BaseMaterial3D] by setting [BaseMaterial3D.usePointSize] and the + * variable [BaseMaterial3D.pointSize]. + * When using PointMeshes, properties that normally alter vertices will be ignored, including + * billboard mode, grow, and cull face. */ @GodotBaseType public open class PointMesh : PrimitiveMesh() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Polygon2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Polygon2D.kt index 02b6a4639..a5ff98aea 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Polygon2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Polygon2D.kt @@ -41,14 +41,15 @@ import kotlin.Suppress import kotlin.Unit /** - * A 2D polygon. - * - * A Polygon2D is defined by a set of points. Each point is connected to the next, with the final point being connected to the first, resulting in a closed polygon. Polygon2Ds can be filled with color (solid or gradient) or filled with a given texture. + * A Polygon2D is defined by a set of points. Each point is connected to the next, with the final + * point being connected to the first, resulting in a closed polygon. Polygon2Ds can be filled with + * color (solid or gradient) or filled with a given texture. */ @GodotBaseType public open class Polygon2D : Node2D() { /** - * The polygon's fill color. If [texture] is set, it will be multiplied by this color. It will also be the default color for vertices not set in [vertexColors]. + * The polygon's fill color. If [texture] is set, it will be multiplied by this color. It will + * also be the default color for vertices not set in [vertexColors]. */ @CoreTypeLocalCopy public var color: Color @@ -106,7 +107,8 @@ public open class Polygon2D : Node2D() { } /** - * Amount to offset the polygon's [texture]. If set to `Vector2(0, 0)`, the texture's origin (its top-left corner) will be placed at the polygon's position. + * Amount to offset the polygon's [texture]. If set to `Vector2(0, 0)`, the texture's origin (its + * top-left corner) will be placed at the polygon's position. */ @CoreTypeLocalCopy public var textureOffset: Vector2 @@ -121,7 +123,8 @@ public open class Polygon2D : Node2D() { } /** - * Amount to multiply the [uv] coordinates when using [texture]. Larger values make the texture smaller, and vice versa. + * Amount to multiply the [uv] coordinates when using [texture]. Larger values make the texture + * smaller, and vice versa. */ @CoreTypeLocalCopy public var textureScale: Vector2 @@ -150,7 +153,8 @@ public open class Polygon2D : Node2D() { } /** - * Path to a [godot.Skeleton2D] node used for skeleton-based deformations of this polygon. If empty or invalid, skeletal deformations will not be used. + * Path to a [Skeleton2D] node used for skeleton-based deformations of this polygon. If empty or + * invalid, skeletal deformations will not be used. */ public var skeleton: NodePath get() { @@ -164,7 +168,8 @@ public open class Polygon2D : Node2D() { } /** - * If `true`, the polygon will be inverted, containing the area outside the defined points and extending to the [invertBorder]. + * If `true`, the polygon will be inverted, containing the area outside the defined points and + * extending to the [invertBorder]. */ public var invertEnabled: Boolean get() { @@ -178,7 +183,8 @@ public open class Polygon2D : Node2D() { } /** - * Added padding applied to the bounding box when [invertEnabled] is set to `true`. Setting this value too small may result in a "Bad Polygon" error. + * Added padding applied to the bounding box when [invertEnabled] is set to `true`. Setting this + * value too small may result in a "Bad Polygon" error. */ public var invertBorder: Float get() { @@ -193,8 +199,7 @@ public open class Polygon2D : Node2D() { /** * The polygon's list of vertices. The final point will be connected to the first. - * - * **Note:** This returns a copy of the [godot.PackedVector2Array] rather than a reference. + * **Note:** This returns a copy of the [PackedVector2Array] rather than a reference. */ public var polygon: PackedVector2Array get() { @@ -208,7 +213,8 @@ public open class Polygon2D : Node2D() { } /** - * Texture coordinates for each vertex of the polygon. There should be one UV value per polygon vertex. If there are fewer, undefined vertices will use `Vector2(0, 0)`. + * Texture coordinates for each vertex of the polygon. There should be one UV value per polygon + * vertex. If there are fewer, undefined vertices will use `Vector2(0, 0)`. */ public var uv: PackedVector2Array get() { @@ -222,7 +228,8 @@ public open class Polygon2D : Node2D() { } /** - * Color for each vertex. Colors are interpolated between vertices, resulting in smooth gradients. There should be one per polygon vertex. If there are fewer, undefined vertices will use [color]. + * Color for each vertex. Colors are interpolated between vertices, resulting in smooth gradients. + * There should be one per polygon vertex. If there are fewer, undefined vertices will use [color]. */ public var vertexColors: PackedColorArray get() { @@ -236,7 +243,10 @@ public open class Polygon2D : Node2D() { } /** - * The list of polygons, in case more than one is being represented. Every individual polygon is stored as a [godot.PackedInt32Array] where each [int] is an index to a point in [polygon]. If empty, this property will be ignored, and the resulting single polygon will be composed of all points in [polygon], using the order they are stored in. + * The list of polygons, in case more than one is being represented. Every individual polygon is + * stored as a [PackedInt32Array] where each [int] is an index to a point in [polygon]. If empty, + * this property will be ignored, and the resulting single polygon will be composed of all points in + * [polygon], using the order they are stored in. */ public var polygons: VariantArray get() { @@ -269,7 +279,8 @@ public open class Polygon2D : Node2D() { } /** - * The polygon's fill color. If [texture] is set, it will be multiplied by this color. It will also be the default color for vertices not set in [vertexColors]. + * The polygon's fill color. If [texture] is set, it will be multiplied by this color. It will + * also be the default color for vertices not set in [vertexColors]. * * This is a helper function to make dealing with local copies easier. * @@ -317,7 +328,8 @@ public open class Polygon2D : Node2D() { /** - * Amount to offset the polygon's [texture]. If set to `Vector2(0, 0)`, the texture's origin (its top-left corner) will be placed at the polygon's position. + * Amount to offset the polygon's [texture]. If set to `Vector2(0, 0)`, the texture's origin (its + * top-left corner) will be placed at the polygon's position. * * This is a helper function to make dealing with local copies easier. * @@ -341,7 +353,8 @@ public open class Polygon2D : Node2D() { /** - * Amount to multiply the [uv] coordinates when using [texture]. Larger values make the texture smaller, and vice versa. + * Amount to multiply the [uv] coordinates when using [texture]. Larger values make the texture + * smaller, and vice versa. * * This is a helper function to make dealing with local copies easier. * @@ -365,7 +378,7 @@ public open class Polygon2D : Node2D() { /** - * Adds a bone with the specified [path] and [weights]. + * Adds a bone with the specified [param path] and [param weights]. */ public fun addBone(path: NodePath, weights: PackedFloat32Array): Unit { TransferContext.writeArguments(NODE_PATH to path, PACKED_FLOAT_32_ARRAY to weights) @@ -373,7 +386,7 @@ public open class Polygon2D : Node2D() { } /** - * Returns the number of bones in this [godot.Polygon2D]. + * Returns the number of bones in this [Polygon2D]. */ public fun getBoneCount(): Int { TransferContext.writeArguments() @@ -400,7 +413,7 @@ public open class Polygon2D : Node2D() { } /** - * Removes the specified bone from this [godot.Polygon2D]. + * Removes the specified bone from this [Polygon2D]. */ public fun eraseBone(index: Int): Unit { TransferContext.writeArguments(LONG to index.toLong()) @@ -408,7 +421,7 @@ public open class Polygon2D : Node2D() { } /** - * Removes all bones from this [godot.Polygon2D]. + * Removes all bones from this [Polygon2D]. */ public fun clearBones(): Unit { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PolygonOccluder3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PolygonOccluder3D.kt index c68950b4c..6f7669ae6 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PolygonOccluder3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PolygonOccluder3D.kt @@ -18,21 +18,21 @@ import kotlin.Int import kotlin.Suppress /** - * Flat 2D polygon shape for use with occlusion culling in [godot.OccluderInstance3D]. - * - * Tutorials: - * [$DOCS_URL/tutorials/3d/occlusion_culling.html]($DOCS_URL/tutorials/3d/occlusion_culling.html) - * - * [godot.PolygonOccluder3D] stores a polygon shape that can be used by the engine's occlusion culling system. When an [godot.OccluderInstance3D] with a [godot.PolygonOccluder3D] is selected in the editor, an editor will appear at the top of the 3D viewport so you can add/remove points. All points must be placed on the same 2D plane, which means it is not possible to create arbitrary 3D shapes with a single [godot.PolygonOccluder3D]. To use arbitrary 3D shapes as occluders, use [godot.ArrayOccluder3D] or [godot.OccluderInstance3D]'s baking feature instead. - * - * See [godot.OccluderInstance3D]'s documentation for instructions on setting up occlusion culling. + * [PolygonOccluder3D] stores a polygon shape that can be used by the engine's occlusion culling + * system. When an [OccluderInstance3D] with a [PolygonOccluder3D] is selected in the editor, an editor + * will appear at the top of the 3D viewport so you can add/remove points. All points must be placed on + * the same 2D plane, which means it is not possible to create arbitrary 3D shapes with a single + * [PolygonOccluder3D]. To use arbitrary 3D shapes as occluders, use [ArrayOccluder3D] or + * [OccluderInstance3D]'s baking feature instead. + * See [OccluderInstance3D]'s documentation for instructions on setting up occlusion culling. */ @GodotBaseType public open class PolygonOccluder3D : Occluder3D() { /** - * The polygon to use for occlusion culling. The polygon can be convex or concave, but it should have as few points as possible to maximize performance. - * - * The polygon must *not* have intersecting lines. Otherwise, triangulation will fail (with an error message printed). + * The polygon to use for occlusion culling. The polygon can be convex or concave, but it should + * have as few points as possible to maximize performance. + * The polygon must *not* have intersecting lines. Otherwise, triangulation will fail (with an + * error message printed). */ public var polygon: PackedVector2Array get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PolygonPathFinder.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PolygonPathFinder.kt index 53bd537f9..1a4316dd9 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PolygonPathFinder.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PolygonPathFinder.kt @@ -29,9 +29,6 @@ import kotlin.Int import kotlin.Suppress import kotlin.Unit -/** - * - */ @GodotBaseType public open class PolygonPathFinder : Resource() { public override fun new(scriptIndex: Int): Boolean { @@ -39,70 +36,46 @@ public open class PolygonPathFinder : Resource() { return true } - /** - * - */ public fun setup(points: PackedVector2Array, connections: PackedInt32Array): Unit { TransferContext.writeArguments(PACKED_VECTOR2_ARRAY to points, PACKED_INT_32_ARRAY to connections) TransferContext.callMethod(rawPtr, MethodBindings.setupPtr, NIL) } - /** - * - */ public fun findPath(from: Vector2, to: Vector2): PackedVector2Array { TransferContext.writeArguments(VECTOR2 to from, VECTOR2 to to) TransferContext.callMethod(rawPtr, MethodBindings.findPathPtr, PACKED_VECTOR2_ARRAY) return (TransferContext.readReturnValue(PACKED_VECTOR2_ARRAY, false) as PackedVector2Array) } - /** - * - */ public fun getIntersections(from: Vector2, to: Vector2): PackedVector2Array { TransferContext.writeArguments(VECTOR2 to from, VECTOR2 to to) TransferContext.callMethod(rawPtr, MethodBindings.getIntersectionsPtr, PACKED_VECTOR2_ARRAY) return (TransferContext.readReturnValue(PACKED_VECTOR2_ARRAY, false) as PackedVector2Array) } - /** - * - */ public fun getClosestPoint(point: Vector2): Vector2 { TransferContext.writeArguments(VECTOR2 to point) TransferContext.callMethod(rawPtr, MethodBindings.getClosestPointPtr, VECTOR2) return (TransferContext.readReturnValue(VECTOR2, false) as Vector2) } - /** - * - */ public fun isPointInside(point: Vector2): Boolean { TransferContext.writeArguments(VECTOR2 to point) TransferContext.callMethod(rawPtr, MethodBindings.isPointInsidePtr, BOOL) return (TransferContext.readReturnValue(BOOL, false) as Boolean) } - /** - * - */ public fun setPointPenalty(idx: Int, penalty: Float): Unit { TransferContext.writeArguments(LONG to idx.toLong(), DOUBLE to penalty.toDouble()) TransferContext.callMethod(rawPtr, MethodBindings.setPointPenaltyPtr, NIL) } - /** - * - */ public fun getPointPenalty(idx: Int): Float { TransferContext.writeArguments(LONG to idx.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.getPointPenaltyPtr, DOUBLE) return (TransferContext.readReturnValue(DOUBLE, false) as Double).toFloat() } - /** - * - */ public fun getBounds(): Rect2 { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getBoundsPtr, RECT2) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Popup.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Popup.kt index 8f5adfe50..ee5bcdfb8 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Popup.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Popup.kt @@ -14,9 +14,8 @@ import kotlin.Int import kotlin.Suppress /** - * Base class for contextual windows and panels with fixed position. - * - * [godot.Popup] is a base class for contextual windows and panels with fixed position. It's a modal by default (see [godot.Window.popupWindow]) and provides methods for implementing custom popup behavior. + * [Popup] is a base class for contextual windows and panels with fixed position. It's a modal by + * default (see [Window.popupWindow]) and provides methods for implementing custom popup behavior. */ @GodotBaseType public open class Popup : Window() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PopupPanel.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PopupPanel.kt index 8b969b9d5..a15c4affb 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PopupPanel.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PopupPanel.kt @@ -12,9 +12,9 @@ import kotlin.Int import kotlin.Suppress /** - * A popup with a panel background. - * - * A popup with a configurable panel background. Any child controls added to this node will be stretched to fit the panel's size (similar to how [godot.PanelContainer] works). If you are making windows, see [godot.Window]. + * A popup with a configurable panel background. Any child controls added to this node will be + * stretched to fit the panel's size (similar to how [PanelContainer] works). If you are making + * windows, see [Window]. */ @GodotBaseType public open class PopupPanel : Popup() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PortableCompressedTexture2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PortableCompressedTexture2D.kt index c68f0692d..90db1c478 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PortableCompressedTexture2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PortableCompressedTexture2D.kt @@ -28,16 +28,13 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * Provides a compressed texture for disk and/or VRAM in a way that is portable. - * * This class allows storing compressed textures as self contained (not imported) resources. - * - * For 2D usage (compressed on disk, uncompressed on VRAM), the lossy and lossless modes are recommended. For 3D usage (compressed on VRAM) it depends on the target platform. - * - * If you intend to only use desktop, S3TC or BPTC are recommended. For only mobile, ETC2 is recommended. - * - * For portable, self contained 3D textures that work on both desktop and mobile, Basis Universal is recommended (although it has a small quality cost and longer compression time as a tradeoff). - * + * For 2D usage (compressed on disk, uncompressed on VRAM), the lossy and lossless modes are + * recommended. For 3D usage (compressed on VRAM) it depends on the target platform. + * If you intend to only use desktop, S3TC or BPTC are recommended. For only mobile, ETC2 is + * recommended. + * For portable, self contained 3D textures that work on both desktop and mobile, Basis Universal is + * recommended (although it has a small quality cost and longer compression time as a tradeoff). * This resource is intended to be created from code. */ @GodotBaseType @@ -58,9 +55,10 @@ public open class PortableCompressedTexture2D : Texture2D() { } /** - * When running on the editor, this class will keep the source compressed data in memory. Otherwise, the source compressed data is lost after loading and the resource can't be re saved. - * - * This flag allows to keep the compressed data in memory if you intend it to persist after loading. + * When running on the editor, this class will keep the source compressed data in memory. + * Otherwise, the source compressed data is lost after loading and the resource can't be re saved. + * This flag allows to keep the compressed data in memory if you intend it to persist after + * loading. */ public var keepCompressedBuffer: Boolean get() { @@ -104,10 +102,10 @@ public open class PortableCompressedTexture2D : Texture2D() { /** * Initializes the compressed texture from a base image. The compression mode must be provided. - * - * [normalMap] is recommended to ensure optimum quality if this image will be used as a normal map. - * - * If lossy compression is requested, the quality setting can optionally be provided. This maps to Lossy WebP compression quality. + * [param normal_map] is recommended to ensure optimum quality if this image will be used as a + * normal map. + * If lossy compression is requested, the quality setting can optionally be provided. This maps to + * Lossy WebP compression quality. */ @JvmOverloads public fun createFromImage( @@ -141,29 +139,11 @@ public open class PortableCompressedTexture2D : Texture2D() { public enum class CompressionMode( id: Long, ) { - /** - * - */ COMPRESSION_MODE_LOSSLESS(0), - /** - * - */ COMPRESSION_MODE_LOSSY(1), - /** - * - */ COMPRESSION_MODE_BASIS_UNIVERSAL(2), - /** - * - */ COMPRESSION_MODE_S3TC(3), - /** - * - */ COMPRESSION_MODE_ETC2(4), - /** - * - */ COMPRESSION_MODE_BPTC(5), ; @@ -179,7 +159,8 @@ public open class PortableCompressedTexture2D : Texture2D() { public companion object { /** - * Overrides the flag globally for all textures of this type. This is used primarily by the editor. + * Overrides the flag globally for all textures of this type. This is used primarily by the + * editor. */ public fun setKeepAllCompressedBuffers(keep: Boolean): Unit { TransferContext.writeArguments(BOOL to keep) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PrismMesh.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PrismMesh.kt index 040e503d4..1da993b11 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PrismMesh.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PrismMesh.kt @@ -26,14 +26,13 @@ import kotlin.Suppress import kotlin.Unit /** - * Class representing a prism-shaped [godot.PrimitiveMesh]. - * - * Class representing a prism-shaped [godot.PrimitiveMesh]. + * Class representing a prism-shaped [PrimitiveMesh]. */ @GodotBaseType public open class PrismMesh : PrimitiveMesh() { /** - * Displacement of the upper edge along the X axis. 0.0 positions edge straight above the bottom-left edge. + * Displacement of the upper edge along the X axis. 0.0 positions edge straight above the + * bottom-left edge. */ public var leftToRight: Float get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ProgressBar.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ProgressBar.kt index c97a8f2f6..850434226 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ProgressBar.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ProgressBar.kt @@ -19,9 +19,8 @@ import kotlin.Long import kotlin.Suppress /** - * A control used for visual representation of a percentage. - * - * A control used for visual representation of a percentage. Shows fill percentage from right to left. + * A control used for visual representation of a percentage. Shows fill percentage from right to + * left. */ @GodotBaseType public open class ProgressBar : Range() { @@ -62,11 +61,15 @@ public open class ProgressBar : Range() { id: Long, ) { /** - * The progress bar fills from begin to end horizontally, according to the language direction. If [godot.Control.isLayoutRtl] returns `false`, it fills from left to right, and if it returns `true`, it fills from right to left. + * The progress bar fills from begin to end horizontally, according to the language direction. + * If [Control.isLayoutRtl] returns `false`, it fills from left to right, and if it returns `true`, + * it fills from right to left. */ FILL_BEGIN_TO_END(0), /** - * The progress bar fills from end to begin horizontally, according to the language direction. If [godot.Control.isLayoutRtl] returns `false`, it fills from right to left, and if it returns `true`, it fills from left to right. + * The progress bar fills from end to begin horizontally, according to the language direction. + * If [Control.isLayoutRtl] returns `false`, it fills from right to left, and if it returns `true`, + * it fills from left to right. */ FILL_END_TO_BEGIN(1), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ProjectSettings.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ProjectSettings.kt index 73c7ee00e..b8708c483 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ProjectSettings.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ProjectSettings.kt @@ -34,18 +34,20 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * Stores globally-accessible variables. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/677](https://godotengine.org/asset-library/asset/677) - * - * Stores variables that can be accessed from everywhere. Use [getSetting], [setSetting] or [hasSetting] to access them. Variables stored in `project.godot` are also loaded into [godot.ProjectSettings], making this object very useful for reading custom game configuration options. - * - * When naming a Project Settings property, use the full path to the setting including the category. For example, `"application/config/name"` for the project name. Category and property names can be viewed in the Project Settings dialog. - * - * **Feature tags:** Project settings can be overridden for specific platforms and configurations (debug, release, ...) using [feature tags]($DOCS_URL/tutorials/export/feature_tags.html). - * - * **Overriding:** Any project setting can be overridden by creating a file named `override.cfg` in the project's root directory. This can also be used in exported projects by placing this file in the same directory as the project binary. Overriding will still take the base project settings' [feature tags]($DOCS_URL/tutorials/export/feature_tags.html) in account. Therefore, make sure to *also* override the setting with the desired feature tags if you want them to override base project settings on all platforms and configurations. + * Stores variables that can be accessed from everywhere. Use [getSetting], [setSetting] or + * [hasSetting] to access them. Variables stored in `project.godot` are also loaded into + * [ProjectSettings], making this object very useful for reading custom game configuration options. + * When naming a Project Settings property, use the full path to the setting including the category. + * For example, `"application/config/name"` for the project name. Category and property names can be + * viewed in the Project Settings dialog. + * **Feature tags:** Project settings can be overridden for specific platforms and configurations + * (debug, release, ...) using [url=$DOCS_URL/tutorials/export/feature_tags.html]feature tags[/url]. + * **Overriding:** Any project setting can be overridden by creating a file named `override.cfg` in + * the project's root directory. This can also be used in exported projects by placing this file in the + * same directory as the project binary. Overriding will still take the base project settings' + * [url=$DOCS_URL/tutorials/export/feature_tags.html]feature tags[/url] in account. Therefore, make + * sure to *also* override the setting with the desired feature tags if you want them to override base + * project settings on all platforms and configurations. */ @GodotBaseType public object ProjectSettings : Object() { @@ -70,26 +72,19 @@ public object ProjectSettings : Object() { /** * Sets the value of a setting. - * * **Example:** * - * [codeblocks] - * - * [gdscript] - * + * gdscript: + * ```gdscript * ProjectSettings.set_setting("application/config/name", "Example") - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * ProjectSettings.SetSetting("application/config/name", "Example"); + * ``` * - * [/csharp] - * - * [/codeblocks] - * - * This can also be used to erase custom project settings. To do this change the setting value to `null`. + * This can also be used to erase custom project settings. To do this change the setting value to + * `null`. */ public fun setSetting(name: String, `value`: Any?): Unit { TransferContext.writeArguments(STRING to name, ANY to value) @@ -97,31 +92,26 @@ public object ProjectSettings : Object() { } /** - * Returns the value of the setting identified by [name]. If the setting doesn't exist and [defaultValue] is specified, the value of [defaultValue] is returned. Otherwise, `null` is returned. - * + * Returns the value of the setting identified by [param name]. If the setting doesn't exist and + * [param default_value] is specified, the value of [param default_value] is returned. Otherwise, + * `null` is returned. * **Example:** * - * [codeblocks] - * - * [gdscript] - * + * gdscript: + * ```gdscript * print(ProjectSettings.get_setting("application/config/name")) - * - * print(ProjectSettings.get_setting("application/config/custom_description", "No description specified.")) - * - * [/gdscript] - * - * [csharp] - * + * print(ProjectSettings.get_setting("application/config/custom_description", "No description + * specified.")) + * ``` + * csharp: + * ```csharp * GD.Print(ProjectSettings.GetSetting("application/config/name")); + * GD.Print(ProjectSettings.GetSetting("application/config/custom_description", "No description + * specified.")); + * ``` * - * GD.Print(ProjectSettings.GetSetting("application/config/custom_description", "No description specified.")); - * - * [/csharp] - * - * [/codeblocks] - * - * **Note:** This method doesn't take potential feature overrides into account automatically. Use [getSettingWithOverride] to handle seamlessly. + * **Note:** This method doesn't take potential feature overrides into account automatically. Use + * [getSettingWithOverride] to handle seamlessly. */ @JvmOverloads public fun getSetting(name: String, defaultValue: Any? = null): Any? { @@ -132,28 +122,21 @@ public object ProjectSettings : Object() { /** * Similar to [getSetting], but applies feature tag overrides if any exists and is valid. - * * **Example:** + * If the following setting override exists "application/config/name.windows", and the following + * code is executed: * - * If the following setting override exists "application/config/name.windows", and the following code is executed: - * - * [codeblocks] - * - * [gdscript] - * + * gdscript: + * ```gdscript * print(ProjectSettings.get_setting_with_override("application/config/name")) - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * GD.Print(ProjectSettings.GetSettingWithOverride("application/config/name")); + * ``` * - * [/csharp] - * - * [/codeblocks] - * - * Then the overridden setting will be returned instead if the project is running on the *Windows* operating system. + * Then the overridden setting will be returned instead if the project is running on the *Windows* + * operating system. */ public fun getSettingWithOverride(name: StringName): Any? { TransferContext.writeArguments(STRING_NAME to name) @@ -162,19 +145,15 @@ public object ProjectSettings : Object() { } /** - * Returns an [godot.Array] of registered global classes. Each global class is represented as a [godot.core.Dictionary] that contains the following entries: - * + * Returns an [Array] of registered global classes. Each global class is represented as a + * [Dictionary] that contains the following entries: * - `base` is a name of the base class; - * * - `class` is a name of the registered global class; - * * - `icon` is a path to a custom icon of the global class, if it has any; - * * - `language` is a name of a programming language in which the global class is written; - * * - `path` is a path to a file containing the global class. - * - * **Note:** Both the script and the icon paths are local to the project filesystem, i.e. they start with `res://`. + * **Note:** Both the script and the icon paths are local to the project filesystem, i.e. they + * start with `res://`. */ public fun getGlobalClassList(): VariantArray> { TransferContext.writeArguments() @@ -208,7 +187,9 @@ public object ProjectSettings : Object() { } /** - * Defines if the specified setting is considered basic or advanced. Basic settings will always be shown in the project settings. Advanced settings will only be shown if the user enables the "Advanced Settings" option. + * Defines if the specified setting is considered basic or advanced. Basic settings will always be + * shown in the project settings. Advanced settings will only be shown if the user enables the + * "Advanced Settings" option. */ public fun setAsBasic(name: String, basic: Boolean): Unit { TransferContext.writeArguments(STRING to name, BOOL to basic) @@ -216,7 +197,9 @@ public object ProjectSettings : Object() { } /** - * Defines if the specified setting is considered internal. An internal setting won't show up in the Project Settings dialog. This is mostly useful for addons that need to store their own internal settings without exposing them directly to the user. + * Defines if the specified setting is considered internal. An internal setting won't show up in + * the Project Settings dialog. This is mostly useful for addons that need to store their own + * internal settings without exposing them directly to the user. */ public fun setAsInternal(name: String, `internal`: Boolean): Unit { TransferContext.writeArguments(STRING to name, BOOL to internal) @@ -225,68 +208,38 @@ public object ProjectSettings : Object() { /** * Adds a custom property info to a property. The dictionary must contain: - * - * - `"name"`: [godot.String] (the property's name) - * + * - `"name"`: [String] (the property's name) * - `"type"`: [int] (see [enum Variant.Type]) - * - * - optionally `"hint"`: [int] (see [enum PropertyHint]) and `"hint_string"`: [godot.String] - * + * - optionally `"hint"`: [int] (see [enum PropertyHint]) and `"hint_string"`: [String] * **Example:** * - * [codeblocks] - * - * [gdscript] - * + * gdscript: + * ```gdscript * ProjectSettings.set("category/property_name", 0) * - * - * * var property_info = { - * * "name": "category/property_name", - * * "type": TYPE_INT, - * * "hint": PROPERTY_HINT_ENUM, - * * "hint_string": "one,two,three" - * * } * - * - * * ProjectSettings.add_property_info(property_info) - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * ProjectSettings.Singleton.Set("category/property_name", 0); * - * - * * var propertyInfo = new Godot.Collections.Dictionary - * * { - * * {"name", "category/propertyName"}, - * * {"type", (int)Variant.Type.Int}, - * * {"hint", (int)PropertyHint.Enum}, - * * {"hint_string", "one,two,three"}, - * * }; * - * - * * ProjectSettings.AddPropertyInfo(propertyInfo); - * - * [/csharp] - * - * [/codeblocks] + * ``` */ public fun addPropertyInfo(hint: Dictionary): Unit { TransferContext.writeArguments(DICTIONARY to hint) @@ -295,8 +248,9 @@ public object ProjectSettings : Object() { /** * Sets whether a setting requires restarting the editor to properly take effect. - * - * **Note:** This is just a hint to display to the user that the editor must be restarted for changes to take effect. Enabling [setRestartIfChanged] does *not* delay the setting being set when changed. + * **Note:** This is just a hint to display to the user that the editor must be restarted for + * changes to take effect. Enabling [setRestartIfChanged] does *not* delay the setting being set when + * changed. */ public fun setRestartIfChanged(name: String, restart: Boolean): Unit { TransferContext.writeArguments(STRING to name, BOOL to restart) @@ -312,7 +266,8 @@ public object ProjectSettings : Object() { } /** - * Returns the localized path (starting with `res://`) corresponding to the absolute, native OS [path]. See also [globalizePath]. + * Returns the localized path (starting with `res://`) corresponding to the absolute, native OS + * [param path]. See also [globalizePath]. */ public fun localizePath(path: String): String { TransferContext.writeArguments(STRING to path) @@ -321,23 +276,25 @@ public object ProjectSettings : Object() { } /** - * Returns the absolute, native OS path corresponding to the localized [path] (starting with `res://` or `user://`). The returned path will vary depending on the operating system and user preferences. See [godot.File paths in Godot projects]($DOCS_URL/tutorials/io/data_paths.html) to see what those paths convert to. See also [localizePath]. - * - * **Note:** [globalizePath] with `res://` will not work in an exported project. Instead, prepend the executable's base directory to the path when running from an exported project: - * - * ``` - * var path = "" - * if OS.has_feature("editor"): - * # Running from an editor binary. - * # `path` will contain the absolute path to `hello.txt` located in the project root. - * path = ProjectSettings.globalize_path("res://hello.txt") - * else: - * # Running from an exported project. - * # `path` will contain the absolute path to `hello.txt` next to the executable. - * # This is *not* identical to using `ProjectSettings.globalize_path()` with a `res://` path, - * # but is close enough in spirit. - * path = OS.get_executable_path().get_base_dir().path_join("hello.txt") - * ``` + * Returns the absolute, native OS path corresponding to the localized [param path] (starting with + * `res://` or `user://`). The returned path will vary depending on the operating system and user + * preferences. See [url=$DOCS_URL/tutorials/io/data_paths.html]File paths in Godot projects[/url] to + * see what those paths convert to. See also [localizePath]. + * **Note:** [globalizePath] with `res://` will not work in an exported project. Instead, prepend + * the executable's base directory to the path when running from an exported project: + * [codeblock] + * var path = "" + * if OS.has_feature("editor"): + * # Running from an editor binary. + * # `path` will contain the absolute path to `hello.txt` located in the project root. + * path = ProjectSettings.globalize_path("res://hello.txt") + * else: + * # Running from an exported project. + * # `path` will contain the absolute path to `hello.txt` next to the executable. + * # This is *not* identical to using `ProjectSettings.globalize_path()` with a `res://` path, + * # but is close enough in spirit. + * path = OS.get_executable_path().get_base_dir().path_join("hello.txt") + * [/codeblock] */ public fun globalizePath(path: String): String { TransferContext.writeArguments(STRING to path) @@ -347,8 +304,9 @@ public object ProjectSettings : Object() { /** * Saves the configuration to the `project.godot` file. - * - * **Note:** This method is intended to be used by editor plugins, as modified [godot.ProjectSettings] can't be loaded back in the running app. If you want to change project settings in exported projects, use [saveCustom] to save `override.cfg` file. + * **Note:** This method is intended to be used by editor plugins, as modified [ProjectSettings] + * can't be loaded back in the running app. If you want to change project settings in exported + * projects, use [saveCustom] to save `override.cfg` file. */ public fun save(): GodotError { TransferContext.writeArguments() @@ -357,11 +315,13 @@ public object ProjectSettings : Object() { } /** - * Loads the contents of the .pck or .zip file specified by [pack] into the resource filesystem (`res://`). Returns `true` on success. - * - * **Note:** If a file from [pack] shares the same path as a file already in the resource filesystem, any attempts to load that file will use the file from [pack] unless [replaceFiles] is set to `false`. - * - * **Note:** The optional [offset] parameter can be used to specify the offset in bytes to the start of the resource pack. This is only supported for .pck files. + * Loads the contents of the .pck or .zip file specified by [param pack] into the resource + * filesystem (`res://`). Returns `true` on success. + * **Note:** If a file from [param pack] shares the same path as a file already in the resource + * filesystem, any attempts to load that file will use the file from [param pack] unless [param + * replace_files] is set to `false`. + * **Note:** The optional [param offset] parameter can be used to specify the offset in bytes to + * the start of the resource pack. This is only supported for .pck files. */ @JvmOverloads public fun loadResourcePack( @@ -375,7 +335,10 @@ public object ProjectSettings : Object() { } /** - * Saves the configuration to a custom file. The file extension must be `.godot` (to save in text-based [godot.ConfigFile] format) or `.binary` (to save in binary format). You can also save `override.cfg` file, which is also text, but can be used in exported projects unlike other formats. + * Saves the configuration to a custom file. The file extension must be `.godot` (to save in + * text-based [ConfigFile] format) or `.binary` (to save in binary format). You can also save + * `override.cfg` file, which is also text, but can be used in exported projects unlike other + * formats. */ public fun saveCustom(`file`: String): GodotError { TransferContext.writeArguments(STRING to file) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PropertyHint.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PropertyHint.kt index a4ef2cab8..bf51444fc 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PropertyHint.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PropertyHint.kt @@ -6,30 +6,219 @@ import kotlin.Long public enum class PropertyHint( id: Long, ) { + /** + * The property has no hint for the editor. + */ PROPERTY_HINT_NONE(0), + /** + * Hints that an [int] or [float] property should be within a range specified via the hint string + * `"min,max"` or `"min,max,step"`. The hint string can optionally include `"or_greater"` and/or + * `"or_less"` to allow manual input going respectively above the max or below the min values. + * **Example:** `"-360,360,1,or_greater,or_less"`. + * Additionally, other keywords can be included: `"exp"` for exponential range editing, + * `"radians_as_degrees"` for editing radian angles in degrees (the range values are also in + * degrees), `"degrees"` to hint at an angle and `"hide_slider"` to hide the slider. + */ PROPERTY_HINT_RANGE(1), + /** + * Hints that an [int] or [String] property is an enumerated value to pick in a list specified via + * a hint string. + * The hint string is a comma separated list of names such as `"Hello,Something,Else"`. + * Whitespaces are **not** removed from either end of a name. For integer properties, the first name + * in the list has value 0, the next 1, and so on. Explicit values can also be specified by appending + * `:integer` to the name, e.g. `"Zero,One,Three:3,Four,Six:6"`. + */ PROPERTY_HINT_ENUM(2), + /** + * Hints that a [String] property can be an enumerated value to pick in a list specified via a + * hint string such as `"Hello,Something,Else"`. + * Unlike [constant PROPERTY_HINT_ENUM], a property with this hint still accepts arbitrary values + * and can be empty. The list of values serves to suggest possible values. + */ PROPERTY_HINT_ENUM_SUGGESTION(3), + /** + * Hints that a [float] property should be edited via an exponential easing function. The hint + * string can include `"attenuation"` to flip the curve horizontally and/or `"positive_only"` to + * exclude in/out easing and limit values to be greater than or equal to zero. + */ PROPERTY_HINT_EXP_EASING(4), + /** + * Hints that a vector property should allow its components to be linked. For example, this allows + * [Vector2.x] and [Vector2.y] to be edited together. + */ PROPERTY_HINT_LINK(5), + /** + * Hints that an [int] property is a bitmask with named bit flags. + * The hint string is a comma separated list of names such as `"Bit0,Bit1,Bit2,Bit3"`. Whitespaces + * are **not** removed from either end of a name. The first name in the list has value 1, the next 2, + * then 4, 8, 16 and so on. Explicit values can also be specified by appending `:integer` to the + * name, e.g. `"A:4,B:8,C:16"`. You can also combine several flags (`"A:4,B:8,AB:12,C:16"`). + * **Note:** A flag value must be at least `1` and at most `2 ** 32 - 1`. + * **Note:** Unlike [constant PROPERTY_HINT_ENUM], the previous explicit value is not taken into + * account. For the hint `"A:16,B,C"`, A is 16, B is 2, C is 4. + */ PROPERTY_HINT_FLAGS(6), + /** + * Hints that an [int] property is a bitmask using the optionally named 2D render layers. + */ PROPERTY_HINT_LAYERS_2D_RENDER(7), + /** + * Hints that an [int] property is a bitmask using the optionally named 2D physics layers. + */ PROPERTY_HINT_LAYERS_2D_PHYSICS(8), + /** + * Hints that an [int] property is a bitmask using the optionally named 2D navigation layers. + */ PROPERTY_HINT_LAYERS_2D_NAVIGATION(9), + /** + * Hints that an [int] property is a bitmask using the optionally named 3D render layers. + */ PROPERTY_HINT_LAYERS_3D_RENDER(10), + /** + * Hints that an [int] property is a bitmask using the optionally named 3D physics layers. + */ PROPERTY_HINT_LAYERS_3D_PHYSICS(11), + /** + * Hints that an [int] property is a bitmask using the optionally named 3D navigation layers. + */ PROPERTY_HINT_LAYERS_3D_NAVIGATION(12), + /** + * Hints that an integer property is a bitmask using the optionally named avoidance layers. + */ PROPERTY_HINT_LAYERS_AVOIDANCE(37), + /** + * Hints that a [String] property is a path to a file. Editing it will show a file dialog for + * picking the path. The hint string can be a set of filters with wildcards like `"*.png,*.jpg"`. + */ PROPERTY_HINT_FILE(13), + /** + * Hints that a [String] property is a path to a directory. Editing it will show a file dialog for + * picking the path. + */ PROPERTY_HINT_DIR(14), + /** + * Hints that a [String] property is an absolute path to a file outside the project folder. + * Editing it will show a file dialog for picking the path. The hint string can be a set of filters + * with wildcards, like `"*.png,*.jpg"`. + */ PROPERTY_HINT_GLOBAL_FILE(15), + /** + * Hints that a [String] property is an absolute path to a directory outside the project folder. + * Editing it will show a file dialog for picking the path. + */ PROPERTY_HINT_GLOBAL_DIR(16), + /** + * Hints that a property is an instance of a [Resource]-derived type, optionally specified via the + * hint string (e.g. `"Texture2D"`). Editing it will show a popup menu of valid resource types to + * instantiate. + */ PROPERTY_HINT_RESOURCE_TYPE(17), + /** + * Hints that a [String] property is text with line breaks. Editing it will show a text input + * field where line breaks can be typed. + */ PROPERTY_HINT_MULTILINE_TEXT(18), + /** + * Hints that a [String] property is an [Expression]. + */ PROPERTY_HINT_EXPRESSION(19), + /** + * Hints that a [String] property should show a placeholder text on its input field, if empty. The + * hint string is the placeholder text to use. + */ PROPERTY_HINT_PLACEHOLDER_TEXT(20), + /** + * Hints that a [Color] property should be edited without affecting its transparency ([Color.a] is + * not editable). + */ PROPERTY_HINT_COLOR_NO_ALPHA(21), PROPERTY_HINT_OBJECT_ID(22), + /** + * If a property is [String], hints that the property represents a particular type (class). This + * allows to select a type from the create dialog. The property will store the selected type as a + * string. + * If a property is [Array], hints the editor how to show elements. The `hint_string` must encode + * nested types using `":"` and `"/"`. + * + * gdscript: + * ```gdscript + * # Array of elem_type. + * hint_string = "%d:" % [elem_type] + * hint_string = "%d/%d:%s" % [elem_type, elem_hint, elem_hint_string] + * # Two-dimensional array of elem_type (array of arrays of elem_type). + * hint_string = "%d:%d:" % [TYPE_ARRAY, elem_type] + * hint_string = "%d:%d/%d:%s" % [TYPE_ARRAY, elem_type, elem_hint, + * elem_hint_string] + * # Three-dimensional array of elem_type (array of arrays of arrays of elem_type). + * hint_string = "%d:%d:%d:" % [TYPE_ARRAY, TYPE_ARRAY, elem_type] + * hint_string = "%d:%d:%d/%d:%s" % [TYPE_ARRAY, TYPE_ARRAY, elem_type, + * elem_hint, elem_hint_string] + * ``` + * csharp: + * ```csharp + * // Array of elemType. + * hintString = $"{elemType:D}:"; + * hintString = $"{elemType:}/{elemHint:D}:{elemHintString}"; + * // Two-dimensional array of elemType (array of arrays of elemType). + * hintString = $"{Variant.Type.Array:D}:{elemType:D}:"; + * hintString = $"{Variant.Type.Array:D}:{elemType:D}/{elemHint:D}:{elemHintString}"; + * // Three-dimensional array of elemType (array of arrays of arrays of elemType). + * hintString = $"{Variant.Type.Array:D}:{Variant.Type.Array:D}:{elemType:D}:"; + * hintString = + * $"{Variant.Type.Array:D}:{Variant.Type.Array:D}:{elemType:D}/{elemHint:D}:{elemHintString}"; + * ``` + * + * Examples: + * + * gdscript: + * ```gdscript + * hint_string = "%d:" % [TYPE_INT] # Array of integers. + * hint_string = "%d/%d:1,10,1" % [TYPE_INT, PROPERTY_HINT_RANGE] # Array of integers + * (in range from 1 to 10). + * hint_string = "%d/%d:Zero,One,Two" % [TYPE_INT, PROPERTY_HINT_ENUM] # Array of + * integers (an enum). + * hint_string = "%d/%d:Zero,One,Three:3,Six:6" % [TYPE_INT, PROPERTY_HINT_ENUM] # + * Array of integers (an enum). + * hint_string = "%d/%d:*.png" % [TYPE_STRING, PROPERTY_HINT_FILE] # Array of strings + * (file paths). + * hint_string = "%d/%d:Texture2D" % [TYPE_OBJECT, PROPERTY_HINT_RESOURCE_TYPE] # + * Array of textures. + * + * hint_string = "%d:%d:" % [TYPE_ARRAY, TYPE_FLOAT] # Two-dimensional array of + * floats. + * hint_string = "%d:%d/%d:" % [TYPE_ARRAY, TYPE_STRING, + * PROPERTY_HINT_MULTILINE_TEXT] # Two-dimensional array of multiline strings. + * hint_string = "%d:%d/%d:-1,1,0.1" % [TYPE_ARRAY, TYPE_FLOAT, + * PROPERTY_HINT_RANGE] # Two-dimensional array of floats (in range from -1 to 1). + * hint_string = "%d:%d/%d:Texture2D" % [TYPE_ARRAY, TYPE_OBJECT, + * PROPERTY_HINT_RESOURCE_TYPE] # Two-dimensional array of textures. + * ``` + * csharp: + * ```csharp + * hintString = $"{Variant.Type.Int:D}/{PropertyHint.Range:D}:1,10,1"; // Array of integers (in + * range from 1 to 10). + * hintString = $"{Variant.Type.Int:D}/{PropertyHint.Enum:D}:Zero,One,Two"; // Array of integers + * (an enum). + * hintString = $"{Variant.Type.Int:D}/{PropertyHint.Enum:D}:Zero,One,Three:3,Six:6"; // Array of + * integers (an enum). + * hintString = $"{Variant.Type.String:D}/{PropertyHint.File:D}:*.png"; // Array of strings (file + * paths). + * hintString = $"{Variant.Type.Object:D}/{PropertyHint.ResourceType:D}:Texture2D"; // Array of + * textures. + * + * hintString = $"{Variant.Type.Array:D}:{Variant.Type.Float:D}:"; // Two-dimensional array of + * floats. + * hintString = $"{Variant.Type.Array:D}:{Variant.Type.String:D}/{PropertyHint.MultilineText:D}:"; + * // Two-dimensional array of multiline strings. + * hintString = $"{Variant.Type.Array:D}:{Variant.Type.Float:D}/{PropertyHint.Range:D}:-1,1,0.1"; + * // Two-dimensional array of floats (in range from -1 to 1). + * hintString = + * $"{Variant.Type.Array:D}:{Variant.Type.Object:D}/{PropertyHint.ResourceType:D}:Texture2D"; // + * Two-dimensional array of textures. + * ``` + * + * **Note:** The trailing colon is required for properly detecting built-in types. + */ PROPERTY_HINT_TYPE_STRING(23), PROPERTY_HINT_NODE_PATH_TO_EDITED_NODE(24), PROPERTY_HINT_OBJECT_TOO_BIG(25), @@ -39,11 +228,29 @@ public enum class PropertyHint( PROPERTY_HINT_INT_IS_OBJECTID(29), PROPERTY_HINT_INT_IS_POINTER(30), PROPERTY_HINT_ARRAY_TYPE(31), + /** + * Hints that a string property is a locale code. Editing it will show a locale dialog for picking + * language and country. + */ PROPERTY_HINT_LOCALE_ID(32), + /** + * Hints that a dictionary property is string translation map. Dictionary keys are locale codes + * and, values are translated strings. + */ PROPERTY_HINT_LOCALIZABLE_STRING(33), PROPERTY_HINT_NODE_TYPE(34), + /** + * Hints that a quaternion property should disable the temporary euler editor. + */ PROPERTY_HINT_HIDE_QUATERNION_EDIT(35), + /** + * Hints that a string property is a password, and every character is replaced with the secret + * character. + */ PROPERTY_HINT_PASSWORD(36), + /** + * Represents the size of the [enum PropertyHint] enum. + */ PROPERTY_HINT_MAX(38), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/PropertyTweener.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/PropertyTweener.kt index be4bbed94..9423b01c3 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/PropertyTweener.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/PropertyTweener.kt @@ -21,11 +21,10 @@ import kotlin.Int import kotlin.Suppress /** - * Interpolates an [godot.Object]'s property over time. - * - * [godot.PropertyTweener] is used to interpolate a property in an object. See [godot.Tween.tweenProperty] for more usage information. - * - * **Note:** [godot.Tween.tweenProperty] is the only correct way to create [godot.PropertyTweener]. Any [godot.PropertyTweener] created manually will not function correctly. + * [PropertyTweener] is used to interpolate a property in an object. See [Tween.tweenProperty] for + * more usage information. + * **Note:** [Tween.tweenProperty] is the only correct way to create [PropertyTweener]. Any + * [PropertyTweener] created manually will not function correctly. */ @GodotBaseType public open class PropertyTweener : Tweener() { @@ -35,14 +34,13 @@ public open class PropertyTweener : Tweener() { } /** - * Sets a custom initial value to the [godot.PropertyTweener]. - * + * Sets a custom initial value to the [PropertyTweener]. * **Example:** - * - * ``` - * var tween = get_tree().create_tween() - * tween.tween_property(self, "position", Vector2(200, 100), 1).from(Vector2(100, 100)) #this will move the node from position (100, 100) to (200, 100) - * ``` + * [codeblock] + * var tween = get_tree().create_tween() + * tween.tween_property(self, "position", Vector2(200, 100), 1).from(Vector2(100, 100)) #this will + * move the node from position (100, 100) to (200, 100) + * [/codeblock] */ public fun from(`value`: Any?): PropertyTweener? { TransferContext.writeArguments(ANY to value) @@ -51,12 +49,13 @@ public open class PropertyTweener : Tweener() { } /** - * Makes the [godot.PropertyTweener] use the current property value (i.e. at the time of creating this [godot.PropertyTweener]) as a starting point. This is equivalent of using [from] with the current value. These two calls will do the same: - * - * ``` - * tween.tween_property(self, "position", Vector2(200, 100), 1).from(position) - * tween.tween_property(self, "position", Vector2(200, 100), 1).from_current() - * ``` + * Makes the [PropertyTweener] use the current property value (i.e. at the time of creating this + * [PropertyTweener]) as a starting point. This is equivalent of using [from] with the current value. + * These two calls will do the same: + * [codeblock] + * tween.tween_property(self, "position", Vector2(200, 100), 1).from(position) + * tween.tween_property(self, "position", Vector2(200, 100), 1).from_current() + * [/codeblock] */ public fun fromCurrent(): PropertyTweener? { TransferContext.writeArguments() @@ -66,13 +65,12 @@ public open class PropertyTweener : Tweener() { /** * When called, the final value will be used as a relative value instead. - * * **Example:** - * - * ``` - * var tween = get_tree().create_tween() - * tween.tween_property(self, "position", Vector2.RIGHT * 100, 1).as_relative() #the node will move by 100 pixels to the right - * ``` + * [codeblock] + * var tween = get_tree().create_tween() + * tween.tween_property(self, "position", Vector2.RIGHT * 100, 1).as_relative() #the node will + * move by 100 pixels to the right + * [/codeblock] */ public fun asRelative(): PropertyTweener? { TransferContext.writeArguments() @@ -81,7 +79,8 @@ public open class PropertyTweener : Tweener() { } /** - * Sets the type of used transition from [enum Tween.TransitionType]. If not set, the default transition is used from the [godot.Tween] that contains this Tweener. + * Sets the type of used transition from [enum Tween.TransitionType]. If not set, the default + * transition is used from the [Tween] that contains this Tweener. */ public fun setTrans(trans: Tween.TransitionType): PropertyTweener? { TransferContext.writeArguments(LONG to trans.id) @@ -90,7 +89,8 @@ public open class PropertyTweener : Tweener() { } /** - * Sets the type of used easing from [enum Tween.EaseType]. If not set, the default easing is used from the [godot.Tween] that contains this Tweener. + * Sets the type of used easing from [enum Tween.EaseType]. If not set, the default easing is used + * from the [Tween] that contains this Tweener. */ public fun setEase(ease: Tween.EaseType): PropertyTweener? { TransferContext.writeArguments(LONG to ease.id) @@ -99,7 +99,8 @@ public open class PropertyTweener : Tweener() { } /** - * Sets the time in seconds after which the [godot.PropertyTweener] will start interpolating. By default there's no delay. + * Sets the time in seconds after which the [PropertyTweener] will start interpolating. By default + * there's no delay. */ public fun setDelay(delay: Double): PropertyTweener? { TransferContext.writeArguments(DOUBLE to delay) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/QuadMesh.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/QuadMesh.kt index a1103ab0a..424487958 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/QuadMesh.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/QuadMesh.kt @@ -12,12 +12,10 @@ import kotlin.Int import kotlin.Suppress /** - * Class representing a square mesh facing the camera. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/129](https://godotengine.org/asset-library/asset/129) - * - * Class representing a square [godot.PrimitiveMesh]. This flat mesh does not have a thickness. By default, this mesh is aligned on the X and Y axes; this rotation is more suited for use with billboarded materials. A [godot.QuadMesh] is equivalent to a [godot.PlaneMesh] except its default [godot.PlaneMesh.orientation] is [godot.PlaneMesh.FACE_Z]. + * Class representing a square [PrimitiveMesh]. This flat mesh does not have a thickness. By + * default, this mesh is aligned on the X and Y axes; this rotation is more suited for use with + * billboarded materials. A [QuadMesh] is equivalent to a [PlaneMesh] except its default + * [PlaneMesh.orientation] is [constant PlaneMesh.FACE_Z]. */ @GodotBaseType public open class QuadMesh : PlaneMesh() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/QuadOccluder3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/QuadOccluder3D.kt index 1c64c9302..f0b55e38f 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/QuadOccluder3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/QuadOccluder3D.kt @@ -21,14 +21,9 @@ import kotlin.Suppress import kotlin.Unit /** - * Flat plane shape for use with occlusion culling in [godot.OccluderInstance3D]. - * - * Tutorials: - * [$DOCS_URL/tutorials/3d/occlusion_culling.html]($DOCS_URL/tutorials/3d/occlusion_culling.html) - * - * [godot.QuadOccluder3D] stores a flat plane shape that can be used by the engine's occlusion culling system. See also [godot.PolygonOccluder3D] if you need to customize the quad's shape. - * - * See [godot.OccluderInstance3D]'s documentation for instructions on setting up occlusion culling. + * [QuadOccluder3D] stores a flat plane shape that can be used by the engine's occlusion culling + * system. See also [PolygonOccluder3D] if you need to customize the quad's shape. + * See [OccluderInstance3D]'s documentation for instructions on setting up occlusion culling. */ @GodotBaseType public open class QuadOccluder3D : Occluder3D() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/RDAttachmentFormat.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/RDAttachmentFormat.kt index 68b634e82..4ec9ff344 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/RDAttachmentFormat.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/RDAttachmentFormat.kt @@ -18,9 +18,7 @@ import kotlin.Long import kotlin.Suppress /** - * Attachment format (used by [godot.RenderingDevice]). - * - * This object is used by [godot.RenderingDevice]. + * This object is used by [RenderingDevice]. */ @GodotBaseType public open class RDAttachmentFormat : RefCounted() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/RDFramebufferPass.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/RDFramebufferPass.kt index 117df10e0..87b157cfc 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/RDFramebufferPass.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/RDFramebufferPass.kt @@ -20,18 +20,17 @@ import kotlin.Long import kotlin.Suppress /** - * Framebuffer pass attachment description (used by [godot.RenderingDevice]). - * - * This class contains the list of attachment descriptions for a framebuffer pass. Each points with an index to a previously supplied list of texture attachments. - * - * Multipass framebuffers can optimize some configurations in mobile. On desktop, they provide little to no advantage. - * - * This object is used by [godot.RenderingDevice]. + * This class contains the list of attachment descriptions for a framebuffer pass. Each points with + * an index to a previously supplied list of texture attachments. + * Multipass framebuffers can optimize some configurations in mobile. On desktop, they provide + * little to no advantage. + * This object is used by [RenderingDevice]. */ @GodotBaseType public open class RDFramebufferPass : RefCounted() { /** - * Color attachments in order starting from 0. If this attachment is not used by the shader, pass ATTACHMENT_UNUSED to skip. + * Color attachments in order starting from 0. If this attachment is not used by the shader, pass + * ATTACHMENT_UNUSED to skip. */ public var colorAttachments: PackedInt32Array get() { @@ -45,7 +44,8 @@ public open class RDFramebufferPass : RefCounted() { } /** - * Used for multipass framebuffers (more than one render pass). Converts an attachment to an input. Make sure to also supply it properly in the [godot.RDUniform] for the uniform set. + * Used for multipass framebuffers (more than one render pass). Converts an attachment to an + * input. Make sure to also supply it properly in the [RDUniform] for the uniform set. */ public var inputAttachments: PackedInt32Array get() { @@ -59,7 +59,8 @@ public open class RDFramebufferPass : RefCounted() { } /** - * If the color attachments are multisampled, non-multisampled resolve attachments can be provided. + * If the color attachments are multisampled, non-multisampled resolve attachments can be + * provided. */ public var resolveAttachments: PackedInt32Array get() { @@ -89,7 +90,8 @@ public open class RDFramebufferPass : RefCounted() { } /** - * Depth attachment. ATTACHMENT_UNUSED should be used if no depth buffer is required for this pass. + * Depth attachment. ATTACHMENT_UNUSED should be used if no depth buffer is required for this + * pass. */ public var depthAttachment: Int get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/RDPipelineColorBlendState.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/RDPipelineColorBlendState.kt index 741a50cc8..45666ebb4 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/RDPipelineColorBlendState.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/RDPipelineColorBlendState.kt @@ -26,9 +26,7 @@ import kotlin.Suppress import kotlin.Unit /** - * Pipeline color blend state (used by [godot.RenderingDevice]). - * - * This object is used by [godot.RenderingDevice]. + * This object is used by [RenderingDevice]. */ @GodotBaseType public open class RDPipelineColorBlendState : RefCounted() { @@ -61,7 +59,7 @@ public open class RDPipelineColorBlendState : RefCounted() { } /** - * The constant color to blend with. See also [godot.RenderingDevice.drawListSetBlendConstants]. + * The constant color to blend with. See also [RenderingDevice.drawListSetBlendConstants]. */ @CoreTypeLocalCopy public var blendConstant: Color @@ -96,7 +94,7 @@ public open class RDPipelineColorBlendState : RefCounted() { } /** - * The constant color to blend with. See also [godot.RenderingDevice.drawListSetBlendConstants]. + * The constant color to blend with. See also [RenderingDevice.drawListSetBlendConstants]. * * This is a helper function to make dealing with local copies easier. * diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/RDPipelineColorBlendStateAttachment.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/RDPipelineColorBlendStateAttachment.kt index a51c9330f..bd554ec49 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/RDPipelineColorBlendStateAttachment.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/RDPipelineColorBlendStateAttachment.kt @@ -20,81 +20,72 @@ import kotlin.Suppress import kotlin.Unit /** - * Pipeline color blend state attachment (used by [godot.RenderingDevice]). - * - * Controls how blending between source and destination fragments is performed when using [godot.RenderingDevice]. - * + * Controls how blending between source and destination fragments is performed when using + * [RenderingDevice]. * For reference, this is how common user-facing blend modes are implemented in Godot's 2D renderer: - * * **Mix:** - * - * ``` - * var attachment = RDPipelineColorBlendStateAttachment.new() - * attachment.enable_blend = true - * attachment.color_blend_op = RenderingDevice.BLEND_OP_ADD - * attachment.src_color_blend_factor = RenderingDevice.BLEND_FACTOR_SRC_ALPHA - * attachment.dst_color_blend_factor = RenderingDevice.BLEND_FACTOR_ONE_MINUS_SRC_ALPHA - * attachment.alpha_blend_op = RenderingDevice.BLEND_OP_ADD - * attachment.src_alpha_blend_factor = RenderingDevice.BLEND_FACTOR_ONE - * attachment.dst_alpha_blend_factor = RenderingDevice.BLEND_FACTOR_ONE_MINUS_SRC_ALPHA - * ``` - * + * [codeblock] + * var attachment = RDPipelineColorBlendStateAttachment.new() + * attachment.enable_blend = true + * attachment.color_blend_op = RenderingDevice.BLEND_OP_ADD + * attachment.src_color_blend_factor = RenderingDevice.BLEND_FACTOR_SRC_ALPHA + * attachment.dst_color_blend_factor = RenderingDevice.BLEND_FACTOR_ONE_MINUS_SRC_ALPHA + * attachment.alpha_blend_op = RenderingDevice.BLEND_OP_ADD + * attachment.src_alpha_blend_factor = RenderingDevice.BLEND_FACTOR_ONE + * attachment.dst_alpha_blend_factor = RenderingDevice.BLEND_FACTOR_ONE_MINUS_SRC_ALPHA + * [/codeblock] * **Add:** - * - * ``` - * var attachment = RDPipelineColorBlendStateAttachment.new() - * attachment.enable_blend = true - * attachment.alpha_blend_op = RenderingDevice.BLEND_OP_ADD - * attachment.color_blend_op = RenderingDevice.BLEND_OP_ADD - * attachment.src_color_blend_factor = RenderingDevice.BLEND_FACTOR_SRC_ALPHA - * attachment.dst_color_blend_factor = RenderingDevice.BLEND_FACTOR_ONE - * attachment.src_alpha_blend_factor = RenderingDevice.BLEND_FACTOR_SRC_ALPHA - * attachment.dst_alpha_blend_factor = RenderingDevice.BLEND_FACTOR_ONE - * ``` - * + * [codeblock] + * var attachment = RDPipelineColorBlendStateAttachment.new() + * attachment.enable_blend = true + * attachment.alpha_blend_op = RenderingDevice.BLEND_OP_ADD + * attachment.color_blend_op = RenderingDevice.BLEND_OP_ADD + * attachment.src_color_blend_factor = RenderingDevice.BLEND_FACTOR_SRC_ALPHA + * attachment.dst_color_blend_factor = RenderingDevice.BLEND_FACTOR_ONE + * attachment.src_alpha_blend_factor = RenderingDevice.BLEND_FACTOR_SRC_ALPHA + * attachment.dst_alpha_blend_factor = RenderingDevice.BLEND_FACTOR_ONE + * [/codeblock] * **Subtract:** - * - * ``` - * var attachment = RDPipelineColorBlendStateAttachment.new() - * attachment.enable_blend = true - * attachment.alpha_blend_op = RenderingDevice.BLEND_OP_REVERSE_SUBTRACT - * attachment.color_blend_op = RenderingDevice.BLEND_OP_REVERSE_SUBTRACT - * attachment.src_color_blend_factor = RenderingDevice.BLEND_FACTOR_SRC_ALPHA - * attachment.dst_color_blend_factor = RenderingDevice.BLEND_FACTOR_ONE - * attachment.src_alpha_blend_factor = RenderingDevice.BLEND_FACTOR_SRC_ALPHA - * attachment.dst_alpha_blend_factor = RenderingDevice.BLEND_FACTOR_ONE - * ``` - * + * [codeblock] + * var attachment = RDPipelineColorBlendStateAttachment.new() + * attachment.enable_blend = true + * attachment.alpha_blend_op = RenderingDevice.BLEND_OP_REVERSE_SUBTRACT + * attachment.color_blend_op = RenderingDevice.BLEND_OP_REVERSE_SUBTRACT + * attachment.src_color_blend_factor = RenderingDevice.BLEND_FACTOR_SRC_ALPHA + * attachment.dst_color_blend_factor = RenderingDevice.BLEND_FACTOR_ONE + * attachment.src_alpha_blend_factor = RenderingDevice.BLEND_FACTOR_SRC_ALPHA + * attachment.dst_alpha_blend_factor = RenderingDevice.BLEND_FACTOR_ONE + * [/codeblock] * **Multiply:** - * - * ``` - * var attachment = RDPipelineColorBlendStateAttachment.new() - * attachment.enable_blend = true - * attachment.alpha_blend_op = RenderingDevice.BLEND_OP_ADD - * attachment.color_blend_op = RenderingDevice.BLEND_OP_ADD - * attachment.src_color_blend_factor = RenderingDevice.BLEND_FACTOR_DST_COLOR - * attachment.dst_color_blend_factor = RenderingDevice.BLEND_FACTOR_ZERO - * attachment.src_alpha_blend_factor = RenderingDevice.BLEND_FACTOR_DST_ALPHA - * attachment.dst_alpha_blend_factor = RenderingDevice.BLEND_FACTOR_ZERO - * ``` - * + * [codeblock] + * var attachment = RDPipelineColorBlendStateAttachment.new() + * attachment.enable_blend = true + * attachment.alpha_blend_op = RenderingDevice.BLEND_OP_ADD + * attachment.color_blend_op = RenderingDevice.BLEND_OP_ADD + * attachment.src_color_blend_factor = RenderingDevice.BLEND_FACTOR_DST_COLOR + * attachment.dst_color_blend_factor = RenderingDevice.BLEND_FACTOR_ZERO + * attachment.src_alpha_blend_factor = RenderingDevice.BLEND_FACTOR_DST_ALPHA + * attachment.dst_alpha_blend_factor = RenderingDevice.BLEND_FACTOR_ZERO + * [/codeblock] * **Pre-multiplied alpha:** - * - * ``` - * var attachment = RDPipelineColorBlendStateAttachment.new() - * attachment.enable_blend = true - * attachment.alpha_blend_op = RenderingDevice.BLEND_OP_ADD - * attachment.color_blend_op = RenderingDevice.BLEND_OP_ADD - * attachment.src_color_blend_factor = RenderingDevice.BLEND_FACTOR_ONE - * attachment.dst_color_blend_factor = RenderingDevice.BLEND_FACTOR_ONE_MINUS_SRC_ALPHA - * attachment.src_alpha_blend_factor = RenderingDevice.BLEND_FACTOR_ONE - * attachment.dst_alpha_blend_factor = RenderingDevice.BLEND_FACTOR_ONE_MINUS_SRC_ALPHA - * ``` + * [codeblock] + * var attachment = RDPipelineColorBlendStateAttachment.new() + * attachment.enable_blend = true + * attachment.alpha_blend_op = RenderingDevice.BLEND_OP_ADD + * attachment.color_blend_op = RenderingDevice.BLEND_OP_ADD + * attachment.src_color_blend_factor = RenderingDevice.BLEND_FACTOR_ONE + * attachment.dst_color_blend_factor = RenderingDevice.BLEND_FACTOR_ONE_MINUS_SRC_ALPHA + * attachment.src_alpha_blend_factor = RenderingDevice.BLEND_FACTOR_ONE + * attachment.dst_alpha_blend_factor = RenderingDevice.BLEND_FACTOR_ONE_MINUS_SRC_ALPHA + * [/codeblock] */ @GodotBaseType public open class RDPipelineColorBlendStateAttachment : RefCounted() { /** - * If `true`, performs blending between the source and destination according to the factors defined in [srcColorBlendFactor], [dstColorBlendFactor], [srcAlphaBlendFactor] and [dstAlphaBlendFactor]. The blend modes [colorBlendOp] and [alphaBlendOp] are also taken into account, with [writeR], [writeG], [writeB] and [writeA] controlling the output. + * If `true`, performs blending between the source and destination according to the factors + * defined in [srcColorBlendFactor], [dstColorBlendFactor], [srcAlphaBlendFactor] and + * [dstAlphaBlendFactor]. The blend modes [colorBlendOp] and [alphaBlendOp] are also taken into + * account, with [writeR], [writeG], [writeB] and [writeA] controlling the output. */ public var enableBlend: Boolean get() { @@ -108,7 +99,8 @@ public open class RDPipelineColorBlendStateAttachment : RefCounted() { } /** - * Controls how the blend factor for the color channels is determined based on the source's fragments. + * Controls how the blend factor for the color channels is determined based on the source's + * fragments. */ public var srcColorBlendFactor: RenderingDevice.BlendFactor get() { @@ -122,7 +114,8 @@ public open class RDPipelineColorBlendStateAttachment : RefCounted() { } /** - * Controls how the blend factor for the color channels is determined based on the destination's fragments. + * Controls how the blend factor for the color channels is determined based on the destination's + * fragments. */ public var dstColorBlendFactor: RenderingDevice.BlendFactor get() { @@ -150,7 +143,8 @@ public open class RDPipelineColorBlendStateAttachment : RefCounted() { } /** - * Controls how the blend factor for the alpha channel is determined based on the source's fragments. + * Controls how the blend factor for the alpha channel is determined based on the source's + * fragments. */ public var srcAlphaBlendFactor: RenderingDevice.BlendFactor get() { @@ -164,7 +158,8 @@ public open class RDPipelineColorBlendStateAttachment : RefCounted() { } /** - * Controls how the blend factor for the alpha channel is determined based on the destination's fragments. + * Controls how the blend factor for the alpha channel is determined based on the destination's + * fragments. */ public var dstAlphaBlendFactor: RenderingDevice.BlendFactor get() { @@ -253,7 +248,12 @@ public open class RDPipelineColorBlendStateAttachment : RefCounted() { } /** - * Convenience method to perform standard mix blending with straight (non-premultiplied) alpha. This sets [enableBlend] to `true`, [srcColorBlendFactor] to [godot.RenderingDevice.BLEND_FACTOR_SRC_ALPHA], [dstColorBlendFactor] to [godot.RenderingDevice.BLEND_FACTOR_ONE_MINUS_SRC_ALPHA], [srcAlphaBlendFactor] to [godot.RenderingDevice.BLEND_FACTOR_SRC_ALPHA] and [dstAlphaBlendFactor] to [godot.RenderingDevice.BLEND_FACTOR_ONE_MINUS_SRC_ALPHA]. + * Convenience method to perform standard mix blending with straight (non-premultiplied) alpha. + * This sets [enableBlend] to `true`, [srcColorBlendFactor] to [constant + * RenderingDevice.BLEND_FACTOR_SRC_ALPHA], [dstColorBlendFactor] to [constant + * RenderingDevice.BLEND_FACTOR_ONE_MINUS_SRC_ALPHA], [srcAlphaBlendFactor] to [constant + * RenderingDevice.BLEND_FACTOR_SRC_ALPHA] and [dstAlphaBlendFactor] to [constant + * RenderingDevice.BLEND_FACTOR_ONE_MINUS_SRC_ALPHA]. */ public fun setAsMix(): Unit { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/RDPipelineMultisampleState.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/RDPipelineMultisampleState.kt index 29ddec670..f2f80efe5 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/RDPipelineMultisampleState.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/RDPipelineMultisampleState.kt @@ -24,14 +24,14 @@ import kotlin.Long import kotlin.Suppress /** - * Pipeline multisample state (used by [godot.RenderingDevice]). - * - * [godot.RDPipelineMultisampleState] is used to control how multisample or supersample antialiasing is being performed when rendering using [godot.RenderingDevice]. + * [RDPipelineMultisampleState] is used to control how multisample or supersample antialiasing is + * being performed when rendering using [RenderingDevice]. */ @GodotBaseType public open class RDPipelineMultisampleState : RefCounted() { /** - * The number of MSAA samples (or SSAA samples if [enableSampleShading] is `true`) to perform. Higher values result in better antialiasing, at the cost of performance. + * The number of MSAA samples (or SSAA samples if [enableSampleShading] is `true`) to perform. + * Higher values result in better antialiasing, at the cost of performance. */ public var sampleCount: RenderingDevice.TextureSamples get() { @@ -45,7 +45,11 @@ public open class RDPipelineMultisampleState : RefCounted() { } /** - * If `true`, enables per-sample shading which replaces MSAA by SSAA. This provides higher quality antialiasing that works with transparent (alpha scissor) edges. This has a very high performance cost. See also [minSampleShading]. See the [per-sample shading Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#primsrast-sampleshading) for more details. + * If `true`, enables per-sample shading which replaces MSAA by SSAA. This provides higher quality + * antialiasing that works with transparent (alpha scissor) edges. This has a very high performance + * cost. See also [minSampleShading]. See the + * [url=https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#primsrast-sampleshading]per-sample + * shading Vulkan documentation[/url] for more details. */ public var enableSampleShading: Boolean get() { @@ -59,7 +63,10 @@ public open class RDPipelineMultisampleState : RefCounted() { } /** - * The multiplier of [sampleCount] that determines how many samples are performed for each fragment. Must be between `0.0` and `1.0` (inclusive). Only effective if [enableSampleShading] is `true`. If [minSampleShading] is `1.0`, fragment invocation must only read from the coverage index sample. Tile image access must not be used if [enableSampleShading] is *not* `1.0`. + * The multiplier of [sampleCount] that determines how many samples are performed for each + * fragment. Must be between `0.0` and `1.0` (inclusive). Only effective if [enableSampleShading] is + * `true`. If [minSampleShading] is `1.0`, fragment invocation must only read from the coverage index + * sample. Tile image access must not be used if [enableSampleShading] is *not* `1.0`. */ public var minSampleShading: Float get() { @@ -73,7 +80,9 @@ public open class RDPipelineMultisampleState : RefCounted() { } /** - * If `true`, alpha to coverage is enabled. This generates a temporary coverage value based on the alpha component of the fragment's first color output. This allows alpha transparency to make use of multisample antialiasing. + * If `true`, alpha to coverage is enabled. This generates a temporary coverage value based on the + * alpha component of the fragment's first color output. This allows alpha transparency to make use + * of multisample antialiasing. */ public var enableAlphaToCoverage: Boolean get() { @@ -87,7 +96,8 @@ public open class RDPipelineMultisampleState : RefCounted() { } /** - * If `true`, alpha is forced to either `0.0` or `1.0`. This allows hardening the edges of antialiased alpha transparencies. Only relevant if [enableAlphaToCoverage] is `true`. + * If `true`, alpha is forced to either `0.0` or `1.0`. This allows hardening the edges of + * antialiased alpha transparencies. Only relevant if [enableAlphaToCoverage] is `true`. */ public var enableAlphaToOne: Boolean get() { @@ -101,7 +111,9 @@ public open class RDPipelineMultisampleState : RefCounted() { } /** - * The sample mask array. See the [sample mask Vulkan documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#fragops-samplemask) for more details. + * The sample mask array. See the + * [url=https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#fragops-samplemask]sample + * mask Vulkan documentation[/url] for more details. */ public var sampleMasks: VariantArray get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/RDPipelineRasterizationState.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/RDPipelineRasterizationState.kt index a46e0af63..4cd563626 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/RDPipelineRasterizationState.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/RDPipelineRasterizationState.kt @@ -22,15 +22,10 @@ import kotlin.Long import kotlin.Suppress /** - * Pipeline rasterization state (used by [godot.RenderingDevice]). - * - * This object is used by [godot.RenderingDevice]. + * This object is used by [RenderingDevice]. */ @GodotBaseType public open class RDPipelineRasterizationState : RefCounted() { - /** - * - */ public var enableDepthClamp: Boolean get() { TransferContext.writeArguments() @@ -71,7 +66,8 @@ public open class RDPipelineRasterizationState : RefCounted() { } /** - * The cull mode to use when drawing polygons, which determines whether front faces or backfaces are hidden. + * The cull mode to use when drawing polygons, which determines whether front faces or backfaces + * are hidden. */ public var cullMode: RenderingDevice.PolygonCullMode get() { @@ -98,9 +94,6 @@ public open class RDPipelineRasterizationState : RefCounted() { TransferContext.callMethod(rawPtr, MethodBindings.setFrontFacePtr, NIL) } - /** - * - */ public var depthBiasEnabled: Boolean get() { TransferContext.writeArguments() @@ -112,9 +105,6 @@ public open class RDPipelineRasterizationState : RefCounted() { TransferContext.callMethod(rawPtr, MethodBindings.setDepthBiasEnabledPtr, NIL) } - /** - * - */ public var depthBiasConstantFactor: Float get() { TransferContext.writeArguments() @@ -126,9 +116,6 @@ public open class RDPipelineRasterizationState : RefCounted() { TransferContext.callMethod(rawPtr, MethodBindings.setDepthBiasConstantFactorPtr, NIL) } - /** - * - */ public var depthBiasClamp: Float get() { TransferContext.writeArguments() @@ -140,9 +127,6 @@ public open class RDPipelineRasterizationState : RefCounted() { TransferContext.callMethod(rawPtr, MethodBindings.setDepthBiasClampPtr, NIL) } - /** - * - */ public var depthBiasSlopeFactor: Float get() { TransferContext.writeArguments() @@ -155,7 +139,8 @@ public open class RDPipelineRasterizationState : RefCounted() { } /** - * The line width to use when drawing lines (in pixels). Thick lines may not be supported on all hardware. + * The line width to use when drawing lines (in pixels). Thick lines may not be supported on all + * hardware. */ public var lineWidth: Float get() { @@ -169,7 +154,8 @@ public open class RDPipelineRasterizationState : RefCounted() { } /** - * The number of control points to use when drawing a patch with tessellation enabled. Higher values result in higher quality at the cost of performance. + * The number of control points to use when drawing a patch with tessellation enabled. Higher + * values result in higher quality at the cost of performance. */ public var patchControlPoints: Long get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/RDPipelineSpecializationConstant.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/RDPipelineSpecializationConstant.kt index 0120340cd..7b1e8cda5 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/RDPipelineSpecializationConstant.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/RDPipelineSpecializationConstant.kt @@ -20,16 +20,17 @@ import kotlin.Long import kotlin.Suppress /** - * Pipeline specialization constant (used by [godot.RenderingDevice]). - * - * A *specialization constant* is a way to create additional variants of shaders without actually increasing the number of shader versions that are compiled. This allows improving performance by reducing the number of shader versions and reducing `if` branching, while still allowing shaders to be flexible for different use cases. - * - * This object is used by [godot.RenderingDevice]. + * A *specialization constant* is a way to create additional variants of shaders without actually + * increasing the number of shader versions that are compiled. This allows improving performance by + * reducing the number of shader versions and reducing `if` branching, while still allowing shaders to + * be flexible for different use cases. + * This object is used by [RenderingDevice]. */ @GodotBaseType public open class RDPipelineSpecializationConstant : RefCounted() { /** - * The specialization constant's value. Only [bool], [int] and [float] types are valid for specialization constants. + * The specialization constant's value. Only [bool], [int] and [float] types are valid for + * specialization constants. */ public var `value`: Any? get() { @@ -43,7 +44,8 @@ public open class RDPipelineSpecializationConstant : RefCounted() { } /** - * The identifier of the specialization constant. This is a value starting from `0` and that increments for every different specialization constant for a given shader. + * The identifier of the specialization constant. This is a value starting from `0` and that + * increments for every different specialization constant for a given shader. */ public var constantId: Long get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/RDSamplerState.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/RDSamplerState.kt index ea3785a24..22e871d02 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/RDSamplerState.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/RDSamplerState.kt @@ -22,9 +22,7 @@ import kotlin.Long import kotlin.Suppress /** - * Sampler state (used by [godot.RenderingDevice]). - * - * This object is used by [godot.RenderingDevice]. + * This object is used by [RenderingDevice]. */ @GodotBaseType public open class RDSamplerState : RefCounted() { @@ -42,9 +40,6 @@ public open class RDSamplerState : RefCounted() { TransferContext.callMethod(rawPtr, MethodBindings.setMagFilterPtr, NIL) } - /** - * - */ public var minFilter: RenderingDevice.SamplerFilter get() { TransferContext.writeArguments() @@ -71,7 +66,8 @@ public open class RDSamplerState : RefCounted() { } /** - * The repeat mode to use along the U axis of UV coordinates. This affects the returned values if sampling outside the UV bounds. + * The repeat mode to use along the U axis of UV coordinates. This affects the returned values if + * sampling outside the UV bounds. */ public var repeatU: RenderingDevice.SamplerRepeatMode get() { @@ -85,7 +81,8 @@ public open class RDSamplerState : RefCounted() { } /** - * The repeat mode to use along the V axis of UV coordinates. This affects the returned values if sampling outside the UV bounds. + * The repeat mode to use along the V axis of UV coordinates. This affects the returned values if + * sampling outside the UV bounds. */ public var repeatV: RenderingDevice.SamplerRepeatMode get() { @@ -99,7 +96,8 @@ public open class RDSamplerState : RefCounted() { } /** - * The repeat mode to use along the W axis of UV coordinates. This affects the returned values if sampling outside the UV bounds. Only effective for 3D samplers. + * The repeat mode to use along the W axis of UV coordinates. This affects the returned values if + * sampling outside the UV bounds. Only effective for 3D samplers. */ public var repeatW: RenderingDevice.SamplerRepeatMode get() { @@ -113,7 +111,10 @@ public open class RDSamplerState : RefCounted() { } /** - * The mipmap LOD bias to use. Positive values will make the sampler blurrier at a given distance, while negative values will make the sampler sharper at a given distance (at the risk of looking grainy). Recommended values are between `-0.5` and `0.0`. Only effective if the sampler has mipmaps available. + * The mipmap LOD bias to use. Positive values will make the sampler blurrier at a given distance, + * while negative values will make the sampler sharper at a given distance (at the risk of looking + * grainy). Recommended values are between `-0.5` and `0.0`. Only effective if the sampler has + * mipmaps available. */ public var lodBias: Float get() { @@ -141,8 +142,10 @@ public open class RDSamplerState : RefCounted() { } /** - * Maximum anisotropy that can be used when sampling. Only effective if [useAnisotropy] is `true`. Higher values result in a sharper sampler at oblique angles, at the cost of performance (due to memory bandwidth). This value may be limited by the graphics hardware in use. Most graphics hardware only supports values up to `16.0`. - * + * Maximum anisotropy that can be used when sampling. Only effective if [useAnisotropy] is `true`. + * Higher values result in a sharper sampler at oblique angles, at the cost of performance (due to + * memory bandwidth). This value may be limited by the graphics hardware in use. Most graphics + * hardware only supports values up to `16.0`. * If [anisotropyMax] is `1.0`, forcibly disables anisotropy even if [useAnisotropy] is `true`. */ public var anisotropyMax: Float @@ -157,7 +160,10 @@ public open class RDSamplerState : RefCounted() { } /** - * If `true`, returned values will be based on the comparison operation defined in [compareOp]. This is a hardware-based approach and is therefore faster than performing this manually in a shader. For example, compare operations are used for shadow map rendering by comparing depth values from a shadow sampler. + * If `true`, returned values will be based on the comparison operation defined in [compareOp]. + * This is a hardware-based approach and is therefore faster than performing this manually in a + * shader. For example, compare operations are used for shadow map rendering by comparing depth + * values from a shadow sampler. */ public var enableCompare: Boolean get() { @@ -185,7 +191,8 @@ public open class RDSamplerState : RefCounted() { } /** - * The minimum mipmap LOD bias to display (highest resolution). Only effective if the sampler has mipmaps available. + * The minimum mipmap LOD bias to display (highest resolution). Only effective if the sampler has + * mipmaps available. */ public var minLod: Float get() { @@ -199,7 +206,8 @@ public open class RDSamplerState : RefCounted() { } /** - * The maximum mipmap LOD bias to display (lowest resolution). Only effective if the sampler has mipmaps available. + * The maximum mipmap LOD bias to display (lowest resolution). Only effective if the sampler has + * mipmaps available. */ public var maxLod: Float get() { @@ -213,7 +221,8 @@ public open class RDSamplerState : RefCounted() { } /** - * The border color that will be returned when sampling outside the sampler's bounds and the [repeatU], [repeatV] or [repeatW] modes have repeating disabled. + * The border color that will be returned when sampling outside the sampler's bounds and the + * [repeatU], [repeatV] or [repeatW] modes have repeating disabled. */ public var borderColor: RenderingDevice.SamplerBorderColor get() { @@ -226,9 +235,6 @@ public open class RDSamplerState : RefCounted() { TransferContext.callMethod(rawPtr, MethodBindings.setBorderColorPtr, NIL) } - /** - * - */ public var unnormalizedUvw: Boolean get() { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/RDShaderFile.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/RDShaderFile.kt index be94e860f..7edbbf566 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/RDShaderFile.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/RDShaderFile.kt @@ -25,16 +25,17 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * Compiled shader file in SPIR-V form (used by [godot.RenderingDevice]). Not to be confused with Godot's own [godot.Shader]. - * * Compiled shader file in SPIR-V form. - * - * See also [godot.RDShaderSource]. [godot.RDShaderFile] is only meant to be used with the [godot.RenderingDevice] API. It should not be confused with Godot's own [godot.Shader] resource, which is what Godot's various nodes use for high-level shader programming. + * See also [RDShaderSource]. [RDShaderFile] is only meant to be used with the [RenderingDevice] + * API. It should not be confused with Godot's own [Shader] resource, which is what Godot's various + * nodes use for high-level shader programming. */ @GodotBaseType public open class RDShaderFile : Resource() { /** - * The base compilation error message, which indicates errors not related to a specific shader stage if non-empty. If empty, shader compilation is not necessarily successful (check [godot.RDShaderSPIRV]'s error message members). + * The base compilation error message, which indicates errors not related to a specific shader + * stage if non-empty. If empty, shader compilation is not necessarily successful (check + * [RDShaderSPIRV]'s error message members). */ public var baseError: String get() { @@ -53,7 +54,7 @@ public open class RDShaderFile : Resource() { } /** - * Sets the SPIR-V [bytecode] that will be compiled for the specified [version]. + * Sets the SPIR-V [param bytecode] that will be compiled for the specified [param version]. */ @JvmOverloads public fun setBytecode(bytecode: RDShaderSPIRV, version: StringName = StringName("")): Unit { @@ -62,7 +63,7 @@ public open class RDShaderFile : Resource() { } /** - * Returns the SPIR-V intermediate representation for the specified shader [version]. + * Returns the SPIR-V intermediate representation for the specified shader [param version]. */ @JvmOverloads public fun getSpirv(version: StringName = StringName("")): RDShaderSPIRV? { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/RDShaderSPIRV.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/RDShaderSPIRV.kt index 23e71b8cb..6bf54767f 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/RDShaderSPIRV.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/RDShaderSPIRV.kt @@ -21,11 +21,12 @@ import kotlin.String import kotlin.Suppress /** - * SPIR-V intermediate representation as part of a [godot.RDShaderFile] (used by [godot.RenderingDevice]). - * - * [godot.RDShaderSPIRV] represents a [godot.RDShaderFile]'s [godot.SPIR-V](https://www.khronos.org/spir/) code for various shader stages, as well as possible compilation error messages. SPIR-V is a low-level intermediate shader representation. This intermediate representation is not used directly by GPUs for rendering, but it can be compiled into binary shaders that GPUs can understand. Unlike compiled shaders, SPIR-V is portable across GPU models and driver versions. - * - * This object is used by [godot.RenderingDevice]. + * [RDShaderSPIRV] represents a [RDShaderFile]'s [url=https://www.khronos.org/spir/]SPIR-V[/url] + * code for various shader stages, as well as possible compilation error messages. SPIR-V is a + * low-level intermediate shader representation. This intermediate representation is not used directly + * by GPUs for rendering, but it can be compiled into binary shaders that GPUs can understand. Unlike + * compiled shaders, SPIR-V is portable across GPU models and driver versions. + * This object is used by [RenderingDevice]. */ @GodotBaseType public open class RDShaderSPIRV : Resource() { @@ -100,7 +101,8 @@ public open class RDShaderSPIRV : Resource() { } /** - * The compilation error message for the vertex shader stage (set by the SPIR-V compiler and Godot). If empty, shader compilation was successful. + * The compilation error message for the vertex shader stage (set by the SPIR-V compiler and + * Godot). If empty, shader compilation was successful. */ public var compileErrorVertex: String get() { @@ -114,7 +116,8 @@ public open class RDShaderSPIRV : Resource() { } /** - * The compilation error message for the fragment shader stage (set by the SPIR-V compiler and Godot). If empty, shader compilation was successful. + * The compilation error message for the fragment shader stage (set by the SPIR-V compiler and + * Godot). If empty, shader compilation was successful. */ public var compileErrorFragment: String get() { @@ -128,7 +131,8 @@ public open class RDShaderSPIRV : Resource() { } /** - * The compilation error message for the tessellation control shader stage (set by the SPIR-V compiler and Godot). If empty, shader compilation was successful. + * The compilation error message for the tessellation control shader stage (set by the SPIR-V + * compiler and Godot). If empty, shader compilation was successful. */ public var compileErrorTesselationControl: String get() { @@ -142,7 +146,8 @@ public open class RDShaderSPIRV : Resource() { } /** - * The compilation error message for the tessellation evaluation shader stage (set by the SPIR-V compiler and Godot). If empty, shader compilation was successful. + * The compilation error message for the tessellation evaluation shader stage (set by the SPIR-V + * compiler and Godot). If empty, shader compilation was successful. */ public var compileErrorTesselationEvaluation: String get() { @@ -156,7 +161,8 @@ public open class RDShaderSPIRV : Resource() { } /** - * The compilation error message for the compute shader stage (set by the SPIR-V compiler and Godot). If empty, shader compilation was successful. + * The compilation error message for the compute shader stage (set by the SPIR-V compiler and + * Godot). If empty, shader compilation was successful. */ public var compileErrorCompute: String get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/RDShaderSource.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/RDShaderSource.kt index 5429fdf2a..e7b98b2d0 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/RDShaderSource.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/RDShaderSource.kt @@ -20,11 +20,10 @@ import kotlin.String import kotlin.Suppress /** - * Shader source code (used by [godot.RenderingDevice]). - * * Shader source code in text form. - * - * See also [godot.RDShaderFile]. [godot.RDShaderSource] is only meant to be used with the [godot.RenderingDevice] API. It should not be confused with Godot's own [godot.Shader] resource, which is what Godot's various nodes use for high-level shader programming. + * See also [RDShaderFile]. [RDShaderSource] is only meant to be used with the [RenderingDevice] + * API. It should not be confused with Godot's own [Shader] resource, which is what Godot's various + * nodes use for high-level shader programming. */ @GodotBaseType public open class RDShaderSource : RefCounted() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/RDTextureFormat.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/RDTextureFormat.kt index 47ec65667..b669c0753 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/RDTextureFormat.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/RDTextureFormat.kt @@ -20,9 +20,7 @@ import kotlin.Suppress import kotlin.Unit /** - * Texture format (used by [godot.RenderingDevice]). - * - * This object is used by [godot.RenderingDevice]. + * This object is used by [RenderingDevice]. */ @GodotBaseType public open class RDTextureFormat : RefCounted() { @@ -157,17 +155,11 @@ public open class RDTextureFormat : RefCounted() { return true } - /** - * - */ public fun addShareableFormat(format: RenderingDevice.DataFormat): Unit { TransferContext.writeArguments(LONG to format.id) TransferContext.callMethod(rawPtr, MethodBindings.addShareableFormatPtr, NIL) } - /** - * - */ public fun removeShareableFormat(format: RenderingDevice.DataFormat): Unit { TransferContext.writeArguments(LONG to format.id) TransferContext.callMethod(rawPtr, MethodBindings.removeShareableFormatPtr, NIL) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/RDTextureView.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/RDTextureView.kt index 202280d1f..a1cf876c4 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/RDTextureView.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/RDTextureView.kt @@ -18,14 +18,13 @@ import kotlin.Long import kotlin.Suppress /** - * Texture view (used by [godot.RenderingDevice]). - * - * This object is used by [godot.RenderingDevice]. + * This object is used by [RenderingDevice]. */ @GodotBaseType public open class RDTextureView : RefCounted() { /** - * Optional override for the data format to return sampled values in. The default value of [godot.RenderingDevice.DATA_FORMAT_MAX] does not override the format. + * Optional override for the data format to return sampled values in. The default value of + * [constant RenderingDevice.DATA_FORMAT_MAX] does not override the format. */ public var formatOverride: RenderingDevice.DataFormat get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/RDUniform.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/RDUniform.kt index 31a20a46c..716aae00f 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/RDUniform.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/RDUniform.kt @@ -23,9 +23,7 @@ import kotlin.Suppress import kotlin.Unit /** - * Shader uniform (used by [godot.RenderingDevice]). - * - * This object is used by [godot.RenderingDevice]. + * This object is used by [RenderingDevice]. */ @GodotBaseType public open class RDUniform : RefCounted() { @@ -62,25 +60,16 @@ public open class RDUniform : RefCounted() { return true } - /** - * - */ public fun addId(id: RID): Unit { TransferContext.writeArguments(_RID to id) TransferContext.callMethod(rawPtr, MethodBindings.addIdPtr, NIL) } - /** - * - */ public fun clearIds(): Unit { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.clearIdsPtr, NIL) } - /** - * - */ public fun getIds(): VariantArray { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getIdsPtr, ARRAY) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/RDVertexAttribute.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/RDVertexAttribute.kt index 7d5bc4519..22cdc7837 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/RDVertexAttribute.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/RDVertexAttribute.kt @@ -18,15 +18,10 @@ import kotlin.Long import kotlin.Suppress /** - * Vertex attribute (used by [godot.RenderingDevice]). - * - * This object is used by [godot.RenderingDevice]. + * This object is used by [RenderingDevice]. */ @GodotBaseType public open class RDVertexAttribute : RefCounted() { - /** - * - */ public var location: Long get() { TransferContext.writeArguments() @@ -38,9 +33,6 @@ public open class RDVertexAttribute : RefCounted() { TransferContext.callMethod(rawPtr, MethodBindings.setLocationPtr, NIL) } - /** - * - */ public var offset: Long get() { TransferContext.writeArguments() @@ -52,9 +44,6 @@ public open class RDVertexAttribute : RefCounted() { TransferContext.callMethod(rawPtr, MethodBindings.setOffsetPtr, NIL) } - /** - * - */ public var format: RenderingDevice.DataFormat get() { TransferContext.writeArguments() @@ -66,9 +55,6 @@ public open class RDVertexAttribute : RefCounted() { TransferContext.callMethod(rawPtr, MethodBindings.setFormatPtr, NIL) } - /** - * - */ public var stride: Long get() { TransferContext.writeArguments() @@ -80,9 +66,6 @@ public open class RDVertexAttribute : RefCounted() { TransferContext.callMethod(rawPtr, MethodBindings.setStridePtr, NIL) } - /** - * - */ public var frequency: RenderingDevice.VertexFrequency get() { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Range.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Range.kt index 5c11d8f0b..178fa4fbd 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Range.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Range.kt @@ -24,16 +24,19 @@ import kotlin.Suppress import kotlin.Unit /** - * Abstract base class for controls that represent a number within a range. - * - * Range is an abstract base class for controls that represent a number within a range, using a configured [step] and [page] size. See e.g. [godot.ScrollBar] and [godot.Slider] for examples of higher-level nodes using Range. + * Range is an abstract base class for controls that represent a number within a range, using a + * configured [step] and [page] size. See e.g. [ScrollBar] and [Slider] for examples of higher-level + * nodes using Range. */ @GodotBaseType public open class Range : Control() { /** - * Emitted when [value] changes. When used on a [godot.Slider], this is called continuously while dragging (potentially every frame). If you are performing an expensive operation in a function connected to [valueChanged], consider using a *debouncing* [godot.Timer] to call the function less often. - * - * **Note:** Unlike signals such as [godot.LineEdit.textChanged], [valueChanged] is also emitted when [value] is set directly via code. + * Emitted when [value] changes. When used on a [Slider], this is called continuously while + * dragging (potentially every frame). If you are performing an expensive operation in a function + * connected to [signal value_changed], consider using a *debouncing* [Timer] to call the function + * less often. + * **Note:** Unlike signals such as [signal LineEdit.text_changed], [signal value_changed] is also + * emitted when [param value] is set directly via code. */ public val valueChanged: Signal1 by signal("value") @@ -71,7 +74,9 @@ public open class Range : Control() { } /** - * If greater than 0, [value] will always be rounded to a multiple of this property's value. If [rounded] is also `true`, [value] will first be rounded to a multiple of this property's value, then rounded to the nearest integer. + * If greater than 0, [value] will always be rounded to a multiple of this property's value. If + * [rounded] is also `true`, [value] will first be rounded to a multiple of this property's value, + * then rounded to the nearest integer. */ public var step: Double get() { @@ -85,7 +90,8 @@ public open class Range : Control() { } /** - * Page size. Used mainly for [godot.ScrollBar]. ScrollBar's length is its size multiplied by [page] over the difference between [minValue] and [maxValue]. + * Page size. Used mainly for [ScrollBar]. ScrollBar's length is its size multiplied by [page] + * over the difference between [minValue] and [maxValue]. */ public var page: Double get() { @@ -99,7 +105,8 @@ public open class Range : Control() { } /** - * Range's current value. Changing this property (even via code) will trigger [valueChanged] signal. Use [setValueNoSignal] if you want to avoid it. + * Range's current value. Changing this property (even via code) will trigger [signal + * value_changed] signal. Use [setValueNoSignal] if you want to avoid it. */ public var `value`: Double get() { @@ -127,7 +134,8 @@ public open class Range : Control() { } /** - * If `true`, and [minValue] is greater than 0, [value] will be represented exponentially rather than linearly. + * If `true`, and [minValue] is greater than 0, [value] will be represented exponentially rather + * than linearly. */ public var expEdit: Boolean get() { @@ -188,13 +196,15 @@ public open class Range : Control() { } /** - * Called when the [godot.Range]'s value is changed (following the same conditions as [valueChanged]). + * Called when the [Range]'s value is changed (following the same conditions as [signal + * value_changed]). */ public open fun _valueChanged(newValue: Double): Unit { } /** - * Sets the [godot.Range]'s current value to the specified [value], without emitting the [valueChanged] signal. + * Sets the [Range]'s current value to the specified [param value], without emitting the [signal + * value_changed] signal. */ public fun setValueNoSignal(`value`: Double): Unit { TransferContext.writeArguments(DOUBLE to value) @@ -202,7 +212,9 @@ public open class Range : Control() { } /** - * Binds two [godot.Range]s together along with any ranges previously grouped with either of them. When any of range's member variables change, it will share the new value with all other ranges in its group. + * Binds two [Range]s together along with any ranges previously grouped with either of them. When + * any of range's member variables change, it will share the new value with all other ranges in its + * group. */ public fun share(with: Node): Unit { TransferContext.writeArguments(OBJECT to with) @@ -210,7 +222,7 @@ public open class Range : Control() { } /** - * Stops the [godot.Range] from sharing its member variables with any other. + * Stops the [Range] from sharing its member variables with any other. */ public fun unshare(): Unit { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/RectangleShape2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/RectangleShape2D.kt index 8381e6976..c3c0d79c8 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/RectangleShape2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/RectangleShape2D.kt @@ -21,14 +21,10 @@ import kotlin.Suppress import kotlin.Unit /** - * A 2D rectangle shape used for physics collision. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/113](https://godotengine.org/asset-library/asset/113) - * - * A 2D rectangle shape, intended for use in physics. Usually used to provide a shape for a [godot.CollisionShape2D]. - * - * **Performance:** [godot.RectangleShape2D] is fast to check collisions against. It is faster than [godot.CapsuleShape2D], but slower than [godot.CircleShape2D]. + * A 2D rectangle shape, intended for use in physics. Usually used to provide a shape for a + * [CollisionShape2D]. + * **Performance:** [RectangleShape2D] is fast to check collisions against. It is faster than + * [CapsuleShape2D], but slower than [CircleShape2D]. */ @GodotBaseType public open class RectangleShape2D : Shape2D() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ReferenceRect.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ReferenceRect.kt index 4a300ef2e..f3e0d4d6c 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ReferenceRect.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ReferenceRect.kt @@ -25,14 +25,13 @@ import kotlin.Suppress import kotlin.Unit /** - * A rectangle hint for designing UIs. - * - * A rectangle box that displays only a colored border around its rectangle. It is used to visualize the extents of a [godot.Control]. + * A rectangle box that displays only a colored border around its rectangle. It is used to visualize + * the extents of a [Control]. */ @GodotBaseType public open class ReferenceRect : Control() { /** - * Sets the border color of the [godot.ReferenceRect]. + * Sets the border color of the [ReferenceRect]. */ @CoreTypeLocalCopy public var borderColor: Color @@ -47,7 +46,8 @@ public open class ReferenceRect : Control() { } /** - * Sets the border width of the [godot.ReferenceRect]. The border grows both inwards and outwards with respect to the rectangle box. + * Sets the border width of the [ReferenceRect]. The border grows both inwards and outwards with + * respect to the rectangle box. */ public var borderWidth: Float get() { @@ -61,7 +61,8 @@ public open class ReferenceRect : Control() { } /** - * If `true`, the [godot.ReferenceRect] will only be visible while in editor. Otherwise, [godot.ReferenceRect] will be visible in the running project. + * If `true`, the [ReferenceRect] will only be visible while in editor. Otherwise, [ReferenceRect] + * will be visible in the running project. */ public var editorOnly: Boolean get() { @@ -80,7 +81,7 @@ public open class ReferenceRect : Control() { } /** - * Sets the border color of the [godot.ReferenceRect]. + * Sets the border color of the [ReferenceRect]. * * This is a helper function to make dealing with local copies easier. * diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ReflectionProbe.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ReflectionProbe.kt index af873db75..9fd073f96 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ReflectionProbe.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ReflectionProbe.kt @@ -29,25 +29,33 @@ import kotlin.Suppress import kotlin.Unit /** - * Captures its surroundings to create fast, accurate reflections from a given point. - * - * Tutorials: - * [$DOCS_URL/tutorials/3d/global_illumination/reflection_probes.html]($DOCS_URL/tutorials/3d/global_illumination/reflection_probes.html) - * - * Captures its surroundings as a cubemap, and stores versions of it with increasing levels of blur to simulate different material roughnesses. - * - * The [godot.ReflectionProbe] is used to create high-quality reflections at a low performance cost (when [updateMode] is [UPDATE_ONCE]). [godot.ReflectionProbe]s can be blended together and with the rest of the scene smoothly. [godot.ReflectionProbe]s can also be combined with [godot.VoxelGI], SDFGI ([godot.Environment.sdfgiEnabled]) and screen-space reflections ([godot.Environment.ssrEnabled]) to get more accurate reflections in specific areas. [godot.ReflectionProbe]s render all objects within their [cullMask], so updating them can be quite expensive. It is best to update them once with the important static objects and then leave them as-is. - * - * **Note:** Unlike [godot.VoxelGI] and SDFGI, [godot.ReflectionProbe]s only source their environment from a [godot.WorldEnvironment] node. If you specify an [godot.Environment] resource within a [godot.Camera3D] node, it will be ignored by the [godot.ReflectionProbe]. This can lead to incorrect lighting within the [godot.ReflectionProbe]. - * - * **Note:** Reflection probes are only supported in the Forward+ and Mobile rendering methods, not Compatibility. When using the Mobile rendering method, only 8 reflection probes can be displayed on each mesh resource. Attempting to display more than 8 reflection probes on a single mesh resource will result in reflection probes flickering in and out as the camera moves. - * - * **Note:** When using the Mobile rendering method, reflection probes will only correctly affect meshes whose visibility AABB intersects with the reflection probe's AABB. If using a shader to deform the mesh in a way that makes it go outside its AABB, [godot.GeometryInstance3D.extraCullMargin] must be increased on the mesh. Otherwise, the reflection probe may not be visible on the mesh. + * Captures its surroundings as a cubemap, and stores versions of it with increasing levels of blur + * to simulate different material roughnesses. + * The [ReflectionProbe] is used to create high-quality reflections at a low performance cost (when + * [updateMode] is [constant UPDATE_ONCE]). [ReflectionProbe]s can be blended together and with the + * rest of the scene smoothly. [ReflectionProbe]s can also be combined with [VoxelGI], SDFGI + * ([Environment.sdfgiEnabled]) and screen-space reflections ([Environment.ssrEnabled]) to get more + * accurate reflections in specific areas. [ReflectionProbe]s render all objects within their + * [cullMask], so updating them can be quite expensive. It is best to update them once with the + * important static objects and then leave them as-is. + * **Note:** Unlike [VoxelGI] and SDFGI, [ReflectionProbe]s only source their environment from a + * [WorldEnvironment] node. If you specify an [Environment] resource within a [Camera3D] node, it will + * be ignored by the [ReflectionProbe]. This can lead to incorrect lighting within the + * [ReflectionProbe]. + * **Note:** Reflection probes are only supported in the Forward+ and Mobile rendering methods, not + * Compatibility. When using the Mobile rendering method, only 8 reflection probes can be displayed on + * each mesh resource. Attempting to display more than 8 reflection probes on a single mesh resource + * will result in reflection probes flickering in and out as the camera moves. + * **Note:** When using the Mobile rendering method, reflection probes will only correctly affect + * meshes whose visibility AABB intersects with the reflection probe's AABB. If using a shader to + * deform the mesh in a way that makes it go outside its AABB, [GeometryInstance3D.extraCullMargin] + * must be increased on the mesh. Otherwise, the reflection probe may not be visible on the mesh. */ @GodotBaseType public open class ReflectionProbe : VisualInstance3D() { /** - * Sets how frequently the [godot.ReflectionProbe] is updated. Can be [UPDATE_ONCE] or [UPDATE_ALWAYS]. + * Sets how frequently the [ReflectionProbe] is updated. Can be [constant UPDATE_ONCE] or + * [constant UPDATE_ALWAYS]. */ public var updateMode: UpdateMode get() { @@ -75,9 +83,12 @@ public open class ReflectionProbe : VisualInstance3D() { } /** - * The maximum distance away from the [godot.ReflectionProbe] an object can be before it is culled. Decrease this to improve performance, especially when using the [UPDATE_ALWAYS] [updateMode]. - * - * **Note:** The maximum reflection distance is always at least equal to the probe's extents. This means that decreasing [maxDistance] will not always cull objects from reflections, especially if the reflection probe's box defined by its [size] is already large. + * The maximum distance away from the [ReflectionProbe] an object can be before it is culled. + * Decrease this to improve performance, especially when using the [constant UPDATE_ALWAYS] + * [updateMode]. + * **Note:** The maximum reflection distance is always at least equal to the probe's extents. This + * means that decreasing [maxDistance] will not always cull objects from reflections, especially if + * the reflection probe's box defined by its [size] is already large. */ public var maxDistance: Float get() { @@ -91,9 +102,11 @@ public open class ReflectionProbe : VisualInstance3D() { } /** - * The size of the reflection probe. The larger the size, the more space covered by the probe, which will lower the perceived resolution. It is best to keep the size only as large as you need it. - * - * **Note:** To better fit areas that are not aligned to the grid, you can rotate the [godot.ReflectionProbe] node. + * The size of the reflection probe. The larger the size, the more space covered by the probe, + * which will lower the perceived resolution. It is best to keep the size only as large as you need + * it. + * **Note:** To better fit areas that are not aligned to the grid, you can rotate the + * [ReflectionProbe] node. */ @CoreTypeLocalCopy public var size: Vector3 @@ -108,7 +121,9 @@ public open class ReflectionProbe : VisualInstance3D() { } /** - * Sets the origin offset to be used when this [godot.ReflectionProbe] is in [boxProjection] mode. This can be set to a non-zero value to ensure a reflection fits a rectangle-shaped room, while reducing the number of objects that "get in the way" of the reflection. + * Sets the origin offset to be used when this [ReflectionProbe] is in [boxProjection] mode. This + * can be set to a non-zero value to ensure a reflection fits a rectangle-shaped room, while reducing + * the number of objects that "get in the way" of the reflection. */ @CoreTypeLocalCopy public var originOffset: Vector3 @@ -123,9 +138,10 @@ public open class ReflectionProbe : VisualInstance3D() { } /** - * If `true`, enables box projection. This makes reflections look more correct in rectangle-shaped rooms by offsetting the reflection center depending on the camera's location. - * - * **Note:** To better fit rectangle-shaped rooms that are not aligned to the grid, you can rotate the [godot.ReflectionProbe] node. + * If `true`, enables box projection. This makes reflections look more correct in rectangle-shaped + * rooms by offsetting the reflection center depending on the camera's location. + * **Note:** To better fit rectangle-shaped rooms that are not aligned to the grid, you can rotate + * the [ReflectionProbe] node. */ public var boxProjection: Boolean get() { @@ -153,7 +169,8 @@ public open class ReflectionProbe : VisualInstance3D() { } /** - * If `true`, computes shadows in the reflection probe. This makes the reflection probe slower to render; you may want to disable this if using the [UPDATE_ALWAYS] [updateMode]. + * If `true`, computes shadows in the reflection probe. This makes the reflection probe slower to + * render; you may want to disable this if using the [constant UPDATE_ALWAYS] [updateMode]. */ public var enableShadows: Boolean get() { @@ -167,7 +184,10 @@ public open class ReflectionProbe : VisualInstance3D() { } /** - * Sets the cull mask which determines what objects are drawn by this probe. Every [godot.VisualInstance3D] with a layer included in this cull mask will be rendered by the probe. To improve performance, it is best to only include large objects which are likely to take up a lot of space in the reflection. + * Sets the cull mask which determines what objects are drawn by this probe. Every + * [VisualInstance3D] with a layer included in this cull mask will be rendered by the probe. To + * improve performance, it is best to only include large objects which are likely to take up a lot of + * space in the reflection. */ public var cullMask: Long get() { @@ -181,9 +201,13 @@ public open class ReflectionProbe : VisualInstance3D() { } /** - * The automatic LOD bias to use for meshes rendered within the [godot.ReflectionProbe] (this is analog to [godot.Viewport.meshLodThreshold]). Higher values will use less detailed versions of meshes that have LOD variations generated. If set to `0.0`, automatic LOD is disabled. Increase [meshLodThreshold] to improve performance at the cost of geometry detail, especially when using the [UPDATE_ALWAYS] [updateMode]. - * - * **Note:** [meshLodThreshold] does not affect [godot.GeometryInstance3D] visibility ranges (also known as "manual" LOD or hierarchical LOD). + * The automatic LOD bias to use for meshes rendered within the [ReflectionProbe] (this is analog + * to [Viewport.meshLodThreshold]). Higher values will use less detailed versions of meshes that have + * LOD variations generated. If set to `0.0`, automatic LOD is disabled. Increase [meshLodThreshold] + * to improve performance at the cost of geometry detail, especially when using the [constant + * UPDATE_ALWAYS] [updateMode]. + * **Note:** [meshLodThreshold] does not affect [GeometryInstance3D] visibility ranges (also known + * as "manual" LOD or hierarchical LOD). */ public var meshLodThreshold: Float get() { @@ -197,7 +221,9 @@ public open class ReflectionProbe : VisualInstance3D() { } /** - * The ambient color to use within the [godot.ReflectionProbe]'s box defined by its [size]. The ambient color will smoothly blend with other [godot.ReflectionProbe]s and the rest of the scene (outside the [godot.ReflectionProbe]'s box defined by its [size]). + * The ambient color to use within the [ReflectionProbe]'s box defined by its [size]. The ambient + * color will smoothly blend with other [ReflectionProbe]s and the rest of the scene (outside the + * [ReflectionProbe]'s box defined by its [size]). */ public var ambientMode: AmbientMode get() { @@ -211,7 +237,8 @@ public open class ReflectionProbe : VisualInstance3D() { } /** - * The custom ambient color to use within the [godot.ReflectionProbe]'s box defined by its [size]. Only effective if [ambientMode] is [AMBIENT_COLOR]. + * The custom ambient color to use within the [ReflectionProbe]'s box defined by its [size]. Only + * effective if [ambientMode] is [constant AMBIENT_COLOR]. */ @CoreTypeLocalCopy public var ambientColor: Color @@ -226,7 +253,8 @@ public open class ReflectionProbe : VisualInstance3D() { } /** - * The custom ambient color energy to use within the [godot.ReflectionProbe]'s box defined by its [size]. Only effective if [ambientMode] is [AMBIENT_COLOR]. + * The custom ambient color energy to use within the [ReflectionProbe]'s box defined by its + * [size]. Only effective if [ambientMode] is [constant AMBIENT_COLOR]. */ public var ambientColorEnergy: Float get() { @@ -245,9 +273,11 @@ public open class ReflectionProbe : VisualInstance3D() { } /** - * The size of the reflection probe. The larger the size, the more space covered by the probe, which will lower the perceived resolution. It is best to keep the size only as large as you need it. - * - * **Note:** To better fit areas that are not aligned to the grid, you can rotate the [godot.ReflectionProbe] node. + * The size of the reflection probe. The larger the size, the more space covered by the probe, + * which will lower the perceived resolution. It is best to keep the size only as large as you need + * it. + * **Note:** To better fit areas that are not aligned to the grid, you can rotate the + * [ReflectionProbe] node. * * This is a helper function to make dealing with local copies easier. * @@ -271,7 +301,9 @@ public open class ReflectionProbe : VisualInstance3D() { /** - * Sets the origin offset to be used when this [godot.ReflectionProbe] is in [boxProjection] mode. This can be set to a non-zero value to ensure a reflection fits a rectangle-shaped room, while reducing the number of objects that "get in the way" of the reflection. + * Sets the origin offset to be used when this [ReflectionProbe] is in [boxProjection] mode. This + * can be set to a non-zero value to ensure a reflection fits a rectangle-shaped room, while reducing + * the number of objects that "get in the way" of the reflection. * * This is a helper function to make dealing with local copies easier. * @@ -295,7 +327,8 @@ public open class ReflectionProbe : VisualInstance3D() { /** - * The custom ambient color to use within the [godot.ReflectionProbe]'s box defined by its [size]. Only effective if [ambientMode] is [AMBIENT_COLOR]. + * The custom ambient color to use within the [ReflectionProbe]'s box defined by its [size]. Only + * effective if [ambientMode] is [constant AMBIENT_COLOR]. * * This is a helper function to make dealing with local copies easier. * @@ -322,11 +355,19 @@ public open class ReflectionProbe : VisualInstance3D() { id: Long, ) { /** - * Update the probe once on the next frame (recommended for most objects). The corresponding radiance map will be generated over the following six frames. This takes more time to update than [UPDATE_ALWAYS], but it has a lower performance cost and can result in higher-quality reflections. The ReflectionProbe is updated when its transform changes, but not when nearby geometry changes. You can force a [godot.ReflectionProbe] update by moving the [godot.ReflectionProbe] slightly in any direction. + * Update the probe once on the next frame (recommended for most objects). The corresponding + * radiance map will be generated over the following six frames. This takes more time to update + * than [constant UPDATE_ALWAYS], but it has a lower performance cost and can result in + * higher-quality reflections. The ReflectionProbe is updated when its transform changes, but not + * when nearby geometry changes. You can force a [ReflectionProbe] update by moving the + * [ReflectionProbe] slightly in any direction. */ UPDATE_ONCE(0), /** - * Update the probe every frame. This provides better results for fast-moving dynamic objects (such as cars). However, it has a significant performance cost. Due to the cost, it's recommended to only use one ReflectionProbe with [UPDATE_ALWAYS] at most per scene. For all other use cases, use [UPDATE_ONCE]. + * Update the probe every frame. This provides better results for fast-moving dynamic objects + * (such as cars). However, it has a significant performance cost. Due to the cost, it's + * recommended to only use one ReflectionProbe with [constant UPDATE_ALWAYS] at most per scene. For + * all other use cases, use [constant UPDATE_ONCE]. */ UPDATE_ALWAYS(1), ; @@ -345,15 +386,17 @@ public open class ReflectionProbe : VisualInstance3D() { id: Long, ) { /** - * Do not apply any ambient lighting inside the [godot.ReflectionProbe]'s box defined by its [size]. + * Do not apply any ambient lighting inside the [ReflectionProbe]'s box defined by its [size]. */ AMBIENT_DISABLED(0), /** - * Apply automatically-sourced environment lighting inside the [godot.ReflectionProbe]'s box defined by its [size]. + * Apply automatically-sourced environment lighting inside the [ReflectionProbe]'s box defined + * by its [size]. */ AMBIENT_ENVIRONMENT(1), /** - * Apply custom ambient lighting inside the [godot.ReflectionProbe]'s box defined by its [size]. See [ambientColor] and [ambientColorEnergy]. + * Apply custom ambient lighting inside the [ReflectionProbe]'s box defined by its [size]. See + * [ambientColor] and [ambientColorEnergy]. */ AMBIENT_COLOR(2), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/RegEx.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/RegEx.kt index b9fe913f5..daa1b10d1 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/RegEx.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/RegEx.kt @@ -28,6 +28,65 @@ import kotlin.Suppress import kotlin.Unit import kotlin.jvm.JvmOverloads +/** + * A regular expression (or regex) is a compact language that can be used to recognize strings that + * follow a specific pattern, such as URLs, email addresses, complete sentences, etc. For example, a + * regex of `ab[0-9]` would find any string that is `ab` followed by any number from `0` to `9`. For a + * more in-depth look, you can easily find various tutorials and detailed explanations on the Internet. + * To begin, the RegEx object needs to be compiled with the search pattern using [compile] before it + * can be used. + * [codeblock] + * var regex = RegEx.new() + * regex.compile("\\w-(\\d+)") + * [/codeblock] + * The search pattern must be escaped first for GDScript before it is escaped for the expression. + * For example, `compile("\\d+")` would be read by RegEx as `\d+`. Similarly, + * `compile("\"(?:\\\\.|[^\"])*\"")` would be read as `"(?:\\.|[^"])*"`. In GDScript, you can also use + * raw string literals (r-strings). For example, `compile(r'"(?:\\.|[^"])*"')` would be read the same. + * Using [search], you can find the pattern within the given text. If a pattern is found, + * [RegExMatch] is returned and you can retrieve details of the results using methods such as + * [RegExMatch.getString] and [RegExMatch.getStart]. + * [codeblock] + * var regex = RegEx.new() + * regex.compile("\\w-(\\d+)") + * var result = regex.search("abc n-0123") + * if result: + * print(result.get_string()) # Would print n-0123 + * [/codeblock] + * The results of capturing groups `()` can be retrieved by passing the group number to the various + * methods in [RegExMatch]. Group 0 is the default and will always refer to the entire pattern. In the + * above example, calling `result.get_string(1)` would give you `0123`. + * This version of RegEx also supports named capturing groups, and the names can be used to retrieve + * the results. If two or more groups have the same name, the name would only refer to the first one + * with a match. + * [codeblock] + * var regex = RegEx.new() + * regex.compile("d(?[0-9]+)|x(?[0-9a-f]+)") + * var result = regex.search("the number is x2f") + * if result: + * print(result.get_string("digit")) # Would print 2f + * [/codeblock] + * If you need to process multiple results, [searchAll] generates a list of all non-overlapping + * results. This can be combined with a `for` loop for convenience. + * [codeblock] + * for result in regex.search_all("d01, d03, d0c, x3f and x42"): + * print(result.get_string("digit")) + * # Would print 01 03 0 3f 42 + * [/codeblock] + * **Example of splitting a string using a RegEx:** + * [codeblock] + * var regex = RegEx.new() + * regex.compile("\\S+") # Negated whitespace character class. + * var results = [] + * for result in regex.search_all("One Two \n\tThree"): + * results.push_back(result.get_string()) + * # The `results` array now contains "One", "Two", "Three". + * [/codeblock] + * **Note:** Godot's regex implementation is based on the [url=https://www.pcre.org/]PCRE2[/url] + * library. You can view the full pattern reference + * [url=https://www.pcre.org/current/doc/html/pcre2pattern.html]here[/url]. + * **Tip:** You can use [url=https://regexr.com/]Regexr[/url] to test regular expressions online. + */ @GodotBaseType public open class RegEx : RefCounted() { public override fun new(scriptIndex: Int): Boolean { @@ -35,17 +94,35 @@ public open class RegEx : RefCounted() { return true } + /** + * This method resets the state of the object, as if it was freshly created. Namely, it unassigns + * the regular expression of this object. + */ public fun clear(): Unit { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.clearPtr, NIL) } + /** + * Compiles and assign the search pattern to use. Returns [constant OK] if the compilation is + * successful. If an error is encountered, details are printed to standard output and an error is + * returned. + */ public fun compile(pattern: String): GodotError { TransferContext.writeArguments(STRING to pattern) TransferContext.callMethod(rawPtr, MethodBindings.compilePtr, LONG) return GodotError.from(TransferContext.readReturnValue(LONG) as Long) } + /** + * Searches the text for the compiled pattern. Returns a [RegExMatch] container of the first + * matching result if found, otherwise `null`. + * The region to search within can be specified with [param offset] and [param end]. This is + * useful when searching for another match in the same [param subject] by calling this method again + * after a previous success. Note that setting these parameters differs from passing over a shortened + * string. For example, the start anchor `^` is not affected by [param offset], and the character + * before [param offset] will be checked for the word boundary `\b`. + */ @JvmOverloads public fun search( subject: String, @@ -57,6 +134,15 @@ public open class RegEx : RefCounted() { return (TransferContext.readReturnValue(OBJECT, true) as RegExMatch?) } + /** + * Searches the text for the compiled pattern. Returns an array of [RegExMatch] containers for + * each non-overlapping result. If no results were found, an empty array is returned instead. + * The region to search within can be specified with [param offset] and [param end]. This is + * useful when searching for another match in the same [param subject] by calling this method again + * after a previous success. Note that setting these parameters differs from passing over a shortened + * string. For example, the start anchor `^` is not affected by [param offset], and the character + * before [param offset] will be checked for the word boundary `\b`. + */ @JvmOverloads public fun searchAll( subject: String, @@ -68,6 +154,16 @@ public open class RegEx : RefCounted() { return (TransferContext.readReturnValue(ARRAY, false) as VariantArray) } + /** + * Searches the text for the compiled pattern and replaces it with the specified string. Escapes + * and backreferences such as `$1` and `$name` are expanded and resolved. By default, only the first + * instance is replaced, but it can be changed for all instances (global replacement). + * The region to search within can be specified with [param offset] and [param end]. This is + * useful when searching for another match in the same [param subject] by calling this method again + * after a previous success. Note that setting these parameters differs from passing over a shortened + * string. For example, the start anchor `^` is not affected by [param offset], and the character + * before [param offset] will be checked for the word boundary `\b`. + */ @JvmOverloads public fun sub( subject: String, @@ -81,24 +177,37 @@ public open class RegEx : RefCounted() { return (TransferContext.readReturnValue(STRING, false) as String) } + /** + * Returns whether this object has a valid search pattern assigned. + */ public fun isValid(): Boolean { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.isValidPtr, BOOL) return (TransferContext.readReturnValue(BOOL, false) as Boolean) } + /** + * Returns the original search pattern that was compiled. + */ public fun getPattern(): String { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getPatternPtr, STRING) return (TransferContext.readReturnValue(STRING, false) as String) } + /** + * Returns the number of capturing groups in compiled pattern. + */ public fun getGroupCount(): Int { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getGroupCountPtr, LONG) return (TransferContext.readReturnValue(LONG, false) as Long).toInt() } + /** + * Returns an array of names of named capturing groups in the compiled pattern. They are ordered + * by appearance. + */ public fun getNames(): PackedStringArray { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getNamesPtr, PACKED_STRING_ARRAY) @@ -106,6 +215,9 @@ public open class RegEx : RefCounted() { } public companion object { + /** + * Creates and compiles a new [RegEx] object. + */ public fun createFromString(pattern: String): RegEx? { TransferContext.writeArguments(STRING to pattern) TransferContext.callMethod(0, MethodBindings.createFromStringPtr, OBJECT) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/RegExMatch.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/RegExMatch.kt index 18cd0ca6f..768aef322 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/RegExMatch.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/RegExMatch.kt @@ -25,8 +25,16 @@ import kotlin.String import kotlin.Suppress import kotlin.jvm.JvmOverloads +/** + * Contains the results of a single [RegEx] match returned by [RegEx.search] and [RegEx.searchAll]. + * It can be used to find the position and range of the match and its capturing groups, and it can + * extract its substring for you. + */ @GodotBaseType public open class RegExMatch : RefCounted() { + /** + * The source string used with the search pattern to find this matching result. + */ public val subject: String get() { TransferContext.writeArguments() @@ -34,6 +42,11 @@ public open class RegExMatch : RefCounted() { return (TransferContext.readReturnValue(STRING, false) as String) } + /** + * A dictionary of named groups and its corresponding group number. Only groups that were matched + * are included. If multiple groups have the same name, that name would refer to the first matching + * one. + */ public val names: Dictionary get() { TransferContext.writeArguments() @@ -41,6 +54,9 @@ public open class RegExMatch : RefCounted() { return (TransferContext.readReturnValue(DICTIONARY, false) as Dictionary) } + /** + * An [Array] of the match and its capturing groups. + */ public val strings: PackedStringArray get() { TransferContext.writeArguments() @@ -53,12 +69,21 @@ public open class RegExMatch : RefCounted() { return true } + /** + * Returns the number of capturing groups. + */ public fun getGroupCount(): Int { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getGroupCountPtr, LONG) return (TransferContext.readReturnValue(LONG, false) as Long).toInt() } + /** + * Returns the substring of the match from the source string. Capturing groups can be retrieved by + * providing its group number as an integer or its string name (if it's a named group). The default + * value of 0 refers to the whole pattern. + * Returns an empty string if the group did not match or doesn't exist. + */ @JvmOverloads public fun getString(name: Any? = 0): String { TransferContext.writeArguments(ANY to name) @@ -66,6 +91,12 @@ public open class RegExMatch : RefCounted() { return (TransferContext.readReturnValue(STRING, false) as String) } + /** + * Returns the starting position of the match within the source string. The starting position of + * capturing groups can be retrieved by providing its group number as an integer or its string name + * (if it's a named group). The default value of 0 refers to the whole pattern. + * Returns -1 if the group did not match or doesn't exist. + */ @JvmOverloads public fun getStart(name: Any? = 0): Int { TransferContext.writeArguments(ANY to name) @@ -73,6 +104,12 @@ public open class RegExMatch : RefCounted() { return (TransferContext.readReturnValue(LONG, false) as Long).toInt() } + /** + * Returns the end position of the match within the source string. The end position of capturing + * groups can be retrieved by providing its group number as an integer or its string name (if it's a + * named group). The default value of 0 refers to the whole pattern. + * Returns -1 if the group did not match or doesn't exist. + */ @JvmOverloads public fun getEnd(name: Any? = 0): Int { TransferContext.writeArguments(ANY to name) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/RemoteTransform2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/RemoteTransform2D.kt index ec0d33251..0c61b7f65 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/RemoteTransform2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/RemoteTransform2D.kt @@ -20,16 +20,15 @@ import kotlin.Suppress import kotlin.Unit /** - * RemoteTransform2D pushes its own [godot.core.Transform2D] to another [godot.Node2D] derived node in the scene. - * - * RemoteTransform2D pushes its own [godot.core.Transform2D] to another [godot.Node2D] derived node (called the remote node) in the scene. - * - * It can be set to update another node's position, rotation and/or scale. It can use either global or local coordinates. + * RemoteTransform2D pushes its own [Transform2D] to another [Node2D] derived node (called the + * remote node) in the scene. + * It can be set to update another node's position, rotation and/or scale. It can use either global + * or local coordinates. */ @GodotBaseType public open class RemoteTransform2D : Node2D() { /** - * The [godot.core.NodePath] to the remote node, relative to the RemoteTransform2D's position in the scene. + * The [NodePath] to the remote node, relative to the RemoteTransform2D's position in the scene. */ public var remotePath: NodePath get() { @@ -104,7 +103,8 @@ public open class RemoteTransform2D : Node2D() { } /** - * [godot.RemoteTransform2D] caches the remote node. It may not notice if the remote node disappears; [forceUpdateCache] forces it to update the cache again. + * [RemoteTransform2D] caches the remote node. It may not notice if the remote node disappears; + * [forceUpdateCache] forces it to update the cache again. */ public fun forceUpdateCache(): Unit { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/RemoteTransform3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/RemoteTransform3D.kt index 376a8f7ab..d5910f5ba 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/RemoteTransform3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/RemoteTransform3D.kt @@ -20,16 +20,15 @@ import kotlin.Suppress import kotlin.Unit /** - * RemoteTransform3D pushes its own [godot.Transform3D] to another [godot.Node3D] derived Node in the scene. - * - * RemoteTransform3D pushes its own [godot.Transform3D] to another [godot.Node3D] derived Node (called the remote node) in the scene. - * - * It can be set to update another Node's position, rotation and/or scale. It can use either global or local coordinates. + * RemoteTransform3D pushes its own [Transform3D] to another [Node3D] derived Node (called the + * remote node) in the scene. + * It can be set to update another Node's position, rotation and/or scale. It can use either global + * or local coordinates. */ @GodotBaseType public open class RemoteTransform3D : Node3D() { /** - * The [godot.core.NodePath] to the remote node, relative to the RemoteTransform3D's position in the scene. + * The [NodePath] to the remote node, relative to the RemoteTransform3D's position in the scene. */ public var remotePath: NodePath get() { @@ -104,7 +103,8 @@ public open class RemoteTransform3D : Node3D() { } /** - * [godot.RemoteTransform3D] caches the remote node. It may not notice if the remote node disappears; [forceUpdateCache] forces it to update the cache again. + * [RemoteTransform3D] caches the remote node. It may not notice if the remote node disappears; + * [forceUpdateCache] forces it to update the cache again. */ public fun forceUpdateCache(): Unit { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/RenderSceneBuffers.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/RenderSceneBuffers.kt index 002dd2eaf..785e1d097 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/RenderSceneBuffers.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/RenderSceneBuffers.kt @@ -18,10 +18,9 @@ import kotlin.Suppress import kotlin.Unit /** - * Abstract scene buffers object, created for each viewport for which 3D rendering is done. - * - * Abstract scene buffers object, created for each viewport for which 3D rendering is done. It manages any additional buffers used during rendering and will discard buffers when the viewport is resized. - * + * Abstract scene buffers object, created for each viewport for which 3D rendering is done. It + * manages any additional buffers used during rendering and will discard buffers when the viewport is + * resized. * **Note:** this is an internal rendering server object only exposed for GDExtension plugins. */ @GodotBaseType @@ -32,7 +31,8 @@ public open class RenderSceneBuffers internal constructor() : RefCounted() { } /** - * This method is called by the rendering server when the associated viewports configuration is changed. It will discard the old buffers and recreate the internal buffers used. + * This method is called by the rendering server when the associated viewports configuration is + * changed. It will discard the old buffers and recreate the internal buffers used. */ public fun configure(config: RenderSceneBuffersConfiguration): Unit { TransferContext.writeArguments(OBJECT to config) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/RenderSceneBuffersConfiguration.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/RenderSceneBuffersConfiguration.kt index adf246883..b2b0b5ce0 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/RenderSceneBuffersConfiguration.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/RenderSceneBuffersConfiguration.kt @@ -28,9 +28,8 @@ import kotlin.Suppress import kotlin.Unit /** - * Configuration object used to setup a [godot.RenderSceneBuffers] object. - * - * This configuration object is created and populated by the render engine on a viewport change and used to (re)configure a [godot.RenderSceneBuffers] object. + * This configuration object is created and populated by the render engine on a viewport change and + * used to (re)configure a [RenderSceneBuffers] object. */ @GodotBaseType public open class RenderSceneBuffersConfiguration : RefCounted() { @@ -93,7 +92,8 @@ public open class RenderSceneBuffersConfiguration : RefCounted() { } /** - * The requested scaling mode with which we upscale/downscale if [internalSize] and [targetSize] are not equal. + * The requested scaling mode with which we upscale/downscale if [internalSize] and [targetSize] + * are not equal. */ public var scaling3dMode: RenderingServer.ViewportScaling3DMode get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/RenderSceneBuffersExtension.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/RenderSceneBuffersExtension.kt index 305c31e8a..4a4ad7acb 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/RenderSceneBuffersExtension.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/RenderSceneBuffersExtension.kt @@ -16,8 +16,6 @@ import kotlin.Suppress import kotlin.Unit /** - * This class allows for a RenderSceneBuffer implementation to be made in GDExtension. - * * This class allows for a RenderSceneBuffer implementation to be made in GDExtension. */ @GodotBaseType diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/RenderSceneBuffersRD.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/RenderSceneBuffersRD.kt index c0d5b20f9..ebc6f2939 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/RenderSceneBuffersRD.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/RenderSceneBuffersRD.kt @@ -27,14 +27,12 @@ import kotlin.Suppress import kotlin.Unit /** - * Abstract render scene buffer implementation for the RenderingDevice based renderers. - * - * This object manages all 3D rendering buffers for the rendering device based renderers. An instance of this object is created for every viewport that has 3D rendering enabled. - * - * All buffers are organized in **contexts**. The default context is called **render_buffers** and can contain amongst others the color buffer, depth buffer, velocity buffers, VRS density map and MSAA variants of these buffers. - * + * This object manages all 3D rendering buffers for the rendering device based renderers. An + * instance of this object is created for every viewport that has 3D rendering enabled. + * All buffers are organized in **contexts**. The default context is called **render_buffers** and + * can contain amongst others the color buffer, depth buffer, velocity buffers, VRS density map and + * MSAA variants of these buffers. * Buffers are only guaranteed to exist during rendering of the viewport. - * * **Note:** this is an internal rendering server object only exposed for GDExtension plugins. */ @GodotBaseType @@ -54,7 +52,8 @@ public open class RenderSceneBuffersRD internal constructor() : RenderSceneBuffe } /** - * Create a new texture with the given definition and cache this under the given name. Will return the existing texture if it already exists. + * Create a new texture with the given definition and cache this under the given name. Will return + * the existing texture if it already exists. */ public fun createTexture( context: StringName, @@ -73,7 +72,8 @@ public open class RenderSceneBuffersRD internal constructor() : RenderSceneBuffe } /** - * Create a new texture using the given format and view and cache this under the given name. Will return the existing texture if it already exists. + * Create a new texture using the given format and view and cache this under the given name. Will + * return the existing texture if it already exists. */ public fun createTextureFromFormat( context: StringName, @@ -88,7 +88,9 @@ public open class RenderSceneBuffersRD internal constructor() : RenderSceneBuffe } /** - * Create a new texture view for an existing texture and cache this under the given view_name. Will return the existing teture view if it already exists. Will error if the source texture doesn't exist. + * Create a new texture view for an existing texture and cache this under the given view_name. + * Will return the existing teture view if it already exists. Will error if the source texture + * doesn't exist. */ public fun createTextureView( context: StringName, @@ -174,7 +176,8 @@ public open class RenderSceneBuffersRD internal constructor() : RenderSceneBuffe } /** - * Returns the color texture we are rendering 3D content to. If multiview is used this will be a texture array with all views. + * Returns the color texture we are rendering 3D content to. If multiview is used this will be a + * texture array with all views. */ public fun getColorTexture(): RID { TransferContext.writeArguments() @@ -192,7 +195,8 @@ public open class RenderSceneBuffersRD internal constructor() : RenderSceneBuffe } /** - * Returns the depth texture we are rendering 3D content to. If multiview is used this will be a texture array with all views. + * Returns the depth texture we are rendering 3D content to. If multiview is used this will be a + * texture array with all views. */ public fun getDepthTexture(): RID { TransferContext.writeArguments() @@ -210,7 +214,8 @@ public open class RenderSceneBuffersRD internal constructor() : RenderSceneBuffe } /** - * Returns the velocity texture we are rendering 3D content to. If multiview is used this will be a texture array with all views. + * Returns the velocity texture we are rendering 3D content to. If multiview is used this will be + * a texture array with all views. */ public fun getVelocityTexture(): RID { TransferContext.writeArguments() @@ -246,7 +251,8 @@ public open class RenderSceneBuffersRD internal constructor() : RenderSceneBuffe } /** - * Returns the internal size of the render buffer (size before upscaling) with which textures are created by default. + * Returns the internal size of the render buffer (size before upscaling) with which textures are + * created by default. */ public fun getInternalSize(): Vector2i { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ResourceFormatLoader.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ResourceFormatLoader.kt index 3f0e76b9e..71ad9b47f 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ResourceFormatLoader.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ResourceFormatLoader.kt @@ -22,13 +22,18 @@ import kotlin.String import kotlin.Suppress /** - * Loads a specific resource type from a file. - * - * Godot loads resources in the editor or in exported games using ResourceFormatLoaders. They are queried automatically via the [godot.ResourceLoader] singleton, or when a resource with internal dependencies is loaded. Each file type may load as a different resource type, so multiple ResourceFormatLoaders are registered in the engine. - * - * Extending this class allows you to define your own loader. Be sure to respect the documented return types and values. You should give it a global class name with `class_name` for it to be registered. Like built-in ResourceFormatLoaders, it will be called automatically when loading resources of its handled type(s). You may also implement a [godot.ResourceFormatSaver]. - * - * **Note:** You can also extend [godot.EditorImportPlugin] if the resource type you need exists but Godot is unable to load its format. Choosing one way over another depends on if the format is suitable or not for the final exported game. For example, it's better to import `.png` textures as `.ctex` ([godot.CompressedTexture2D]) first, so they can be loaded with better efficiency on the graphics card. + * Godot loads resources in the editor or in exported games using ResourceFormatLoaders. They are + * queried automatically via the [ResourceLoader] singleton, or when a resource with internal + * dependencies is loaded. Each file type may load as a different resource type, so multiple + * ResourceFormatLoaders are registered in the engine. + * Extending this class allows you to define your own loader. Be sure to respect the documented + * return types and values. You should give it a global class name with `class_name` for it to be + * registered. Like built-in ResourceFormatLoaders, it will be called automatically when loading + * resources of its handled type(s). You may also implement a [ResourceFormatSaver]. + * **Note:** You can also extend [EditorImportPlugin] if the resource type you need exists but Godot + * is unable to load its format. Choosing one way over another depends on if the format is suitable or + * not for the final exported game. For example, it's better to import `.png` textures as `.ctex` + * ([CompressedTexture2D]) first, so they can be loaded with better efficiency on the graphics card. */ @GodotBaseType public open class ResourceFormatLoader : RefCounted() { @@ -45,9 +50,11 @@ public open class ResourceFormatLoader : RefCounted() { } /** - * Tells whether or not this loader should load a resource from its resource path for a given type. - * - * If it is not implemented, the default behavior returns whether the path's extension is within the ones provided by [_getRecognizedExtensions], and if the type is within the ones provided by [_getResourceType]. + * Tells whether or not this loader should load a resource from its resource path for a given + * type. + * If it is not implemented, the default behavior returns whether the path's extension is within + * the ones provided by [_getRecognizedExtensions], and if the type is within the ones provided by + * [_getResourceType]. */ public open fun _recognizePath(path: String, type: StringName): Boolean { throw NotImplementedError("_recognize_path is not implemented for ResourceFormatLoader") @@ -55,72 +62,68 @@ public open class ResourceFormatLoader : RefCounted() { /** * Tells which resource class this loader can load. - * - * **Note:** Custom resource types defined by scripts aren't known by the [godot.ClassDB], so you might just handle `"Resource"` for them. + * **Note:** Custom resource types defined by scripts aren't known by the [ClassDB], so you might + * just handle `"Resource"` for them. */ public open fun _handlesType(type: StringName): Boolean { throw NotImplementedError("_handles_type is not implemented for ResourceFormatLoader") } /** - * Gets the class name of the resource associated with the given path. If the loader cannot handle it, it should return `""`. - * - * **Note:** Custom resource types defined by scripts aren't known by the [godot.ClassDB], so you might just return `"Resource"` for them. + * Gets the class name of the resource associated with the given path. If the loader cannot handle + * it, it should return `""`. + * **Note:** Custom resource types defined by scripts aren't known by the [ClassDB], so you might + * just return `"Resource"` for them. */ public open fun _getResourceType(path: String): String { throw NotImplementedError("_get_resource_type is not implemented for ResourceFormatLoader") } /** - * Returns the script class name associated with the [godot.Resource] under the given [path]. If the resource has no script or the script isn't a named class, it should return `""`. + * Returns the script class name associated with the [Resource] under the given [param path]. If + * the resource has no script or the script isn't a named class, it should return `""`. */ public open fun _getResourceScriptClass(path: String): String { throw NotImplementedError("_get_resource_script_class is not implemented for ResourceFormatLoader") } - /** - * - */ public open fun _getResourceUid(path: String): Long { throw NotImplementedError("_get_resource_uid is not implemented for ResourceFormatLoader") } /** - * If implemented, gets the dependencies of a given resource. If [addTypes] is `true`, paths should be appended `::TypeName`, where `TypeName` is the class name of the dependency. - * - * **Note:** Custom resource types defined by scripts aren't known by the [godot.ClassDB], so you might just return `"Resource"` for them. + * If implemented, gets the dependencies of a given resource. If [param add_types] is `true`, + * paths should be appended `::TypeName`, where `TypeName` is the class name of the dependency. + * **Note:** Custom resource types defined by scripts aren't known by the [ClassDB], so you might + * just return `"Resource"` for them. */ public open fun _getDependencies(path: String, addTypes: Boolean): PackedStringArray { throw NotImplementedError("_get_dependencies is not implemented for ResourceFormatLoader") } /** - * If implemented, renames dependencies within the given resource and saves it. [renames] is a dictionary `{ String => String }` mapping old dependency paths to new paths. - * - * Returns [OK] on success, or an [enum Error] constant in case of failure. + * If implemented, renames dependencies within the given resource and saves it. [param renames] is + * a dictionary `{ String => String }` mapping old dependency paths to new paths. + * Returns [constant OK] on success, or an [enum Error] constant in case of failure. */ public open fun _renameDependencies(path: String, renames: Dictionary): GodotError { throw NotImplementedError("_rename_dependencies is not implemented for ResourceFormatLoader") } - /** - * - */ public open fun _exists(path: String): Boolean { throw NotImplementedError("_exists is not implemented for ResourceFormatLoader") } - /** - * - */ public open fun _getClassesUsed(path: String): PackedStringArray { throw NotImplementedError("_get_classes_used is not implemented for ResourceFormatLoader") } /** - * Loads a resource when the engine finds this loader to be compatible. If the loaded resource is the result of an import, [originalPath] will target the source file. Returns a [godot.Resource] object on success, or an [enum Error] constant in case of failure. - * - * The [cacheMode] property defines whether and how the cache should be used or updated when loading the resource. See [enum CacheMode] for details. + * Loads a resource when the engine finds this loader to be compatible. If the loaded resource is + * the result of an import, [param original_path] will target the source file. Returns a [Resource] + * object on success, or an [enum Error] constant in case of failure. + * The [param cache_mode] property defines whether and how the cache should be used or updated + * when loading the resource. See [enum CacheMode] for details. */ public open fun _load( path: String, @@ -134,17 +137,8 @@ public open class ResourceFormatLoader : RefCounted() { public enum class CacheMode( id: Long, ) { - /** - * - */ CACHE_MODE_IGNORE(0), - /** - * - */ CACHE_MODE_REUSE(1), - /** - * - */ CACHE_MODE_REPLACE(2), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ResourceFormatSaver.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ResourceFormatSaver.kt index ffcd29b62..b1eacb32c 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ResourceFormatSaver.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ResourceFormatSaver.kt @@ -19,11 +19,14 @@ import kotlin.String import kotlin.Suppress /** - * Saves a specific resource type to a file. - * - * The engine can save resources when you do it from the editor, or when you use the [godot.ResourceSaver] singleton. This is accomplished thanks to multiple [godot.ResourceFormatSaver]s, each handling its own format and called automatically by the engine. - * - * By default, Godot saves resources as `.tres` (text-based), `.res` (binary) or another built-in format, but you can choose to create your own format by extending this class. Be sure to respect the documented return types and values. You should give it a global class name with `class_name` for it to be registered. Like built-in ResourceFormatSavers, it will be called automatically when saving resources of its recognized type(s). You may also implement a [godot.ResourceFormatLoader]. + * The engine can save resources when you do it from the editor, or when you use the [ResourceSaver] + * singleton. This is accomplished thanks to multiple [ResourceFormatSaver]s, each handling its own + * format and called automatically by the engine. + * By default, Godot saves resources as `.tres` (text-based), `.res` (binary) or another built-in + * format, but you can choose to create your own format by extending this class. Be sure to respect the + * documented return types and values. You should give it a global class name with `class_name` for it + * to be registered. Like built-in ResourceFormatSavers, it will be called automatically when saving + * resources of its recognized type(s). You may also implement a [ResourceFormatLoader]. */ @GodotBaseType public open class ResourceFormatSaver : RefCounted() { @@ -33,9 +36,9 @@ public open class ResourceFormatSaver : RefCounted() { } /** - * Saves the given resource object to a file at the target [path]. [flags] is a bitmask composed with [enum ResourceSaver.SaverFlags] constants. - * - * Returns [OK] on success, or an [enum Error] constant in case of failure. + * Saves the given resource object to a file at the target [param path]. [param flags] is a + * bitmask composed with [enum ResourceSaver.SaverFlags] constants. + * Returns [constant OK] on success, or an [enum Error] constant in case of failure. */ public open fun _save( resource: Resource, @@ -46,7 +49,8 @@ public open class ResourceFormatSaver : RefCounted() { } /** - * Sets a new UID for the resource at the given [path]. Returns [OK] on success, or an [enum Error] constant in case of failure. + * Sets a new UID for the resource at the given [param path]. Returns [constant OK] on success, or + * an [enum Error] constant in case of failure. */ public open fun _setUid(path: String, uid: Long): GodotError { throw NotImplementedError("_set_uid is not implemented for ResourceFormatSaver") @@ -60,7 +64,8 @@ public open class ResourceFormatSaver : RefCounted() { } /** - * Returns the list of extensions available for saving the resource object, provided it is recognized (see [_recognize]). + * Returns the list of extensions available for saving the resource object, provided it is + * recognized (see [_recognize]). */ public open fun _getRecognizedExtensions(resource: Resource): PackedStringArray { throw NotImplementedError("_get_recognized_extensions is not implemented for ResourceFormatSaver") @@ -68,8 +73,8 @@ public open class ResourceFormatSaver : RefCounted() { /** * Returns `true` if this saver handles a given save path and `false` otherwise. - * - * If this method is not implemented, the default behavior returns whether the path's extension is within the ones provided by [_getRecognizedExtensions]. + * If this method is not implemented, the default behavior returns whether the path's extension is + * within the ones provided by [_getRecognizedExtensions]. */ public open fun _recognizePath(resource: Resource, path: String): Boolean { throw NotImplementedError("_recognize_path is not implemented for ResourceFormatSaver") diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ResourceImporter.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ResourceImporter.kt index 1e08526ab..85510772d 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ResourceImporter.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ResourceImporter.kt @@ -13,12 +13,8 @@ import kotlin.Long import kotlin.Suppress /** - * Base class for resource importers. - * - * Tutorials: - * [$DOCS_URL/tutorials/plugins/editor/import_plugins.html]($DOCS_URL/tutorials/plugins/editor/import_plugins.html) - * - * This is the base class for Godot's resource importers. To implement your own resource importers using editor plugins, see [godot.EditorImportPlugin]. + * This is the base class for Godot's resource importers. To implement your own resource importers + * using editor plugins, see [EditorImportPlugin]. */ @GodotBaseType public open class ResourceImporter internal constructor() : RefCounted() { @@ -35,7 +31,9 @@ public open class ResourceImporter internal constructor() : RefCounted() { */ IMPORT_ORDER_DEFAULT(0), /** - * The import order for scenes, which ensures scenes are imported *after* all other core resources such as textures. Custom importers should generally have an import order lower than `100` to avoid issues when importing scenes that rely on custom resources. + * The import order for scenes, which ensures scenes are imported *after* all other core + * resources such as textures. Custom importers should generally have an import order lower than + * `100` to avoid issues when importing scenes that rely on custom resources. */ IMPORT_ORDER_SCENE(100), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ResourcePreloader.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ResourcePreloader.kt index b4d0b28ad..4ffeef539 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ResourcePreloader.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ResourcePreloader.kt @@ -23,11 +23,11 @@ import kotlin.Suppress import kotlin.Unit /** - * A node used to preload sub-resources inside a scene. - * - * This node is used to preload sub-resources inside a scene, so when the scene is loaded, all the resources are ready to use and can be retrieved from the preloader. You can add the resources using the ResourcePreloader tab when the node is selected. - * - * GDScript has a simplified [@GDScript.preload] built-in method which can be used in most situations, leaving the use of [godot.ResourcePreloader] for more advanced scenarios. + * This node is used to preload sub-resources inside a scene, so when the scene is loaded, all the + * resources are ready to use and can be retrieved from the preloader. You can add the resources using + * the ResourcePreloader tab when the node is selected. + * GDScript has a simplified [@GDScript.preload] built-in method which can be used in most + * situations, leaving the use of [ResourcePreloader] for more advanced scenarios. */ @GodotBaseType public open class ResourcePreloader : Node() { @@ -37,7 +37,9 @@ public open class ResourcePreloader : Node() { } /** - * Adds a resource to the preloader with the given [name]. If a resource with the given [name] already exists, the new resource will be renamed to "[name] N" where N is an incrementing number starting from 2. + * Adds a resource to the preloader with the given [param name]. If a resource with the given + * [param name] already exists, the new resource will be renamed to "[param name] N" where N is an + * incrementing number starting from 2. */ public fun addResource(name: StringName, resource: Resource): Unit { TransferContext.writeArguments(STRING_NAME to name, OBJECT to resource) @@ -45,7 +47,7 @@ public open class ResourcePreloader : Node() { } /** - * Removes the resource associated to [name] from the preloader. + * Removes the resource associated to [param name] from the preloader. */ public fun removeResource(name: StringName): Unit { TransferContext.writeArguments(STRING_NAME to name) @@ -53,7 +55,7 @@ public open class ResourcePreloader : Node() { } /** - * Renames a resource inside the preloader from [name] to [newname]. + * Renames a resource inside the preloader from [param name] to [param newname]. */ public fun renameResource(name: StringName, newname: StringName): Unit { TransferContext.writeArguments(STRING_NAME to name, STRING_NAME to newname) @@ -61,7 +63,7 @@ public open class ResourcePreloader : Node() { } /** - * Returns `true` if the preloader contains a resource associated to [name]. + * Returns `true` if the preloader contains a resource associated to [param name]. */ public fun hasResource(name: StringName): Boolean { TransferContext.writeArguments(STRING_NAME to name) @@ -70,7 +72,7 @@ public open class ResourcePreloader : Node() { } /** - * Returns the resource associated to [name]. + * Returns the resource associated to [param name]. */ public fun getResource(name: StringName): Resource? { TransferContext.writeArguments(STRING_NAME to name) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ResourceUID.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ResourceUID.kt index a2d5801ea..eaf6c1803 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ResourceUID.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ResourceUID.kt @@ -22,17 +22,15 @@ import kotlin.Suppress import kotlin.Unit /** - * A singleton that manages the unique identifiers of all resources within a project. - * - * Resource UIDs (Unique IDentifiers) allow the engine to keep references between resources intact, even if files can renamed or moved. They can be accessed with `uid://`. - * - * [godot.ResourceUID] keeps track of all registered resource UIDs in a project, generates new UIDs, and converts between their string and integer representations. + * Resource UIDs (Unique IDentifiers) allow the engine to keep references between resources intact, + * even if files can renamed or moved. They can be accessed with `uid://`. + * [ResourceUID] keeps track of all registered resource UIDs in a project, generates new UIDs, and + * converts between their string and integer representations. */ @GodotBaseType public object ResourceUID : Object() { /** * The value to use for an invalid UID, for example if the resource could not be loaded. - * * Its text representation is `uid://`. */ public final const val INVALID_ID: Long = -1 @@ -61,8 +59,8 @@ public object ResourceUID : Object() { } /** - * Generates a random resource UID which is guaranteed to be unique within the list of currently loaded UIDs. - * + * Generates a random resource UID which is guaranteed to be unique within the list of currently + * loaded UIDs. * In order for this UID to be registered, you must call [addId] or [setId]. */ public fun createId(): Long { @@ -82,8 +80,8 @@ public object ResourceUID : Object() { /** * Adds a new UID value which is mapped to the given resource path. - * - * Fails with an error if the UID already exists, so be sure to check [hasId] beforehand, or use [setId] instead. + * Fails with an error if the UID already exists, so be sure to check [hasId] beforehand, or use + * [setId] instead. */ public fun addId(id: Long, path: String): Unit { TransferContext.writeArguments(LONG to id, STRING to path) @@ -92,8 +90,8 @@ public object ResourceUID : Object() { /** * Updates the resource path of an existing UID. - * - * Fails with an error if the UID does not exist, so be sure to check [hasId] beforehand, or use [addId] instead. + * Fails with an error if the UID does not exist, so be sure to check [hasId] beforehand, or use + * [addId] instead. */ public fun setId(id: Long, path: String): Unit { TransferContext.writeArguments(LONG to id, STRING to path) @@ -102,7 +100,6 @@ public object ResourceUID : Object() { /** * Returns the path that the given UID value refers to. - * * Fails with an error if the UID does not exist, so be sure to check [hasId] beforehand. */ public fun getIdPath(id: Long): String { @@ -113,7 +110,6 @@ public object ResourceUID : Object() { /** * Removes a loaded UID value from the cache. - * * Fails with an error if the UID does not exist, so be sure to check [hasId] beforehand. */ public fun removeId(id: Long): Unit { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/RibbonTrailMesh.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/RibbonTrailMesh.kt index 60f089c66..26518096e 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/RibbonTrailMesh.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/RibbonTrailMesh.kt @@ -22,13 +22,10 @@ import kotlin.Long import kotlin.Suppress /** - * Represents a straight ribbon-shaped [godot.PrimitiveMesh] with variable width. - * - * Tutorials: - * [$DOCS_URL/tutorials/3d/particles/index.html]($DOCS_URL/tutorials/3d/particles/index.html) - * - * [godot.RibbonTrailMesh] represents a straight ribbon-shaped mesh with variable width. The ribbon is composed of a number of flat or cross-shaped sections, each with the same [sectionLength] and number of [sectionSegments]. A [curve] is sampled along the total length of the ribbon, meaning that the curve determines the size of the ribbon along its length. - * + * [RibbonTrailMesh] represents a straight ribbon-shaped mesh with variable width. The ribbon is + * composed of a number of flat or cross-shaped sections, each with the same [sectionLength] and number + * of [sectionSegments]. A [curve] is sampled along the total length of the ribbon, meaning that the + * curve determines the size of the ribbon along its length. * This primitive mesh is usually used for particle trails. */ @GodotBaseType @@ -48,7 +45,8 @@ public open class RibbonTrailMesh : PrimitiveMesh() { } /** - * The baseline size of the ribbon. The size of a particular section segment is obtained by multiplying this size by the value of the [curve] at the given distance. + * The baseline size of the ribbon. The size of a particular section segment is obtained by + * multiplying this size by the value of the [curve] at the given distance. */ public var size: Float get() { @@ -90,7 +88,8 @@ public open class RibbonTrailMesh : PrimitiveMesh() { } /** - * The number of segments in a section. The [curve] is sampled on each segment to determine its size. Higher values result in a more detailed ribbon at the cost of performance. + * The number of segments in a section. The [curve] is sampled on each segment to determine its + * size. Higher values result in a more detailed ribbon at the cost of performance. */ public var sectionSegments: Int get() { @@ -104,7 +103,9 @@ public open class RibbonTrailMesh : PrimitiveMesh() { } /** - * Determines the size of the ribbon along its length. The size of a particular section segment is obtained by multiplying the baseline [size] by the value of this curve at the given distance. For values smaller than `0`, the faces will be inverted. + * Determines the size of the ribbon along its length. The size of a particular section segment is + * obtained by multiplying the baseline [size] by the value of this curve at the given distance. For + * values smaller than `0`, the faces will be inverted. */ public var curve: Curve? get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/RigidBody2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/RigidBody2D.kt index d8c0aae10..bb9ede0ff 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/RigidBody2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/RigidBody2D.kt @@ -36,69 +36,80 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * A 2D physics body that is moved by a physics simulation. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/148](https://godotengine.org/asset-library/asset/148) - * - * [godot.RigidBody2D] implements full 2D physics. It cannot be controlled directly, instead, you must apply forces to it (gravity, impulses, etc.), and the physics simulation will calculate the resulting movement, rotation, react to collisions, and affect other physics bodies in its path. - * - * The body's behavior can be adjusted via [lockRotation], [freeze], and [freezeMode]. By changing various properties of the object, such as [mass], you can control how the physics simulation acts on it. - * - * A rigid body will always maintain its shape and size, even when forces are applied to it. It is useful for objects that can be interacted with in an environment, such as a tree that can be knocked over or a stack of crates that can be pushed around. - * - * If you need to override the default physics behavior, you can write a custom force integration function. See [customIntegrator]. - * - * **Note:** Changing the 2D transform or [linearVelocity] of a [godot.RigidBody2D] very often may lead to some unpredictable behaviors. If you need to directly affect the body, prefer [_integrateForces] as it allows you to directly access the physics state. + * [RigidBody2D] implements full 2D physics. It cannot be controlled directly, instead, you must + * apply forces to it (gravity, impulses, etc.), and the physics simulation will calculate the + * resulting movement, rotation, react to collisions, and affect other physics bodies in its path. + * The body's behavior can be adjusted via [lockRotation], [freeze], and [freezeMode]. By changing + * various properties of the object, such as [mass], you can control how the physics simulation acts on + * it. + * A rigid body will always maintain its shape and size, even when forces are applied to it. It is + * useful for objects that can be interacted with in an environment, such as a tree that can be knocked + * over or a stack of crates that can be pushed around. + * If you need to override the default physics behavior, you can write a custom force integration + * function. See [customIntegrator]. + * **Note:** Changing the 2D transform or [linearVelocity] of a [RigidBody2D] very often may lead to + * some unpredictable behaviors. If you need to directly affect the body, prefer [_integrateForces] as + * it allows you to directly access the physics state. */ @GodotBaseType public open class RigidBody2D : PhysicsBody2D() { /** - * Emitted when one of this RigidBody2D's [godot.Shape2D]s collides with another [godot.PhysicsBody2D] or [godot.TileMap]'s [godot.Shape2D]s. Requires [contactMonitor] to be set to `true` and [maxContactsReported] to be set high enough to detect all the collisions. [godot.TileMap]s are detected if the [godot.TileSet] has Collision [godot.Shape2D]s. - * - * [bodyRid] the [RID] of the other [godot.PhysicsBody2D] or [godot.TileSet]'s [godot.CollisionObject2D] used by the [godot.PhysicsServer2D]. - * - * [body] the [godot.Node], if it exists in the tree, of the other [godot.PhysicsBody2D] or [godot.TileMap]. - * - * [bodyShapeIndex] the index of the [godot.Shape2D] of the other [godot.PhysicsBody2D] or [godot.TileMap] used by the [godot.PhysicsServer2D]. Get the [godot.CollisionShape2D] node with `body.shape_owner_get_owner(body.shape_find_owner(body_shape_index))`. - * - * [localShapeIndex] the index of the [godot.Shape2D] of this RigidBody2D used by the [godot.PhysicsServer2D]. Get the [godot.CollisionShape2D] node with `self.shape_owner_get_owner(self.shape_find_owner(local_shape_index))`. + * Emitted when one of this RigidBody2D's [Shape2D]s collides with another [PhysicsBody2D] or + * [TileMap]'s [Shape2D]s. Requires [contactMonitor] to be set to `true` and [maxContactsReported] to + * be set high enough to detect all the collisions. [TileMap]s are detected if the [TileSet] has + * Collision [Shape2D]s. + * [param body_rid] the [RID] of the other [PhysicsBody2D] or [TileSet]'s [CollisionObject2D] used + * by the [PhysicsServer2D]. + * [param body] the [Node], if it exists in the tree, of the other [PhysicsBody2D] or [TileMap]. + * [param body_shape_index] the index of the [Shape2D] of the other [PhysicsBody2D] or [TileMap] + * used by the [PhysicsServer2D]. Get the [CollisionShape2D] node with + * `body.shape_owner_get_owner(body.shape_find_owner(body_shape_index))`. + * [param local_shape_index] the index of the [Shape2D] of this RigidBody2D used by the + * [PhysicsServer2D]. Get the [CollisionShape2D] node with + * `self.shape_owner_get_owner(self.shape_find_owner(local_shape_index))`. */ public val bodyShapeEntered: Signal4 by signal("bodyRid", "body", "bodyShapeIndex", "localShapeIndex") /** - * Emitted when the collision between one of this RigidBody2D's [godot.Shape2D]s and another [godot.PhysicsBody2D] or [godot.TileMap]'s [godot.Shape2D]s ends. Requires [contactMonitor] to be set to `true` and [maxContactsReported] to be set high enough to detect all the collisions. [godot.TileMap]s are detected if the [godot.TileSet] has Collision [godot.Shape2D]s. - * - * [bodyRid] the [RID] of the other [godot.PhysicsBody2D] or [godot.TileSet]'s [godot.CollisionObject2D] used by the [godot.PhysicsServer2D]. - * - * [body] the [godot.Node], if it exists in the tree, of the other [godot.PhysicsBody2D] or [godot.TileMap]. - * - * [bodyShapeIndex] the index of the [godot.Shape2D] of the other [godot.PhysicsBody2D] or [godot.TileMap] used by the [godot.PhysicsServer2D]. Get the [godot.CollisionShape2D] node with `body.shape_owner_get_owner(body.shape_find_owner(body_shape_index))`. - * - * [localShapeIndex] the index of the [godot.Shape2D] of this RigidBody2D used by the [godot.PhysicsServer2D]. Get the [godot.CollisionShape2D] node with `self.shape_owner_get_owner(self.shape_find_owner(local_shape_index))`. + * Emitted when the collision between one of this RigidBody2D's [Shape2D]s and another + * [PhysicsBody2D] or [TileMap]'s [Shape2D]s ends. Requires [contactMonitor] to be set to `true` and + * [maxContactsReported] to be set high enough to detect all the collisions. [TileMap]s are detected + * if the [TileSet] has Collision [Shape2D]s. + * [param body_rid] the [RID] of the other [PhysicsBody2D] or [TileSet]'s [CollisionObject2D] used + * by the [PhysicsServer2D]. + * [param body] the [Node], if it exists in the tree, of the other [PhysicsBody2D] or [TileMap]. + * [param body_shape_index] the index of the [Shape2D] of the other [PhysicsBody2D] or [TileMap] + * used by the [PhysicsServer2D]. Get the [CollisionShape2D] node with + * `body.shape_owner_get_owner(body.shape_find_owner(body_shape_index))`. + * [param local_shape_index] the index of the [Shape2D] of this RigidBody2D used by the + * [PhysicsServer2D]. Get the [CollisionShape2D] node with + * `self.shape_owner_get_owner(self.shape_find_owner(local_shape_index))`. */ public val bodyShapeExited: Signal4 by signal("bodyRid", "body", "bodyShapeIndex", "localShapeIndex") /** - * Emitted when a collision with another [godot.PhysicsBody2D] or [godot.TileMap] occurs. Requires [contactMonitor] to be set to `true` and [maxContactsReported] to be set high enough to detect all the collisions. [godot.TileMap]s are detected if the [godot.TileSet] has Collision [godot.Shape2D]s. - * - * [body] the [godot.Node], if it exists in the tree, of the other [godot.PhysicsBody2D] or [godot.TileMap]. + * Emitted when a collision with another [PhysicsBody2D] or [TileMap] occurs. Requires + * [contactMonitor] to be set to `true` and [maxContactsReported] to be set high enough to detect all + * the collisions. [TileMap]s are detected if the [TileSet] has Collision [Shape2D]s. + * [param body] the [Node], if it exists in the tree, of the other [PhysicsBody2D] or [TileMap]. */ public val bodyEntered: Signal1 by signal("body") /** - * Emitted when the collision with another [godot.PhysicsBody2D] or [godot.TileMap] ends. Requires [contactMonitor] to be set to `true` and [maxContactsReported] to be set high enough to detect all the collisions. [godot.TileMap]s are detected if the [godot.TileSet] has Collision [godot.Shape2D]s. - * - * [body] the [godot.Node], if it exists in the tree, of the other [godot.PhysicsBody2D] or [godot.TileMap]. + * Emitted when the collision with another [PhysicsBody2D] or [TileMap] ends. Requires + * [contactMonitor] to be set to `true` and [maxContactsReported] to be set high enough to detect all + * the collisions. [TileMap]s are detected if the [TileSet] has Collision [Shape2D]s. + * [param body] the [Node], if it exists in the tree, of the other [PhysicsBody2D] or [TileMap]. */ public val bodyExited: Signal1 by signal("body") /** * Emitted when the physics engine changes the body's sleeping state. - * - * **Note:** Changing the value [sleeping] will not trigger this signal. It is only emitted if the sleeping state is changed by the physics engine or `emit_signal("sleeping_state_changed")` is used. + * **Note:** Changing the value [sleeping] will not trigger this signal. It is only emitted if the + * sleeping state is changed by the physics engine or `emit_signal("sleeping_state_changed")` is + * used. */ public val sleepingStateChanged: Signal0 by signal() @@ -118,8 +129,8 @@ public open class RigidBody2D : PhysicsBody2D() { /** * The physics material override for the body. - * - * If a material is assigned to this property, it will be used instead of any other physics material, such as an inherited one. + * If a material is assigned to this property, it will be used instead of any other physics + * material, such as an inherited one. */ public var physicsMaterialOverride: PhysicsMaterial? get() { @@ -133,7 +144,9 @@ public open class RigidBody2D : PhysicsBody2D() { } /** - * Multiplies the gravity applied to the body. The body's gravity is calculated from the **Default Gravity** value in **Project > Project Settings > Physics > 2d** and/or any additional gravity vector applied by [godot.Area2D]s. + * Multiplies the gravity applied to the body. The body's gravity is calculated from the **Default + * Gravity** value in **Project > Project Settings > Physics > 2d** and/or any additional gravity + * vector applied by [Area2D]s. */ public var gravityScale: Float get() { @@ -147,7 +160,8 @@ public open class RigidBody2D : PhysicsBody2D() { } /** - * Defines the way the body's center of mass is set. See [enum CenterOfMassMode] for possible values. + * Defines the way the body's center of mass is set. See [enum CenterOfMassMode] for possible + * values. */ public var centerOfMassMode: CenterOfMassMode get() { @@ -161,9 +175,12 @@ public open class RigidBody2D : PhysicsBody2D() { } /** - * The body's custom center of mass, relative to the body's origin position, when [centerOfMassMode] is set to [CENTER_OF_MASS_MODE_CUSTOM]. This is the balanced point of the body, where applied forces only cause linear acceleration. Applying forces outside of the center of mass causes angular acceleration. - * - * When [centerOfMassMode] is set to [CENTER_OF_MASS_MODE_AUTO] (default value), the center of mass is automatically computed. + * The body's custom center of mass, relative to the body's origin position, when + * [centerOfMassMode] is set to [constant CENTER_OF_MASS_MODE_CUSTOM]. This is the balanced point of + * the body, where applied forces only cause linear acceleration. Applying forces outside of the + * center of mass causes angular acceleration. + * When [centerOfMassMode] is set to [constant CENTER_OF_MASS_MODE_AUTO] (default value), the + * center of mass is automatically computed. */ @CoreTypeLocalCopy public var centerOfMass: Vector2 @@ -178,53 +195,34 @@ public open class RigidBody2D : PhysicsBody2D() { } /** - * The body's moment of inertia. This is like mass, but for rotation: it determines how much torque it takes to rotate the body. The moment of inertia is usually computed automatically from the mass and the shapes, but this property allows you to set a custom value. - * + * The body's moment of inertia. This is like mass, but for rotation: it determines how much + * torque it takes to rotate the body. The moment of inertia is usually computed automatically from + * the mass and the shapes, but this property allows you to set a custom value. * If set to `0`, inertia is automatically computed (default value). + * **Note:** This value does not change when inertia is automatically computed. Use + * [PhysicsServer2D] to get the computed inertia. * - * **Note:** This value does not change when inertia is automatically computed. Use [godot.PhysicsServer2D] to get the computed inertia. - * - * [codeblocks] - * - * [gdscript] - * + * gdscript: + * ```gdscript * @onready var ball = $Ball * - * - * * func get_ball_inertia(): - * * return 1.0 / PhysicsServer2D.body_get_direct_state(ball.get_rid()).inverse_inertia - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * private RigidBody2D _ball; * - * - * * public override void _Ready() - * * { - * * _ball = GetNode("Ball"); - * * } * - * - * * private float GetBallInertia() - * * { - * * return 1.0f / PhysicsServer2D.BodyGetDirectState(_ball.GetRid()).InverseInertia; - * * } - * - * [/csharp] - * - * [/codeblocks] + * ``` */ public var inertia: Float get() { @@ -238,7 +236,8 @@ public open class RigidBody2D : PhysicsBody2D() { } /** - * If `true`, the body will not move and will not calculate forces until woken up by another body through, for example, a collision, or by using the [applyImpulse] or [applyForce] methods. + * If `true`, the body will not move and will not calculate forces until woken up by another body + * through, for example, a collision, or by using the [applyImpulse] or [applyForce] methods. */ public var sleeping: Boolean get() { @@ -281,10 +280,8 @@ public open class RigidBody2D : PhysicsBody2D() { /** * If `true`, the body is frozen. Gravity and forces are not applied anymore. - * * See [freezeMode] to set the body's behavior when frozen. - * - * For a body that is always frozen, use [godot.StaticBody2D] or [godot.AnimatableBody2D] instead. + * For a body that is always frozen, use [StaticBody2D] or [AnimatableBody2D] instead. */ public var freeze: Boolean get() { @@ -298,9 +295,9 @@ public open class RigidBody2D : PhysicsBody2D() { } /** - * The body's freeze mode. Can be used to set the body's behavior when [freeze] is enabled. See [enum FreezeMode] for possible values. - * - * For a body that is always frozen, use [godot.StaticBody2D] or [godot.AnimatableBody2D] instead. + * The body's freeze mode. Can be used to set the body's behavior when [freeze] is enabled. See + * [enum FreezeMode] for possible values. + * For a body that is always frozen, use [StaticBody2D] or [AnimatableBody2D] instead. */ public var freezeMode: FreezeMode get() { @@ -314,7 +311,8 @@ public open class RigidBody2D : PhysicsBody2D() { } /** - * If `true`, internal force integration is disabled for this body. Aside from collision response, the body will only move as determined by the [_integrateForces] function. + * If `true`, internal force integration is disabled for this body. Aside from collision response, + * the body will only move as determined by the [_integrateForces] function. */ public var customIntegrator: Boolean get() { @@ -329,8 +327,10 @@ public open class RigidBody2D : PhysicsBody2D() { /** * Continuous collision detection mode. - * - * Continuous collision detection tries to predict where a moving body will collide instead of moving it and correcting its movement after collision. Continuous collision detection is slower, but more precise and misses fewer collisions with small, fast-moving objects. Raycasting and shapecasting methods are available. See [enum CCDMode] for details. + * Continuous collision detection tries to predict where a moving body will collide instead of + * moving it and correcting its movement after collision. Continuous collision detection is slower, + * but more precise and misses fewer collisions with small, fast-moving objects. Raycasting and + * shapecasting methods are available. See [enum CCDMode] for details. */ public var continuousCd: CCDMode get() { @@ -345,9 +345,12 @@ public open class RigidBody2D : PhysicsBody2D() { } /** - * The maximum number of contacts that will be recorded. Requires a value greater than 0 and [contactMonitor] to be set to `true` to start to register contacts. Use [getContactCount] to retrieve the count or [getCollidingBodies] to retrieve bodies that have been collided with. - * - * **Note:** The number of contacts is different from the number of collisions. Collisions between parallel edges will result in two contacts (one at each end), and collisions between parallel faces will result in four contacts (one at each corner). + * The maximum number of contacts that will be recorded. Requires a value greater than 0 and + * [contactMonitor] to be set to `true` to start to register contacts. Use [getContactCount] to + * retrieve the count or [getCollidingBodies] to retrieve bodies that have been collided with. + * **Note:** The number of contacts is different from the number of collisions. Collisions between + * parallel edges will result in two contacts (one at each end), and collisions between parallel + * faces will result in four contacts (one at each corner). */ public var maxContactsReported: Int get() { @@ -362,8 +365,8 @@ public open class RigidBody2D : PhysicsBody2D() { /** * If `true`, the RigidBody2D will emit signals when it collides with another body. - * - * **Note:** By default the maximum contacts reported is set to 0, meaning nothing will be recorded, see [maxContactsReported]. + * **Note:** By default the maximum contacts reported is set to 0, meaning nothing will be + * recorded, see [maxContactsReported]. */ public var contactMonitor: Boolean get() { @@ -377,7 +380,9 @@ public open class RigidBody2D : PhysicsBody2D() { } /** - * The body's linear velocity in pixels per second. Can be used sporadically, but **don't set this every frame**, because physics may run in another thread and runs at a different granularity. Use [_integrateForces] as your process loop for precise control of the body state. + * The body's linear velocity in pixels per second. Can be used sporadically, but **don't set this + * every frame**, because physics may run in another thread and runs at a different granularity. Use + * [_integrateForces] as your process loop for precise control of the body state. */ @CoreTypeLocalCopy public var linearVelocity: Vector2 @@ -406,9 +411,11 @@ public open class RigidBody2D : PhysicsBody2D() { } /** - * Damps the body's movement. By default, the body will use the **Default Linear Damp** in **Project > Project Settings > Physics > 2d** or any value override set by an [godot.Area2D] the body is in. Depending on [linearDampMode], you can set [linearDamp] to be added to or to replace the body's damping value. - * - * See [godot.ProjectSettings.physics/2d/defaultLinearDamp] for more details about damping. + * Damps the body's movement. By default, the body will use the **Default Linear Damp** in + * **Project > Project Settings > Physics > 2d** or any value override set by an [Area2D] the body is + * in. Depending on [linearDampMode], you can set [linearDamp] to be added to or to replace the + * body's damping value. + * See [ProjectSettings.physics/2d/defaultLinearDamp] for more details about damping. */ public var linearDamp: Float get() { @@ -450,9 +457,11 @@ public open class RigidBody2D : PhysicsBody2D() { } /** - * Damps the body's rotation. By default, the body will use the **Default Angular Damp** in **Project > Project Settings > Physics > 2d** or any value override set by an [godot.Area2D] the body is in. Depending on [angularDampMode], you can set [angularDamp] to be added to or to replace the body's damping value. - * - * See [godot.ProjectSettings.physics/2d/defaultAngularDamp] for more details about damping. + * Damps the body's rotation. By default, the body will use the **Default Angular Damp** in + * **Project > Project Settings > Physics > 2d** or any value override set by an [Area2D] the body is + * in. Depending on [angularDampMode], you can set [angularDamp] to be added to or to replace the + * body's damping value. + * See [ProjectSettings.physics/2d/defaultAngularDamp] for more details about damping. */ public var angularDamp: Float get() { @@ -467,7 +476,6 @@ public open class RigidBody2D : PhysicsBody2D() { /** * The body's total constant positional forces applied during each physics update. - * * See [addConstantForce] and [addConstantCentralForce]. */ @CoreTypeLocalCopy @@ -484,7 +492,6 @@ public open class RigidBody2D : PhysicsBody2D() { /** * The body's total constant rotational forces applied during each physics update. - * * See [addConstantTorque]. */ public var constantTorque: Float @@ -504,9 +511,12 @@ public open class RigidBody2D : PhysicsBody2D() { } /** - * The body's custom center of mass, relative to the body's origin position, when [centerOfMassMode] is set to [CENTER_OF_MASS_MODE_CUSTOM]. This is the balanced point of the body, where applied forces only cause linear acceleration. Applying forces outside of the center of mass causes angular acceleration. - * - * When [centerOfMassMode] is set to [CENTER_OF_MASS_MODE_AUTO] (default value), the center of mass is automatically computed. + * The body's custom center of mass, relative to the body's origin position, when + * [centerOfMassMode] is set to [constant CENTER_OF_MASS_MODE_CUSTOM]. This is the balanced point of + * the body, where applied forces only cause linear acceleration. Applying forces outside of the + * center of mass causes angular acceleration. + * When [centerOfMassMode] is set to [constant CENTER_OF_MASS_MODE_AUTO] (default value), the + * center of mass is automatically computed. * * This is a helper function to make dealing with local copies easier. * @@ -530,7 +540,9 @@ public open class RigidBody2D : PhysicsBody2D() { /** - * The body's linear velocity in pixels per second. Can be used sporadically, but **don't set this every frame**, because physics may run in another thread and runs at a different granularity. Use [_integrateForces] as your process loop for precise control of the body state. + * The body's linear velocity in pixels per second. Can be used sporadically, but **don't set this + * every frame**, because physics may run in another thread and runs at a different granularity. Use + * [_integrateForces] as your process loop for precise control of the body state. * * This is a helper function to make dealing with local copies easier. * @@ -555,7 +567,6 @@ public open class RigidBody2D : PhysicsBody2D() { /** * The body's total constant positional forces applied during each physics update. - * * See [addConstantForce] and [addConstantCentralForce]. * * This is a helper function to make dealing with local copies easier. @@ -580,14 +591,17 @@ public open class RigidBody2D : PhysicsBody2D() { /** - * Allows you to read and safely modify the simulation state for the object. Use this instead of [godot.Node.PhysicsProcess] if you need to directly change the body's `position` or other physics properties. By default, it works in addition to the usual physics behavior, but [customIntegrator] allows you to disable the default behavior and write custom force integration for a body. + * Allows you to read and safely modify the simulation state for the object. Use this instead of + * [Node.PhysicsProcess] if you need to directly change the body's `position` or other physics + * properties. By default, it works in addition to the usual physics behavior, but [customIntegrator] + * allows you to disable the default behavior and write custom force integration for a body. */ public open fun _integrateForces(state: PhysicsDirectBodyState2D): Unit { } /** - * Returns the number of contacts this body has with other bodies. By default, this returns 0 unless bodies are configured to monitor contacts (see [contactMonitor]). - * + * Returns the number of contacts this body has with other bodies. By default, this returns 0 + * unless bodies are configured to monitor contacts (see [contactMonitor]). * **Note:** To retrieve the colliding bodies, use [getCollidingBodies]. */ public fun getContactCount(): Int { @@ -597,7 +611,8 @@ public open class RigidBody2D : PhysicsBody2D() { } /** - * Sets the body's velocity on the given axis. The velocity in the given vector axis will be set as the given vector length. This is useful for jumping behavior. + * Sets the body's velocity on the given axis. The velocity in the given vector axis will be set + * as the given vector length. This is useful for jumping behavior. */ public fun setAxisVelocity(axisVelocity: Vector2): Unit { TransferContext.writeArguments(VECTOR2 to axisVelocity) @@ -606,9 +621,9 @@ public open class RigidBody2D : PhysicsBody2D() { /** * Applies a directional impulse without affecting rotation. - * - * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). - * + * An impulse is time-independent! Applying an impulse every frame would result in a + * framerate-dependent force. For this reason, it should only be used when simulating one-time + * impacts (use the "_force" functions otherwise). * This is equivalent to using [applyImpulse] at the body's center of mass. */ @JvmOverloads @@ -619,10 +634,10 @@ public open class RigidBody2D : PhysicsBody2D() { /** * Applies a positioned impulse to the body. - * - * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). - * - * [position] is the offset from the body origin in global coordinates. + * An impulse is time-independent! Applying an impulse every frame would result in a + * framerate-dependent force. For this reason, it should only be used when simulating one-time + * impacts (use the "_force" functions otherwise). + * [param position] is the offset from the body origin in global coordinates. */ @JvmOverloads public fun applyImpulse(impulse: Vector2, position: Vector2 = Vector2(0, 0)): Unit { @@ -632,10 +647,11 @@ public open class RigidBody2D : PhysicsBody2D() { /** * Applies a rotational impulse to the body without affecting the position. - * - * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). - * - * **Note:** [inertia] is required for this to work. To have [inertia], an active [godot.CollisionShape2D] must be a child of the node, or you can manually set [inertia]. + * An impulse is time-independent! Applying an impulse every frame would result in a + * framerate-dependent force. For this reason, it should only be used when simulating one-time + * impacts (use the "_force" functions otherwise). + * **Note:** [inertia] is required for this to work. To have [inertia], an active + * [CollisionShape2D] must be a child of the node, or you can manually set [inertia]. */ public fun applyTorqueImpulse(torque: Float): Unit { TransferContext.writeArguments(DOUBLE to torque.toDouble()) @@ -643,8 +659,8 @@ public open class RigidBody2D : PhysicsBody2D() { } /** - * Applies a directional force without affecting rotation. A force is time dependent and meant to be applied every physics update. - * + * Applies a directional force without affecting rotation. A force is time dependent and meant to + * be applied every physics update. * This is equivalent to using [applyForce] at the body's center of mass. */ public fun applyCentralForce(force: Vector2): Unit { @@ -653,9 +669,9 @@ public open class RigidBody2D : PhysicsBody2D() { } /** - * Applies a positioned force to the body. A force is time dependent and meant to be applied every physics update. - * - * [position] is the offset from the body origin in global coordinates. + * Applies a positioned force to the body. A force is time dependent and meant to be applied every + * physics update. + * [param position] is the offset from the body origin in global coordinates. */ @JvmOverloads public fun applyForce(force: Vector2, position: Vector2 = Vector2(0, 0)): Unit { @@ -664,9 +680,10 @@ public open class RigidBody2D : PhysicsBody2D() { } /** - * Applies a rotational force without affecting position. A force is time dependent and meant to be applied every physics update. - * - * **Note:** [inertia] is required for this to work. To have [inertia], an active [godot.CollisionShape2D] must be a child of the node, or you can manually set [inertia]. + * Applies a rotational force without affecting position. A force is time dependent and meant to + * be applied every physics update. + * **Note:** [inertia] is required for this to work. To have [inertia], an active + * [CollisionShape2D] must be a child of the node, or you can manually set [inertia]. */ public fun applyTorque(torque: Float): Unit { TransferContext.writeArguments(DOUBLE to torque.toDouble()) @@ -674,8 +691,8 @@ public open class RigidBody2D : PhysicsBody2D() { } /** - * Adds a constant directional force without affecting rotation that keeps being applied over time until cleared with `constant_force = Vector2(0, 0)`. - * + * Adds a constant directional force without affecting rotation that keeps being applied over time + * until cleared with `constant_force = Vector2(0, 0)`. * This is equivalent to using [addConstantForce] at the body's center of mass. */ public fun addConstantCentralForce(force: Vector2): Unit { @@ -684,9 +701,9 @@ public open class RigidBody2D : PhysicsBody2D() { } /** - * Adds a constant positioned force to the body that keeps being applied over time until cleared with `constant_force = Vector2(0, 0)`. - * - * [position] is the offset from the body origin in global coordinates. + * Adds a constant positioned force to the body that keeps being applied over time until cleared + * with `constant_force = Vector2(0, 0)`. + * [param position] is the offset from the body origin in global coordinates. */ @JvmOverloads public fun addConstantForce(force: Vector2, position: Vector2 = Vector2(0, 0)): Unit { @@ -695,7 +712,8 @@ public open class RigidBody2D : PhysicsBody2D() { } /** - * Adds a constant rotational force without affecting position that keeps being applied over time until cleared with `constant_torque = 0`. + * Adds a constant rotational force without affecting position that keeps being applied over time + * until cleared with `constant_torque = 0`. */ public fun addConstantTorque(torque: Float): Unit { TransferContext.writeArguments(DOUBLE to torque.toDouble()) @@ -703,9 +721,11 @@ public open class RigidBody2D : PhysicsBody2D() { } /** - * Returns a list of the bodies colliding with this one. Requires [contactMonitor] to be set to `true` and [maxContactsReported] to be set high enough to detect all the collisions. - * - * **Note:** The result of this test is not immediate after moving objects. For performance, list of collisions is updated once per frame and before the physics step. Consider using signals instead. + * Returns a list of the bodies colliding with this one. Requires [contactMonitor] to be set to + * `true` and [maxContactsReported] to be set high enough to detect all the collisions. + * **Note:** The result of this test is not immediate after moving objects. For performance, list + * of collisions is updated once per frame and before the physics step. Consider using signals + * instead. */ public fun getCollidingBodies(): VariantArray { TransferContext.writeArguments() @@ -717,11 +737,13 @@ public open class RigidBody2D : PhysicsBody2D() { id: Long, ) { /** - * Static body freeze mode (default). The body is not affected by gravity and forces. It can be only moved by user code and doesn't collide with other bodies along its path. + * Static body freeze mode (default). The body is not affected by gravity and forces. It can be + * only moved by user code and doesn't collide with other bodies along its path. */ FREEZE_MODE_STATIC(0), /** - * Kinematic body freeze mode. Similar to [FREEZE_MODE_STATIC], but collides with other bodies along its path when moved. Useful for a frozen body that needs to be animated. + * Kinematic body freeze mode. Similar to [constant FREEZE_MODE_STATIC], but collides with other + * bodies along its path when moved. Useful for a frozen body that needs to be animated. */ FREEZE_MODE_KINEMATIC(1), ; @@ -740,11 +762,13 @@ public open class RigidBody2D : PhysicsBody2D() { id: Long, ) { /** - * In this mode, the body's center of mass is calculated automatically based on its shapes. This assumes that the shapes' origins are also their center of mass. + * In this mode, the body's center of mass is calculated automatically based on its shapes. This + * assumes that the shapes' origins are also their center of mass. */ CENTER_OF_MASS_MODE_AUTO(0), /** - * In this mode, the body's center of mass is set through [centerOfMass]. Defaults to the body's origin position. + * In this mode, the body's center of mass is set through [centerOfMass]. Defaults to the body's + * origin position. */ CENTER_OF_MASS_MODE_CUSTOM(1), ; @@ -763,7 +787,8 @@ public open class RigidBody2D : PhysicsBody2D() { id: Long, ) { /** - * In this mode, the body's damping value is added to any value set in areas or the default value. + * In this mode, the body's damping value is added to any value set in areas or the default + * value. */ DAMP_MODE_COMBINE(0), /** @@ -786,15 +811,18 @@ public open class RigidBody2D : PhysicsBody2D() { id: Long, ) { /** - * Continuous collision detection disabled. This is the fastest way to detect body collisions, but can miss small, fast-moving objects. + * Continuous collision detection disabled. This is the fastest way to detect body collisions, + * but can miss small, fast-moving objects. */ CCD_MODE_DISABLED(0), /** - * Continuous collision detection enabled using raycasting. This is faster than shapecasting but less precise. + * Continuous collision detection enabled using raycasting. This is faster than shapecasting but + * less precise. */ CCD_MODE_CAST_RAY(1), /** - * Continuous collision detection enabled using shapecasting. This is the slowest CCD method and the most precise. + * Continuous collision detection enabled using shapecasting. This is the slowest CCD method and + * the most precise. */ CCD_MODE_CAST_SHAPE(2), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/RigidBody3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/RigidBody3D.kt index e99b9e12f..85e0e9615 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/RigidBody3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/RigidBody3D.kt @@ -38,69 +38,80 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * A 3D physics body that is moved by a physics simulation. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/675](https://godotengine.org/asset-library/asset/675) - * - * [godot.RigidBody3D] implements full 3D physics. It cannot be controlled directly, instead, you must apply forces to it (gravity, impulses, etc.), and the physics simulation will calculate the resulting movement, rotation, react to collisions, and affect other physics bodies in its path. - * - * The body's behavior can be adjusted via [lockRotation], [freeze], and [freezeMode]. By changing various properties of the object, such as [mass], you can control how the physics simulation acts on it. - * - * A rigid body will always maintain its shape and size, even when forces are applied to it. It is useful for objects that can be interacted with in an environment, such as a tree that can be knocked over or a stack of crates that can be pushed around. - * - * If you need to override the default physics behavior, you can write a custom force integration function. See [customIntegrator]. - * - * **Note:** Changing the 3D transform or [linearVelocity] of a [godot.RigidBody3D] very often may lead to some unpredictable behaviors. If you need to directly affect the body, prefer [_integrateForces] as it allows you to directly access the physics state. + * [RigidBody3D] implements full 3D physics. It cannot be controlled directly, instead, you must + * apply forces to it (gravity, impulses, etc.), and the physics simulation will calculate the + * resulting movement, rotation, react to collisions, and affect other physics bodies in its path. + * The body's behavior can be adjusted via [lockRotation], [freeze], and [freezeMode]. By changing + * various properties of the object, such as [mass], you can control how the physics simulation acts on + * it. + * A rigid body will always maintain its shape and size, even when forces are applied to it. It is + * useful for objects that can be interacted with in an environment, such as a tree that can be knocked + * over or a stack of crates that can be pushed around. + * If you need to override the default physics behavior, you can write a custom force integration + * function. See [customIntegrator]. + * **Note:** Changing the 3D transform or [linearVelocity] of a [RigidBody3D] very often may lead to + * some unpredictable behaviors. If you need to directly affect the body, prefer [_integrateForces] as + * it allows you to directly access the physics state. */ @GodotBaseType public open class RigidBody3D : PhysicsBody3D() { /** - * Emitted when one of this RigidBody3D's [godot.Shape3D]s collides with another [godot.PhysicsBody3D] or [godot.GridMap]'s [godot.Shape3D]s. Requires [contactMonitor] to be set to `true` and [maxContactsReported] to be set high enough to detect all the collisions. [godot.GridMap]s are detected if the [godot.MeshLibrary] has Collision [godot.Shape3D]s. - * - * [bodyRid] the [RID] of the other [godot.PhysicsBody3D] or [godot.MeshLibrary]'s [godot.CollisionObject3D] used by the [godot.PhysicsServer3D]. - * - * [body] the [godot.Node], if it exists in the tree, of the other [godot.PhysicsBody3D] or [godot.GridMap]. - * - * [bodyShapeIndex] the index of the [godot.Shape3D] of the other [godot.PhysicsBody3D] or [godot.GridMap] used by the [godot.PhysicsServer3D]. Get the [godot.CollisionShape3D] node with `body.shape_owner_get_owner(body.shape_find_owner(body_shape_index))`. - * - * [localShapeIndex] the index of the [godot.Shape3D] of this RigidBody3D used by the [godot.PhysicsServer3D]. Get the [godot.CollisionShape3D] node with `self.shape_owner_get_owner(self.shape_find_owner(local_shape_index))`. + * Emitted when one of this RigidBody3D's [Shape3D]s collides with another [PhysicsBody3D] or + * [GridMap]'s [Shape3D]s. Requires [contactMonitor] to be set to `true` and [maxContactsReported] to + * be set high enough to detect all the collisions. [GridMap]s are detected if the [MeshLibrary] has + * Collision [Shape3D]s. + * [param body_rid] the [RID] of the other [PhysicsBody3D] or [MeshLibrary]'s [CollisionObject3D] + * used by the [PhysicsServer3D]. + * [param body] the [Node], if it exists in the tree, of the other [PhysicsBody3D] or [GridMap]. + * [param body_shape_index] the index of the [Shape3D] of the other [PhysicsBody3D] or [GridMap] + * used by the [PhysicsServer3D]. Get the [CollisionShape3D] node with + * `body.shape_owner_get_owner(body.shape_find_owner(body_shape_index))`. + * [param local_shape_index] the index of the [Shape3D] of this RigidBody3D used by the + * [PhysicsServer3D]. Get the [CollisionShape3D] node with + * `self.shape_owner_get_owner(self.shape_find_owner(local_shape_index))`. */ public val bodyShapeEntered: Signal4 by signal("bodyRid", "body", "bodyShapeIndex", "localShapeIndex") /** - * Emitted when the collision between one of this RigidBody3D's [godot.Shape3D]s and another [godot.PhysicsBody3D] or [godot.GridMap]'s [godot.Shape3D]s ends. Requires [contactMonitor] to be set to `true` and [maxContactsReported] to be set high enough to detect all the collisions. [godot.GridMap]s are detected if the [godot.MeshLibrary] has Collision [godot.Shape3D]s. - * - * [bodyRid] the [RID] of the other [godot.PhysicsBody3D] or [godot.MeshLibrary]'s [godot.CollisionObject3D] used by the [godot.PhysicsServer3D]. [godot.GridMap]s are detected if the Meshes have [godot.Shape3D]s. - * - * [body] the [godot.Node], if it exists in the tree, of the other [godot.PhysicsBody3D] or [godot.GridMap]. - * - * [bodyShapeIndex] the index of the [godot.Shape3D] of the other [godot.PhysicsBody3D] or [godot.GridMap] used by the [godot.PhysicsServer3D]. Get the [godot.CollisionShape3D] node with `body.shape_owner_get_owner(body.shape_find_owner(body_shape_index))`. - * - * [localShapeIndex] the index of the [godot.Shape3D] of this RigidBody3D used by the [godot.PhysicsServer3D]. Get the [godot.CollisionShape3D] node with `self.shape_owner_get_owner(self.shape_find_owner(local_shape_index))`. + * Emitted when the collision between one of this RigidBody3D's [Shape3D]s and another + * [PhysicsBody3D] or [GridMap]'s [Shape3D]s ends. Requires [contactMonitor] to be set to `true` and + * [maxContactsReported] to be set high enough to detect all the collisions. [GridMap]s are detected + * if the [MeshLibrary] has Collision [Shape3D]s. + * [param body_rid] the [RID] of the other [PhysicsBody3D] or [MeshLibrary]'s [CollisionObject3D] + * used by the [PhysicsServer3D]. [GridMap]s are detected if the Meshes have [Shape3D]s. + * [param body] the [Node], if it exists in the tree, of the other [PhysicsBody3D] or [GridMap]. + * [param body_shape_index] the index of the [Shape3D] of the other [PhysicsBody3D] or [GridMap] + * used by the [PhysicsServer3D]. Get the [CollisionShape3D] node with + * `body.shape_owner_get_owner(body.shape_find_owner(body_shape_index))`. + * [param local_shape_index] the index of the [Shape3D] of this RigidBody3D used by the + * [PhysicsServer3D]. Get the [CollisionShape3D] node with + * `self.shape_owner_get_owner(self.shape_find_owner(local_shape_index))`. */ public val bodyShapeExited: Signal4 by signal("bodyRid", "body", "bodyShapeIndex", "localShapeIndex") /** - * Emitted when a collision with another [godot.PhysicsBody3D] or [godot.GridMap] occurs. Requires [contactMonitor] to be set to `true` and [maxContactsReported] to be set high enough to detect all the collisions. [godot.GridMap]s are detected if the [godot.MeshLibrary] has Collision [godot.Shape3D]s. - * - * [body] the [godot.Node], if it exists in the tree, of the other [godot.PhysicsBody3D] or [godot.GridMap]. + * Emitted when a collision with another [PhysicsBody3D] or [GridMap] occurs. Requires + * [contactMonitor] to be set to `true` and [maxContactsReported] to be set high enough to detect all + * the collisions. [GridMap]s are detected if the [MeshLibrary] has Collision [Shape3D]s. + * [param body] the [Node], if it exists in the tree, of the other [PhysicsBody3D] or [GridMap]. */ public val bodyEntered: Signal1 by signal("body") /** - * Emitted when the collision with another [godot.PhysicsBody3D] or [godot.GridMap] ends. Requires [contactMonitor] to be set to `true` and [maxContactsReported] to be set high enough to detect all the collisions. [godot.GridMap]s are detected if the [godot.MeshLibrary] has Collision [godot.Shape3D]s. - * - * [body] the [godot.Node], if it exists in the tree, of the other [godot.PhysicsBody3D] or [godot.GridMap]. + * Emitted when the collision with another [PhysicsBody3D] or [GridMap] ends. Requires + * [contactMonitor] to be set to `true` and [maxContactsReported] to be set high enough to detect all + * the collisions. [GridMap]s are detected if the [MeshLibrary] has Collision [Shape3D]s. + * [param body] the [Node], if it exists in the tree, of the other [PhysicsBody3D] or [GridMap]. */ public val bodyExited: Signal1 by signal("body") /** * Emitted when the physics engine changes the body's sleeping state. - * - * **Note:** Changing the value [sleeping] will not trigger this signal. It is only emitted if the sleeping state is changed by the physics engine or `emit_signal("sleeping_state_changed")` is used. + * **Note:** Changing the value [sleeping] will not trigger this signal. It is only emitted if the + * sleeping state is changed by the physics engine or `emit_signal("sleeping_state_changed")` is + * used. */ public val sleepingStateChanged: Signal0 by signal() @@ -120,8 +131,8 @@ public open class RigidBody3D : PhysicsBody3D() { /** * The physics material override for the body. - * - * If a material is assigned to this property, it will be used instead of any other physics material, such as an inherited one. + * If a material is assigned to this property, it will be used instead of any other physics + * material, such as an inherited one. */ public var physicsMaterialOverride: PhysicsMaterial? get() { @@ -135,7 +146,9 @@ public open class RigidBody3D : PhysicsBody3D() { } /** - * This is multiplied by the global 3D gravity setting found in **Project > Project Settings > Physics > 3d** to produce RigidBody3D's gravity. For example, a value of 1 will be normal gravity, 2 will apply double gravity, and 0.5 will apply half gravity to this object. + * This is multiplied by the global 3D gravity setting found in **Project > Project Settings > + * Physics > 3d** to produce RigidBody3D's gravity. For example, a value of 1 will be normal gravity, + * 2 will apply double gravity, and 0.5 will apply half gravity to this object. */ public var gravityScale: Float get() { @@ -149,7 +162,8 @@ public open class RigidBody3D : PhysicsBody3D() { } /** - * Defines the way the body's center of mass is set. See [enum CenterOfMassMode] for possible values. + * Defines the way the body's center of mass is set. See [enum CenterOfMassMode] for possible + * values. */ public var centerOfMassMode: CenterOfMassMode get() { @@ -163,9 +177,12 @@ public open class RigidBody3D : PhysicsBody3D() { } /** - * The body's custom center of mass, relative to the body's origin position, when [centerOfMassMode] is set to [CENTER_OF_MASS_MODE_CUSTOM]. This is the balanced point of the body, where applied forces only cause linear acceleration. Applying forces outside of the center of mass causes angular acceleration. - * - * When [centerOfMassMode] is set to [CENTER_OF_MASS_MODE_AUTO] (default value), the center of mass is automatically computed. + * The body's custom center of mass, relative to the body's origin position, when + * [centerOfMassMode] is set to [constant CENTER_OF_MASS_MODE_CUSTOM]. This is the balanced point of + * the body, where applied forces only cause linear acceleration. Applying forces outside of the + * center of mass causes angular acceleration. + * When [centerOfMassMode] is set to [constant CENTER_OF_MASS_MODE_AUTO] (default value), the + * center of mass is automatically computed. */ @CoreTypeLocalCopy public var centerOfMass: Vector3 @@ -180,53 +197,34 @@ public open class RigidBody3D : PhysicsBody3D() { } /** - * The body's moment of inertia. This is like mass, but for rotation: it determines how much torque it takes to rotate the body on each axis. The moment of inertia is usually computed automatically from the mass and the shapes, but this property allows you to set a custom value. - * - * If set to [godot.Vector3.ZERO], inertia is automatically computed (default value). - * - * **Note:** This value does not change when inertia is automatically computed. Use [godot.PhysicsServer3D] to get the computed inertia. - * - * [codeblocks] - * - * [gdscript] - * + * The body's moment of inertia. This is like mass, but for rotation: it determines how much + * torque it takes to rotate the body on each axis. The moment of inertia is usually computed + * automatically from the mass and the shapes, but this property allows you to set a custom value. + * If set to [constant Vector3.ZERO], inertia is automatically computed (default value). + * **Note:** This value does not change when inertia is automatically computed. Use + * [PhysicsServer3D] to get the computed inertia. + * + * gdscript: + * ```gdscript * @onready var ball = $Ball * - * - * * func get_ball_inertia(): - * * return PhysicsServer3D.body_get_direct_state(ball.get_rid()).inverse_inertia.inverse() - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * private RigidBody3D _ball; * - * - * * public override void _Ready() - * * { - * * _ball = GetNode("Ball"); - * * } * - * - * * private Vector3 GetBallInertia() - * * { - * * return PhysicsServer3D.BodyGetDirectState(_ball.GetRid()).InverseInertia.Inverse(); - * * } - * - * [/csharp] - * - * [/codeblocks] + * ``` */ @CoreTypeLocalCopy public var inertia: Vector3 @@ -241,7 +239,8 @@ public open class RigidBody3D : PhysicsBody3D() { } /** - * If `true`, the body will not move and will not calculate forces until woken up by another body through, for example, a collision, or by using the [applyImpulse] or [applyForce] methods. + * If `true`, the body will not move and will not calculate forces until woken up by another body + * through, for example, a collision, or by using the [applyImpulse] or [applyForce] methods. */ public var sleeping: Boolean get() { @@ -284,10 +283,8 @@ public open class RigidBody3D : PhysicsBody3D() { /** * If `true`, the body is frozen. Gravity and forces are not applied anymore. - * * See [freezeMode] to set the body's behavior when frozen. - * - * For a body that is always frozen, use [godot.StaticBody3D] or [godot.AnimatableBody3D] instead. + * For a body that is always frozen, use [StaticBody3D] or [AnimatableBody3D] instead. */ public var freeze: Boolean get() { @@ -301,9 +298,9 @@ public open class RigidBody3D : PhysicsBody3D() { } /** - * The body's freeze mode. Can be used to set the body's behavior when [freeze] is enabled. See [enum FreezeMode] for possible values. - * - * For a body that is always frozen, use [godot.StaticBody3D] or [godot.AnimatableBody3D] instead. + * The body's freeze mode. Can be used to set the body's behavior when [freeze] is enabled. See + * [enum FreezeMode] for possible values. + * For a body that is always frozen, use [StaticBody3D] or [AnimatableBody3D] instead. */ public var freezeMode: FreezeMode get() { @@ -317,7 +314,9 @@ public open class RigidBody3D : PhysicsBody3D() { } /** - * If `true`, internal force integration will be disabled (like gravity or air friction) for this body. Other than collision response, the body will only move as determined by the [_integrateForces] function, if defined. + * If `true`, internal force integration will be disabled (like gravity or air friction) for this + * body. Other than collision response, the body will only move as determined by the + * [_integrateForces] function, if defined. */ public var customIntegrator: Boolean get() { @@ -332,8 +331,10 @@ public open class RigidBody3D : PhysicsBody3D() { /** * If `true`, continuous collision detection is used. - * - * Continuous collision detection tries to predict where a moving body will collide, instead of moving it and correcting its movement if it collided. Continuous collision detection is more precise, and misses fewer impacts by small, fast-moving objects. Not using continuous collision detection is faster to compute, but can miss small, fast-moving objects. + * Continuous collision detection tries to predict where a moving body will collide, instead of + * moving it and correcting its movement if it collided. Continuous collision detection is more + * precise, and misses fewer impacts by small, fast-moving objects. Not using continuous collision + * detection is faster to compute, but can miss small, fast-moving objects. */ public var continuousCd: Boolean get() { @@ -348,9 +349,12 @@ public open class RigidBody3D : PhysicsBody3D() { } /** - * The maximum number of contacts that will be recorded. Requires a value greater than 0 and [contactMonitor] to be set to `true` to start to register contacts. Use [getContactCount] to retrieve the count or [getCollidingBodies] to retrieve bodies that have been collided with. - * - * **Note:** The number of contacts is different from the number of collisions. Collisions between parallel edges will result in two contacts (one at each end), and collisions between parallel faces will result in four contacts (one at each corner). + * The maximum number of contacts that will be recorded. Requires a value greater than 0 and + * [contactMonitor] to be set to `true` to start to register contacts. Use [getContactCount] to + * retrieve the count or [getCollidingBodies] to retrieve bodies that have been collided with. + * **Note:** The number of contacts is different from the number of collisions. Collisions between + * parallel edges will result in two contacts (one at each end), and collisions between parallel + * faces will result in four contacts (one at each corner). */ public var maxContactsReported: Int get() { @@ -365,8 +369,8 @@ public open class RigidBody3D : PhysicsBody3D() { /** * If `true`, the RigidBody3D will emit signals when it collides with another body. - * - * **Note:** By default the maximum contacts reported is set to 0, meaning nothing will be recorded, see [maxContactsReported]. + * **Note:** By default the maximum contacts reported is set to 0, meaning nothing will be + * recorded, see [maxContactsReported]. */ public var contactMonitor: Boolean get() { @@ -380,7 +384,9 @@ public open class RigidBody3D : PhysicsBody3D() { } /** - * The body's linear velocity in units per second. Can be used sporadically, but **don't set this every frame**, because physics may run in another thread and runs at a different granularity. Use [_integrateForces] as your process loop for precise control of the body state. + * The body's linear velocity in units per second. Can be used sporadically, but **don't set this + * every frame**, because physics may run in another thread and runs at a different granularity. Use + * [_integrateForces] as your process loop for precise control of the body state. */ @CoreTypeLocalCopy public var linearVelocity: Vector3 @@ -409,9 +415,11 @@ public open class RigidBody3D : PhysicsBody3D() { } /** - * Damps the body's movement. By default, the body will use the **Default Linear Damp** in **Project > Project Settings > Physics > 3d** or any value override set by an [godot.Area3D] the body is in. Depending on [linearDampMode], you can set [linearDamp] to be added to or to replace the body's damping value. - * - * See [godot.ProjectSettings.physics/3d/defaultLinearDamp] for more details about damping. + * Damps the body's movement. By default, the body will use the **Default Linear Damp** in + * **Project > Project Settings > Physics > 3d** or any value override set by an [Area3D] the body is + * in. Depending on [linearDampMode], you can set [linearDamp] to be added to or to replace the + * body's damping value. + * See [ProjectSettings.physics/3d/defaultLinearDamp] for more details about damping. */ public var linearDamp: Float get() { @@ -454,9 +462,11 @@ public open class RigidBody3D : PhysicsBody3D() { } /** - * Damps the body's rotation. By default, the body will use the **Default Angular Damp** in **Project > Project Settings > Physics > 3d** or any value override set by an [godot.Area3D] the body is in. Depending on [angularDampMode], you can set [angularDamp] to be added to or to replace the body's damping value. - * - * See [godot.ProjectSettings.physics/3d/defaultAngularDamp] for more details about damping. + * Damps the body's rotation. By default, the body will use the **Default Angular Damp** in + * **Project > Project Settings > Physics > 3d** or any value override set by an [Area3D] the body is + * in. Depending on [angularDampMode], you can set [angularDamp] to be added to or to replace the + * body's damping value. + * See [ProjectSettings.physics/3d/defaultAngularDamp] for more details about damping. */ public var angularDamp: Float get() { @@ -471,7 +481,6 @@ public open class RigidBody3D : PhysicsBody3D() { /** * The body's total constant positional forces applied during each physics update. - * * See [addConstantForce] and [addConstantCentralForce]. */ @CoreTypeLocalCopy @@ -488,7 +497,6 @@ public open class RigidBody3D : PhysicsBody3D() { /** * The body's total constant rotational forces applied during each physics update. - * * See [addConstantTorque]. */ @CoreTypeLocalCopy @@ -509,9 +517,12 @@ public open class RigidBody3D : PhysicsBody3D() { } /** - * The body's custom center of mass, relative to the body's origin position, when [centerOfMassMode] is set to [CENTER_OF_MASS_MODE_CUSTOM]. This is the balanced point of the body, where applied forces only cause linear acceleration. Applying forces outside of the center of mass causes angular acceleration. - * - * When [centerOfMassMode] is set to [CENTER_OF_MASS_MODE_AUTO] (default value), the center of mass is automatically computed. + * The body's custom center of mass, relative to the body's origin position, when + * [centerOfMassMode] is set to [constant CENTER_OF_MASS_MODE_CUSTOM]. This is the balanced point of + * the body, where applied forces only cause linear acceleration. Applying forces outside of the + * center of mass causes angular acceleration. + * When [centerOfMassMode] is set to [constant CENTER_OF_MASS_MODE_AUTO] (default value), the + * center of mass is automatically computed. * * This is a helper function to make dealing with local copies easier. * @@ -535,53 +546,35 @@ public open class RigidBody3D : PhysicsBody3D() { /** - * The body's moment of inertia. This is like mass, but for rotation: it determines how much torque it takes to rotate the body on each axis. The moment of inertia is usually computed automatically from the mass and the shapes, but this property allows you to set a custom value. - * - * If set to [godot.Vector3.ZERO], inertia is automatically computed (default value). - * - * **Note:** This value does not change when inertia is automatically computed. Use [godot.PhysicsServer3D] to get the computed inertia. - * - * [codeblocks] - * - * [gdscript] - * + * The body's moment of inertia. This is like mass, but for rotation: it determines how much + * torque it takes to rotate the body on each axis. The moment of inertia is usually computed + * automatically from the mass and the shapes, but this property allows you to set a custom value. + * If set to [constant Vector3.ZERO], inertia is automatically computed (default value). + * **Note:** This value does not change when inertia is automatically computed. Use + * [PhysicsServer3D] to get the computed inertia. + * + * gdscript: + * ```gdscript * @onready var ball = $Ball * - * - * * func get_ball_inertia(): - * * return PhysicsServer3D.body_get_direct_state(ball.get_rid()).inverse_inertia.inverse() - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * private RigidBody3D _ball; * - * - * * public override void _Ready() - * * { - * * _ball = GetNode("Ball"); - * * } * - * - * * private Vector3 GetBallInertia() - * * { - * * return PhysicsServer3D.BodyGetDirectState(_ball.GetRid()).InverseInertia.Inverse(); - * * } + * ``` * - * [/csharp] - * - * [/codeblocks] * * This is a helper function to make dealing with local copies easier. * @@ -605,7 +598,9 @@ public open class RigidBody3D : PhysicsBody3D() { /** - * The body's linear velocity in units per second. Can be used sporadically, but **don't set this every frame**, because physics may run in another thread and runs at a different granularity. Use [_integrateForces] as your process loop for precise control of the body state. + * The body's linear velocity in units per second. Can be used sporadically, but **don't set this + * every frame**, because physics may run in another thread and runs at a different granularity. Use + * [_integrateForces] as your process loop for precise control of the body state. * * This is a helper function to make dealing with local copies easier. * @@ -654,7 +649,6 @@ public open class RigidBody3D : PhysicsBody3D() { /** * The body's total constant positional forces applied during each physics update. - * * See [addConstantForce] and [addConstantCentralForce]. * * This is a helper function to make dealing with local copies easier. @@ -680,7 +674,6 @@ public open class RigidBody3D : PhysicsBody3D() { /** * The body's total constant rotational forces applied during each physics update. - * * See [addConstantTorque]. * * This is a helper function to make dealing with local copies easier. @@ -705,13 +698,17 @@ public open class RigidBody3D : PhysicsBody3D() { /** - * Called during physics processing, allowing you to read and safely modify the simulation state for the object. By default, it works in addition to the usual physics behavior, but the [customIntegrator] property allows you to disable the default behavior and do fully custom force integration for a body. + * Called during physics processing, allowing you to read and safely modify the simulation state + * for the object. By default, it works in addition to the usual physics behavior, but the + * [customIntegrator] property allows you to disable the default behavior and do fully custom force + * integration for a body. */ public open fun _integrateForces(state: PhysicsDirectBodyState3D): Unit { } /** - * Returns the inverse inertia tensor basis. This is used to calculate the angular acceleration resulting from a torque applied to the [godot.RigidBody3D]. + * Returns the inverse inertia tensor basis. This is used to calculate the angular acceleration + * resulting from a torque applied to the [RigidBody3D]. */ public fun getInverseInertiaTensor(): Basis { TransferContext.writeArguments() @@ -720,8 +717,8 @@ public open class RigidBody3D : PhysicsBody3D() { } /** - * Returns the number of contacts this body has with other bodies. By default, this returns 0 unless bodies are configured to monitor contacts (see [contactMonitor]). - * + * Returns the number of contacts this body has with other bodies. By default, this returns 0 + * unless bodies are configured to monitor contacts (see [contactMonitor]). * **Note:** To retrieve the colliding bodies, use [getCollidingBodies]. */ public fun getContactCount(): Int { @@ -731,7 +728,8 @@ public open class RigidBody3D : PhysicsBody3D() { } /** - * Sets an axis velocity. The velocity in the given vector axis will be set as the given vector length. This is useful for jumping behavior. + * Sets an axis velocity. The velocity in the given vector axis will be set as the given vector + * length. This is useful for jumping behavior. */ public fun setAxisVelocity(axisVelocity: Vector3): Unit { TransferContext.writeArguments(VECTOR3 to axisVelocity) @@ -740,9 +738,9 @@ public open class RigidBody3D : PhysicsBody3D() { /** * Applies a directional impulse without affecting rotation. - * - * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). - * + * An impulse is time-independent! Applying an impulse every frame would result in a + * framerate-dependent force. For this reason, it should only be used when simulating one-time + * impacts (use the "_force" functions otherwise). * This is equivalent to using [applyImpulse] at the body's center of mass. */ public fun applyCentralImpulse(impulse: Vector3): Unit { @@ -752,10 +750,10 @@ public open class RigidBody3D : PhysicsBody3D() { /** * Applies a positioned impulse to the body. - * - * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). - * - * [position] is the offset from the body origin in global coordinates. + * An impulse is time-independent! Applying an impulse every frame would result in a + * framerate-dependent force. For this reason, it should only be used when simulating one-time + * impacts (use the "_force" functions otherwise). + * [param position] is the offset from the body origin in global coordinates. */ @JvmOverloads public fun applyImpulse(impulse: Vector3, position: Vector3 = Vector3(0, 0, 0)): Unit { @@ -765,10 +763,11 @@ public open class RigidBody3D : PhysicsBody3D() { /** * Applies a rotational impulse to the body without affecting the position. - * - * An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). - * - * **Note:** [inertia] is required for this to work. To have [inertia], an active [godot.CollisionShape3D] must be a child of the node, or you can manually set [inertia]. + * An impulse is time-independent! Applying an impulse every frame would result in a + * framerate-dependent force. For this reason, it should only be used when simulating one-time + * impacts (use the "_force" functions otherwise). + * **Note:** [inertia] is required for this to work. To have [inertia], an active + * [CollisionShape3D] must be a child of the node, or you can manually set [inertia]. */ public fun applyTorqueImpulse(impulse: Vector3): Unit { TransferContext.writeArguments(VECTOR3 to impulse) @@ -776,8 +775,8 @@ public open class RigidBody3D : PhysicsBody3D() { } /** - * Applies a directional force without affecting rotation. A force is time dependent and meant to be applied every physics update. - * + * Applies a directional force without affecting rotation. A force is time dependent and meant to + * be applied every physics update. * This is equivalent to using [applyForce] at the body's center of mass. */ public fun applyCentralForce(force: Vector3): Unit { @@ -786,9 +785,9 @@ public open class RigidBody3D : PhysicsBody3D() { } /** - * Applies a positioned force to the body. A force is time dependent and meant to be applied every physics update. - * - * [position] is the offset from the body origin in global coordinates. + * Applies a positioned force to the body. A force is time dependent and meant to be applied every + * physics update. + * [param position] is the offset from the body origin in global coordinates. */ @JvmOverloads public fun applyForce(force: Vector3, position: Vector3 = Vector3(0, 0, 0)): Unit { @@ -797,9 +796,10 @@ public open class RigidBody3D : PhysicsBody3D() { } /** - * Applies a rotational force without affecting position. A force is time dependent and meant to be applied every physics update. - * - * **Note:** [inertia] is required for this to work. To have [inertia], an active [godot.CollisionShape3D] must be a child of the node, or you can manually set [inertia]. + * Applies a rotational force without affecting position. A force is time dependent and meant to + * be applied every physics update. + * **Note:** [inertia] is required for this to work. To have [inertia], an active + * [CollisionShape3D] must be a child of the node, or you can manually set [inertia]. */ public fun applyTorque(torque: Vector3): Unit { TransferContext.writeArguments(VECTOR3 to torque) @@ -807,8 +807,8 @@ public open class RigidBody3D : PhysicsBody3D() { } /** - * Adds a constant directional force without affecting rotation that keeps being applied over time until cleared with `constant_force = Vector3(0, 0, 0)`. - * + * Adds a constant directional force without affecting rotation that keeps being applied over time + * until cleared with `constant_force = Vector3(0, 0, 0)`. * This is equivalent to using [addConstantForce] at the body's center of mass. */ public fun addConstantCentralForce(force: Vector3): Unit { @@ -817,9 +817,9 @@ public open class RigidBody3D : PhysicsBody3D() { } /** - * Adds a constant positioned force to the body that keeps being applied over time until cleared with `constant_force = Vector3(0, 0, 0)`. - * - * [position] is the offset from the body origin in global coordinates. + * Adds a constant positioned force to the body that keeps being applied over time until cleared + * with `constant_force = Vector3(0, 0, 0)`. + * [param position] is the offset from the body origin in global coordinates. */ @JvmOverloads public fun addConstantForce(force: Vector3, position: Vector3 = Vector3(0, 0, 0)): Unit { @@ -828,7 +828,8 @@ public open class RigidBody3D : PhysicsBody3D() { } /** - * Adds a constant rotational force without affecting position that keeps being applied over time until cleared with `constant_torque = Vector3(0, 0, 0)`. + * Adds a constant rotational force without affecting position that keeps being applied over time + * until cleared with `constant_torque = Vector3(0, 0, 0)`. */ public fun addConstantTorque(torque: Vector3): Unit { TransferContext.writeArguments(VECTOR3 to torque) @@ -836,9 +837,11 @@ public open class RigidBody3D : PhysicsBody3D() { } /** - * Returns a list of the bodies colliding with this one. Requires [contactMonitor] to be set to `true` and [maxContactsReported] to be set high enough to detect all the collisions. - * - * **Note:** The result of this test is not immediate after moving objects. For performance, list of collisions is updated once per frame and before the physics step. Consider using signals instead. + * Returns a list of the bodies colliding with this one. Requires [contactMonitor] to be set to + * `true` and [maxContactsReported] to be set high enough to detect all the collisions. + * **Note:** The result of this test is not immediate after moving objects. For performance, list + * of collisions is updated once per frame and before the physics step. Consider using signals + * instead. */ public fun getCollidingBodies(): VariantArray { TransferContext.writeArguments() @@ -850,11 +853,13 @@ public open class RigidBody3D : PhysicsBody3D() { id: Long, ) { /** - * Static body freeze mode (default). The body is not affected by gravity and forces. It can be only moved by user code and doesn't collide with other bodies along its path. + * Static body freeze mode (default). The body is not affected by gravity and forces. It can be + * only moved by user code and doesn't collide with other bodies along its path. */ FREEZE_MODE_STATIC(0), /** - * Kinematic body freeze mode. Similar to [FREEZE_MODE_STATIC], but collides with other bodies along its path when moved. Useful for a frozen body that needs to be animated. + * Kinematic body freeze mode. Similar to [constant FREEZE_MODE_STATIC], but collides with other + * bodies along its path when moved. Useful for a frozen body that needs to be animated. */ FREEZE_MODE_KINEMATIC(1), ; @@ -873,11 +878,13 @@ public open class RigidBody3D : PhysicsBody3D() { id: Long, ) { /** - * In this mode, the body's center of mass is calculated automatically based on its shapes. This assumes that the shapes' origins are also their center of mass. + * In this mode, the body's center of mass is calculated automatically based on its shapes. This + * assumes that the shapes' origins are also their center of mass. */ CENTER_OF_MASS_MODE_AUTO(0), /** - * In this mode, the body's center of mass is set through [centerOfMass]. Defaults to the body's origin position. + * In this mode, the body's center of mass is set through [centerOfMass]. Defaults to the body's + * origin position. */ CENTER_OF_MASS_MODE_CUSTOM(1), ; @@ -896,7 +903,8 @@ public open class RigidBody3D : PhysicsBody3D() { id: Long, ) { /** - * In this mode, the body's damping value is added to any value set in areas or the default value. + * In this mode, the body's damping value is added to any value set in areas or the default + * value. */ DAMP_MODE_COMBINE(0), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/RootMotionView.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/RootMotionView.kt index ebd89122f..bef3c8ff8 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/RootMotionView.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/RootMotionView.kt @@ -27,19 +27,18 @@ import kotlin.Suppress import kotlin.Unit /** - * Editor-only helper for setting up root motion in [godot.AnimationMixer]. - * - * Tutorials: - * [$DOCS_URL/tutorials/animation/animation_tree.html#root-motion]($DOCS_URL/tutorials/animation/animation_tree.html#root-motion) - * - * *Root motion* refers to an animation technique where a mesh's skeleton is used to give impulse to a character. When working with 3D animations, a popular technique is for animators to use the root skeleton bone to give motion to the rest of the skeleton. This allows animating characters in a way where steps actually match the floor below. It also allows precise interaction with objects during cinematics. See also [godot.AnimationMixer]. - * - * **Note:** [godot.RootMotionView] is only visible in the editor. It will be hidden automatically in the running project. + * *Root motion* refers to an animation technique where a mesh's skeleton is used to give impulse to + * a character. When working with 3D animations, a popular technique is for animators to use the root + * skeleton bone to give motion to the rest of the skeleton. This allows animating characters in a way + * where steps actually match the floor below. It also allows precise interaction with objects during + * cinematics. See also [AnimationMixer]. + * **Note:** [RootMotionView] is only visible in the editor. It will be hidden automatically in the + * running project. */ @GodotBaseType public open class RootMotionView : VisualInstance3D() { /** - * Path to an [godot.AnimationMixer] node to use as a basis for root motion. + * Path to an [AnimationMixer] node to use as a basis for root motion. */ public var animationPath: NodePath get() { @@ -82,7 +81,8 @@ public open class RootMotionView : VisualInstance3D() { } /** - * The grid's radius in 3D units. The grid's opacity will fade gradually as the distance from the origin increases until this [radius] is reached. + * The grid's radius in 3D units. The grid's opacity will fade gradually as the distance from the + * origin increases until this [radius] is reached. */ public var radius: Float get() { @@ -96,7 +96,8 @@ public open class RootMotionView : VisualInstance3D() { } /** - * If `true`, the grid's points will all be on the same Y coordinate (*local* Y = 0). If `false`, the points' original Y coordinate is preserved. + * If `true`, the grid's points will all be on the same Y coordinate (*local* Y = 0). If `false`, + * the points' original Y coordinate is preserved. */ public var zeroY: Boolean get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/SceneMultiplayer.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/SceneMultiplayer.kt index 30ca2c18d..6082a0145 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/SceneMultiplayer.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/SceneMultiplayer.kt @@ -34,14 +34,49 @@ import kotlin.Suppress import kotlin.Unit import kotlin.jvm.JvmOverloads +/** + * This class is the default implementation of [MultiplayerAPI], used to provide multiplayer + * functionalities in Godot Engine. + * This implementation supports RPCs via [Node.rpc] and [Node.rpcId] and requires + * [MultiplayerAPI.rpc] to be passed a [Node] (it will fail for other object types). + * This implementation additionally provide [SceneTree] replication via the [MultiplayerSpawner] and + * [MultiplayerSynchronizer] nodes, and the [SceneReplicationConfig] resource. + * **Note:** The high-level multiplayer API protocol is an implementation detail and isn't meant to + * be used by non-Godot servers. It may change without notice. + * **Note:** When exporting to Android, make sure to enable the `INTERNET` permission in the Android + * export preset before exporting the project or using one-click deploy. Otherwise, network + * communication of any kind will be blocked by Android. + */ @GodotBaseType public open class SceneMultiplayer : MultiplayerAPI() { + /** + * Emitted when this MultiplayerAPI's [MultiplayerAPI.multiplayerPeer] connects to a new peer and + * a valid [authCallback] is set. In this case, the [signal MultiplayerAPI.peer_connected] will not + * be emitted until [completeAuth] is called with given peer [param id]. While in this state, the + * peer will not be included in the list returned by [MultiplayerAPI.getPeers] (but in the one + * returned by [getAuthenticatingPeers]), and only authentication data will be sent or received. See + * [sendAuth] for sending authentication data. + */ public val peerAuthenticating: Signal1 by signal("id") + /** + * Emitted when this MultiplayerAPI's [MultiplayerAPI.multiplayerPeer] disconnects from a peer for + * which authentication had not yet completed. See [signal peer_authenticating]. + */ public val peerAuthenticationFailed: Signal1 by signal("id") + /** + * Emitted when this MultiplayerAPI's [MultiplayerAPI.multiplayerPeer] receives a [param packet] + * with custom data (see [sendBytes]). ID is the peer ID of the peer that sent the packet. + */ public val peerPacket: Signal2 by signal("id", "packet") + /** + * The root path to use for RPCs and replication. Instead of an absolute path, a relative path + * will be used to find the node upon which the RPC should be executed. + * This effectively allows to have different branches of the scene tree to be managed by different + * MultiplayerAPI, allowing for example to run both client and server in the same scene. + */ public var rootPath: NodePath get() { TransferContext.writeArguments() @@ -53,6 +88,10 @@ public open class SceneMultiplayer : MultiplayerAPI() { TransferContext.callMethod(rawPtr, MethodBindings.setRootPathPtr, NIL) } + /** + * The callback to execute when when receiving authentication data sent via [sendAuth]. If the + * [Callable] is empty (default), peers will be automatically accepted as soon as they connect. + */ public var authCallback: Callable get() { TransferContext.writeArguments() @@ -64,6 +103,11 @@ public open class SceneMultiplayer : MultiplayerAPI() { TransferContext.callMethod(rawPtr, MethodBindings.setAuthCallbackPtr, NIL) } + /** + * If set to a value greater than `0.0`, the maximum amount of time peers can stay in the + * authenticating state, after which the authentication will automatically fail. See the [signal + * peer_authenticating] and [signal peer_authentication_failed] signals. + */ public var authTimeout: Double get() { TransferContext.writeArguments() @@ -75,6 +119,12 @@ public open class SceneMultiplayer : MultiplayerAPI() { TransferContext.callMethod(rawPtr, MethodBindings.setAuthTimeoutPtr, NIL) } + /** + * If `true`, the MultiplayerAPI will allow encoding and decoding of object during RPCs. + * **Warning:** Deserialized objects can contain code which gets executed. Do not use this option + * if the serialized object comes from untrusted sources to avoid potential security threat such as + * remote code execution. + */ public var allowObjectDecoding: Boolean get() { TransferContext.writeArguments() @@ -86,6 +136,10 @@ public open class SceneMultiplayer : MultiplayerAPI() { TransferContext.callMethod(rawPtr, MethodBindings.setAllowObjectDecodingPtr, NIL) } + /** + * If `true`, the MultiplayerAPI's [MultiplayerAPI.multiplayerPeer] refuses new incoming + * connections. + */ public var refuseNewConnections: Boolean get() { TransferContext.writeArguments() @@ -97,6 +151,16 @@ public open class SceneMultiplayer : MultiplayerAPI() { TransferContext.callMethod(rawPtr, MethodBindings.setRefuseNewConnectionsPtr, NIL) } + /** + * Enable or disable the server feature that notifies clients of other peers' + * connection/disconnection, and relays messages between them. When this option is `false`, clients + * won't be automatically notified of other peers and won't be able to send them packets through the + * server. + * **Note:** Changing this option while other peers are connected may lead to unexpected + * behaviors. + * **Note:** Support for this feature may depend on the current [MultiplayerPeer] configuration. + * See [MultiplayerPeer.isServerRelaySupported]. + */ public var serverRelay: Boolean get() { TransferContext.writeArguments() @@ -108,6 +172,10 @@ public open class SceneMultiplayer : MultiplayerAPI() { TransferContext.callMethod(rawPtr, MethodBindings.setServerRelayEnabledPtr, NIL) } + /** + * Maximum size of each synchronization packet. Higher values increase the chance of receiving + * full updates in a single frame, but also the chance of packet loss. See [MultiplayerSynchronizer]. + */ public var maxSyncPacketSize: Int get() { TransferContext.writeArguments() @@ -119,6 +187,11 @@ public open class SceneMultiplayer : MultiplayerAPI() { TransferContext.callMethod(rawPtr, MethodBindings.setMaxSyncPacketSizePtr, NIL) } + /** + * Maximum size of each delta packet. Higher values increase the chance of receiving full updates + * in a single frame, but also the chance of causing networking congestion (higher latency, + * disconnections). See [MultiplayerSynchronizer]. + */ public var maxDeltaPacketSize: Int get() { TransferContext.writeArguments() @@ -135,16 +208,27 @@ public open class SceneMultiplayer : MultiplayerAPI() { return true } + /** + * Clears the current SceneMultiplayer network state (you shouldn't call this unless you know what + * you are doing). + */ public fun clear(): Unit { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.clearPtr, NIL) } + /** + * Disconnects the peer identified by [param id], removing it from the list of connected peers, + * and closing the underlying connection with it. + */ public fun disconnectPeer(id: Int): Unit { TransferContext.writeArguments(LONG to id.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.disconnectPeerPtr, NIL) } + /** + * Returns the IDs of the peers currently trying to authenticate with this [MultiplayerAPI]. + */ public fun getAuthenticatingPeers(): PackedInt32Array { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getAuthenticatingPeersPtr, @@ -152,18 +236,38 @@ public open class SceneMultiplayer : MultiplayerAPI() { return (TransferContext.readReturnValue(PACKED_INT_32_ARRAY, false) as PackedInt32Array) } + /** + * Sends the specified [param data] to the remote peer identified by [param id] as part of an + * authentication message. This can be used to authenticate peers, and control when [signal + * MultiplayerAPI.peer_connected] is emitted (and the remote peer accepted as one of the connected + * peers). + */ public fun sendAuth(id: Int, `data`: PackedByteArray): GodotError { TransferContext.writeArguments(LONG to id.toLong(), PACKED_BYTE_ARRAY to data) TransferContext.callMethod(rawPtr, MethodBindings.sendAuthPtr, LONG) return GodotError.from(TransferContext.readReturnValue(LONG) as Long) } + /** + * Mark the authentication step as completed for the remote peer identified by [param id]. The + * [signal MultiplayerAPI.peer_connected] signal will be emitted for this peer once the remote side + * also completes the authentication. No further authentication messages are expected to be received + * from this peer. + * If a peer disconnects before completing authentication, either due to a network issue, the + * [authTimeout] expiring, or manually calling [disconnectPeer], the [signal + * peer_authentication_failed] signal will be emitted instead of [signal + * MultiplayerAPI.peer_disconnected]. + */ public fun completeAuth(id: Int): GodotError { TransferContext.writeArguments(LONG to id.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.completeAuthPtr, LONG) return GodotError.from(TransferContext.readReturnValue(LONG) as Long) } + /** + * Sends the given raw [param bytes] to a specific peer identified by [param id] (see + * [MultiplayerPeer.setTargetPeer]). Default ID is `0`, i.e. broadcast to all peers. + */ @JvmOverloads public fun sendBytes( bytes: PackedByteArray, diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/SceneState.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/SceneState.kt index e8f2a2d34..e40a24f61 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/SceneState.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/SceneState.kt @@ -32,11 +32,11 @@ import kotlin.Suppress import kotlin.jvm.JvmOverloads /** - * Provides access to a scene file's information. - * - * Maintains a list of resources, nodes, exported and overridden properties, and built-in scripts associated with a scene. They cannot be modified from a [godot.SceneState], only accessed. Useful for peeking into what a [godot.PackedScene] contains without instantiating it. - * - * This class cannot be instantiated directly, it is retrieved for a given scene as the result of [godot.PackedScene.getState]. + * Maintains a list of resources, nodes, exported and overridden properties, and built-in scripts + * associated with a scene. They cannot be modified from a [SceneState], only accessed. Useful for + * peeking into what a [PackedScene] contains without instantiating it. + * This class cannot be instantiated directly, it is retrieved for a given scene as the result of + * [PackedScene.getState]. */ @GodotBaseType public open class SceneState internal constructor() : RefCounted() { @@ -47,8 +47,8 @@ public open class SceneState internal constructor() : RefCounted() { /** * Returns the number of nodes in the scene. - * - * The `idx` argument used to query node data in other `get_node_*` methods in the interval `[0, get_node_count() - 1]`. + * The `idx` argument used to query node data in other `get_node_*` methods in the interval `[0, + * get_node_count() - 1]`. */ public fun getNodeCount(): Int { TransferContext.writeArguments() @@ -57,7 +57,7 @@ public open class SceneState internal constructor() : RefCounted() { } /** - * Returns the type of the node at [idx]. + * Returns the type of the node at [param idx]. */ public fun getNodeType(idx: Int): StringName { TransferContext.writeArguments(LONG to idx.toLong()) @@ -66,7 +66,7 @@ public open class SceneState internal constructor() : RefCounted() { } /** - * Returns the name of the node at [idx]. + * Returns the name of the node at [param idx]. */ public fun getNodeName(idx: Int): StringName { TransferContext.writeArguments(LONG to idx.toLong()) @@ -75,9 +75,8 @@ public open class SceneState internal constructor() : RefCounted() { } /** - * Returns the path to the node at [idx]. - * - * If [forParent] is `true`, returns the path of the [idx] node's parent instead. + * Returns the path to the node at [param idx]. + * If [param for_parent] is `true`, returns the path of the [param idx] node's parent instead. */ @JvmOverloads public fun getNodePath(idx: Int, forParent: Boolean = false): NodePath { @@ -87,7 +86,7 @@ public open class SceneState internal constructor() : RefCounted() { } /** - * Returns the path to the owner of the node at [idx], relative to the root node. + * Returns the path to the owner of the node at [param idx], relative to the root node. */ public fun getNodeOwnerPath(idx: Int): NodePath { TransferContext.writeArguments(LONG to idx.toLong()) @@ -96,7 +95,7 @@ public open class SceneState internal constructor() : RefCounted() { } /** - * Returns `true` if the node at [idx] is an [godot.InstancePlaceholder]. + * Returns `true` if the node at [param idx] is an [InstancePlaceholder]. */ public fun isNodeInstancePlaceholder(idx: Int): Boolean { TransferContext.writeArguments(LONG to idx.toLong()) @@ -105,7 +104,8 @@ public open class SceneState internal constructor() : RefCounted() { } /** - * Returns the path to the represented scene file if the node at [idx] is an [godot.InstancePlaceholder]. + * Returns the path to the represented scene file if the node at [param idx] is an + * [InstancePlaceholder]. */ public fun getNodeInstancePlaceholder(idx: Int): String { TransferContext.writeArguments(LONG to idx.toLong()) @@ -114,7 +114,8 @@ public open class SceneState internal constructor() : RefCounted() { } /** - * Returns a [godot.PackedScene] for the node at [idx] (i.e. the whole branch starting at this node, with its child nodes and resources), or `null` if the node is not an instance. + * Returns a [PackedScene] for the node at [param idx] (i.e. the whole branch starting at this + * node, with its child nodes and resources), or `null` if the node is not an instance. */ public fun getNodeInstance(idx: Int): PackedScene? { TransferContext.writeArguments(LONG to idx.toLong()) @@ -123,7 +124,7 @@ public open class SceneState internal constructor() : RefCounted() { } /** - * Returns the list of group names associated with the node at [idx]. + * Returns the list of group names associated with the node at [param idx]. */ public fun getNodeGroups(idx: Int): PackedStringArray { TransferContext.writeArguments(LONG to idx.toLong()) @@ -132,7 +133,10 @@ public open class SceneState internal constructor() : RefCounted() { } /** - * Returns the node's index, which is its position relative to its siblings. This is only relevant and saved in scenes for cases where new nodes are added to an instantiated or inherited scene among siblings from the base scene. Despite the name, this index is not related to the [idx] argument used here and in other methods. + * Returns the node's index, which is its position relative to its siblings. This is only relevant + * and saved in scenes for cases where new nodes are added to an instantiated or inherited scene + * among siblings from the base scene. Despite the name, this index is not related to the [param idx] + * argument used here and in other methods. */ public fun getNodeIndex(idx: Int): Int { TransferContext.writeArguments(LONG to idx.toLong()) @@ -141,9 +145,9 @@ public open class SceneState internal constructor() : RefCounted() { } /** - * Returns the number of exported or overridden properties for the node at [idx]. - * - * The `prop_idx` argument used to query node property data in other `get_node_property_*` methods in the interval `[0, get_node_property_count() - 1]`. + * Returns the number of exported or overridden properties for the node at [param idx]. + * The `prop_idx` argument used to query node property data in other `get_node_property_*` methods + * in the interval `[0, get_node_property_count() - 1]`. */ public fun getNodePropertyCount(idx: Int): Int { TransferContext.writeArguments(LONG to idx.toLong()) @@ -152,7 +156,7 @@ public open class SceneState internal constructor() : RefCounted() { } /** - * Returns the name of the property at [propIdx] for the node at [idx]. + * Returns the name of the property at [param prop_idx] for the node at [param idx]. */ public fun getNodePropertyName(idx: Int, propIdx: Int): StringName { TransferContext.writeArguments(LONG to idx.toLong(), LONG to propIdx.toLong()) @@ -161,7 +165,7 @@ public open class SceneState internal constructor() : RefCounted() { } /** - * Returns the value of the property at [propIdx] for the node at [idx]. + * Returns the value of the property at [param prop_idx] for the node at [param idx]. */ public fun getNodePropertyValue(idx: Int, propIdx: Int): Any? { TransferContext.writeArguments(LONG to idx.toLong(), LONG to propIdx.toLong()) @@ -171,8 +175,8 @@ public open class SceneState internal constructor() : RefCounted() { /** * Returns the number of signal connections in the scene. - * - * The `idx` argument used to query connection metadata in other `get_connection_*` methods in the interval `[0, get_connection_count() - 1]`. + * The `idx` argument used to query connection metadata in other `get_connection_*` methods in the + * interval `[0, get_connection_count() - 1]`. */ public fun getConnectionCount(): Int { TransferContext.writeArguments() @@ -181,7 +185,7 @@ public open class SceneState internal constructor() : RefCounted() { } /** - * Returns the path to the node that owns the signal at [idx], relative to the root node. + * Returns the path to the node that owns the signal at [param idx], relative to the root node. */ public fun getConnectionSource(idx: Int): NodePath { TransferContext.writeArguments(LONG to idx.toLong()) @@ -190,7 +194,7 @@ public open class SceneState internal constructor() : RefCounted() { } /** - * Returns the name of the signal at [idx]. + * Returns the name of the signal at [param idx]. */ public fun getConnectionSignal(idx: Int): StringName { TransferContext.writeArguments(LONG to idx.toLong()) @@ -199,7 +203,8 @@ public open class SceneState internal constructor() : RefCounted() { } /** - * Returns the path to the node that owns the method connected to the signal at [idx], relative to the root node. + * Returns the path to the node that owns the method connected to the signal at [param idx], + * relative to the root node. */ public fun getConnectionTarget(idx: Int): NodePath { TransferContext.writeArguments(LONG to idx.toLong()) @@ -208,7 +213,7 @@ public open class SceneState internal constructor() : RefCounted() { } /** - * Returns the method connected to the signal at [idx]. + * Returns the method connected to the signal at [param idx]. */ public fun getConnectionMethod(idx: Int): StringName { TransferContext.writeArguments(LONG to idx.toLong()) @@ -217,7 +222,8 @@ public open class SceneState internal constructor() : RefCounted() { } /** - * Returns the connection flags for the signal at [idx]. See [enum Object.ConnectFlags] constants. + * Returns the connection flags for the signal at [param idx]. See [enum Object.ConnectFlags] + * constants. */ public fun getConnectionFlags(idx: Int): Int { TransferContext.writeArguments(LONG to idx.toLong()) @@ -226,7 +232,7 @@ public open class SceneState internal constructor() : RefCounted() { } /** - * Returns the list of bound parameters for the signal at [idx]. + * Returns the list of bound parameters for the signal at [param idx]. */ public fun getConnectionBinds(idx: Int): VariantArray { TransferContext.writeArguments(LONG to idx.toLong()) @@ -235,7 +241,7 @@ public open class SceneState internal constructor() : RefCounted() { } /** - * Returns the number of unbound parameters for the signal at [idx]. + * Returns the number of unbound parameters for the signal at [param idx]. */ public fun getConnectionUnbinds(idx: Int): Int { TransferContext.writeArguments(LONG to idx.toLong()) @@ -247,24 +253,24 @@ public open class SceneState internal constructor() : RefCounted() { id: Long, ) { /** - * If passed to [godot.PackedScene.instantiate], blocks edits to the scene state. + * If passed to [PackedScene.instantiate], blocks edits to the scene state. */ GEN_EDIT_STATE_DISABLED(0), /** - * If passed to [godot.PackedScene.instantiate], provides inherited scene resources to the local scene. - * + * If passed to [PackedScene.instantiate], provides inherited scene resources to the local + * scene. * **Note:** Only available in editor builds. */ GEN_EDIT_STATE_INSTANCE(1), /** - * If passed to [godot.PackedScene.instantiate], provides local scene resources to the local scene. Only the main scene should receive the main edit state. - * + * If passed to [PackedScene.instantiate], provides local scene resources to the local scene. + * Only the main scene should receive the main edit state. * **Note:** Only available in editor builds. */ GEN_EDIT_STATE_MAIN(2), /** - * If passed to [godot.PackedScene.instantiate], it's similar to [GEN_EDIT_STATE_MAIN], but for the case where the scene is being instantiated to be the base of another one. - * + * If passed to [PackedScene.instantiate], it's similar to [constant GEN_EDIT_STATE_MAIN], but + * for the case where the scene is being instantiated to be the base of another one. * **Note:** Only available in editor builds. */ GEN_EDIT_STATE_MAIN_INHERITED(3), diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/SceneTreeTimer.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/SceneTreeTimer.kt index 35d32ba70..b26aee985 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/SceneTreeTimer.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/SceneTreeTimer.kt @@ -20,47 +20,33 @@ import kotlin.Int import kotlin.Suppress /** - * One-shot timer. - * - * A one-shot timer managed by the scene tree, which emits [timeout] on completion. See also [godot.SceneTree.createTimer]. - * - * As opposed to [godot.Timer], it does not require the instantiation of a node. Commonly used to create a one-shot delay timer as in the following example: - * - * [codeblocks] - * - * [gdscript] + * A one-shot timer managed by the scene tree, which emits [signal timeout] on completion. See also + * [SceneTree.createTimer]. + * As opposed to [Timer], it does not require the instantiation of a node. Commonly used to create a + * one-shot delay timer as in the following example: * + * gdscript: + * ```gdscript * func some_function(): - * * print("Timer started.") - * * await get_tree().create_timer(1.0).timeout - * * print("Timer ended.") - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * public async Task SomeFunction() - * * { - * * GD.Print("Timer started."); - * * await ToSignal(GetTree().CreateTimer(1.0f), SceneTreeTimer.SignalName.Timeout); - * * GD.Print("Timer ended."); - * * } + * ``` * - * [/csharp] - * - * [/codeblocks] - * - * The timer will be dereferenced after its time elapses. To preserve the timer, you can keep a reference to it. See [godot.RefCounted]. - * - * **Note:** The timer is processed after all of the nodes in the current frame, i.e. node's [godot.Node.Process] method would be called before the timer (or [godot.Node.PhysicsProcess] if `process_in_physics` in [godot.SceneTree.createTimer] has been set to `true`). + * The timer will be dereferenced after its time elapses. To preserve the timer, you can keep a + * reference to it. See [RefCounted]. + * **Note:** The timer is processed after all of the nodes in the current frame, i.e. node's + * [Node.Process] method would be called before the timer (or [Node.PhysicsProcess] if + * `process_in_physics` in [SceneTree.createTimer] has been set to `true`). */ @GodotBaseType public open class SceneTreeTimer internal constructor() : RefCounted() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ScriptExtension.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ScriptExtension.kt index 5875b2eab..0a2e83a5e 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ScriptExtension.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ScriptExtension.kt @@ -21,9 +21,6 @@ import kotlin.String import kotlin.Suppress import kotlin.Unit -/** - * - */ @GodotBaseType public open class ScriptExtension : Script() { public override fun new(scriptIndex: Int): Boolean { @@ -31,224 +28,132 @@ public open class ScriptExtension : Script() { return true } - /** - * - */ public open fun _editorCanReloadFromFile(): Boolean { throw NotImplementedError("_editor_can_reload_from_file is not implemented for ScriptExtension") } - /** - * - */ public open fun _canInstantiate(): Boolean { throw NotImplementedError("_can_instantiate is not implemented for ScriptExtension") } - /** - * - */ public open fun _getBaseScript(): Script? { throw NotImplementedError("_get_base_script is not implemented for ScriptExtension") } - /** - * - */ public open fun _getGlobalName(): StringName { throw NotImplementedError("_get_global_name is not implemented for ScriptExtension") } - /** - * - */ public open fun _inheritsScript(script: Script): Boolean { throw NotImplementedError("_inherits_script is not implemented for ScriptExtension") } - /** - * - */ public open fun _getInstanceBaseType(): StringName { throw NotImplementedError("_get_instance_base_type is not implemented for ScriptExtension") } - /** - * - */ public open fun _instanceHas(_object: Object): Boolean { throw NotImplementedError("_instance_has is not implemented for ScriptExtension") } - /** - * - */ public open fun _hasSourceCode(): Boolean { throw NotImplementedError("_has_source_code is not implemented for ScriptExtension") } - /** - * - */ public open fun _getSourceCode(): String { throw NotImplementedError("_get_source_code is not implemented for ScriptExtension") } - /** - * - */ public open fun _setSourceCode(code: String): Unit { } - /** - * - */ public open fun _reload(keepState: Boolean): GodotError { throw NotImplementedError("_reload is not implemented for ScriptExtension") } - /** - * - */ public open fun _getDocumentation(): VariantArray> { throw NotImplementedError("_get_documentation is not implemented for ScriptExtension") } - /** - * - */ public open fun _getClassIconPath(): String { throw NotImplementedError("_get_class_icon_path is not implemented for ScriptExtension") } - /** - * - */ public open fun _hasMethod(method: StringName): Boolean { throw NotImplementedError("_has_method is not implemented for ScriptExtension") } - /** - * - */ public open fun _hasStaticMethod(method: StringName): Boolean { throw NotImplementedError("_has_static_method is not implemented for ScriptExtension") } - /** - * - */ public open fun _getMethodInfo(method: StringName): Dictionary { throw NotImplementedError("_get_method_info is not implemented for ScriptExtension") } - /** - * - */ public open fun _isTool(): Boolean { throw NotImplementedError("_is_tool is not implemented for ScriptExtension") } - /** - * - */ public open fun _isValid(): Boolean { throw NotImplementedError("_is_valid is not implemented for ScriptExtension") } /** - * Returns `true` if the script is an abstract script. An abstract script does not have a constructor and cannot be instantiated. + * Returns `true` if the script is an abstract script. An abstract script does not have a + * constructor and cannot be instantiated. */ public open fun _isAbstract(): Boolean { throw NotImplementedError("_is_abstract is not implemented for ScriptExtension") } - /** - * - */ public open fun _getLanguage(): ScriptLanguage? { throw NotImplementedError("_get_language is not implemented for ScriptExtension") } - /** - * - */ public open fun _hasScriptSignal(signal: StringName): Boolean { throw NotImplementedError("_has_script_signal is not implemented for ScriptExtension") } - /** - * - */ public open fun _getScriptSignalList(): VariantArray> { throw NotImplementedError("_get_script_signal_list is not implemented for ScriptExtension") } - /** - * - */ public open fun _hasPropertyDefaultValue(`property`: StringName): Boolean { throw NotImplementedError("_has_property_default_value is not implemented for ScriptExtension") } - /** - * - */ public open fun _getPropertyDefaultValue(`property`: StringName): Any? { throw NotImplementedError("_get_property_default_value is not implemented for ScriptExtension") } - /** - * - */ public open fun _updateExports(): Unit { } - /** - * - */ public open fun _getScriptMethodList(): VariantArray> { throw NotImplementedError("_get_script_method_list is not implemented for ScriptExtension") } - /** - * - */ public open fun _getScriptPropertyList(): VariantArray> { throw NotImplementedError("_get_script_property_list is not implemented for ScriptExtension") } - /** - * - */ public open fun _getMemberLine(member: StringName): Int { throw NotImplementedError("_get_member_line is not implemented for ScriptExtension") } - /** - * - */ public open fun _getConstants(): Dictionary { throw NotImplementedError("_get_constants is not implemented for ScriptExtension") } - /** - * - */ public open fun _getMembers(): VariantArray { throw NotImplementedError("_get_members is not implemented for ScriptExtension") } - /** - * - */ public open fun _isPlaceholderFallbackEnabled(): Boolean { throw NotImplementedError("_is_placeholder_fallback_enabled is not implemented for ScriptExtension") } - /** - * - */ public open fun _getRpcConfig(): Any? { throw NotImplementedError("_get_rpc_config is not implemented for ScriptExtension") } diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ScriptLanguage.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ScriptLanguage.kt index 2d3757c94..7bc3c5e71 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ScriptLanguage.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ScriptLanguage.kt @@ -11,9 +11,6 @@ import kotlin.Boolean import kotlin.Int import kotlin.Suppress -/** - * - */ @GodotBaseType public open class ScriptLanguage internal constructor() : Object() { public override fun new(scriptIndex: Int): Boolean { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ScriptLanguageExtension.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ScriptLanguageExtension.kt index 04d5bd321..446070286 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ScriptLanguageExtension.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ScriptLanguageExtension.kt @@ -23,9 +23,6 @@ import kotlin.String import kotlin.Suppress import kotlin.Unit -/** - * - */ @GodotBaseType public open class ScriptLanguageExtension : ScriptLanguage() { public override fun new(scriptIndex: Int): Boolean { @@ -33,77 +30,44 @@ public open class ScriptLanguageExtension : ScriptLanguage() { return true } - /** - * - */ public open fun _getName(): String { throw NotImplementedError("_get_name is not implemented for ScriptLanguageExtension") } - /** - * - */ public open fun _init(): Unit { } - /** - * - */ public open fun _getType(): String { throw NotImplementedError("_get_type is not implemented for ScriptLanguageExtension") } - /** - * - */ public open fun _getExtension(): String { throw NotImplementedError("_get_extension is not implemented for ScriptLanguageExtension") } - /** - * - */ public open fun _finish(): Unit { } - /** - * - */ public open fun _getReservedWords(): PackedStringArray { throw NotImplementedError("_get_reserved_words is not implemented for ScriptLanguageExtension") } - /** - * - */ public open fun _isControlFlowKeyword(keyword: String): Boolean { throw NotImplementedError("_is_control_flow_keyword is not implemented for ScriptLanguageExtension") } - /** - * - */ public open fun _getCommentDelimiters(): PackedStringArray { throw NotImplementedError("_get_comment_delimiters is not implemented for ScriptLanguageExtension") } - /** - * - */ public open fun _getDocCommentDelimiters(): PackedStringArray { throw NotImplementedError("_get_doc_comment_delimiters is not implemented for ScriptLanguageExtension") } - /** - * - */ public open fun _getStringDelimiters(): PackedStringArray { throw NotImplementedError("_get_string_delimiters is not implemented for ScriptLanguageExtension") } - /** - * - */ public open fun _makeTemplate( template: String, className: String, @@ -112,23 +76,14 @@ public open class ScriptLanguageExtension : ScriptLanguage() { throw NotImplementedError("_make_template is not implemented for ScriptLanguageExtension") } - /** - * - */ public open fun _getBuiltInTemplates(_object: StringName): VariantArray> { throw NotImplementedError("_get_built_in_templates is not implemented for ScriptLanguageExtension") } - /** - * - */ public open fun _isUsingTemplates(): Boolean { throw NotImplementedError("_is_using_templates is not implemented for ScriptLanguageExtension") } - /** - * - */ public open fun _validate( script: String, path: String, @@ -140,16 +95,10 @@ public open class ScriptLanguageExtension : ScriptLanguage() { throw NotImplementedError("_validate is not implemented for ScriptLanguageExtension") } - /** - * - */ public open fun _validatePath(path: String): String { throw NotImplementedError("_validate_path is not implemented for ScriptLanguageExtension") } - /** - * - */ public open fun _createScript(): Object? { throw NotImplementedError("_create_script is not implemented for ScriptLanguageExtension") } @@ -161,37 +110,22 @@ public open class ScriptLanguageExtension : ScriptLanguage() { throw NotImplementedError("_has_named_classes is not implemented for ScriptLanguageExtension") } - /** - * - */ public open fun _supportsBuiltinMode(): Boolean { throw NotImplementedError("_supports_builtin_mode is not implemented for ScriptLanguageExtension") } - /** - * - */ public open fun _supportsDocumentation(): Boolean { throw NotImplementedError("_supports_documentation is not implemented for ScriptLanguageExtension") } - /** - * - */ public open fun _canInheritFromFile(): Boolean { throw NotImplementedError("_can_inherit_from_file is not implemented for ScriptLanguageExtension") } - /** - * - */ public open fun _findFunction(className: String, functionName: String): Int { throw NotImplementedError("_find_function is not implemented for ScriptLanguageExtension") } - /** - * - */ public open fun _makeFunction( className: String, functionName: String, @@ -200,9 +134,6 @@ public open class ScriptLanguageExtension : ScriptLanguage() { throw NotImplementedError("_make_function is not implemented for ScriptLanguageExtension") } - /** - * - */ public open fun _openInExternalEditor( script: Script, line: Int, @@ -211,16 +142,10 @@ public open class ScriptLanguageExtension : ScriptLanguage() { throw NotImplementedError("_open_in_external_editor is not implemented for ScriptLanguageExtension") } - /** - * - */ public open fun _overridesExternalEditor(): Boolean { throw NotImplementedError("_overrides_external_editor is not implemented for ScriptLanguageExtension") } - /** - * - */ public open fun _completeCode( code: String, path: String, @@ -229,9 +154,6 @@ public open class ScriptLanguageExtension : ScriptLanguage() { throw NotImplementedError("_complete_code is not implemented for ScriptLanguageExtension") } - /** - * - */ public open fun _lookupCode( code: String, symbol: String, @@ -241,9 +163,6 @@ public open class ScriptLanguageExtension : ScriptLanguage() { throw NotImplementedError("_lookup_code is not implemented for ScriptLanguageExtension") } - /** - * - */ public open fun _autoIndentCode( code: String, fromLine: Int, @@ -252,67 +171,37 @@ public open class ScriptLanguageExtension : ScriptLanguage() { throw NotImplementedError("_auto_indent_code is not implemented for ScriptLanguageExtension") } - /** - * - */ public open fun _addGlobalConstant(name: StringName, `value`: Any?): Unit { } - /** - * - */ public open fun _addNamedGlobalConstant(name: StringName, `value`: Any?): Unit { } - /** - * - */ public open fun _removeNamedGlobalConstant(name: StringName): Unit { } - /** - * - */ public open fun _threadEnter(): Unit { } - /** - * - */ public open fun _threadExit(): Unit { } - /** - * - */ public open fun _debugGetError(): String { throw NotImplementedError("_debug_get_error is not implemented for ScriptLanguageExtension") } - /** - * - */ public open fun _debugGetStackLevelCount(): Int { throw NotImplementedError("_debug_get_stack_level_count is not implemented for ScriptLanguageExtension") } - /** - * - */ public open fun _debugGetStackLevelLine(level: Int): Int { throw NotImplementedError("_debug_get_stack_level_line is not implemented for ScriptLanguageExtension") } - /** - * - */ public open fun _debugGetStackLevelFunction(level: Int): String { throw NotImplementedError("_debug_get_stack_level_function is not implemented for ScriptLanguageExtension") } - /** - * - */ public open fun _debugGetStackLevelLocals( level: Int, maxSubitems: Int, @@ -321,9 +210,6 @@ public open class ScriptLanguageExtension : ScriptLanguage() { throw NotImplementedError("_debug_get_stack_level_locals is not implemented for ScriptLanguageExtension") } - /** - * - */ public open fun _debugGetStackLevelMembers( level: Int, maxSubitems: Int, @@ -332,16 +218,10 @@ public open class ScriptLanguageExtension : ScriptLanguage() { throw NotImplementedError("_debug_get_stack_level_members is not implemented for ScriptLanguageExtension") } - /** - * - */ public open fun _debugGetGlobals(maxSubitems: Int, maxDepth: Int): Dictionary { throw NotImplementedError("_debug_get_globals is not implemented for ScriptLanguageExtension") } - /** - * - */ public open fun _debugParseStackLevelExpression( level: Int, expression: String, @@ -351,81 +231,45 @@ public open class ScriptLanguageExtension : ScriptLanguage() { throw NotImplementedError("_debug_parse_stack_level_expression is not implemented for ScriptLanguageExtension") } - /** - * - */ public open fun _debugGetCurrentStackInfo(): VariantArray> { throw NotImplementedError("_debug_get_current_stack_info is not implemented for ScriptLanguageExtension") } - /** - * - */ public open fun _reloadAllScripts(): Unit { } - /** - * - */ public open fun _reloadToolScript(script: Script, softReload: Boolean): Unit { } - /** - * - */ public open fun _getRecognizedExtensions(): PackedStringArray { throw NotImplementedError("_get_recognized_extensions is not implemented for ScriptLanguageExtension") } - /** - * - */ public open fun _getPublicFunctions(): VariantArray> { throw NotImplementedError("_get_public_functions is not implemented for ScriptLanguageExtension") } - /** - * - */ public open fun _getPublicConstants(): Dictionary { throw NotImplementedError("_get_public_constants is not implemented for ScriptLanguageExtension") } - /** - * - */ public open fun _getPublicAnnotations(): VariantArray> { throw NotImplementedError("_get_public_annotations is not implemented for ScriptLanguageExtension") } - /** - * - */ public open fun _profilingStart(): Unit { } - /** - * - */ public open fun _profilingStop(): Unit { } - /** - * - */ public open fun _frame(): Unit { } - /** - * - */ public open fun _handlesGlobalClassType(type: String): Boolean { throw NotImplementedError("_handles_global_class_type is not implemented for ScriptLanguageExtension") } - /** - * - */ public open fun _getGlobalClassName(path: String): Dictionary { throw NotImplementedError("_get_global_class_name is not implemented for ScriptLanguageExtension") } @@ -433,45 +277,15 @@ public open class ScriptLanguageExtension : ScriptLanguage() { public enum class LookupResultType( id: Long, ) { - /** - * - */ LOOKUP_RESULT_SCRIPT_LOCATION(0), - /** - * - */ LOOKUP_RESULT_CLASS(1), - /** - * - */ LOOKUP_RESULT_CLASS_CONSTANT(2), - /** - * - */ LOOKUP_RESULT_CLASS_PROPERTY(3), - /** - * - */ LOOKUP_RESULT_CLASS_METHOD(4), - /** - * - */ LOOKUP_RESULT_CLASS_SIGNAL(5), - /** - * - */ LOOKUP_RESULT_CLASS_ENUM(6), - /** - * - */ LOOKUP_RESULT_CLASS_TBD_GLOBALSCOPE(7), - /** - * - */ LOOKUP_RESULT_CLASS_ANNOTATION(8), - /** - * - */ LOOKUP_RESULT_MAX(9), ; @@ -489,19 +303,26 @@ public open class ScriptLanguageExtension : ScriptLanguage() { id: Long, ) { /** - * The option is local to the location of the code completion query - e.g. a local variable. Subsequent value of location represent options from the outer class, the exact value represent how far they are (in terms of inner classes). + * The option is local to the location of the code completion query - e.g. a local variable. + * Subsequent value of location represent options from the outer class, the exact value represent + * how far they are (in terms of inner classes). */ LOCATION_LOCAL(0), /** - * The option is from the containing class or a parent class, relative to the location of the code completion query. Perform a bitwise OR with the class depth (e.g. 0 for the local class, 1 for the parent, 2 for the grandparent, etc) to store the depth of an option in the class or a parent class. + * The option is from the containing class or a parent class, relative to the location of the + * code completion query. Perform a bitwise OR with the class depth (e.g. 0 for the local class, 1 + * for the parent, 2 for the grandparent, etc) to store the depth of an option in the class or a + * parent class. */ LOCATION_PARENT_MASK(256), /** - * The option is from user code which is not local and not in a derived class (e.g. Autoload Singletons). + * The option is from user code which is not local and not in a derived class (e.g. Autoload + * Singletons). */ LOCATION_OTHER_USER_CODE(512), /** - * The option is from other engine code, not covered by the other enum constants - e.g. built-in classes. + * The option is from other engine code, not covered by the other enum constants - e.g. built-in + * classes. */ LOCATION_OTHER(1024), ; @@ -519,49 +340,16 @@ public open class ScriptLanguageExtension : ScriptLanguage() { public enum class CodeCompletionKind( id: Long, ) { - /** - * - */ CODE_COMPLETION_KIND_CLASS(0), - /** - * - */ CODE_COMPLETION_KIND_FUNCTION(1), - /** - * - */ CODE_COMPLETION_KIND_SIGNAL(2), - /** - * - */ CODE_COMPLETION_KIND_VARIABLE(3), - /** - * - */ CODE_COMPLETION_KIND_MEMBER(4), - /** - * - */ CODE_COMPLETION_KIND_ENUM(5), - /** - * - */ CODE_COMPLETION_KIND_CONSTANT(6), - /** - * - */ CODE_COMPLETION_KIND_NODE_PATH(7), - /** - * - */ CODE_COMPLETION_KIND_FILE_PATH(8), - /** - * - */ CODE_COMPLETION_KIND_PLAIN_TEXT(9), - /** - * - */ CODE_COMPLETION_KIND_MAX(10), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ScrollBar.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ScrollBar.kt index 78b16b023..0dafdd4b9 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ScrollBar.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ScrollBar.kt @@ -21,9 +21,8 @@ import kotlin.Int import kotlin.Suppress /** - * Abstract base class for scrollbars. - * - * Abstract base class for scrollbars, typically used to navigate through content that extends beyond the visible area of a control. Scrollbars are [godot.Range]-based controls. + * Abstract base class for scrollbars, typically used to navigate through content that extends + * beyond the visible area of a control. Scrollbars are [Range]-based controls. */ @GodotBaseType public open class ScrollBar internal constructor() : Range() { @@ -33,7 +32,8 @@ public open class ScrollBar internal constructor() : Range() { public val scrolling: Signal0 by signal() /** - * Overrides the step used when clicking increment and decrement buttons or when using arrow keys when the [godot.ScrollBar] is focused. + * Overrides the step used when clicking increment and decrement buttons or when using arrow keys + * when the [ScrollBar] is focused. */ public var customStep: Float get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ScrollContainer.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ScrollContainer.kt index 5e271a9e1..7fa183dd0 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ScrollContainer.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ScrollContainer.kt @@ -26,31 +26,35 @@ import kotlin.Suppress import kotlin.Unit /** - * A container used to provide scrollbars to a child control when needed. - * - * Tutorials: - * [$DOCS_URL/tutorials/ui/gui_containers.html]($DOCS_URL/tutorials/ui/gui_containers.html) - * - * A container used to provide a child control with scrollbars when needed. Scrollbars will automatically be drawn at the right (for vertical) or bottom (for horizontal) and will enable dragging to move the viewable Control (and its children) within the ScrollContainer. Scrollbars will also automatically resize the grabber based on the [godot.Control.customMinimumSize] of the Control relative to the ScrollContainer. + * A container used to provide a child control with scrollbars when needed. Scrollbars will + * automatically be drawn at the right (for vertical) or bottom (for horizontal) and will enable + * dragging to move the viewable Control (and its children) within the ScrollContainer. Scrollbars will + * also automatically resize the grabber based on the [Control.customMinimumSize] of the Control + * relative to the ScrollContainer. */ @GodotBaseType public open class ScrollContainer : Container() { /** - * Emitted when scrolling starts when dragging the scrollable area w*ith a touch event*. This signal is *not* emitted when scrolling by dragging the scrollbar, scrolling with the mouse wheel or scrolling with keyboard/gamepad events. - * - * **Note:** This signal is only emitted on Android or iOS, or on desktop/web platforms when [godot.ProjectSettings.inputDevices/pointing/emulateTouchFromMouse] is enabled. + * Emitted when scrolling starts when dragging the scrollable area w*ith a touch event*. This + * signal is *not* emitted when scrolling by dragging the scrollbar, scrolling with the mouse wheel + * or scrolling with keyboard/gamepad events. + * **Note:** This signal is only emitted on Android or iOS, or on desktop/web platforms when + * [ProjectSettings.inputDevices/pointing/emulateTouchFromMouse] is enabled. */ public val scrollStarted: Signal0 by signal() /** - * Emitted when scrolling stops when dragging the scrollable area *with a touch event*. This signal is *not* emitted when scrolling by dragging the scrollbar, scrolling with the mouse wheel or scrolling with keyboard/gamepad events. - * - * **Note:** This signal is only emitted on Android or iOS, or on desktop/web platforms when [godot.ProjectSettings.inputDevices/pointing/emulateTouchFromMouse] is enabled. + * Emitted when scrolling stops when dragging the scrollable area *with a touch event*. This + * signal is *not* emitted when scrolling by dragging the scrollbar, scrolling with the mouse wheel + * or scrolling with keyboard/gamepad events. + * **Note:** This signal is only emitted on Android or iOS, or on desktop/web platforms when + * [ProjectSettings.inputDevices/pointing/emulateTouchFromMouse] is enabled. */ public val scrollEnded: Signal0 by signal() /** - * If `true`, the ScrollContainer will automatically scroll to focused children (including indirect children) to make sure they are fully visible. + * If `true`, the ScrollContainer will automatically scroll to focused children (including + * indirect children) to make sure they are fully visible. */ public var followFocus: Boolean get() { @@ -65,13 +69,12 @@ public open class ScrollContainer : Container() { /** * The current horizontal scroll value. - * - * **Note:** If you are setting this value in the [godot.Node.Ready] function or earlier, it needs to be wrapped with [godot.Object.setDeferred], since scroll bar's [godot.Range.maxValue] is not initialized yet. - * - * ``` - * func _ready(): - * set_deferred("scroll_horizontal", 600) - * ``` + * **Note:** If you are setting this value in the [Node.Ready] function or earlier, it needs to be + * wrapped with [Object.setDeferred], since scroll bar's [Range.maxValue] is not initialized yet. + * [codeblock] + * func _ready(): + * set_deferred("scroll_horizontal", 600) + * [/codeblock] */ public var scrollHorizontal: Int get() { @@ -86,13 +89,11 @@ public open class ScrollContainer : Container() { /** * The current vertical scroll value. - * * **Note:** Setting it early needs to be deferred, just like in [scrollHorizontal]. - * - * ``` - * func _ready(): - * set_deferred("scroll_vertical", 600) - * ``` + * [codeblock] + * func _ready(): + * set_deferred("scroll_vertical", 600) + * [/codeblock] */ public var scrollVertical: Int get() { @@ -106,7 +107,8 @@ public open class ScrollContainer : Container() { } /** - * Overrides the [godot.ScrollBar.customStep] used when clicking the internal scroll bar's horizontal increment and decrement buttons or when using arrow keys when the [godot.ScrollBar] is focused. + * Overrides the [ScrollBar.customStep] used when clicking the internal scroll bar's horizontal + * increment and decrement buttons or when using arrow keys when the [ScrollBar] is focused. */ public var scrollHorizontalCustomStep: Float get() { @@ -120,7 +122,8 @@ public open class ScrollContainer : Container() { } /** - * Overrides the [godot.ScrollBar.customStep] used when clicking the internal scroll bar's vertical increment and decrement buttons or when using arrow keys when the [godot.ScrollBar] is focused. + * Overrides the [ScrollBar.customStep] used when clicking the internal scroll bar's vertical + * increment and decrement buttons or when using arrow keys when the [ScrollBar] is focused. */ public var scrollVerticalCustomStep: Float get() { @@ -134,7 +137,8 @@ public open class ScrollContainer : Container() { } /** - * Controls whether horizontal scrollbar can be used and when it should be visible. See [enum ScrollMode] for options. + * Controls whether horizontal scrollbar can be used and when it should be visible. See [enum + * ScrollMode] for options. */ public var horizontalScrollMode: ScrollMode get() { @@ -148,7 +152,8 @@ public open class ScrollContainer : Container() { } /** - * Controls whether vertical scrollbar can be used and when it should be visible. See [enum ScrollMode] for options. + * Controls whether vertical scrollbar can be used and when it should be visible. See [enum + * ScrollMode] for options. */ public var verticalScrollMode: ScrollMode get() { @@ -181,9 +186,9 @@ public open class ScrollContainer : Container() { } /** - * Returns the horizontal scrollbar [godot.HScrollBar] of this [godot.ScrollContainer]. - * - * **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to disable or hide a scrollbar, you can use [horizontalScrollMode]. + * Returns the horizontal scrollbar [HScrollBar] of this [ScrollContainer]. + * **Warning:** This is a required internal node, removing and freeing it may cause a crash. If + * you wish to disable or hide a scrollbar, you can use [horizontalScrollMode]. */ public fun getHScrollBar(): HScrollBar? { TransferContext.writeArguments() @@ -192,9 +197,9 @@ public open class ScrollContainer : Container() { } /** - * Returns the vertical scrollbar [godot.VScrollBar] of this [godot.ScrollContainer]. - * - * **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to disable or hide a scrollbar, you can use [verticalScrollMode]. + * Returns the vertical scrollbar [VScrollBar] of this [ScrollContainer]. + * **Warning:** This is a required internal node, removing and freeing it may cause a crash. If + * you wish to disable or hide a scrollbar, you can use [verticalScrollMode]. */ public fun getVScrollBar(): VScrollBar? { TransferContext.writeArguments() @@ -203,15 +208,16 @@ public open class ScrollContainer : Container() { } /** - * Ensures the given [control] is visible (must be a direct or indirect child of the ScrollContainer). Used by [followFocus]. - * - * **Note:** This will not work on a node that was just added during the same frame. If you want to scroll to a newly added child, you must wait until the next frame using [godot.SceneTree.processFrame]: - * - * ``` - * add_child(child_node) - * await get_tree().process_frame - * ensure_control_visible(child_node) - * ``` + * Ensures the given [param control] is visible (must be a direct or indirect child of the + * ScrollContainer). Used by [followFocus]. + * **Note:** This will not work on a node that was just added during the same frame. If you want + * to scroll to a newly added child, you must wait until the next frame using [signal + * SceneTree.process_frame]: + * [codeblock] + * add_child(child_node) + * await get_tree().process_frame + * ensure_control_visible(child_node) + * [/codeblock] */ public fun ensureControlVisible(control: Control): Unit { TransferContext.writeArguments(OBJECT to control) @@ -226,7 +232,8 @@ public open class ScrollContainer : Container() { */ SCROLL_MODE_DISABLED(0), /** - * Scrolling enabled, scrollbar will be visible only if necessary, i.e. container's content is bigger than the container. + * Scrolling enabled, scrollbar will be visible only if necessary, i.e. container's content is + * bigger than the container. */ SCROLL_MODE_AUTO(1), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/SegmentShape2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/SegmentShape2D.kt index cdcfa88b4..2e6e875d8 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/SegmentShape2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/SegmentShape2D.kt @@ -21,9 +21,8 @@ import kotlin.Suppress import kotlin.Unit /** - * A 2D line segment shape used for physics collision. - * - * A 2D line segment shape, intended for use in physics. Usually used to provide a shape for a [godot.CollisionShape2D]. + * A 2D line segment shape, intended for use in physics. Usually used to provide a shape for a + * [CollisionShape2D]. */ @GodotBaseType public open class SegmentShape2D : Shape2D() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Semaphore.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Semaphore.kt index c3b1c02a9..739e24f22 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Semaphore.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Semaphore.kt @@ -19,20 +19,15 @@ import kotlin.Unit import kotlin.jvm.JvmName /** - * A synchronization mechanism used to control access to a shared resource by [godot.Thread]s. - * - * Tutorials: - * [$DOCS_URL/tutorials/performance/thread_safe_apis.html]($DOCS_URL/tutorials/performance/thread_safe_apis.html) - * - * A synchronization semaphore that can be used to synchronize multiple [godot.Thread]s. Initialized to zero on creation. For a binary version, see [godot.Mutex]. - * + * A synchronization semaphore that can be used to synchronize multiple [Thread]s. Initialized to + * zero on creation. For a binary version, see [Mutex]. * **Warning:** Semaphores must be used carefully to avoid deadlocks. - * - * **Warning:** To guarantee that the operating system is able to perform proper cleanup (no crashes, no deadlocks), these conditions must be met: - * - * - When a [godot.Semaphore]'s reference count reaches zero and it is therefore destroyed, no threads must be waiting on it. - * - * - When a [godot.Thread]'s reference count reaches zero and it is therefore destroyed, it must not be waiting on any semaphore. + * **Warning:** To guarantee that the operating system is able to perform proper cleanup (no + * crashes, no deadlocks), these conditions must be met: + * - When a [Semaphore]'s reference count reaches zero and it is therefore destroyed, no threads + * must be waiting on it. + * - When a [Thread]'s reference count reaches zero and it is therefore destroyed, it must not be + * waiting on any semaphore. */ @GodotBaseType public open class Semaphore : RefCounted() { @@ -42,7 +37,7 @@ public open class Semaphore : RefCounted() { } /** - * Waits for the [godot.Semaphore], if its value is zero, blocks until non-zero. + * Waits for the [Semaphore], if its value is zero, blocks until non-zero. */ @JvmName("semaphoreWait") public fun wait(): Unit { @@ -51,7 +46,8 @@ public open class Semaphore : RefCounted() { } /** - * Like [wait], but won't block, so if the value is zero, fails immediately and returns `false`. If non-zero, it returns `true` to report success. + * Like [wait], but won't block, so if the value is zero, fails immediately and returns `false`. + * If non-zero, it returns `true` to report success. */ public fun tryWait(): Boolean { TransferContext.writeArguments() @@ -60,7 +56,7 @@ public open class Semaphore : RefCounted() { } /** - * Lowers the [godot.Semaphore], allowing one more thread in. + * Lowers the [Semaphore], allowing one more thread in. */ public fun post(): Unit { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/SeparationRayShape2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/SeparationRayShape2D.kt index 3fbc85aa3..462164afd 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/SeparationRayShape2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/SeparationRayShape2D.kt @@ -20,9 +20,10 @@ import kotlin.Int import kotlin.Suppress /** - * A 2D ray shape used for physics collision that tries to separate itself from any collider. - * - * A 2D ray shape, intended for use in physics. Usually used to provide a shape for a [godot.CollisionShape2D]. When a [godot.SeparationRayShape2D] collides with an object, it tries to separate itself from it by moving its endpoint to the collision point. For example, a [godot.SeparationRayShape2D] next to a character can allow it to instantly move up when touching stairs. + * A 2D ray shape, intended for use in physics. Usually used to provide a shape for a + * [CollisionShape2D]. When a [SeparationRayShape2D] collides with an object, it tries to separate + * itself from it by moving its endpoint to the collision point. For example, a [SeparationRayShape2D] + * next to a character can allow it to instantly move up when touching stairs. */ @GodotBaseType public open class SeparationRayShape2D : Shape2D() { @@ -42,8 +43,8 @@ public open class SeparationRayShape2D : Shape2D() { /** * If `false` (default), the shape always separates and returns a normal along its own direction. - * - * If `true`, the shape can return the correct normal and separate in any direction, allowing sliding motion on slopes. + * If `true`, the shape can return the correct normal and separate in any direction, allowing + * sliding motion on slopes. */ public var slideOnSlope: Boolean get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/SeparationRayShape3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/SeparationRayShape3D.kt index 0ccba54a0..b176d770d 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/SeparationRayShape3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/SeparationRayShape3D.kt @@ -20,9 +20,10 @@ import kotlin.Int import kotlin.Suppress /** - * A 3D ray shape used for physics collision that tries to separate itself from any collider. - * - * A 3D ray shape, intended for use in physics. Usually used to provide a shape for a [godot.CollisionShape3D]. When a [godot.SeparationRayShape3D] collides with an object, it tries to separate itself from it by moving its endpoint to the collision point. For example, a [godot.SeparationRayShape3D] next to a character can allow it to instantly move up when touching stairs. + * A 3D ray shape, intended for use in physics. Usually used to provide a shape for a + * [CollisionShape3D]. When a [SeparationRayShape3D] collides with an object, it tries to separate + * itself from it by moving its endpoint to the collision point. For example, a [SeparationRayShape3D] + * next to a character can allow it to instantly move up when touching stairs. */ @GodotBaseType public open class SeparationRayShape3D : Shape3D() { @@ -42,8 +43,8 @@ public open class SeparationRayShape3D : Shape3D() { /** * If `false` (default), the shape always separates and returns a normal along its own direction. - * - * If `true`, the shape can return the correct normal and separate in any direction, allowing sliding motion on slopes. + * If `true`, the shape can return the correct normal and separate in any direction, allowing + * sliding motion on slopes. */ public var slideOnSlope: Boolean get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Separator.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Separator.kt index 6128c15a4..7900051b8 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Separator.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Separator.kt @@ -12,9 +12,8 @@ import kotlin.Int import kotlin.Suppress /** - * Abstract base class for separators. - * - * Abstract base class for separators, used for separating other controls. [godot.Separator]s are purely visual and normally drawn as a [godot.StyleBoxLine]. + * Abstract base class for separators, used for separating other controls. [Separator]s are purely + * visual and normally drawn as a [StyleBoxLine]. */ @GodotBaseType public open class Separator internal constructor() : Control() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Shader.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Shader.kt index 2eb83085f..8e895fe5d 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Shader.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Shader.kt @@ -29,19 +29,17 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * A shader implemented in the Godot shading language. - * - * Tutorials: - * [$DOCS_URL/tutorials/shaders/index.html]($DOCS_URL/tutorials/shaders/index.html) - * - * A custom shader program implemented in the Godot shading language, saved with the `.gdshader` extension. - * - * This class is used by a [godot.ShaderMaterial] and allows you to write your own custom behavior for rendering visual items or updating particle information. For a detailed explanation and usage, please see the tutorials linked below. + * A custom shader program implemented in the Godot shading language, saved with the `.gdshader` + * extension. + * This class is used by a [ShaderMaterial] and allows you to write your own custom behavior for + * rendering visual items or updating particle information. For a detailed explanation and usage, + * please see the tutorials linked below. */ @GodotBaseType public open class Shader : Resource() { /** - * Returns the shader's code as the user has written it, not the full generated code used internally. + * Returns the shader's code as the user has written it, not the full generated code used + * internally. */ public var code: String get() { @@ -69,11 +67,10 @@ public open class Shader : Resource() { } /** - * Sets the default texture to be used with a texture uniform. The default is used if a texture is not set in the [godot.ShaderMaterial]. - * - * **Note:** [name] must match the name of the uniform in the code exactly. - * - * **Note:** If the sampler array is used use [index] to access the specified texture. + * Sets the default texture to be used with a texture uniform. The default is used if a texture is + * not set in the [ShaderMaterial]. + * **Note:** [param name] must match the name of the uniform in the code exactly. + * **Note:** If the sampler array is used use [param index] to access the specified texture. */ @JvmOverloads public fun setDefaultTextureParameter( @@ -87,10 +84,8 @@ public open class Shader : Resource() { /** * Returns the texture that is set as default for the specified parameter. - * - * **Note:** [name] must match the name of the uniform in the code exactly. - * - * **Note:** If the sampler array is used use [index] to access the specified texture. + * **Note:** [param name] must match the name of the uniform in the code exactly. + * **Note:** If the sampler array is used use [param index] to access the specified texture. */ @JvmOverloads public fun getDefaultTextureParameter(name: StringName, index: Int = 0): Texture2D? { @@ -100,9 +95,11 @@ public open class Shader : Resource() { } /** - * Get the list of shader uniforms that can be assigned to a [godot.ShaderMaterial], for use with [godot.ShaderMaterial.setShaderParameter] and [godot.ShaderMaterial.getShaderParameter]. The parameters returned are contained in dictionaries in a similar format to the ones returned by [godot.Object.getPropertyList]. - * - * If argument [getGroups] is true, parameter grouping hints will be provided. + * Get the list of shader uniforms that can be assigned to a [ShaderMaterial], for use with + * [ShaderMaterial.setShaderParameter] and [ShaderMaterial.getShaderParameter]. The parameters + * returned are contained in dictionaries in a similar format to the ones returned by + * [Object.getPropertyList]. + * If argument [param get_groups] is true, parameter grouping hints will be provided. */ @JvmOverloads public fun getShaderUniformList(getGroups: Boolean = false): VariantArray { @@ -127,7 +124,7 @@ public open class Shader : Resource() { */ MODE_PARTICLES(2), /** - * Mode used for drawing skies. Only works with shaders attached to [godot.Sky] objects. + * Mode used for drawing skies. Only works with shaders attached to [Sky] objects. */ MODE_SKY(3), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ShaderGlobalsOverride.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ShaderGlobalsOverride.kt index 0e7a9e3e6..b19589af0 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ShaderGlobalsOverride.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ShaderGlobalsOverride.kt @@ -12,16 +12,17 @@ import kotlin.Int import kotlin.Suppress /** - * A node used to override global shader parameters' values in a scene. - * - * Tutorials: - * [$DOCS_URL/tutorials/shaders/shader_reference/shading_language.html]($DOCS_URL/tutorials/shaders/shader_reference/shading_language.html) - * - * Similar to how a [godot.WorldEnvironment] node can be used to override the environment while a specific scene is loaded, [godot.ShaderGlobalsOverride] can be used to override global shader parameters temporarily. Once the node is removed, the project-wide values for the global shader parameters are restored. See the [godot.RenderingServer] `global_shader_parameter_*` methods for more information. - * - * **Note:** Only one [godot.ShaderGlobalsOverride] can be used per scene. If there is more than one [godot.ShaderGlobalsOverride] node in the scene tree, only the first node (in tree order) will be taken into account. - * - * **Note:** All [godot.ShaderGlobalsOverride] nodes are made part of a `"shader_overrides_group"` group when they are added to the scene tree. The currently active [godot.ShaderGlobalsOverride] node also has a `"shader_overrides_group_active"` group added to it. You can use this to check which [godot.ShaderGlobalsOverride] node is currently active. + * Similar to how a [WorldEnvironment] node can be used to override the environment while a specific + * scene is loaded, [ShaderGlobalsOverride] can be used to override global shader parameters + * temporarily. Once the node is removed, the project-wide values for the global shader parameters are + * restored. See the [RenderingServer] `global_shader_parameter_*` methods for more information. + * **Note:** Only one [ShaderGlobalsOverride] can be used per scene. If there is more than one + * [ShaderGlobalsOverride] node in the scene tree, only the first node (in tree order) will be taken + * into account. + * **Note:** All [ShaderGlobalsOverride] nodes are made part of a `"shader_overrides_group"` group + * when they are added to the scene tree. The currently active [ShaderGlobalsOverride] node also has a + * `"shader_overrides_group_active"` group added to it. You can use this to check which + * [ShaderGlobalsOverride] node is currently active. */ @GodotBaseType public open class ShaderGlobalsOverride : Node() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ShaderInclude.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ShaderInclude.kt index 50d4ddc1a..b4ad00a21 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ShaderInclude.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ShaderInclude.kt @@ -18,17 +18,16 @@ import kotlin.String import kotlin.Suppress /** - * A snippet of shader code to be included in a [godot.Shader] with `#include`. - * - * Tutorials: - * [$DOCS_URL/tutorials/shaders/shader_reference/shader_preprocessor.html]($DOCS_URL/tutorials/shaders/shader_reference/shader_preprocessor.html) - * - * A shader include file, saved with the `.gdshaderinc` extension. This class allows you to define a custom shader snippet that can be included in a [godot.Shader] by using the preprocessor directive `#include`, followed by the file path (e.g. `#include "res://shader_lib.gdshaderinc"`). The snippet doesn't have to be a valid shader on its own. + * A shader include file, saved with the `.gdshaderinc` extension. This class allows you to define a + * custom shader snippet that can be included in a [Shader] by using the preprocessor directive + * `#include`, followed by the file path (e.g. `#include "res://shader_lib.gdshaderinc"`). The snippet + * doesn't have to be a valid shader on its own. */ @GodotBaseType public open class ShaderInclude : Resource() { /** - * Returns the code of the shader include file. The returned text is what the user has written, not the full generated code used internally. + * Returns the code of the shader include file. The returned text is what the user has written, + * not the full generated code used internally. */ public var code: String get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ShaderMaterial.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ShaderMaterial.kt index 587b69818..ad53abd5c 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ShaderMaterial.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ShaderMaterial.kt @@ -22,21 +22,19 @@ import kotlin.Suppress import kotlin.Unit /** - * A material defined by a custom [godot.Shader] program and the values of its shader parameters. - * - * Tutorials: - * [$DOCS_URL/tutorials/shaders/index.html]($DOCS_URL/tutorials/shaders/index.html) - * - * A material that uses a custom [godot.Shader] program to render visual items (canvas items, meshes, skies, fog), or to process particles. Compared to other materials, [godot.ShaderMaterial] gives deeper control over the generated shader code. For more information, see the shaders documentation index below. - * - * Multiple [godot.ShaderMaterial]s can use the same shader and configure different values for the shader uniforms. - * - * **Note:** For performance reasons, the [godot.Resource.changed] signal is only emitted when the [godot.Resource.resourceName] changes. Only in editor, it is also emitted for [shader] changes. + * A material that uses a custom [Shader] program to render visual items (canvas items, meshes, + * skies, fog), or to process particles. Compared to other materials, [ShaderMaterial] gives deeper + * control over the generated shader code. For more information, see the shaders documentation index + * below. + * Multiple [ShaderMaterial]s can use the same shader and configure different values for the shader + * uniforms. + * **Note:** For performance reasons, the [signal Resource.changed] signal is only emitted when the + * [Resource.resourceName] changes. Only in editor, it is also emitted for [shader] changes. */ @GodotBaseType public open class ShaderMaterial : Material() { /** - * The [godot.Shader] program used to render this material. + * The [Shader] program used to render this material. */ public var shader: Shader? get() { @@ -56,10 +54,13 @@ public open class ShaderMaterial : Material() { /** * Changes the value set for this material of a uniform in the shader. - * - * **Note:** [param] is case-sensitive and must match the name of the uniform in the code exactly (not the capitalized name in the inspector). - * - * **Note:** Changes to the shader uniform will be effective on all instances using this [godot.ShaderMaterial]. To prevent this, use per-instance uniforms with [godot.GeometryInstance3D.setInstanceShaderParameter] or duplicate the [godot.ShaderMaterial] resource using [godot.Resource.duplicate]. Per-instance uniforms allow for better shader reuse and are therefore faster, so they should be preferred over duplicating the [godot.ShaderMaterial] when possible. + * **Note:** [param param] is case-sensitive and must match the name of the uniform in the code + * exactly (not the capitalized name in the inspector). + * **Note:** Changes to the shader uniform will be effective on all instances using this + * [ShaderMaterial]. To prevent this, use per-instance uniforms with + * [GeometryInstance3D.setInstanceShaderParameter] or duplicate the [ShaderMaterial] resource using + * [Resource.duplicate]. Per-instance uniforms allow for better shader reuse and are therefore + * faster, so they should be preferred over duplicating the [ShaderMaterial] when possible. */ public fun setShaderParameter(`param`: StringName, `value`: Any?): Unit { TransferContext.writeArguments(STRING_NAME to param, ANY to value) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Shape2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Shape2D.kt index 6d1505237..63ee31fd1 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Shape2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Shape2D.kt @@ -34,21 +34,17 @@ import kotlin.Suppress import kotlin.Unit /** - * Abstract base class for 2D shapes used for physics collision. - * - * Tutorials: - * [$DOCS_URL/tutorials/physics/physics_introduction.html]($DOCS_URL/tutorials/physics/physics_introduction.html) - * * Abstract base class for all 2D shapes, intended for use in physics. - * - * **Performance:** Primitive shapes, especially [godot.CircleShape2D], are fast to check collisions against. [godot.ConvexPolygonShape2D] is slower, and [godot.ConcavePolygonShape2D] is the slowest. + * **Performance:** Primitive shapes, especially [CircleShape2D], are fast to check collisions + * against. [ConvexPolygonShape2D] is slower, and [ConcavePolygonShape2D] is the slowest. */ @GodotBaseType public open class Shape2D internal constructor() : Resource() { /** - * The shape's custom solver bias. Defines how much bodies react to enforce contact separation when this shape is involved. - * - * When set to `0`, the default value from [godot.ProjectSettings.physics/2d/solver/defaultContactBias] is used. + * The shape's custom solver bias. Defines how much bodies react to enforce contact separation + * when this shape is involved. + * When set to `0`, the default value from [ProjectSettings.physics/2d/solver/defaultContactBias] + * is used. */ public var customSolverBias: Float get() { @@ -68,8 +64,9 @@ public open class Shape2D internal constructor() : Resource() { /** * Returns `true` if this shape is colliding with another. - * - * This method needs the transformation matrix for this shape ([localXform]), the shape to check collisions with ([withShape]), and the transformation matrix of that shape ([shapeXform]). + * This method needs the transformation matrix for this shape ([param local_xform]), the shape to + * check collisions with ([param with_shape]), and the transformation matrix of that shape ([param + * shape_xform]). */ public fun collide( localXform: Transform2D, @@ -83,8 +80,10 @@ public open class Shape2D internal constructor() : Resource() { /** * Returns whether this shape would collide with another, if a given movement was applied. - * - * This method needs the transformation matrix for this shape ([localXform]), the movement to test on this shape ([localMotion]), the shape to check collisions with ([withShape]), the transformation matrix of that shape ([shapeXform]), and the movement to test onto the other object ([shapeMotion]). + * This method needs the transformation matrix for this shape ([param local_xform]), the movement + * to test on this shape ([param local_motion]), the shape to check collisions with ([param + * with_shape]), the transformation matrix of that shape ([param shape_xform]), and the movement to + * test onto the other object ([param shape_motion]). */ public fun collideWithMotion( localXform: Transform2D, @@ -100,12 +99,15 @@ public open class Shape2D internal constructor() : Resource() { /** * Returns a list of contact point pairs where this shape touches another. - * - * If there are no collisions, the returned list is empty. Otherwise, the returned list contains contact points arranged in pairs, with entries alternating between points on the boundary of this shape and points on the boundary of [withShape]. - * - * A collision pair A, B can be used to calculate the collision normal with `(B - A).normalized()`, and the collision depth with `(B - A).length()`. This information is typically used to separate shapes, particularly in collision solvers. - * - * This method needs the transformation matrix for this shape ([localXform]), the shape to check collisions with ([withShape]), and the transformation matrix of that shape ([shapeXform]). + * If there are no collisions, the returned list is empty. Otherwise, the returned list contains + * contact points arranged in pairs, with entries alternating between points on the boundary of this + * shape and points on the boundary of [param with_shape]. + * A collision pair A, B can be used to calculate the collision normal with `(B - + * A).normalized()`, and the collision depth with `(B - A).length()`. This information is typically + * used to separate shapes, particularly in collision solvers. + * This method needs the transformation matrix for this shape ([param local_xform]), the shape to + * check collisions with ([param with_shape]), and the transformation matrix of that shape ([param + * shape_xform]). */ public fun collideAndGetContacts( localXform: Transform2D, @@ -119,13 +121,18 @@ public open class Shape2D internal constructor() : Resource() { } /** - * Returns a list of contact point pairs where this shape would touch another, if a given movement was applied. - * - * If there would be no collisions, the returned list is empty. Otherwise, the returned list contains contact points arranged in pairs, with entries alternating between points on the boundary of this shape and points on the boundary of [withShape]. - * - * A collision pair A, B can be used to calculate the collision normal with `(B - A).normalized()`, and the collision depth with `(B - A).length()`. This information is typically used to separate shapes, particularly in collision solvers. - * - * This method needs the transformation matrix for this shape ([localXform]), the movement to test on this shape ([localMotion]), the shape to check collisions with ([withShape]), the transformation matrix of that shape ([shapeXform]), and the movement to test onto the other object ([shapeMotion]). + * Returns a list of contact point pairs where this shape would touch another, if a given movement + * was applied. + * If there would be no collisions, the returned list is empty. Otherwise, the returned list + * contains contact points arranged in pairs, with entries alternating between points on the boundary + * of this shape and points on the boundary of [param with_shape]. + * A collision pair A, B can be used to calculate the collision normal with `(B - + * A).normalized()`, and the collision depth with `(B - A).length()`. This information is typically + * used to separate shapes, particularly in collision solvers. + * This method needs the transformation matrix for this shape ([param local_xform]), the movement + * to test on this shape ([param local_motion]), the shape to check collisions with ([param + * with_shape]), the transformation matrix of that shape ([param shape_xform]), and the movement to + * test onto the other object ([param shape_motion]). */ public fun collideWithMotionAndGetContacts( localXform: Transform2D, @@ -141,7 +148,9 @@ public open class Shape2D internal constructor() : Resource() { } /** - * Draws a solid shape onto a [godot.CanvasItem] with the [godot.RenderingServer] API filled with the specified [color]. The exact drawing method is specific for each shape and cannot be configured. + * Draws a solid shape onto a [CanvasItem] with the [RenderingServer] API filled with the + * specified [param color]. The exact drawing method is specific for each shape and cannot be + * configured. */ public fun draw(canvasItem: RID, color: Color): Unit { TransferContext.writeArguments(_RID to canvasItem, COLOR to color) @@ -149,7 +158,7 @@ public open class Shape2D internal constructor() : Resource() { } /** - * Returns a [godot.core.Rect2] representing the shapes boundary. + * Returns a [Rect2] representing the shapes boundary. */ public fun getRect(): Rect2 { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Shape3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Shape3D.kt index f71d0b6c4..afb4c613e 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Shape3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Shape3D.kt @@ -20,21 +20,18 @@ import kotlin.Int import kotlin.Suppress /** - * Abstract base class for 3D shapes used for physics collision. - * - * Tutorials: - * [$DOCS_URL/tutorials/physics/physics_introduction.html]($DOCS_URL/tutorials/physics/physics_introduction.html) - * * Abstract base class for all 3D shapes, intended for use in physics. - * - * **Performance:** Primitive shapes, especially [godot.SphereShape3D], are fast to check collisions against. [godot.ConvexPolygonShape3D] and [godot.HeightMapShape3D] are slower, and [godot.ConcavePolygonShape3D] is the slowest. + * **Performance:** Primitive shapes, especially [SphereShape3D], are fast to check collisions + * against. [ConvexPolygonShape3D] and [HeightMapShape3D] are slower, and [ConcavePolygonShape3D] is + * the slowest. */ @GodotBaseType public open class Shape3D internal constructor() : Resource() { /** - * The shape's custom solver bias. Defines how much bodies react to enforce contact separation when this shape is involved. - * - * When set to `0`, the default value from [godot.ProjectSettings.physics/3d/solver/defaultContactBias] is used. + * The shape's custom solver bias. Defines how much bodies react to enforce contact separation + * when this shape is involved. + * When set to `0`, the default value from [ProjectSettings.physics/3d/solver/defaultContactBias] + * is used. */ public var customSolverBias: Float get() { @@ -49,8 +46,10 @@ public open class Shape3D internal constructor() : Resource() { /** * The collision margin for the shape. This is not used in Godot Physics. - * - * Collision margins allow collision detection to be more efficient by adding an extra shell around shapes. Collision algorithms are more expensive when objects overlap by more than their margin, so a higher value for margins is better for performance, at the cost of accuracy around edges as it makes them less sharp. + * Collision margins allow collision detection to be more efficient by adding an extra shell + * around shapes. Collision algorithms are more expensive when objects overlap by more than their + * margin, so a higher value for margins is better for performance, at the cost of accuracy around + * edges as it makes them less sharp. */ public var margin: Float get() { @@ -69,7 +68,7 @@ public open class Shape3D internal constructor() : Resource() { } /** - * Returns the [godot.ArrayMesh] used to draw the debug collision for this [godot.Shape3D]. + * Returns the [ArrayMesh] used to draw the debug collision for this [Shape3D]. */ public fun getDebugMesh(): ArrayMesh? { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Shortcut.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Shortcut.kt index f266c43cb..2ca0bd3f8 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Shortcut.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Shortcut.kt @@ -23,18 +23,17 @@ import kotlin.String import kotlin.Suppress /** - * A shortcut for binding input. - * - * Shortcuts are commonly used for interacting with a [godot.Control] element from an [godot.InputEvent] (also known as hotkeys). - * - * One shortcut can contain multiple [godot.InputEvent]'s, allowing the possibility of triggering one action with multiple different inputs. + * Shortcuts are commonly used for interacting with a [Control] element from an [InputEvent] (also + * known as hotkeys). + * One shortcut can contain multiple [InputEvent]'s, allowing the possibility of triggering one + * action with multiple different inputs. */ @GodotBaseType public open class Shortcut : Resource() { /** - * The shortcut's [godot.InputEvent] array. - * - * Generally the [godot.InputEvent] used is an [godot.InputEventKey], though it can be any [godot.InputEvent], including an [godot.InputEventAction]. + * The shortcut's [InputEvent] array. + * Generally the [InputEvent] used is an [InputEventKey], though it can be any [InputEvent], + * including an [InputEventAction]. */ public var events: VariantArray get() { @@ -53,7 +52,7 @@ public open class Shortcut : Resource() { } /** - * Returns whether [events] contains an [godot.InputEvent] which is valid. + * Returns whether [events] contains an [InputEvent] which is valid. */ public fun hasValidEvent(): Boolean { TransferContext.writeArguments() @@ -62,7 +61,7 @@ public open class Shortcut : Resource() { } /** - * Returns whether any [godot.InputEvent] in [events] equals [event]. + * Returns whether any [InputEvent] in [events] equals [param event]. */ public fun matchesEvent(event: InputEvent): Boolean { TransferContext.writeArguments(OBJECT to event) @@ -71,7 +70,7 @@ public open class Shortcut : Resource() { } /** - * Returns the shortcut's first valid [godot.InputEvent] as a [godot.String]. + * Returns the shortcut's first valid [InputEvent] as a [String]. */ public fun getAsText(): String { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Side.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Side.kt index 563389582..c1ee2892e 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Side.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Side.kt @@ -6,9 +6,21 @@ import kotlin.Long public enum class Side( id: Long, ) { + /** + * Left side, usually used for [Control] or [StyleBox]-derived classes. + */ SIDE_LEFT(0), + /** + * Top side, usually used for [Control] or [StyleBox]-derived classes. + */ SIDE_TOP(1), + /** + * Right side, usually used for [Control] or [StyleBox]-derived classes. + */ SIDE_RIGHT(2), + /** + * Bottom side, usually used for [Control] or [StyleBox]-derived classes. + */ SIDE_BOTTOM(3), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Skeleton2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Skeleton2D.kt index 42aa761d9..81a14ee04 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Skeleton2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Skeleton2D.kt @@ -29,19 +29,17 @@ import kotlin.Suppress import kotlin.Unit /** - * The parent of a hierarchy of [godot.Bone2D]s, used to create a 2D skeletal animation. - * - * Tutorials: - * [$DOCS_URL/tutorials/animation/2d_skeletons.html]($DOCS_URL/tutorials/animation/2d_skeletons.html) - * - * [godot.Skeleton2D] parents a hierarchy of [godot.Bone2D] nodes. It holds a reference to each [godot.Bone2D]'s rest pose and acts as a single point of access to its bones. - * - * To set up different types of inverse kinematics for the given Skeleton2D, a [godot.SkeletonModificationStack2D] should be created. The inverse kinematics be applied by increasing [godot.SkeletonModificationStack2D.modificationCount] and creating the desired number of modifications. + * [Skeleton2D] parents a hierarchy of [Bone2D] nodes. It holds a reference to each [Bone2D]'s rest + * pose and acts as a single point of access to its bones. + * To set up different types of inverse kinematics for the given Skeleton2D, a + * [SkeletonModificationStack2D] should be created. The inverse kinematics be applied by increasing + * [SkeletonModificationStack2D.modificationCount] and creating the desired number of modifications. */ @GodotBaseType public open class Skeleton2D : Node2D() { /** - * Emitted when the [godot.Bone2D] setup attached to this skeletons changes. This is primarily used internally within the skeleton. + * Emitted when the [Bone2D] setup attached to this skeletons changes. This is primarily used + * internally within the skeleton. */ public val boneSetupChanged: Signal0 by signal() @@ -51,7 +49,7 @@ public open class Skeleton2D : Node2D() { } /** - * Returns the number of [godot.Bone2D] nodes in the node hierarchy parented by Skeleton2D. + * Returns the number of [Bone2D] nodes in the node hierarchy parented by Skeleton2D. */ public fun getBoneCount(): Int { TransferContext.writeArguments() @@ -60,7 +58,9 @@ public open class Skeleton2D : Node2D() { } /** - * Returns a [godot.Bone2D] from the node hierarchy parented by Skeleton2D. The object to return is identified by the parameter [idx]. Bones are indexed by descending the node hierarchy from top to bottom, adding the children of each branch before moving to the next sibling. + * Returns a [Bone2D] from the node hierarchy parented by Skeleton2D. The object to return is + * identified by the parameter [param idx]. Bones are indexed by descending the node hierarchy from + * top to bottom, adding the children of each branch before moving to the next sibling. */ public fun getBone(idx: Int): Bone2D? { TransferContext.writeArguments(LONG to idx.toLong()) @@ -78,7 +78,7 @@ public open class Skeleton2D : Node2D() { } /** - * Sets the [godot.SkeletonModificationStack2D] attached to this skeleton. + * Sets the [SkeletonModificationStack2D] attached to this skeleton. */ public fun setModificationStack(modificationStack: SkeletonModificationStack2D): Unit { TransferContext.writeArguments(OBJECT to modificationStack) @@ -86,7 +86,7 @@ public open class Skeleton2D : Node2D() { } /** - * Returns the [godot.SkeletonModificationStack2D] attached to this skeleton, if one exists. + * Returns the [SkeletonModificationStack2D] attached to this skeleton, if one exists. */ public fun getModificationStack(): SkeletonModificationStack2D? { TransferContext.writeArguments() @@ -95,7 +95,8 @@ public open class Skeleton2D : Node2D() { } /** - * Executes all the modifications on the [godot.SkeletonModificationStack2D], if the Skeleton2D has one assigned. + * Executes all the modifications on the [SkeletonModificationStack2D], if the Skeleton2D has one + * assigned. */ public fun executeModifications(delta: Float, executionMode: Int): Unit { TransferContext.writeArguments(DOUBLE to delta.toDouble(), LONG to executionMode.toLong()) @@ -103,11 +104,11 @@ public open class Skeleton2D : Node2D() { } /** - * Sets the local pose transform, [overridePose], for the bone at [boneIdx]. - * - * [strength] is the interpolation strength that will be used when applying the pose, and [persistent] determines if the applied pose will remain. - * - * **Note:** The pose transform needs to be a local transform relative to the [godot.Bone2D] node at [boneIdx]! + * Sets the local pose transform, [param override_pose], for the bone at [param bone_idx]. + * [param strength] is the interpolation strength that will be used when applying the pose, and + * [param persistent] determines if the applied pose will remain. + * **Note:** The pose transform needs to be a local transform relative to the [Bone2D] node at + * [param bone_idx]! */ public fun setBoneLocalPoseOverride( boneIdx: Int, @@ -120,7 +121,7 @@ public open class Skeleton2D : Node2D() { } /** - * Returns the local pose override transform for [boneIdx]. + * Returns the local pose override transform for [param bone_idx]. */ public fun getBoneLocalPoseOverride(boneIdx: Int): Transform2D { TransferContext.writeArguments(LONG to boneIdx.toLong()) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonIK3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonIK3D.kt index 88a99879c..a5a170281 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonIK3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonIK3D.kt @@ -35,33 +35,33 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * A node used to rotate all bones of a [godot.Skeleton3D] bone chain a way that places the end bone at a desired 3D position. + * SkeletonIK3D is used to rotate all bones of a [Skeleton3D] bone chain a way that places the end + * bone at a desired 3D position. A typical scenario for IK in games is to place a character's feet on + * the ground or a character's hands on a currently held object. SkeletonIK uses FabrikInverseKinematic + * internally to solve the bone chain and applies the results to the [Skeleton3D] + * `bones_global_pose_override` property for all affected bones in the chain. If fully applied, this + * overwrites any bone transform from [Animation]s or bone custom poses set by users. The applied + * amount can be controlled with the [interpolation] property. + * [codeblock] + * # Apply IK effect automatically on every new frame (not the current) + * skeleton_ik_node.start() * - * Tutorials: - * [https://godotengine.org/asset-library/asset/523](https://godotengine.org/asset-library/asset/523) + * # Apply IK effect only on the current frame + * skeleton_ik_node.start(true) * - * SkeletonIK3D is used to rotate all bones of a [godot.Skeleton3D] bone chain a way that places the end bone at a desired 3D position. A typical scenario for IK in games is to place a character's feet on the ground or a character's hands on a currently held object. SkeletonIK uses FabrikInverseKinematic internally to solve the bone chain and applies the results to the [godot.Skeleton3D] `bones_global_pose_override` property for all affected bones in the chain. If fully applied, this overwrites any bone transform from [godot.Animation]s or bone custom poses set by users. The applied amount can be controlled with the [interpolation] property. + * # Stop IK effect and reset bones_global_pose_override on Skeleton + * skeleton_ik_node.stop() * - * ``` - * # Apply IK effect automatically on every new frame (not the current) - * skeleton_ik_node.start() + * # Apply full IK effect + * skeleton_ik_node.set_interpolation(1.0) * - * # Apply IK effect only on the current frame - * skeleton_ik_node.start(true) - * - * # Stop IK effect and reset bones_global_pose_override on Skeleton - * skeleton_ik_node.stop() - * - * # Apply full IK effect - * skeleton_ik_node.set_interpolation(1.0) - * - * # Apply half IK effect - * skeleton_ik_node.set_interpolation(0.5) - * - * # Apply zero IK effect (a value at or below 0.01 also removes bones_global_pose_override on Skeleton) - * skeleton_ik_node.set_interpolation(0.0) - * ``` + * # Apply half IK effect + * skeleton_ik_node.set_interpolation(0.5) * + * # Apply zero IK effect (a value at or below 0.01 also removes bones_global_pose_override on + * Skeleton) + * skeleton_ik_node.set_interpolation(0.0) + * [/codeblock] * *Deprecated.* This class is deprecated, and might be removed in a future release. */ @GodotBaseType @@ -81,7 +81,8 @@ public open class SkeletonIK3D : Node() { } /** - * The name of the current tip bone, the last bone in the IK chain placed at the [target] transform (or [targetNode] if defined). + * The name of the current tip bone, the last bone in the IK chain placed at the [target] + * transform (or [targetNode] if defined). */ public var tipBone: StringName get() { @@ -95,7 +96,10 @@ public open class SkeletonIK3D : Node() { } /** - * Interpolation value for how much the IK results are applied to the current skeleton bone chain. A value of `1.0` will overwrite all skeleton bone transforms completely while a value of `0.0` will visually disable the SkeletonIK. A value at or below `0.01` also calls [godot.Skeleton3D.clearBonesGlobalPoseOverride]. + * Interpolation value for how much the IK results are applied to the current skeleton bone chain. + * A value of `1.0` will overwrite all skeleton bone transforms completely while a value of `0.0` + * will visually disable the SkeletonIK. A value at or below `0.01` also calls + * [Skeleton3D.clearBonesGlobalPoseOverride]. */ public var interpolation: Float get() { @@ -109,7 +113,9 @@ public open class SkeletonIK3D : Node() { } /** - * First target of the IK chain where the tip bone is placed and, if [overrideTipBasis] is `true`, how the tip bone is rotated. If a [targetNode] path is available the nodes transform is used instead and this property is ignored. + * First target of the IK chain where the tip bone is placed and, if [overrideTipBasis] is `true`, + * how the tip bone is rotated. If a [targetNode] path is available the nodes transform is used + * instead and this property is ignored. */ @CoreTypeLocalCopy public var target: Transform3D @@ -124,7 +130,8 @@ public open class SkeletonIK3D : Node() { } /** - * If `true` overwrites the rotation of the tip bone with the rotation of the [target] (or [targetNode] if defined). + * If `true` overwrites the rotation of the tip bone with the rotation of the [target] (or + * [targetNode] if defined). */ public var overrideTipBasis: Boolean get() { @@ -138,7 +145,9 @@ public open class SkeletonIK3D : Node() { } /** - * If `true`, instructs the IK solver to consider the secondary magnet target (pole target) when calculating the bone chain. Use the magnet position (pole target) to control the bending of the IK chain. + * If `true`, instructs the IK solver to consider the secondary magnet target (pole target) when + * calculating the bone chain. Use the magnet position (pole target) to control the bending of the IK + * chain. */ public var useMagnet: Boolean get() { @@ -152,7 +161,10 @@ public open class SkeletonIK3D : Node() { } /** - * Secondary target position (first is [target] property or [targetNode]) for the IK chain. Use magnet position (pole target) to control the bending of the IK chain. Only works if the bone chain has more than 2 bones. The middle chain bone position will be linearly interpolated with the magnet position. + * Secondary target position (first is [target] property or [targetNode]) for the IK chain. Use + * magnet position (pole target) to control the bending of the IK chain. Only works if the bone chain + * has more than 2 bones. The middle chain bone position will be linearly interpolated with the + * magnet position. */ @CoreTypeLocalCopy public var magnet: Vector3 @@ -167,7 +179,8 @@ public open class SkeletonIK3D : Node() { } /** - * Target node [godot.core.NodePath] for the IK chain. If available, the node's current [godot.Transform3D] is used instead of the [target] property. + * Target node [NodePath] for the IK chain. If available, the node's current [Transform3D] is used + * instead of the [target] property. */ public var targetNode: NodePath get() { @@ -181,7 +194,8 @@ public open class SkeletonIK3D : Node() { } /** - * The minimum distance between bone and goal target. If the distance is below this value, the IK solver stops further iterations. + * The minimum distance between bone and goal target. If the distance is below this value, the IK + * solver stops further iterations. */ public var minDistance: Float get() { @@ -195,7 +209,8 @@ public open class SkeletonIK3D : Node() { } /** - * Number of iteration loops used by the IK solver to produce more accurate (and elegant) bone chain results. + * Number of iteration loops used by the IK solver to produce more accurate (and elegant) bone + * chain results. */ public var maxIterations: Int get() { @@ -214,7 +229,9 @@ public open class SkeletonIK3D : Node() { } /** - * First target of the IK chain where the tip bone is placed and, if [overrideTipBasis] is `true`, how the tip bone is rotated. If a [targetNode] path is available the nodes transform is used instead and this property is ignored. + * First target of the IK chain where the tip bone is placed and, if [overrideTipBasis] is `true`, + * how the tip bone is rotated. If a [targetNode] path is available the nodes transform is used + * instead and this property is ignored. * * This is a helper function to make dealing with local copies easier. * @@ -238,7 +255,10 @@ public open class SkeletonIK3D : Node() { /** - * Secondary target position (first is [target] property or [targetNode]) for the IK chain. Use magnet position (pole target) to control the bending of the IK chain. Only works if the bone chain has more than 2 bones. The middle chain bone position will be linearly interpolated with the magnet position. + * Secondary target position (first is [target] property or [targetNode]) for the IK chain. Use + * magnet position (pole target) to control the bending of the IK chain. Only works if the bone chain + * has more than 2 bones. The middle chain bone position will be linearly interpolated with the + * magnet position. * * This is a helper function to make dealing with local copies easier. * @@ -262,7 +282,9 @@ public open class SkeletonIK3D : Node() { /** - * Returns the parent [godot.Skeleton3D] Node that was present when SkeletonIK entered the [godot.SceneTree]. Returns null if the parent node was not a [godot.Skeleton3D] Node when SkeletonIK3D entered the [godot.SceneTree]. + * Returns the parent [Skeleton3D] Node that was present when SkeletonIK entered the [SceneTree]. + * Returns null if the parent node was not a [Skeleton3D] Node when SkeletonIK3D entered the + * [SceneTree]. */ public fun getParentSkeleton(): Skeleton3D? { TransferContext.writeArguments() @@ -271,7 +293,9 @@ public open class SkeletonIK3D : Node() { } /** - * Returns `true` if SkeletonIK is applying IK effects on continues frames to the [godot.Skeleton3D] bones. Returns `false` if SkeletonIK is stopped or [start] was used with the `one_time` parameter set to `true`. + * Returns `true` if SkeletonIK is applying IK effects on continues frames to the [Skeleton3D] + * bones. Returns `false` if SkeletonIK is stopped or [start] was used with the `one_time` parameter + * set to `true`. */ public fun isRunning(): Boolean { TransferContext.writeArguments() @@ -280,7 +304,9 @@ public open class SkeletonIK3D : Node() { } /** - * Starts applying IK effects on each frame to the [godot.Skeleton3D] bones but will only take effect starting on the next frame. If [oneTime] is `true`, this will take effect immediately but also reset on the next frame. + * Starts applying IK effects on each frame to the [Skeleton3D] bones but will only take effect + * starting on the next frame. If [param one_time] is `true`, this will take effect immediately but + * also reset on the next frame. */ @JvmOverloads public fun start(oneTime: Boolean = false): Unit { @@ -289,7 +315,8 @@ public open class SkeletonIK3D : Node() { } /** - * Stops applying IK effects on each frame to the [godot.Skeleton3D] bones and also calls [godot.Skeleton3D.clearBonesGlobalPoseOverride] to remove existing overrides on all bones. + * Stops applying IK effects on each frame to the [Skeleton3D] bones and also calls + * [Skeleton3D.clearBonesGlobalPoseOverride] to remove existing overrides on all bones. */ public fun stop(): Unit { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonModification2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonModification2D.kt index fbab29b2e..08ba34e9c 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonModification2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonModification2D.kt @@ -24,16 +24,16 @@ import kotlin.Suppress import kotlin.Unit /** - * Base class for resources that operate on [godot.Bone2D]s in a [godot.Skeleton2D]. - * - * This resource provides an interface that can be expanded so code that operates on [godot.Bone2D] nodes in a [godot.Skeleton2D] can be mixed and matched together to create complex interactions. - * - * This is used to provide Godot with a flexible and powerful Inverse Kinematics solution that can be adapted for many different uses. + * This resource provides an interface that can be expanded so code that operates on [Bone2D] nodes + * in a [Skeleton2D] can be mixed and matched together to create complex interactions. + * This is used to provide Godot with a flexible and powerful Inverse Kinematics solution that can + * be adapted for many different uses. */ @GodotBaseType public open class SkeletonModification2D : Resource() { /** - * If `true`, the modification's [_execute] function will be called by the [godot.SkeletonModificationStack2D]. + * If `true`, the modification's [_execute] function will be called by the + * [SkeletonModificationStack2D]. */ public var enabled: Boolean get() { @@ -47,7 +47,8 @@ public open class SkeletonModification2D : Resource() { } /** - * The execution mode for the modification. This tells the modification stack when to execute the modification. Some modifications have settings that are only available in certain execution modes. + * The execution mode for the modification. This tells the modification stack when to execute the + * modification. Some modifications have settings that are only available in certain execution modes. */ public var executionMode: Int get() { @@ -66,7 +67,8 @@ public open class SkeletonModification2D : Resource() { } /** - * Executes the given modification. This is where the modification performs whatever function it is designed to do. + * Executes the given modification. This is where the modification performs whatever function it + * is designed to do. */ public open fun _execute(delta: Double): Unit { } @@ -78,15 +80,17 @@ public open class SkeletonModification2D : Resource() { } /** - * Used for drawing **editor-only** modification gizmos. This function will only be called in the Godot editor and can be overridden to draw custom gizmos. - * - * **Note:** You will need to use the Skeleton2D from [godot.SkeletonModificationStack2D.getSkeleton] and it's draw functions, as the [godot.SkeletonModification2D] resource cannot draw on its own. + * Used for drawing **editor-only** modification gizmos. This function will only be called in the + * Godot editor and can be overridden to draw custom gizmos. + * **Note:** You will need to use the Skeleton2D from [SkeletonModificationStack2D.getSkeleton] + * and it's draw functions, as the [SkeletonModification2D] resource cannot draw on its own. */ public open fun _drawEditorGizmo(): Unit { } /** - * Returns the [godot.SkeletonModificationStack2D] that this modification is bound to. Through the modification stack, you can access the Skeleton2D the modification is operating on. + * Returns the [SkeletonModificationStack2D] that this modification is bound to. Through the + * modification stack, you can access the Skeleton2D the modification is operating on. */ public fun getModificationStack(): SkeletonModificationStack2D? { TransferContext.writeArguments() @@ -95,7 +99,9 @@ public open class SkeletonModification2D : Resource() { } /** - * Manually allows you to set the setup state of the modification. This function should only rarely be used, as the [godot.SkeletonModificationStack2D] the modification is bound to should handle setting the modification up. + * Manually allows you to set the setup state of the modification. This function should only + * rarely be used, as the [SkeletonModificationStack2D] the modification is bound to should handle + * setting the modification up. */ public fun setIsSetup(isSetup: Boolean): Unit { TransferContext.writeArguments(BOOL to isSetup) @@ -112,7 +118,9 @@ public open class SkeletonModification2D : Resource() { } /** - * Takes an angle and clamps it so it is within the passed-in [min] and [max] range. [invert] will inversely clamp the angle, clamping it to the range outside of the given bounds. + * Takes an angle and clamps it so it is within the passed-in [param min] and [param max] range. + * [param invert] will inversely clamp the angle, clamping it to the range outside of the given + * bounds. */ public fun clampAngle( angle: Float, @@ -126,7 +134,8 @@ public open class SkeletonModification2D : Resource() { } /** - * Sets whether this modification will call [_drawEditorGizmo] in the Godot editor to draw modification-specific gizmos. + * Sets whether this modification will call [_drawEditorGizmo] in the Godot editor to draw + * modification-specific gizmos. */ public fun setEditorDrawGizmo(drawGizmo: Boolean): Unit { TransferContext.writeArguments(BOOL to drawGizmo) @@ -134,7 +143,8 @@ public open class SkeletonModification2D : Resource() { } /** - * Returns whether this modification will call [_drawEditorGizmo] in the Godot editor to draw modification-specific gizmos. + * Returns whether this modification will call [_drawEditorGizmo] in the Godot editor to draw + * modification-specific gizmos. */ public fun getEditorDrawGizmo(): Boolean { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonModification2DCCDIK.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonModification2DCCDIK.kt index 909ea85c0..7335f75ec 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonModification2DCCDIK.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonModification2DCCDIK.kt @@ -25,20 +25,24 @@ import kotlin.Suppress import kotlin.Unit /** - * A modification that uses CCDIK to manipulate a series of bones to reach a target in 2D. - * - * This [godot.SkeletonModification2D] uses an algorithm called Cyclic Coordinate Descent Inverse Kinematics, or CCDIK, to manipulate a chain of bones in a [godot.Skeleton2D] so it reaches a defined target. - * - * CCDIK works by rotating a set of bones, typically called a "bone chain", on a single axis. Each bone is rotated to face the target from the tip (by default), which over a chain of bones allow it to rotate properly to reach the target. Because the bones only rotate on a single axis, CCDIK *can* look more robotic than other IK solvers. - * - * **Note:** The CCDIK modifier has `ccdik_joints`, which are the data objects that hold the data for each joint in the CCDIK chain. This is different from a bone! CCDIK joints hold the data needed for each bone in the bone chain used by CCDIK. - * - * CCDIK also fully supports angle constraints, allowing for more control over how a solution is met. + * This [SkeletonModification2D] uses an algorithm called Cyclic Coordinate Descent Inverse + * Kinematics, or CCDIK, to manipulate a chain of bones in a [Skeleton2D] so it reaches a defined + * target. + * CCDIK works by rotating a set of bones, typically called a "bone chain", on a single axis. Each + * bone is rotated to face the target from the tip (by default), which over a chain of bones allow it + * to rotate properly to reach the target. Because the bones only rotate on a single axis, CCDIK *can* + * look more robotic than other IK solvers. + * **Note:** The CCDIK modifier has `ccdik_joints`, which are the data objects that hold the data + * for each joint in the CCDIK chain. This is different from a bone! CCDIK joints hold the data needed + * for each bone in the bone chain used by CCDIK. + * CCDIK also fully supports angle constraints, allowing for more control over how a solution is + * met. */ @GodotBaseType public open class SkeletonModification2DCCDIK : SkeletonModification2D() { /** - * The NodePath to the node that is the target for the CCDIK modification. This node is what the CCDIK chain will attempt to rotate the bone chain to. + * The NodePath to the node that is the target for the CCDIK modification. This node is what the + * CCDIK chain will attempt to rotate the bone chain to. */ public var targetNodepath: NodePath get() { @@ -52,7 +56,8 @@ public open class SkeletonModification2DCCDIK : SkeletonModification2D() { } /** - * The end position of the CCDIK chain. Typically, this should be a child of a [godot.Bone2D] node attached to the final [godot.Bone2D] in the CCDIK chain. + * The end position of the CCDIK chain. Typically, this should be a child of a [Bone2D] node + * attached to the final [Bone2D] in the CCDIK chain. */ public var tipNodepath: NodePath get() { @@ -85,7 +90,7 @@ public open class SkeletonModification2DCCDIK : SkeletonModification2D() { } /** - * Sets the [godot.Bone2D] node assigned to the CCDIK joint at [jointIdx]. + * Sets the [Bone2D] node assigned to the CCDIK joint at [param joint_idx]. */ public fun setCcdikJointBone2dNode(jointIdx: Int, bone2dNodepath: NodePath): Unit { TransferContext.writeArguments(LONG to jointIdx.toLong(), NODE_PATH to bone2dNodepath) @@ -93,7 +98,7 @@ public open class SkeletonModification2DCCDIK : SkeletonModification2D() { } /** - * Returns the [godot.Bone2D] node assigned to the CCDIK joint at [jointIdx]. + * Returns the [Bone2D] node assigned to the CCDIK joint at [param joint_idx]. */ public fun getCcdikJointBone2dNode(jointIdx: Int): NodePath { TransferContext.writeArguments(LONG to jointIdx.toLong()) @@ -102,7 +107,9 @@ public open class SkeletonModification2DCCDIK : SkeletonModification2D() { } /** - * Sets the bone index, [boneIdx], of the CCDIK joint at [jointIdx]. When possible, this will also update the `bone2d_node` of the CCDIK joint based on data provided by the linked skeleton. + * Sets the bone index, [param bone_idx], of the CCDIK joint at [param joint_idx]. When possible, + * this will also update the `bone2d_node` of the CCDIK joint based on data provided by the linked + * skeleton. */ public fun setCcdikJointBoneIndex(jointIdx: Int, boneIdx: Int): Unit { TransferContext.writeArguments(LONG to jointIdx.toLong(), LONG to boneIdx.toLong()) @@ -110,7 +117,7 @@ public open class SkeletonModification2DCCDIK : SkeletonModification2D() { } /** - * Returns the index of the [godot.Bone2D] node assigned to the CCDIK joint at [jointIdx]. + * Returns the index of the [Bone2D] node assigned to the CCDIK joint at [param joint_idx]. */ public fun getCcdikJointBoneIndex(jointIdx: Int): Int { TransferContext.writeArguments(LONG to jointIdx.toLong()) @@ -119,7 +126,8 @@ public open class SkeletonModification2DCCDIK : SkeletonModification2D() { } /** - * Sets whether the joint at [jointIdx] is set to rotate from the joint, `true`, or to rotate from the tip, `false`. + * Sets whether the joint at [param joint_idx] is set to rotate from the joint, `true`, or to + * rotate from the tip, `false`. */ public fun setCcdikJointRotateFromJoint(jointIdx: Int, rotateFromJoint: Boolean): Unit { TransferContext.writeArguments(LONG to jointIdx.toLong(), BOOL to rotateFromJoint) @@ -127,7 +135,8 @@ public open class SkeletonModification2DCCDIK : SkeletonModification2D() { } /** - * Returns whether the joint at [jointIdx] is set to rotate from the joint, `true`, or to rotate from the tip, `false`. The default is to rotate from the tip. + * Returns whether the joint at [param joint_idx] is set to rotate from the joint, `true`, or to + * rotate from the tip, `false`. The default is to rotate from the tip. */ public fun getCcdikJointRotateFromJoint(jointIdx: Int): Boolean { TransferContext.writeArguments(LONG to jointIdx.toLong()) @@ -136,7 +145,8 @@ public open class SkeletonModification2DCCDIK : SkeletonModification2D() { } /** - * Determines whether angle constraints on the CCDIK joint at [jointIdx] are enabled. When `true`, constraints will be enabled and taken into account when solving. + * Determines whether angle constraints on the CCDIK joint at [param joint_idx] are enabled. When + * `true`, constraints will be enabled and taken into account when solving. */ public fun setCcdikJointEnableConstraint(jointIdx: Int, enableConstraint: Boolean): Unit { TransferContext.writeArguments(LONG to jointIdx.toLong(), BOOL to enableConstraint) @@ -144,7 +154,7 @@ public open class SkeletonModification2DCCDIK : SkeletonModification2D() { } /** - * Returns whether angle constraints on the CCDIK joint at [jointIdx] are enabled. + * Returns whether angle constraints on the CCDIK joint at [param joint_idx] are enabled. */ public fun getCcdikJointEnableConstraint(jointIdx: Int): Boolean { TransferContext.writeArguments(LONG to jointIdx.toLong()) @@ -153,7 +163,7 @@ public open class SkeletonModification2DCCDIK : SkeletonModification2D() { } /** - * Sets the minimum angle constraint for the joint at [jointIdx]. + * Sets the minimum angle constraint for the joint at [param joint_idx]. */ public fun setCcdikJointConstraintAngleMin(jointIdx: Int, angleMin: Float): Unit { TransferContext.writeArguments(LONG to jointIdx.toLong(), DOUBLE to angleMin.toDouble()) @@ -161,7 +171,7 @@ public open class SkeletonModification2DCCDIK : SkeletonModification2D() { } /** - * Returns the minimum angle constraint for the joint at [jointIdx]. + * Returns the minimum angle constraint for the joint at [param joint_idx]. */ public fun getCcdikJointConstraintAngleMin(jointIdx: Int): Float { TransferContext.writeArguments(LONG to jointIdx.toLong()) @@ -170,7 +180,7 @@ public open class SkeletonModification2DCCDIK : SkeletonModification2D() { } /** - * Sets the maximum angle constraint for the joint at [jointIdx]. + * Sets the maximum angle constraint for the joint at [param joint_idx]. */ public fun setCcdikJointConstraintAngleMax(jointIdx: Int, angleMax: Float): Unit { TransferContext.writeArguments(LONG to jointIdx.toLong(), DOUBLE to angleMax.toDouble()) @@ -178,7 +188,7 @@ public open class SkeletonModification2DCCDIK : SkeletonModification2D() { } /** - * Returns the maximum angle constraint for the joint at [jointIdx]. + * Returns the maximum angle constraint for the joint at [param joint_idx]. */ public fun getCcdikJointConstraintAngleMax(jointIdx: Int): Float { TransferContext.writeArguments(LONG to jointIdx.toLong()) @@ -187,9 +197,10 @@ public open class SkeletonModification2DCCDIK : SkeletonModification2D() { } /** - * Sets whether the CCDIK joint at [jointIdx] uses an inverted joint constraint. - * - * An inverted joint constraint only constraints the CCDIK joint to the angles *outside of* the inputted minimum and maximum angles. For this reason, it is referred to as an inverted joint constraint, as it constraints the joint to the outside of the inputted values. + * Sets whether the CCDIK joint at [param joint_idx] uses an inverted joint constraint. + * An inverted joint constraint only constraints the CCDIK joint to the angles *outside of* the + * inputted minimum and maximum angles. For this reason, it is referred to as an inverted joint + * constraint, as it constraints the joint to the outside of the inputted values. */ public fun setCcdikJointConstraintAngleInvert(jointIdx: Int, invert: Boolean): Unit { TransferContext.writeArguments(LONG to jointIdx.toLong(), BOOL to invert) @@ -197,7 +208,8 @@ public open class SkeletonModification2DCCDIK : SkeletonModification2D() { } /** - * Returns whether the CCDIK joint at [jointIdx] uses an inverted joint constraint. See [setCcdikJointConstraintAngleInvert] for details. + * Returns whether the CCDIK joint at [param joint_idx] uses an inverted joint constraint. See + * [setCcdikJointConstraintAngleInvert] for details. */ public fun getCcdikJointConstraintAngleInvert(jointIdx: Int): Boolean { TransferContext.writeArguments(LONG to jointIdx.toLong()) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonModification2DFABRIK.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonModification2DFABRIK.kt index 5ff445d5e..893809b12 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonModification2DFABRIK.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonModification2DFABRIK.kt @@ -24,22 +24,29 @@ import kotlin.Suppress import kotlin.Unit /** - * A modification that uses FABRIK to manipulate a series of [godot.Bone2D] nodes to reach a target. - * - * This [godot.SkeletonModification2D] uses an algorithm called Forward And Backward Reaching Inverse Kinematics, or FABRIK, to rotate a bone chain so that it reaches a target. - * - * FABRIK works by knowing the positions and lengths of a series of bones, typically called a "bone chain". It first starts by running a forward pass, which places the final bone at the target's position. Then all other bones are moved towards the tip bone, so they stay at the defined bone length away. Then a backwards pass is performed, where the root/first bone in the FABRIK chain is placed back at the origin. Then all other bones are moved so they stay at the defined bone length away. This positions the bone chain so that it reaches the target when possible, but all of the bones stay the correct length away from each other. - * - * Because of how FABRIK works, it often gives more natural results than those seen in [godot.SkeletonModification2DCCDIK]. FABRIK also supports angle constraints, which are fully taken into account when solving. - * - * **Note:** The FABRIK modifier has `fabrik_joints`, which are the data objects that hold the data for each joint in the FABRIK chain. This is different from [godot.Bone2D] nodes! FABRIK joints hold the data needed for each [godot.Bone2D] in the bone chain used by FABRIK. - * - * To help control how the FABRIK joints move, a magnet vector can be passed, which can nudge the bones in a certain direction prior to solving, giving a level of control over the final result. + * This [SkeletonModification2D] uses an algorithm called Forward And Backward Reaching Inverse + * Kinematics, or FABRIK, to rotate a bone chain so that it reaches a target. + * FABRIK works by knowing the positions and lengths of a series of bones, typically called a "bone + * chain". It first starts by running a forward pass, which places the final bone at the target's + * position. Then all other bones are moved towards the tip bone, so they stay at the defined bone + * length away. Then a backwards pass is performed, where the root/first bone in the FABRIK chain is + * placed back at the origin. Then all other bones are moved so they stay at the defined bone length + * away. This positions the bone chain so that it reaches the target when possible, but all of the + * bones stay the correct length away from each other. + * Because of how FABRIK works, it often gives more natural results than those seen in + * [SkeletonModification2DCCDIK]. FABRIK also supports angle constraints, which are fully taken into + * account when solving. + * **Note:** The FABRIK modifier has `fabrik_joints`, which are the data objects that hold the data + * for each joint in the FABRIK chain. This is different from [Bone2D] nodes! FABRIK joints hold the + * data needed for each [Bone2D] in the bone chain used by FABRIK. + * To help control how the FABRIK joints move, a magnet vector can be passed, which can nudge the + * bones in a certain direction prior to solving, giving a level of control over the final result. */ @GodotBaseType public open class SkeletonModification2DFABRIK : SkeletonModification2D() { /** - * The NodePath to the node that is the target for the FABRIK modification. This node is what the FABRIK chain will attempt to rotate the bone chain to. + * The NodePath to the node that is the target for the FABRIK modification. This node is what the + * FABRIK chain will attempt to rotate the bone chain to. */ public var targetNodepath: NodePath get() { @@ -72,7 +79,7 @@ public open class SkeletonModification2DFABRIK : SkeletonModification2D() { } /** - * Sets the [godot.Bone2D] node assigned to the FABRIK joint at [jointIdx]. + * Sets the [Bone2D] node assigned to the FABRIK joint at [param joint_idx]. */ public fun setFabrikJointBone2dNode(jointIdx: Int, bone2dNodepath: NodePath): Unit { TransferContext.writeArguments(LONG to jointIdx.toLong(), NODE_PATH to bone2dNodepath) @@ -80,7 +87,7 @@ public open class SkeletonModification2DFABRIK : SkeletonModification2D() { } /** - * Returns the [godot.Bone2D] node assigned to the FABRIK joint at [jointIdx]. + * Returns the [Bone2D] node assigned to the FABRIK joint at [param joint_idx]. */ public fun getFabrikJointBone2dNode(jointIdx: Int): NodePath { TransferContext.writeArguments(LONG to jointIdx.toLong()) @@ -89,7 +96,9 @@ public open class SkeletonModification2DFABRIK : SkeletonModification2D() { } /** - * Sets the bone index, [boneIdx], of the FABRIK joint at [jointIdx]. When possible, this will also update the `bone2d_node` of the FABRIK joint based on data provided by the linked skeleton. + * Sets the bone index, [param bone_idx], of the FABRIK joint at [param joint_idx]. When possible, + * this will also update the `bone2d_node` of the FABRIK joint based on data provided by the linked + * skeleton. */ public fun setFabrikJointBoneIndex(jointIdx: Int, boneIdx: Int): Unit { TransferContext.writeArguments(LONG to jointIdx.toLong(), LONG to boneIdx.toLong()) @@ -97,7 +106,7 @@ public open class SkeletonModification2DFABRIK : SkeletonModification2D() { } /** - * Returns the index of the [godot.Bone2D] node assigned to the FABRIK joint at [jointIdx]. + * Returns the index of the [Bone2D] node assigned to the FABRIK joint at [param joint_idx]. */ public fun getFabrikJointBoneIndex(jointIdx: Int): Int { TransferContext.writeArguments(LONG to jointIdx.toLong()) @@ -106,7 +115,7 @@ public open class SkeletonModification2DFABRIK : SkeletonModification2D() { } /** - * Sets the magnet position vector for the joint at [jointIdx]. + * Sets the magnet position vector for the joint at [param joint_idx]. */ public fun setFabrikJointMagnetPosition(jointIdx: Int, magnetPosition: Vector2): Unit { TransferContext.writeArguments(LONG to jointIdx.toLong(), VECTOR2 to magnetPosition) @@ -114,7 +123,7 @@ public open class SkeletonModification2DFABRIK : SkeletonModification2D() { } /** - * Returns the magnet position vector for the joint at [jointIdx]. + * Returns the magnet position vector for the joint at [param joint_idx]. */ public fun getFabrikJointMagnetPosition(jointIdx: Int): Vector2 { TransferContext.writeArguments(LONG to jointIdx.toLong()) @@ -123,9 +132,10 @@ public open class SkeletonModification2DFABRIK : SkeletonModification2D() { } /** - * Sets whether the joint at [jointIdx] will use the target node's rotation rather than letting FABRIK rotate the node. - * - * **Note:** This option only works for the tip/final joint in the chain. For all other nodes, this option will be ignored. + * Sets whether the joint at [param joint_idx] will use the target node's rotation rather than + * letting FABRIK rotate the node. + * **Note:** This option only works for the tip/final joint in the chain. For all other nodes, + * this option will be ignored. */ public fun setFabrikJointUseTargetRotation(jointIdx: Int, useTargetRotation: Boolean): Unit { TransferContext.writeArguments(LONG to jointIdx.toLong(), BOOL to useTargetRotation) @@ -133,7 +143,8 @@ public open class SkeletonModification2DFABRIK : SkeletonModification2D() { } /** - * Returns whether the joint is using the target's rotation rather than allowing FABRIK to rotate the joint. This option only applies to the tip/final joint in the chain. + * Returns whether the joint is using the target's rotation rather than allowing FABRIK to rotate + * the joint. This option only applies to the tip/final joint in the chain. */ public fun getFabrikJointUseTargetRotation(jointIdx: Int): Boolean { TransferContext.writeArguments(LONG to jointIdx.toLong()) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonModification2DJiggle.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonModification2DJiggle.kt index 8a448db27..d3d196402 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonModification2DJiggle.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonModification2DJiggle.kt @@ -29,18 +29,23 @@ import kotlin.Suppress import kotlin.Unit /** - * A modification that jiggles [godot.Bone2D] nodes as they move towards a target. - * - * This modification moves a series of bones, typically called a bone chain, towards a target. What makes this modification special is that it calculates the velocity and acceleration for each bone in the bone chain, and runs a very light physics-like calculation using the inputted values. This allows the bones to overshoot the target and "jiggle" around. It can be configured to act more like a spring, or sway around like cloth might. - * - * This modification is useful for adding additional motion to things like hair, the edges of clothing, and more. It has several settings to that allow control over how the joint moves when the target moves. - * - * **Note:** The Jiggle modifier has `jiggle_joints`, which are the data objects that hold the data for each joint in the Jiggle chain. This is different from than [godot.Bone2D] nodes! Jiggle joints hold the data needed for each [godot.Bone2D] in the bone chain used by the Jiggle modification. + * This modification moves a series of bones, typically called a bone chain, towards a target. What + * makes this modification special is that it calculates the velocity and acceleration for each bone in + * the bone chain, and runs a very light physics-like calculation using the inputted values. This + * allows the bones to overshoot the target and "jiggle" around. It can be configured to act more like + * a spring, or sway around like cloth might. + * This modification is useful for adding additional motion to things like hair, the edges of + * clothing, and more. It has several settings to that allow control over how the joint moves when the + * target moves. + * **Note:** The Jiggle modifier has `jiggle_joints`, which are the data objects that hold the data + * for each joint in the Jiggle chain. This is different from than [Bone2D] nodes! Jiggle joints hold + * the data needed for each [Bone2D] in the bone chain used by the Jiggle modification. */ @GodotBaseType public open class SkeletonModification2DJiggle : SkeletonModification2D() { /** - * The NodePath to the node that is the target for the Jiggle modification. This node is what the Jiggle chain will attempt to rotate the bone chain to. + * The NodePath to the node that is the target for the Jiggle modification. This node is what the + * Jiggle chain will attempt to rotate the bone chain to. */ public var targetNodepath: NodePath get() { @@ -68,7 +73,8 @@ public open class SkeletonModification2DJiggle : SkeletonModification2D() { } /** - * The default amount of stiffness assigned to the Jiggle joints, if they are not overridden. Higher values act more like springs, quickly moving into the correct position. + * The default amount of stiffness assigned to the Jiggle joints, if they are not overridden. + * Higher values act more like springs, quickly moving into the correct position. */ public var stiffness: Float get() { @@ -82,7 +88,8 @@ public open class SkeletonModification2DJiggle : SkeletonModification2D() { } /** - * The default amount of mass assigned to the Jiggle joints, if they are not overridden. Higher values lead to faster movements and more overshooting. + * The default amount of mass assigned to the Jiggle joints, if they are not overridden. Higher + * values lead to faster movements and more overshooting. */ public var mass: Float get() { @@ -96,7 +103,8 @@ public open class SkeletonModification2DJiggle : SkeletonModification2D() { } /** - * The default amount of damping applied to the Jiggle joints, if they are not overridden. Higher values lead to more of the calculated velocity being applied. + * The default amount of damping applied to the Jiggle joints, if they are not overridden. Higher + * values lead to more of the calculated velocity being applied. */ public var damping: Float get() { @@ -110,7 +118,8 @@ public open class SkeletonModification2DJiggle : SkeletonModification2D() { } /** - * Whether the gravity vector, [gravity], should be applied to the Jiggle joints, assuming they are not overriding the default settings. + * Whether the gravity vector, [gravity], should be applied to the Jiggle joints, assuming they + * are not overriding the default settings. */ public var useGravity: Boolean get() { @@ -168,7 +177,8 @@ public open class SkeletonModification2DJiggle : SkeletonModification2D() { /** - * If `true`, the Jiggle modifier will take colliders into account, keeping them from entering into these collision objects. + * If `true`, the Jiggle modifier will take colliders into account, keeping them from entering + * into these collision objects. */ public fun setUseColliders(useColliders: Boolean): Unit { TransferContext.writeArguments(BOOL to useColliders) @@ -185,7 +195,8 @@ public open class SkeletonModification2DJiggle : SkeletonModification2D() { } /** - * Sets the collision mask that the Jiggle modifier will use when reacting to colliders, if the Jiggle modifier is set to take colliders into account. + * Sets the collision mask that the Jiggle modifier will use when reacting to colliders, if the + * Jiggle modifier is set to take colliders into account. */ public fun setCollisionMask(collisionMask: Int): Unit { TransferContext.writeArguments(LONG to collisionMask.toLong()) @@ -202,7 +213,7 @@ public open class SkeletonModification2DJiggle : SkeletonModification2D() { } /** - * Sets the [godot.Bone2D] node assigned to the Jiggle joint at [jointIdx]. + * Sets the [Bone2D] node assigned to the Jiggle joint at [param joint_idx]. */ public fun setJiggleJointBone2dNode(jointIdx: Int, bone2dNode: NodePath): Unit { TransferContext.writeArguments(LONG to jointIdx.toLong(), NODE_PATH to bone2dNode) @@ -210,7 +221,7 @@ public open class SkeletonModification2DJiggle : SkeletonModification2D() { } /** - * Returns the [godot.Bone2D] node assigned to the Jiggle joint at [jointIdx]. + * Returns the [Bone2D] node assigned to the Jiggle joint at [param joint_idx]. */ public fun getJiggleJointBone2dNode(jointIdx: Int): NodePath { TransferContext.writeArguments(LONG to jointIdx.toLong()) @@ -219,7 +230,9 @@ public open class SkeletonModification2DJiggle : SkeletonModification2D() { } /** - * Sets the bone index, [boneIdx], of the Jiggle joint at [jointIdx]. When possible, this will also update the `bone2d_node` of the Jiggle joint based on data provided by the linked skeleton. + * Sets the bone index, [param bone_idx], of the Jiggle joint at [param joint_idx]. When possible, + * this will also update the `bone2d_node` of the Jiggle joint based on data provided by the linked + * skeleton. */ public fun setJiggleJointBoneIndex(jointIdx: Int, boneIdx: Int): Unit { TransferContext.writeArguments(LONG to jointIdx.toLong(), LONG to boneIdx.toLong()) @@ -227,7 +240,7 @@ public open class SkeletonModification2DJiggle : SkeletonModification2D() { } /** - * Returns the index of the [godot.Bone2D] node assigned to the Jiggle joint at [jointIdx]. + * Returns the index of the [Bone2D] node assigned to the Jiggle joint at [param joint_idx]. */ public fun getJiggleJointBoneIndex(jointIdx: Int): Int { TransferContext.writeArguments(LONG to jointIdx.toLong()) @@ -236,7 +249,9 @@ public open class SkeletonModification2DJiggle : SkeletonModification2D() { } /** - * Sets whether the Jiggle joint at [jointIdx] should override the default Jiggle joint settings. Setting this to `true` will make the joint use its own settings rather than the default ones attached to the modification. + * Sets whether the Jiggle joint at [param joint_idx] should override the default Jiggle joint + * settings. Setting this to `true` will make the joint use its own settings rather than the default + * ones attached to the modification. */ public fun setJiggleJointOverride(jointIdx: Int, `override`: Boolean): Unit { TransferContext.writeArguments(LONG to jointIdx.toLong(), BOOL to override) @@ -244,7 +259,8 @@ public open class SkeletonModification2DJiggle : SkeletonModification2D() { } /** - * Returns a boolean that indicates whether the joint at [jointIdx] is overriding the default Jiggle joint data defined in the modification. + * Returns a boolean that indicates whether the joint at [param joint_idx] is overriding the + * default Jiggle joint data defined in the modification. */ public fun getJiggleJointOverride(jointIdx: Int): Boolean { TransferContext.writeArguments(LONG to jointIdx.toLong()) @@ -253,7 +269,7 @@ public open class SkeletonModification2DJiggle : SkeletonModification2D() { } /** - * Sets the of stiffness of the Jiggle joint at [jointIdx]. + * Sets the of stiffness of the Jiggle joint at [param joint_idx]. */ public fun setJiggleJointStiffness(jointIdx: Int, stiffness: Float): Unit { TransferContext.writeArguments(LONG to jointIdx.toLong(), DOUBLE to stiffness.toDouble()) @@ -261,7 +277,7 @@ public open class SkeletonModification2DJiggle : SkeletonModification2D() { } /** - * Returns the stiffness of the Jiggle joint at [jointIdx]. + * Returns the stiffness of the Jiggle joint at [param joint_idx]. */ public fun getJiggleJointStiffness(jointIdx: Int): Float { TransferContext.writeArguments(LONG to jointIdx.toLong()) @@ -270,7 +286,7 @@ public open class SkeletonModification2DJiggle : SkeletonModification2D() { } /** - * Sets the of mass of the Jiggle joint at [jointIdx]. + * Sets the of mass of the Jiggle joint at [param joint_idx]. */ public fun setJiggleJointMass(jointIdx: Int, mass: Float): Unit { TransferContext.writeArguments(LONG to jointIdx.toLong(), DOUBLE to mass.toDouble()) @@ -278,7 +294,7 @@ public open class SkeletonModification2DJiggle : SkeletonModification2D() { } /** - * Returns the amount of mass of the jiggle joint at [jointIdx]. + * Returns the amount of mass of the jiggle joint at [param joint_idx]. */ public fun getJiggleJointMass(jointIdx: Int): Float { TransferContext.writeArguments(LONG to jointIdx.toLong()) @@ -287,7 +303,7 @@ public open class SkeletonModification2DJiggle : SkeletonModification2D() { } /** - * Sets the amount of damping of the Jiggle joint at [jointIdx]. + * Sets the amount of damping of the Jiggle joint at [param joint_idx]. */ public fun setJiggleJointDamping(jointIdx: Int, damping: Float): Unit { TransferContext.writeArguments(LONG to jointIdx.toLong(), DOUBLE to damping.toDouble()) @@ -295,7 +311,7 @@ public open class SkeletonModification2DJiggle : SkeletonModification2D() { } /** - * Returns the amount of damping of the Jiggle joint at [jointIdx]. + * Returns the amount of damping of the Jiggle joint at [param joint_idx]. */ public fun getJiggleJointDamping(jointIdx: Int): Float { TransferContext.writeArguments(LONG to jointIdx.toLong()) @@ -304,7 +320,7 @@ public open class SkeletonModification2DJiggle : SkeletonModification2D() { } /** - * Sets whether the Jiggle joint at [jointIdx] should use gravity. + * Sets whether the Jiggle joint at [param joint_idx] should use gravity. */ public fun setJiggleJointUseGravity(jointIdx: Int, useGravity: Boolean): Unit { TransferContext.writeArguments(LONG to jointIdx.toLong(), BOOL to useGravity) @@ -312,7 +328,8 @@ public open class SkeletonModification2DJiggle : SkeletonModification2D() { } /** - * Returns a boolean that indicates whether the joint at [jointIdx] is using gravity or not. + * Returns a boolean that indicates whether the joint at [param joint_idx] is using gravity or + * not. */ public fun getJiggleJointUseGravity(jointIdx: Int): Boolean { TransferContext.writeArguments(LONG to jointIdx.toLong()) @@ -321,7 +338,7 @@ public open class SkeletonModification2DJiggle : SkeletonModification2D() { } /** - * Sets the gravity vector of the Jiggle joint at [jointIdx]. + * Sets the gravity vector of the Jiggle joint at [param joint_idx]. */ public fun setJiggleJointGravity(jointIdx: Int, gravity: Vector2): Unit { TransferContext.writeArguments(LONG to jointIdx.toLong(), VECTOR2 to gravity) @@ -329,7 +346,8 @@ public open class SkeletonModification2DJiggle : SkeletonModification2D() { } /** - * Returns a [godot.core.Vector2] representing the amount of gravity the Jiggle joint at [jointIdx] is influenced by. + * Returns a [Vector2] representing the amount of gravity the Jiggle joint at [param joint_idx] is + * influenced by. */ public fun getJiggleJointGravity(jointIdx: Int): Vector2 { TransferContext.writeArguments(LONG to jointIdx.toLong()) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonModification2DLookAt.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonModification2DLookAt.kt index 08f8f696b..3edab55a6 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonModification2DLookAt.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonModification2DLookAt.kt @@ -25,14 +25,14 @@ import kotlin.Suppress import kotlin.Unit /** - * A modification that rotates a [godot.Bone2D] node to look at a target. - * - * This [godot.SkeletonModification2D] rotates a bone to look a target. This is extremely helpful for moving character's head to look at the player, rotating a turret to look at a target, or any other case where you want to make a bone rotate towards something quickly and easily. + * This [SkeletonModification2D] rotates a bone to look a target. This is extremely helpful for + * moving character's head to look at the player, rotating a turret to look at a target, or any other + * case where you want to make a bone rotate towards something quickly and easily. */ @GodotBaseType public open class SkeletonModification2DLookAt : SkeletonModification2D() { /** - * The index of the [godot.Bone2D] node that the modification will operate on. + * The index of the [Bone2D] node that the modification will operate on. */ public var boneIndex: Int get() { @@ -46,7 +46,7 @@ public open class SkeletonModification2DLookAt : SkeletonModification2D() { } /** - * The [godot.Bone2D] node that the modification will operate on. + * The [Bone2D] node that the modification will operate on. */ public var bone2dNode: NodePath get() { @@ -60,7 +60,8 @@ public open class SkeletonModification2DLookAt : SkeletonModification2D() { } /** - * The NodePath to the node that is the target for the LookAt modification. This node is what the modification will rotate the [godot.Bone2D] to. + * The NodePath to the node that is the target for the LookAt modification. This node is what the + * modification will rotate the [Bone2D] to. */ public var targetNodepath: NodePath get() { @@ -79,7 +80,8 @@ public open class SkeletonModification2DLookAt : SkeletonModification2D() { } /** - * Sets the amount of additional rotation that is to be applied after executing the modification. This allows for offsetting the results by the inputted rotation amount. + * Sets the amount of additional rotation that is to be applied after executing the modification. + * This allows for offsetting the results by the inputted rotation amount. */ public fun setAdditionalRotation(rotation: Float): Unit { TransferContext.writeArguments(DOUBLE to rotation.toDouble()) @@ -87,7 +89,8 @@ public open class SkeletonModification2DLookAt : SkeletonModification2D() { } /** - * Returns the amount of additional rotation that is applied after the LookAt modification executes. + * Returns the amount of additional rotation that is applied after the LookAt modification + * executes. */ public fun getAdditionalRotation(): Float { TransferContext.writeArguments() @@ -96,7 +99,8 @@ public open class SkeletonModification2DLookAt : SkeletonModification2D() { } /** - * Sets whether this modification will use constraints or not. When `true`, constraints will be applied when solving the LookAt modification. + * Sets whether this modification will use constraints or not. When `true`, constraints will be + * applied when solving the LookAt modification. */ public fun setEnableConstraint(enableConstraint: Boolean): Unit { TransferContext.writeArguments(BOOL to enableConstraint) @@ -148,8 +152,9 @@ public open class SkeletonModification2DLookAt : SkeletonModification2D() { /** * When `true`, the modification will use an inverted joint constraint. - * - * An inverted joint constraint only constraints the [godot.Bone2D] to the angles *outside of* the inputted minimum and maximum angles. For this reason, it is referred to as an inverted joint constraint, as it constraints the joint to the outside of the inputted values. + * An inverted joint constraint only constraints the [Bone2D] to the angles *outside of* the + * inputted minimum and maximum angles. For this reason, it is referred to as an inverted joint + * constraint, as it constraints the joint to the outside of the inputted values. */ public fun setConstraintAngleInvert(invert: Boolean): Unit { TransferContext.writeArguments(BOOL to invert) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonModification2DPhysicalBones.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonModification2DPhysicalBones.kt index 8bdc7bd8e..e3d6eec9d 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonModification2DPhysicalBones.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonModification2DPhysicalBones.kt @@ -25,16 +25,16 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * A modification that applies the transforms of [godot.PhysicalBone2D] nodes to [godot.Bone2D] nodes. - * - * This modification takes the transforms of [godot.PhysicalBone2D] nodes and applies them to [godot.Bone2D] nodes. This allows the [godot.Bone2D] nodes to react to physics thanks to the linked [godot.PhysicalBone2D] nodes. - * - * Experimental. Physical bones may be changed in the future to perform the position update of [godot.Bone2D] on their own. + * This modification takes the transforms of [PhysicalBone2D] nodes and applies them to [Bone2D] + * nodes. This allows the [Bone2D] nodes to react to physics thanks to the linked [PhysicalBone2D] + * nodes. + * Experimental. Physical bones may be changed in the future to perform the position update of + * [Bone2D] on their own. */ @GodotBaseType public open class SkeletonModification2DPhysicalBones : SkeletonModification2D() { /** - * The number of [godot.PhysicalBone2D] nodes linked in this modification. + * The number of [PhysicalBone2D] nodes linked in this modification. */ public var physicalBoneChainLength: Int get() { @@ -53,9 +53,9 @@ public open class SkeletonModification2DPhysicalBones : SkeletonModification2D() } /** - * Sets the [godot.PhysicalBone2D] node at [jointIdx]. - * - * **Note:** This is just the index used for this modification, not the bone index used in the [godot.Skeleton2D]. + * Sets the [PhysicalBone2D] node at [param joint_idx]. + * **Note:** This is just the index used for this modification, not the bone index used in the + * [Skeleton2D]. */ public fun setPhysicalBoneNode(jointIdx: Int, physicalbone2dNode: NodePath): Unit { TransferContext.writeArguments(LONG to jointIdx.toLong(), NODE_PATH to physicalbone2dNode) @@ -63,7 +63,7 @@ public open class SkeletonModification2DPhysicalBones : SkeletonModification2D() } /** - * Returns the [godot.PhysicalBone2D] node at [jointIdx]. + * Returns the [PhysicalBone2D] node at [param joint_idx]. */ public fun getPhysicalBoneNode(jointIdx: Int): NodePath { TransferContext.writeArguments(LONG to jointIdx.toLong()) @@ -72,7 +72,8 @@ public open class SkeletonModification2DPhysicalBones : SkeletonModification2D() } /** - * Empties the list of [godot.PhysicalBone2D] nodes and populates it with all [godot.PhysicalBone2D] nodes that are children of the [godot.Skeleton2D]. + * Empties the list of [PhysicalBone2D] nodes and populates it with all [PhysicalBone2D] nodes + * that are children of the [Skeleton2D]. */ public fun fetchPhysicalBones(): Unit { TransferContext.writeArguments() @@ -80,9 +81,9 @@ public open class SkeletonModification2DPhysicalBones : SkeletonModification2D() } /** - * Tell the [godot.PhysicalBone2D] nodes to start simulating and interacting with the physics world. - * - * Optionally, an array of bone names can be passed to this function, and that will cause only [godot.PhysicalBone2D] nodes with those names to start simulating. + * Tell the [PhysicalBone2D] nodes to start simulating and interacting with the physics world. + * Optionally, an array of bone names can be passed to this function, and that will cause only + * [PhysicalBone2D] nodes with those names to start simulating. */ @JvmOverloads public fun startSimulation(bones: VariantArray = godot.core.variantArrayOf()): Unit { @@ -91,9 +92,9 @@ public open class SkeletonModification2DPhysicalBones : SkeletonModification2D() } /** - * Tell the [godot.PhysicalBone2D] nodes to stop simulating and interacting with the physics world. - * - * Optionally, an array of bone names can be passed to this function, and that will cause only [godot.PhysicalBone2D] nodes with those names to stop simulating. + * Tell the [PhysicalBone2D] nodes to stop simulating and interacting with the physics world. + * Optionally, an array of bone names can be passed to this function, and that will cause only + * [PhysicalBone2D] nodes with those names to stop simulating. */ @JvmOverloads public fun stopSimulation(bones: VariantArray = godot.core.variantArrayOf()): Unit { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonModification2DStackHolder.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonModification2DStackHolder.kt index 95fc1fa36..afa24040d 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonModification2DStackHolder.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonModification2DStackHolder.kt @@ -18,11 +18,10 @@ import kotlin.Suppress import kotlin.Unit /** - * A modification that holds and executes a [godot.SkeletonModificationStack2D]. - * - * This [godot.SkeletonModification2D] holds a reference to a [godot.SkeletonModificationStack2D], allowing you to use multiple modification stacks on a single [godot.Skeleton2D]. - * - * **Note:** The modifications in the held [godot.SkeletonModificationStack2D] will only be executed if their execution mode matches the execution mode of the SkeletonModification2DStackHolder. + * This [SkeletonModification2D] holds a reference to a [SkeletonModificationStack2D], allowing you + * to use multiple modification stacks on a single [Skeleton2D]. + * **Note:** The modifications in the held [SkeletonModificationStack2D] will only be executed if + * their execution mode matches the execution mode of the SkeletonModification2DStackHolder. */ @GodotBaseType public open class SkeletonModification2DStackHolder : SkeletonModification2D() { @@ -32,7 +31,8 @@ public open class SkeletonModification2DStackHolder : SkeletonModification2D() { } /** - * Sets the [godot.SkeletonModificationStack2D] that this modification is holding. This modification stack will then be executed when this modification is executed. + * Sets the [SkeletonModificationStack2D] that this modification is holding. This modification + * stack will then be executed when this modification is executed. */ public fun setHeldModificationStack(heldModificationStack: SkeletonModificationStack2D): Unit { TransferContext.writeArguments(OBJECT to heldModificationStack) @@ -40,7 +40,7 @@ public open class SkeletonModification2DStackHolder : SkeletonModification2D() { } /** - * Returns the [godot.SkeletonModificationStack2D] that this modification is holding. + * Returns the [SkeletonModificationStack2D] that this modification is holding. */ public fun getHeldModificationStack(): SkeletonModificationStack2D? { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonModification2DTwoBoneIK.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonModification2DTwoBoneIK.kt index faa244f6b..27c8f1b7c 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonModification2DTwoBoneIK.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonModification2DTwoBoneIK.kt @@ -25,16 +25,20 @@ import kotlin.Suppress import kotlin.Unit /** - * A modification that rotates two bones using the law of cosines to reach the target. - * - * This [godot.SkeletonModification2D] uses an algorithm typically called TwoBoneIK. This algorithm works by leveraging the law of cosines and the lengths of the bones to figure out what rotation the bones currently have, and what rotation they need to make a complete triangle, where the first bone, the second bone, and the target form the three vertices of the triangle. Because the algorithm works by making a triangle, it can only operate on two bones. - * - * TwoBoneIK is great for arms, legs, and really any joints that can be represented by just two bones that bend to reach a target. This solver is more lightweight than [godot.SkeletonModification2DFABRIK], but gives similar, natural looking results. + * This [SkeletonModification2D] uses an algorithm typically called TwoBoneIK. This algorithm works + * by leveraging the law of cosines and the lengths of the bones to figure out what rotation the bones + * currently have, and what rotation they need to make a complete triangle, where the first bone, the + * second bone, and the target form the three vertices of the triangle. Because the algorithm works by + * making a triangle, it can only operate on two bones. + * TwoBoneIK is great for arms, legs, and really any joints that can be represented by just two + * bones that bend to reach a target. This solver is more lightweight than + * [SkeletonModification2DFABRIK], but gives similar, natural looking results. */ @GodotBaseType public open class SkeletonModification2DTwoBoneIK : SkeletonModification2D() { /** - * The NodePath to the node that is the target for the TwoBoneIK modification. This node is what the modification will use when bending the [godot.Bone2D] nodes. + * The NodePath to the node that is the target for the TwoBoneIK modification. This node is what + * the modification will use when bending the [Bone2D] nodes. */ public var targetNodepath: NodePath get() { @@ -48,7 +52,9 @@ public open class SkeletonModification2DTwoBoneIK : SkeletonModification2D() { } /** - * The minimum distance the target can be at. If the target is closer than this distance, the modification will solve as if it's at this minimum distance. When set to `0`, the modification will solve without distance constraints. + * The minimum distance the target can be at. If the target is closer than this distance, the + * modification will solve as if it's at this minimum distance. When set to `0`, the modification + * will solve without distance constraints. */ public var targetMinimumDistance: Float get() { @@ -62,7 +68,9 @@ public open class SkeletonModification2DTwoBoneIK : SkeletonModification2D() { } /** - * The maximum distance the target can be at. If the target is farther than this distance, the modification will solve as if it's at this maximum distance. When set to `0`, the modification will solve without distance constraints. + * The maximum distance the target can be at. If the target is farther than this distance, the + * modification will solve as if it's at this maximum distance. When set to `0`, the modification + * will solve without distance constraints. */ public var targetMaximumDistance: Float get() { @@ -76,7 +84,8 @@ public open class SkeletonModification2DTwoBoneIK : SkeletonModification2D() { } /** - * If `true`, the bones in the modification will blend outward as opposed to inwards when contracting. If `false`, the bones will bend inwards when contracting. + * If `true`, the bones in the modification will blend outward as opposed to inwards when + * contracting. If `false`, the bones will bend inwards when contracting. */ public var flipBendDirection: Boolean get() { @@ -95,7 +104,7 @@ public open class SkeletonModification2DTwoBoneIK : SkeletonModification2D() { } /** - * Sets the [godot.Bone2D] node that is being used as the first bone in the TwoBoneIK modification. + * Sets the [Bone2D] node that is being used as the first bone in the TwoBoneIK modification. */ public fun setJointOneBone2dNode(bone2dNode: NodePath): Unit { TransferContext.writeArguments(NODE_PATH to bone2dNode) @@ -103,7 +112,7 @@ public open class SkeletonModification2DTwoBoneIK : SkeletonModification2D() { } /** - * Returns the [godot.Bone2D] node that is being used as the first bone in the TwoBoneIK modification. + * Returns the [Bone2D] node that is being used as the first bone in the TwoBoneIK modification. */ public fun getJointOneBone2dNode(): NodePath { TransferContext.writeArguments() @@ -112,7 +121,8 @@ public open class SkeletonModification2DTwoBoneIK : SkeletonModification2D() { } /** - * Sets the index of the [godot.Bone2D] node that is being used as the first bone in the TwoBoneIK modification. + * Sets the index of the [Bone2D] node that is being used as the first bone in the TwoBoneIK + * modification. */ public fun setJointOneBoneIdx(boneIdx: Int): Unit { TransferContext.writeArguments(LONG to boneIdx.toLong()) @@ -120,7 +130,8 @@ public open class SkeletonModification2DTwoBoneIK : SkeletonModification2D() { } /** - * Returns the index of the [godot.Bone2D] node that is being used as the first bone in the TwoBoneIK modification. + * Returns the index of the [Bone2D] node that is being used as the first bone in the TwoBoneIK + * modification. */ public fun getJointOneBoneIdx(): Int { TransferContext.writeArguments() @@ -129,7 +140,7 @@ public open class SkeletonModification2DTwoBoneIK : SkeletonModification2D() { } /** - * Sets the [godot.Bone2D] node that is being used as the second bone in the TwoBoneIK modification. + * Sets the [Bone2D] node that is being used as the second bone in the TwoBoneIK modification. */ public fun setJointTwoBone2dNode(bone2dNode: NodePath): Unit { TransferContext.writeArguments(NODE_PATH to bone2dNode) @@ -137,7 +148,7 @@ public open class SkeletonModification2DTwoBoneIK : SkeletonModification2D() { } /** - * Returns the [godot.Bone2D] node that is being used as the second bone in the TwoBoneIK modification. + * Returns the [Bone2D] node that is being used as the second bone in the TwoBoneIK modification. */ public fun getJointTwoBone2dNode(): NodePath { TransferContext.writeArguments() @@ -146,7 +157,8 @@ public open class SkeletonModification2DTwoBoneIK : SkeletonModification2D() { } /** - * Sets the index of the [godot.Bone2D] node that is being used as the second bone in the TwoBoneIK modification. + * Sets the index of the [Bone2D] node that is being used as the second bone in the TwoBoneIK + * modification. */ public fun setJointTwoBoneIdx(boneIdx: Int): Unit { TransferContext.writeArguments(LONG to boneIdx.toLong()) @@ -154,7 +166,8 @@ public open class SkeletonModification2DTwoBoneIK : SkeletonModification2D() { } /** - * Returns the index of the [godot.Bone2D] node that is being used as the second bone in the TwoBoneIK modification. + * Returns the index of the [Bone2D] node that is being used as the second bone in the TwoBoneIK + * modification. */ public fun getJointTwoBoneIdx(): Int { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonModificationStack2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonModificationStack2D.kt index 8ce80e0de..43fb6eec0 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonModificationStack2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonModificationStack2D.kt @@ -24,18 +24,19 @@ import kotlin.Suppress import kotlin.Unit /** - * A resource that holds a stack of [godot.SkeletonModification2D]s. - * - * This resource is used by the Skeleton and holds a stack of [godot.SkeletonModification2D]s. - * - * This controls the order of the modifications and how they are applied. Modification order is especially important for full-body IK setups, as you need to execute the modifications in the correct order to get the desired results. For example, you want to execute a modification on the spine *before* the arms on a humanoid skeleton. - * - * This resource also controls how strongly all of the modifications are applied to the [godot.Skeleton2D]. + * This resource is used by the Skeleton and holds a stack of [SkeletonModification2D]s. + * This controls the order of the modifications and how they are applied. Modification order is + * especially important for full-body IK setups, as you need to execute the modifications in the + * correct order to get the desired results. For example, you want to execute a modification on the + * spine *before* the arms on a humanoid skeleton. + * This resource also controls how strongly all of the modifications are applied to the + * [Skeleton2D]. */ @GodotBaseType public open class SkeletonModificationStack2D : Resource() { /** - * If `true`, the modification's in the stack will be called. This is handled automatically through the [godot.Skeleton2D] node. + * If `true`, the modification's in the stack will be called. This is handled automatically + * through the [Skeleton2D] node. */ public var enabled: Boolean get() { @@ -49,7 +50,9 @@ public open class SkeletonModificationStack2D : Resource() { } /** - * The interpolation strength of the modifications in stack. A value of `0` will make it where the modifications are not applied, a strength of `0.5` will be half applied, and a strength of `1` will allow the modifications to be fully applied and override the [godot.Skeleton2D] [godot.Bone2D] poses. + * The interpolation strength of the modifications in stack. A value of `0` will make it where the + * modifications are not applied, a strength of `0.5` will be half applied, and a strength of `1` + * will allow the modifications to be fully applied and override the [Skeleton2D] [Bone2D] poses. */ public var strength: Float get() { @@ -82,7 +85,8 @@ public open class SkeletonModificationStack2D : Resource() { } /** - * Sets up the modification stack so it can execute. This function should be called by [godot.Skeleton2D] and shouldn't be manually called unless you know what you are doing. + * Sets up the modification stack so it can execute. This function should be called by + * [Skeleton2D] and shouldn't be manually called unless you know what you are doing. */ public fun setup(): Unit { TransferContext.writeArguments() @@ -90,9 +94,11 @@ public open class SkeletonModificationStack2D : Resource() { } /** - * Executes all of the [godot.SkeletonModification2D]s in the stack that use the same execution mode as the passed-in [executionMode], starting from index `0` to [modificationCount]. - * - * **Note:** The order of the modifications can matter depending on the modifications. For example, modifications on a spine should operate before modifications on the arms in order to get proper results. + * Executes all of the [SkeletonModification2D]s in the stack that use the same execution mode as + * the passed-in [param execution_mode], starting from index `0` to [modificationCount]. + * **Note:** The order of the modifications can matter depending on the modifications. For + * example, modifications on a spine should operate before modifications on the arms in order to get + * proper results. */ public fun execute(delta: Float, executionMode: Int): Unit { TransferContext.writeArguments(DOUBLE to delta.toDouble(), LONG to executionMode.toLong()) @@ -100,7 +106,7 @@ public open class SkeletonModificationStack2D : Resource() { } /** - * Enables all [godot.SkeletonModification2D]s in the stack. + * Enables all [SkeletonModification2D]s in the stack. */ public fun enableAllModifications(enabled: Boolean): Unit { TransferContext.writeArguments(BOOL to enabled) @@ -108,7 +114,7 @@ public open class SkeletonModificationStack2D : Resource() { } /** - * Returns the [godot.SkeletonModification2D] at the passed-in index, [modIdx]. + * Returns the [SkeletonModification2D] at the passed-in index, [param mod_idx]. */ public fun getModification(modIdx: Int): SkeletonModification2D? { TransferContext.writeArguments(LONG to modIdx.toLong()) @@ -117,7 +123,7 @@ public open class SkeletonModificationStack2D : Resource() { } /** - * Adds the passed-in [godot.SkeletonModification2D] to the stack. + * Adds the passed-in [SkeletonModification2D] to the stack. */ public fun addModification(modification: SkeletonModification2D): Unit { TransferContext.writeArguments(OBJECT to modification) @@ -125,7 +131,7 @@ public open class SkeletonModificationStack2D : Resource() { } /** - * Deletes the [godot.SkeletonModification2D] at the index position [modIdx], if it exists. + * Deletes the [SkeletonModification2D] at the index position [param mod_idx], if it exists. */ public fun deleteModification(modIdx: Int): Unit { TransferContext.writeArguments(LONG to modIdx.toLong()) @@ -133,7 +139,7 @@ public open class SkeletonModificationStack2D : Resource() { } /** - * Sets the modification at [modIdx] to the passed-in modification, [modification]. + * Sets the modification at [param mod_idx] to the passed-in modification, [param modification]. */ public fun setModification(modIdx: Int, modification: SkeletonModification2D): Unit { TransferContext.writeArguments(LONG to modIdx.toLong(), OBJECT to modification) @@ -150,7 +156,7 @@ public open class SkeletonModificationStack2D : Resource() { } /** - * Returns the [godot.Skeleton2D] node that the SkeletonModificationStack2D is bound to. + * Returns the [Skeleton2D] node that the SkeletonModificationStack2D is bound to. */ public fun getSkeleton(): Skeleton2D? { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonProfile.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonProfile.kt index 0a883cd01..0888880cb 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonProfile.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonProfile.kt @@ -28,26 +28,25 @@ import kotlin.Suppress import kotlin.Unit /** - * Base class for a profile of a virtual skeleton used as a target for retargeting. - * - * Tutorials: - * [$DOCS_URL/tutorials/assets_pipeline/retargeting_3d_skeletons.html]($DOCS_URL/tutorials/assets_pipeline/retargeting_3d_skeletons.html) - * - * This resource is used in [godot.EditorScenePostImport]. Some parameters are referring to bones in [godot.Skeleton3D], [godot.Skin], [godot.Animation], and some other nodes are rewritten based on the parameters of [godot.SkeletonProfile]. - * - * **Note:** These parameters need to be set only when creating a custom profile. In [godot.SkeletonProfileHumanoid], they are defined internally as read-only values. + * This resource is used in [EditorScenePostImport]. Some parameters are referring to bones in + * [Skeleton3D], [Skin], [Animation], and some other nodes are rewritten based on the parameters of + * [SkeletonProfile]. + * **Note:** These parameters need to be set only when creating a custom profile. In + * [SkeletonProfileHumanoid], they are defined internally as read-only values. */ @GodotBaseType public open class SkeletonProfile : Resource() { /** - * This signal is emitted when change the value in profile. This is used to update key name in the [godot.BoneMap] and to redraw the [godot.BoneMap] editor. - * - * **Note:** This signal is not connected directly to editor to simplify the reference, instead it is passed on to editor through the [godot.BoneMap]. + * This signal is emitted when change the value in profile. This is used to update key name in the + * [BoneMap] and to redraw the [BoneMap] editor. + * **Note:** This signal is not connected directly to editor to simplify the reference, instead it + * is passed on to editor through the [BoneMap]. */ public val profileUpdated: Signal0 by signal() /** - * A bone name that will be used as the root bone in [godot.AnimationTree]. This should be the bone of the parent of hips that exists at the world origin. + * A bone name that will be used as the root bone in [AnimationTree]. This should be the bone of + * the parent of hips that exists at the world origin. */ public var rootBone: StringName get() { @@ -61,7 +60,8 @@ public open class SkeletonProfile : Resource() { } /** - * A bone name which will use model's height as the coefficient for normalization. For example, [godot.SkeletonProfileHumanoid] defines it as `Hips`. + * A bone name which will use model's height as the coefficient for normalization. For example, + * [SkeletonProfileHumanoid] defines it as `Hips`. */ public var scaleBaseBone: StringName get() { @@ -75,8 +75,8 @@ public open class SkeletonProfile : Resource() { } /** - * The amount of groups of bones in retargeting section's [godot.BoneMap] editor. For example, [godot.SkeletonProfileHumanoid] has 4 groups. - * + * The amount of groups of bones in retargeting section's [BoneMap] editor. For example, + * [SkeletonProfileHumanoid] has 4 groups. * This property exists to separate the bone list into several sections in the editor. */ public var groupSize: Int @@ -91,9 +91,10 @@ public open class SkeletonProfile : Resource() { } /** - * The amount of bones in retargeting section's [godot.BoneMap] editor. For example, [godot.SkeletonProfileHumanoid] has 56 bones. - * - * The size of elements in [godot.BoneMap] updates when changing this property in it's assigned [godot.SkeletonProfile]. + * The amount of bones in retargeting section's [BoneMap] editor. For example, + * [SkeletonProfileHumanoid] has 56 bones. + * The size of elements in [BoneMap] updates when changing this property in it's assigned + * [SkeletonProfile]. */ public var boneSize: Int get() { @@ -112,7 +113,8 @@ public open class SkeletonProfile : Resource() { } /** - * Returns the name of the group at [groupIdx] that will be the drawing group in the [godot.BoneMap] editor. + * Returns the name of the group at [param group_idx] that will be the drawing group in the + * [BoneMap] editor. */ public fun getGroupName(groupIdx: Int): StringName { TransferContext.writeArguments(LONG to groupIdx.toLong()) @@ -121,7 +123,8 @@ public open class SkeletonProfile : Resource() { } /** - * Sets the name of the group at [groupIdx] that will be the drawing group in the [godot.BoneMap] editor. + * Sets the name of the group at [param group_idx] that will be the drawing group in the [BoneMap] + * editor. */ public fun setGroupName(groupIdx: Int, groupName: StringName): Unit { TransferContext.writeArguments(LONG to groupIdx.toLong(), STRING_NAME to groupName) @@ -129,7 +132,8 @@ public open class SkeletonProfile : Resource() { } /** - * Returns the texture of the group at [groupIdx] that will be the drawing group background image in the [godot.BoneMap] editor. + * Returns the texture of the group at [param group_idx] that will be the drawing group background + * image in the [BoneMap] editor. */ public fun getTexture(groupIdx: Int): Texture2D? { TransferContext.writeArguments(LONG to groupIdx.toLong()) @@ -138,7 +142,8 @@ public open class SkeletonProfile : Resource() { } /** - * Sets the texture of the group at [groupIdx] that will be the drawing group background image in the [godot.BoneMap] editor. + * Sets the texture of the group at [param group_idx] that will be the drawing group background + * image in the [BoneMap] editor. */ public fun setTexture(groupIdx: Int, texture: Texture2D): Unit { TransferContext.writeArguments(LONG to groupIdx.toLong(), OBJECT to texture) @@ -146,7 +151,7 @@ public open class SkeletonProfile : Resource() { } /** - * Returns the bone index that matches [boneName] as its name. + * Returns the bone index that matches [param bone_name] as its name. */ public fun findBone(boneName: StringName): Int { TransferContext.writeArguments(STRING_NAME to boneName) @@ -155,8 +160,7 @@ public open class SkeletonProfile : Resource() { } /** - * Returns the name of the bone at [boneIdx] that will be the key name in the [godot.BoneMap]. - * + * Returns the name of the bone at [param bone_idx] that will be the key name in the [BoneMap]. * In the retargeting process, the returned bone name is the bone name of the target skeleton. */ public fun getBoneName(boneIdx: Int): StringName { @@ -166,8 +170,7 @@ public open class SkeletonProfile : Resource() { } /** - * Sets the name of the bone at [boneIdx] that will be the key name in the [godot.BoneMap]. - * + * Sets the name of the bone at [param bone_idx] that will be the key name in the [BoneMap]. * In the retargeting process, the setting bone name is the bone name of the target skeleton. */ public fun setBoneName(boneIdx: Int, boneName: StringName): Unit { @@ -176,7 +179,8 @@ public open class SkeletonProfile : Resource() { } /** - * Returns the name of the bone which is the parent to the bone at [boneIdx]. The result is empty if the bone has no parent. + * Returns the name of the bone which is the parent to the bone at [param bone_idx]. The result is + * empty if the bone has no parent. */ public fun getBoneParent(boneIdx: Int): StringName { TransferContext.writeArguments(LONG to boneIdx.toLong()) @@ -185,7 +189,8 @@ public open class SkeletonProfile : Resource() { } /** - * Sets the bone with name [boneParent] as the parent of the bone at [boneIdx]. If an empty string is passed, then the bone has no parent. + * Sets the bone with name [param bone_parent] as the parent of the bone at [param bone_idx]. If + * an empty string is passed, then the bone has no parent. */ public fun setBoneParent(boneIdx: Int, boneParent: StringName): Unit { TransferContext.writeArguments(LONG to boneIdx.toLong(), STRING_NAME to boneParent) @@ -193,7 +198,7 @@ public open class SkeletonProfile : Resource() { } /** - * Returns the tail direction of the bone at [boneIdx]. + * Returns the tail direction of the bone at [param bone_idx]. */ public fun getTailDirection(boneIdx: Int): TailDirection { TransferContext.writeArguments(LONG to boneIdx.toLong()) @@ -202,9 +207,9 @@ public open class SkeletonProfile : Resource() { } /** - * Sets the tail direction of the bone at [boneIdx]. - * - * **Note:** This only specifies the method of calculation. The actual coordinates required should be stored in an external skeleton, so the calculation itself needs to be done externally. + * Sets the tail direction of the bone at [param bone_idx]. + * **Note:** This only specifies the method of calculation. The actual coordinates required should + * be stored in an external skeleton, so the calculation itself needs to be done externally. */ public fun setTailDirection(boneIdx: Int, tailDirection: TailDirection): Unit { TransferContext.writeArguments(LONG to boneIdx.toLong(), LONG to tailDirection.id) @@ -212,7 +217,7 @@ public open class SkeletonProfile : Resource() { } /** - * Returns the name of the bone which is the tail of the bone at [boneIdx]. + * Returns the name of the bone which is the tail of the bone at [param bone_idx]. */ public fun getBoneTail(boneIdx: Int): StringName { TransferContext.writeArguments(LONG to boneIdx.toLong()) @@ -221,7 +226,7 @@ public open class SkeletonProfile : Resource() { } /** - * Sets the bone with name [boneTail] as the tail of the bone at [boneIdx]. + * Sets the bone with name [param bone_tail] as the tail of the bone at [param bone_idx]. */ public fun setBoneTail(boneIdx: Int, boneTail: StringName): Unit { TransferContext.writeArguments(LONG to boneIdx.toLong(), STRING_NAME to boneTail) @@ -229,7 +234,7 @@ public open class SkeletonProfile : Resource() { } /** - * Returns the reference pose transform for bone [boneIdx]. + * Returns the reference pose transform for bone [param bone_idx]. */ public fun getReferencePose(boneIdx: Int): Transform3D { TransferContext.writeArguments(LONG to boneIdx.toLong()) @@ -238,7 +243,7 @@ public open class SkeletonProfile : Resource() { } /** - * Sets the reference pose transform for bone [boneIdx]. + * Sets the reference pose transform for bone [param bone_idx]. */ public fun setReferencePose(boneIdx: Int, boneName: Transform3D): Unit { TransferContext.writeArguments(LONG to boneIdx.toLong(), TRANSFORM3D to boneName) @@ -246,8 +251,8 @@ public open class SkeletonProfile : Resource() { } /** - * Returns the offset of the bone at [boneIdx] that will be the button position in the [godot.BoneMap] editor. - * + * Returns the offset of the bone at [param bone_idx] that will be the button position in the + * [BoneMap] editor. * This is the offset with origin at the top left corner of the square. */ public fun getHandleOffset(boneIdx: Int): Vector2 { @@ -257,8 +262,8 @@ public open class SkeletonProfile : Resource() { } /** - * Sets the offset of the bone at [boneIdx] that will be the button position in the [godot.BoneMap] editor. - * + * Sets the offset of the bone at [param bone_idx] that will be the button position in the + * [BoneMap] editor. * This is the offset with origin at the top left corner of the square. */ public fun setHandleOffset(boneIdx: Int, handleOffset: Vector2): Unit { @@ -267,7 +272,7 @@ public open class SkeletonProfile : Resource() { } /** - * Returns the group of the bone at [boneIdx]. + * Returns the group of the bone at [param bone_idx]. */ public fun getGroup(boneIdx: Int): StringName { TransferContext.writeArguments(LONG to boneIdx.toLong()) @@ -276,7 +281,7 @@ public open class SkeletonProfile : Resource() { } /** - * Sets the group of the bone at [boneIdx]. + * Sets the group of the bone at [param bone_idx]. */ public fun setGroup(boneIdx: Int, group: StringName): Unit { TransferContext.writeArguments(LONG to boneIdx.toLong(), STRING_NAME to group) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonProfileHumanoid.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonProfileHumanoid.kt index 4f6926c1f..4bd286d48 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonProfileHumanoid.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/SkeletonProfileHumanoid.kt @@ -12,12 +12,8 @@ import kotlin.Int import kotlin.Suppress /** - * A humanoid [godot.SkeletonProfile] preset. - * - * Tutorials: - * [$DOCS_URL/tutorials/assets_pipeline/retargeting_3d_skeletons.html]($DOCS_URL/tutorials/assets_pipeline/retargeting_3d_skeletons.html) - * - * A [godot.SkeletonProfile] as a preset that is optimized for the human form. This exists for standardization, so all parameters are read-only. + * A [SkeletonProfile] as a preset that is optimized for the human form. This exists for + * standardization, so all parameters are read-only. */ @GodotBaseType public open class SkeletonProfileHumanoid : SkeletonProfile() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Skin.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Skin.kt index 389c5119f..3de15985c 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Skin.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Skin.kt @@ -24,9 +24,6 @@ import kotlin.String import kotlin.Suppress import kotlin.Unit -/** - * - */ @GodotBaseType public open class Skin : Resource() { public override fun new(scriptIndex: Int): Boolean { @@ -34,93 +31,60 @@ public open class Skin : Resource() { return true } - /** - * - */ public fun setBindCount(bindCount: Int): Unit { TransferContext.writeArguments(LONG to bindCount.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.setBindCountPtr, NIL) } - /** - * - */ public fun getBindCount(): Int { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getBindCountPtr, LONG) return (TransferContext.readReturnValue(LONG, false) as Long).toInt() } - /** - * - */ public fun addBind(bone: Int, pose: Transform3D): Unit { TransferContext.writeArguments(LONG to bone.toLong(), TRANSFORM3D to pose) TransferContext.callMethod(rawPtr, MethodBindings.addBindPtr, NIL) } - /** - * - */ public fun addNamedBind(name: String, pose: Transform3D): Unit { TransferContext.writeArguments(STRING to name, TRANSFORM3D to pose) TransferContext.callMethod(rawPtr, MethodBindings.addNamedBindPtr, NIL) } - /** - * - */ public fun setBindPose(bindIndex: Int, pose: Transform3D): Unit { TransferContext.writeArguments(LONG to bindIndex.toLong(), TRANSFORM3D to pose) TransferContext.callMethod(rawPtr, MethodBindings.setBindPosePtr, NIL) } - /** - * - */ public fun getBindPose(bindIndex: Int): Transform3D { TransferContext.writeArguments(LONG to bindIndex.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.getBindPosePtr, TRANSFORM3D) return (TransferContext.readReturnValue(TRANSFORM3D, false) as Transform3D) } - /** - * - */ public fun setBindName(bindIndex: Int, name: StringName): Unit { TransferContext.writeArguments(LONG to bindIndex.toLong(), STRING_NAME to name) TransferContext.callMethod(rawPtr, MethodBindings.setBindNamePtr, NIL) } - /** - * - */ public fun getBindName(bindIndex: Int): StringName { TransferContext.writeArguments(LONG to bindIndex.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.getBindNamePtr, STRING_NAME) return (TransferContext.readReturnValue(STRING_NAME, false) as StringName) } - /** - * - */ public fun setBindBone(bindIndex: Int, bone: Int): Unit { TransferContext.writeArguments(LONG to bindIndex.toLong(), LONG to bone.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.setBindBonePtr, NIL) } - /** - * - */ public fun getBindBone(bindIndex: Int): Int { TransferContext.writeArguments(LONG to bindIndex.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.getBindBonePtr, LONG) return (TransferContext.readReturnValue(LONG, false) as Long).toInt() } - /** - * - */ public fun clearBinds(): Unit { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.clearBindsPtr, NIL) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/SkinReference.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/SkinReference.kt index 5e742ba6a..c3b0d2f45 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/SkinReference.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/SkinReference.kt @@ -17,9 +17,6 @@ import kotlin.Boolean import kotlin.Int import kotlin.Suppress -/** - * - */ @GodotBaseType public open class SkinReference internal constructor() : RefCounted() { public override fun new(scriptIndex: Int): Boolean { @@ -27,18 +24,12 @@ public open class SkinReference internal constructor() : RefCounted() { return true } - /** - * - */ public fun getSkeleton(): RID { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getSkeletonPtr, _RID) return (TransferContext.readReturnValue(_RID, false) as RID) } - /** - * - */ public fun getSkin(): Skin? { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getSkinPtr, OBJECT) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Sky.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Sky.kt index c9ca73846..407ecae91 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Sky.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Sky.kt @@ -19,14 +19,14 @@ import kotlin.Long import kotlin.Suppress /** - * Defines a 3D environment's background by using a [godot.Material]. - * - * The [godot.Sky] class uses a [godot.Material] to render a 3D environment's background and the light it emits by updating the reflection/radiance cubemaps. + * The [Sky] class uses a [Material] to render a 3D environment's background and the light it emits + * by updating the reflection/radiance cubemaps. */ @GodotBaseType public open class Sky : Resource() { /** - * [godot.Material] used to draw the background. Can be [godot.PanoramaSkyMaterial], [godot.ProceduralSkyMaterial], [godot.PhysicalSkyMaterial], or even a [godot.ShaderMaterial] if you want to use your own custom shader. + * [Material] used to draw the background. Can be [PanoramaSkyMaterial], [ProceduralSkyMaterial], + * [PhysicalSkyMaterial], or even a [ShaderMaterial] if you want to use your own custom shader. */ public var skyMaterial: Material? get() { @@ -40,7 +40,9 @@ public open class Sky : Resource() { } /** - * Sets the method for generating the radiance map from the sky. The radiance map is a cubemap with increasingly blurry versions of the sky corresponding to different levels of roughness. Radiance maps can be expensive to calculate. See [enum ProcessMode] for options. + * Sets the method for generating the radiance map from the sky. The radiance map is a cubemap + * with increasingly blurry versions of the sky corresponding to different levels of roughness. + * Radiance maps can be expensive to calculate. See [enum ProcessMode] for options. */ public var processMode: ProcessMode get() { @@ -54,11 +56,11 @@ public open class Sky : Resource() { } /** - * The [godot.Sky]'s radiance map size. The higher the radiance map size, the more detailed the lighting from the [godot.Sky] will be. - * + * The [Sky]'s radiance map size. The higher the radiance map size, the more detailed the lighting + * from the [Sky] will be. * See [enum RadianceSize] constants for values. - * - * **Note:** Some hardware will have trouble with higher radiance sizes, especially [godot.RADIANCE_SIZE_512] and above. Only use such high values on high-end hardware. + * **Note:** Some hardware will have trouble with higher radiance sizes, especially [constant + * RADIANCE_SIZE_512] and above. Only use such high values on high-end hardware. */ public var radianceSize: RadianceSize get() { @@ -127,21 +129,35 @@ public open class Sky : Resource() { id: Long, ) { /** - * Automatically selects the appropriate process mode based on your sky shader. If your shader uses `TIME` or `POSITION`, this will use [PROCESS_MODE_REALTIME]. If your shader uses any of the `LIGHT_*` variables or any custom uniforms, this uses [PROCESS_MODE_INCREMENTAL]. Otherwise, this defaults to [PROCESS_MODE_QUALITY]. + * Automatically selects the appropriate process mode based on your sky shader. If your shader + * uses `TIME` or `POSITION`, this will use [constant PROCESS_MODE_REALTIME]. If your shader uses + * any of the `LIGHT_*` variables or any custom uniforms, this uses [constant + * PROCESS_MODE_INCREMENTAL]. Otherwise, this defaults to [constant PROCESS_MODE_QUALITY]. */ PROCESS_MODE_AUTOMATIC(0), /** - * Uses high quality importance sampling to process the radiance map. In general, this results in much higher quality than [PROCESS_MODE_REALTIME] but takes much longer to generate. This should not be used if you plan on changing the sky at runtime. If you are finding that the reflection is not blurry enough and is showing sparkles or fireflies, try increasing [godot.ProjectSettings.rendering/reflections/skyReflections/ggxSamples]. + * Uses high quality importance sampling to process the radiance map. In general, this results + * in much higher quality than [constant PROCESS_MODE_REALTIME] but takes much longer to generate. + * This should not be used if you plan on changing the sky at runtime. If you are finding that the + * reflection is not blurry enough and is showing sparkles or fireflies, try increasing + * [ProjectSettings.rendering/reflections/skyReflections/ggxSamples]. */ PROCESS_MODE_QUALITY(1), /** - * Uses the same high quality importance sampling to process the radiance map as [PROCESS_MODE_QUALITY], but updates over several frames. The number of frames is determined by [godot.ProjectSettings.rendering/reflections/skyReflections/roughnessLayers]. Use this when you need highest quality radiance maps, but have a sky that updates slowly. + * Uses the same high quality importance sampling to process the radiance map as [constant + * PROCESS_MODE_QUALITY], but updates over several frames. The number of frames is determined by + * [ProjectSettings.rendering/reflections/skyReflections/roughnessLayers]. Use this when you need + * highest quality radiance maps, but have a sky that updates slowly. */ PROCESS_MODE_INCREMENTAL(2), /** - * Uses the fast filtering algorithm to process the radiance map. In general this results in lower quality, but substantially faster run times. If you need better quality, but still need to update the sky every frame, consider turning on [godot.ProjectSettings.rendering/reflections/skyReflections/fastFilterHighQuality]. - * - * **Note:** The fast filtering algorithm is limited to 256×256 cubemaps, so [radianceSize] must be set to [godot.RADIANCE_SIZE_256]. Otherwise, a warning is printed and the overridden radiance size is ignored. + * Uses the fast filtering algorithm to process the radiance map. In general this results in + * lower quality, but substantially faster run times. If you need better quality, but still need to + * update the sky every frame, consider turning on + * [ProjectSettings.rendering/reflections/skyReflections/fastFilterHighQuality]. + * **Note:** The fast filtering algorithm is limited to 256×256 cubemaps, so [radianceSize] must + * be set to [constant RADIANCE_SIZE_256]. Otherwise, a warning is printed and the overridden + * radiance size is ignored. */ PROCESS_MODE_REALTIME(3), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Slider.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Slider.kt index 52316f0fb..5e500f9a2 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Slider.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Slider.kt @@ -22,9 +22,8 @@ import kotlin.Long import kotlin.Suppress /** - * Abstract base class for sliders. - * - * Abstract base class for sliders, used to adjust a value by moving a grabber along a horizontal or vertical axis. Sliders are [godot.Range]-based controls. + * Abstract base class for sliders, used to adjust a value by moving a grabber along a horizontal or + * vertical axis. Sliders are [Range]-based controls. */ @GodotBaseType public open class Slider internal constructor() : Range() { @@ -34,12 +33,14 @@ public open class Slider internal constructor() : Range() { public val dragStarted: Signal0 by signal() /** - * Emitted when dragging stops. If [valueChanged] is true, [godot.Range.value] is different from the value when you started the dragging. + * Emitted when dragging stops. If [param value_changed] is true, [Range.value] is different from + * the value when you started the dragging. */ public val dragEnded: Signal1 by signal("valueChanged") /** - * If `true`, the slider can be interacted with. If `false`, the value can be changed only by code. + * If `true`, the slider can be interacted with. If `false`, the value can be changed only by + * code. */ public var editable: Boolean get() { @@ -67,7 +68,8 @@ public open class Slider internal constructor() : Range() { } /** - * Number of ticks displayed on the slider, including border ticks. Ticks are uniformly-distributed value markers. + * Number of ticks displayed on the slider, including border ticks. Ticks are + * uniformly-distributed value markers. */ public var tickCount: Int get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/SliderJoint3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/SliderJoint3D.kt index 7325a4b62..b7cada688 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/SliderJoint3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/SliderJoint3D.kt @@ -22,9 +22,9 @@ import kotlin.Suppress import kotlin.Unit /** - * A physics joint that restricts the movement of a 3D physics body along an axis relative to another physics body. - * - * A physics joint that restricts the movement of a 3D physics body along an axis relative to another physics body. For example, Body A could be a [godot.StaticBody3D] representing a piston base, while Body B could be a [godot.RigidBody3D] representing the piston head, moving up and down. + * A physics joint that restricts the movement of a 3D physics body along an axis relative to + * another physics body. For example, Body A could be a [StaticBody3D] representing a piston base, + * while Body B could be a [RigidBody3D] representing the piston head, moving up and down. */ @GodotBaseType public open class SliderJoint3D : Joint3D() { @@ -33,17 +33,11 @@ public open class SliderJoint3D : Joint3D() { return true } - /** - * - */ public fun setParam(`param`: Param, `value`: Float): Unit { TransferContext.writeArguments(LONG to param.id, DOUBLE to value.toDouble()) TransferContext.callMethod(rawPtr, MethodBindings.setParamPtr, NIL) } - /** - * - */ public fun getParam(`param`: Param): Float { TransferContext.writeArguments(LONG to param.id) TransferContext.callMethod(rawPtr, MethodBindings.getParamPtr, DOUBLE) @@ -62,11 +56,13 @@ public open class SliderJoint3D : Joint3D() { */ PARAM_LINEAR_LIMIT_LOWER(1), /** - * A factor applied to the movement across the slider axis once the limits get surpassed. The lower, the slower the movement. + * A factor applied to the movement across the slider axis once the limits get surpassed. The + * lower, the slower the movement. */ PARAM_LINEAR_LIMIT_SOFTNESS(2), /** - * The amount of restitution once the limits are surpassed. The lower, the more velocity-energy gets lost. + * The amount of restitution once the limits are surpassed. The lower, the more velocity-energy + * gets lost. */ PARAM_LINEAR_LIMIT_RESTITUTION(3), /** @@ -74,7 +70,8 @@ public open class SliderJoint3D : Joint3D() { */ PARAM_LINEAR_LIMIT_DAMPING(4), /** - * A factor applied to the movement across the slider axis as long as the slider is in the limits. The lower, the slower the movement. + * A factor applied to the movement across the slider axis as long as the slider is in the + * limits. The lower, the slower the movement. */ PARAM_LINEAR_MOTION_SOFTNESS(5), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/SphereMesh.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/SphereMesh.kt index b073e31da..dc4cd30a8 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/SphereMesh.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/SphereMesh.kt @@ -22,9 +22,7 @@ import kotlin.Long import kotlin.Suppress /** - * Class representing a spherical [godot.PrimitiveMesh]. - * - * Class representing a spherical [godot.PrimitiveMesh]. + * Class representing a spherical [PrimitiveMesh]. */ @GodotBaseType public open class SphereMesh : PrimitiveMesh() { @@ -86,7 +84,6 @@ public open class SphereMesh : PrimitiveMesh() { /** * If `true`, a hemisphere is created rather than a full sphere. - * * **Note:** To get a regular hemisphere, the height and radius of the sphere must be equal. */ public var isHemisphere: Boolean diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/SphereOccluder3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/SphereOccluder3D.kt index 57fc49759..4fd1b4923 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/SphereOccluder3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/SphereOccluder3D.kt @@ -19,14 +19,9 @@ import kotlin.Int import kotlin.Suppress /** - * Spherical shape for use with occlusion culling in [godot.OccluderInstance3D]. - * - * Tutorials: - * [$DOCS_URL/tutorials/3d/occlusion_culling.html]($DOCS_URL/tutorials/3d/occlusion_culling.html) - * - * [godot.SphereOccluder3D] stores a sphere shape that can be used by the engine's occlusion culling system. - * - * See [godot.OccluderInstance3D]'s documentation for instructions on setting up occlusion culling. + * [SphereOccluder3D] stores a sphere shape that can be used by the engine's occlusion culling + * system. + * See [OccluderInstance3D]'s documentation for instructions on setting up occlusion culling. */ @GodotBaseType public open class SphereOccluder3D : Occluder3D() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/SphereShape3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/SphereShape3D.kt index 3014dd89c..477464792 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/SphereShape3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/SphereShape3D.kt @@ -19,14 +19,10 @@ import kotlin.Int import kotlin.Suppress /** - * A 3D sphere shape used for physics collision. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/675](https://godotengine.org/asset-library/asset/675) - * - * A 3D sphere shape, intended for use in physics. Usually used to provide a shape for a [godot.CollisionShape3D]. - * - * **Performance:** [godot.SphereShape3D] is fast to check collisions against. It is faster than [godot.BoxShape3D], [godot.CapsuleShape3D], and [godot.CylinderShape3D]. + * A 3D sphere shape, intended for use in physics. Usually used to provide a shape for a + * [CollisionShape3D]. + * **Performance:** [SphereShape3D] is fast to check collisions against. It is faster than + * [BoxShape3D], [CapsuleShape3D], and [CylinderShape3D]. */ @GodotBaseType public open class SphereShape3D : Shape3D() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/SplitContainer.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/SplitContainer.kt index 55ceefe73..0edee9af9 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/SplitContainer.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/SplitContainer.kt @@ -22,12 +22,9 @@ import kotlin.Suppress import kotlin.Unit /** - * A container that splits two child controls horizontally or vertically and provides a grabber for adjusting the split ratio. - * - * Tutorials: - * [$DOCS_URL/tutorials/ui/gui_containers.html]($DOCS_URL/tutorials/ui/gui_containers.html) - * - * A container that accepts only two child controls, then arranges them horizontally or vertically and creates a divisor between them. The divisor can be dragged around to change the size relation between the child controls. + * A container that accepts only two child controls, then arranges them horizontally or vertically + * and creates a divisor between them. The divisor can be dragged around to change the size relation + * between the child controls. */ @GodotBaseType public open class SplitContainer : Container() { @@ -37,7 +34,8 @@ public open class SplitContainer : Container() { public val dragged: Signal1 by signal("offset") /** - * The initial offset of the splitting between the two [godot.Control]s, with `0` being at the end of the first [godot.Control]. + * The initial offset of the splitting between the two [Control]s, with `0` being at the end of + * the first [Control]. */ public var splitOffset: Int get() { @@ -51,7 +49,7 @@ public open class SplitContainer : Container() { } /** - * If `true`, the area of the first [godot.Control] will be collapsed and the dragger will be disabled. + * If `true`, the area of the first [Control] will be collapsed and the dragger will be disabled. */ public var collapsed: Boolean get() { @@ -79,9 +77,8 @@ public open class SplitContainer : Container() { } /** - * If `true`, the [godot.SplitContainer] will arrange its children vertically, rather than horizontally. - * - * Can't be changed when using [godot.HSplitContainer] and [godot.VSplitContainer]. + * If `true`, the [SplitContainer] will arrange its children vertically, rather than horizontally. + * Can't be changed when using [HSplitContainer] and [VSplitContainer]. */ public var vertical: Boolean get() { @@ -100,7 +97,8 @@ public open class SplitContainer : Container() { } /** - * Clamps the [splitOffset] value to not go outside the currently possible minimal and maximum values. + * Clamps the [splitOffset] value to not go outside the currently possible minimal and maximum + * values. */ public fun clampSplitOffset(): Unit { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/SpotLight3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/SpotLight3D.kt index 39573881d..d993c0a88 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/SpotLight3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/SpotLight3D.kt @@ -12,16 +12,18 @@ import kotlin.Int import kotlin.Suppress /** - * A spotlight, such as a reflector spotlight or a lantern. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/678](https://godotengine.org/asset-library/asset/678) - * - * A Spotlight is a type of [godot.Light3D] node that emits lights in a specific direction, in the shape of a cone. The light is attenuated through the distance. This attenuation can be configured by changing the energy, radius and attenuation parameters of [godot.Light3D]. - * - * **Note:** When using the Mobile rendering method, only 8 spot lights can be displayed on each mesh resource. Attempting to display more than 8 spot lights on a single mesh resource will result in spot lights flickering in and out as the camera moves. When using the Compatibility rendering method, only 8 spot lights can be displayed on each mesh resource by default, but this can be increased by adjusting [godot.ProjectSettings.rendering/limits/opengl/maxLightsPerObject]. - * - * **Note:** When using the Mobile or Compatibility rendering methods, spot lights will only correctly affect meshes whose visibility AABB intersects with the light's AABB. If using a shader to deform the mesh in a way that makes it go outside its AABB, [godot.GeometryInstance3D.extraCullMargin] must be increased on the mesh. Otherwise, the light may not be visible on the mesh. + * A Spotlight is a type of [Light3D] node that emits lights in a specific direction, in the shape + * of a cone. The light is attenuated through the distance. This attenuation can be configured by + * changing the energy, radius and attenuation parameters of [Light3D]. + * **Note:** When using the Mobile rendering method, only 8 spot lights can be displayed on each + * mesh resource. Attempting to display more than 8 spot lights on a single mesh resource will result + * in spot lights flickering in and out as the camera moves. When using the Compatibility rendering + * method, only 8 spot lights can be displayed on each mesh resource by default, but this can be + * increased by adjusting [ProjectSettings.rendering/limits/opengl/maxLightsPerObject]. + * **Note:** When using the Mobile or Compatibility rendering methods, spot lights will only + * correctly affect meshes whose visibility AABB intersects with the light's AABB. If using a shader to + * deform the mesh in a way that makes it go outside its AABB, [GeometryInstance3D.extraCullMargin] + * must be increased on the mesh. Otherwise, the light may not be visible on the mesh. */ @GodotBaseType public open class SpotLight3D : Light3D() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/SpringArm3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/SpringArm3D.kt index 1e77cd39f..8f457a336 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/SpringArm3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/SpringArm3D.kt @@ -26,14 +26,17 @@ import kotlin.Suppress import kotlin.Unit /** - * A 3D raycast that dynamically moves its children near the collision point. - * - * [godot.SpringArm3D] casts a ray or a shape along its Z axis and moves all its direct children to the collision point, with an optional margin. This is useful for 3rd person cameras that move closer to the player when inside a tight space (you may need to exclude the player's collider from the [godot.SpringArm3D]'s collision check). + * [SpringArm3D] casts a ray or a shape along its Z axis and moves all its direct children to the + * collision point, with an optional margin. This is useful for 3rd person cameras that move closer to + * the player when inside a tight space (you may need to exclude the player's collider from the + * [SpringArm3D]'s collision check). */ @GodotBaseType public open class SpringArm3D : Node3D() { /** - * The layers against which the collision check shall be done. See [godot.Collision layers and masks]($DOCS_URL/tutorials/physics/physics_introduction.html#collision-layers-and-masks) in the documentation for more information. + * The layers against which the collision check shall be done. See + * [url=$DOCS_URL/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision + * layers and masks[/url] in the documentation for more information. */ public var collisionMask: Long get() { @@ -47,9 +50,9 @@ public open class SpringArm3D : Node3D() { } /** - * The [godot.Shape3D] to use for the SpringArm3D. - * - * When the shape is set, the SpringArm3D will cast the [godot.Shape3D] on its z axis instead of performing a ray cast. + * The [Shape3D] to use for the SpringArm3D. + * When the shape is set, the SpringArm3D will cast the [Shape3D] on its z axis instead of + * performing a ray cast. */ public var shape: Shape3D? get() { @@ -63,9 +66,10 @@ public open class SpringArm3D : Node3D() { } /** - * The maximum extent of the SpringArm3D. This is used as a length for both the ray and the shape cast used internally to calculate the desired position of the SpringArm3D's child nodes. - * - * To know more about how to perform a shape cast or a ray cast, please consult the [godot.PhysicsDirectSpaceState3D] documentation. + * The maximum extent of the SpringArm3D. This is used as a length for both the ray and the shape + * cast used internally to calculate the desired position of the SpringArm3D's child nodes. + * To know more about how to perform a shape cast or a ray cast, please consult the + * [PhysicsDirectSpaceState3D] documentation. */ public var springLength: Float get() { @@ -80,10 +84,11 @@ public open class SpringArm3D : Node3D() { /** * When the collision check is made, a candidate length for the SpringArm3D is given. - * - * The margin is then subtracted to this length and the translation is applied to the child objects of the SpringArm3D. - * - * This margin is useful for when the SpringArm3D has a [godot.Camera3D] as a child node: without the margin, the [godot.Camera3D] would be placed on the exact point of collision, while with the margin the [godot.Camera3D] would be placed close to the point of collision. + * The margin is then subtracted to this length and the translation is applied to the child + * objects of the SpringArm3D. + * This margin is useful for when the SpringArm3D has a [Camera3D] as a child node: without the + * margin, the [Camera3D] would be placed on the exact point of collision, while with the margin the + * [Camera3D] would be placed close to the point of collision. */ public var margin: Float get() { @@ -111,7 +116,8 @@ public open class SpringArm3D : Node3D() { } /** - * Adds the [godot.PhysicsBody3D] object with the given [RID] to the list of [godot.PhysicsBody3D] objects excluded from the collision check. + * Adds the [PhysicsBody3D] object with the given [RID] to the list of [PhysicsBody3D] objects + * excluded from the collision check. */ public fun addExcludedObject(RID: RID): Unit { TransferContext.writeArguments(_RID to RID) @@ -119,7 +125,8 @@ public open class SpringArm3D : Node3D() { } /** - * Removes the given [RID] from the list of [godot.PhysicsBody3D] objects excluded from the collision check. + * Removes the given [RID] from the list of [PhysicsBody3D] objects excluded from the collision + * check. */ public fun removeExcludedObject(RID: RID): Boolean { TransferContext.writeArguments(_RID to RID) @@ -128,7 +135,7 @@ public open class SpringArm3D : Node3D() { } /** - * Clears the list of [godot.PhysicsBody3D] objects excluded from the collision check. + * Clears the list of [PhysicsBody3D] objects excluded from the collision check. */ public fun clearExcludedObjects(): Unit { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Sprite2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Sprite2D.kt index 5809910c9..9bd6f2201 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Sprite2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Sprite2D.kt @@ -31,12 +31,8 @@ import kotlin.Suppress import kotlin.Unit /** - * General-purpose sprite node. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/148](https://godotengine.org/asset-library/asset/148) - * - * A node that displays a 2D texture. The texture displayed can be a region from a larger atlas texture, or a frame from a sprite sheet animation. + * A node that displays a 2D texture. The texture displayed can be a region from a larger atlas + * texture, or a frame from a sprite sheet animation. */ @GodotBaseType public open class Sprite2D : Node2D() { @@ -51,7 +47,7 @@ public open class Sprite2D : Node2D() { public val textureChanged: Signal0 by signal() /** - * [godot.Texture2D] object to draw. + * [Texture2D] object to draw. */ public var texture: Texture2D? get() { @@ -164,7 +160,8 @@ public open class Sprite2D : Node2D() { } /** - * Coordinates of the frame to display from sprite sheet. This is as an alias for the [frame] property. [hframes] or [vframes] must be greater than 1. + * Coordinates of the frame to display from sprite sheet. This is as an alias for the [frame] + * property. [hframes] or [vframes] must be greater than 1. */ @CoreTypeLocalCopy public var frameCoords: Vector2i @@ -251,7 +248,8 @@ public open class Sprite2D : Node2D() { /** - * Coordinates of the frame to display from sprite sheet. This is as an alias for the [frame] property. [hframes] or [vframes] must be greater than 1. + * Coordinates of the frame to display from sprite sheet. This is as an alias for the [frame] + * property. [hframes] or [vframes] must be greater than 1. * * This is a helper function to make dealing with local copies easier. * @@ -300,8 +298,8 @@ public open class Sprite2D : Node2D() { /** * Returns `true`, if the pixel at the given position is opaque and `false` in other case. - * - * **Note:** It also returns `false`, if the sprite's texture is `null` or if the given position is invalid. + * **Note:** It also returns `false`, if the sprite's texture is `null` or if the given position + * is invalid. */ public fun isPixelOpaque(pos: Vector2): Boolean { TransferContext.writeArguments(VECTOR2 to pos) @@ -310,55 +308,34 @@ public open class Sprite2D : Node2D() { } /** - * Returns a [godot.core.Rect2] representing the Sprite2D's boundary in local coordinates. Can be used to detect if the Sprite2D was clicked. - * + * Returns a [Rect2] representing the Sprite2D's boundary in local coordinates. Can be used to + * detect if the Sprite2D was clicked. * **Example:** * - * [codeblocks] - * - * [gdscript] - * + * gdscript: + * ```gdscript * func _input(event): - * - * if event is InputEventMouseButton and event.pressed and event.button_index == MOUSE_BUTTON_LEFT: - * + * if event is InputEventMouseButton and event.pressed and event.button_index == + * MOUSE_BUTTON_LEFT: * if get_rect().has_point(to_local(event.position)): - * * print("A click!") - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * public override void _Input(InputEvent @event) - * * { - * * if (@event is InputEventMouseButton inputEventMouse) - * * { - * * if (inputEventMouse.Pressed && inputEventMouse.ButtonIndex == MouseButton.Left) - * * { - * * if (GetRect().HasPoint(ToLocal(inputEventMouse.Position))) - * * { - * * GD.Print("A click!"); - * * } - * * } - * * } - * * } - * - * [/csharp] - * - * [/codeblocks] + * ``` */ public fun getRect(): Rect2 { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Sprite3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Sprite3D.kt index 83e7f4cd3..776173579 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Sprite3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Sprite3D.kt @@ -29,9 +29,9 @@ import kotlin.Suppress import kotlin.Unit /** - * 2D sprite node in a 3D world. - * - * A node that displays a 2D texture in a 3D environment. The texture displayed can be a region from a larger atlas texture, or a frame from a sprite sheet animation. See also [godot.SpriteBase3D] where properties such as the billboard mode are defined. + * A node that displays a 2D texture in a 3D environment. The texture displayed can be a region from + * a larger atlas texture, or a frame from a sprite sheet animation. See also [SpriteBase3D] where + * properties such as the billboard mode are defined. */ @GodotBaseType public open class Sprite3D : SpriteBase3D() { @@ -46,7 +46,8 @@ public open class Sprite3D : SpriteBase3D() { public val textureChanged: Signal0 by signal() /** - * [godot.Texture2D] object to draw. If [godot.GeometryInstance3D.materialOverride] is used, this will be overridden. The size information is still used. + * [Texture2D] object to draw. If [GeometryInstance3D.materialOverride] is used, this will be + * overridden. The size information is still used. */ public var texture: Texture2D? get() { @@ -102,7 +103,8 @@ public open class Sprite3D : SpriteBase3D() { } /** - * Coordinates of the frame to display from sprite sheet. This is as an alias for the [frame] property. [hframes] or [vframes] must be greater than 1. + * Coordinates of the frame to display from sprite sheet. This is as an alias for the [frame] + * property. [hframes] or [vframes] must be greater than 1. */ @CoreTypeLocalCopy public var frameCoords: Vector2i @@ -151,7 +153,8 @@ public open class Sprite3D : SpriteBase3D() { } /** - * Coordinates of the frame to display from sprite sheet. This is as an alias for the [frame] property. [hframes] or [vframes] must be greater than 1. + * Coordinates of the frame to display from sprite sheet. This is as an alias for the [frame] + * property. [hframes] or [vframes] must be greater than 1. * * This is a helper function to make dealing with local copies easier. * diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/SpriteFrames.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/SpriteFrames.kt index e40c5862b..3ebf3f34d 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/SpriteFrames.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/SpriteFrames.kt @@ -29,9 +29,8 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * Sprite frame library for AnimatedSprite2D and AnimatedSprite3D. - * - * Sprite frame library for an [godot.AnimatedSprite2D] or [godot.AnimatedSprite3D] node. Contains frames and animation data for playback. + * Sprite frame library for an [AnimatedSprite2D] or [AnimatedSprite3D] node. Contains frames and + * animation data for playback. */ @GodotBaseType public open class SpriteFrames : Resource() { @@ -41,7 +40,7 @@ public open class SpriteFrames : Resource() { } /** - * Adds a new [anim] animation to the library. + * Adds a new [param anim] animation to the library. */ public fun addAnimation(anim: StringName): Unit { TransferContext.writeArguments(STRING_NAME to anim) @@ -49,7 +48,7 @@ public open class SpriteFrames : Resource() { } /** - * Returns `true` if the [anim] animation exists. + * Returns `true` if the [param anim] animation exists. */ public fun hasAnimation(anim: StringName): Boolean { TransferContext.writeArguments(STRING_NAME to anim) @@ -58,7 +57,7 @@ public open class SpriteFrames : Resource() { } /** - * Removes the [anim] animation. + * Removes the [param anim] animation. */ public fun removeAnimation(anim: StringName): Unit { TransferContext.writeArguments(STRING_NAME to anim) @@ -66,7 +65,7 @@ public open class SpriteFrames : Resource() { } /** - * Changes the [anim] animation's name to [newname]. + * Changes the [param anim] animation's name to [param newname]. */ public fun renameAnimation(anim: StringName, newname: StringName): Unit { TransferContext.writeArguments(STRING_NAME to anim, STRING_NAME to newname) @@ -74,7 +73,8 @@ public open class SpriteFrames : Resource() { } /** - * Returns an array containing the names associated to each animation. Values are placed in alphabetical order. + * Returns an array containing the names associated to each animation. Values are placed in + * alphabetical order. */ public fun getAnimationNames(): PackedStringArray { TransferContext.writeArguments() @@ -83,7 +83,7 @@ public open class SpriteFrames : Resource() { } /** - * Sets the speed for the [anim] animation in frames per second. + * Sets the speed for the [param anim] animation in frames per second. */ public fun setAnimationSpeed(anim: StringName, fps: Double): Unit { TransferContext.writeArguments(STRING_NAME to anim, DOUBLE to fps) @@ -91,7 +91,7 @@ public open class SpriteFrames : Resource() { } /** - * Returns the speed in frames per second for the [anim] animation. + * Returns the speed in frames per second for the [param anim] animation. */ public fun getAnimationSpeed(anim: StringName): Double { TransferContext.writeArguments(STRING_NAME to anim) @@ -100,7 +100,8 @@ public open class SpriteFrames : Resource() { } /** - * If [loop] is `true`, the [anim] animation will loop when it reaches the end, or the start if it is played in reverse. + * If [param loop] is `true`, the [param anim] animation will loop when it reaches the end, or the + * start if it is played in reverse. */ public fun setAnimationLoop(anim: StringName, loop: Boolean): Unit { TransferContext.writeArguments(STRING_NAME to anim, BOOL to loop) @@ -108,7 +109,8 @@ public open class SpriteFrames : Resource() { } /** - * Returns `true` if the given animation is configured to loop when it finishes playing. Otherwise, returns `false`. + * Returns `true` if the given animation is configured to loop when it finishes playing. + * Otherwise, returns `false`. */ public fun getAnimationLoop(anim: StringName): Boolean { TransferContext.writeArguments(STRING_NAME to anim) @@ -117,7 +119,8 @@ public open class SpriteFrames : Resource() { } /** - * Adds a frame to the [anim] animation. If [atPosition] is `-1`, the frame will be added to the end of the animation. + * Adds a frame to the [param anim] animation. If [param at_position] is `-1`, the frame will be + * added to the end of the animation. */ @JvmOverloads public fun addFrame( @@ -131,7 +134,8 @@ public open class SpriteFrames : Resource() { } /** - * Sets the [texture] and the [duration] of the frame [idx] in the [anim] animation. + * Sets the [param texture] and the [param duration] of the frame [param idx] in the [param anim] + * animation. */ @JvmOverloads public fun setFrame( @@ -145,7 +149,7 @@ public open class SpriteFrames : Resource() { } /** - * Removes the [anim] animation's frame [idx]. + * Removes the [param anim] animation's frame [param idx]. */ public fun removeFrame(anim: StringName, idx: Int): Unit { TransferContext.writeArguments(STRING_NAME to anim, LONG to idx.toLong()) @@ -153,7 +157,7 @@ public open class SpriteFrames : Resource() { } /** - * Returns the number of frames for the [anim] animation. + * Returns the number of frames for the [param anim] animation. */ public fun getFrameCount(anim: StringName): Int { TransferContext.writeArguments(STRING_NAME to anim) @@ -162,7 +166,7 @@ public open class SpriteFrames : Resource() { } /** - * Returns the texture of the frame [idx] in the [anim] animation. + * Returns the texture of the frame [param idx] in the [param anim] animation. */ public fun getFrameTexture(anim: StringName, idx: Int): Texture2D? { TransferContext.writeArguments(STRING_NAME to anim, LONG to idx.toLong()) @@ -171,13 +175,15 @@ public open class SpriteFrames : Resource() { } /** - * Returns a relative duration of the frame [idx] in the [anim] animation (defaults to `1.0`). For example, a frame with a duration of `2.0` is displayed twice as long as a frame with a duration of `1.0`. You can calculate the absolute duration (in seconds) of a frame using the following formula: - * - * ``` - * absolute_duration = relative_duration / (animation_fps * abs(playing_speed)) - * ``` - * - * In this example, `playing_speed` refers to either [godot.AnimatedSprite2D.getPlayingSpeed] or [godot.AnimatedSprite3D.getPlayingSpeed]. + * Returns a relative duration of the frame [param idx] in the [param anim] animation (defaults to + * `1.0`). For example, a frame with a duration of `2.0` is displayed twice as long as a frame with a + * duration of `1.0`. You can calculate the absolute duration (in seconds) of a frame using the + * following formula: + * [codeblock] + * absolute_duration = relative_duration / (animation_fps * abs(playing_speed)) + * [/codeblock] + * In this example, `playing_speed` refers to either [AnimatedSprite2D.getPlayingSpeed] or + * [AnimatedSprite3D.getPlayingSpeed]. */ public fun getFrameDuration(anim: StringName, idx: Int): Float { TransferContext.writeArguments(STRING_NAME to anim, LONG to idx.toLong()) @@ -186,7 +192,7 @@ public open class SpriteFrames : Resource() { } /** - * Removes all frames from the [anim] animation. + * Removes all frames from the [param anim] animation. */ public fun clear(anim: StringName): Unit { TransferContext.writeArguments(STRING_NAME to anim) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/StandardMaterial3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/StandardMaterial3D.kt index 2674b1236..d5ffefe1c 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/StandardMaterial3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/StandardMaterial3D.kt @@ -12,12 +12,9 @@ import kotlin.Int import kotlin.Suppress /** - * A PBR (Physically Based Rendering) material to be used on 3D objects. - * - * Tutorials: - * [$DOCS_URL/tutorials/3d/standard_material_3d.html]($DOCS_URL/tutorials/3d/standard_material_3d.html) - * - * [godot.StandardMaterial3D]'s properties are inherited from [godot.BaseMaterial3D]. [godot.StandardMaterial3D] uses separate textures for ambient occlusion, roughness and metallic maps. To use a single ORM map for all 3 textures, use an [godot.ORMMaterial3D] instead. + * [StandardMaterial3D]'s properties are inherited from [BaseMaterial3D]. [StandardMaterial3D] uses + * separate textures for ambient occlusion, roughness and metallic maps. To use a single ORM map for + * all 3 textures, use an [ORMMaterial3D] instead. */ @GodotBaseType public open class StandardMaterial3D : BaseMaterial3D() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/StaticBody2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/StaticBody2D.kt index fef9eb0f6..d5ca73e94 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/StaticBody2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/StaticBody2D.kt @@ -25,20 +25,21 @@ import kotlin.Suppress import kotlin.Unit /** - * A 2D physics body that can't be moved by external forces. When moved manually, it doesn't affect other bodies in its path. - * - * A static 2D physics body. It can't be moved by external forces or contacts, but can be moved manually by other means such as code, [godot.AnimationMixer]s (with [godot.AnimationMixer.callbackModeProcess] set to [godot.AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_PHYSICS]), and [godot.RemoteTransform2D]. - * - * When [godot.StaticBody2D] is moved, it is teleported to its new position without affecting other physics bodies in its path. If this is not desired, use [godot.AnimatableBody2D] instead. - * - * [godot.StaticBody2D] is useful for completely static objects like floors and walls, as well as moving surfaces like conveyor belts and circular revolving platforms (by using [constantLinearVelocity] and [constantAngularVelocity]). + * A static 2D physics body. It can't be moved by external forces or contacts, but can be moved + * manually by other means such as code, [AnimationMixer]s (with [AnimationMixer.callbackModeProcess] + * set to [constant AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_PHYSICS]), and [RemoteTransform2D]. + * When [StaticBody2D] is moved, it is teleported to its new position without affecting other + * physics bodies in its path. If this is not desired, use [AnimatableBody2D] instead. + * [StaticBody2D] is useful for completely static objects like floors and walls, as well as moving + * surfaces like conveyor belts and circular revolving platforms (by using [constantLinearVelocity] and + * [constantAngularVelocity]). */ @GodotBaseType public open class StaticBody2D : PhysicsBody2D() { /** * The physics material override for the body. - * - * If a material is assigned to this property, it will be used instead of any other physics material, such as an inherited one. + * If a material is assigned to this property, it will be used instead of any other physics + * material, such as an inherited one. */ public var physicsMaterialOverride: PhysicsMaterial? get() { @@ -52,7 +53,8 @@ public open class StaticBody2D : PhysicsBody2D() { } /** - * The body's constant linear velocity. This does not move the body, but affects touching bodies, as if it were moving. + * The body's constant linear velocity. This does not move the body, but affects touching bodies, + * as if it were moving. */ @CoreTypeLocalCopy public var constantLinearVelocity: Vector2 @@ -67,7 +69,8 @@ public open class StaticBody2D : PhysicsBody2D() { } /** - * The body's constant angular velocity. This does not rotate the body, but affects touching bodies, as if it were rotating. + * The body's constant angular velocity. This does not rotate the body, but affects touching + * bodies, as if it were rotating. */ public var constantAngularVelocity: Float get() { @@ -86,7 +89,8 @@ public open class StaticBody2D : PhysicsBody2D() { } /** - * The body's constant linear velocity. This does not move the body, but affects touching bodies, as if it were moving. + * The body's constant linear velocity. This does not move the body, but affects touching bodies, + * as if it were moving. * * This is a helper function to make dealing with local copies easier. * diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/StaticBody3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/StaticBody3D.kt index f6463963c..a3264c153 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/StaticBody3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/StaticBody3D.kt @@ -22,23 +22,21 @@ import kotlin.Suppress import kotlin.Unit /** - * A 3D physics body that can't be moved by external forces. When moved manually, it doesn't affect other bodies in its path. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/676](https://godotengine.org/asset-library/asset/676) - * - * A static 3D physics body. It can't be moved by external forces or contacts, but can be moved manually by other means such as code, [godot.AnimationMixer]s (with [godot.AnimationMixer.callbackModeProcess] set to [godot.AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_PHYSICS]), and [godot.RemoteTransform3D]. - * - * When [godot.StaticBody3D] is moved, it is teleported to its new position without affecting other physics bodies in its path. If this is not desired, use [godot.AnimatableBody3D] instead. - * - * [godot.StaticBody3D] is useful for completely static objects like floors and walls, as well as moving surfaces like conveyor belts and circular revolving platforms (by using [constantLinearVelocity] and [constantAngularVelocity]). + * A static 3D physics body. It can't be moved by external forces or contacts, but can be moved + * manually by other means such as code, [AnimationMixer]s (with [AnimationMixer.callbackModeProcess] + * set to [constant AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_PHYSICS]), and [RemoteTransform3D]. + * When [StaticBody3D] is moved, it is teleported to its new position without affecting other + * physics bodies in its path. If this is not desired, use [AnimatableBody3D] instead. + * [StaticBody3D] is useful for completely static objects like floors and walls, as well as moving + * surfaces like conveyor belts and circular revolving platforms (by using [constantLinearVelocity] and + * [constantAngularVelocity]). */ @GodotBaseType public open class StaticBody3D : PhysicsBody3D() { /** * The physics material override for the body. - * - * If a material is assigned to this property, it will be used instead of any other physics material, such as an inherited one. + * If a material is assigned to this property, it will be used instead of any other physics + * material, such as an inherited one. */ public var physicsMaterialOverride: PhysicsMaterial? get() { @@ -52,7 +50,8 @@ public open class StaticBody3D : PhysicsBody3D() { } /** - * The body's constant linear velocity. This does not move the body, but affects touching bodies, as if it were moving. + * The body's constant linear velocity. This does not move the body, but affects touching bodies, + * as if it were moving. */ @CoreTypeLocalCopy public var constantLinearVelocity: Vector3 @@ -67,7 +66,8 @@ public open class StaticBody3D : PhysicsBody3D() { } /** - * The body's constant angular velocity. This does not rotate the body, but affects touching bodies, as if it were rotating. + * The body's constant angular velocity. This does not rotate the body, but affects touching + * bodies, as if it were rotating. */ @CoreTypeLocalCopy public var constantAngularVelocity: Vector3 @@ -87,7 +87,8 @@ public open class StaticBody3D : PhysicsBody3D() { } /** - * The body's constant linear velocity. This does not move the body, but affects touching bodies, as if it were moving. + * The body's constant linear velocity. This does not move the body, but affects touching bodies, + * as if it were moving. * * This is a helper function to make dealing with local copies easier. * @@ -112,7 +113,8 @@ public open class StaticBody3D : PhysicsBody3D() { /** - * The body's constant angular velocity. This does not rotate the body, but affects touching bodies, as if it were rotating. + * The body's constant angular velocity. This does not rotate the body, but affects touching + * bodies, as if it were rotating. * * This is a helper function to make dealing with local copies easier. * diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/StreamPeer.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/StreamPeer.kt index c13971851..cd5afd719 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/StreamPeer.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/StreamPeer.kt @@ -33,16 +33,16 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * Abstract base class for interacting with streams. - * - * StreamPeer is an abstract base class mostly used for stream-based protocols (such as TCP). It provides an API for sending and receiving data through streams as raw data or strings. - * - * **Note:** When exporting to Android, make sure to enable the `INTERNET` permission in the Android export preset before exporting the project or using one-click deploy. Otherwise, network communication of any kind will be blocked by Android. + * StreamPeer is an abstract base class mostly used for stream-based protocols (such as TCP). It + * provides an API for sending and receiving data through streams as raw data or strings. + * **Note:** When exporting to Android, make sure to enable the `INTERNET` permission in the Android + * export preset before exporting the project or using one-click deploy. Otherwise, network + * communication of any kind will be blocked by Android. */ @GodotBaseType public open class StreamPeer internal constructor() : RefCounted() { /** - * If `true`, this [godot.StreamPeer] will using big-endian format for encoding and decoding. + * If `true`, this [StreamPeer] will using big-endian format for encoding and decoding. */ public var bigEndian: Boolean get() { @@ -61,7 +61,8 @@ public open class StreamPeer internal constructor() : RefCounted() { } /** - * Sends a chunk of data through the connection, blocking if necessary until the data is done sending. This function returns an [enum Error] code. + * Sends a chunk of data through the connection, blocking if necessary until the data is done + * sending. This function returns an [enum Error] code. */ public fun putData(`data`: PackedByteArray): GodotError { TransferContext.writeArguments(PACKED_BYTE_ARRAY to data) @@ -70,7 +71,9 @@ public open class StreamPeer internal constructor() : RefCounted() { } /** - * Sends a chunk of data through the connection. If all the data could not be sent at once, only part of it will. This function returns two values, an [enum Error] code and an integer, describing how much data was actually sent. + * Sends a chunk of data through the connection. If all the data could not be sent at once, only + * part of it will. This function returns two values, an [enum Error] code and an integer, describing + * how much data was actually sent. */ public fun putPartialData(`data`: PackedByteArray): VariantArray { TransferContext.writeArguments(PACKED_BYTE_ARRAY to data) @@ -79,7 +82,10 @@ public open class StreamPeer internal constructor() : RefCounted() { } /** - * Returns a chunk data with the received bytes. The number of bytes to be received can be requested in the [bytes] argument. If not enough bytes are available, the function will block until the desired amount is received. This function returns two values, an [enum Error] code and a data array. + * Returns a chunk data with the received bytes. The number of bytes to be received can be + * requested in the [param bytes] argument. If not enough bytes are available, the function will + * block until the desired amount is received. This function returns two values, an [enum Error] code + * and a data array. */ public fun getData(bytes: Int): VariantArray { TransferContext.writeArguments(LONG to bytes.toLong()) @@ -88,7 +94,10 @@ public open class StreamPeer internal constructor() : RefCounted() { } /** - * Returns a chunk data with the received bytes. The number of bytes to be received can be requested in the "bytes" argument. If not enough bytes are available, the function will return how many were actually received. This function returns two values, an [enum Error] code, and a data array. + * Returns a chunk data with the received bytes. The number of bytes to be received can be + * requested in the "bytes" argument. If not enough bytes are available, the function will return how + * many were actually received. This function returns two values, an [enum Error] code, and a data + * array. */ public fun getPartialData(bytes: Int): VariantArray { TransferContext.writeArguments(LONG to bytes.toLong()) @@ -97,7 +106,7 @@ public open class StreamPeer internal constructor() : RefCounted() { } /** - * Returns the number of bytes this [godot.StreamPeer] has available. + * Returns the number of bytes this [StreamPeer] has available. */ public fun getAvailableBytes(): Int { TransferContext.writeArguments() @@ -186,25 +195,18 @@ public open class StreamPeer internal constructor() : RefCounted() { } /** - * Puts a zero-terminated ASCII string into the stream prepended by a 32-bit unsigned integer representing its size. - * + * Puts a zero-terminated ASCII string into the stream prepended by a 32-bit unsigned integer + * representing its size. * **Note:** To put an ASCII string without prepending its size, you can use [putData]: * - * [codeblocks] - * - * [gdscript] - * + * gdscript: + * ```gdscript * put_data("Hello world".to_ascii_buffer()) - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * PutData("Hello World".ToAsciiBuffer()); - * - * [/csharp] - * - * [/codeblocks] + * ``` */ public fun putString(`value`: String): Unit { TransferContext.writeArguments(STRING to value) @@ -212,25 +214,18 @@ public open class StreamPeer internal constructor() : RefCounted() { } /** - * Puts a zero-terminated UTF-8 string into the stream prepended by a 32 bits unsigned integer representing its size. - * + * Puts a zero-terminated UTF-8 string into the stream prepended by a 32 bits unsigned integer + * representing its size. * **Note:** To put a UTF-8 string without prepending its size, you can use [putData]: * - * [codeblocks] - * - * [gdscript] - * + * gdscript: + * ```gdscript * put_data("Hello world".to_utf8_buffer()) - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * PutData("Hello World".ToUtf8Buffer()); - * - * [/csharp] - * - * [/codeblocks] + * ``` */ public fun putUtf8String(`value`: String): Unit { TransferContext.writeArguments(STRING to value) @@ -238,8 +233,8 @@ public open class StreamPeer internal constructor() : RefCounted() { } /** - * Puts a Variant into the stream. If [fullObjects] is `true` encoding objects is allowed (and can potentially include code). - * + * Puts a Variant into the stream. If [param full_objects] is `true` encoding objects is allowed + * (and can potentially include code). * Internally, this uses the same encoding mechanism as the [@GlobalScope.varToBytes] method. */ @JvmOverloads @@ -339,7 +334,9 @@ public open class StreamPeer internal constructor() : RefCounted() { } /** - * Gets an ASCII string with byte-length [bytes] from the stream. If [bytes] is negative (default) the length will be read from the stream using the reverse process of [putString]. + * Gets an ASCII string with byte-length [param bytes] from the stream. If [param bytes] is + * negative (default) the length will be read from the stream using the reverse process of + * [putString]. */ @JvmOverloads public fun getString(bytes: Int = -1): String { @@ -349,7 +346,9 @@ public open class StreamPeer internal constructor() : RefCounted() { } /** - * Gets a UTF-8 string with byte-length [bytes] from the stream (this decodes the string sent as UTF-8). If [bytes] is negative (default) the length will be read from the stream using the reverse process of [putUtf8String]. + * Gets a UTF-8 string with byte-length [param bytes] from the stream (this decodes the string + * sent as UTF-8). If [param bytes] is negative (default) the length will be read from the stream + * using the reverse process of [putUtf8String]. */ @JvmOverloads public fun getUtf8String(bytes: Int = -1): String { @@ -359,11 +358,12 @@ public open class StreamPeer internal constructor() : RefCounted() { } /** - * Gets a Variant from the stream. If [allowObjects] is `true`, decoding objects is allowed. - * + * Gets a Variant from the stream. If [param allow_objects] is `true`, decoding objects is + * allowed. * Internally, this uses the same decoding mechanism as the [@GlobalScope.bytesToVar] method. - * - * **Warning:** Deserialized objects can contain code which gets executed. Do not use this option if the serialized object comes from untrusted sources to avoid potential security threats such as remote code execution. + * **Warning:** Deserialized objects can contain code which gets executed. Do not use this option + * if the serialized object comes from untrusted sources to avoid potential security threats such as + * remote code execution. */ @JvmOverloads public fun getVar(allowObjects: Boolean = false): Any? { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/StreamPeerBuffer.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/StreamPeerBuffer.kt index 24d5a6f82..b87e9048d 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/StreamPeerBuffer.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/StreamPeerBuffer.kt @@ -22,11 +22,12 @@ import kotlin.Suppress import kotlin.Unit /** - * A stream peer used to handle binary data streams. - * - * A data buffer stream peer that uses a byte array as the stream. This object can be used to handle binary data from network sessions. To handle binary data stored in files, [godot.FileAccess] can be used directly. - * - * A [godot.StreamPeerBuffer] object keeps an internal cursor which is the offset in bytes to the start of the buffer. Get and put operations are performed at the cursor position and will move the cursor accordingly. + * A data buffer stream peer that uses a byte array as the stream. This object can be used to handle + * binary data from network sessions. To handle binary data stored in files, [FileAccess] can be used + * directly. + * A [StreamPeerBuffer] object keeps an internal cursor which is the offset in bytes to the start of + * the buffer. Get and put operations are performed at the cursor position and will move the cursor + * accordingly. */ @GodotBaseType public open class StreamPeerBuffer : StreamPeer() { @@ -50,7 +51,8 @@ public open class StreamPeerBuffer : StreamPeer() { } /** - * Moves the cursor to the specified position. [position] must be a valid index of [dataArray]. + * Moves the cursor to the specified position. [param position] must be a valid index of + * [dataArray]. */ public fun seek(position: Int): Unit { TransferContext.writeArguments(LONG to position.toLong()) @@ -92,7 +94,7 @@ public open class StreamPeerBuffer : StreamPeer() { } /** - * Returns a new [godot.StreamPeerBuffer] with the same [dataArray] content. + * Returns a new [StreamPeerBuffer] with the same [dataArray] content. */ public fun duplicate(): StreamPeerBuffer? { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/StreamPeerExtension.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/StreamPeerExtension.kt index 29dd8f94f..3323f1930 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/StreamPeerExtension.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/StreamPeerExtension.kt @@ -14,9 +14,6 @@ import kotlin.Int import kotlin.NotImplementedError import kotlin.Suppress -/** - * - */ @GodotBaseType public open class StreamPeerExtension : StreamPeer() { public override fun new(scriptIndex: Int): Boolean { @@ -24,9 +21,6 @@ public open class StreamPeerExtension : StreamPeer() { return true } - /** - * - */ public open fun _getAvailableBytes(): Int { throw NotImplementedError("_get_available_bytes is not implemented for StreamPeerExtension") } diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/StreamPeerGZIP.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/StreamPeerGZIP.kt index 44e630205..350124354 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/StreamPeerGZIP.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/StreamPeerGZIP.kt @@ -22,11 +22,16 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * A stream peer that handles GZIP and deflate compression/decompression. - * - * This class allows to compress or decompress data using GZIP/deflate in a streaming fashion. This is particularly useful when compressing or decompressing files that have to be sent through the network without needing to allocate them all in memory. - * - * After starting the stream via [startCompression] (or [startDecompression]), calling [godot.StreamPeer.putPartialData] on this stream will compress (or decompress) the data, writing it to the internal buffer. Calling [godot.StreamPeer.getAvailableBytes] will return the pending bytes in the internal buffer, and [godot.StreamPeer.getPartialData] will retrieve the compressed (or decompressed) bytes from it. When the stream is over, you must call [finish] to ensure the internal buffer is properly flushed (make sure to call [godot.StreamPeer.getAvailableBytes] on last time to check if more data needs to be read after that). + * This class allows to compress or decompress data using GZIP/deflate in a streaming fashion. This + * is particularly useful when compressing or decompressing files that have to be sent through the + * network without needing to allocate them all in memory. + * After starting the stream via [startCompression] (or [startDecompression]), calling + * [StreamPeer.putPartialData] on this stream will compress (or decompress) the data, writing it to the + * internal buffer. Calling [StreamPeer.getAvailableBytes] will return the pending bytes in the + * internal buffer, and [StreamPeer.getPartialData] will retrieve the compressed (or decompressed) + * bytes from it. When the stream is over, you must call [finish] to ensure the internal buffer is + * properly flushed (make sure to call [StreamPeer.getAvailableBytes] on last time to check if more + * data needs to be read after that). */ @GodotBaseType public open class StreamPeerGZIP : StreamPeer() { @@ -36,7 +41,8 @@ public open class StreamPeerGZIP : StreamPeer() { } /** - * Start the stream in compression mode with the given [bufferSize], if [useDeflate] is `true` uses deflate instead of GZIP. + * Start the stream in compression mode with the given [param buffer_size], if [param use_deflate] + * is `true` uses deflate instead of GZIP. */ @JvmOverloads public fun startCompression(useDeflate: Boolean = false, bufferSize: Int = 65535): GodotError { @@ -46,7 +52,8 @@ public open class StreamPeerGZIP : StreamPeer() { } /** - * Start the stream in decompression mode with the given [bufferSize], if [useDeflate] is `true` uses deflate instead of GZIP. + * Start the stream in decompression mode with the given [param buffer_size], if [param + * use_deflate] is `true` uses deflate instead of GZIP. */ @JvmOverloads public fun startDecompression(useDeflate: Boolean = false, bufferSize: Int = 65535): GodotError { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/StreamPeerTCP.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/StreamPeerTCP.kt index 5569d85c9..5f4d27f50 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/StreamPeerTCP.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/StreamPeerTCP.kt @@ -24,11 +24,11 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * A stream peer that handles TCP connections. - * - * A stream peer that handles TCP connections. This object can be used to connect to TCP servers, or also is returned by a TCP server. - * - * **Note:** When exporting to Android, make sure to enable the `INTERNET` permission in the Android export preset before exporting the project or using one-click deploy. Otherwise, network communication of any kind will be blocked by Android. + * A stream peer that handles TCP connections. This object can be used to connect to TCP servers, or + * also is returned by a TCP server. + * **Note:** When exporting to Android, make sure to enable the `INTERNET` permission in the Android + * export preset before exporting the project or using one-click deploy. Otherwise, network + * communication of any kind will be blocked by Android. */ @GodotBaseType public open class StreamPeerTCP : StreamPeer() { @@ -39,8 +39,9 @@ public open class StreamPeerTCP : StreamPeer() { /** * Opens the TCP socket, and binds it to the specified local address. - * - * This method is generally not needed, and only used to force the subsequent call to [connectToHost] to use the specified [host] and [port] as source address. This can be desired in some NAT punchthrough techniques, or when forcing the source network interface. + * This method is generally not needed, and only used to force the subsequent call to + * [connectToHost] to use the specified [param host] and [param port] as source address. This can be + * desired in some NAT punchthrough techniques, or when forcing the source network interface. */ @JvmOverloads public fun bind(port: Int, host: String = "*"): GodotError { @@ -50,7 +51,8 @@ public open class StreamPeerTCP : StreamPeer() { } /** - * Connects to the specified `host:port` pair. A hostname will be resolved if valid. Returns [OK] on success. + * Connects to the specified `host:port` pair. A hostname will be resolved if valid. Returns + * [constant OK] on success. */ public fun connectToHost(host: String, port: Int): GodotError { TransferContext.writeArguments(STRING to host, LONG to port.toLong()) @@ -112,9 +114,11 @@ public open class StreamPeerTCP : StreamPeer() { } /** - * If [enabled] is `true`, packets will be sent immediately. If [enabled] is `false` (the default), packet transfers will be delayed and combined using [godot.Nagle's algorithm](https://en.wikipedia.org/wiki/Nagle%27s_algorithm). - * - * **Note:** It's recommended to leave this disabled for applications that send large packets or need to transfer a lot of data, as enabling this can decrease the total available bandwidth. + * If [param enabled] is `true`, packets will be sent immediately. If [param enabled] is `false` + * (the default), packet transfers will be delayed and combined using + * [url=https://en.wikipedia.org/wiki/Nagle%27s_algorithm]Nagle's algorithm[/url]. + * **Note:** It's recommended to leave this disabled for applications that send large packets or + * need to transfer a lot of data, as enabling this can decrease the total available bandwidth. */ public fun setNoDelay(enabled: Boolean): Unit { TransferContext.writeArguments(BOOL to enabled) @@ -125,19 +129,19 @@ public open class StreamPeerTCP : StreamPeer() { id: Long, ) { /** - * The initial status of the [godot.StreamPeerTCP]. This is also the status after disconnecting. + * The initial status of the [StreamPeerTCP]. This is also the status after disconnecting. */ STATUS_NONE(0), /** - * A status representing a [godot.StreamPeerTCP] that is connecting to a host. + * A status representing a [StreamPeerTCP] that is connecting to a host. */ STATUS_CONNECTING(1), /** - * A status representing a [godot.StreamPeerTCP] that is connected to a host. + * A status representing a [StreamPeerTCP] that is connected to a host. */ STATUS_CONNECTED(2), /** - * A status representing a [godot.StreamPeerTCP] in error state. + * A status representing a [StreamPeerTCP] in error state. */ STATUS_ERROR(3), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/StreamPeerTLS.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/StreamPeerTLS.kt index 824d6cdf2..013d18061 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/StreamPeerTLS.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/StreamPeerTLS.kt @@ -24,14 +24,11 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * A stream peer that handles TLS connections. - * - * Tutorials: - * [$DOCS_URL/tutorials/networking/ssl_certificates.html]($DOCS_URL/tutorials/networking/ssl_certificates.html) - * - * A stream peer that handles TLS connections. This object can be used to connect to a TLS server or accept a single TLS client connection. - * - * **Note:** When exporting to Android, make sure to enable the `INTERNET` permission in the Android export preset before exporting the project or using one-click deploy. Otherwise, network communication of any kind will be blocked by Android. + * A stream peer that handles TLS connections. This object can be used to connect to a TLS server or + * accept a single TLS client connection. + * **Note:** When exporting to Android, make sure to enable the `INTERNET` permission in the Android + * export preset before exporting the project or using one-click deploy. Otherwise, network + * communication of any kind will be blocked by Android. */ @GodotBaseType public open class StreamPeerTLS : StreamPeer() { @@ -41,7 +38,8 @@ public open class StreamPeerTLS : StreamPeer() { } /** - * Poll the connection to check for incoming bytes. Call this right before [godot.StreamPeer.getAvailableBytes] for it to work properly. + * Poll the connection to check for incoming bytes. Call this right before + * [StreamPeer.getAvailableBytes] for it to work properly. */ public fun poll(): Unit { TransferContext.writeArguments() @@ -49,7 +47,8 @@ public open class StreamPeerTLS : StreamPeer() { } /** - * Accepts a peer connection as a server using the given [serverOptions]. See [godot.TLSOptions.server]. + * Accepts a peer connection as a server using the given [param server_options]. See + * [TLSOptions.server]. */ public fun acceptStream(stream: StreamPeer, serverOptions: TLSOptions): GodotError { TransferContext.writeArguments(OBJECT to stream, OBJECT to serverOptions) @@ -58,7 +57,10 @@ public open class StreamPeerTLS : StreamPeer() { } /** - * Connects to a peer using an underlying [godot.StreamPeer] [stream] and verifying the remote certificate is correctly signed for the given [commonName]. You can pass the optional [clientOptions] parameter to customize the trusted certification authorities, or disable the common name verification. See [godot.TLSOptions.client] and [godot.TLSOptions.clientUnsafe]. + * Connects to a peer using an underlying [StreamPeer] [param stream] and verifying the remote + * certificate is correctly signed for the given [param common_name]. You can pass the optional + * [param client_options] parameter to customize the trusted certification authorities, or disable + * the common name verification. See [TLSOptions.client] and [TLSOptions.clientUnsafe]. */ @JvmOverloads public fun connectToStream( @@ -81,7 +83,7 @@ public open class StreamPeerTLS : StreamPeer() { } /** - * Returns the underlying [godot.StreamPeer] connection, used in [acceptStream] or [connectToStream]. + * Returns the underlying [StreamPeer] connection, used in [acceptStream] or [connectToStream]. */ public fun getStream(): StreamPeer? { TransferContext.writeArguments() @@ -101,23 +103,24 @@ public open class StreamPeerTLS : StreamPeer() { id: Long, ) { /** - * A status representing a [godot.StreamPeerTLS] that is disconnected. + * A status representing a [StreamPeerTLS] that is disconnected. */ STATUS_DISCONNECTED(0), /** - * A status representing a [godot.StreamPeerTLS] during handshaking. + * A status representing a [StreamPeerTLS] during handshaking. */ STATUS_HANDSHAKING(1), /** - * A status representing a [godot.StreamPeerTLS] that is connected to a host. + * A status representing a [StreamPeerTLS] that is connected to a host. */ STATUS_CONNECTED(2), /** - * A status representing a [godot.StreamPeerTLS] in error state. + * A status representing a [StreamPeerTLS] in error state. */ STATUS_ERROR(3), /** - * An error status that shows a mismatch in the TLS certificate domain presented by the host and the domain requested for validation. + * An error status that shows a mismatch in the TLS certificate domain presented by the host and + * the domain requested for validation. */ STATUS_ERROR_HOSTNAME_MISMATCH(4), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/StyleBox.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/StyleBox.kt index ffaea1de0..dc2a08f87 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/StyleBox.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/StyleBox.kt @@ -30,17 +30,19 @@ import kotlin.Suppress import kotlin.Unit /** - * Abstract base class for defining stylized boxes for UI elements. - * - * [godot.StyleBox] is an abstract base class for drawing stylized boxes for UI elements. It is used for panels, buttons, [godot.LineEdit] backgrounds, [godot.Tree] backgrounds, etc. and also for testing a transparency mask for pointer signals. If mask test fails on a [godot.StyleBox] assigned as mask to a control, clicks and motion signals will go through it to the one below. - * - * **Note:** For control nodes that have *Theme Properties*, the `focus` [godot.StyleBox] is displayed over the `normal`, `hover` or `pressed` [godot.StyleBox]. This makes the `focus` [godot.StyleBox] more reusable across different nodes. + * [StyleBox] is an abstract base class for drawing stylized boxes for UI elements. It is used for + * panels, buttons, [LineEdit] backgrounds, [Tree] backgrounds, etc. and also for testing a + * transparency mask for pointer signals. If mask test fails on a [StyleBox] assigned as mask to a + * control, clicks and motion signals will go through it to the one below. + * **Note:** For control nodes that have *Theme Properties*, the `focus` [StyleBox] is displayed + * over the `normal`, `hover` or `pressed` [StyleBox]. This makes the `focus` [StyleBox] more reusable + * across different nodes. */ @GodotBaseType public open class StyleBox : Resource() { /** - * The left margin for the contents of this style box. Increasing this value reduces the space available to the contents from the left. - * + * The left margin for the contents of this style box. Increasing this value reduces the space + * available to the contents from the left. * Refer to [contentMarginBottom] for extra considerations. */ public var contentMarginLeft: Float @@ -55,8 +57,8 @@ public open class StyleBox : Resource() { } /** - * The top margin for the contents of this style box. Increasing this value reduces the space available to the contents from the top. - * + * The top margin for the contents of this style box. Increasing this value reduces the space + * available to the contents from the top. * Refer to [contentMarginBottom] for extra considerations. */ public var contentMarginTop: Float @@ -71,8 +73,8 @@ public open class StyleBox : Resource() { } /** - * The right margin for the contents of this style box. Increasing this value reduces the space available to the contents from the right. - * + * The right margin for the contents of this style box. Increasing this value reduces the space + * available to the contents from the right. * Refer to [contentMarginBottom] for extra considerations. */ public var contentMarginRight: Float @@ -87,13 +89,14 @@ public open class StyleBox : Resource() { } /** - * The bottom margin for the contents of this style box. Increasing this value reduces the space available to the contents from the bottom. - * - * If this value is negative, it is ignored and a child-specific margin is used instead. For example, for [godot.StyleBoxFlat], the border thickness (if any) is used instead. - * - * It is up to the code using this style box to decide what these contents are: for example, a [godot.Button] respects this content margin for the textual contents of the button. - * - * [getMargin] should be used to fetch this value as consumer instead of reading these properties directly. This is because it correctly respects negative values and the fallback mentioned above. + * The bottom margin for the contents of this style box. Increasing this value reduces the space + * available to the contents from the bottom. + * If this value is negative, it is ignored and a child-specific margin is used instead. For + * example, for [StyleBoxFlat], the border thickness (if any) is used instead. + * It is up to the code using this style box to decide what these contents are: for example, a + * [Button] respects this content margin for the textual contents of the button. + * [getMargin] should be used to fetch this value as consumer instead of reading these properties + * directly. This is because it correctly respects negative values and the fallback mentioned above. */ public var contentMarginBottom: Float get() { @@ -111,29 +114,23 @@ public open class StyleBox : Resource() { return true } - /** - * - */ public open fun _draw(toCanvasItem: RID, rect: Rect2): Unit { } - /** - * - */ public open fun _getDrawRect(rect: Rect2): Rect2 { throw NotImplementedError("_get_draw_rect is not implemented for StyleBox") } /** - * Virtual method to be implemented by the user. Returns a custom minimum size that the stylebox must respect when drawing. By default [getMinimumSize] only takes content margins into account. This method can be overridden to add another size restriction. A combination of the default behavior and the output of this method will be used, to account for both sizes. + * Virtual method to be implemented by the user. Returns a custom minimum size that the stylebox + * must respect when drawing. By default [getMinimumSize] only takes content margins into account. + * This method can be overridden to add another size restriction. A combination of the default + * behavior and the output of this method will be used, to account for both sizes. */ public open fun _getMinimumSize(): Vector2 { throw NotImplementedError("_get_minimum_size is not implemented for StyleBox") } - /** - * - */ public open fun _testMask(point: Vector2, rect: Rect2): Boolean { throw NotImplementedError("_test_mask is not implemented for StyleBox") } @@ -148,7 +145,7 @@ public open class StyleBox : Resource() { } /** - * Sets the default margin to [offset] pixels for all sides. + * Sets the default margin to [param offset] pixels for all sides. */ public fun setContentMarginAll(offset: Float): Unit { TransferContext.writeArguments(DOUBLE to offset.toDouble()) @@ -157,8 +154,7 @@ public open class StyleBox : Resource() { /** * Returns the content margin offset for the specified [enum Side]. - * - * Positive values reduce size inwards, unlike [godot.Control]'s margin values. + * Positive values reduce size inwards, unlike [Control]'s margin values. */ public fun getMargin(margin: Side): Float { TransferContext.writeArguments(LONG to margin.id) @@ -167,7 +163,8 @@ public open class StyleBox : Resource() { } /** - * Returns the "offset" of a stylebox. This helper function returns a value equivalent to `Vector2(style.get_margin(MARGIN_LEFT), style.get_margin(MARGIN_TOP))`. + * Returns the "offset" of a stylebox. This helper function returns a value equivalent to + * `Vector2(style.get_margin(MARGIN_LEFT), style.get_margin(MARGIN_TOP))`. */ public fun getOffset(): Vector2 { TransferContext.writeArguments() @@ -177,8 +174,9 @@ public open class StyleBox : Resource() { /** * Draws this stylebox using a canvas item identified by the given [RID]. - * - * The [RID] value can either be the result of [godot.CanvasItem.getCanvasItem] called on an existing [godot.CanvasItem]-derived node, or directly from creating a canvas item in the [godot.RenderingServer] with [godot.RenderingServer.canvasItemCreate]. + * The [RID] value can either be the result of [CanvasItem.getCanvasItem] called on an existing + * [CanvasItem]-derived node, or directly from creating a canvas item in the [RenderingServer] with + * [RenderingServer.canvasItemCreate]. */ public fun draw(canvasItem: RID, rect: Rect2): Unit { TransferContext.writeArguments(_RID to canvasItem, RECT2 to rect) @@ -186,7 +184,8 @@ public open class StyleBox : Resource() { } /** - * Returns the [godot.CanvasItem] that handles its [godot.CanvasItem.NOTIFICATION_DRAW] or [godot.CanvasItem.Draw] callback at this moment. + * Returns the [CanvasItem] that handles its [constant CanvasItem.NOTIFICATION_DRAW] or + * [CanvasItem.Draw] callback at this moment. */ public fun getCurrentItemDrawn(): CanvasItem? { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/StyleBoxEmpty.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/StyleBoxEmpty.kt index 103ed0872..fc543e88c 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/StyleBoxEmpty.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/StyleBoxEmpty.kt @@ -12,9 +12,8 @@ import kotlin.Int import kotlin.Suppress /** - * An empty [godot.StyleBox] (does not display anything). - * - * An empty [godot.StyleBox] that can be used to display nothing instead of the default style (e.g. it can "disable" `focus` styles). + * An empty [StyleBox] that can be used to display nothing instead of the default style (e.g. it can + * "disable" `focus` styles). */ @GodotBaseType public open class StyleBoxEmpty : StyleBox() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/StyleBoxFlat.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/StyleBoxFlat.kt index 72a70a918..8cf46a64e 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/StyleBoxFlat.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/StyleBoxFlat.kt @@ -29,26 +29,22 @@ import kotlin.Suppress import kotlin.Unit /** - * A customizable [godot.StyleBox] that doesn't use a texture. - * - * By configuring various properties of this style box, you can achieve many common looks without the need of a texture. This includes optionally rounded borders, antialiasing, shadows, and skew. - * - * Setting corner radius to high values is allowed. As soon as corners overlap, the stylebox will switch to a relative system. - * + * By configuring various properties of this style box, you can achieve many common looks without + * the need of a texture. This includes optionally rounded borders, antialiasing, shadows, and skew. + * Setting corner radius to high values is allowed. As soon as corners overlap, the stylebox will + * switch to a relative system. * **Example:** - * - * ``` - * height = 30 - * corner_radius_top_left = 50 - * corner_radius_bottom_left = 100 - * ``` - * - * The relative system now would take the 1:2 ratio of the two left corners to calculate the actual corner width. Both corners added will **never** be more than the height. Result: - * - * ``` - * corner_radius_top_left: 10 - * corner_radius_bottom_left: 20 - * ``` + * [codeblock] + * height = 30 + * corner_radius_top_left = 50 + * corner_radius_bottom_left = 100 + * [/codeblock] + * The relative system now would take the 1:2 ratio of the two left corners to calculate the actual + * corner width. Both corners added will **never** be more than the height. Result: + * [codeblock] + * corner_radius_top_left: 10 + * corner_radius_bottom_left: 20 + * [/codeblock] */ @GodotBaseType public open class StyleBoxFlat : StyleBox() { @@ -82,9 +78,14 @@ public open class StyleBoxFlat : StyleBox() { } /** - * If set to a non-zero value on either axis, [skew] distorts the StyleBox horizontally and/or vertically. This can be used for "futuristic"-style UIs. Positive values skew the StyleBox towards the right (X axis) and upwards (Y axis), while negative values skew the StyleBox towards the left (X axis) and downwards (Y axis). - * - * **Note:** To ensure text does not touch the StyleBox's edges, consider increasing the [godot.StyleBox]'s content margin (see [godot.StyleBox.contentMarginBottom]). It is preferable to increase the content margin instead of the expand margin (see [expandMarginBottom]), as increasing the expand margin does not increase the size of the clickable area for [godot.Control]s. + * If set to a non-zero value on either axis, [skew] distorts the StyleBox horizontally and/or + * vertically. This can be used for "futuristic"-style UIs. Positive values skew the StyleBox towards + * the right (X axis) and upwards (Y axis), while negative values skew the StyleBox towards the left + * (X axis) and downwards (Y axis). + * **Note:** To ensure text does not touch the StyleBox's edges, consider increasing the + * [StyleBox]'s content margin (see [StyleBox.contentMarginBottom]). It is preferable to increase the + * content margin instead of the expand margin (see [expandMarginBottom]), as increasing the expand + * margin does not increase the size of the clickable area for [Control]s. */ @CoreTypeLocalCopy public var skew: Vector2 @@ -240,11 +241,13 @@ public open class StyleBoxFlat : StyleBox() { } /** - * This sets the number of vertices used for each corner. Higher values result in rounder corners but take more processing power to compute. When choosing a value, you should take the corner radius ([setCornerRadiusAll]) into account. - * - * For corner radii less than 10, `4` or `5` should be enough. For corner radii less than 30, values between `8` and `12` should be enough. - * - * A corner detail of `1` will result in chamfered corners instead of rounded corners, which is useful for some artistic effects. + * This sets the number of vertices used for each corner. Higher values result in rounder corners + * but take more processing power to compute. When choosing a value, you should take the corner + * radius ([setCornerRadiusAll]) into account. + * For corner radii less than 10, `4` or `5` should be enough. For corner radii less than 30, + * values between `8` and `12` should be enough. + * A corner detail of `1` will result in chamfered corners instead of rounded corners, which is + * useful for some artistic effects. */ public var cornerDetail: Int get() { @@ -258,9 +261,11 @@ public open class StyleBoxFlat : StyleBox() { } /** - * Expands the stylebox outside of the control rect on the left edge. Useful in combination with [borderWidthLeft] to draw a border outside the control rect. - * - * **Note:** Unlike [godot.StyleBox.contentMarginLeft], [expandMarginLeft] does *not* affect the size of the clickable area for [godot.Control]s. This can negatively impact usability if used wrong, as the user may try to click an area of the StyleBox that cannot actually receive clicks. + * Expands the stylebox outside of the control rect on the left edge. Useful in combination with + * [borderWidthLeft] to draw a border outside the control rect. + * **Note:** Unlike [StyleBox.contentMarginLeft], [expandMarginLeft] does *not* affect the size of + * the clickable area for [Control]s. This can negatively impact usability if used wrong, as the user + * may try to click an area of the StyleBox that cannot actually receive clicks. */ public var expandMarginLeft: Float get() { @@ -274,9 +279,11 @@ public open class StyleBoxFlat : StyleBox() { } /** - * Expands the stylebox outside of the control rect on the top edge. Useful in combination with [borderWidthTop] to draw a border outside the control rect. - * - * **Note:** Unlike [godot.StyleBox.contentMarginTop], [expandMarginTop] does *not* affect the size of the clickable area for [godot.Control]s. This can negatively impact usability if used wrong, as the user may try to click an area of the StyleBox that cannot actually receive clicks. + * Expands the stylebox outside of the control rect on the top edge. Useful in combination with + * [borderWidthTop] to draw a border outside the control rect. + * **Note:** Unlike [StyleBox.contentMarginTop], [expandMarginTop] does *not* affect the size of + * the clickable area for [Control]s. This can negatively impact usability if used wrong, as the user + * may try to click an area of the StyleBox that cannot actually receive clicks. */ public var expandMarginTop: Float get() { @@ -290,9 +297,11 @@ public open class StyleBoxFlat : StyleBox() { } /** - * Expands the stylebox outside of the control rect on the right edge. Useful in combination with [borderWidthRight] to draw a border outside the control rect. - * - * **Note:** Unlike [godot.StyleBox.contentMarginRight], [expandMarginRight] does *not* affect the size of the clickable area for [godot.Control]s. This can negatively impact usability if used wrong, as the user may try to click an area of the StyleBox that cannot actually receive clicks. + * Expands the stylebox outside of the control rect on the right edge. Useful in combination with + * [borderWidthRight] to draw a border outside the control rect. + * **Note:** Unlike [StyleBox.contentMarginRight], [expandMarginRight] does *not* affect the size + * of the clickable area for [Control]s. This can negatively impact usability if used wrong, as the + * user may try to click an area of the StyleBox that cannot actually receive clicks. */ public var expandMarginRight: Float get() { @@ -306,9 +315,11 @@ public open class StyleBoxFlat : StyleBox() { } /** - * Expands the stylebox outside of the control rect on the bottom edge. Useful in combination with [borderWidthBottom] to draw a border outside the control rect. - * - * **Note:** Unlike [godot.StyleBox.contentMarginBottom], [expandMarginBottom] does *not* affect the size of the clickable area for [godot.Control]s. This can negatively impact usability if used wrong, as the user may try to click an area of the StyleBox that cannot actually receive clicks. + * Expands the stylebox outside of the control rect on the bottom edge. Useful in combination with + * [borderWidthBottom] to draw a border outside the control rect. + * **Note:** Unlike [StyleBox.contentMarginBottom], [expandMarginBottom] does *not* affect the + * size of the clickable area for [Control]s. This can negatively impact usability if used wrong, as + * the user may try to click an area of the StyleBox that cannot actually receive clicks. */ public var expandMarginBottom: Float get() { @@ -366,9 +377,11 @@ public open class StyleBoxFlat : StyleBox() { } /** - * Antialiasing draws a small ring around the edges, which fades to transparency. As a result, edges look much smoother. This is only noticeable when using rounded corners or [skew]. - * - * **Note:** When using beveled corners with 45-degree angles ([cornerDetail] = 1), it is recommended to set [antiAliasing] to `false` to ensure crisp visuals and avoid possible visual glitches. + * Antialiasing draws a small ring around the edges, which fades to transparency. As a result, + * edges look much smoother. This is only noticeable when using rounded corners or [skew]. + * **Note:** When using beveled corners with 45-degree angles ([cornerDetail] = 1), it is + * recommended to set [antiAliasing] to `false` to ensure crisp visuals and avoid possible visual + * glitches. */ public var antiAliasing: Boolean get() { @@ -382,9 +395,11 @@ public open class StyleBoxFlat : StyleBox() { } /** - * This changes the size of the antialiasing effect. `1.0` is recommended for an optimal result at 100% scale, identical to how rounded rectangles are rendered in web browsers and most vector drawing software. - * - * **Note:** Higher values may produce a blur effect but can also create undesired artifacts on small boxes with large-radius corners. + * This changes the size of the antialiasing effect. `1.0` is recommended for an optimal result at + * 100% scale, identical to how rounded rectangles are rendered in web browsers and most vector + * drawing software. + * **Note:** Higher values may produce a blur effect but can also create undesired artifacts on + * small boxes with large-radius corners. */ public var antiAliasingSize: Float get() { @@ -427,9 +442,14 @@ public open class StyleBoxFlat : StyleBox() { /** - * If set to a non-zero value on either axis, [skew] distorts the StyleBox horizontally and/or vertically. This can be used for "futuristic"-style UIs. Positive values skew the StyleBox towards the right (X axis) and upwards (Y axis), while negative values skew the StyleBox towards the left (X axis) and downwards (Y axis). - * - * **Note:** To ensure text does not touch the StyleBox's edges, consider increasing the [godot.StyleBox]'s content margin (see [godot.StyleBox.contentMarginBottom]). It is preferable to increase the content margin instead of the expand margin (see [expandMarginBottom]), as increasing the expand margin does not increase the size of the clickable area for [godot.Control]s. + * If set to a non-zero value on either axis, [skew] distorts the StyleBox horizontally and/or + * vertically. This can be used for "futuristic"-style UIs. Positive values skew the StyleBox towards + * the right (X axis) and upwards (Y axis), while negative values skew the StyleBox towards the left + * (X axis) and downwards (Y axis). + * **Note:** To ensure text does not touch the StyleBox's edges, consider increasing the + * [StyleBox]'s content margin (see [StyleBox.contentMarginBottom]). It is preferable to increase the + * content margin instead of the expand margin (see [expandMarginBottom]), as increasing the expand + * margin does not increase the size of the clickable area for [Control]s. * * This is a helper function to make dealing with local copies easier. * @@ -525,7 +545,7 @@ public open class StyleBoxFlat : StyleBox() { /** - * Sets the border width to [width] pixels for all sides. + * Sets the border width to [param width] pixels for all sides. */ public fun setBorderWidthAll(width: Int): Unit { TransferContext.writeArguments(LONG to width.toLong()) @@ -542,7 +562,7 @@ public open class StyleBoxFlat : StyleBox() { } /** - * Sets the corner radius to [radius] pixels for all corners. + * Sets the corner radius to [param radius] pixels for all corners. */ public fun setCornerRadiusAll(radius: Int): Unit { TransferContext.writeArguments(LONG to radius.toLong()) @@ -550,7 +570,7 @@ public open class StyleBoxFlat : StyleBox() { } /** - * Sets the expand margin to [size] pixels for all sides. + * Sets the expand margin to [param size] pixels for all sides. */ public fun setExpandMarginAll(size: Float): Unit { TransferContext.writeArguments(DOUBLE to size.toDouble()) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/StyleBoxLine.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/StyleBoxLine.kt index e35456146..060fea7da 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/StyleBoxLine.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/StyleBoxLine.kt @@ -27,9 +27,8 @@ import kotlin.Suppress import kotlin.Unit /** - * A [godot.StyleBox] that displays a single line of a given color and thickness. - * - * A [godot.StyleBox] that displays a single line of a given color and thickness. The line can be either horizontal or vertical. Useful for separators. + * A [StyleBox] that displays a single line of a given color and thickness. The line can be either + * horizontal or vertical. Useful for separators. */ @GodotBaseType public open class StyleBoxLine : StyleBox() { @@ -49,7 +48,8 @@ public open class StyleBoxLine : StyleBox() { } /** - * The number of pixels the line will extend before the [godot.StyleBoxLine]'s bounds. If set to a negative value, the line will begin inside the [godot.StyleBoxLine]'s bounds. + * The number of pixels the line will extend before the [StyleBoxLine]'s bounds. If set to a + * negative value, the line will begin inside the [StyleBoxLine]'s bounds. */ public var growBegin: Float get() { @@ -63,7 +63,8 @@ public open class StyleBoxLine : StyleBox() { } /** - * The number of pixels the line will extend past the [godot.StyleBoxLine]'s bounds. If set to a negative value, the line will end inside the [godot.StyleBoxLine]'s bounds. + * The number of pixels the line will extend past the [StyleBoxLine]'s bounds. If set to a + * negative value, the line will end inside the [StyleBoxLine]'s bounds. */ public var growEnd: Float get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/StyleBoxTexture.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/StyleBoxTexture.kt index f4723753d..2f13758ee 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/StyleBoxTexture.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/StyleBoxTexture.kt @@ -30,9 +30,9 @@ import kotlin.Suppress import kotlin.Unit /** - * A texture-based nine-patch [godot.StyleBox]. - * - * A texture-based nine-patch [godot.StyleBox], in a way similar to [godot.NinePatchRect]. This stylebox performs a 3×3 scaling of a texture, where only the center cell is fully stretched. This makes it possible to design bordered styles regardless of the stylebox's size. + * A texture-based nine-patch [StyleBox], in a way similar to [NinePatchRect]. This stylebox + * performs a 3×3 scaling of a texture, where only the center cell is fully stretched. This makes it + * possible to design bordered styles regardless of the stylebox's size. */ @GodotBaseType public open class StyleBoxTexture : StyleBox() { @@ -52,10 +52,9 @@ public open class StyleBoxTexture : StyleBox() { /** * Increases the left margin of the 3×3 texture box. - * - * A higher value means more of the source texture is considered to be part of the left border of the 3×3 box. - * - * This is also the value used as fallback for [godot.StyleBox.contentMarginLeft] if it is negative. + * A higher value means more of the source texture is considered to be part of the left border of + * the 3×3 box. + * This is also the value used as fallback for [StyleBox.contentMarginLeft] if it is negative. */ public var textureMarginLeft: Float get() { @@ -70,10 +69,9 @@ public open class StyleBoxTexture : StyleBox() { /** * Increases the top margin of the 3×3 texture box. - * - * A higher value means more of the source texture is considered to be part of the top border of the 3×3 box. - * - * This is also the value used as fallback for [godot.StyleBox.contentMarginTop] if it is negative. + * A higher value means more of the source texture is considered to be part of the top border of + * the 3×3 box. + * This is also the value used as fallback for [StyleBox.contentMarginTop] if it is negative. */ public var textureMarginTop: Float get() { @@ -88,10 +86,9 @@ public open class StyleBoxTexture : StyleBox() { /** * Increases the right margin of the 3×3 texture box. - * - * A higher value means more of the source texture is considered to be part of the right border of the 3×3 box. - * - * This is also the value used as fallback for [godot.StyleBox.contentMarginRight] if it is negative. + * A higher value means more of the source texture is considered to be part of the right border of + * the 3×3 box. + * This is also the value used as fallback for [StyleBox.contentMarginRight] if it is negative. */ public var textureMarginRight: Float get() { @@ -106,10 +103,9 @@ public open class StyleBoxTexture : StyleBox() { /** * Increases the bottom margin of the 3×3 texture box. - * - * A higher value means more of the source texture is considered to be part of the bottom border of the 3×3 box. - * - * This is also the value used as fallback for [godot.StyleBox.contentMarginBottom] if it is negative. + * A higher value means more of the source texture is considered to be part of the bottom border + * of the 3×3 box. + * This is also the value used as fallback for [StyleBox.contentMarginBottom] if it is negative. */ public var textureMarginBottom: Float get() { @@ -123,7 +119,8 @@ public open class StyleBoxTexture : StyleBox() { } /** - * Expands the left margin of this style box when drawing, causing it to be drawn larger than requested. + * Expands the left margin of this style box when drawing, causing it to be drawn larger than + * requested. */ public var expandMarginLeft: Float get() { @@ -137,7 +134,8 @@ public open class StyleBoxTexture : StyleBox() { } /** - * Expands the top margin of this style box when drawing, causing it to be drawn larger than requested. + * Expands the top margin of this style box when drawing, causing it to be drawn larger than + * requested. */ public var expandMarginTop: Float get() { @@ -151,7 +149,8 @@ public open class StyleBoxTexture : StyleBox() { } /** - * Expands the right margin of this style box when drawing, causing it to be drawn larger than requested. + * Expands the right margin of this style box when drawing, causing it to be drawn larger than + * requested. */ public var expandMarginRight: Float get() { @@ -165,7 +164,8 @@ public open class StyleBoxTexture : StyleBox() { } /** - * Expands the bottom margin of this style box when drawing, causing it to be drawn larger than requested. + * Expands the bottom margin of this style box when drawing, causing it to be drawn larger than + * requested. */ public var expandMarginBottom: Float get() { @@ -179,7 +179,8 @@ public open class StyleBoxTexture : StyleBox() { } /** - * Controls how the stylebox's texture will be stretched or tiled horizontally. See [enum AxisStretchMode] for possible values. + * Controls how the stylebox's texture will be stretched or tiled horizontally. See [enum + * AxisStretchMode] for possible values. */ public var axisStretchHorizontal: AxisStretchMode get() { @@ -193,7 +194,8 @@ public open class StyleBoxTexture : StyleBox() { } /** - * Controls how the stylebox's texture will be stretched or tiled vertically. See [enum AxisStretchMode] for possible values. + * Controls how the stylebox's texture will be stretched or tiled vertically. See [enum + * AxisStretchMode] for possible values. */ public var axisStretchVertical: AxisStretchMode get() { @@ -208,9 +210,7 @@ public open class StyleBoxTexture : StyleBox() { /** * Species a sub-region of the texture to use. - * - * This is equivalent to first wrapping the texture in an [godot.AtlasTexture] with the same region. - * + * This is equivalent to first wrapping the texture in an [AtlasTexture] with the same region. * If empty (`Rect2(0, 0, 0, 0)`), the whole texture will be used. */ @CoreTypeLocalCopy @@ -261,9 +261,7 @@ public open class StyleBoxTexture : StyleBox() { /** * Species a sub-region of the texture to use. - * - * This is equivalent to first wrapping the texture in an [godot.AtlasTexture] with the same region. - * + * This is equivalent to first wrapping the texture in an [AtlasTexture] with the same region. * If empty (`Rect2(0, 0, 0, 0)`), the whole texture will be used. * * This is a helper function to make dealing with local copies easier. @@ -312,7 +310,7 @@ public open class StyleBoxTexture : StyleBox() { /** - * Sets the margin to [size] pixels for all sides. + * Sets the margin to [param size] pixels for all sides. */ public fun setTextureMarginAll(size: Float): Unit { TransferContext.writeArguments(DOUBLE to size.toDouble()) @@ -320,7 +318,7 @@ public open class StyleBoxTexture : StyleBox() { } /** - * Sets the expand margin to [size] pixels for all sides. + * Sets the expand margin to [param size] pixels for all sides. */ public fun setExpandMarginAll(size: Float): Unit { TransferContext.writeArguments(DOUBLE to size.toDouble()) @@ -331,15 +329,19 @@ public open class StyleBoxTexture : StyleBox() { id: Long, ) { /** - * Stretch the stylebox's texture. This results in visible distortion unless the texture size matches the stylebox's size perfectly. + * Stretch the stylebox's texture. This results in visible distortion unless the texture size + * matches the stylebox's size perfectly. */ AXIS_STRETCH_MODE_STRETCH(0), /** - * Repeats the stylebox's texture to match the stylebox's size according to the nine-patch system. + * Repeats the stylebox's texture to match the stylebox's size according to the nine-patch + * system. */ AXIS_STRETCH_MODE_TILE(1), /** - * Repeats the stylebox's texture to match the stylebox's size according to the nine-patch system. Unlike [AXIS_STRETCH_MODE_TILE], the texture may be slightly stretched to make the nine-patch texture tile seamlessly. + * Repeats the stylebox's texture to match the stylebox's size according to the nine-patch + * system. Unlike [constant AXIS_STRETCH_MODE_TILE], the texture may be slightly stretched to make + * the nine-patch texture tile seamlessly. */ AXIS_STRETCH_MODE_TILE_FIT(2), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/SubViewport.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/SubViewport.kt index 832c2172f..1680d179a 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/SubViewport.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/SubViewport.kt @@ -24,21 +24,19 @@ import kotlin.Suppress import kotlin.Unit /** - * An interface to a game world that doesn't create a window or draw to the screen directly. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/586](https://godotengine.org/asset-library/asset/586) - * - * [godot.SubViewport] Isolates a rectangular region of a scene to be displayed independently. This can be used, for example, to display UI in 3D space. - * - * **Note:** [godot.SubViewport] is a [godot.Viewport] that isn't a [godot.Window], i.e. it doesn't draw anything by itself. To display anything, [godot.SubViewport] must have a non-zero size and be either put inside a [godot.SubViewportContainer] or assigned to a [godot.ViewportTexture]. + * [SubViewport] Isolates a rectangular region of a scene to be displayed independently. This can be + * used, for example, to display UI in 3D space. + * **Note:** [SubViewport] is a [Viewport] that isn't a [Window], i.e. it doesn't draw anything by + * itself. To display anything, [SubViewport] must have a non-zero size and be either put inside a + * [SubViewportContainer] or assigned to a [ViewportTexture]. */ @GodotBaseType public open class SubViewport : Viewport() { /** - * The width and height of the sub-viewport. Must be set to a value greater than or equal to 2 pixels on both dimensions. Otherwise, nothing will be displayed. - * - * **Note:** If the parent node is a [godot.SubViewportContainer] and its [godot.SubViewportContainer.stretch] is `true`, the viewport size cannot be changed manually. + * The width and height of the sub-viewport. Must be set to a value greater than or equal to 2 + * pixels on both dimensions. Otherwise, nothing will be displayed. + * **Note:** If the parent node is a [SubViewportContainer] and its [SubViewportContainer.stretch] + * is `true`, the viewport size cannot be changed manually. */ @CoreTypeLocalCopy public var size: Vector2i @@ -53,7 +51,8 @@ public open class SubViewport : Viewport() { } /** - * The 2D size override of the sub-viewport. If either the width or height is `0`, the override is disabled. + * The 2D size override of the sub-viewport. If either the width or height is `0`, the override is + * disabled. */ @CoreTypeLocalCopy public var size2dOverride: Vector2i @@ -83,7 +82,6 @@ public open class SubViewport : Viewport() { /** * The clear mode when the sub-viewport is used as a render target. - * * **Note:** This property is intended for 2D usage. */ public var renderTargetClearMode: ClearMode @@ -117,9 +115,10 @@ public open class SubViewport : Viewport() { } /** - * The width and height of the sub-viewport. Must be set to a value greater than or equal to 2 pixels on both dimensions. Otherwise, nothing will be displayed. - * - * **Note:** If the parent node is a [godot.SubViewportContainer] and its [godot.SubViewportContainer.stretch] is `true`, the viewport size cannot be changed manually. + * The width and height of the sub-viewport. Must be set to a value greater than or equal to 2 + * pixels on both dimensions. Otherwise, nothing will be displayed. + * **Note:** If the parent node is a [SubViewportContainer] and its [SubViewportContainer.stretch] + * is `true`, the viewport size cannot be changed manually. * * This is a helper function to make dealing with local copies easier. * @@ -143,7 +142,8 @@ public open class SubViewport : Viewport() { /** - * The 2D size override of the sub-viewport. If either the width or height is `0`, the override is disabled. + * The 2D size override of the sub-viewport. If either the width or height is `0`, the override is + * disabled. * * This is a helper function to make dealing with local copies easier. * @@ -178,7 +178,7 @@ public open class SubViewport : Viewport() { */ CLEAR_MODE_NEVER(1), /** - * Clear the render target on the next frame, then switch to [CLEAR_MODE_NEVER]. + * Clear the render target on the next frame, then switch to [constant CLEAR_MODE_NEVER]. */ CLEAR_MODE_ONCE(2), ; @@ -201,7 +201,7 @@ public open class SubViewport : Viewport() { */ UPDATE_DISABLED(0), /** - * Update the render target once, then switch to [UPDATE_DISABLED]. + * Update the render target once, then switch to [constant UPDATE_DISABLED]. */ UPDATE_ONCE(1), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/SubViewportContainer.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/SubViewportContainer.kt index ecd18110d..ac066411a 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/SubViewportContainer.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/SubViewportContainer.kt @@ -20,20 +20,19 @@ import kotlin.NotImplementedError import kotlin.Suppress /** - * A container used for displaying the contents of a [godot.SubViewport]. - * - * A container that displays the contents of underlying [godot.SubViewport] child nodes. It uses the combined size of the [godot.SubViewport]s as minimum size, unless [stretch] is enabled. - * - * **Note:** Changing a [godot.SubViewportContainer]'s [godot.Control.scale] will cause its contents to appear distorted. To change its visual size without causing distortion, adjust the node's margins instead (if it's not already in a container). - * - * **Note:** The [godot.SubViewportContainer] forwards mouse-enter and mouse-exit notifications to its sub-viewports. + * A container that displays the contents of underlying [SubViewport] child nodes. It uses the + * combined size of the [SubViewport]s as minimum size, unless [stretch] is enabled. + * **Note:** Changing a [SubViewportContainer]'s [Control.scale] will cause its contents to appear + * distorted. To change its visual size without causing distortion, adjust the node's margins instead + * (if it's not already in a container). + * **Note:** The [SubViewportContainer] forwards mouse-enter and mouse-exit notifications to its + * sub-viewports. */ @GodotBaseType public open class SubViewportContainer : Container() { /** * If `true`, the sub-viewport will be automatically resized to the control's size. - * - * **Note:** If `true`, this will prohibit changing [godot.SubViewport.size] of its children manually. + * **Note:** If `true`, this will prohibit changing [SubViewport.size] of its children manually. */ public var stretch: Boolean get() { @@ -47,10 +46,10 @@ public open class SubViewportContainer : Container() { } /** - * Divides the sub-viewport's effective resolution by this value while preserving its scale. This can be used to speed up rendering. - * - * For example, a 1280×720 sub-viewport with [stretchShrink] set to `2` will be rendered at 640×360 while occupying the same size in the container. - * + * Divides the sub-viewport's effective resolution by this value while preserving its scale. This + * can be used to speed up rendering. + * For example, a 1280×720 sub-viewport with [stretchShrink] set to `2` will be rendered at + * 640×360 while occupying the same size in the container. * **Note:** [stretch] must be `true` for this property to work. */ public var stretchShrink: Int @@ -70,7 +69,9 @@ public open class SubViewportContainer : Container() { } /** - * Virtual method to be implemented by the user. If it returns `true`, the [event] is propagated to [godot.SubViewport] children. Propagation doesn't happen if it returns `false`. If the function is not implemented, all events are propagated to SubViewports. + * Virtual method to be implemented by the user. If it returns `true`, the [param event] is + * propagated to [SubViewport] children. Propagation doesn't happen if it returns `false`. If the + * function is not implemented, all events are propagated to SubViewports. */ public open fun _propagateInputEvent(event: InputEvent): Boolean { throw NotImplementedError("_propagate_input_event is not implemented for SubViewportContainer") diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/SyntaxHighlighter.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/SyntaxHighlighter.kt index 1b630cdcb..7d0f2c99a 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/SyntaxHighlighter.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/SyntaxHighlighter.kt @@ -23,11 +23,9 @@ import kotlin.Suppress import kotlin.Unit /** - * Base class for syntax highlighters. Provides syntax highlighting data to a [godot.TextEdit]. - * - * Base class for syntax highlighters. Provides syntax highlighting data to a [godot.TextEdit]. The associated [godot.TextEdit] will call into the [godot.SyntaxHighlighter] on an as-needed basis. - * - * **Note:** A [godot.SyntaxHighlighter] instance should not be used across multiple [godot.TextEdit] nodes. + * Base class for syntax highlighters. Provides syntax highlighting data to a [TextEdit]. The + * associated [TextEdit] will call into the [SyntaxHighlighter] on an as-needed basis. + * **Note:** A [SyntaxHighlighter] instance should not be used across multiple [TextEdit] nodes. */ @GodotBaseType public open class SyntaxHighlighter : Resource() { @@ -38,7 +36,6 @@ public open class SyntaxHighlighter : Resource() { /** * Virtual method which can be overridden to return syntax highlighting data. - * * See [getLineSyntaxHighlighting] for more details. */ public open fun _getLineSyntaxHighlighting(line: Int): Dictionary { @@ -58,23 +55,22 @@ public open class SyntaxHighlighter : Resource() { } /** - * Returns syntax highlighting data for a single line. If the line is not cached, calls [_getLineSyntaxHighlighting] to calculate the data. - * - * The return [godot.core.Dictionary] is column number to [godot.core.Dictionary]. The column number notes the start of a region, the region will end if another region is found, or at the end of the line. The nested [godot.core.Dictionary] contains the data for that region, currently only the key "color" is supported. - * + * Returns syntax highlighting data for a single line. If the line is not cached, calls + * [_getLineSyntaxHighlighting] to calculate the data. + * The return [Dictionary] is column number to [Dictionary]. The column number notes the start of + * a region, the region will end if another region is found, or at the end of the line. The nested + * [Dictionary] contains the data for that region, currently only the key "color" is supported. * **Example return:** - * - * ``` - * var color_map = { - * 0: { - * "color": Color(1, 0, 0) - * }, - * 5: { - * "color": Color(0, 1, 0) - * } - * } - * ``` - * + * [codeblock] + * var color_map = { + * 0: { + * "color": Color(1, 0, 0) + * }, + * 5: { + * "color": Color(0, 1, 0) + * } + * } + * [/codeblock] * This will color columns 0-4 red, and columns 5-eol in green. */ public fun getLineSyntaxHighlighting(line: Int): Dictionary { @@ -84,9 +80,9 @@ public open class SyntaxHighlighter : Resource() { } /** - * Clears then updates the [godot.SyntaxHighlighter] caches. Override [_updateCache] for a callback. - * - * **Note:** This is called automatically when the associated [godot.TextEdit] node, updates its own cache. + * Clears then updates the [SyntaxHighlighter] caches. Override [_updateCache] for a callback. + * **Note:** This is called automatically when the associated [TextEdit] node, updates its own + * cache. */ public fun updateCache(): Unit { TransferContext.writeArguments() @@ -95,7 +91,6 @@ public open class SyntaxHighlighter : Resource() { /** * Clears all cached syntax highlighting data. - * * Then calls overridable method [_clearHighlightingCache]. */ public fun clearHighlightingCache(): Unit { @@ -104,7 +99,7 @@ public open class SyntaxHighlighter : Resource() { } /** - * Returns the associated [godot.TextEdit] node. + * Returns the associated [TextEdit] node. */ public fun getTextEdit(): TextEdit? { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/TCPServer.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/TCPServer.kt index c18c16f7b..71fd71041 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/TCPServer.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/TCPServer.kt @@ -25,11 +25,11 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * A TCP server. - * - * A TCP server. Listens to connections on a port and returns a [godot.StreamPeerTCP] when it gets an incoming connection. - * - * **Note:** When exporting to Android, make sure to enable the `INTERNET` permission in the Android export preset before exporting the project or using one-click deploy. Otherwise, network communication of any kind will be blocked by Android. + * A TCP server. Listens to connections on a port and returns a [StreamPeerTCP] when it gets an + * incoming connection. + * **Note:** When exporting to Android, make sure to enable the `INTERNET` permission in the Android + * export preset before exporting the project or using one-click deploy. Otherwise, network + * communication of any kind will be blocked by Android. */ @GodotBaseType public open class TCPServer : RefCounted() { @@ -39,13 +39,14 @@ public open class TCPServer : RefCounted() { } /** - * Listen on the [port] binding to [bindAddress]. - * - * If [bindAddress] is set as `"*"` (default), the server will listen on all available addresses (both IPv4 and IPv6). - * - * If [bindAddress] is set as `"0.0.0.0"` (for IPv4) or `"::"` (for IPv6), the server will listen on all available addresses matching that IP type. - * - * If [bindAddress] is set to any valid address (e.g. `"192.168.1.101"`, `"::1"`, etc), the server will only listen on the interface with that addresses (or fail if no interface with the given address exists). + * Listen on the [param port] binding to [param bind_address]. + * If [param bind_address] is set as `"*"` (default), the server will listen on all available + * addresses (both IPv4 and IPv6). + * If [param bind_address] is set as `"0.0.0.0"` (for IPv4) or `"::"` (for IPv6), the server will + * listen on all available addresses matching that IP type. + * If [param bind_address] is set to any valid address (e.g. `"192.168.1.101"`, `"::1"`, etc), the + * server will only listen on the interface with that addresses (or fail if no interface with the + * given address exists). */ @JvmOverloads public fun listen(port: Int, bindAddress: String = "*"): GodotError { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/TLSOptions.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/TLSOptions.kt index 40c35c472..1585a49cd 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/TLSOptions.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/TLSOptions.kt @@ -19,35 +19,22 @@ import kotlin.Suppress import kotlin.jvm.JvmOverloads /** - * TLS configuration for clients and servers. - * - * TLSOptions abstracts the configuration options for the [godot.StreamPeerTLS] and [godot.PacketPeerDTLS] classes. - * - * Objects of this class cannot be instantiated directly, and one of the static methods [client], [clientUnsafe], or [server] should be used instead. - * - * [codeblocks] - * - * [gdscript] + * TLSOptions abstracts the configuration options for the [StreamPeerTLS] and [PacketPeerDTLS] + * classes. + * Objects of this class cannot be instantiated directly, and one of the static methods [client], + * [clientUnsafe], or [server] should be used instead. * + * gdscript: + * ```gdscript * # Create a TLS client configuration which uses our custom trusted CA chain. - * * var client_trusted_cas = load("res://my_trusted_cas.crt") - * * var client_tls_options = TLSOptions.client(client_trusted_cas) * - * - * * # Create a TLS server configuration. - * * var server_certs = load("res://my_server_cas.crt") - * * var server_key = load("res://my_server_key.key") - * * var server_tls_options = TLSOptions.server(server_key, server_certs) - * - * [/gdscript] - * - * [/codeblocks] + * ``` */ @GodotBaseType public open class TLSOptions internal constructor() : RefCounted() { @@ -58,11 +45,13 @@ public open class TLSOptions internal constructor() : RefCounted() { public companion object { /** - * Creates a TLS client configuration which validates certificates and their common names (fully qualified domain names). - * - * You can specify a custom [trustedChain] of certification authorities (the default CA list will be used if `null`), and optionally provide a [commonNameOverride] if you expect the certificate to have a common name other than the server FQDN. - * - * **Note:** On the Web platform, TLS verification is always enforced against the CA list of the web browser. This is considered a security feature. + * Creates a TLS client configuration which validates certificates and their common names (fully + * qualified domain names). + * You can specify a custom [param trusted_chain] of certification authorities (the default CA + * list will be used if `null`), and optionally provide a [param common_name_override] if you + * expect the certificate to have a common name other than the server FQDN. + * **Note:** On the Web platform, TLS verification is always enforced against the CA list of the + * web browser. This is considered a security feature. */ @JvmOverloads public fun client(trustedChain: X509Certificate? = null, commonNameOverride: String = ""): @@ -73,9 +62,12 @@ public open class TLSOptions internal constructor() : RefCounted() { } /** - * Creates an **unsafe** TLS client configuration where certificate validation is optional. You can optionally provide a valid [trustedChain], but the common name of the certificates will never be checked. Using this configuration for purposes other than testing **is not recommended**. - * - * **Note:** On the Web platform, TLS verification is always enforced against the CA list of the web browser. This is considered a security feature. + * Creates an **unsafe** TLS client configuration where certificate validation is optional. You + * can optionally provide a valid [param trusted_chain], but the common name of the certificates + * will never be checked. Using this configuration for purposes other than testing **is not + * recommended**. + * **Note:** On the Web platform, TLS verification is always enforced against the CA list of the + * web browser. This is considered a security feature. */ @JvmOverloads public fun clientUnsafe(trustedChain: X509Certificate? = null): TLSOptions? { @@ -85,9 +77,9 @@ public open class TLSOptions internal constructor() : RefCounted() { } /** - * Creates a TLS server configuration using the provided [key] and [certificate]. - * - * **Note:** The [certificate] should include the full certificate chain up to the signing CA (certificates file can be concatenated using a general purpose text editor). + * Creates a TLS server configuration using the provided [param key] and [param certificate]. + * **Note:** The [param certificate] should include the full certificate chain up to the signing + * CA (certificates file can be concatenated using a general purpose text editor). */ public fun server(key: CryptoKey, certificate: X509Certificate): TLSOptions? { TransferContext.writeArguments(OBJECT to key, OBJECT to certificate) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/TabBar.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/TabBar.kt index 42aab552a..8112366ae 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/TabBar.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/TabBar.kt @@ -32,9 +32,8 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * A control that provides a horizontal bar with tabs. - * - * A control that provides a horizontal bar with tabs. Similar to [godot.TabContainer] but is only in charge of drawing tabs, not interacting with children. + * A control that provides a horizontal bar with tabs. Similar to [TabContainer] but is only in + * charge of drawing tabs, not interacting with children. */ @GodotBaseType public open class TabBar : Control() { @@ -60,24 +59,17 @@ public open class TabBar : Control() { /** * Emitted when a tab's close button is pressed. + * **Note:** Tabs are not removed automatically once the close button is pressed, this behavior + * needs to be programmed manually. For example: * - * **Note:** Tabs are not removed automatically once the close button is pressed, this behavior needs to be programmed manually. For example: - * - * [codeblocks] - * - * [gdscript] - * + * gdscript: + * ```gdscript * $TabBar.tab_close_pressed.connect($TabBar.remove_tab) - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * GetNode("TabBar").TabClosePressed += GetNode("TabBar").RemoveTab; - * - * [/csharp] - * - * [/codeblocks] + * ``` */ public val tabClosePressed: Signal1 by signal("tab") @@ -139,7 +131,8 @@ public open class TabBar : Control() { } /** - * If `true`, tabs overflowing this node's width will be hidden, displaying two navigation buttons instead. Otherwise, this node's minimum size is updated so that all tabs are visible. + * If `true`, tabs overflowing this node's width will be hidden, displaying two navigation buttons + * instead. Otherwise, this node's minimum size is updated so that all tabs are visible. */ public var clipTabs: Boolean get() { @@ -153,7 +146,8 @@ public open class TabBar : Control() { } /** - * Sets when the close button will appear on the tabs. See [enum CloseButtonDisplayPolicy] for details. + * Sets when the close button will appear on the tabs. See [enum CloseButtonDisplayPolicy] for + * details. */ public var tabCloseDisplayPolicy: CloseButtonDisplayPolicy get() { @@ -209,9 +203,9 @@ public open class TabBar : Control() { } /** - * [godot.TabBar]s with the same rearrange group ID will allow dragging the tabs between them. Enable drag with [dragToRearrangeEnabled]. - * - * Setting this to `-1` will disable rearranging between [godot.TabBar]s. + * [TabBar]s with the same rearrange group ID will allow dragging the tabs between them. Enable + * drag with [dragToRearrangeEnabled]. + * Setting this to `-1` will disable rearranging between [TabBar]s. */ public var tabsRearrangeGroup: Int get() { @@ -267,7 +261,8 @@ public open class TabBar : Control() { } /** - * Selects the first available tab with lower index than the currently selected. Returns `true` if tab selection changed. + * Selects the first available tab with lower index than the currently selected. Returns `true` if + * tab selection changed. */ public fun selectPreviousAvailable(): Boolean { TransferContext.writeArguments() @@ -276,7 +271,8 @@ public open class TabBar : Control() { } /** - * Selects the first available tab with greater index than the currently selected. Returns `true` if tab selection changed. + * Selects the first available tab with greater index than the currently selected. Returns `true` + * if tab selection changed. */ public fun selectNextAvailable(): Boolean { TransferContext.writeArguments() @@ -285,7 +281,7 @@ public open class TabBar : Control() { } /** - * Sets a [title] for the tab at index [tabIdx]. + * Sets a [param title] for the tab at index [param tab_idx]. */ public fun setTabTitle(tabIdx: Int, title: String): Unit { TransferContext.writeArguments(LONG to tabIdx.toLong(), STRING to title) @@ -293,7 +289,7 @@ public open class TabBar : Control() { } /** - * Returns the title of the tab at index [tabIdx]. + * Returns the title of the tab at index [param tab_idx]. */ public fun getTabTitle(tabIdx: Int): String { TransferContext.writeArguments(LONG to tabIdx.toLong()) @@ -319,7 +315,8 @@ public open class TabBar : Control() { } /** - * Sets language code of tab title used for line-breaking and text shaping algorithms, if left empty current locale is used instead. + * Sets language code of tab title used for line-breaking and text shaping algorithms, if left + * empty current locale is used instead. */ public fun setTabLanguage(tabIdx: Int, language: String): Unit { TransferContext.writeArguments(LONG to tabIdx.toLong(), STRING to language) @@ -336,7 +333,7 @@ public open class TabBar : Control() { } /** - * Sets an [icon] for the tab at index [tabIdx]. + * Sets an [param icon] for the tab at index [param tab_idx]. */ public fun setTabIcon(tabIdx: Int, icon: Texture2D): Unit { TransferContext.writeArguments(LONG to tabIdx.toLong(), OBJECT to icon) @@ -344,7 +341,7 @@ public open class TabBar : Control() { } /** - * Returns the icon for the tab at index [tabIdx] or `null` if the tab has no icon. + * Returns the icon for the tab at index [param tab_idx] or `null` if the tab has no icon. */ public fun getTabIcon(tabIdx: Int): Texture2D? { TransferContext.writeArguments(LONG to tabIdx.toLong()) @@ -353,7 +350,9 @@ public open class TabBar : Control() { } /** - * Sets the maximum allowed width of the icon for the tab at index [tabIdx]. This limit is applied on top of the default size of the icon and on top of [theme_item icon_max_width]. The height is adjusted according to the icon's ratio. + * Sets the maximum allowed width of the icon for the tab at index [param tab_idx]. This limit is + * applied on top of the default size of the icon and on top of [theme_item icon_max_width]. The + * height is adjusted according to the icon's ratio. */ public fun setTabIconMaxWidth(tabIdx: Int, width: Int): Unit { TransferContext.writeArguments(LONG to tabIdx.toLong(), LONG to width.toLong()) @@ -361,7 +360,7 @@ public open class TabBar : Control() { } /** - * Returns the maximum allowed width of the icon for the tab at index [tabIdx]. + * Returns the maximum allowed width of the icon for the tab at index [param tab_idx]. */ public fun getTabIconMaxWidth(tabIdx: Int): Int { TransferContext.writeArguments(LONG to tabIdx.toLong()) @@ -370,7 +369,9 @@ public open class TabBar : Control() { } /** - * Sets an [icon] for the button of the tab at index [tabIdx] (located to the right, before the close button), making it visible and clickable (See [tabButtonPressed]). Giving it a `null` value will hide the button. + * Sets an [param icon] for the button of the tab at index [param tab_idx] (located to the right, + * before the close button), making it visible and clickable (See [signal tab_button_pressed]). + * Giving it a `null` value will hide the button. */ public fun setTabButtonIcon(tabIdx: Int, icon: Texture2D): Unit { TransferContext.writeArguments(LONG to tabIdx.toLong(), OBJECT to icon) @@ -378,7 +379,8 @@ public open class TabBar : Control() { } /** - * Returns the icon for the right button of the tab at index [tabIdx] or `null` if the right button has no icon. + * Returns the icon for the right button of the tab at index [param tab_idx] or `null` if the + * right button has no icon. */ public fun getTabButtonIcon(tabIdx: Int): Texture2D? { TransferContext.writeArguments(LONG to tabIdx.toLong()) @@ -387,7 +389,8 @@ public open class TabBar : Control() { } /** - * If [disabled] is `true`, disables the tab at index [tabIdx], making it non-interactable. + * If [param disabled] is `true`, disables the tab at index [param tab_idx], making it + * non-interactable. */ public fun setTabDisabled(tabIdx: Int, disabled: Boolean): Unit { TransferContext.writeArguments(LONG to tabIdx.toLong(), BOOL to disabled) @@ -395,7 +398,7 @@ public open class TabBar : Control() { } /** - * Returns `true` if the tab at index [tabIdx] is disabled. + * Returns `true` if the tab at index [param tab_idx] is disabled. */ public fun isTabDisabled(tabIdx: Int): Boolean { TransferContext.writeArguments(LONG to tabIdx.toLong()) @@ -404,7 +407,8 @@ public open class TabBar : Control() { } /** - * If [hidden] is `true`, hides the tab at index [tabIdx], making it disappear from the tab area. + * If [param hidden] is `true`, hides the tab at index [param tab_idx], making it disappear from + * the tab area. */ public fun setTabHidden(tabIdx: Int, hidden: Boolean): Unit { TransferContext.writeArguments(LONG to tabIdx.toLong(), BOOL to hidden) @@ -412,7 +416,7 @@ public open class TabBar : Control() { } /** - * Returns `true` if the tab at index [tabIdx] is hidden. + * Returns `true` if the tab at index [param tab_idx] is hidden. */ public fun isTabHidden(tabIdx: Int): Boolean { TransferContext.writeArguments(LONG to tabIdx.toLong()) @@ -421,7 +425,8 @@ public open class TabBar : Control() { } /** - * Sets the metadata value for the tab at index [tabIdx], which can be retrieved later using [getTabMetadata]. + * Sets the metadata value for the tab at index [param tab_idx], which can be retrieved later + * using [getTabMetadata]. */ public fun setTabMetadata(tabIdx: Int, metadata: Any?): Unit { TransferContext.writeArguments(LONG to tabIdx.toLong(), ANY to metadata) @@ -429,7 +434,8 @@ public open class TabBar : Control() { } /** - * Returns the metadata value set to the tab at index [tabIdx] using [setTabMetadata]. If no metadata was previously set, returns `null` by default. + * Returns the metadata value set to the tab at index [param tab_idx] using [setTabMetadata]. If + * no metadata was previously set, returns `null` by default. */ public fun getTabMetadata(tabIdx: Int): Any? { TransferContext.writeArguments(LONG to tabIdx.toLong()) @@ -438,7 +444,7 @@ public open class TabBar : Control() { } /** - * Removes the tab at index [tabIdx]. + * Removes the tab at index [param tab_idx]. */ public fun removeTab(tabIdx: Int): Unit { TransferContext.writeArguments(LONG to tabIdx.toLong()) @@ -455,7 +461,8 @@ public open class TabBar : Control() { } /** - * Returns the index of the tab at local coordinates [point]. Returns `-1` if the point is outside the control boundaries or if there's no tab at the queried position. + * Returns the index of the tab at local coordinates [param point]. Returns `-1` if the point is + * outside the control boundaries or if there's no tab at the queried position. */ public fun getTabIdxAtPoint(point: Vector2): Int { TransferContext.writeArguments(VECTOR2 to point) @@ -473,7 +480,8 @@ public open class TabBar : Control() { } /** - * Returns `true` if the offset buttons (the ones that appear when there's not enough space for all tabs) are visible. + * Returns `true` if the offset buttons (the ones that appear when there's not enough space for + * all tabs) are visible. */ public fun getOffsetButtonsVisible(): Boolean { TransferContext.writeArguments() @@ -490,7 +498,7 @@ public open class TabBar : Control() { } /** - * Returns tab [godot.core.Rect2] with local position and size. + * Returns tab [Rect2] with local position and size. */ public fun getTabRect(tabIdx: Int): Rect2 { TransferContext.writeArguments(LONG to tabIdx.toLong()) @@ -499,7 +507,7 @@ public open class TabBar : Control() { } /** - * Moves a tab from [from] to [to]. + * Moves a tab from [param from] to [param to]. */ public fun moveTab(from: Int, to: Int): Unit { TransferContext.writeArguments(LONG to from.toLong(), LONG to to.toLong()) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/TextLine.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/TextLine.kt index 38bef824d..fe69c0766 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/TextLine.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/TextLine.kt @@ -42,9 +42,7 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * Holds a line of text. - * - * Abstraction over [godot.TextServer] for handling a single line of text. + * Abstraction over [TextServer] for handling a single line of text. */ @GodotBaseType public open class TextLine : RefCounted() { @@ -133,7 +131,7 @@ public open class TextLine : RefCounted() { } /** - * Line alignment rules. For more info see [godot.TextServer]. + * Line alignment rules. For more info see [TextServer]. */ public var flags: TextServer.JustificationFlag get() { @@ -147,7 +145,8 @@ public open class TextLine : RefCounted() { } /** - * Sets the clipping behavior when the text exceeds the text line's set width. See [enum TextServer.OverrunBehavior] for a description of all modes. + * Sets the clipping behavior when the text exceeds the text line's set width. See [enum + * TextServer.OverrunBehavior] for a description of all modes. */ public var textOverrunBehavior: TextServer.OverrunBehavior get() { @@ -175,8 +174,8 @@ public open class TextLine : RefCounted() { /** * Overrides BiDi for the structured text. - * - * Override ranges should cover full source text without overlaps. BiDi algorithm will be used on each range separately. + * Override ranges should cover full source text without overlaps. BiDi algorithm will be used on + * each range separately. */ public fun setBidiOverride(`override`: VariantArray): Unit { TransferContext.writeArguments(ARRAY to override) @@ -200,7 +199,8 @@ public open class TextLine : RefCounted() { } /** - * Adds inline object to the text buffer, [key] must be unique. In the text, object is represented as [length] object replacement characters. + * Adds inline object to the text buffer, [param key] must be unique. In the text, object is + * represented as [param length] object replacement characters. */ @JvmOverloads public fun addObject( @@ -275,7 +275,8 @@ public open class TextLine : RefCounted() { } /** - * Returns the text ascent (number of pixels above the baseline for horizontal layout or to the left of baseline for vertical). + * Returns the text ascent (number of pixels above the baseline for horizontal layout or to the + * left of baseline for vertical). */ public fun getLineAscent(): Float { TransferContext.writeArguments() @@ -284,7 +285,8 @@ public open class TextLine : RefCounted() { } /** - * Returns the text descent (number of pixels below the baseline for horizontal layout or to the right of baseline for vertical). + * Returns the text descent (number of pixels below the baseline for horizontal layout or to the + * right of baseline for vertical). */ public fun getLineDescent(): Float { TransferContext.writeArguments() @@ -320,7 +322,8 @@ public open class TextLine : RefCounted() { } /** - * Draw text into a canvas item at a given position, with [color]. [pos] specifies the top left corner of the bounding box. + * Draw text into a canvas item at a given position, with [param color]. [param pos] specifies the + * top left corner of the bounding box. */ @JvmOverloads public fun draw( @@ -333,7 +336,8 @@ public open class TextLine : RefCounted() { } /** - * Draw text into a canvas item at a given position, with [color]. [pos] specifies the top left corner of the bounding box. + * Draw text into a canvas item at a given position, with [param color]. [param pos] specifies the + * top left corner of the bounding box. */ @JvmOverloads public fun drawOutline( @@ -347,7 +351,8 @@ public open class TextLine : RefCounted() { } /** - * Returns caret character offset at the specified pixel offset at the baseline. This function always returns a valid position. + * Returns caret character offset at the specified pixel offset at the baseline. This function + * always returns a valid position. */ public fun hitTest(coords: Float): Int { TransferContext.writeArguments(DOUBLE to coords.toDouble()) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/TextMesh.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/TextMesh.kt index ea7d762b3..b03330a7e 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/TextMesh.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/TextMesh.kt @@ -34,16 +34,12 @@ import kotlin.Suppress import kotlin.Unit /** - * Generate an [godot.PrimitiveMesh] from the text. - * - * Tutorials: - * [$DOCS_URL/tutorials/3d/3d_text.html]($DOCS_URL/tutorials/3d/3d_text.html) - * - * Generate an [godot.PrimitiveMesh] from the text. - * - * TextMesh can be generated only when using dynamic fonts with vector glyph contours. Bitmap fonts (including bitmap data in the TrueType/OpenType containers, like color emoji fonts) are not supported. - * - * The UV layout is arranged in 4 horizontal strips, top to bottom: 40% of the height for the front face, 40% for the back face, 10% for the outer edges and 10% for the inner edges. + * Generate an [PrimitiveMesh] from the text. + * TextMesh can be generated only when using dynamic fonts with vector glyph contours. Bitmap fonts + * (including bitmap data in the TrueType/OpenType containers, like color emoji fonts) are not + * supported. + * The UV layout is arranged in 4 horizontal strips, top to bottom: 40% of the height for the + * front face, 40% for the back face, 10% for the outer edges and 10% for the inner edges. */ @GodotBaseType public open class TextMesh : PrimitiveMesh() { @@ -76,7 +72,7 @@ public open class TextMesh : PrimitiveMesh() { } /** - * Font size of the [godot.TextMesh]'s text. + * Font size of the [TextMesh]'s text. */ public var fontSize: Int get() { @@ -90,7 +86,8 @@ public open class TextMesh : PrimitiveMesh() { } /** - * Controls the text's horizontal alignment. Supports left, center, right, and fill, or justify. Set it to one of the [enum HorizontalAlignment] constants. + * Controls the text's horizontal alignment. Supports left, center, right, and fill, or justify. + * Set it to one of the [enum HorizontalAlignment] constants. */ public var horizontalAlignment: HorizontalAlignment get() { @@ -104,7 +101,8 @@ public open class TextMesh : PrimitiveMesh() { } /** - * Controls the text's vertical alignment. Supports top, center, bottom. Set it to one of the [enum VerticalAlignment] constants. + * Controls the text's vertical alignment. Supports top, center, bottom. Set it to one of the + * [enum VerticalAlignment] constants. */ public var verticalAlignment: VerticalAlignment get() { @@ -132,7 +130,7 @@ public open class TextMesh : PrimitiveMesh() { } /** - * Vertical space between lines in multiline [godot.TextMesh]. + * Vertical space between lines in multiline [TextMesh]. */ public var lineSpacing: Float get() { @@ -146,7 +144,9 @@ public open class TextMesh : PrimitiveMesh() { } /** - * If set to something other than [godot.TextServer.AUTOWRAP_OFF], the text gets wrapped inside the node's bounding rectangle. If you resize the node, it will change its height automatically to show all the text. To see how each mode behaves, see [enum TextServer.AutowrapMode]. + * If set to something other than [constant TextServer.AUTOWRAP_OFF], the text gets wrapped inside + * the node's bounding rectangle. If you resize the node, it will change its height automatically to + * show all the text. To see how each mode behaves, see [enum TextServer.AutowrapMode]. */ public var autowrapMode: TextServer.AutowrapMode get() { @@ -202,7 +202,8 @@ public open class TextMesh : PrimitiveMesh() { } /** - * Depths of the mesh, if set to `0.0` only front surface, is generated, and UV layout is changed to use full texture for the front face only. + * Depths of the mesh, if set to `0.0` only front surface, is generated, and UV layout is changed + * to use full texture for the front face only. */ public var depth: Float get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/TextParagraph.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/TextParagraph.kt index c8f454dc2..ef0b4040e 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/TextParagraph.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/TextParagraph.kt @@ -45,9 +45,7 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * Holds a paragraph of text. - * - * Abstraction over [godot.TextServer] for handling a single paragraph of text. + * Abstraction over [TextServer] for handling a single paragraph of text. */ @GodotBaseType public open class TextParagraph : RefCounted() { @@ -66,7 +64,8 @@ public open class TextParagraph : RefCounted() { } /** - * Custom punctuation character list, used for word breaking. If set to empty string, server defaults are used. + * Custom punctuation character list, used for word breaking. If set to empty string, server + * defaults are used. */ public var customPunctuation: String get() { @@ -136,7 +135,7 @@ public open class TextParagraph : RefCounted() { } /** - * Line breaking rules. For more info see [godot.TextServer]. + * Line breaking rules. For more info see [TextServer]. */ public var breakFlags: TextServer.LineBreakFlag get() { @@ -164,7 +163,8 @@ public open class TextParagraph : RefCounted() { } /** - * Sets the clipping behavior when the text exceeds the paragraph's set width. See [enum TextServer.OverrunBehavior] for a description of all modes. + * Sets the clipping behavior when the text exceeds the paragraph's set width. See [enum + * TextServer.OverrunBehavior] for a description of all modes. */ public var textOverrunBehavior: TextServer.OverrunBehavior get() { @@ -220,8 +220,8 @@ public open class TextParagraph : RefCounted() { /** * Overrides BiDi for the structured text. - * - * Override ranges should cover full source text without overlaps. BiDi algorithm will be used on each range separately. + * Override ranges should cover full source text without overlaps. BiDi algorithm will be used on + * each range separately. */ public fun setBidiOverride(`override`: VariantArray): Unit { TransferContext.writeArguments(ARRAY to override) @@ -229,7 +229,8 @@ public open class TextParagraph : RefCounted() { } /** - * Sets drop cap, overrides previously set drop cap. Drop cap (dropped capital) is a decorative element at the beginning of a paragraph that is larger than the rest of the text. + * Sets drop cap, overrides previously set drop cap. Drop cap (dropped capital) is a decorative + * element at the beginning of a paragraph that is larger than the rest of the text. */ @JvmOverloads public fun setDropcap( @@ -269,7 +270,8 @@ public open class TextParagraph : RefCounted() { } /** - * Adds inline object to the text buffer, [key] must be unique. In the text, object is represented as [length] object replacement characters. + * Adds inline object to the text buffer, [param key] must be unique. In the text, object is + * represented as [param length] object replacement characters. */ @JvmOverloads public fun addObject( @@ -398,7 +400,8 @@ public open class TextParagraph : RefCounted() { } /** - * Returns the text line ascent (number of pixels above the baseline for horizontal layout or to the left of baseline for vertical). + * Returns the text line ascent (number of pixels above the baseline for horizontal layout or to + * the left of baseline for vertical). */ public fun getLineAscent(line: Int): Float { TransferContext.writeArguments(LONG to line.toLong()) @@ -407,7 +410,8 @@ public open class TextParagraph : RefCounted() { } /** - * Returns the text line descent (number of pixels below the baseline for horizontal layout or to the right of baseline for vertical). + * Returns the text line descent (number of pixels below the baseline for horizontal layout or to + * the right of baseline for vertical). */ public fun getLineDescent(line: Int): Float { TransferContext.writeArguments(LONG to line.toLong()) @@ -461,7 +465,8 @@ public open class TextParagraph : RefCounted() { } /** - * Draw all lines of the text and drop cap into a canvas item at a given position, with [color]. [pos] specifies the top left corner of the bounding box. + * Draw all lines of the text and drop cap into a canvas item at a given position, with [param + * color]. [param pos] specifies the top left corner of the bounding box. */ @JvmOverloads public fun draw( @@ -475,7 +480,8 @@ public open class TextParagraph : RefCounted() { } /** - * Draw outlines of all lines of the text and drop cap into a canvas item at a given position, with [color]. [pos] specifies the top left corner of the bounding box. + * Draw outlines of all lines of the text and drop cap into a canvas item at a given position, + * with [param color]. [param pos] specifies the top left corner of the bounding box. */ @JvmOverloads public fun drawOutline( @@ -490,7 +496,8 @@ public open class TextParagraph : RefCounted() { } /** - * Draw single line of text into a canvas item at a given position, with [color]. [pos] specifies the top left corner of the bounding box. + * Draw single line of text into a canvas item at a given position, with [param color]. [param + * pos] specifies the top left corner of the bounding box. */ @JvmOverloads public fun drawLine( @@ -504,7 +511,8 @@ public open class TextParagraph : RefCounted() { } /** - * Draw outline of the single line of text into a canvas item at a given position, with [color]. [pos] specifies the top left corner of the bounding box. + * Draw outline of the single line of text into a canvas item at a given position, with [param + * color]. [param pos] specifies the top left corner of the bounding box. */ @JvmOverloads public fun drawLineOutline( @@ -519,7 +527,8 @@ public open class TextParagraph : RefCounted() { } /** - * Draw drop cap into a canvas item at a given position, with [color]. [pos] specifies the top left corner of the bounding box. + * Draw drop cap into a canvas item at a given position, with [param color]. [param pos] specifies + * the top left corner of the bounding box. */ @JvmOverloads public fun drawDropcap( @@ -532,7 +541,8 @@ public open class TextParagraph : RefCounted() { } /** - * Draw drop cap outline into a canvas item at a given position, with [color]. [pos] specifies the top left corner of the bounding box. + * Draw drop cap outline into a canvas item at a given position, with [param color]. [param pos] + * specifies the top left corner of the bounding box. */ @JvmOverloads public fun drawDropcapOutline( @@ -546,7 +556,8 @@ public open class TextParagraph : RefCounted() { } /** - * Returns caret character offset at the specified coordinates. This function always returns a valid position. + * Returns caret character offset at the specified coordinates. This function always returns a + * valid position. */ public fun hitTest(coords: Vector2): Int { TransferContext.writeArguments(VECTOR2 to coords) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/TextServerAdvanced.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/TextServerAdvanced.kt index 0c88ed1db..228b2bfb0 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/TextServerAdvanced.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/TextServerAdvanced.kt @@ -11,6 +11,11 @@ import kotlin.Boolean import kotlin.Int import kotlin.Suppress +/** + * An implementation of [TextServer] that uses HarfBuzz, ICU and SIL Graphite to support BiDi, + * complex text layouts and contextual OpenType features. This is Godot's default primary [TextServer] + * interface. + */ @GodotBaseType public open class TextServerAdvanced : TextServerExtension() { public override fun new(scriptIndex: Int): Boolean { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/TextServerDummy.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/TextServerDummy.kt index d2486c0ca..edf4b717e 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/TextServerDummy.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/TextServerDummy.kt @@ -12,24 +12,22 @@ import kotlin.Int import kotlin.Suppress /** - * A dummy text server that can't render text or manage fonts. - * - * A dummy [godot.TextServer] interface that doesn't do anything. Useful for freeing up memory when rendering text is not needed, as text servers are resource-intensive. It can also be used for performance comparisons in complex GUIs to check the impact of text rendering. - * + * A dummy [TextServer] interface that doesn't do anything. Useful for freeing up memory when + * rendering text is not needed, as text servers are resource-intensive. It can also be used for + * performance comparisons in complex GUIs to check the impact of text rendering. * A dummy text server is always available at the start of a project. Here's how to access it: - * - * ``` - * var dummy_text_server = TextServerManager.find_interface("Dummy") - * if dummy_text_server != null: - * TextServerManager.set_primary_interface(dummy_text_server) - * # If the other text servers are unneeded, they can be removed: - * for i in TextServerManager.get_interface_count(): - * var text_server = TextServerManager.get_interface(i) - * if text_server != dummy_text_server: - * TextServerManager.remove_interface(text_server) - * ``` - * - * The command line argument `--text-driver Dummy` (case-sensitive) can be used to force the "Dummy" [godot.TextServer] on any project. + * [codeblock] + * var dummy_text_server = TextServerManager.find_interface("Dummy") + * if dummy_text_server != null: + * TextServerManager.set_primary_interface(dummy_text_server) + * # If the other text servers are unneeded, they can be removed: + * for i in TextServerManager.get_interface_count(): + * var text_server = TextServerManager.get_interface(i) + * if text_server != dummy_text_server: + * TextServerManager.remove_interface(text_server) + * [/codeblock] + * The command line argument `--text-driver Dummy` (case-sensitive) can be used to force the "Dummy" + * [TextServer] on any project. */ @GodotBaseType public open class TextServerDummy : TextServerExtension() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/TextServerManager.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/TextServerManager.kt index 1b82d3a4f..f2d883d14 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/TextServerManager.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/TextServerManager.kt @@ -29,11 +29,9 @@ import kotlin.Suppress import kotlin.Unit /** - * A singleton for managing [godot.TextServer] implementations. - * - * [godot.TextServerManager] is the API backend for loading, enumerating, and switching [godot.TextServer]s. - * - * **Note:** Switching text server at runtime is possible, but will invalidate all fonts and text buffers. Make sure to unload all controls, fonts, and themes before doing so. + * [TextServerManager] is the API backend for loading, enumerating, and switching [TextServer]s. + * **Note:** Switching text server at runtime is possible, but will invalidate all fonts and text + * buffers. Make sure to unload all controls, fonts, and themes before doing so. */ @GodotBaseType public object TextServerManager : Object() { @@ -53,7 +51,7 @@ public object TextServerManager : Object() { } /** - * Registers a [godot.TextServer] interface. + * Registers a [TextServer] interface. */ public fun addInterface(_interface: TextServer): Unit { TransferContext.writeArguments(OBJECT to _interface) @@ -70,7 +68,8 @@ public object TextServerManager : Object() { } /** - * Removes an interface. All fonts and shaped text caches should be freed before removing an interface. + * Removes an interface. All fonts and shaped text caches should be freed before removing an + * interface. */ public fun removeInterface(_interface: TextServer): Unit { TransferContext.writeArguments(OBJECT to _interface) @@ -96,7 +95,7 @@ public object TextServerManager : Object() { } /** - * Finds an interface by its [name]. + * Finds an interface by its [param name]. */ public fun findInterface(name: String): TextServer? { TransferContext.writeArguments(STRING to name) @@ -105,7 +104,7 @@ public object TextServerManager : Object() { } /** - * Sets the primary [godot.TextServer] interface. + * Sets the primary [TextServer] interface. */ public fun setPrimaryInterface(index: TextServer): Unit { TransferContext.writeArguments(OBJECT to index) @@ -113,7 +112,7 @@ public object TextServerManager : Object() { } /** - * Returns the primary [godot.TextServer] interface currently in use. + * Returns the primary [TextServer] interface currently in use. */ public fun getPrimaryInterface(): TextServer? { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Texture.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Texture.kt index 7f7831194..525ba1cdf 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Texture.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Texture.kt @@ -12,9 +12,8 @@ import kotlin.Int import kotlin.Suppress /** - * Base class for all texture types. - * - * [godot.Texture] is the base class for all texture types. Common texture types are [godot.Texture2D] and [godot.ImageTexture]. See also [godot.Image]. + * [Texture] is the base class for all texture types. Common texture types are [Texture2D] and + * [ImageTexture]. See also [Image]. */ @GodotBaseType public open class Texture : Resource() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Texture2DArray.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Texture2DArray.kt index 2ca3c756e..da6826005 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Texture2DArray.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Texture2DArray.kt @@ -16,13 +16,16 @@ import kotlin.Int import kotlin.Suppress /** - * A single texture resource which consists of multiple, separate images. Each image has the same dimensions and number of mipmap levels. - * - * A Texture2DArray is different from a Texture3D: The Texture2DArray does not support trilinear interpolation between the [godot.Image]s, i.e. no blending. See also [godot.Cubemap] and [godot.CubemapArray], which are texture arrays with specialized cubemap functions. - * - * A Texture2DArray is also different from an [godot.AtlasTexture]: In a Texture2DArray, all images are treated separately. In an atlas, the regions (i.e. the single images) can be of different sizes. Furthermore, you usually need to add a padding around the regions, to prevent accidental UV mapping to more than one region. The same goes for mipmapping: Mipmap chains are handled separately for each layer. In an atlas, the slicing has to be done manually in the fragment shader. - * - * To create such a texture file yourself, reimport your image files using the Godot Editor import presets. + * A Texture2DArray is different from a Texture3D: The Texture2DArray does not support trilinear + * interpolation between the [Image]s, i.e. no blending. See also [Cubemap] and [CubemapArray], which + * are texture arrays with specialized cubemap functions. + * A Texture2DArray is also different from an [AtlasTexture]: In a Texture2DArray, all images are + * treated separately. In an atlas, the regions (i.e. the single images) can be of different sizes. + * Furthermore, you usually need to add a padding around the regions, to prevent accidental UV mapping + * to more than one region. The same goes for mipmapping: Mipmap chains are handled separately for each + * layer. In an atlas, the slicing has to be done manually in the fragment shader. + * To create such a texture file yourself, reimport your image files using the Godot Editor import + * presets. */ @GodotBaseType public open class Texture2DArray : ImageTextureLayered() { @@ -32,7 +35,7 @@ public open class Texture2DArray : ImageTextureLayered() { } /** - * Creates a placeholder version of this resource ([godot.PlaceholderTexture2DArray]). + * Creates a placeholder version of this resource ([PlaceholderTexture2DArray]). */ public fun createPlaceholder(): Resource? { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Texture2DArrayRD.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Texture2DArrayRD.kt index db587cec8..144ad50d0 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Texture2DArrayRD.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Texture2DArrayRD.kt @@ -12,9 +12,8 @@ import kotlin.Int import kotlin.Suppress /** - * Texture Array for 2D that is bound to a texture created on the [godot.RenderingDevice]. - * - * This texture array class allows you to use a 2D array texture created directly on the [godot.RenderingDevice] as a texture for materials, meshes, etc. + * This texture array class allows you to use a 2D array texture created directly on the + * [RenderingDevice] as a texture for materials, meshes, etc. */ @GodotBaseType public open class Texture2DArrayRD : TextureLayeredRD() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Texture2DRD.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Texture2DRD.kt index 042fdf1a7..a4908b40a 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Texture2DRD.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Texture2DRD.kt @@ -18,14 +18,13 @@ import kotlin.Int import kotlin.Suppress /** - * Texture for 2D that is bound to a texture created on the [godot.RenderingDevice]. - * - * This texture class allows you to use a 2D texture created directly on the [godot.RenderingDevice] as a texture for materials, meshes, etc. + * This texture class allows you to use a 2D texture created directly on the [RenderingDevice] as a + * texture for materials, meshes, etc. */ @GodotBaseType public open class Texture2DRD : Texture2D() { /** - * The RID of the texture object created on the [godot.RenderingDevice]. + * The RID of the texture object created on the [RenderingDevice]. */ public var textureRdRid: RID get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Texture3DRD.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Texture3DRD.kt index 5fd15e830..c70d013d0 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Texture3DRD.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Texture3DRD.kt @@ -18,14 +18,13 @@ import kotlin.Int import kotlin.Suppress /** - * Texture for 3D that is bound to a texture created on the [godot.RenderingDevice]. - * - * This texture class allows you to use a 3D texture created directly on the [godot.RenderingDevice] as a texture for materials, meshes, etc. + * This texture class allows you to use a 3D texture created directly on the [RenderingDevice] as a + * texture for materials, meshes, etc. */ @GodotBaseType public open class Texture3DRD : Texture3D() { /** - * The RID of the texture object created on the [godot.RenderingDevice]. + * The RID of the texture object created on the [RenderingDevice]. */ public var textureRdRid: RID get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/TextureButton.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/TextureButton.kt index c28196241..dc75a96c3 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/TextureButton.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/TextureButton.kt @@ -20,21 +20,17 @@ import kotlin.Long import kotlin.Suppress /** - * Texture-based button. Supports Pressed, Hover, Disabled and Focused states. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/676](https://godotengine.org/asset-library/asset/676) - * - * [godot.TextureButton] has the same functionality as [godot.Button], except it uses sprites instead of Godot's [godot.Theme] resource. It is faster to create, but it doesn't support localization like more complex [godot.Control]s. - * + * [TextureButton] has the same functionality as [Button], except it uses sprites instead of Godot's + * [Theme] resource. It is faster to create, but it doesn't support localization like more complex + * [Control]s. * The "normal" state must contain a texture ([textureNormal]); other textures are optional. - * - * See also [godot.BaseButton] which contains common properties and methods associated with this node. + * See also [BaseButton] which contains common properties and methods associated with this node. */ @GodotBaseType public open class TextureButton : BaseButton() { /** - * Texture to display by default, when the node is **not** in the disabled, hover or pressed state. This texture is still displayed in the focused state, with [textureFocused] drawn on top. + * Texture to display by default, when the node is **not** in the disabled, hover or pressed + * state. This texture is still displayed in the focused state, with [textureFocused] drawn on top. */ public var textureNormal: Texture2D? get() { @@ -48,7 +44,8 @@ public open class TextureButton : BaseButton() { } /** - * Texture to display on mouse down over the node, if the node has keyboard focus and the player presses the Enter key or if the player presses the [godot.BaseButton.shortcut] key. + * Texture to display on mouse down over the node, if the node has keyboard focus and the player + * presses the Enter key or if the player presses the [BaseButton.shortcut] key. */ public var texturePressed: Texture2D? get() { @@ -76,7 +73,7 @@ public open class TextureButton : BaseButton() { } /** - * Texture to display when the node is disabled. See [godot.BaseButton.disabled]. + * Texture to display when the node is disabled. See [BaseButton.disabled]. */ public var textureDisabled: Texture2D? get() { @@ -90,7 +87,12 @@ public open class TextureButton : BaseButton() { } /** - * Texture to display when the node has mouse or keyboard focus. [textureFocused] is displayed *over* the base texture, so a partially transparent texture should be used to ensure the base texture remains visible. A texture that represents an outline or an underline works well for this purpose. To disable the focus visual effect, assign a fully transparent texture of any size. Note that disabling the focus visual effect will harm keyboard/controller navigation usability, so this is not recommended for accessibility reasons. + * Texture to display when the node has mouse or keyboard focus. [textureFocused] is displayed + * *over* the base texture, so a partially transparent texture should be used to ensure the base + * texture remains visible. A texture that represents an outline or an underline works well for this + * purpose. To disable the focus visual effect, assign a fully transparent texture of any size. Note + * that disabling the focus visual effect will harm keyboard/controller navigation usability, so this + * is not recommended for accessibility reasons. */ public var textureFocused: Texture2D? get() { @@ -104,7 +106,8 @@ public open class TextureButton : BaseButton() { } /** - * Pure black and white [godot.BitMap] image to use for click detection. On the mask, white pixels represent the button's clickable area. Use it to create buttons with curved shapes. + * Pure black and white [BitMap] image to use for click detection. On the mask, white pixels + * represent the button's clickable area. Use it to create buttons with curved shapes. */ public var textureClickMask: BitMap? get() { @@ -118,7 +121,8 @@ public open class TextureButton : BaseButton() { } /** - * If `true`, the size of the texture won't be considered for minimum size calculation, so the [godot.TextureButton] can be shrunk down past the texture size. + * If `true`, the size of the texture won't be considered for minimum size calculation, so the + * [TextureButton] can be shrunk down past the texture size. */ public var ignoreTextureSize: Boolean get() { @@ -132,7 +136,8 @@ public open class TextureButton : BaseButton() { } /** - * Controls the texture's behavior when you resize the node's bounding rectangle. See the [enum StretchMode] constants for available options. + * Controls the texture's behavior when you resize the node's bounding rectangle. See the [enum + * StretchMode] constants for available options. */ public var stretchMode: StretchMode get() { @@ -198,15 +203,18 @@ public open class TextureButton : BaseButton() { */ STRETCH_KEEP_CENTERED(3), /** - * Scale the texture to fit the node's bounding rectangle, but maintain the texture's aspect ratio. + * Scale the texture to fit the node's bounding rectangle, but maintain the texture's aspect + * ratio. */ STRETCH_KEEP_ASPECT(4), /** - * Scale the texture to fit the node's bounding rectangle, center it, and maintain its aspect ratio. + * Scale the texture to fit the node's bounding rectangle, center it, and maintain its aspect + * ratio. */ STRETCH_KEEP_ASPECT_CENTERED(5), /** - * Scale the texture so that the shorter side fits the bounding rectangle. The other side clips to the node's limits. + * Scale the texture so that the shorter side fits the bounding rectangle. The other side clips + * to the node's limits. */ STRETCH_KEEP_ASPECT_COVERED(6), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/TextureCubemapArrayRD.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/TextureCubemapArrayRD.kt index c8dadd2a1..f8c78bdd7 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/TextureCubemapArrayRD.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/TextureCubemapArrayRD.kt @@ -12,9 +12,8 @@ import kotlin.Int import kotlin.Suppress /** - * Texture Array for Cubemaps that is bound to a texture created on the [godot.RenderingDevice]. - * - * This texture class allows you to use a cubemap array texture created directly on the [godot.RenderingDevice] as a texture for materials, meshes, etc. + * This texture class allows you to use a cubemap array texture created directly on the + * [RenderingDevice] as a texture for materials, meshes, etc. */ @GodotBaseType public open class TextureCubemapArrayRD : TextureLayeredRD() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/TextureCubemapRD.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/TextureCubemapRD.kt index 94d2b9c1d..87ce515eb 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/TextureCubemapRD.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/TextureCubemapRD.kt @@ -12,9 +12,8 @@ import kotlin.Int import kotlin.Suppress /** - * Texture for Cubemap that is bound to a texture created on the [godot.RenderingDevice]. - * - * This texture class allows you to use a cubemap texture created directly on the [godot.RenderingDevice] as a texture for materials, meshes, etc. + * This texture class allows you to use a cubemap texture created directly on the [RenderingDevice] + * as a texture for materials, meshes, etc. */ @GodotBaseType public open class TextureCubemapRD : TextureLayeredRD() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/TextureLayered.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/TextureLayered.kt index 4607e44d0..d8d89d76c 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/TextureLayered.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/TextureLayered.kt @@ -20,17 +20,13 @@ import kotlin.NotImplementedError import kotlin.Suppress /** - * Base class for texture types which contain the data of multiple [godot.Image]s. Each image is of the same size and format. - * - * Base class for [godot.ImageTextureLayered] and [godot.CompressedTextureLayered]. Cannot be used directly, but contains all the functions necessary for accessing the derived resource types. See also [godot.Texture3D]. - * - * Data is set on a per-layer basis. For [godot.Texture2DArray]s, the layer specifies the array layer. - * + * Base class for [ImageTextureLayered] and [CompressedTextureLayered]. Cannot be used directly, but + * contains all the functions necessary for accessing the derived resource types. See also [Texture3D]. + * Data is set on a per-layer basis. For [Texture2DArray]s, the layer specifies the array layer. * All images need to have the same width, height and number of mipmap levels. - * - * A [godot.TextureLayered] can be loaded with [godot.ResourceLoader.load]. - * - * Internally, Godot maps these files to their respective counterparts in the target rendering driver (Vulkan, OpenGL3). + * A [TextureLayered] can be loaded with [ResourceLoader.load]. + * Internally, Godot maps these files to their respective counterparts in the target rendering + * driver (Vulkan, OpenGL3). */ @GodotBaseType public open class TextureLayered : Texture() { @@ -40,49 +36,49 @@ public open class TextureLayered : Texture() { } /** - * Called when the [godot.TextureLayered]'s format is queried. + * Called when the [TextureLayered]'s format is queried. */ public open fun _getFormat(): Image.Format { throw NotImplementedError("_get_format is not implemented for TextureLayered") } /** - * Called when the layers' type in the [godot.TextureLayered] is queried. + * Called when the layers' type in the [TextureLayered] is queried. */ public open fun _getLayeredType(): Long { throw NotImplementedError("_get_layered_type is not implemented for TextureLayered") } /** - * Called when the [godot.TextureLayered]'s width queried. + * Called when the [TextureLayered]'s width queried. */ public open fun _getWidth(): Int { throw NotImplementedError("_get_width is not implemented for TextureLayered") } /** - * Called when the [godot.TextureLayered]'s height is queried. + * Called when the [TextureLayered]'s height is queried. */ public open fun _getHeight(): Int { throw NotImplementedError("_get_height is not implemented for TextureLayered") } /** - * Called when the number of layers in the [godot.TextureLayered] is queried. + * Called when the number of layers in the [TextureLayered] is queried. */ public open fun _getLayers(): Int { throw NotImplementedError("_get_layers is not implemented for TextureLayered") } /** - * Called when the presence of mipmaps in the [godot.TextureLayered] is queried. + * Called when the presence of mipmaps in the [TextureLayered] is queried. */ public open fun _hasMipmaps(): Boolean { throw NotImplementedError("_has_mipmaps is not implemented for TextureLayered") } /** - * Called when the data for a layer in the [godot.TextureLayered] is queried. + * Called when the data for a layer in the [TextureLayered] is queried. */ public open fun _getLayerData(layerIndex: Int): Image? { throw NotImplementedError("_get_layer_data is not implemented for TextureLayered") @@ -98,7 +94,8 @@ public open class TextureLayered : Texture() { } /** - * Returns the [godot.TextureLayered]'s type. The type determines how the data is accessed, with cubemaps having special types. + * Returns the [TextureLayered]'s type. The type determines how the data is accessed, with + * cubemaps having special types. */ public fun getLayeredType(): LayeredType { TransferContext.writeArguments() @@ -125,7 +122,7 @@ public open class TextureLayered : Texture() { } /** - * Returns the number of referenced [godot.Image]s. + * Returns the number of referenced [Image]s. */ public fun getLayers(): Int { TransferContext.writeArguments() @@ -143,7 +140,7 @@ public open class TextureLayered : Texture() { } /** - * Returns an [godot.Image] resource with the data from specified [layer]. + * Returns an [Image] resource with the data from specified [param layer]. */ public fun getLayerData(layer: Int): Image? { TransferContext.writeArguments(LONG to layer.toLong()) @@ -155,15 +152,15 @@ public open class TextureLayered : Texture() { id: Long, ) { /** - * Texture is a generic [godot.Texture2DArray]. + * Texture is a generic [Texture2DArray]. */ LAYERED_TYPE_2D_ARRAY(0), /** - * Texture is a [godot.Cubemap], with each side in its own layer (6 in total). + * Texture is a [Cubemap], with each side in its own layer (6 in total). */ LAYERED_TYPE_CUBEMAP(1), /** - * Texture is a [godot.CubemapArray], with each cubemap being made of 6 layers. + * Texture is a [CubemapArray], with each cubemap being made of 6 layers. */ LAYERED_TYPE_CUBEMAP_ARRAY(2), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/TextureLayeredRD.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/TextureLayeredRD.kt index d683ed103..701129c52 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/TextureLayeredRD.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/TextureLayeredRD.kt @@ -18,14 +18,13 @@ import kotlin.Int import kotlin.Suppress /** - * Abstract base class for layered texture RD types. - * - * Base class for [godot.Texture2DArrayRD], [godot.TextureCubemapRD] and [godot.TextureCubemapArrayRD]. Cannot be used directly, but contains all the functions necessary for accessing the derived resource types. + * Base class for [Texture2DArrayRD], [TextureCubemapRD] and [TextureCubemapArrayRD]. Cannot be used + * directly, but contains all the functions necessary for accessing the derived resource types. */ @GodotBaseType public open class TextureLayeredRD internal constructor() : TextureLayered() { /** - * The RID of the texture object created on the [godot.RenderingDevice]. + * The RID of the texture object created on the [RenderingDevice]. */ public var textureRdRid: RID get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/TextureProgressBar.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/TextureProgressBar.kt index 529d5c498..d13059ab9 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/TextureProgressBar.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/TextureProgressBar.kt @@ -30,9 +30,8 @@ import kotlin.Suppress import kotlin.Unit /** - * Texture-based progress bar. Useful for loading screens and life or stamina bars. - * - * TextureProgressBar works like [godot.ProgressBar], but uses up to 3 textures instead of Godot's [godot.Theme] resource. It can be used to create horizontal, vertical and radial progress bars. + * TextureProgressBar works like [ProgressBar], but uses up to 3 textures instead of Godot's [Theme] + * resource. It can be used to create horizontal, vertical and radial progress bars. */ @GodotBaseType public open class TextureProgressBar : Range() { @@ -51,7 +50,9 @@ public open class TextureProgressBar : Range() { } /** - * If `true`, Godot treats the bar's textures like in [godot.NinePatchRect]. Use the `stretch_margin_*` properties like [stretchMarginBottom] to set up the nine patch's 3×3 grid. When using a radial [fillMode], this setting will enable stretching. + * If `true`, Godot treats the bar's textures like in [NinePatchRect]. Use the `stretch_margin_*` + * properties like [stretchMarginBottom] to set up the nine patch's 3×3 grid. When using a radial + * [fillMode], this setting will enable stretching. */ public var ninePatchStretch: Boolean get() { @@ -107,7 +108,9 @@ public open class TextureProgressBar : Range() { } /** - * The height of the 9-patch's bottom row. A margin of 16 means the 9-slice's bottom corners and side will have a height of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders. + * The height of the 9-patch's bottom row. A margin of 16 means the 9-slice's bottom corners and + * side will have a height of 16 pixels. You can set all 4 margin values individually to create + * panels with non-uniform borders. */ public var stretchMarginBottom: Int get() { @@ -121,7 +124,7 @@ public open class TextureProgressBar : Range() { } /** - * [godot.Texture2D] that draws under the progress bar. The bar's background. + * [Texture2D] that draws under the progress bar. The bar's background. */ public var textureUnder: Texture2D? get() { @@ -135,7 +138,8 @@ public open class TextureProgressBar : Range() { } /** - * [godot.Texture2D] that draws over the progress bar. Use it to add highlights or an upper-frame that hides part of [textureProgress]. + * [Texture2D] that draws over the progress bar. Use it to add highlights or an upper-frame that + * hides part of [textureProgress]. */ public var textureOver: Texture2D? get() { @@ -149,9 +153,10 @@ public open class TextureProgressBar : Range() { } /** - * [godot.Texture2D] that clips based on the node's `value` and [fillMode]. As `value` increased, the texture fills up. It shows entirely when `value` reaches `max_value`. It doesn't show at all if `value` is equal to `min_value`. - * - * The `value` property comes from [godot.Range]. See [godot.Range.value], [godot.Range.minValue], [godot.Range.maxValue]. + * [Texture2D] that clips based on the node's `value` and [fillMode]. As `value` increased, the + * texture fills up. It shows entirely when `value` reaches `max_value`. It doesn't show at all if + * `value` is equal to `min_value`. + * The `value` property comes from [Range]. See [Range.value], [Range.minValue], [Range.maxValue]. */ public var textureProgress: Texture2D? get() { @@ -165,7 +170,8 @@ public open class TextureProgressBar : Range() { } /** - * The offset of [textureProgress]. Useful for [textureOver] and [textureUnder] with fancy borders, to avoid transparent margins in your progress texture. + * The offset of [textureProgress]. Useful for [textureOver] and [textureUnder] with fancy + * borders, to avoid transparent margins in your progress texture. */ @CoreTypeLocalCopy public var textureProgressOffset: Vector2 @@ -195,7 +201,8 @@ public open class TextureProgressBar : Range() { } /** - * Multiplies the color of the bar's [textureOver] texture. The effect is similar to [godot.CanvasItem.modulate], except it only affects this specific texture instead of the entire node. + * Multiplies the color of the bar's [textureOver] texture. The effect is similar to + * [CanvasItem.modulate], except it only affects this specific texture instead of the entire node. */ @CoreTypeLocalCopy public var tintOver: Color @@ -225,7 +232,10 @@ public open class TextureProgressBar : Range() { } /** - * Starting angle for the fill of [textureProgress] if [fillMode] is [FILL_CLOCKWISE] or [FILL_COUNTER_CLOCKWISE]. When the node's `value` is equal to its `min_value`, the texture doesn't show up at all. When the `value` increases, the texture fills and tends towards [radialFillDegrees]. + * Starting angle for the fill of [textureProgress] if [fillMode] is [constant FILL_CLOCKWISE] or + * [constant FILL_COUNTER_CLOCKWISE]. When the node's `value` is equal to its `min_value`, the + * texture doesn't show up at all. When the `value` increases, the texture fills and tends towards + * [radialFillDegrees]. */ public var radialInitialAngle: Float get() { @@ -239,9 +249,10 @@ public open class TextureProgressBar : Range() { } /** - * Upper limit for the fill of [textureProgress] if [fillMode] is [FILL_CLOCKWISE] or [FILL_COUNTER_CLOCKWISE]. When the node's `value` is equal to its `max_value`, the texture fills up to this angle. - * - * See [godot.Range.value], [godot.Range.maxValue]. + * Upper limit for the fill of [textureProgress] if [fillMode] is [constant FILL_CLOCKWISE] or + * [constant FILL_COUNTER_CLOCKWISE]. When the node's `value` is equal to its `max_value`, the + * texture fills up to this angle. + * See [Range.value], [Range.maxValue]. */ public var radialFillDegrees: Float get() { @@ -255,7 +266,8 @@ public open class TextureProgressBar : Range() { } /** - * Offsets [textureProgress] if [fillMode] is [FILL_CLOCKWISE] or [FILL_COUNTER_CLOCKWISE]. + * Offsets [textureProgress] if [fillMode] is [constant FILL_CLOCKWISE] or [constant + * FILL_COUNTER_CLOCKWISE]. */ @CoreTypeLocalCopy public var radialCenterOffset: Vector2 @@ -275,7 +287,8 @@ public open class TextureProgressBar : Range() { } /** - * The offset of [textureProgress]. Useful for [textureOver] and [textureUnder] with fancy borders, to avoid transparent margins in your progress texture. + * The offset of [textureProgress]. Useful for [textureOver] and [textureUnder] with fancy + * borders, to avoid transparent margins in your progress texture. * * This is a helper function to make dealing with local copies easier. * @@ -324,7 +337,8 @@ public open class TextureProgressBar : Range() { /** - * Multiplies the color of the bar's [textureOver] texture. The effect is similar to [godot.CanvasItem.modulate], except it only affects this specific texture instead of the entire node. + * Multiplies the color of the bar's [textureOver] texture. The effect is similar to + * [CanvasItem.modulate], except it only affects this specific texture instead of the entire node. * * This is a helper function to make dealing with local copies easier. * @@ -372,7 +386,8 @@ public open class TextureProgressBar : Range() { /** - * Offsets [textureProgress] if [fillMode] is [FILL_CLOCKWISE] or [FILL_COUNTER_CLOCKWISE]. + * Offsets [textureProgress] if [fillMode] is [constant FILL_CLOCKWISE] or [constant + * FILL_COUNTER_CLOCKWISE]. * * This is a helper function to make dealing with local copies easier. * @@ -416,11 +431,15 @@ public open class TextureProgressBar : Range() { */ FILL_BOTTOM_TO_TOP(3), /** - * Turns the node into a radial bar. The [textureProgress] fills clockwise. See [radialCenterOffset], [radialInitialAngle] and [radialFillDegrees] to control the way the bar fills up. + * Turns the node into a radial bar. The [textureProgress] fills clockwise. See + * [radialCenterOffset], [radialInitialAngle] and [radialFillDegrees] to control the way the bar + * fills up. */ FILL_CLOCKWISE(4), /** - * Turns the node into a radial bar. The [textureProgress] fills counterclockwise. See [radialCenterOffset], [radialInitialAngle] and [radialFillDegrees] to control the way the bar fills up. + * Turns the node into a radial bar. The [textureProgress] fills counterclockwise. See + * [radialCenterOffset], [radialInitialAngle] and [radialFillDegrees] to control the way the bar + * fills up. */ FILL_COUNTER_CLOCKWISE(5), /** @@ -432,7 +451,9 @@ public open class TextureProgressBar : Range() { */ FILL_BILINEAR_TOP_AND_BOTTOM(7), /** - * Turns the node into a radial bar. The [textureProgress] fills radially from the center, expanding both clockwise and counterclockwise. See [radialCenterOffset], [radialInitialAngle] and [radialFillDegrees] to control the way the bar fills up. + * Turns the node into a radial bar. The [textureProgress] fills radially from the center, + * expanding both clockwise and counterclockwise. See [radialCenterOffset], [radialInitialAngle] + * and [radialFillDegrees] to control the way the bar fills up. */ FILL_CLOCKWISE_AND_COUNTER_CLOCKWISE(8), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/TextureRect.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/TextureRect.kt index 12db0cbb7..acf073d99 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/TextureRect.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/TextureRect.kt @@ -20,17 +20,14 @@ import kotlin.Long import kotlin.Suppress /** - * A control that displays a texture. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/676](https://godotengine.org/asset-library/asset/676) - * - * A control that displays a texture, for example an icon inside a GUI. The texture's placement can be controlled with the [stretchMode] property. It can scale, tile, or stay centered inside its bounding rectangle. + * A control that displays a texture, for example an icon inside a GUI. The texture's placement can + * be controlled with the [stretchMode] property. It can scale, tile, or stay centered inside its + * bounding rectangle. */ @GodotBaseType public open class TextureRect : Control() { /** - * The node's [godot.Texture2D] resource. + * The node's [Texture2D] resource. */ public var texture: Texture2D? get() { @@ -44,9 +41,12 @@ public open class TextureRect : Control() { } /** - * Defines how minimum size is determined based on the texture's size. See [enum ExpandMode] for options. - * - * **Note:** Using [EXPAND_FIT_WIDTH], [EXPAND_FIT_WIDTH_PROPORTIONAL], [EXPAND_FIT_HEIGHT] or [EXPAND_FIT_HEIGHT_PROPORTIONAL] may result in unstable behavior in some containers. This functionality is being re-evaluated and will change in the future. + * Defines how minimum size is determined based on the texture's size. See [enum ExpandMode] for + * options. + * **Note:** Using [constant EXPAND_FIT_WIDTH], [constant EXPAND_FIT_WIDTH_PROPORTIONAL], + * [constant EXPAND_FIT_HEIGHT] or [constant EXPAND_FIT_HEIGHT_PROPORTIONAL] may result in unstable + * behavior in some containers. This functionality is being re-evaluated and will change in the + * future. */ public var expandMode: ExpandMode get() { @@ -60,7 +60,8 @@ public open class TextureRect : Control() { } /** - * Controls the texture's behavior when resizing the node's bounding rectangle. See [enum StretchMode]. + * Controls the texture's behavior when resizing the node's bounding rectangle. See [enum + * StretchMode]. */ public var stretchMode: StretchMode get() { @@ -110,27 +111,31 @@ public open class TextureRect : Control() { id: Long, ) { /** - * The minimum size will be equal to texture size, i.e. [godot.TextureRect] can't be smaller than the texture. + * The minimum size will be equal to texture size, i.e. [TextureRect] can't be smaller than the + * texture. */ EXPAND_KEEP_SIZE(0), /** - * The size of the texture won't be considered for minimum size calculation, so the [godot.TextureRect] can be shrunk down past the texture size. + * The size of the texture won't be considered for minimum size calculation, so the + * [TextureRect] can be shrunk down past the texture size. */ EXPAND_IGNORE_SIZE(1), /** - * The height of the texture will be ignored. Minimum width will be equal to the current height. Useful for horizontal layouts, e.g. inside [godot.HBoxContainer]. + * The height of the texture will be ignored. Minimum width will be equal to the current height. + * Useful for horizontal layouts, e.g. inside [HBoxContainer]. */ EXPAND_FIT_WIDTH(2), /** - * Same as [EXPAND_FIT_WIDTH], but keeps texture's aspect ratio. + * Same as [constant EXPAND_FIT_WIDTH], but keeps texture's aspect ratio. */ EXPAND_FIT_WIDTH_PROPORTIONAL(3), /** - * The width of the texture will be ignored. Minimum height will be equal to the current width. Useful for vertical layouts, e.g. inside [godot.VBoxContainer]. + * The width of the texture will be ignored. Minimum height will be equal to the current width. + * Useful for vertical layouts, e.g. inside [VBoxContainer]. */ EXPAND_FIT_HEIGHT(4), /** - * Same as [EXPAND_FIT_HEIGHT], but keeps texture's aspect ratio. + * Same as [constant EXPAND_FIT_HEIGHT], but keeps texture's aspect ratio. */ EXPAND_FIT_HEIGHT_PROPORTIONAL(5), ; @@ -165,15 +170,18 @@ public open class TextureRect : Control() { */ STRETCH_KEEP_CENTERED(3), /** - * Scale the texture to fit the node's bounding rectangle, but maintain the texture's aspect ratio. + * Scale the texture to fit the node's bounding rectangle, but maintain the texture's aspect + * ratio. */ STRETCH_KEEP_ASPECT(4), /** - * Scale the texture to fit the node's bounding rectangle, center it and maintain its aspect ratio. + * Scale the texture to fit the node's bounding rectangle, center it and maintain its aspect + * ratio. */ STRETCH_KEEP_ASPECT_CENTERED(5), /** - * Scale the texture so that the shorter side fits the bounding rectangle. The other side clips to the node's limits. + * Scale the texture so that the shorter side fits the bounding rectangle. The other side clips + * to the node's limits. */ STRETCH_KEEP_ASPECT_COVERED(6), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Theme.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Theme.kt index dedaff72b..988f574ae 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Theme.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Theme.kt @@ -34,22 +34,24 @@ import kotlin.Suppress import kotlin.Unit /** - * A resource used for styling/skinning [godot.Control]s and [godot.Window]s. - * - * Tutorials: - * [$DOCS_URL/tutorials/ui/gui_using_theme_editor.html]($DOCS_URL/tutorials/ui/gui_using_theme_editor.html) - * - * A resource used for styling/skinning [godot.Control] and [godot.Window] nodes. While individual controls can be styled using their local theme overrides (see [godot.Control.addThemeColorOverride]), theme resources allow you to store and apply the same settings across all controls sharing the same type (e.g. style all [godot.Button]s the same). One theme resource can be used for the entire project, but you can also set a separate theme resource to a branch of control nodes. A theme resource assigned to a control applies to the control itself, as well as all of its direct and indirect children (as long as a chain of controls is uninterrupted). - * - * Use [godot.ProjectSettings.gui/theme/custom] to set up a project-scope theme that will be available to every control in your project. - * - * Use [godot.Control.theme] of any control node to set up a theme that will be available to that control and all of its direct and indirect children. + * A resource used for styling/skinning [Control] and [Window] nodes. While individual controls can + * be styled using their local theme overrides (see [Control.addThemeColorOverride]), theme resources + * allow you to store and apply the same settings across all controls sharing the same type (e.g. style + * all [Button]s the same). One theme resource can be used for the entire project, but you can also set + * a separate theme resource to a branch of control nodes. A theme resource assigned to a control + * applies to the control itself, as well as all of its direct and indirect children (as long as a + * chain of controls is uninterrupted). + * Use [ProjectSettings.gui/theme/custom] to set up a project-scope theme that will be available to + * every control in your project. + * Use [Control.theme] of any control node to set up a theme that will be available to that control + * and all of its direct and indirect children. */ @GodotBaseType public open class Theme : Resource() { /** - * The default base scale factor of this theme resource. Used by some controls to scale their visual properties based on the global scale factor. If this value is set to `0.0`, the global scale factor is used (see [godot.ThemeDB.fallbackBaseScale]). - * + * The default base scale factor of this theme resource. Used by some controls to scale their + * visual properties based on the global scale factor. If this value is set to `0.0`, the global + * scale factor is used (see [ThemeDB.fallbackBaseScale]). * Use [hasDefaultBaseScale] to check if this value is valid. */ public var defaultBaseScale: Float @@ -64,8 +66,9 @@ public open class Theme : Resource() { } /** - * The default font of this theme resource. Used as the default value when trying to fetch a font resource that doesn't exist in this theme or is in invalid state. If the default font is also missing or invalid, the engine fallback value is used (see [godot.ThemeDB.fallbackFont]). - * + * The default font of this theme resource. Used as the default value when trying to fetch a font + * resource that doesn't exist in this theme or is in invalid state. If the default font is also + * missing or invalid, the engine fallback value is used (see [ThemeDB.fallbackFont]). * Use [hasDefaultFont] to check if this value is valid. */ public var defaultFont: Font? @@ -80,9 +83,11 @@ public open class Theme : Resource() { } /** - * The default font size of this theme resource. Used as the default value when trying to fetch a font size value that doesn't exist in this theme or is in invalid state. If the default font size is also missing or invalid, the engine fallback value is used (see [godot.ThemeDB.fallbackFontSize]). - * - * Values below `0` are invalid and can be used to unset the property. Use [hasDefaultFontSize] to check if this value is valid. + * The default font size of this theme resource. Used as the default value when trying to fetch a + * font size value that doesn't exist in this theme or is in invalid state. If the default font size + * is also missing or invalid, the engine fallback value is used (see [ThemeDB.fallbackFontSize]). + * Values below `0` are invalid and can be used to unset the property. Use [hasDefaultFontSize] to + * check if this value is valid. */ public var defaultFontSize: Int get() { @@ -101,7 +106,8 @@ public open class Theme : Resource() { } /** - * Creates or changes the value of the icon property defined by [name] and [themeType]. Use [clearIcon] to remove the property. + * Creates or changes the value of the icon property defined by [param name] and [param + * theme_type]. Use [clearIcon] to remove the property. */ public fun setIcon( name: StringName, @@ -113,9 +119,9 @@ public open class Theme : Resource() { } /** - * Returns the icon property defined by [name] and [themeType], if it exists. - * - * Returns the engine fallback icon value if the property doesn't exist (see [godot.ThemeDB.fallbackIcon]). Use [hasIcon] to check for existence. + * Returns the icon property defined by [param name] and [param theme_type], if it exists. + * Returns the engine fallback icon value if the property doesn't exist (see + * [ThemeDB.fallbackIcon]). Use [hasIcon] to check for existence. */ public fun getIcon(name: StringName, themeType: StringName): Texture2D? { TransferContext.writeArguments(STRING_NAME to name, STRING_NAME to themeType) @@ -124,8 +130,7 @@ public open class Theme : Resource() { } /** - * Returns `true` if the icon property defined by [name] and [themeType] exists. - * + * Returns `true` if the icon property defined by [param name] and [param theme_type] exists. * Returns `false` if it doesn't exist. Use [setIcon] to define it. */ public fun hasIcon(name: StringName, themeType: StringName): Boolean { @@ -135,9 +140,10 @@ public open class Theme : Resource() { } /** - * Renames the icon property defined by [oldName] and [themeType] to [name], if it exists. - * - * Fails if it doesn't exist, or if a similar property with the new name already exists. Use [hasIcon] to check for existence, and [clearIcon] to remove the existing property. + * Renames the icon property defined by [param old_name] and [param theme_type] to [param name], + * if it exists. + * Fails if it doesn't exist, or if a similar property with the new name already exists. Use + * [hasIcon] to check for existence, and [clearIcon] to remove the existing property. */ public fun renameIcon( oldName: StringName, @@ -149,8 +155,7 @@ public open class Theme : Resource() { } /** - * Removes the icon property defined by [name] and [themeType], if it exists. - * + * Removes the icon property defined by [param name] and [param theme_type], if it exists. * Fails if it doesn't exist. Use [hasIcon] to check for existence. */ public fun clearIcon(name: StringName, themeType: StringName): Unit { @@ -159,7 +164,8 @@ public open class Theme : Resource() { } /** - * Returns a list of names for icon properties defined with [themeType]. Use [getIconTypeList] to get a list of possible theme type names. + * Returns a list of names for icon properties defined with [param theme_type]. Use + * [getIconTypeList] to get a list of possible theme type names. */ public fun getIconList(themeType: String): PackedStringArray { TransferContext.writeArguments(STRING to themeType) @@ -168,7 +174,8 @@ public open class Theme : Resource() { } /** - * Returns a list of all unique theme type names for icon properties. Use [getTypeList] to get a list of all unique theme types. + * Returns a list of all unique theme type names for icon properties. Use [getTypeList] to get a + * list of all unique theme types. */ public fun getIconTypeList(): PackedStringArray { TransferContext.writeArguments() @@ -177,7 +184,8 @@ public open class Theme : Resource() { } /** - * Creates or changes the value of the [godot.StyleBox] property defined by [name] and [themeType]. Use [clearStylebox] to remove the property. + * Creates or changes the value of the [StyleBox] property defined by [param name] and [param + * theme_type]. Use [clearStylebox] to remove the property. */ public fun setStylebox( name: StringName, @@ -189,9 +197,9 @@ public open class Theme : Resource() { } /** - * Returns the [godot.StyleBox] property defined by [name] and [themeType], if it exists. - * - * Returns the engine fallback stylebox value if the property doesn't exist (see [godot.ThemeDB.fallbackStylebox]). Use [hasStylebox] to check for existence. + * Returns the [StyleBox] property defined by [param name] and [param theme_type], if it exists. + * Returns the engine fallback stylebox value if the property doesn't exist (see + * [ThemeDB.fallbackStylebox]). Use [hasStylebox] to check for existence. */ public fun getStylebox(name: StringName, themeType: StringName): StyleBox? { TransferContext.writeArguments(STRING_NAME to name, STRING_NAME to themeType) @@ -200,8 +208,8 @@ public open class Theme : Resource() { } /** - * Returns `true` if the [godot.StyleBox] property defined by [name] and [themeType] exists. - * + * Returns `true` if the [StyleBox] property defined by [param name] and [param theme_type] + * exists. * Returns `false` if it doesn't exist. Use [setStylebox] to define it. */ public fun hasStylebox(name: StringName, themeType: StringName): Boolean { @@ -211,9 +219,10 @@ public open class Theme : Resource() { } /** - * Renames the [godot.StyleBox] property defined by [oldName] and [themeType] to [name], if it exists. - * - * Fails if it doesn't exist, or if a similar property with the new name already exists. Use [hasStylebox] to check for existence, and [clearStylebox] to remove the existing property. + * Renames the [StyleBox] property defined by [param old_name] and [param theme_type] to [param + * name], if it exists. + * Fails if it doesn't exist, or if a similar property with the new name already exists. Use + * [hasStylebox] to check for existence, and [clearStylebox] to remove the existing property. */ public fun renameStylebox( oldName: StringName, @@ -225,8 +234,7 @@ public open class Theme : Resource() { } /** - * Removes the [godot.StyleBox] property defined by [name] and [themeType], if it exists. - * + * Removes the [StyleBox] property defined by [param name] and [param theme_type], if it exists. * Fails if it doesn't exist. Use [hasStylebox] to check for existence. */ public fun clearStylebox(name: StringName, themeType: StringName): Unit { @@ -235,7 +243,8 @@ public open class Theme : Resource() { } /** - * Returns a list of names for [godot.StyleBox] properties defined with [themeType]. Use [getStyleboxTypeList] to get a list of possible theme type names. + * Returns a list of names for [StyleBox] properties defined with [param theme_type]. Use + * [getStyleboxTypeList] to get a list of possible theme type names. */ public fun getStyleboxList(themeType: String): PackedStringArray { TransferContext.writeArguments(STRING to themeType) @@ -244,7 +253,8 @@ public open class Theme : Resource() { } /** - * Returns a list of all unique theme type names for [godot.StyleBox] properties. Use [getTypeList] to get a list of all unique theme types. + * Returns a list of all unique theme type names for [StyleBox] properties. Use [getTypeList] to + * get a list of all unique theme types. */ public fun getStyleboxTypeList(): PackedStringArray { TransferContext.writeArguments() @@ -253,7 +263,8 @@ public open class Theme : Resource() { } /** - * Creates or changes the value of the [godot.Font] property defined by [name] and [themeType]. Use [clearFont] to remove the property. + * Creates or changes the value of the [Font] property defined by [param name] and [param + * theme_type]. Use [clearFont] to remove the property. */ public fun setFont( name: StringName, @@ -265,11 +276,11 @@ public open class Theme : Resource() { } /** - * Returns the [godot.Font] property defined by [name] and [themeType], if it exists. - * - * Returns the default theme font if the property doesn't exist and the default theme font is set up (see [defaultFont]). Use [hasFont] to check for existence of the property and [hasDefaultFont] to check for existence of the default theme font. - * - * Returns the engine fallback font value, if neither exist (see [godot.ThemeDB.fallbackFont]). + * Returns the [Font] property defined by [param name] and [param theme_type], if it exists. + * Returns the default theme font if the property doesn't exist and the default theme font is set + * up (see [defaultFont]). Use [hasFont] to check for existence of the property and [hasDefaultFont] + * to check for existence of the default theme font. + * Returns the engine fallback font value, if neither exist (see [ThemeDB.fallbackFont]). */ public fun getFont(name: StringName, themeType: StringName): Font? { TransferContext.writeArguments(STRING_NAME to name, STRING_NAME to themeType) @@ -278,8 +289,8 @@ public open class Theme : Resource() { } /** - * Returns `true` if the [godot.Font] property defined by [name] and [themeType] exists, or if the default theme font is set up (see [hasDefaultFont]). - * + * Returns `true` if the [Font] property defined by [param name] and [param theme_type] exists, or + * if the default theme font is set up (see [hasDefaultFont]). * Returns `false` if neither exist. Use [setFont] to define the property. */ public fun hasFont(name: StringName, themeType: StringName): Boolean { @@ -289,9 +300,10 @@ public open class Theme : Resource() { } /** - * Renames the [godot.Font] property defined by [oldName] and [themeType] to [name], if it exists. - * - * Fails if it doesn't exist, or if a similar property with the new name already exists. Use [hasFont] to check for existence, and [clearFont] to remove the existing property. + * Renames the [Font] property defined by [param old_name] and [param theme_type] to [param name], + * if it exists. + * Fails if it doesn't exist, or if a similar property with the new name already exists. Use + * [hasFont] to check for existence, and [clearFont] to remove the existing property. */ public fun renameFont( oldName: StringName, @@ -303,8 +315,7 @@ public open class Theme : Resource() { } /** - * Removes the [godot.Font] property defined by [name] and [themeType], if it exists. - * + * Removes the [Font] property defined by [param name] and [param theme_type], if it exists. * Fails if it doesn't exist. Use [hasFont] to check for existence. */ public fun clearFont(name: StringName, themeType: StringName): Unit { @@ -313,7 +324,8 @@ public open class Theme : Resource() { } /** - * Returns a list of names for [godot.Font] properties defined with [themeType]. Use [getFontTypeList] to get a list of possible theme type names. + * Returns a list of names for [Font] properties defined with [param theme_type]. Use + * [getFontTypeList] to get a list of possible theme type names. */ public fun getFontList(themeType: String): PackedStringArray { TransferContext.writeArguments(STRING to themeType) @@ -322,7 +334,8 @@ public open class Theme : Resource() { } /** - * Returns a list of all unique theme type names for [godot.Font] properties. Use [getTypeList] to get a list of all unique theme types. + * Returns a list of all unique theme type names for [Font] properties. Use [getTypeList] to get a + * list of all unique theme types. */ public fun getFontTypeList(): PackedStringArray { TransferContext.writeArguments() @@ -331,7 +344,8 @@ public open class Theme : Resource() { } /** - * Creates or changes the value of the font size property defined by [name] and [themeType]. Use [clearFontSize] to remove the property. + * Creates or changes the value of the font size property defined by [param name] and [param + * theme_type]. Use [clearFontSize] to remove the property. */ public fun setFontSize( name: StringName, @@ -343,11 +357,11 @@ public open class Theme : Resource() { } /** - * Returns the font size property defined by [name] and [themeType], if it exists. - * - * Returns the default theme font size if the property doesn't exist and the default theme font size is set up (see [defaultFontSize]). Use [hasFontSize] to check for existence of the property and [hasDefaultFontSize] to check for existence of the default theme font. - * - * Returns the engine fallback font size value, if neither exist (see [godot.ThemeDB.fallbackFontSize]). + * Returns the font size property defined by [param name] and [param theme_type], if it exists. + * Returns the default theme font size if the property doesn't exist and the default theme font + * size is set up (see [defaultFontSize]). Use [hasFontSize] to check for existence of the property + * and [hasDefaultFontSize] to check for existence of the default theme font. + * Returns the engine fallback font size value, if neither exist (see [ThemeDB.fallbackFontSize]). */ public fun getFontSize(name: StringName, themeType: StringName): Int { TransferContext.writeArguments(STRING_NAME to name, STRING_NAME to themeType) @@ -356,8 +370,8 @@ public open class Theme : Resource() { } /** - * Returns `true` if the font size property defined by [name] and [themeType] exists, or if the default theme font size is set up (see [hasDefaultFontSize]). - * + * Returns `true` if the font size property defined by [param name] and [param theme_type] exists, + * or if the default theme font size is set up (see [hasDefaultFontSize]). * Returns `false` if neither exist. Use [setFontSize] to define the property. */ public fun hasFontSize(name: StringName, themeType: StringName): Boolean { @@ -367,9 +381,10 @@ public open class Theme : Resource() { } /** - * Renames the font size property defined by [oldName] and [themeType] to [name], if it exists. - * - * Fails if it doesn't exist, or if a similar property with the new name already exists. Use [hasFontSize] to check for existence, and [clearFontSize] to remove the existing property. + * Renames the font size property defined by [param old_name] and [param theme_type] to [param + * name], if it exists. + * Fails if it doesn't exist, or if a similar property with the new name already exists. Use + * [hasFontSize] to check for existence, and [clearFontSize] to remove the existing property. */ public fun renameFontSize( oldName: StringName, @@ -381,8 +396,7 @@ public open class Theme : Resource() { } /** - * Removes the font size property defined by [name] and [themeType], if it exists. - * + * Removes the font size property defined by [param name] and [param theme_type], if it exists. * Fails if it doesn't exist. Use [hasFontSize] to check for existence. */ public fun clearFontSize(name: StringName, themeType: StringName): Unit { @@ -391,7 +405,8 @@ public open class Theme : Resource() { } /** - * Returns a list of names for font size properties defined with [themeType]. Use [getFontSizeTypeList] to get a list of possible theme type names. + * Returns a list of names for font size properties defined with [param theme_type]. Use + * [getFontSizeTypeList] to get a list of possible theme type names. */ public fun getFontSizeList(themeType: String): PackedStringArray { TransferContext.writeArguments(STRING to themeType) @@ -400,7 +415,8 @@ public open class Theme : Resource() { } /** - * Returns a list of all unique theme type names for font size properties. Use [getTypeList] to get a list of all unique theme types. + * Returns a list of all unique theme type names for font size properties. Use [getTypeList] to + * get a list of all unique theme types. */ public fun getFontSizeTypeList(): PackedStringArray { TransferContext.writeArguments() @@ -409,7 +425,8 @@ public open class Theme : Resource() { } /** - * Creates or changes the value of the [godot.core.Color] property defined by [name] and [themeType]. Use [clearColor] to remove the property. + * Creates or changes the value of the [Color] property defined by [param name] and [param + * theme_type]. Use [clearColor] to remove the property. */ public fun setColor( name: StringName, @@ -421,9 +438,9 @@ public open class Theme : Resource() { } /** - * Returns the [godot.core.Color] property defined by [name] and [themeType], if it exists. - * - * Returns the default color value if the property doesn't exist. Use [hasColor] to check for existence. + * Returns the [Color] property defined by [param name] and [param theme_type], if it exists. + * Returns the default color value if the property doesn't exist. Use [hasColor] to check for + * existence. */ public fun getColor(name: StringName, themeType: StringName): Color { TransferContext.writeArguments(STRING_NAME to name, STRING_NAME to themeType) @@ -432,8 +449,7 @@ public open class Theme : Resource() { } /** - * Returns `true` if the [godot.core.Color] property defined by [name] and [themeType] exists. - * + * Returns `true` if the [Color] property defined by [param name] and [param theme_type] exists. * Returns `false` if it doesn't exist. Use [setColor] to define it. */ public fun hasColor(name: StringName, themeType: StringName): Boolean { @@ -443,9 +459,10 @@ public open class Theme : Resource() { } /** - * Renames the [godot.core.Color] property defined by [oldName] and [themeType] to [name], if it exists. - * - * Fails if it doesn't exist, or if a similar property with the new name already exists. Use [hasColor] to check for existence, and [clearColor] to remove the existing property. + * Renames the [Color] property defined by [param old_name] and [param theme_type] to [param + * name], if it exists. + * Fails if it doesn't exist, or if a similar property with the new name already exists. Use + * [hasColor] to check for existence, and [clearColor] to remove the existing property. */ public fun renameColor( oldName: StringName, @@ -457,8 +474,7 @@ public open class Theme : Resource() { } /** - * Removes the [godot.core.Color] property defined by [name] and [themeType], if it exists. - * + * Removes the [Color] property defined by [param name] and [param theme_type], if it exists. * Fails if it doesn't exist. Use [hasColor] to check for existence. */ public fun clearColor(name: StringName, themeType: StringName): Unit { @@ -467,7 +483,8 @@ public open class Theme : Resource() { } /** - * Returns a list of names for [godot.core.Color] properties defined with [themeType]. Use [getColorTypeList] to get a list of possible theme type names. + * Returns a list of names for [Color] properties defined with [param theme_type]. Use + * [getColorTypeList] to get a list of possible theme type names. */ public fun getColorList(themeType: String): PackedStringArray { TransferContext.writeArguments(STRING to themeType) @@ -476,7 +493,8 @@ public open class Theme : Resource() { } /** - * Returns a list of all unique theme type names for [godot.core.Color] properties. Use [getTypeList] to get a list of all unique theme types. + * Returns a list of all unique theme type names for [Color] properties. Use [getTypeList] to get + * a list of all unique theme types. */ public fun getColorTypeList(): PackedStringArray { TransferContext.writeArguments() @@ -485,7 +503,8 @@ public open class Theme : Resource() { } /** - * Creates or changes the value of the constant property defined by [name] and [themeType]. Use [clearConstant] to remove the property. + * Creates or changes the value of the constant property defined by [param name] and [param + * theme_type]. Use [clearConstant] to remove the property. */ public fun setConstant( name: StringName, @@ -497,8 +516,7 @@ public open class Theme : Resource() { } /** - * Returns the constant property defined by [name] and [themeType], if it exists. - * + * Returns the constant property defined by [param name] and [param theme_type], if it exists. * Returns `0` if the property doesn't exist. Use [hasConstant] to check for existence. */ public fun getConstant(name: StringName, themeType: StringName): Int { @@ -508,8 +526,7 @@ public open class Theme : Resource() { } /** - * Returns `true` if the constant property defined by [name] and [themeType] exists. - * + * Returns `true` if the constant property defined by [param name] and [param theme_type] exists. * Returns `false` if it doesn't exist. Use [setConstant] to define it. */ public fun hasConstant(name: StringName, themeType: StringName): Boolean { @@ -519,9 +536,10 @@ public open class Theme : Resource() { } /** - * Renames the constant property defined by [oldName] and [themeType] to [name], if it exists. - * - * Fails if it doesn't exist, or if a similar property with the new name already exists. Use [hasConstant] to check for existence, and [clearConstant] to remove the existing property. + * Renames the constant property defined by [param old_name] and [param theme_type] to [param + * name], if it exists. + * Fails if it doesn't exist, or if a similar property with the new name already exists. Use + * [hasConstant] to check for existence, and [clearConstant] to remove the existing property. */ public fun renameConstant( oldName: StringName, @@ -533,8 +551,7 @@ public open class Theme : Resource() { } /** - * Removes the constant property defined by [name] and [themeType], if it exists. - * + * Removes the constant property defined by [param name] and [param theme_type], if it exists. * Fails if it doesn't exist. Use [hasConstant] to check for existence. */ public fun clearConstant(name: StringName, themeType: StringName): Unit { @@ -543,7 +560,8 @@ public open class Theme : Resource() { } /** - * Returns a list of names for constant properties defined with [themeType]. Use [getConstantTypeList] to get a list of possible theme type names. + * Returns a list of names for constant properties defined with [param theme_type]. Use + * [getConstantTypeList] to get a list of possible theme type names. */ public fun getConstantList(themeType: String): PackedStringArray { TransferContext.writeArguments(STRING to themeType) @@ -552,7 +570,8 @@ public open class Theme : Resource() { } /** - * Returns a list of all unique theme type names for constant properties. Use [getTypeList] to get a list of all unique theme types. + * Returns a list of all unique theme type names for constant properties. Use [getTypeList] to get + * a list of all unique theme types. */ public fun getConstantTypeList(): PackedStringArray { TransferContext.writeArguments() @@ -562,7 +581,6 @@ public open class Theme : Resource() { /** * Returns `true` if [defaultBaseScale] has a valid value. - * * Returns `false` if it doesn't. The value must be greater than `0.0` to be considered valid. */ public fun hasDefaultBaseScale(): Boolean { @@ -573,7 +591,6 @@ public open class Theme : Resource() { /** * Returns `true` if [defaultFont] has a valid value. - * * Returns `false` if it doesn't. */ public fun hasDefaultFont(): Boolean { @@ -584,7 +601,6 @@ public open class Theme : Resource() { /** * Returns `true` if [defaultFontSize] has a valid value. - * * Returns `false` if it doesn't. The value must be greater than `0` to be considered valid. */ public fun hasDefaultFontSize(): Boolean { @@ -594,11 +610,11 @@ public open class Theme : Resource() { } /** - * Creates or changes the value of the theme property of [dataType] defined by [name] and [themeType]. Use [clearThemeItem] to remove the property. - * - * Fails if the [value] type is not accepted by [dataType]. - * - * **Note:** This method is analogous to calling the corresponding data type specific method, but can be used for more generalized logic. + * Creates or changes the value of the theme property of [param data_type] defined by [param name] + * and [param theme_type]. Use [clearThemeItem] to remove the property. + * Fails if the [param value] type is not accepted by [param data_type]. + * **Note:** This method is analogous to calling the corresponding data type specific method, but + * can be used for more generalized logic. */ public fun setThemeItem( dataType: DataType, @@ -611,11 +627,12 @@ public open class Theme : Resource() { } /** - * Returns the theme property of [dataType] defined by [name] and [themeType], if it exists. - * - * Returns the engine fallback value if the property doesn't exist (see [godot.ThemeDB]). Use [hasThemeItem] to check for existence. - * - * **Note:** This method is analogous to calling the corresponding data type specific method, but can be used for more generalized logic. + * Returns the theme property of [param data_type] defined by [param name] and [param theme_type], + * if it exists. + * Returns the engine fallback value if the property doesn't exist (see [ThemeDB]). Use + * [hasThemeItem] to check for existence. + * **Note:** This method is analogous to calling the corresponding data type specific method, but + * can be used for more generalized logic. */ public fun getThemeItem( dataType: DataType, @@ -628,11 +645,11 @@ public open class Theme : Resource() { } /** - * Returns `true` if the theme property of [dataType] defined by [name] and [themeType] exists. - * + * Returns `true` if the theme property of [param data_type] defined by [param name] and [param + * theme_type] exists. * Returns `false` if it doesn't exist. Use [setThemeItem] to define it. - * - * **Note:** This method is analogous to calling the corresponding data type specific method, but can be used for more generalized logic. + * **Note:** This method is analogous to calling the corresponding data type specific method, but + * can be used for more generalized logic. */ public fun hasThemeItem( dataType: DataType, @@ -645,11 +662,12 @@ public open class Theme : Resource() { } /** - * Renames the theme property of [dataType] defined by [oldName] and [themeType] to [name], if it exists. - * - * Fails if it doesn't exist, or if a similar property with the new name already exists. Use [hasThemeItem] to check for existence, and [clearThemeItem] to remove the existing property. - * - * **Note:** This method is analogous to calling the corresponding data type specific method, but can be used for more generalized logic. + * Renames the theme property of [param data_type] defined by [param old_name] and [param + * theme_type] to [param name], if it exists. + * Fails if it doesn't exist, or if a similar property with the new name already exists. Use + * [hasThemeItem] to check for existence, and [clearThemeItem] to remove the existing property. + * **Note:** This method is analogous to calling the corresponding data type specific method, but + * can be used for more generalized logic. */ public fun renameThemeItem( dataType: DataType, @@ -662,11 +680,11 @@ public open class Theme : Resource() { } /** - * Removes the theme property of [dataType] defined by [name] and [themeType], if it exists. - * + * Removes the theme property of [param data_type] defined by [param name] and [param theme_type], + * if it exists. * Fails if it doesn't exist. Use [hasThemeItem] to check for existence. - * - * **Note:** This method is analogous to calling the corresponding data type specific method, but can be used for more generalized logic. + * **Note:** This method is analogous to calling the corresponding data type specific method, but + * can be used for more generalized logic. */ public fun clearThemeItem( dataType: DataType, @@ -678,9 +696,10 @@ public open class Theme : Resource() { } /** - * Returns a list of names for properties of [dataType] defined with [themeType]. Use [getThemeItemTypeList] to get a list of possible theme type names. - * - * **Note:** This method is analogous to calling the corresponding data type specific method, but can be used for more generalized logic. + * Returns a list of names for properties of [param data_type] defined with [param theme_type]. + * Use [getThemeItemTypeList] to get a list of possible theme type names. + * **Note:** This method is analogous to calling the corresponding data type specific method, but + * can be used for more generalized logic. */ public fun getThemeItemList(dataType: DataType, themeType: String): PackedStringArray { TransferContext.writeArguments(LONG to dataType.id, STRING to themeType) @@ -689,9 +708,10 @@ public open class Theme : Resource() { } /** - * Returns a list of all unique theme type names for [dataType] properties. Use [getTypeList] to get a list of all unique theme types. - * - * **Note:** This method is analogous to calling the corresponding data type specific method, but can be used for more generalized logic. + * Returns a list of all unique theme type names for [param data_type] properties. Use + * [getTypeList] to get a list of all unique theme types. + * **Note:** This method is analogous to calling the corresponding data type specific method, but + * can be used for more generalized logic. */ public fun getThemeItemTypeList(dataType: DataType): PackedStringArray { TransferContext.writeArguments(LONG to dataType.id) @@ -700,13 +720,14 @@ public open class Theme : Resource() { } /** - * Marks [themeType] as a variation of [baseType]. - * - * This adds [themeType] as a suggested option for [godot.Control.themeTypeVariation] on a [godot.Control] that is of the [baseType] class. - * - * Variations can also be nested, i.e. [baseType] can be another variation. If a chain of variations ends with a [baseType] matching the class of the [godot.Control], the whole chain is going to be suggested as options. - * - * **Note:** Suggestions only show up if this theme resource is set as the project default theme. See [godot.ProjectSettings.gui/theme/custom]. + * Marks [param theme_type] as a variation of [param base_type]. + * This adds [param theme_type] as a suggested option for [Control.themeTypeVariation] on a + * [Control] that is of the [param base_type] class. + * Variations can also be nested, i.e. [param base_type] can be another variation. If a chain of + * variations ends with a [param base_type] matching the class of the [Control], the whole chain is + * going to be suggested as options. + * **Note:** Suggestions only show up if this theme resource is set as the project default theme. + * See [ProjectSettings.gui/theme/custom]. */ public fun setTypeVariation(themeType: StringName, baseType: StringName): Unit { TransferContext.writeArguments(STRING_NAME to themeType, STRING_NAME to baseType) @@ -714,7 +735,7 @@ public open class Theme : Resource() { } /** - * Returns `true` if [themeType] is marked as a variation of [baseType]. + * Returns `true` if [param theme_type] is marked as a variation of [param base_type]. */ public fun isTypeVariation(themeType: StringName, baseType: StringName): Boolean { TransferContext.writeArguments(STRING_NAME to themeType, STRING_NAME to baseType) @@ -723,7 +744,7 @@ public open class Theme : Resource() { } /** - * Unmarks [themeType] as being a variation of another theme type. See [setTypeVariation]. + * Unmarks [param theme_type] as being a variation of another theme type. See [setTypeVariation]. */ public fun clearTypeVariation(themeType: StringName): Unit { TransferContext.writeArguments(STRING_NAME to themeType) @@ -731,7 +752,8 @@ public open class Theme : Resource() { } /** - * Returns the name of the base theme type if [themeType] is a valid variation type. Returns an empty string otherwise. + * Returns the name of the base theme type if [param theme_type] is a valid variation type. + * Returns an empty string otherwise. */ public fun getTypeVariationBase(themeType: StringName): StringName { TransferContext.writeArguments(STRING_NAME to themeType) @@ -740,7 +762,7 @@ public open class Theme : Resource() { } /** - * Returns a list of all type variations for the given [baseType]. + * Returns a list of all type variations for the given [param base_type]. */ public fun getTypeVariationList(baseType: StringName): PackedStringArray { TransferContext.writeArguments(STRING_NAME to baseType) @@ -750,8 +772,8 @@ public open class Theme : Resource() { /** * Adds an empty theme type for every valid data type. - * - * **Note:** Empty types are not saved with the theme. This method only exists to perform in-memory changes to the resource. Use available `set_*` methods to add theme items. + * **Note:** Empty types are not saved with the theme. This method only exists to perform + * in-memory changes to the resource. Use available `set_*` methods to add theme items. */ public fun addType(themeType: StringName): Unit { TransferContext.writeArguments(STRING_NAME to themeType) @@ -759,7 +781,9 @@ public open class Theme : Resource() { } /** - * Removes the theme type, gracefully discarding defined theme items. If the type is a variation, this information is also erased. If the type is a base for type variations, those variations lose their base. + * Removes the theme type, gracefully discarding defined theme items. If the type is a variation, + * this information is also erased. If the type is a base for type variations, those variations lose + * their base. */ public fun removeType(themeType: StringName): Unit { TransferContext.writeArguments(STRING_NAME to themeType) @@ -767,7 +791,8 @@ public open class Theme : Resource() { } /** - * Returns a list of all unique theme type names. Use the appropriate `get_*_type_list` method to get a list of unique theme types for a single data type. + * Returns a list of all unique theme type names. Use the appropriate `get_*_type_list` method to + * get a list of unique theme types for a single data type. */ public fun getTypeList(): PackedStringArray { TransferContext.writeArguments() @@ -776,9 +801,10 @@ public open class Theme : Resource() { } /** - * Adds missing and overrides existing definitions with values from the [other] theme resource. - * - * **Note:** This modifies the current theme. If you want to merge two themes together without modifying either one, create a new empty theme and merge the other two into it one after another. + * Adds missing and overrides existing definitions with values from the [param other] theme + * resource. + * **Note:** This modifies the current theme. If you want to merge two themes together without + * modifying either one, create a new empty theme and merge the other two into it one after another. */ public fun mergeWith(other: Theme): Unit { TransferContext.writeArguments(OBJECT to other) @@ -797,7 +823,7 @@ public open class Theme : Resource() { id: Long, ) { /** - * Theme's [godot.core.Color] item type. + * Theme's [Color] item type. */ DATA_TYPE_COLOR(0), /** @@ -805,7 +831,7 @@ public open class Theme : Resource() { */ DATA_TYPE_CONSTANT(1), /** - * Theme's [godot.Font] item type. + * Theme's [Font] item type. */ DATA_TYPE_FONT(2), /** @@ -813,11 +839,11 @@ public open class Theme : Resource() { */ DATA_TYPE_FONT_SIZE(3), /** - * Theme's icon [godot.Texture2D] item type. + * Theme's icon [Texture2D] item type. */ DATA_TYPE_ICON(4), /** - * Theme's [godot.StyleBox] item type. + * Theme's [StyleBox] item type. */ DATA_TYPE_STYLEBOX(5), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ThemeDB.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ThemeDB.kt index 3e03018c0..3674b0a3b 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ThemeDB.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ThemeDB.kt @@ -25,16 +25,16 @@ import kotlin.Suppress import kotlin.Unit /** - * A singleton that provides access to static information about [godot.Theme] resources used by the engine and by your project. - * - * This singleton provides access to static information about [godot.Theme] resources used by the engine and by your projects. You can fetch the default engine theme, as well as your project configured theme. - * - * [godot.ThemeDB] also contains fallback values for theme properties. + * This singleton provides access to static information about [Theme] resources used by the engine + * and by your projects. You can fetch the default engine theme, as well as your project configured + * theme. + * [ThemeDB] also contains fallback values for theme properties. */ @GodotBaseType public object ThemeDB : Object() { /** - * Emitted when one of the fallback values had been changed. Use it to refresh the look of controls that may rely on the fallback theme items. + * Emitted when one of the fallback values had been changed. Use it to refresh the look of + * controls that may rely on the fallback theme items. */ public val fallbackChanged: Signal0 by signal() @@ -44,7 +44,8 @@ public object ThemeDB : Object() { } /** - * Returns a reference to the default engine [godot.Theme]. This theme resource is responsible for the out-of-the-box look of [godot.Control] nodes and cannot be overridden. + * Returns a reference to the default engine [Theme]. This theme resource is responsible for the + * out-of-the-box look of [Control] nodes and cannot be overridden. */ public fun getDefaultTheme(): Theme? { TransferContext.writeArguments() @@ -53,9 +54,9 @@ public object ThemeDB : Object() { } /** - * Returns a reference to the custom project [godot.Theme]. This theme resources allows to override the default engine theme for every control node in the project. - * - * To set the project theme, see [godot.ProjectSettings.gui/theme/custom]. + * Returns a reference to the custom project [Theme]. This theme resources allows to override the + * default engine theme for every control node in the project. + * To set the project theme, see [ProjectSettings.gui/theme/custom]. */ public fun getProjectTheme(): Theme? { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Thread.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Thread.kt index 455c518f7..56b39cfcd 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Thread.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Thread.kt @@ -28,21 +28,13 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * A unit of execution in a process. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/676](https://godotengine.org/asset-library/asset/676) - * - * A unit of execution in a process. Can run methods on [godot.Object]s simultaneously. The use of synchronization via [godot.Mutex] or [godot.Semaphore] is advised if working with shared objects. - * + * A unit of execution in a process. Can run methods on [Object]s simultaneously. The use of + * synchronization via [Mutex] or [Semaphore] is advised if working with shared objects. * **Warning:** - * - * To ensure proper cleanup without crashes or deadlocks, when a [godot.Thread]'s reference count reaches zero and it is therefore destroyed, the following conditions must be met: - * - * - It must not have any [godot.Mutex] objects locked. - * - * - It must not be waiting on any [godot.Semaphore] objects. - * + * To ensure proper cleanup without crashes or deadlocks, when a [Thread]'s reference count reaches + * zero and it is therefore destroyed, the following conditions must be met: + * - It must not have any [Mutex] objects locked. + * - It must not be waiting on any [Semaphore] objects. * - [waitToFinish] should have been called on it. */ @GodotBaseType @@ -53,13 +45,11 @@ public open class Thread : RefCounted() { } /** - * Starts a new [godot.Thread] that calls [callable]. - * - * If the method takes some arguments, you can pass them using [godot.Callable.bind]. - * - * The [priority] of the [godot.Thread] can be changed by passing a value from the [enum Priority] enum. - * - * Returns [OK] on success, or [ERR_CANT_CREATE] on failure. + * Starts a new [Thread] that calls [param callable]. + * If the method takes some arguments, you can pass them using [Callable.bind]. + * The [param priority] of the [Thread] can be changed by passing a value from the [enum Priority] + * enum. + * Returns [constant OK] on success, or [constant ERR_CANT_CREATE] on failure. */ @JvmOverloads public fun start(callable: Callable, priority: Priority = Thread.Priority.PRIORITY_NORMAL): @@ -70,7 +60,8 @@ public open class Thread : RefCounted() { } /** - * Returns the current [godot.Thread]'s ID, uniquely identifying it among all threads. If the [godot.Thread] has not started running or if [waitToFinish] has been called, this returns an empty string. + * Returns the current [Thread]'s ID, uniquely identifying it among all threads. If the [Thread] + * has not started running or if [waitToFinish] has been called, this returns an empty string. */ public fun getId(): String { TransferContext.writeArguments() @@ -79,7 +70,9 @@ public open class Thread : RefCounted() { } /** - * Returns `true` if this [godot.Thread] has been started. Once started, this will return `true` until it is joined using [waitToFinish]. For checking if a [godot.Thread] is still executing its task, use [isAlive]. + * Returns `true` if this [Thread] has been started. Once started, this will return `true` until + * it is joined using [waitToFinish]. For checking if a [Thread] is still executing its task, use + * [isAlive]. */ public fun isStarted(): Boolean { TransferContext.writeArguments() @@ -88,9 +81,9 @@ public open class Thread : RefCounted() { } /** - * Returns `true` if this [godot.Thread] is currently running the provided function. This is useful for determining if [waitToFinish] can be called without blocking the calling thread. - * - * To check if a [godot.Thread] is joinable, use [isStarted]. + * Returns `true` if this [Thread] is currently running the provided function. This is useful for + * determining if [waitToFinish] can be called without blocking the calling thread. + * To check if a [Thread] is joinable, use [isStarted]. */ public fun isAlive(): Boolean { TransferContext.writeArguments() @@ -99,11 +92,12 @@ public open class Thread : RefCounted() { } /** - * Joins the [godot.Thread] and waits for it to finish. Returns the output of the [godot.Callable] passed to [start]. - * - * Should either be used when you want to retrieve the value returned from the method called by the [godot.Thread] or before freeing the instance that contains the [godot.Thread]. - * - * To determine if this can be called without blocking the calling thread, check if [isAlive] is `false`. + * Joins the [Thread] and waits for it to finish. Returns the output of the [Callable] passed to + * [start]. + * Should either be used when you want to retrieve the value returned from the method called by + * the [Thread] or before freeing the instance that contains the [Thread]. + * To determine if this can be called without blocking the calling thread, check if [isAlive] is + * `false`. */ public fun waitToFinish(): Any? { TransferContext.writeArguments() @@ -140,19 +134,23 @@ public open class Thread : RefCounted() { public companion object { /** - * Sets whether the thread safety checks the engine normally performs in methods of certain classes (e.g., [godot.Node]) should happen **on the current thread**. - * - * The default, for every thread, is that they are enabled (as if called with [enabled] being `true`). - * - * Those checks are conservative. That means that they will only succeed in considering a call thread-safe (and therefore allow it to happen) if the engine can guarantee such safety. - * - * Because of that, there may be cases where the user may want to disable them ([enabled] being `false`) to make certain operations allowed again. By doing so, it becomes the user's responsibility to ensure thread safety (e.g., by using [godot.Mutex]) for those objects that are otherwise protected by the engine. - * - * **Note:** This is an advanced usage of the engine. You are advised to use it only if you know what you are doing and there is no safer way. - * - * **Note:** This is useful for scripts running on either arbitrary [godot.Thread] objects or tasks submitted to the [godot.WorkerThreadPool]. It doesn't apply to code running during [godot.Node] group processing, where the checks will be always performed. - * - * **Note:** Even in the case of having disabled the checks in a [godot.WorkerThreadPool] task, there's no need to re-enable them at the end. The engine will do so. + * Sets whether the thread safety checks the engine normally performs in methods of certain + * classes (e.g., [Node]) should happen **on the current thread**. + * The default, for every thread, is that they are enabled (as if called with [param enabled] + * being `true`). + * Those checks are conservative. That means that they will only succeed in considering a call + * thread-safe (and therefore allow it to happen) if the engine can guarantee such safety. + * Because of that, there may be cases where the user may want to disable them ([param enabled] + * being `false`) to make certain operations allowed again. By doing so, it becomes the user's + * responsibility to ensure thread safety (e.g., by using [Mutex]) for those objects that are + * otherwise protected by the engine. + * **Note:** This is an advanced usage of the engine. You are advised to use it only if you know + * what you are doing and there is no safer way. + * **Note:** This is useful for scripts running on either arbitrary [Thread] objects or tasks + * submitted to the [WorkerThreadPool]. It doesn't apply to code running during [Node] group + * processing, where the checks will be always performed. + * **Note:** Even in the case of having disabled the checks in a [WorkerThreadPool] task, + * there's no need to re-enable them at the end. The engine will do so. */ public fun setThreadSafetyChecksEnabled(enabled: Boolean): Unit { TransferContext.writeArguments(BOOL to enabled) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/TileData.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/TileData.kt index e804916d0..129719669 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/TileData.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/TileData.kt @@ -40,9 +40,8 @@ import kotlin.Suppress import kotlin.Unit /** - * Settings for a single tile in a [godot.TileSet]. - * - * [godot.TileData] object represents a single tile in a [godot.TileSet]. It is usually edited using the tileset editor, but it can be modified at runtime using [godot.TileMap.TileDataRuntimeUpdate]. + * [TileData] object represents a single tile in a [TileSet]. It is usually edited using the tileset + * editor, but it can be modified at runtime using [TileMap.TileDataRuntimeUpdate]. */ @GodotBaseType public open class TileData : Object() { @@ -80,7 +79,8 @@ public open class TileData : Object() { } /** - * If `true`, the tile will display transposed, i.e. with horizontal and vertical texture UVs swapped. + * If `true`, the tile will display transposed, i.e. with horizontal and vertical texture UVs + * swapped. */ public var transpose: Boolean get() { @@ -124,7 +124,8 @@ public open class TileData : Object() { } /** - * The [godot.Material] to use for this [godot.TileData]. This can be a [godot.CanvasItemMaterial] to use the default shader, or a [godot.ShaderMaterial] to use a custom shader. + * The [Material] to use for this [TileData]. This can be a [CanvasItemMaterial] to use the + * default shader, or a [ShaderMaterial] to use a custom shader. */ public var material: Material? get() { @@ -138,7 +139,7 @@ public open class TileData : Object() { } /** - * Ordering index of this tile, relative to [godot.TileMap]. + * Ordering index of this tile, relative to [TileMap]. */ public var zIndex: Int get() { @@ -261,7 +262,7 @@ public open class TileData : Object() { /** - * Sets the occluder for the TileSet occlusion layer with index [layerId]. + * Sets the occluder for the TileSet occlusion layer with index [param layer_id]. */ public fun setOccluder(layerId: Int, occluderPolygon: OccluderPolygon2D): Unit { TransferContext.writeArguments(LONG to layerId.toLong(), OBJECT to occluderPolygon) @@ -269,7 +270,8 @@ public open class TileData : Object() { } /** - * Returns the occluder polygon of the tile for the TileSet occlusion layer with index [layerId]. + * Returns the occluder polygon of the tile for the TileSet occlusion layer with index [param + * layer_id]. */ public fun getOccluder(layerId: Int): OccluderPolygon2D? { TransferContext.writeArguments(LONG to layerId.toLong()) @@ -278,7 +280,8 @@ public open class TileData : Object() { } /** - * Sets the constant linear velocity. This does not move the tile. This linear velocity is applied to objects colliding with this tile. This is useful to create conveyor belts. + * Sets the constant linear velocity. This does not move the tile. This linear velocity is applied + * to objects colliding with this tile. This is useful to create conveyor belts. */ public fun setConstantLinearVelocity(layerId: Int, velocity: Vector2): Unit { TransferContext.writeArguments(LONG to layerId.toLong(), VECTOR2 to velocity) @@ -295,7 +298,8 @@ public open class TileData : Object() { } /** - * Sets the constant angular velocity. This does not rotate the tile. This angular velocity is applied to objects colliding with this tile. + * Sets the constant angular velocity. This does not rotate the tile. This angular velocity is + * applied to objects colliding with this tile. */ public fun setConstantAngularVelocity(layerId: Int, velocity: Float): Unit { TransferContext.writeArguments(LONG to layerId.toLong(), DOUBLE to velocity.toDouble()) @@ -312,7 +316,7 @@ public open class TileData : Object() { } /** - * Sets the polygons count for TileSet physics layer with index [layerId]. + * Sets the polygons count for TileSet physics layer with index [param layer_id]. */ public fun setCollisionPolygonsCount(layerId: Int, polygonsCount: Int): Unit { TransferContext.writeArguments(LONG to layerId.toLong(), LONG to polygonsCount.toLong()) @@ -320,7 +324,7 @@ public open class TileData : Object() { } /** - * Returns how many polygons the tile has for TileSet physics layer with index [layerId]. + * Returns how many polygons the tile has for TileSet physics layer with index [param layer_id]. */ public fun getCollisionPolygonsCount(layerId: Int): Int { TransferContext.writeArguments(LONG to layerId.toLong()) @@ -337,7 +341,8 @@ public open class TileData : Object() { } /** - * Removes the polygon at index [polygonIndex] for TileSet physics layer with index [layerId]. + * Removes the polygon at index [param polygon_index] for TileSet physics layer with index [param + * layer_id]. */ public fun removeCollisionPolygon(layerId: Int, polygonIndex: Int): Unit { TransferContext.writeArguments(LONG to layerId.toLong(), LONG to polygonIndex.toLong()) @@ -345,7 +350,8 @@ public open class TileData : Object() { } /** - * Sets the points of the polygon at index [polygonIndex] for TileSet physics layer with index [layerId]. + * Sets the points of the polygon at index [param polygon_index] for TileSet physics layer with + * index [param layer_id]. */ public fun setCollisionPolygonPoints( layerId: Int, @@ -357,7 +363,8 @@ public open class TileData : Object() { } /** - * Returns the points of the polygon at index [polygonIndex] for TileSet physics layer with index [layerId]. + * Returns the points of the polygon at index [param polygon_index] for TileSet physics layer with + * index [param layer_id]. */ public fun getCollisionPolygonPoints(layerId: Int, polygonIndex: Int): PackedVector2Array { TransferContext.writeArguments(LONG to layerId.toLong(), LONG to polygonIndex.toLong()) @@ -367,7 +374,8 @@ public open class TileData : Object() { } /** - * Enables/disables one-way collisions on the polygon at index [polygonIndex] for TileSet physics layer with index [layerId]. + * Enables/disables one-way collisions on the polygon at index [param polygon_index] for TileSet + * physics layer with index [param layer_id]. */ public fun setCollisionPolygonOneWay( layerId: Int, @@ -379,7 +387,8 @@ public open class TileData : Object() { } /** - * Returns whether one-way collisions are enabled for the polygon at index [polygonIndex] for TileSet physics layer with index [layerId]. + * Returns whether one-way collisions are enabled for the polygon at index [param polygon_index] + * for TileSet physics layer with index [param layer_id]. */ public fun isCollisionPolygonOneWay(layerId: Int, polygonIndex: Int): Boolean { TransferContext.writeArguments(LONG to layerId.toLong(), LONG to polygonIndex.toLong()) @@ -388,7 +397,8 @@ public open class TileData : Object() { } /** - * Enables/disables one-way collisions on the polygon at index [polygonIndex] for TileSet physics layer with index [layerId]. + * Enables/disables one-way collisions on the polygon at index [param polygon_index] for TileSet + * physics layer with index [param layer_id]. */ public fun setCollisionPolygonOneWayMargin( layerId: Int, @@ -400,7 +410,8 @@ public open class TileData : Object() { } /** - * Returns the one-way margin (for one-way platforms) of the polygon at index [polygonIndex] for TileSet physics layer with index [layerId]. + * Returns the one-way margin (for one-way platforms) of the polygon at index [param + * polygon_index] for TileSet physics layer with index [param layer_id]. */ public fun getCollisionPolygonOneWayMargin(layerId: Int, polygonIndex: Int): Float { TransferContext.writeArguments(LONG to layerId.toLong(), LONG to polygonIndex.toLong()) @@ -409,7 +420,7 @@ public open class TileData : Object() { } /** - * Sets the tile's terrain bit for the given [peeringBit] direction. + * Sets the tile's terrain bit for the given [param peering_bit] direction. */ public fun setTerrainPeeringBit(peeringBit: TileSet.CellNeighbor, terrain: Int): Unit { TransferContext.writeArguments(LONG to peeringBit.id, LONG to terrain.toLong()) @@ -417,7 +428,7 @@ public open class TileData : Object() { } /** - * Returns the tile's terrain bit for the given [peeringBit] direction. + * Returns the tile's terrain bit for the given [param peering_bit] direction. */ public fun getTerrainPeeringBit(peeringBit: TileSet.CellNeighbor): Int { TransferContext.writeArguments(LONG to peeringBit.id) @@ -426,7 +437,7 @@ public open class TileData : Object() { } /** - * Sets the navigation polygon for the TileSet navigation layer with index [layerId]. + * Sets the navigation polygon for the TileSet navigation layer with index [param layer_id]. */ public fun setNavigationPolygon(layerId: Int, navigationPolygon: NavigationPolygon): Unit { TransferContext.writeArguments(LONG to layerId.toLong(), OBJECT to navigationPolygon) @@ -434,7 +445,8 @@ public open class TileData : Object() { } /** - * Returns the navigation polygon of the tile for the TileSet navigation layer with index [layerId]. + * Returns the navigation polygon of the tile for the TileSet navigation layer with index [param + * layer_id]. */ public fun getNavigationPolygon(layerId: Int): NavigationPolygon? { TransferContext.writeArguments(LONG to layerId.toLong()) @@ -443,7 +455,8 @@ public open class TileData : Object() { } /** - * Sets the tile's custom data value for the TileSet custom data layer with name [layerName]. + * Sets the tile's custom data value for the TileSet custom data layer with name [param + * layer_name]. */ public fun setCustomData(layerName: String, `value`: Any?): Unit { TransferContext.writeArguments(STRING to layerName, ANY to value) @@ -451,7 +464,7 @@ public open class TileData : Object() { } /** - * Returns the custom data value for custom data layer named [layerName]. + * Returns the custom data value for custom data layer named [param layer_name]. */ public fun getCustomData(layerName: String): Any? { TransferContext.writeArguments(STRING to layerName) @@ -460,7 +473,8 @@ public open class TileData : Object() { } /** - * Sets the tile's custom data value for the TileSet custom data layer with index [layerId]. + * Sets the tile's custom data value for the TileSet custom data layer with index [param + * layer_id]. */ public fun setCustomDataByLayerId(layerId: Int, `value`: Any?): Unit { TransferContext.writeArguments(LONG to layerId.toLong(), ANY to value) @@ -468,7 +482,7 @@ public open class TileData : Object() { } /** - * Returns the custom data value for custom data layer with index [layerId]. + * Returns the custom data value for custom data layer with index [param layer_id]. */ public fun getCustomDataByLayerId(layerId: Int): Any? { TransferContext.writeArguments(LONG to layerId.toLong()) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/TileMapPattern.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/TileMapPattern.kt index 10defafdf..c1bae6a5c 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/TileMapPattern.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/TileMapPattern.kt @@ -25,11 +25,9 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * Holds a pattern to be copied from or pasted into [godot.TileMap]s. - * - * This resource holds a set of cells to help bulk manipulations of [godot.TileMap]. - * - * A pattern always start at the `(0,0)` coordinates and cannot have cells with negative coordinates. + * This resource holds a set of cells to help bulk manipulations of [TileMap]. + * A pattern always start at the `(0,0)` coordinates and cannot have cells with negative + * coordinates. */ @GodotBaseType public open class TileMapPattern : Resource() { @@ -39,7 +37,7 @@ public open class TileMapPattern : Resource() { } /** - * Sets the tile identifiers for the cell at coordinates [coords]. See [godot.TileMap.setCell]. + * Sets the tile identifiers for the cell at coordinates [param coords]. See [TileMap.setCell]. */ @JvmOverloads public fun setCell( @@ -70,7 +68,7 @@ public open class TileMapPattern : Resource() { } /** - * Returns the tile source ID of the cell at [coords]. + * Returns the tile source ID of the cell at [param coords]. */ public fun getCellSourceId(coords: Vector2i): Int { TransferContext.writeArguments(VECTOR2I to coords) @@ -79,7 +77,7 @@ public open class TileMapPattern : Resource() { } /** - * Returns the tile atlas coordinates ID of the cell at [coords]. + * Returns the tile atlas coordinates ID of the cell at [param coords]. */ public fun getCellAtlasCoords(coords: Vector2i): Vector2i { TransferContext.writeArguments(VECTOR2I to coords) @@ -88,7 +86,7 @@ public open class TileMapPattern : Resource() { } /** - * Returns the tile alternative ID of the cell at [coords]. + * Returns the tile alternative ID of the cell at [param coords]. */ public fun getCellAlternativeTile(coords: Vector2i): Int { TransferContext.writeArguments(VECTOR2I to coords) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/TileSet.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/TileSet.kt index be1a70b5c..98d6f8314 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/TileSet.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/TileSet.kt @@ -34,21 +34,18 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * Tile library for tilemaps. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/113](https://godotengine.org/asset-library/asset/113) - * - * A TileSet is a library of tiles for a [godot.TileMap]. A TileSet handles a list of [godot.TileSetSource], each of them storing a set of tiles. - * - * Tiles can either be from a [godot.TileSetAtlasSource], which renders tiles out of a texture with support for physics, navigation, etc., or from a [godot.TileSetScenesCollectionSource], which exposes scene-based tiles. - * - * Tiles are referenced by using three IDs: their source ID, their atlas coordinates ID, and their alternative tile ID. - * - * A TileSet can be configured so that its tiles expose more or fewer properties. To do so, the TileSet resources use property layers, which you can add or remove depending on your needs. - * - * For example, adding a physics layer allows giving collision shapes to your tiles. Each layer has dedicated properties (physics layer and mask), so you may add several TileSet physics layers for each type of collision you need. - * + * A TileSet is a library of tiles for a [TileMap]. A TileSet handles a list of [TileSetSource], + * each of them storing a set of tiles. + * Tiles can either be from a [TileSetAtlasSource], which renders tiles out of a texture with + * support for physics, navigation, etc., or from a [TileSetScenesCollectionSource], which exposes + * scene-based tiles. + * Tiles are referenced by using three IDs: their source ID, their atlas coordinates ID, and their + * alternative tile ID. + * A TileSet can be configured so that its tiles expose more or fewer properties. To do so, the + * TileSet resources use property layers, which you can add or remove depending on your needs. + * For example, adding a physics layer allows giving collision shapes to your tiles. Each layer has + * dedicated properties (physics layer and mask), so you may add several TileSet physics layers for + * each type of collision you need. * See the functions to add new layers for more information. */ @GodotBaseType @@ -68,7 +65,8 @@ public open class TileSet : Resource() { } /** - * For all half-offset shapes (Isometric, Hexagonal and Half-Offset square), changes the way tiles are indexed in the TileMap grid. + * For all half-offset shapes (Isometric, Hexagonal and Half-Offset square), changes the way tiles + * are indexed in the TileMap grid. */ public var tileLayout: TileLayout get() { @@ -82,7 +80,8 @@ public open class TileSet : Resource() { } /** - * For all half-offset shapes (Isometric, Hexagonal and Half-Offset square), determines the offset axis. + * For all half-offset shapes (Isometric, Hexagonal and Half-Offset square), determines the offset + * axis. */ public var tileOffsetAxis: TileOffsetAxis get() { @@ -96,7 +95,8 @@ public open class TileSet : Resource() { } /** - * The tile size, in pixels. For all tile shapes, this size corresponds to the encompassing rectangle of the tile shape. This is thus the minimal cell size required in an atlas. + * The tile size, in pixels. For all tile shapes, this size corresponds to the encompassing + * rectangle of the tile shape. This is thus the minimal cell size required in an atlas. */ @CoreTypeLocalCopy public var tileSize: Vector2i @@ -130,7 +130,8 @@ public open class TileSet : Resource() { } /** - * The tile size, in pixels. For all tile shapes, this size corresponds to the encompassing rectangle of the tile shape. This is thus the minimal cell size required in an atlas. + * The tile size, in pixels. For all tile shapes, this size corresponds to the encompassing + * rectangle of the tile shape. This is thus the minimal cell size required in an atlas. * * This is a helper function to make dealing with local copies easier. * @@ -154,7 +155,8 @@ public open class TileSet : Resource() { /** - * Returns a new unused source ID. This generated ID is the same that a call to [addSource] would return. + * Returns a new unused source ID. This generated ID is the same that a call to [addSource] would + * return. */ public fun getNextSourceId(): Int { TransferContext.writeArguments() @@ -163,11 +165,11 @@ public open class TileSet : Resource() { } /** - * Adds a [godot.TileSetSource] to the TileSet. If [atlasSourceIdOverride] is not -1, also set its source ID. Otherwise, a unique identifier is automatically generated. - * + * Adds a [TileSetSource] to the TileSet. If [param atlas_source_id_override] is not -1, also set + * its source ID. Otherwise, a unique identifier is automatically generated. * The function returns the added source ID or -1 if the source could not be added. - * - * **Warning:** A source cannot belong to two TileSets at the same time. If the added source was attached to another [godot.TileSet], it will be removed from that one. + * **Warning:** A source cannot belong to two TileSets at the same time. If the added source was + * attached to another [TileSet], it will be removed from that one. */ @JvmOverloads public fun addSource(source: TileSetSource, atlasSourceIdOverride: Int = -1): Int { @@ -193,7 +195,7 @@ public open class TileSet : Resource() { } /** - * Returns the number of [godot.TileSetSource] in this TileSet. + * Returns the number of [TileSetSource] in this TileSet. */ public fun getSourceCount(): Int { TransferContext.writeArguments() @@ -202,7 +204,7 @@ public open class TileSet : Resource() { } /** - * Returns the source ID for source with index [index]. + * Returns the source ID for source with index [param index]. */ public fun getSourceId(index: Int): Int { TransferContext.writeArguments(LONG to index.toLong()) @@ -220,7 +222,7 @@ public open class TileSet : Resource() { } /** - * Returns the [godot.TileSetSource] with ID [sourceId]. + * Returns the [TileSetSource] with ID [param source_id]. */ public fun getSource(sourceId: Int): TileSetSource? { TransferContext.writeArguments(LONG to sourceId.toLong()) @@ -238,8 +240,8 @@ public open class TileSet : Resource() { } /** - * Adds an occlusion layer to the TileSet at the given position [toPosition] in the array. If [toPosition] is -1, adds it at the end of the array. - * + * Adds an occlusion layer to the TileSet at the given position [param to_position] in the array. + * If [param to_position] is -1, adds it at the end of the array. * Occlusion layers allow assigning occlusion polygons to atlas tiles. */ @JvmOverloads @@ -249,7 +251,8 @@ public open class TileSet : Resource() { } /** - * Moves the occlusion layer at index [layerIndex] to the given position [toPosition] in the array. Also updates the atlas tiles accordingly. + * Moves the occlusion layer at index [param layer_index] to the given position [param + * to_position] in the array. Also updates the atlas tiles accordingly. */ public fun moveOcclusionLayer(layerIndex: Int, toPosition: Int): Unit { TransferContext.writeArguments(LONG to layerIndex.toLong(), LONG to toPosition.toLong()) @@ -257,7 +260,8 @@ public open class TileSet : Resource() { } /** - * Removes the occlusion layer at index [layerIndex]. Also updates the atlas tiles accordingly. + * Removes the occlusion layer at index [param layer_index]. Also updates the atlas tiles + * accordingly. */ public fun removeOcclusionLayer(layerIndex: Int): Unit { TransferContext.writeArguments(LONG to layerIndex.toLong()) @@ -265,7 +269,8 @@ public open class TileSet : Resource() { } /** - * Sets the occlusion layer (as in the rendering server) for occluders in the given TileSet occlusion layer. + * Sets the occlusion layer (as in the rendering server) for occluders in the given TileSet + * occlusion layer. */ public fun setOcclusionLayerLightMask(layerIndex: Int, lightMask: Int): Unit { TransferContext.writeArguments(LONG to layerIndex.toLong(), LONG to lightMask.toLong()) @@ -308,8 +313,8 @@ public open class TileSet : Resource() { } /** - * Adds a physics layer to the TileSet at the given position [toPosition] in the array. If [toPosition] is -1, adds it at the end of the array. - * + * Adds a physics layer to the TileSet at the given position [param to_position] in the array. If + * [param to_position] is -1, adds it at the end of the array. * Physics layers allow assigning collision polygons to atlas tiles. */ @JvmOverloads @@ -319,7 +324,8 @@ public open class TileSet : Resource() { } /** - * Moves the physics layer at index [layerIndex] to the given position [toPosition] in the array. Also updates the atlas tiles accordingly. + * Moves the physics layer at index [param layer_index] to the given position [param to_position] + * in the array. Also updates the atlas tiles accordingly. */ public fun movePhysicsLayer(layerIndex: Int, toPosition: Int): Unit { TransferContext.writeArguments(LONG to layerIndex.toLong(), LONG to toPosition.toLong()) @@ -327,7 +333,8 @@ public open class TileSet : Resource() { } /** - * Removes the physics layer at index [layerIndex]. Also updates the atlas tiles accordingly. + * Removes the physics layer at index [param layer_index]. Also updates the atlas tiles + * accordingly. */ public fun removePhysicsLayer(layerIndex: Int): Unit { TransferContext.writeArguments(LONG to layerIndex.toLong()) @@ -335,7 +342,8 @@ public open class TileSet : Resource() { } /** - * Sets the physics layer (as in the physics server) for bodies in the given TileSet physics layer. + * Sets the physics layer (as in the physics server) for bodies in the given TileSet physics + * layer. */ public fun setPhysicsLayerCollisionLayer(layerIndex: Int, layer: Long): Unit { TransferContext.writeArguments(LONG to layerIndex.toLong(), LONG to layer) @@ -343,7 +351,8 @@ public open class TileSet : Resource() { } /** - * Returns the collision layer (as in the physics server) bodies on the given TileSet's physics layer are in. + * Returns the collision layer (as in the physics server) bodies on the given TileSet's physics + * layer are in. */ public fun getPhysicsLayerCollisionLayer(layerIndex: Int): Long { TransferContext.writeArguments(LONG to layerIndex.toLong()) @@ -352,7 +361,8 @@ public open class TileSet : Resource() { } /** - * Sets the physics layer (as in the physics server) for bodies in the given TileSet physics layer. + * Sets the physics layer (as in the physics server) for bodies in the given TileSet physics + * layer. */ public fun setPhysicsLayerCollisionMask(layerIndex: Int, mask: Long): Unit { TransferContext.writeArguments(LONG to layerIndex.toLong(), LONG to mask) @@ -396,7 +406,8 @@ public open class TileSet : Resource() { } /** - * Adds a new terrain set at the given position [toPosition] in the array. If [toPosition] is -1, adds it at the end of the array. + * Adds a new terrain set at the given position [param to_position] in the array. If [param + * to_position] is -1, adds it at the end of the array. */ @JvmOverloads public fun addTerrainSet(toPosition: Int = -1): Unit { @@ -405,7 +416,8 @@ public open class TileSet : Resource() { } /** - * Moves the terrain set at index [terrainSet] to the given position [toPosition] in the array. Also updates the atlas tiles accordingly. + * Moves the terrain set at index [param terrain_set] to the given position [param to_position] in + * the array. Also updates the atlas tiles accordingly. */ public fun moveTerrainSet(terrainSet: Int, toPosition: Int): Unit { TransferContext.writeArguments(LONG to terrainSet.toLong(), LONG to toPosition.toLong()) @@ -413,7 +425,7 @@ public open class TileSet : Resource() { } /** - * Removes the terrain set at index [terrainSet]. Also updates the atlas tiles accordingly. + * Removes the terrain set at index [param terrain_set]. Also updates the atlas tiles accordingly. */ public fun removeTerrainSet(terrainSet: Int): Unit { TransferContext.writeArguments(LONG to terrainSet.toLong()) @@ -421,7 +433,8 @@ public open class TileSet : Resource() { } /** - * Sets a terrain mode. Each mode determines which bits of a tile shape is used to match the neighboring tiles' terrains. + * Sets a terrain mode. Each mode determines which bits of a tile shape is used to match the + * neighboring tiles' terrains. */ public fun setTerrainSetMode(terrainSet: Int, mode: TerrainMode): Unit { TransferContext.writeArguments(LONG to terrainSet.toLong(), LONG to mode.id) @@ -447,7 +460,8 @@ public open class TileSet : Resource() { } /** - * Adds a new terrain to the given terrain set [terrainSet] at the given position [toPosition] in the array. If [toPosition] is -1, adds it at the end of the array. + * Adds a new terrain to the given terrain set [param terrain_set] at the given position [param + * to_position] in the array. If [param to_position] is -1, adds it at the end of the array. */ @JvmOverloads public fun addTerrain(terrainSet: Int, toPosition: Int = -1): Unit { @@ -456,7 +470,8 @@ public open class TileSet : Resource() { } /** - * Moves the terrain at index [terrainIndex] for terrain set [terrainSet] to the given position [toPosition] in the array. Also updates the atlas tiles accordingly. + * Moves the terrain at index [param terrain_index] for terrain set [param terrain_set] to the + * given position [param to_position] in the array. Also updates the atlas tiles accordingly. */ public fun moveTerrain( terrainSet: Int, @@ -468,7 +483,8 @@ public open class TileSet : Resource() { } /** - * Removes the terrain at index [terrainIndex] in the given terrain set [terrainSet]. Also updates the atlas tiles accordingly. + * Removes the terrain at index [param terrain_index] in the given terrain set [param + * terrain_set]. Also updates the atlas tiles accordingly. */ public fun removeTerrain(terrainSet: Int, terrainIndex: Int): Unit { TransferContext.writeArguments(LONG to terrainSet.toLong(), LONG to terrainIndex.toLong()) @@ -497,7 +513,8 @@ public open class TileSet : Resource() { } /** - * Sets a terrain's color. This color is used for identifying the different terrains in the TileSet editor. + * Sets a terrain's color. This color is used for identifying the different terrains in the + * TileSet editor. */ public fun setTerrainColor( terrainSet: Int, @@ -527,8 +544,8 @@ public open class TileSet : Resource() { } /** - * Adds a navigation layer to the TileSet at the given position [toPosition] in the array. If [toPosition] is -1, adds it at the end of the array. - * + * Adds a navigation layer to the TileSet at the given position [param to_position] in the array. + * If [param to_position] is -1, adds it at the end of the array. * Navigation layers allow assigning a navigable area to atlas tiles. */ @JvmOverloads @@ -538,7 +555,8 @@ public open class TileSet : Resource() { } /** - * Moves the navigation layer at index [layerIndex] to the given position [toPosition] in the array. Also updates the atlas tiles accordingly. + * Moves the navigation layer at index [param layer_index] to the given position [param + * to_position] in the array. Also updates the atlas tiles accordingly. */ public fun moveNavigationLayer(layerIndex: Int, toPosition: Int): Unit { TransferContext.writeArguments(LONG to layerIndex.toLong(), LONG to toPosition.toLong()) @@ -546,7 +564,8 @@ public open class TileSet : Resource() { } /** - * Removes the navigation layer at index [layerIndex]. Also updates the atlas tiles accordingly. + * Removes the navigation layer at index [param layer_index]. Also updates the atlas tiles + * accordingly. */ public fun removeNavigationLayer(layerIndex: Int): Unit { TransferContext.writeArguments(LONG to layerIndex.toLong()) @@ -554,7 +573,8 @@ public open class TileSet : Resource() { } /** - * Sets the navigation layers (as in the navigation server) for navigation regions in the given TileSet navigation layer. + * Sets the navigation layers (as in the navigation server) for navigation regions in the given + * TileSet navigation layer. */ public fun setNavigationLayerLayers(layerIndex: Int, layers: Long): Unit { TransferContext.writeArguments(LONG to layerIndex.toLong(), LONG to layers) @@ -562,7 +582,8 @@ public open class TileSet : Resource() { } /** - * Returns the navigation layers (as in the Navigation server) of the given TileSet navigation layer. + * Returns the navigation layers (as in the Navigation server) of the given TileSet navigation + * layer. */ public fun getNavigationLayerLayers(layerIndex: Int): Long { TransferContext.writeArguments(LONG to layerIndex.toLong()) @@ -571,7 +592,9 @@ public open class TileSet : Resource() { } /** - * Based on [value], enables or disables the specified navigation layer of the TileSet navigation data layer identified by the given [layerIndex], given a navigation_layers [layerNumber] between 1 and 32. + * Based on [param value], enables or disables the specified navigation layer of the TileSet + * navigation data layer identified by the given [param layer_index], given a navigation_layers + * [param layer_number] between 1 and 32. */ public fun setNavigationLayerLayerValue( layerIndex: Int, @@ -583,7 +606,9 @@ public open class TileSet : Resource() { } /** - * Returns whether or not the specified navigation layer of the TileSet navigation data layer identified by the given [layerIndex] is enabled, given a navigation_layers [layerNumber] between 1 and 32. + * Returns whether or not the specified navigation layer of the TileSet navigation data layer + * identified by the given [param layer_index] is enabled, given a navigation_layers [param + * layer_number] between 1 and 32. */ public fun getNavigationLayerLayerValue(layerIndex: Int, layerNumber: Int): Boolean { TransferContext.writeArguments(LONG to layerIndex.toLong(), LONG to layerNumber.toLong()) @@ -601,8 +626,8 @@ public open class TileSet : Resource() { } /** - * Adds a custom data layer to the TileSet at the given position [toPosition] in the array. If [toPosition] is -1, adds it at the end of the array. - * + * Adds a custom data layer to the TileSet at the given position [param to_position] in the array. + * If [param to_position] is -1, adds it at the end of the array. * Custom data layers allow assigning custom properties to atlas tiles. */ @JvmOverloads @@ -612,7 +637,8 @@ public open class TileSet : Resource() { } /** - * Moves the custom data layer at index [layerIndex] to the given position [toPosition] in the array. Also updates the atlas tiles accordingly. + * Moves the custom data layer at index [param layer_index] to the given position [param + * to_position] in the array. Also updates the atlas tiles accordingly. */ public fun moveCustomDataLayer(layerIndex: Int, toPosition: Int): Unit { TransferContext.writeArguments(LONG to layerIndex.toLong(), LONG to toPosition.toLong()) @@ -620,7 +646,8 @@ public open class TileSet : Resource() { } /** - * Removes the custom data layer at index [layerIndex]. Also updates the atlas tiles accordingly. + * Removes the custom data layer at index [param layer_index]. Also updates the atlas tiles + * accordingly. */ public fun removeCustomDataLayer(layerIndex: Int): Unit { TransferContext.writeArguments(LONG to layerIndex.toLong()) @@ -637,7 +664,8 @@ public open class TileSet : Resource() { } /** - * Sets the name of the custom data layer identified by the given index. Names are identifiers of the layer therefore if the name is already taken it will fail and raise an error. + * Sets the name of the custom data layer identified by the given index. Names are identifiers of + * the layer therefore if the name is already taken it will fail and raise an error. */ public fun setCustomDataLayerName(layerIndex: Int, layerName: String): Unit { TransferContext.writeArguments(LONG to layerIndex.toLong(), STRING to layerName) @@ -671,10 +699,11 @@ public open class TileSet : Resource() { } /** - * Creates a source-level proxy for the given source ID. A proxy will map set of tile identifiers to another set of identifiers. Both the atlas coordinates ID and the alternative tile ID are kept the same when using source-level proxies. - * - * This can be used to replace a source in all TileMaps using this TileSet, as TileMap nodes will find and use the proxy's target source when one is available. - * + * Creates a source-level proxy for the given source ID. A proxy will map set of tile identifiers + * to another set of identifiers. Both the atlas coordinates ID and the alternative tile ID are kept + * the same when using source-level proxies. + * This can be used to replace a source in all TileMaps using this TileSet, as TileMap nodes will + * find and use the proxy's target source when one is available. * Proxied tiles can be automatically replaced in TileMap nodes using the editor. */ public fun setSourceLevelTileProxy(sourceFrom: Int, sourceTo: Int): Unit { @@ -684,7 +713,6 @@ public open class TileSet : Resource() { /** * Returns the source-level proxy for the given source identifier. - * * If the TileSet has no proxy for the given identifier, returns -1. */ public fun getSourceLevelTileProxy(sourceFrom: Int): Int { @@ -711,10 +739,11 @@ public open class TileSet : Resource() { } /** - * Creates a coordinates-level proxy for the given identifiers. A proxy will map set of tile identifiers to another set of identifiers. The alternative tile ID is kept the same when using coordinates-level proxies. - * - * This can be used to replace a tile in all TileMaps using this TileSet, as TileMap nodes will find and use the proxy's target tile when one is available. - * + * Creates a coordinates-level proxy for the given identifiers. A proxy will map set of tile + * identifiers to another set of identifiers. The alternative tile ID is kept the same when using + * coordinates-level proxies. + * This can be used to replace a tile in all TileMaps using this TileSet, as TileMap nodes will + * find and use the proxy's target tile when one is available. * Proxied tiles can be automatically replaced in TileMap nodes using the editor. */ public fun setCoordsLevelTileProxy( @@ -728,8 +757,8 @@ public open class TileSet : Resource() { } /** - * Returns the coordinate-level proxy for the given identifiers. The returned array contains the two target identifiers of the proxy (source ID and atlas coordinates ID). - * + * Returns the coordinate-level proxy for the given identifiers. The returned array contains the + * two target identifiers of the proxy (source ID and atlas coordinates ID). * If the TileSet has no proxy for the given identifiers, returns an empty Array. */ public fun getCoordsLevelTileProxy(sourceFrom: Int, coordsFrom: Vector2i): VariantArray { @@ -756,10 +785,10 @@ public open class TileSet : Resource() { } /** - * Create an alternative-level proxy for the given identifiers. A proxy will map set of tile identifiers to another set of identifiers. - * - * This can be used to replace a tile in all TileMaps using this TileSet, as TileMap nodes will find and use the proxy's target tile when one is available. - * + * Create an alternative-level proxy for the given identifiers. A proxy will map set of tile + * identifiers to another set of identifiers. + * This can be used to replace a tile in all TileMaps using this TileSet, as TileMap nodes will + * find and use the proxy's target tile when one is available. * Proxied tiles can be automatically replaced in TileMap nodes using the editor. */ public fun setAlternativeLevelTileProxy( @@ -775,8 +804,8 @@ public open class TileSet : Resource() { } /** - * Returns the alternative-level proxy for the given identifiers. The returned array contains the three proxie's target identifiers (source ID, atlas coords ID and alternative tile ID). - * + * Returns the alternative-level proxy for the given identifiers. The returned array contains the + * three proxie's target identifiers (source ID, atlas coords ID and alternative tile ID). * If the TileSet has no proxy for the given identifiers, returns an empty Array. */ public fun getAlternativeLevelTileProxy( @@ -815,11 +844,12 @@ public open class TileSet : Resource() { } /** - * According to the configured proxies, maps the provided identifiers to a new set of identifiers. The source ID, atlas coordinates ID and alternative tile ID are returned as a 3 elements Array. - * - * This function first look for matching alternative-level proxies, then coordinates-level proxies, then source-level proxies. - * - * If no proxy corresponding to provided identifiers are found, returns the same values the ones used as arguments. + * According to the configured proxies, maps the provided identifiers to a new set of identifiers. + * The source ID, atlas coordinates ID and alternative tile ID are returned as a 3 elements Array. + * This function first look for matching alternative-level proxies, then coordinates-level + * proxies, then source-level proxies. + * If no proxy corresponding to provided identifiers are found, returns the same values the ones + * used as arguments. */ public fun mapTileProxy( sourceFrom: Int, @@ -848,7 +878,8 @@ public open class TileSet : Resource() { } /** - * Adds a [godot.TileMapPattern] to be stored in the TileSet resource. If provided, insert it at the given [index]. + * Adds a [TileMapPattern] to be stored in the TileSet resource. If provided, insert it at the + * given [param index]. */ @JvmOverloads public fun addPattern(pattern: TileMapPattern, index: Int = -1): Int { @@ -858,7 +889,7 @@ public open class TileSet : Resource() { } /** - * Returns the [godot.TileMapPattern] at the given [index]. + * Returns the [TileMapPattern] at the given [param index]. */ @JvmOverloads public fun getPattern(index: Int = -1): TileMapPattern? { @@ -868,7 +899,7 @@ public open class TileSet : Resource() { } /** - * Remove the [godot.TileMapPattern] at the given index. + * Remove the [TileMapPattern] at the given index. */ public fun removePattern(index: Int): Unit { TransferContext.writeArguments(LONG to index.toLong()) @@ -876,7 +907,7 @@ public open class TileSet : Resource() { } /** - * Returns the number of [godot.TileMapPattern] this tile set handles. + * Returns the number of [TileMapPattern] this tile set handles. */ public fun getPatternsCount(): Int { TransferContext.writeArguments() @@ -893,8 +924,7 @@ public open class TileSet : Resource() { TILE_SHAPE_SQUARE(0), /** * Diamond tile shape (for isometric look). - * - * **Note:** Isometric [godot.TileSet] works best if [godot.TileMap] and all its layers have Y-sort enabled. + * **Note:** Isometric [TileSet] works best if [TileMap] and all its layers have Y-sort enabled. */ TILE_SHAPE_ISOMETRIC(1), /** @@ -921,27 +951,33 @@ public open class TileSet : Resource() { id: Long, ) { /** - * Tile coordinates layout where both axis stay consistent with their respective local horizontal and vertical axis. + * Tile coordinates layout where both axis stay consistent with their respective local + * horizontal and vertical axis. */ TILE_LAYOUT_STACKED(0), /** - * Same as [TILE_LAYOUT_STACKED], but the first half-offset is negative instead of positive. + * Same as [constant TILE_LAYOUT_STACKED], but the first half-offset is negative instead of + * positive. */ TILE_LAYOUT_STACKED_OFFSET(1), /** - * Tile coordinates layout where the horizontal axis stay horizontal, and the vertical one goes down-right. + * Tile coordinates layout where the horizontal axis stay horizontal, and the vertical one goes + * down-right. */ TILE_LAYOUT_STAIRS_RIGHT(2), /** - * Tile coordinates layout where the vertical axis stay vertical, and the horizontal one goes down-right. + * Tile coordinates layout where the vertical axis stay vertical, and the horizontal one goes + * down-right. */ TILE_LAYOUT_STAIRS_DOWN(3), /** - * Tile coordinates layout where the horizontal axis goes up-right, and the vertical one goes down-right. + * Tile coordinates layout where the horizontal axis goes up-right, and the vertical one goes + * down-right. */ TILE_LAYOUT_DIAMOND_RIGHT(4), /** - * Tile coordinates layout where the horizontal axis goes down-right, and the vertical one goes down-left. + * Tile coordinates layout where the horizontal axis goes down-right, and the vertical one goes + * down-left. */ TILE_LAYOUT_DIAMOND_DOWN(5), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/TileSetAtlasSource.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/TileSetAtlasSource.kt index 69d14dca1..50deb862c 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/TileSetAtlasSource.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/TileSetAtlasSource.kt @@ -33,17 +33,19 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * Exposes a 2D atlas texture as a set of tiles for a [godot.TileSet] resource. - * - * An atlas is a grid of tiles laid out on a texture. Each tile in the grid must be exposed using [createTile]. Those tiles are then indexed using their coordinates in the grid. - * - * Each tile can also have a size in the grid coordinates, making it more or less cells in the atlas. - * - * Alternatives version of a tile can be created using [createAlternativeTile], which are then indexed using an alternative ID. The main tile (the one in the grid), is accessed with an alternative ID equal to 0. - * - * Each tile alternate has a set of properties that is defined by the source's [godot.TileSet] layers. Those properties are stored in a TileData object that can be accessed and modified using [getTileData]. - * - * As TileData properties are stored directly in the TileSetAtlasSource resource, their properties might also be set using `TileSetAtlasSource.set("://")`. + * An atlas is a grid of tiles laid out on a texture. Each tile in the grid must be exposed using + * [createTile]. Those tiles are then indexed using their coordinates in the grid. + * Each tile can also have a size in the grid coordinates, making it more or less cells in the + * atlas. + * Alternatives version of a tile can be created using [createAlternativeTile], which are then + * indexed using an alternative ID. The main tile (the one in the grid), is accessed with an + * alternative ID equal to 0. + * Each tile alternate has a set of properties that is defined by the source's [TileSet] layers. + * Those properties are stored in a TileData object that can be accessed and modified using + * [getTileData]. + * As TileData properties are stored directly in the TileSetAtlasSource resource, their properties + * might also be set using + * `TileSetAtlasSource.set("://")`. */ @GodotBaseType public open class TileSetAtlasSource : TileSetSource() { @@ -92,7 +94,8 @@ public open class TileSetAtlasSource : TileSetSource() { } /** - * The base tile size in the texture (in pixel). This size must be bigger than the TileSet's `tile_size` value. + * The base tile size in the texture (in pixel). This size must be bigger than the TileSet's + * `tile_size` value. */ @CoreTypeLocalCopy public var textureRegionSize: Vector2i @@ -107,9 +110,10 @@ public open class TileSetAtlasSource : TileSetSource() { } /** - * If `true`, generates an internal texture with an additional one pixel padding around each tile. Texture padding avoids a common artifact where lines appear between tiles. - * - * Disabling this setting might lead a small performance improvement, as generating the internal texture requires both memory and processing time when the TileSetAtlasSource resource is modified. + * If `true`, generates an internal texture with an additional one pixel padding around each tile. + * Texture padding avoids a common artifact where lines appear between tiles. + * Disabling this setting might lead a small performance improvement, as generating the internal + * texture requires both memory and processing time when the TileSetAtlasSource resource is modified. */ public var useTexturePadding: Boolean get() { @@ -176,7 +180,8 @@ public open class TileSetAtlasSource : TileSetSource() { /** - * The base tile size in the texture (in pixel). This size must be bigger than the TileSet's `tile_size` value. + * The base tile size in the texture (in pixel). This size must be bigger than the TileSet's + * `tile_size` value. * * This is a helper function to make dealing with local copies easier. * @@ -201,7 +206,7 @@ public open class TileSetAtlasSource : TileSetSource() { /** - * Creates a new tile at coordinates [atlasCoords] with the given [size]. + * Creates a new tile at coordinates [param atlas_coords] with the given [param size]. */ @JvmOverloads public fun createTile(atlasCoords: Vector2i, size: Vector2i = Vector2i(1, 1)): Unit { @@ -210,7 +215,7 @@ public open class TileSetAtlasSource : TileSetSource() { } /** - * Remove a tile and its alternative at coordinates [atlasCoords]. + * Remove a tile and its alternative at coordinates [param atlas_coords]. */ public fun removeTile(atlasCoords: Vector2i): Unit { TransferContext.writeArguments(VECTOR2I to atlasCoords) @@ -218,10 +223,11 @@ public open class TileSetAtlasSource : TileSetSource() { } /** - * Move the tile and its alternatives at the [atlasCoords] coordinates to the [newAtlasCoords] coordinates with the [newSize] size. This functions will fail if a tile is already present in the given area. - * - * If [newAtlasCoords] is `Vector2i(-1, -1)`, keeps the tile's coordinates. If [newSize] is `Vector2i(-1, -1)`, keeps the tile's size. - * + * Move the tile and its alternatives at the [param atlas_coords] coordinates to the [param + * new_atlas_coords] coordinates with the [param new_size] size. This functions will fail if a tile + * is already present in the given area. + * If [param new_atlas_coords] is `Vector2i(-1, -1)`, keeps the tile's coordinates. If [param + * new_size] is `Vector2i(-1, -1)`, keeps the tile's size. * To avoid an error, first check if a move is possible using [hasRoomForTile]. */ @JvmOverloads @@ -235,7 +241,8 @@ public open class TileSetAtlasSource : TileSetSource() { } /** - * Returns the size of the tile (in the grid coordinates system) at coordinates [atlasCoords]. + * Returns the size of the tile (in the grid coordinates system) at coordinates [param + * atlas_coords]. */ public fun getTileSizeInAtlas(atlasCoords: Vector2i): Vector2i { TransferContext.writeArguments(VECTOR2I to atlasCoords) @@ -244,7 +251,9 @@ public open class TileSetAtlasSource : TileSetSource() { } /** - * Returns whether there is enough room in an atlas to create/modify a tile with the given properties. If [ignoredTile] is provided, act as is the given tile was not present in the atlas. This may be used when you want to modify a tile's properties. + * Returns whether there is enough room in an atlas to create/modify a tile with the given + * properties. If [param ignored_tile] is provided, act as is the given tile was not present in the + * atlas. This may be used when you want to modify a tile's properties. */ @JvmOverloads public fun hasRoomForTile( @@ -261,7 +270,9 @@ public open class TileSetAtlasSource : TileSetSource() { } /** - * Returns an array of tiles coordinates ID that will be automatically removed when modifying one or several of those properties: [texture], [margins], [separation] or [textureRegionSize]. This can be used to undo changes that would have caused tiles data loss. + * Returns an array of tiles coordinates ID that will be automatically removed when modifying one + * or several of those properties: [param texture], [param margins], [param separation] or [param + * texture_region_size]. This can be used to undo changes that would have caused tiles data loss. */ public fun getTilesToBeRemovedOnChange( texture: Texture2D, @@ -276,7 +287,8 @@ public open class TileSetAtlasSource : TileSetSource() { } /** - * If there is a tile covering the [atlasCoords] coordinates, returns the top-left coordinates of the tile (thus its coordinate ID). Returns `Vector2i(-1, -1)` otherwise. + * If there is a tile covering the [param atlas_coords] coordinates, returns the top-left + * coordinates of the tile (thus its coordinate ID). Returns `Vector2i(-1, -1)` otherwise. */ public fun getTileAtCoords(atlasCoords: Vector2i): Vector2i { TransferContext.writeArguments(VECTOR2I to atlasCoords) @@ -285,7 +297,8 @@ public open class TileSetAtlasSource : TileSetSource() { } /** - * Checks if the source has any tiles that don't fit the texture area (either partially or completely). + * Checks if the source has any tiles that don't fit the texture area (either partially or + * completely). */ public fun hasTilesOutsideTexture(): Boolean { TransferContext.writeArguments() @@ -294,7 +307,8 @@ public open class TileSetAtlasSource : TileSetSource() { } /** - * Removes all tiles that don't fit the available texture area. This method iterates over all the source's tiles, so it's advised to use [hasTilesOutsideTexture] beforehand. + * Removes all tiles that don't fit the available texture area. This method iterates over all the + * source's tiles, so it's advised to use [hasTilesOutsideTexture] beforehand. */ public fun clearTilesOutsideTexture(): Unit { TransferContext.writeArguments() @@ -302,7 +316,9 @@ public open class TileSetAtlasSource : TileSetSource() { } /** - * Sets the number of columns in the animation layout of the tile at coordinates [atlasCoords]. If set to 0, then the different frames of the animation are laid out as a single horizontal line in the atlas. + * Sets the number of columns in the animation layout of the tile at coordinates [param + * atlas_coords]. If set to 0, then the different frames of the animation are laid out as a single + * horizontal line in the atlas. */ public fun setTileAnimationColumns(atlasCoords: Vector2i, frameColumns: Int): Unit { TransferContext.writeArguments(VECTOR2I to atlasCoords, LONG to frameColumns.toLong()) @@ -310,7 +326,7 @@ public open class TileSetAtlasSource : TileSetSource() { } /** - * Returns how many columns the tile at [atlasCoords] has in its animation layout. + * Returns how many columns the tile at [param atlas_coords] has in its animation layout. */ public fun getTileAnimationColumns(atlasCoords: Vector2i): Int { TransferContext.writeArguments(VECTOR2I to atlasCoords) @@ -319,7 +335,8 @@ public open class TileSetAtlasSource : TileSetSource() { } /** - * Sets the margin (in grid tiles) between each tile in the animation layout of the tile at coordinates [atlasCoords] has. + * Sets the margin (in grid tiles) between each tile in the animation layout of the tile at + * coordinates [param atlas_coords] has. */ public fun setTileAnimationSeparation(atlasCoords: Vector2i, separation: Vector2i): Unit { TransferContext.writeArguments(VECTOR2I to atlasCoords, VECTOR2I to separation) @@ -327,7 +344,8 @@ public open class TileSetAtlasSource : TileSetSource() { } /** - * Returns the separation (as in the atlas grid) between each frame of an animated tile at coordinates [atlasCoords]. + * Returns the separation (as in the atlas grid) between each frame of an animated tile at + * coordinates [param atlas_coords]. */ public fun getTileAnimationSeparation(atlasCoords: Vector2i): Vector2i { TransferContext.writeArguments(VECTOR2I to atlasCoords) @@ -336,7 +354,7 @@ public open class TileSetAtlasSource : TileSetSource() { } /** - * Sets the animation speed of the tile at coordinates [atlasCoords] has. + * Sets the animation speed of the tile at coordinates [param atlas_coords] has. */ public fun setTileAnimationSpeed(atlasCoords: Vector2i, speed: Float): Unit { TransferContext.writeArguments(VECTOR2I to atlasCoords, DOUBLE to speed.toDouble()) @@ -344,7 +362,7 @@ public open class TileSetAtlasSource : TileSetSource() { } /** - * Returns the animation speed of the tile at coordinates [atlasCoords]. + * Returns the animation speed of the tile at coordinates [param atlas_coords]. */ public fun getTileAnimationSpeed(atlasCoords: Vector2i): Float { TransferContext.writeArguments(VECTOR2I to atlasCoords) @@ -353,7 +371,8 @@ public open class TileSetAtlasSource : TileSetSource() { } /** - * Sets the [enum TileAnimationMode] of the tile at [atlasCoords] to [mode]. See also [getTileAnimationMode]. + * Sets the [enum TileAnimationMode] of the tile at [param atlas_coords] to [param mode]. See also + * [getTileAnimationMode]. */ public fun setTileAnimationMode(atlasCoords: Vector2i, mode: TileAnimationMode): Unit { TransferContext.writeArguments(VECTOR2I to atlasCoords, LONG to mode.id) @@ -361,7 +380,8 @@ public open class TileSetAtlasSource : TileSetSource() { } /** - * Returns the [enum TileAnimationMode] of the tile at [atlasCoords]. See also [setTileAnimationMode]. + * Returns the [enum TileAnimationMode] of the tile at [param atlas_coords]. See also + * [setTileAnimationMode]. */ public fun getTileAnimationMode(atlasCoords: Vector2i): TileAnimationMode { TransferContext.writeArguments(VECTOR2I to atlasCoords) @@ -370,7 +390,7 @@ public open class TileSetAtlasSource : TileSetSource() { } /** - * Sets how many animation frames the tile at coordinates [atlasCoords] has. + * Sets how many animation frames the tile at coordinates [param atlas_coords] has. */ public fun setTileAnimationFramesCount(atlasCoords: Vector2i, framesCount: Int): Unit { TransferContext.writeArguments(VECTOR2I to atlasCoords, LONG to framesCount.toLong()) @@ -378,7 +398,7 @@ public open class TileSetAtlasSource : TileSetSource() { } /** - * Returns how many animation frames has the tile at coordinates [atlasCoords]. + * Returns how many animation frames has the tile at coordinates [param atlas_coords]. */ public fun getTileAnimationFramesCount(atlasCoords: Vector2i): Int { TransferContext.writeArguments(VECTOR2I to atlasCoords) @@ -387,7 +407,8 @@ public open class TileSetAtlasSource : TileSetSource() { } /** - * Sets the animation frame [duration] of frame [frameIndex] for the tile at coordinates [atlasCoords]. + * Sets the animation frame [param duration] of frame [param frame_index] for the tile at + * coordinates [param atlas_coords]. */ public fun setTileAnimationFrameDuration( atlasCoords: Vector2i, @@ -399,7 +420,8 @@ public open class TileSetAtlasSource : TileSetSource() { } /** - * Returns the animation frame duration of frame [frameIndex] for the tile at coordinates [atlasCoords]. + * Returns the animation frame duration of frame [param frame_index] for the tile at coordinates + * [param atlas_coords]. */ public fun getTileAnimationFrameDuration(atlasCoords: Vector2i, frameIndex: Int): Float { TransferContext.writeArguments(VECTOR2I to atlasCoords, LONG to frameIndex.toLong()) @@ -408,7 +430,9 @@ public open class TileSetAtlasSource : TileSetSource() { } /** - * Returns the sum of the sum of the frame durations of the tile at coordinates [atlasCoords]. This value needs to be divided by the animation speed to get the actual animation loop duration. + * Returns the sum of the sum of the frame durations of the tile at coordinates [param + * atlas_coords]. This value needs to be divided by the animation speed to get the actual animation + * loop duration. */ public fun getTileAnimationTotalDuration(atlasCoords: Vector2i): Float { TransferContext.writeArguments(VECTOR2I to atlasCoords) @@ -417,9 +441,11 @@ public open class TileSetAtlasSource : TileSetSource() { } /** - * Creates an alternative tile for the tile at coordinates [atlasCoords]. If [alternativeIdOverride] is -1, give it an automatically generated unique ID, or assigns it the given ID otherwise. - * - * Returns the new alternative identifier, or -1 if the alternative could not be created with a provided [alternativeIdOverride]. + * Creates an alternative tile for the tile at coordinates [param atlas_coords]. If [param + * alternative_id_override] is -1, give it an automatically generated unique ID, or assigns it the + * given ID otherwise. + * Returns the new alternative identifier, or -1 if the alternative could not be created with a + * provided [param alternative_id_override]. */ @JvmOverloads public fun createAlternativeTile(atlasCoords: Vector2i, alternativeIdOverride: Int = -1): Int { @@ -429,9 +455,9 @@ public open class TileSetAtlasSource : TileSetSource() { } /** - * Remove a tile's alternative with alternative ID [alternativeTile]. - * - * Calling this function with [alternativeTile] equals to 0 will fail, as the base tile alternative cannot be removed. + * Remove a tile's alternative with alternative ID [param alternative_tile]. + * Calling this function with [param alternative_tile] equals to 0 will fail, as the base tile + * alternative cannot be removed. */ public fun removeAlternativeTile(atlasCoords: Vector2i, alternativeTile: Int): Unit { TransferContext.writeArguments(VECTOR2I to atlasCoords, LONG to alternativeTile.toLong()) @@ -439,9 +465,9 @@ public open class TileSetAtlasSource : TileSetSource() { } /** - * Change a tile's alternative ID from [alternativeTile] to [newId]. - * - * Calling this function with [newId] of 0 will fail, as the base tile alternative cannot be moved. + * Change a tile's alternative ID from [param alternative_tile] to [param new_id]. + * Calling this function with [param new_id] of 0 will fail, as the base tile alternative cannot + * be moved. */ public fun setAlternativeTileId( atlasCoords: Vector2i, @@ -462,7 +488,7 @@ public open class TileSetAtlasSource : TileSetSource() { } /** - * Returns the [godot.TileData] object for the given atlas coordinates and alternative ID. + * Returns the [TileData] object for the given atlas coordinates and alternative ID. */ public fun getTileData(atlasCoords: Vector2i, alternativeTile: Int): TileData? { TransferContext.writeArguments(VECTOR2I to atlasCoords, LONG to alternativeTile.toLong()) @@ -471,7 +497,8 @@ public open class TileSetAtlasSource : TileSetSource() { } /** - * Returns the atlas grid size, which depends on how many tiles can fit in the texture. It thus depends on the [texture]'s size, the atlas [margins], and the tiles' [textureRegionSize]. + * Returns the atlas grid size, which depends on how many tiles can fit in the texture. It thus + * depends on the [texture]'s size, the atlas [margins], and the tiles' [textureRegionSize]. */ public fun getAtlasGridSize(): Vector2i { TransferContext.writeArguments() @@ -480,7 +507,8 @@ public open class TileSetAtlasSource : TileSetSource() { } /** - * Returns a tile's texture region in the atlas texture. For animated tiles, a [frame] argument might be provided for the different frames of the animation. + * Returns a tile's texture region in the atlas texture. For animated tiles, a [param frame] + * argument might be provided for the different frames of the animation. */ @JvmOverloads public fun getTileTextureRegion(atlasCoords: Vector2i, frame: Int = 0): Rect2i { @@ -490,7 +518,8 @@ public open class TileSetAtlasSource : TileSetSource() { } /** - * If [useTexturePadding] is `false`, returns [texture]. Otherwise, returns and internal [godot.ImageTexture] created that includes the padding. + * If [useTexturePadding] is `false`, returns [texture]. Otherwise, returns and internal + * [ImageTexture] created that includes the padding. */ public fun getRuntimeTexture(): Texture2D? { TransferContext.writeArguments() @@ -499,8 +528,8 @@ public open class TileSetAtlasSource : TileSetSource() { } /** - * Returns the region of the tile at coordinates [atlasCoords] for the given [frame] inside the texture returned by [getRuntimeTexture]. - * + * Returns the region of the tile at coordinates [param atlas_coords] for the given [param frame] + * inside the texture returned by [getRuntimeTexture]. * **Note:** If [useTexturePadding] is `false`, returns the same as [getTileTextureRegion]. */ public fun getRuntimeTileTextureRegion(atlasCoords: Vector2i, frame: Int): Rect2i { @@ -538,24 +567,25 @@ public open class TileSetAtlasSource : TileSetSource() { public companion object { /** - * Represents cell's horizontal flip flag. Should be used directly with [godot.TileMap] to flip placed tiles by altering their alternative IDs. - * - * ``` - * var alternate_id = $TileMap.get_cell_alternative_tile(0, Vector2i(2, 2)) - * if not alternate_id & TileSetAtlasSource.TRANSFORM_FLIP_H: - * # If tile is not already flipped, flip it. - * $TileMap.set_cell(0, Vector2i(2, 2), source_id, atlas_coords, alternate_id | TileSetAtlasSource.TRANSFORM_FLIP_H) - * ``` + * Represents cell's horizontal flip flag. Should be used directly with [TileMap] to flip placed + * tiles by altering their alternative IDs. + * [codeblock] + * var alternate_id = $TileMap.get_cell_alternative_tile(0, Vector2i(2, 2)) + * if not alternate_id & TileSetAtlasSource.TRANSFORM_FLIP_H: + * # If tile is not already flipped, flip it. + * $TileMap.set_cell(0, Vector2i(2, 2), source_id, atlas_coords, alternate_id | + * TileSetAtlasSource.TRANSFORM_FLIP_H) + * [/codeblock] */ public final const val TRANSFORM_FLIP_H: Long = 4096 /** - * Represents cell's vertical flip flag. See [TRANSFORM_FLIP_H] for usage. + * Represents cell's vertical flip flag. See [constant TRANSFORM_FLIP_H] for usage. */ public final const val TRANSFORM_FLIP_V: Long = 8192 /** - * Represents cell's transposed flag. See [TRANSFORM_FLIP_H] for usage. + * Represents cell's transposed flag. See [constant TRANSFORM_FLIP_H] for usage. */ public final const val TRANSFORM_TRANSPOSE: Long = 16384 } diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/TileSetScenesCollectionSource.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/TileSetScenesCollectionSource.kt index 8eef28bc6..e5cfd21a9 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/TileSetScenesCollectionSource.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/TileSetScenesCollectionSource.kt @@ -22,11 +22,11 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * Exposes a set of scenes as tiles for a [godot.TileSet] resource. - * - * When placed on a [godot.TileMap], tiles from [godot.TileSetScenesCollectionSource] will automatically instantiate an associated scene at the cell's position in the TileMap. - * - * Scenes are instantiated as children of the [godot.TileMap] when it enters the tree. If you add/remove a scene tile in the [godot.TileMap] that is already inside the tree, the [godot.TileMap] will automatically instantiate/free the scene accordingly. + * When placed on a [TileMap], tiles from [TileSetScenesCollectionSource] will automatically + * instantiate an associated scene at the cell's position in the TileMap. + * Scenes are instantiated as children of the [TileMap] when it enters the tree. If you add/remove a + * scene tile in the [TileMap] that is already inside the tree, the [TileMap] will automatically + * instantiate/free the scene accordingly. */ @GodotBaseType public open class TileSetScenesCollectionSource : TileSetSource() { @@ -45,7 +45,7 @@ public open class TileSetScenesCollectionSource : TileSetSource() { } /** - * Returns the scene tile ID of the scene tile at [index]. + * Returns the scene tile ID of the scene tile at [param index]. */ public fun getSceneTileId(index: Int): Int { TransferContext.writeArguments(LONG to index.toLong()) @@ -54,7 +54,7 @@ public open class TileSetScenesCollectionSource : TileSetSource() { } /** - * Returns whether this TileSet source has a scene tile with [id]. + * Returns whether this TileSet source has a scene tile with [param id]. */ public fun hasSceneTileId(id: Int): Boolean { TransferContext.writeArguments(LONG to id.toLong()) @@ -64,7 +64,6 @@ public open class TileSetScenesCollectionSource : TileSetSource() { /** * Creates a scene-based tile out of the given scene. - * * Returns a newly generated unique ID. */ @JvmOverloads @@ -75,7 +74,8 @@ public open class TileSetScenesCollectionSource : TileSetSource() { } /** - * Changes a scene tile's ID from [id] to [newId]. This will fail if there is already a tile with an ID equal to [newId]. + * Changes a scene tile's ID from [param id] to [param new_id]. This will fail if there is already + * a tile with an ID equal to [param new_id]. */ public fun setSceneTileId(id: Int, newId: Int): Unit { TransferContext.writeArguments(LONG to id.toLong(), LONG to newId.toLong()) @@ -83,7 +83,9 @@ public open class TileSetScenesCollectionSource : TileSetSource() { } /** - * Assigns a [godot.PackedScene] resource to the scene tile with [id]. This will fail if the scene does not extend CanvasItem, as positioning properties are needed to place the scene on the TileMap. + * Assigns a [PackedScene] resource to the scene tile with [param id]. This will fail if the scene + * does not extend CanvasItem, as positioning properties are needed to place the scene on the + * TileMap. */ public fun setSceneTileScene(id: Int, packedScene: PackedScene): Unit { TransferContext.writeArguments(LONG to id.toLong(), OBJECT to packedScene) @@ -91,7 +93,7 @@ public open class TileSetScenesCollectionSource : TileSetSource() { } /** - * Returns the [godot.PackedScene] resource of scene tile with [id]. + * Returns the [PackedScene] resource of scene tile with [param id]. */ public fun getSceneTileScene(id: Int): PackedScene? { TransferContext.writeArguments(LONG to id.toLong()) @@ -100,7 +102,8 @@ public open class TileSetScenesCollectionSource : TileSetSource() { } /** - * Sets whether or not the scene tile with [id] should display a placeholder in the editor. This might be useful for scenes that are not visible. + * Sets whether or not the scene tile with [param id] should display a placeholder in the editor. + * This might be useful for scenes that are not visible. */ public fun setSceneTileDisplayPlaceholder(id: Int, displayPlaceholder: Boolean): Unit { TransferContext.writeArguments(LONG to id.toLong(), BOOL to displayPlaceholder) @@ -108,7 +111,7 @@ public open class TileSetScenesCollectionSource : TileSetSource() { } /** - * Returns whether the scene tile with [id] displays a placeholder in the editor. + * Returns whether the scene tile with [param id] displays a placeholder in the editor. */ public fun getSceneTileDisplayPlaceholder(id: Int): Boolean { TransferContext.writeArguments(LONG to id.toLong()) @@ -117,7 +120,7 @@ public open class TileSetScenesCollectionSource : TileSetSource() { } /** - * Remove the scene tile with [id]. + * Remove the scene tile with [param id]. */ public fun removeSceneTile(id: Int): Unit { TransferContext.writeArguments(LONG to id.toLong()) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/TileSetSource.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/TileSetSource.kt index b28a571e3..710a638fb 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/TileSetSource.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/TileSetSource.kt @@ -20,17 +20,16 @@ import kotlin.Long import kotlin.Suppress /** - * Exposes a set of tiles for a [godot.TileSet] resource. - * - * Exposes a set of tiles for a [godot.TileSet] resource. - * - * Tiles in a source are indexed with two IDs, coordinates ID (of type Vector2i) and an alternative ID (of type int), named according to their use in the [godot.TileSetAtlasSource] class. - * - * Depending on the TileSet source type, those IDs might have restrictions on their values, this is why the base [godot.TileSetSource] class only exposes getters for them. - * - * You can iterate over all tiles exposed by a TileSetSource by first iterating over coordinates IDs using [getTilesCount] and [getTileId], then over alternative IDs using [getAlternativeTilesCount] and [getAlternativeTileId]. - * - * **Warning:** [godot.TileSetSource] can only be added to one TileSet at the same time. Calling [godot.TileSet.addSource] on a second [godot.TileSet] will remove the source from the first one. + * Exposes a set of tiles for a [TileSet] resource. + * Tiles in a source are indexed with two IDs, coordinates ID (of type Vector2i) and an alternative + * ID (of type int), named according to their use in the [TileSetAtlasSource] class. + * Depending on the TileSet source type, those IDs might have restrictions on their values, this is + * why the base [TileSetSource] class only exposes getters for them. + * You can iterate over all tiles exposed by a TileSetSource by first iterating over coordinates IDs + * using [getTilesCount] and [getTileId], then over alternative IDs using [getAlternativeTilesCount] + * and [getAlternativeTileId]. + * **Warning:** [TileSetSource] can only be added to one TileSet at the same time. Calling + * [TileSet.addSource] on a second [TileSet] will remove the source from the first one. */ @GodotBaseType public open class TileSetSource internal constructor() : Resource() { @@ -49,7 +48,7 @@ public open class TileSetSource internal constructor() : Resource() { } /** - * Returns the tile coordinates ID of the tile with index [index]. + * Returns the tile coordinates ID of the tile with index [param index]. */ public fun getTileId(index: Int): Vector2i { TransferContext.writeArguments(LONG to index.toLong()) @@ -58,7 +57,7 @@ public open class TileSetSource internal constructor() : Resource() { } /** - * Returns if this atlas has a tile with coordinates ID [atlasCoords]. + * Returns if this atlas has a tile with coordinates ID [param atlas_coords]. */ public fun hasTile(atlasCoords: Vector2i): Boolean { TransferContext.writeArguments(VECTOR2I to atlasCoords) @@ -67,10 +66,9 @@ public open class TileSetSource internal constructor() : Resource() { } /** - * Returns the number of alternatives tiles for the coordinates ID [atlasCoords]. - * - * For [godot.TileSetAtlasSource], this always return at least 1, as the base tile with ID 0 is always part of the alternatives list. - * + * Returns the number of alternatives tiles for the coordinates ID [param atlas_coords]. + * For [TileSetAtlasSource], this always return at least 1, as the base tile with ID 0 is always + * part of the alternatives list. * Returns -1 if there is not tile at the given coords. */ public fun getAlternativeTilesCount(atlasCoords: Vector2i): Int { @@ -80,7 +78,8 @@ public open class TileSetSource internal constructor() : Resource() { } /** - * Returns the alternative ID for the tile with coordinates ID [atlasCoords] at index [index]. + * Returns the alternative ID for the tile with coordinates ID [param atlas_coords] at index + * [param index]. */ public fun getAlternativeTileId(atlasCoords: Vector2i, index: Int): Int { TransferContext.writeArguments(VECTOR2I to atlasCoords, LONG to index.toLong()) @@ -89,7 +88,8 @@ public open class TileSetSource internal constructor() : Resource() { } /** - * Returns if the base tile at coordinates [atlasCoords] has an alternative with ID [alternativeTile]. + * Returns if the base tile at coordinates [param atlas_coords] has an alternative with ID [param + * alternative_tile]. */ public fun hasAlternativeTile(atlasCoords: Vector2i, alternativeTile: Int): Boolean { TransferContext.writeArguments(VECTOR2I to atlasCoords, LONG to alternativeTile.toLong()) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Timer.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Timer.kt index f78bf8d86..68095eb67 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Timer.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Timer.kt @@ -25,16 +25,11 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * A countdown timer. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/515](https://godotengine.org/asset-library/asset/515) - * - * Counts down a specified interval and emits a signal on reaching 0. Can be set to repeat or "one-shot" mode. - * - * **Note:** Timers are affected by [godot.Engine.timeScale], a higher scale means quicker timeouts, and vice versa. - * - * **Note:** To create a one-shot timer without instantiating a node, use [godot.SceneTree.createTimer]. + * Counts down a specified interval and emits a signal on reaching 0. Can be set to repeat or + * "one-shot" mode. + * **Note:** Timers are affected by [Engine.timeScale], a higher scale means quicker timeouts, and + * vice versa. + * **Note:** To create a one-shot timer without instantiating a node, use [SceneTree.createTimer]. */ @GodotBaseType public open class Timer : Node() { @@ -59,8 +54,12 @@ public open class Timer : Node() { /** * The wait time in seconds. - * - * **Note:** Timers can only emit once per rendered frame at most (or once per physics frame if [processCallback] is [TIMER_PROCESS_PHYSICS]). This means very low wait times (lower than 0.05 seconds) will behave in significantly different ways depending on the rendered framerate. For very low wait times, it is recommended to use a process loop in a script instead of using a Timer node. Timers are affected by [godot.Engine.timeScale], a higher scale means quicker timeouts, and vice versa. + * **Note:** Timers can only emit once per rendered frame at most (or once per physics frame if + * [processCallback] is [constant TIMER_PROCESS_PHYSICS]). This means very low wait times (lower than + * 0.05 seconds) will behave in significantly different ways depending on the rendered framerate. For + * very low wait times, it is recommended to use a process loop in a script instead of using a Timer + * node. Timers are affected by [Engine.timeScale], a higher scale means quicker timeouts, and vice + * versa. */ public var waitTime: Double get() { @@ -89,8 +88,8 @@ public open class Timer : Node() { /** * If `true`, the timer will automatically start when entering the scene tree. - * - * **Note:** This property is automatically set to `false` after the timer enters the scene tree and starts. + * **Note:** This property is automatically set to `false` after the timer enters the scene tree + * and starts. */ public var autostart: Boolean get() { @@ -104,7 +103,8 @@ public open class Timer : Node() { } /** - * If `true`, the timer is paused and will not process until it is unpaused again, even if [start] is called. + * If `true`, the timer is paused and will not process until it is unpaused again, even if [start] + * is called. */ public var paused: Boolean get() { @@ -119,8 +119,8 @@ public open class Timer : Node() { /** * The timer's remaining time in seconds. Returns 0 if the timer is inactive. - * - * **Note:** This value is read-only and cannot be set. It is based on [waitTime], which can be set using [start]. + * **Note:** This value is read-only and cannot be set. It is based on [waitTime], which can be + * set using [start]. */ public val timeLeft: Double get() { @@ -135,8 +135,8 @@ public open class Timer : Node() { } /** - * Starts the timer. Sets [waitTime] to [timeSec] if `time_sec > 0`. This also resets the remaining time to [waitTime]. - * + * Starts the timer. Sets [waitTime] to [param time_sec] if `time_sec > 0`. This also resets the + * remaining time to [waitTime]. * **Note:** This method will not resume a paused timer. See [paused]. */ @JvmOverloads @@ -166,11 +166,12 @@ public open class Timer : Node() { id: Long, ) { /** - * Update the timer during physics frames (see [godot.Node.NOTIFICATION_INTERNAL_PHYSICS_PROCESS]). + * Update the timer during physics frames (see [constant + * Node.NOTIFICATION_INTERNAL_PHYSICS_PROCESS]). */ TIMER_PROCESS_PHYSICS(0), /** - * Update the timer during process frames (see [godot.Node.NOTIFICATION_INTERNAL_PROCESS]). + * Update the timer during process frames (see [constant Node.NOTIFICATION_INTERNAL_PROCESS]). */ TIMER_PROCESS_IDLE(1), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/TorusMesh.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/TorusMesh.kt index 6a8d651c5..c1084754d 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/TorusMesh.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/TorusMesh.kt @@ -21,9 +21,7 @@ import kotlin.Long import kotlin.Suppress /** - * Class representing a torus [godot.PrimitiveMesh]. - * - * Class representing a torus [godot.PrimitiveMesh]. + * Class representing a torus [PrimitiveMesh]. */ @GodotBaseType public open class TorusMesh : PrimitiveMesh() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/TouchScreenButton.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/TouchScreenButton.kt index 27f4fcbfd..93b6423b7 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/TouchScreenButton.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/TouchScreenButton.kt @@ -24,13 +24,15 @@ import kotlin.String import kotlin.Suppress /** - * Button for touch screen devices for gameplay use. - * - * TouchScreenButton allows you to create on-screen buttons for touch devices. It's intended for gameplay use, such as a unit you have to touch to move. Unlike [godot.Button], TouchScreenButton supports multitouch out of the box. Several TouchScreenButtons can be pressed at the same time with touch input. - * - * This node inherits from [godot.Node2D]. Unlike with [godot.Control] nodes, you cannot set anchors on it. If you want to create menus or user interfaces, you may want to use [godot.Button] nodes instead. To make button nodes react to touch events, you can enable the Emulate Mouse option in the Project Settings. - * - * You can configure TouchScreenButton to be visible only on touch devices, helping you develop your game both for desktop and mobile devices. + * TouchScreenButton allows you to create on-screen buttons for touch devices. It's intended for + * gameplay use, such as a unit you have to touch to move. Unlike [Button], TouchScreenButton supports + * multitouch out of the box. Several TouchScreenButtons can be pressed at the same time with touch + * input. + * This node inherits from [Node2D]. Unlike with [Control] nodes, you cannot set anchors on it. If + * you want to create menus or user interfaces, you may want to use [Button] nodes instead. To make + * button nodes react to touch events, you can enable the Emulate Mouse option in the Project Settings. + * You can configure TouchScreenButton to be visible only on touch devices, helping you develop your + * game both for desktop and mobile devices. */ @GodotBaseType public open class TouchScreenButton : Node2D() { @@ -101,7 +103,8 @@ public open class TouchScreenButton : Node2D() { } /** - * If `true`, the button's shape is centered in the provided texture. If no texture is used, this property has no effect. + * If `true`, the button's shape is centered in the provided texture. If no texture is used, this + * property has no effect. */ public var shapeCentered: Boolean get() { @@ -129,8 +132,9 @@ public open class TouchScreenButton : Node2D() { } /** - * If `true`, the [pressed] and [released] signals are emitted whenever a pressed finger goes in and out of the button, even if the pressure started outside the active area of the button. - * + * If `true`, the [signal pressed] and [signal released] signals are emitted whenever a pressed + * finger goes in and out of the button, even if the pressure started outside the active area of the + * button. * **Note:** This is a "pass-by" (not "bypass") press mode. */ public var passbyPress: Boolean @@ -145,7 +149,7 @@ public open class TouchScreenButton : Node2D() { } /** - * The button's action. Actions can be handled with [godot.InputEventAction]. + * The button's action. Actions can be handled with [InputEventAction]. */ public var action: String get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Translation.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Translation.kt index 2b404312a..e6969dcee 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Translation.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Translation.kt @@ -27,12 +27,9 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * A language translation that maps a collection of strings to their individual translations. - * - * Tutorials: - * [$DOCS_URL/tutorials/i18n/locales.html]($DOCS_URL/tutorials/i18n/locales.html) - * - * [godot.Translation]s are resources that can be loaded and unloaded on demand. They map a collection of strings to their individual translations, and they also provide convenience methods for pluralization. + * [Translation]s are resources that can be loaded and unloaded on demand. They map a collection of + * strings to their individual translations, and they also provide convenience methods for + * pluralization. */ @GodotBaseType public open class Translation : Resource() { @@ -76,8 +73,8 @@ public open class Translation : Resource() { /** * Adds a message if nonexistent, followed by its translation. - * - * An additional context could be used to specify the translation context or differentiate polysemic words. + * An additional context could be used to specify the translation context or differentiate + * polysemic words. */ @JvmOverloads public fun addMessage( @@ -91,8 +88,8 @@ public open class Translation : Resource() { /** * Adds a message involving plural translation if nonexistent, followed by its translation. - * - * An additional context could be used to specify the translation context or differentiate polysemic words. + * An additional context could be used to specify the translation context or differentiate + * polysemic words. */ @JvmOverloads public fun addPluralMessage( @@ -116,8 +113,8 @@ public open class Translation : Resource() { /** * Returns a message's translation involving plurals. - * - * The number [n] is the number or quantity of the plural object. It will be used to guide the translation system to fetch the correct plural form for the selected language. + * The number [param n] is the number or quantity of the plural object. It will be used to guide + * the translation system to fetch the correct plural form for the selected language. */ @JvmOverloads public fun getPluralMessage( diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/TranslationServer.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/TranslationServer.kt index f81cfd21b..6cad46595 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/TranslationServer.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/TranslationServer.kt @@ -28,12 +28,8 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * The server responsible for language translations. - * - * Tutorials: - * [$DOCS_URL/tutorials/i18n/locales.html]($DOCS_URL/tutorials/i18n/locales.html) - * - * The server that manages all language translations. Translations can be added to or removed from it. + * The server that manages all language translations. Translations can be added to or removed from + * it. */ @GodotBaseType public object TranslationServer : Object() { @@ -43,8 +39,8 @@ public object TranslationServer : Object() { } /** - * Sets the locale of the project. The [locale] string will be standardized to match known locales (e.g. `en-US` would be matched to `en_US`). - * + * Sets the locale of the project. The [param locale] string will be standardized to match known + * locales (e.g. `en-US` would be matched to `en_US`). * If translations have been loaded beforehand for the new locale, they will be applied. */ public fun setLocale(locale: String): Unit { @@ -54,8 +50,7 @@ public object TranslationServer : Object() { /** * Returns the current locale of the project. - * - * See also [godot.OS.getLocale] and [godot.OS.getLocaleLanguage] to query the locale of the user system. + * See also [OS.getLocale] and [OS.getLocaleLanguage] to query the locale of the user system. */ public fun getLocale(): String { TransferContext.writeArguments() @@ -65,7 +60,6 @@ public object TranslationServer : Object() { /** * Returns the current locale of the editor. - * * **Note:** When called from an exported project returns the same value as [getLocale]. */ public fun getToolLocale(): String { @@ -75,7 +69,8 @@ public object TranslationServer : Object() { } /** - * Compares two locales and returns a similarity score between `0` (no match) and `10` (full match). + * Compares two locales and returns a similarity score between `0` (no match) and `10` (full + * match). */ public fun compareLocales(localeA: String, localeB: String): Int { TransferContext.writeArguments(STRING to localeA, STRING to localeB) @@ -84,7 +79,8 @@ public object TranslationServer : Object() { } /** - * Returns a [locale] string standardized to match known locales (e.g. `en-US` would be matched to `en_US`). + * Returns a [param locale] string standardized to match known locales (e.g. `en-US` would be + * matched to `en_US`). */ public fun standardizeLocale(locale: String): String { TransferContext.writeArguments(STRING to locale) @@ -102,7 +98,7 @@ public object TranslationServer : Object() { } /** - * Returns a readable language name for the [language] code. + * Returns a readable language name for the [param language] code. */ public fun getLanguageName(language: String): String { TransferContext.writeArguments(STRING to language) @@ -120,7 +116,7 @@ public object TranslationServer : Object() { } /** - * Returns a readable script name for the [script] code. + * Returns a readable script name for the [param script] code. */ public fun getScriptName(script: String): String { TransferContext.writeArguments(STRING to script) @@ -138,7 +134,7 @@ public object TranslationServer : Object() { } /** - * Returns a readable country name for the [country] code. + * Returns a readable country name for the [param country] code. */ public fun getCountryName(country: String): String { TransferContext.writeArguments(STRING to country) @@ -147,7 +143,8 @@ public object TranslationServer : Object() { } /** - * Returns a locale's language and its variant (e.g. `"en_US"` would return `"English (United States)"`). + * Returns a locale's language and its variant (e.g. `"en_US"` would return `"English (United + * States)"`). */ public fun getLocaleName(locale: String): String { TransferContext.writeArguments(STRING to locale) @@ -166,9 +163,10 @@ public object TranslationServer : Object() { } /** - * Returns the current locale's translation for the given message (key), plural message and context. - * - * The number [n] is the number or quantity of the plural object. It will be used to guide the translation system to fetch the correct plural form for the selected language. + * Returns the current locale's translation for the given message (key), plural message and + * context. + * The number [param n] is the number or quantity of the plural object. It will be used to guide + * the translation system to fetch the correct plural form for the selected language. */ @JvmOverloads public fun translatePlural( @@ -183,7 +181,7 @@ public object TranslationServer : Object() { } /** - * Adds a [godot.Translation] resource. + * Adds a [Translation] resource. */ public fun addTranslation(translation: Translation): Unit { TransferContext.writeArguments(OBJECT to translation) @@ -199,9 +197,8 @@ public object TranslationServer : Object() { } /** - * Returns the [godot.Translation] instance based on the [locale] passed in. - * - * It will return `null` if there is no [godot.Translation] instance that matches the [locale]. + * Returns the [Translation] instance based on the [param locale] passed in. + * It will return `null` if there is no [Translation] instance that matches the [param locale]. */ public fun getTranslationObject(locale: String): Translation? { TransferContext.writeArguments(STRING to locale) @@ -246,7 +243,7 @@ public object TranslationServer : Object() { } /** - * Returns the pseudolocalized string based on the [message] passed in. + * Returns the pseudolocalized string based on the [param message] passed in. */ public fun pseudolocalize(message: StringName): StringName { TransferContext.writeArguments(STRING_NAME to message) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Tree.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Tree.kt index b63057256..3a3184410 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Tree.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Tree.kt @@ -34,63 +34,49 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * A control used to show a set of internal [godot.TreeItem]s in a hierarchical structure. - * - * A control used to show a set of internal [godot.TreeItem]s in a hierarchical structure. The tree items can be selected, expanded and collapsed. The tree can have multiple columns with custom controls like [godot.LineEdit]s, buttons and popups. It can be useful for structured displays and interactions. - * - * Trees are built via code, using [godot.TreeItem] objects to create the structure. They have a single root, but multiple roots can be simulated with [hideRoot]: - * - * [codeblocks] - * - * [gdscript] + * A control used to show a set of internal [TreeItem]s in a hierarchical structure. The tree items + * can be selected, expanded and collapsed. The tree can have multiple columns with custom controls + * like [LineEdit]s, buttons and popups. It can be useful for structured displays and interactions. + * Trees are built via code, using [TreeItem] objects to create the structure. They have a single + * root, but multiple roots can be simulated with [hideRoot]: * + * gdscript: + * ```gdscript * func _ready(): - * * var tree = Tree.new() - * * var root = tree.create_item() - * * tree.hide_root = true - * * var child1 = tree.create_item(root) - * * var child2 = tree.create_item(root) - * * var subchild1 = tree.create_item(child1) - * * subchild1.set_text(0, "Subchild1") - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * public override void _Ready() - * * { - * * var tree = new Tree(); - * * TreeItem root = tree.CreateItem(); - * * tree.HideRoot = true; - * * TreeItem child1 = tree.CreateItem(root); - * * TreeItem child2 = tree.CreateItem(root); - * * TreeItem subchild1 = tree.CreateItem(child1); - * * subchild1.SetText(0, "Subchild1"); - * * } + * ``` * - * [/csharp] - * - * [/codeblocks] - * - * To iterate over all the [godot.TreeItem] objects in a [godot.Tree] object, use [godot.TreeItem.getNext] and [godot.TreeItem.getFirstChild] after getting the root through [getRoot]. You can use [godot.Object.free] on a [godot.TreeItem] to remove it from the [godot.Tree]. - * - * **Incremental search:** Like [godot.ItemList] and [godot.PopupMenu], [godot.Tree] supports searching within the list while the control is focused. Press a key that matches the first letter of an item's name to select the first item starting with the given letter. After that point, there are two ways to perform incremental search: 1) Press the same key again before the timeout duration to select the next item starting with the same letter. 2) Press letter keys that match the rest of the word before the timeout duration to match to select the item in question directly. Both of these actions will be reset to the beginning of the list if the timeout duration has passed since the last keystroke was registered. You can adjust the timeout duration by changing [godot.ProjectSettings.gui/timers/incrementalSearchMaxIntervalMsec]. + * To iterate over all the [TreeItem] objects in a [Tree] object, use [TreeItem.getNext] and + * [TreeItem.getFirstChild] after getting the root through [getRoot]. You can use [Object.free] on a + * [TreeItem] to remove it from the [Tree]. + * **Incremental search:** Like [ItemList] and [PopupMenu], [Tree] supports searching within the + * list while the control is focused. Press a key that matches the first letter of an item's name to + * select the first item starting with the given letter. After that point, there are two ways to + * perform incremental search: 1) Press the same key again before the timeout duration to select the + * next item starting with the same letter. 2) Press letter keys that match the rest of the word before + * the timeout duration to match to select the item in question directly. Both of these actions will be + * reset to the beginning of the list if the timeout duration has passed since the last keystroke was + * registered. You can adjust the timeout duration by changing + * [ProjectSettings.gui/timers/incrementalSearchMaxIntervalMsec]. */ @GodotBaseType public open class Tree : Control() { @@ -105,7 +91,7 @@ public open class Tree : Control() { public val cellSelected: Signal0 by signal() /** - * Emitted instead of [itemSelected] if [selectMode] is set to [SELECT_MULTI]. + * Emitted instead of [signal item_selected] if [selectMode] is set to [constant SELECT_MULTI]. */ public val multiSelected: Signal3 by signal("item", "column", "selected") @@ -125,12 +111,13 @@ public open class Tree : Control() { public val itemEdited: Signal0 by signal() /** - * Emitted when an item with [godot.TreeItem.CELL_MODE_CUSTOM] is clicked with a mouse button. + * Emitted when an item with [constant TreeItem.CELL_MODE_CUSTOM] is clicked with a mouse button. */ public val customItemClicked: Signal1 by signal("mouseButtonIndex") /** - * Emitted when an item's icon is double-clicked. For a signal that emits when any part of the item is double-clicked, see [itemActivated]. + * Emitted when an item's icon is double-clicked. For a signal that emits when any part of the + * item is double-clicked, see [signal item_activated]. */ public val itemIconDoubleClicked: Signal0 by signal() @@ -140,28 +127,33 @@ public open class Tree : Control() { public val itemCollapsed: Signal1 by signal("item") /** - * Emitted when [godot.TreeItem.propagateCheck] is called. Connect to this signal to process the items that are affected when [godot.TreeItem.propagateCheck] is invoked. The order that the items affected will be processed is as follows: the item that invoked the method, children of that item, and finally parents of that item. + * Emitted when [TreeItem.propagateCheck] is called. Connect to this signal to process the items + * that are affected when [TreeItem.propagateCheck] is invoked. The order that the items affected + * will be processed is as follows: the item that invoked the method, children of that item, and + * finally parents of that item. */ public val checkPropagatedToItem: Signal2 by signal("item", "column") /** - * Emitted when a button on the tree was pressed (see [godot.TreeItem.addButton]). + * Emitted when a button on the tree was pressed (see [TreeItem.addButton]). */ public val buttonClicked: Signal4 by signal("item", "column", "id", "mouseButtonIndex") /** - * Emitted when a cell with the [godot.TreeItem.CELL_MODE_CUSTOM] is clicked to be edited. + * Emitted when a cell with the [constant TreeItem.CELL_MODE_CUSTOM] is clicked to be edited. */ public val customPopupEdited: Signal1 by signal("arrowClicked") /** - * Emitted when an item is double-clicked, or selected with a `ui_accept` input event (e.g. using [kbd]Enter[/kbd] or [kbd]Space[/kbd] on the keyboard). + * Emitted when an item is double-clicked, or selected with a `ui_accept` input event (e.g. using + * [kbd]Enter[/kbd] or [kbd]Space[/kbd] on the keyboard). */ public val itemActivated: Signal0 by signal() /** - * Emitted when a column's title is clicked with either [MOUSE_BUTTON_LEFT] or [MOUSE_BUTTON_RIGHT]. + * Emitted when a column's title is clicked with either [constant MOUSE_BUTTON_LEFT] or [constant + * MOUSE_BUTTON_RIGHT]. */ public val columnTitleClicked: Signal2 by signal("column", "mouseButtonIndex") @@ -227,7 +219,7 @@ public open class Tree : Control() { } /** - * If `true`, allows navigating the [godot.Tree] with letter keys through incremental search. + * If `true`, allows navigating the [Tree] with letter keys through incremental search. */ public var allowSearch: Boolean get() { @@ -255,7 +247,8 @@ public open class Tree : Control() { } /** - * If `true`, recursive folding is enabled for this [godot.Tree]. Holding down Shift while clicking the fold arrow collapses or uncollapses the [godot.TreeItem] and all its descendants. + * If `true`, recursive folding is enabled for this [Tree]. Holding down Shift while clicking the + * fold arrow collapses or uncollapses the [TreeItem] and all its descendants. */ public var enableRecursiveFolding: Boolean get() { @@ -283,9 +276,11 @@ public open class Tree : Control() { } /** - * The drop mode as an OR combination of flags. See [enum DropModeFlags] constants. Once dropping is done, reverts to [DROP_MODE_DISABLED]. Setting this during [godot.Control.CanDropData] is recommended. - * - * This controls the drop sections, i.e. the decision and drawing of possible drop locations based on the mouse position. + * The drop mode as an OR combination of flags. See [enum DropModeFlags] constants. Once dropping + * is done, reverts to [constant DROP_MODE_DISABLED]. Setting this during [Control.CanDropData] is + * recommended. + * This controls the drop sections, i.e. the decision and drawing of possible drop locations based + * on the mouse position. */ public var dropModeFlags: Int get() { @@ -354,11 +349,12 @@ public open class Tree : Control() { } /** - * Creates an item in the tree and adds it as a child of [parent], which can be either a valid [godot.TreeItem] or `null`. - * - * If [parent] is `null`, the root item will be the parent, or the new item will be the root itself if the tree is empty. - * - * The new item will be the [index]-th child of parent, or it will be the last child if there are not enough siblings. + * Creates an item in the tree and adds it as a child of [param parent], which can be either a + * valid [TreeItem] or `null`. + * If [param parent] is `null`, the root item will be the parent, or the new item will be the root + * itself if the tree is empty. + * The new item will be the [param index]-th child of parent, or it will be the last child if + * there are not enough siblings. */ @JvmOverloads public fun createItem(parent: TreeItem? = null, index: Int = -1): TreeItem? { @@ -377,7 +373,9 @@ public open class Tree : Control() { } /** - * Overrides the calculated minimum width of a column. It can be set to `0` to restore the default behavior. Columns that have the "Expand" flag will use their "min_width" in a similar fashion to [godot.Control.sizeFlagsStretchRatio]. + * Overrides the calculated minimum width of a column. It can be set to `0` to restore the default + * behavior. Columns that have the "Expand" flag will use their "min_width" in a similar fashion to + * [Control.sizeFlagsStretchRatio]. */ public fun setColumnCustomMinimumWidth(column: Int, minWidth: Int): Unit { TransferContext.writeArguments(LONG to column.toLong(), LONG to minWidth.toLong()) @@ -385,7 +383,9 @@ public open class Tree : Control() { } /** - * If `true`, the column will have the "Expand" flag of [godot.Control]. Columns that have the "Expand" flag will use their expand ratio in a similar fashion to [godot.Control.sizeFlagsStretchRatio] (see [setColumnExpandRatio]). + * If `true`, the column will have the "Expand" flag of [Control]. Columns that have the "Expand" + * flag will use their expand ratio in a similar fashion to [Control.sizeFlagsStretchRatio] (see + * [setColumnExpandRatio]). */ public fun setColumnExpand(column: Int, expand: Boolean): Unit { TransferContext.writeArguments(LONG to column.toLong(), BOOL to expand) @@ -445,9 +445,8 @@ public open class Tree : Control() { } /** - * Returns the next selected [godot.TreeItem] after the given one, or `null` if the end is reached. - * - * If [from] is `null`, this returns the first selected item. + * Returns the next selected [TreeItem] after the given one, or `null` if the end is reached. + * If [param from] is `null`, this returns the first selected item. */ public fun getNextSelected(from: TreeItem): TreeItem? { TransferContext.writeArguments(OBJECT to from) @@ -457,9 +456,9 @@ public open class Tree : Control() { /** * Returns the currently focused item, or `null` if no item is focused. - * - * In [SELECT_ROW] and [SELECT_SINGLE] modes, the focused item is same as the selected item. In [SELECT_MULTI] mode, the focused item is the item under the focus cursor, not necessarily selected. - * + * In [constant SELECT_ROW] and [constant SELECT_SINGLE] modes, the focused item is same as the + * selected item. In [constant SELECT_MULTI] mode, the focused item is the item under the focus + * cursor, not necessarily selected. * To get the currently selected item(s), use [getNextSelected]. */ public fun getSelected(): TreeItem? { @@ -469,7 +468,7 @@ public open class Tree : Control() { } /** - * Selects the specified [godot.TreeItem] and column. + * Selects the specified [TreeItem] and column. */ public fun setSelected(item: TreeItem, column: Int): Unit { TransferContext.writeArguments(OBJECT to item, LONG to column.toLong()) @@ -478,10 +477,11 @@ public open class Tree : Control() { /** * Returns the currently focused column, or -1 if no column is focused. - * - * In [SELECT_SINGLE] mode, the focused column is the selected column. In [SELECT_ROW] mode, the focused column is always 0 if any item is selected. In [SELECT_MULTI] mode, the focused column is the column under the focus cursor, and there are not necessarily any column selected. - * - * To tell whether a column of an item is selected, use [godot.TreeItem.isSelected]. + * In [constant SELECT_SINGLE] mode, the focused column is the selected column. In [constant + * SELECT_ROW] mode, the focused column is always 0 if any item is selected. In [constant + * SELECT_MULTI] mode, the focused column is the column under the focus cursor, and there are not + * necessarily any column selected. + * To tell whether a column of an item is selected, use [TreeItem.isSelected]. */ public fun getSelectedColumn(): Int { TransferContext.writeArguments() @@ -499,7 +499,8 @@ public open class Tree : Control() { } /** - * Deselects all tree items (rows and columns). In [SELECT_MULTI] mode also removes selection cursor. + * Deselects all tree items (rows and columns). In [constant SELECT_MULTI] mode also removes + * selection cursor. */ public fun deselectAll(): Unit { TransferContext.writeArguments() @@ -507,47 +508,29 @@ public open class Tree : Control() { } /** - * Returns the currently edited item. Can be used with [itemEdited] to get the item that was modified. - * - * [codeblocks] - * - * [gdscript] + * Returns the currently edited item. Can be used with [signal item_edited] to get the item that + * was modified. * + * gdscript: + * ```gdscript * func _ready(): - * * $Tree.item_edited.connect(on_Tree_item_edited) * - * - * * func on_Tree_item_edited(): - * * print($Tree.get_edited()) # This item just got edited (e.g. checked). - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * public override void _Ready() - * * { - * * GetNode("Tree").ItemEdited += OnTreeItemEdited; - * * } * - * - * * public void OnTreeItemEdited() - * * { - * * GD.Print(GetNode("Tree").GetEdited()); // This item just got edited (e.g. checked). - * * } - * - * [/csharp] - * - * [/codeblocks] + * ``` */ public fun getEdited(): TreeItem? { TransferContext.writeArguments() @@ -566,9 +549,8 @@ public open class Tree : Control() { /** * Edits the selected tree item as if it was clicked. - * - * Either the item must be set editable with [godot.TreeItem.setEditable] or [forceEdit] must be `true`. - * + * Either the item must be set editable with [TreeItem.setEditable] or [param force_edit] must be + * `true`. * Returns `true` if the item could be edited. Fails if no item is selected. */ @JvmOverloads @@ -579,7 +561,8 @@ public open class Tree : Control() { } /** - * Returns the rectangle for custom popups. Helper to create custom cell controls that display a popup. See [godot.TreeItem.setCellMode]. + * Returns the rectangle for custom popups. Helper to create custom cell controls that display a + * popup. See [TreeItem.setCellMode]. */ public fun getCustomPopupRect(): Rect2 { TransferContext.writeArguments() @@ -588,7 +571,9 @@ public open class Tree : Control() { } /** - * Returns the rectangle area for the specified [godot.TreeItem]. If [column] is specified, only get the position and size of that column, otherwise get the rectangle containing all columns. If a button index is specified, the rectangle of that button will be returned. + * Returns the rectangle area for the specified [TreeItem]. If [param column] is specified, only + * get the position and size of that column, otherwise get the rectangle containing all columns. If a + * button index is specified, the rectangle of that button will be returned. */ @JvmOverloads public fun getItemAreaRect( @@ -611,7 +596,7 @@ public open class Tree : Control() { } /** - * Returns the column index at [position], or -1 if no item is there. + * Returns the column index at [param position], or -1 if no item is there. */ public fun getColumnAtPosition(position: Vector2): Int { TransferContext.writeArguments(VECTOR2 to position) @@ -620,10 +605,9 @@ public open class Tree : Control() { } /** - * Returns the drop section at [position], or -100 if no item is there. - * - * Values -1, 0, or 1 will be returned for the "above item", "on item", and "below item" drop sections, respectively. See [enum DropModeFlags] for a description of each drop section. - * + * Returns the drop section at [param position], or -100 if no item is there. + * Values -1, 0, or 1 will be returned for the "above item", "on item", and "below item" drop + * sections, respectively. See [enum DropModeFlags] for a description of each drop section. * To get the item which the returned drop section is relative to, use [getItemAtPosition]. */ public fun getDropSectionAtPosition(position: Vector2): Int { @@ -633,7 +617,7 @@ public open class Tree : Control() { } /** - * Returns the button ID at [position], or -1 if no button is there. + * Returns the button ID at [param position], or -1 if no button is there. */ public fun getButtonIdAtPosition(position: Vector2): Int { TransferContext.writeArguments(VECTOR2 to position) @@ -643,10 +627,10 @@ public open class Tree : Control() { /** * Makes the currently focused cell visible. - * - * This will scroll the tree if necessary. In [SELECT_ROW] mode, this will not do horizontal scrolling, as all the cells in the selected row is focused logically. - * - * **Note:** Despite the name of this method, the focus cursor itself is only visible in [SELECT_MULTI] mode. + * This will scroll the tree if necessary. In [constant SELECT_ROW] mode, this will not do + * horizontal scrolling, as all the cells in the selected row is focused logically. + * **Note:** Despite the name of this method, the focus cursor itself is only visible in [constant + * SELECT_MULTI] mode. */ public fun ensureCursorIsVisible(): Unit { TransferContext.writeArguments() @@ -671,7 +655,8 @@ public open class Tree : Control() { } /** - * Sets the column title alignment. Note that [@GlobalScope.HORIZONTAL_ALIGNMENT_FILL] is not supported for column titles. + * Sets the column title alignment. Note that [constant @GlobalScope.HORIZONTAL_ALIGNMENT_FILL] is + * not supported for column titles. */ public fun setColumnTitleAlignment(column: Int, titleAlignment: HorizontalAlignment): Unit { TransferContext.writeArguments(LONG to column.toLong(), LONG to titleAlignment.id) @@ -705,7 +690,8 @@ public open class Tree : Control() { } /** - * Sets language code of column title used for line-breaking and text shaping algorithms, if left empty current locale is used instead. + * Sets language code of column title used for line-breaking and text shaping algorithms, if left + * empty current locale is used instead. */ public fun setColumnTitleLanguage(column: Int, language: String): Unit { TransferContext.writeArguments(LONG to column.toLong(), STRING to language) @@ -731,7 +717,7 @@ public open class Tree : Control() { } /** - * Causes the [godot.Tree] to jump to the specified [godot.TreeItem]. + * Causes the [Tree] to jump to the specified [TreeItem]. */ @JvmOverloads public fun scrollToItem(item: TreeItem, centerOnItem: Boolean = false): Unit { @@ -743,21 +729,25 @@ public open class Tree : Control() { id: Long, ) { /** - * Allows selection of a single cell at a time. From the perspective of items, only a single item is allowed to be selected. And there is only one column selected in the selected item. - * - * The focus cursor is always hidden in this mode, but it is positioned at the current selection, making the currently selected item the currently focused item. + * Allows selection of a single cell at a time. From the perspective of items, only a single + * item is allowed to be selected. And there is only one column selected in the selected item. + * The focus cursor is always hidden in this mode, but it is positioned at the current + * selection, making the currently selected item the currently focused item. */ SELECT_SINGLE(0), /** - * Allows selection of a single row at a time. From the perspective of items, only a single items is allowed to be selected. And all the columns are selected in the selected item. - * - * The focus cursor is always hidden in this mode, but it is positioned at the first column of the current selection, making the currently selected item the currently focused item. + * Allows selection of a single row at a time. From the perspective of items, only a single + * items is allowed to be selected. And all the columns are selected in the selected item. + * The focus cursor is always hidden in this mode, but it is positioned at the first column of + * the current selection, making the currently selected item the currently focused item. */ SELECT_ROW(1), /** - * Allows selection of multiple cells at the same time. From the perspective of items, multiple items are allowed to be selected. And there can be multiple columns selected in each selected item. - * - * The focus cursor is visible in this mode, the item or column under the cursor is not necessarily selected. + * Allows selection of multiple cells at the same time. From the perspective of items, multiple + * items are allowed to be selected. And there can be multiple columns selected in each selected + * item. + * The focus cursor is visible in this mode, the item or column under the cursor is not + * necessarily selected. */ SELECT_MULTI(2), ; @@ -776,21 +766,22 @@ public open class Tree : Control() { id: Long, ) { /** - * Disables all drop sections, but still allows to detect the "on item" drop section by [getDropSectionAtPosition]. - * + * Disables all drop sections, but still allows to detect the "on item" drop section by + * [getDropSectionAtPosition]. * **Note:** This is the default flag, it has no effect when combined with other flags. */ DROP_MODE_DISABLED(0), /** * Enables the "on item" drop section. This drop section covers the entire item. - * - * When combined with [DROP_MODE_INBETWEEN], this drop section halves the height and stays centered vertically. + * When combined with [constant DROP_MODE_INBETWEEN], this drop section halves the height and + * stays centered vertically. */ DROP_MODE_ON_ITEM(1), /** - * Enables "above item" and "below item" drop sections. The "above item" drop section covers the top half of the item, and the "below item" drop section covers the bottom half. - * - * When combined with [DROP_MODE_ON_ITEM], these drop sections halves the height and stays on top / bottom accordingly. + * Enables "above item" and "below item" drop sections. The "above item" drop section covers the + * top half of the item, and the "below item" drop section covers the bottom half. + * When combined with [constant DROP_MODE_ON_ITEM], these drop sections halves the height and + * stays on top / bottom accordingly. */ DROP_MODE_INBETWEEN(2), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/TreeItem.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/TreeItem.kt index cf5f09258..5ce1c3ae0 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/TreeItem.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/TreeItem.kt @@ -38,13 +38,13 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * An internal control for a single item inside [godot.Tree]. - * - * A single item of a [godot.Tree] control. It can contain other [godot.TreeItem]s as children, which allows it to create a hierarchy. It can also contain text and buttons. [godot.TreeItem] is not a [godot.Node], it is internal to the [godot.Tree]. - * - * To create a [godot.TreeItem], use [godot.Tree.createItem] or [godot.TreeItem.createChild]. To remove a [godot.TreeItem], use [godot.Object.free]. - * - * **Note:** The ID values used for buttons are 32-bit, unlike [int] which is always 64-bit. They go from `-2147483648` to `2147483647`. + * A single item of a [Tree] control. It can contain other [TreeItem]s as children, which allows it + * to create a hierarchy. It can also contain text and buttons. [TreeItem] is not a [Node], it is + * internal to the [Tree]. + * To create a [TreeItem], use [Tree.createItem] or [TreeItem.createChild]. To remove a [TreeItem], + * use [Object.free]. + * **Note:** The ID values used for buttons are 32-bit, unlike [int] which is always 64-bit. They go + * from `-2147483648` to `2147483647`. */ @GodotBaseType public open class TreeItem internal constructor() : Object() { @@ -63,9 +63,9 @@ public open class TreeItem internal constructor() : Object() { } /** - * If `true`, the [godot.TreeItem] is visible (default). - * - * Note that if a [godot.TreeItem] is set to not be visible, none of its children will be visible either. + * If `true`, the [TreeItem] is visible (default). + * Note that if a [TreeItem] is set to not be visible, none of its children will be visible + * either. */ public var visible: Boolean get() { @@ -112,7 +112,7 @@ public open class TreeItem internal constructor() : Object() { } /** - * Sets the given column's cell mode to [mode]. See [enum TreeCellMode] constants. + * Sets the given column's cell mode to [param mode]. See [enum TreeCellMode] constants. */ public fun setCellMode(column: Int, mode: TreeCellMode): Unit { TransferContext.writeArguments(LONG to column.toLong(), LONG to mode.id) @@ -129,9 +129,10 @@ public open class TreeItem internal constructor() : Object() { } /** - * If [multiline] is `true`, the given [column] is multiline editable. - * - * **Note:** This option only affects the type of control ([godot.LineEdit] or [godot.TextEdit]) that appears when editing the column. You can set multiline values with [setText] even if the column is not multiline editable. + * If [param multiline] is `true`, the given [param column] is multiline editable. + * **Note:** This option only affects the type of control ([LineEdit] or [TextEdit]) that appears + * when editing the column. You can set multiline values with [setText] even if the column is not + * multiline editable. */ public fun setEditMultiline(column: Int, multiline: Boolean): Unit { TransferContext.writeArguments(LONG to column.toLong(), BOOL to multiline) @@ -139,7 +140,7 @@ public open class TreeItem internal constructor() : Object() { } /** - * Returns `true` if the given [column] is multiline editable. + * Returns `true` if the given [param column] is multiline editable. */ public fun isEditMultiline(column: Int): Boolean { TransferContext.writeArguments(LONG to column.toLong()) @@ -148,7 +149,8 @@ public open class TreeItem internal constructor() : Object() { } /** - * If [checked] is `true`, the given [column] is checked. Clears column's indeterminate status. + * If [param checked] is `true`, the given [param column] is checked. Clears column's + * indeterminate status. */ public fun setChecked(column: Int, checked: Boolean): Unit { TransferContext.writeArguments(LONG to column.toLong(), BOOL to checked) @@ -156,8 +158,7 @@ public open class TreeItem internal constructor() : Object() { } /** - * If [indeterminate] is `true`, the given [column] is marked indeterminate. - * + * If [param indeterminate] is `true`, the given [param column] is marked indeterminate. * **Note:** If set `true` from `false`, then column is cleared of checked status. */ public fun setIndeterminate(column: Int, indeterminate: Boolean): Unit { @@ -166,7 +167,7 @@ public open class TreeItem internal constructor() : Object() { } /** - * Returns `true` if the given [column] is checked. + * Returns `true` if the given [param column] is checked. */ public fun isChecked(column: Int): Boolean { TransferContext.writeArguments(LONG to column.toLong()) @@ -175,7 +176,7 @@ public open class TreeItem internal constructor() : Object() { } /** - * Returns `true` if the given [column] is indeterminate. + * Returns `true` if the given [param column] is indeterminate. */ public fun isIndeterminate(column: Int): Boolean { TransferContext.writeArguments(LONG to column.toLong()) @@ -184,7 +185,11 @@ public open class TreeItem internal constructor() : Object() { } /** - * Propagates this item's checked status to its children and parents for the given [column]. It is possible to process the items affected by this method call by connecting to [godot.Tree.checkPropagatedToItem]. The order that the items affected will be processed is as follows: the item invoking this method, children of that item, and finally parents of that item. If [emitSignal] is `false`, then [godot.Tree.checkPropagatedToItem] will not be emitted. + * Propagates this item's checked status to its children and parents for the given [param column]. + * It is possible to process the items affected by this method call by connecting to [signal + * Tree.check_propagated_to_item]. The order that the items affected will be processed is as follows: + * the item invoking this method, children of that item, and finally parents of that item. If [param + * emit_signal] is `false`, then [signal Tree.check_propagated_to_item] will not be emitted. */ @JvmOverloads public fun propagateCheck(column: Int, emitSignal: Boolean = true): Unit { @@ -227,7 +232,8 @@ public open class TreeItem internal constructor() : Object() { } /** - * Sets the autowrap mode in the given [column]. If set to something other than [godot.TextServer.AUTOWRAP_OFF], the text gets wrapped inside the cell's bounding rectangle. + * Sets the autowrap mode in the given [param column]. If set to something other than [constant + * TextServer.AUTOWRAP_OFF], the text gets wrapped inside the cell's bounding rectangle. */ public fun setAutowrapMode(column: Int, autowrapMode: TextServer.AutowrapMode): Unit { TransferContext.writeArguments(LONG to column.toLong(), LONG to autowrapMode.id) @@ -235,7 +241,8 @@ public open class TreeItem internal constructor() : Object() { } /** - * Returns the text autowrap mode in the given [column]. By default it is [godot.TextServer.AUTOWRAP_OFF]. + * Returns the text autowrap mode in the given [param column]. By default it is [constant + * TextServer.AUTOWRAP_OFF]. */ public fun getAutowrapMode(column: Int): TextServer.AutowrapMode { TransferContext.writeArguments(LONG to column.toLong()) @@ -244,7 +251,8 @@ public open class TreeItem internal constructor() : Object() { } /** - * Sets the clipping behavior when the text exceeds the item's bounding rectangle in the given [column]. + * Sets the clipping behavior when the text exceeds the item's bounding rectangle in the given + * [param column]. */ public fun setTextOverrunBehavior(column: Int, overrunBehavior: TextServer.OverrunBehavior): Unit { @@ -253,7 +261,8 @@ public open class TreeItem internal constructor() : Object() { } /** - * Returns the clipping behavior when the text exceeds the item's bounding rectangle in the given [column]. By default it is [godot.TextServer.OVERRUN_TRIM_ELLIPSIS]. + * Returns the clipping behavior when the text exceeds the item's bounding rectangle in the given + * [param column]. By default it is [constant TextServer.OVERRUN_TRIM_ELLIPSIS]. */ public fun getTextOverrunBehavior(column: Int): TextServer.OverrunBehavior { TransferContext.writeArguments(LONG to column.toLong()) @@ -261,35 +270,23 @@ public open class TreeItem internal constructor() : Object() { return TextServer.OverrunBehavior.from(TransferContext.readReturnValue(LONG) as Long) } - /** - * - */ public fun setStructuredTextBidiOverride(column: Int, parser: TextServer.StructuredTextParser): Unit { TransferContext.writeArguments(LONG to column.toLong(), LONG to parser.id) TransferContext.callMethod(rawPtr, MethodBindings.setStructuredTextBidiOverridePtr, NIL) } - /** - * - */ public fun getStructuredTextBidiOverride(column: Int): TextServer.StructuredTextParser { TransferContext.writeArguments(LONG to column.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.getStructuredTextBidiOverridePtr, LONG) return TextServer.StructuredTextParser.from(TransferContext.readReturnValue(LONG) as Long) } - /** - * - */ public fun setStructuredTextBidiOverrideOptions(column: Int, args: VariantArray): Unit { TransferContext.writeArguments(LONG to column.toLong(), ARRAY to args) TransferContext.callMethod(rawPtr, MethodBindings.setStructuredTextBidiOverrideOptionsPtr, NIL) } - /** - * - */ public fun getStructuredTextBidiOverrideOptions(column: Int): VariantArray { TransferContext.writeArguments(LONG to column.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.getStructuredTextBidiOverrideOptionsPtr, @@ -298,7 +295,8 @@ public open class TreeItem internal constructor() : Object() { } /** - * Sets language code of item's text used for line-breaking and text shaping algorithms, if left empty current locale is used instead. + * Sets language code of item's text used for line-breaking and text shaping algorithms, if left + * empty current locale is used instead. */ public fun setLanguage(column: Int, language: String): Unit { TransferContext.writeArguments(LONG to column.toLong(), STRING to language) @@ -332,7 +330,7 @@ public open class TreeItem internal constructor() : Object() { } /** - * Sets the given column's icon [godot.Texture2D]. + * Sets the given column's icon [Texture2D]. */ public fun setIcon(column: Int, texture: Texture2D): Unit { TransferContext.writeArguments(LONG to column.toLong(), OBJECT to texture) @@ -340,7 +338,7 @@ public open class TreeItem internal constructor() : Object() { } /** - * Returns the given column's icon [godot.Texture2D]. Error if no icon is set. + * Returns the given column's icon [Texture2D]. Error if no icon is set. */ public fun getIcon(column: Int): Texture2D? { TransferContext.writeArguments(LONG to column.toLong()) @@ -357,7 +355,7 @@ public open class TreeItem internal constructor() : Object() { } /** - * Returns the icon [godot.Texture2D] region as [godot.core.Rect2]. + * Returns the icon [Texture2D] region as [Rect2]. */ public fun getIconRegion(column: Int): Rect2 { TransferContext.writeArguments(LONG to column.toLong()) @@ -366,7 +364,9 @@ public open class TreeItem internal constructor() : Object() { } /** - * Sets the maximum allowed width of the icon in the given [column]. This limit is applied on top of the default size of the icon and on top of [theme_item Tree.icon_max_width]. The height is adjusted according to the icon's ratio. + * Sets the maximum allowed width of the icon in the given [param column]. This limit is applied + * on top of the default size of the icon and on top of [theme_item Tree.icon_max_width]. The height + * is adjusted according to the icon's ratio. */ public fun setIconMaxWidth(column: Int, width: Int): Unit { TransferContext.writeArguments(LONG to column.toLong(), LONG to width.toLong()) @@ -374,7 +374,7 @@ public open class TreeItem internal constructor() : Object() { } /** - * Returns the maximum allowed width of the icon in the given [column]. + * Returns the maximum allowed width of the icon in the given [param column]. */ public fun getIconMaxWidth(column: Int): Int { TransferContext.writeArguments(LONG to column.toLong()) @@ -383,7 +383,7 @@ public open class TreeItem internal constructor() : Object() { } /** - * Modulates the given column's icon with [modulate]. + * Modulates the given column's icon with [param modulate]. */ public fun setIconModulate(column: Int, modulate: Color): Unit { TransferContext.writeArguments(LONG to column.toLong(), COLOR to modulate) @@ -391,7 +391,7 @@ public open class TreeItem internal constructor() : Object() { } /** - * Returns the [godot.core.Color] modulating the column's icon. + * Returns the [Color] modulating the column's icon. */ public fun getIconModulate(column: Int): Color { TransferContext.writeArguments(LONG to column.toLong()) @@ -400,7 +400,7 @@ public open class TreeItem internal constructor() : Object() { } /** - * Sets the value of a [CELL_MODE_RANGE] column. + * Sets the value of a [constant CELL_MODE_RANGE] column. */ public fun setRange(column: Int, `value`: Double): Unit { TransferContext.writeArguments(LONG to column.toLong(), DOUBLE to value) @@ -408,7 +408,7 @@ public open class TreeItem internal constructor() : Object() { } /** - * Returns the value of a [CELL_MODE_RANGE] column. + * Returns the value of a [constant CELL_MODE_RANGE] column. */ public fun getRange(column: Int): Double { TransferContext.writeArguments(LONG to column.toLong()) @@ -417,9 +417,10 @@ public open class TreeItem internal constructor() : Object() { } /** - * Sets the range of accepted values for a column. The column must be in the [CELL_MODE_RANGE] mode. - * - * If [expr] is `true`, the edit mode slider will use an exponential scale as with [godot.Range.expEdit]. + * Sets the range of accepted values for a column. The column must be in the [constant + * CELL_MODE_RANGE] mode. + * If [param expr] is `true`, the edit mode slider will use an exponential scale as with + * [Range.expEdit]. */ @JvmOverloads public fun setRangeConfig( @@ -434,7 +435,8 @@ public open class TreeItem internal constructor() : Object() { } /** - * Returns a dictionary containing the range parameters for a given column. The keys are "min", "max", "step", and "expr". + * Returns a dictionary containing the range parameters for a given column. The keys are "min", + * "max", "step", and "expr". */ public fun getRangeConfig(column: Int): Dictionary { TransferContext.writeArguments(LONG to column.toLong()) @@ -443,7 +445,8 @@ public open class TreeItem internal constructor() : Object() { } /** - * Sets the metadata value for the given column, which can be retrieved later using [getMetadata]. This can be used, for example, to store a reference to the original data. + * Sets the metadata value for the given column, which can be retrieved later using [getMetadata]. + * This can be used, for example, to store a reference to the original data. */ public fun setMetadata(column: Int, meta: Any?): Unit { TransferContext.writeArguments(LONG to column.toLong(), ANY to meta) @@ -460,9 +463,9 @@ public open class TreeItem internal constructor() : Object() { } /** - * Sets the given column's custom draw callback to [callback] method on [object]. - * - * The [callback] should accept two arguments: the [godot.TreeItem] that is drawn and its position and size as a [godot.core.Rect2]. + * Sets the given column's custom draw callback to [param callback] method on [param object]. + * The [param callback] should accept two arguments: the [TreeItem] that is drawn and its position + * and size as a [Rect2]. */ public fun setCustomDraw( column: Int, @@ -474,7 +477,7 @@ public open class TreeItem internal constructor() : Object() { } /** - * Collapses or uncollapses this [godot.TreeItem] and all the descendants of this item. + * Collapses or uncollapses this [TreeItem] and all the descendants of this item. */ public fun setCollapsedRecursive(enable: Boolean): Unit { TransferContext.writeArguments(BOOL to enable) @@ -482,9 +485,8 @@ public open class TreeItem internal constructor() : Object() { } /** - * Returns `true` if this [godot.TreeItem], or any of its descendants, is collapsed. - * - * If [onlyVisible] is `true` it ignores non-visible [godot.TreeItem]s. + * Returns `true` if this [TreeItem], or any of its descendants, is collapsed. + * If [param only_visible] is `true` it ignores non-visible [TreeItem]s. */ @JvmOverloads public fun isAnyCollapsed(onlyVisible: Boolean = false): Boolean { @@ -493,16 +495,13 @@ public open class TreeItem internal constructor() : Object() { return (TransferContext.readReturnValue(BOOL, false) as Boolean) } - /** - * - */ public fun uncollapseTree(): Unit { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.uncollapseTreePtr, NIL) } /** - * If [selectable] is `true`, the given [column] is selectable. + * If [param selectable] is `true`, the given [param column] is selectable. */ public fun setSelectable(column: Int, selectable: Boolean): Unit { TransferContext.writeArguments(LONG to column.toLong(), BOOL to selectable) @@ -510,7 +509,7 @@ public open class TreeItem internal constructor() : Object() { } /** - * Returns `true` if the given [column] is selectable. + * Returns `true` if the given [param column] is selectable. */ public fun isSelectable(column: Int): Boolean { TransferContext.writeArguments(LONG to column.toLong()) @@ -519,7 +518,7 @@ public open class TreeItem internal constructor() : Object() { } /** - * Returns `true` if the given [column] is selected. + * Returns `true` if the given [param column] is selected. */ public fun isSelected(column: Int): Boolean { TransferContext.writeArguments(LONG to column.toLong()) @@ -528,7 +527,7 @@ public open class TreeItem internal constructor() : Object() { } /** - * Selects the given [column]. + * Selects the given [param column]. */ public fun select(column: Int): Unit { TransferContext.writeArguments(LONG to column.toLong()) @@ -544,7 +543,7 @@ public open class TreeItem internal constructor() : Object() { } /** - * If [enabled] is `true`, the given [column] is editable. + * If [param enabled] is `true`, the given [param column] is editable. */ public fun setEditable(column: Int, enabled: Boolean): Unit { TransferContext.writeArguments(LONG to column.toLong(), BOOL to enabled) @@ -552,7 +551,7 @@ public open class TreeItem internal constructor() : Object() { } /** - * Returns `true` if the given [column] is editable. + * Returns `true` if the given [param column] is editable. */ public fun isEditable(column: Int): Boolean { TransferContext.writeArguments(LONG to column.toLong()) @@ -569,7 +568,7 @@ public open class TreeItem internal constructor() : Object() { } /** - * Returns the custom color of column [column]. + * Returns the custom color of column [param column]. */ public fun getCustomColor(column: Int): Color { TransferContext.writeArguments(LONG to column.toLong()) @@ -586,7 +585,7 @@ public open class TreeItem internal constructor() : Object() { } /** - * Sets custom font used to draw text in the given [column]. + * Sets custom font used to draw text in the given [param column]. */ public fun setCustomFont(column: Int, font: Font): Unit { TransferContext.writeArguments(LONG to column.toLong(), OBJECT to font) @@ -594,7 +593,7 @@ public open class TreeItem internal constructor() : Object() { } /** - * Returns custom font used to draw text in the column [column]. + * Returns custom font used to draw text in the column [param column]. */ public fun getCustomFont(column: Int): Font? { TransferContext.writeArguments(LONG to column.toLong()) @@ -603,7 +602,7 @@ public open class TreeItem internal constructor() : Object() { } /** - * Sets custom font size used to draw text in the given [column]. + * Sets custom font size used to draw text in the given [param column]. */ public fun setCustomFontSize(column: Int, fontSize: Int): Unit { TransferContext.writeArguments(LONG to column.toLong(), LONG to fontSize.toLong()) @@ -611,7 +610,7 @@ public open class TreeItem internal constructor() : Object() { } /** - * Returns custom font size used to draw text in the column [column]. + * Returns custom font size used to draw text in the column [param column]. */ public fun getCustomFontSize(column: Int): Int { TransferContext.writeArguments(LONG to column.toLong()) @@ -641,7 +640,7 @@ public open class TreeItem internal constructor() : Object() { } /** - * Returns the custom background color of column [column]. + * Returns the custom background color of column [param column]. */ public fun getCustomBgColor(column: Int): Color { TransferContext.writeArguments(LONG to column.toLong()) @@ -649,17 +648,11 @@ public open class TreeItem internal constructor() : Object() { return (TransferContext.readReturnValue(COLOR, false) as Color) } - /** - * - */ public fun setCustomAsButton(column: Int, enable: Boolean): Unit { TransferContext.writeArguments(LONG to column.toLong(), BOOL to enable) TransferContext.callMethod(rawPtr, MethodBindings.setCustomAsButtonPtr, NIL) } - /** - * - */ public fun isCustomSetAsButton(column: Int): Boolean { TransferContext.writeArguments(LONG to column.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.isCustomSetAsButtonPtr, BOOL) @@ -667,7 +660,11 @@ public open class TreeItem internal constructor() : Object() { } /** - * Adds a button with [godot.Texture2D] [button] at column [column]. The [id] is used to identify the button in the according [godot.Tree.buttonClicked] signal and can be different from the buttons index. If not specified, the next available index is used, which may be retrieved by calling [getButtonCount] immediately before this method. Optionally, the button can be [disabled] and have a [tooltipText]. + * Adds a button with [Texture2D] [param button] at column [param column]. The [param id] is used + * to identify the button in the according [signal Tree.button_clicked] signal and can be different + * from the buttons index. If not specified, the next available index is used, which may be retrieved + * by calling [getButtonCount] immediately before this method. Optionally, the button can be [param + * disabled] and have a [param tooltip_text]. */ @JvmOverloads public fun addButton( @@ -682,7 +679,7 @@ public open class TreeItem internal constructor() : Object() { } /** - * Returns the number of buttons in column [column]. + * Returns the number of buttons in column [param column]. */ public fun getButtonCount(column: Int): Int { TransferContext.writeArguments(LONG to column.toLong()) @@ -691,7 +688,7 @@ public open class TreeItem internal constructor() : Object() { } /** - * Returns the tooltip text for the button at index [buttonIndex] in column [column]. + * Returns the tooltip text for the button at index [param button_index] in column [param column]. */ public fun getButtonTooltipText(column: Int, buttonIndex: Int): String { TransferContext.writeArguments(LONG to column.toLong(), LONG to buttonIndex.toLong()) @@ -700,7 +697,7 @@ public open class TreeItem internal constructor() : Object() { } /** - * Returns the ID for the button at index [buttonIndex] in column [column]. + * Returns the ID for the button at index [param button_index] in column [param column]. */ public fun getButtonId(column: Int, buttonIndex: Int): Int { TransferContext.writeArguments(LONG to column.toLong(), LONG to buttonIndex.toLong()) @@ -709,7 +706,8 @@ public open class TreeItem internal constructor() : Object() { } /** - * Returns the button index if there is a button with ID [id] in column [column], otherwise returns -1. + * Returns the button index if there is a button with ID [param id] in column [param column], + * otherwise returns -1. */ public fun getButtonById(column: Int, id: Int): Int { TransferContext.writeArguments(LONG to column.toLong(), LONG to id.toLong()) @@ -718,7 +716,7 @@ public open class TreeItem internal constructor() : Object() { } /** - * Returns the [godot.Texture2D] of the button at index [buttonIndex] in column [column]. + * Returns the [Texture2D] of the button at index [param button_index] in column [param column]. */ public fun getButton(column: Int, buttonIndex: Int): Texture2D? { TransferContext.writeArguments(LONG to column.toLong(), LONG to buttonIndex.toLong()) @@ -727,7 +725,7 @@ public open class TreeItem internal constructor() : Object() { } /** - * Sets the tooltip text for the button at index [buttonIndex] in the given [column]. + * Sets the tooltip text for the button at index [param button_index] in the given [param column]. */ public fun setButtonTooltipText( column: Int, @@ -739,7 +737,7 @@ public open class TreeItem internal constructor() : Object() { } /** - * Sets the given column's button [godot.Texture2D] at index [buttonIndex] to [button]. + * Sets the given column's button [Texture2D] at index [param button_index] to [param button]. */ public fun setButton( column: Int, @@ -751,7 +749,7 @@ public open class TreeItem internal constructor() : Object() { } /** - * Removes the button at index [buttonIndex] in column [column]. + * Removes the button at index [param button_index] in column [param column]. */ public fun eraseButton(column: Int, buttonIndex: Int): Unit { TransferContext.writeArguments(LONG to column.toLong(), LONG to buttonIndex.toLong()) @@ -759,7 +757,7 @@ public open class TreeItem internal constructor() : Object() { } /** - * If `true`, disables the button at index [buttonIndex] in the given [column]. + * If `true`, disables the button at index [param button_index] in the given [param column]. */ public fun setButtonDisabled( column: Int, @@ -771,7 +769,7 @@ public open class TreeItem internal constructor() : Object() { } /** - * Sets the given column's button color at index [buttonIndex] to [color]. + * Sets the given column's button color at index [param button_index] to [param color]. */ public fun setButtonColor( column: Int, @@ -783,7 +781,8 @@ public open class TreeItem internal constructor() : Object() { } /** - * Returns `true` if the button at index [buttonIndex] for the given [column] is disabled. + * Returns `true` if the button at index [param button_index] for the given [param column] is + * disabled. */ public fun isButtonDisabled(column: Int, buttonIndex: Int): Boolean { TransferContext.writeArguments(LONG to column.toLong(), LONG to buttonIndex.toLong()) @@ -826,7 +825,7 @@ public open class TreeItem internal constructor() : Object() { } /** - * If [enable] is `true`, the given [column] is expanded to the right. + * If [param enable] is `true`, the given [param column] is expanded to the right. */ public fun setExpandRight(column: Int, enable: Boolean): Unit { TransferContext.writeArguments(LONG to column.toLong(), BOOL to enable) @@ -844,8 +843,8 @@ public open class TreeItem internal constructor() : Object() { /** * Creates an item and adds it as a child. - * - * The new item will be inserted as position [index] (the default value `-1` means the last position), or it will be the last child if [index] is higher than the child count. + * The new item will be inserted as position [param index] (the default value `-1` means the last + * position), or it will be the last child if [param index] is higher than the child count. */ @JvmOverloads public fun createChild(index: Int = -1): TreeItem? { @@ -855,7 +854,8 @@ public open class TreeItem internal constructor() : Object() { } /** - * Adds a previously unparented [godot.TreeItem] as a direct child of this one. The [child] item must not be a part of any [godot.Tree] or parented to any [godot.TreeItem]. See also [removeChild]. + * Adds a previously unparented [TreeItem] as a direct child of this one. The [param child] item + * must not be a part of any [Tree] or parented to any [TreeItem]. See also [removeChild]. */ public fun addChild(child: TreeItem): Unit { TransferContext.writeArguments(OBJECT to child) @@ -863,9 +863,11 @@ public open class TreeItem internal constructor() : Object() { } /** - * Removes the given child [godot.TreeItem] and all its children from the [godot.Tree]. Note that it doesn't free the item from memory, so it can be reused later (see [addChild]). To completely remove a [godot.TreeItem] use [godot.Object.free]. - * - * **Note:** If you want to move a child from one [godot.Tree] to another, then instead of removing and adding it manually you can use [moveBefore] or [moveAfter]. + * Removes the given child [TreeItem] and all its children from the [Tree]. Note that it doesn't + * free the item from memory, so it can be reused later (see [addChild]). To completely remove a + * [TreeItem] use [Object.free]. + * **Note:** If you want to move a child from one [Tree] to another, then instead of removing and + * adding it manually you can use [moveBefore] or [moveAfter]. */ public fun removeChild(child: TreeItem): Unit { TransferContext.writeArguments(OBJECT to child) @@ -873,7 +875,7 @@ public open class TreeItem internal constructor() : Object() { } /** - * Returns the [godot.Tree] that owns this TreeItem. + * Returns the [Tree] that owns this TreeItem. */ public fun getTree(): Tree? { TransferContext.writeArguments() @@ -918,9 +920,10 @@ public open class TreeItem internal constructor() : Object() { } /** - * Returns the next TreeItem in the tree (in the context of a depth-first search) or a `null` object if there is none. - * - * If [wrap] is enabled, the method will wrap around to the first element in the tree when called on the last element, otherwise it returns `null`. + * Returns the next TreeItem in the tree (in the context of a depth-first search) or a `null` + * object if there is none. + * If [param wrap] is enabled, the method will wrap around to the first element in the tree when + * called on the last element, otherwise it returns `null`. */ @JvmOverloads public fun getNextInTree(wrap: Boolean = false): TreeItem? { @@ -930,9 +933,10 @@ public open class TreeItem internal constructor() : Object() { } /** - * Returns the previous TreeItem in the tree (in the context of a depth-first search) or a `null` object if there is none. - * - * If [wrap] is enabled, the method will wrap around to the last element in the tree when called on the first visible element, otherwise it returns `null`. + * Returns the previous TreeItem in the tree (in the context of a depth-first search) or a `null` + * object if there is none. + * If [param wrap] is enabled, the method will wrap around to the last element in the tree when + * called on the first visible element, otherwise it returns `null`. */ @JvmOverloads public fun getPrevInTree(wrap: Boolean = false): TreeItem? { @@ -942,9 +946,10 @@ public open class TreeItem internal constructor() : Object() { } /** - * Returns the next visible TreeItem in the tree (in the context of a depth-first search) or a `null` object if there is none. - * - * If [wrap] is enabled, the method will wrap around to the first visible element in the tree when called on the last visible element, otherwise it returns `null`. + * Returns the next visible TreeItem in the tree (in the context of a depth-first search) or a + * `null` object if there is none. + * If [param wrap] is enabled, the method will wrap around to the first visible element in the + * tree when called on the last visible element, otherwise it returns `null`. */ @JvmOverloads public fun getNextVisible(wrap: Boolean = false): TreeItem? { @@ -954,9 +959,10 @@ public open class TreeItem internal constructor() : Object() { } /** - * Returns the previous visible sibling TreeItem in the tree (in the context of a depth-first search) or a `null` object if there is none. - * - * If [wrap] is enabled, the method will wrap around to the last visible element in the tree when called on the first visible element, otherwise it returns `null`. + * Returns the previous visible sibling TreeItem in the tree (in the context of a depth-first + * search) or a `null` object if there is none. + * If [param wrap] is enabled, the method will wrap around to the last visible element in the tree + * when called on the first visible element, otherwise it returns `null`. */ @JvmOverloads public fun getPrevVisible(wrap: Boolean = false): TreeItem? { @@ -966,8 +972,8 @@ public open class TreeItem internal constructor() : Object() { } /** - * Returns a child item by its [index] (see [getChildCount]). This method is often used for iterating all children of an item. - * + * Returns a child item by its [param index] (see [getChildCount]). This method is often used for + * iterating all children of an item. * Negative indices access the children from the last one. */ public fun getChild(index: Int): TreeItem? { @@ -995,7 +1001,8 @@ public open class TreeItem internal constructor() : Object() { } /** - * Returns the node's order in the tree. For example, if called on the first child item the position is `0`. + * Returns the node's order in the tree. For example, if called on the first child item the + * position is `0`. */ public fun getIndex(): Int { TransferContext.writeArguments() @@ -1004,8 +1011,7 @@ public open class TreeItem internal constructor() : Object() { } /** - * Moves this TreeItem right before the given [item]. - * + * Moves this TreeItem right before the given [param item]. * **Note:** You can't move to the root or move the root. */ public fun moveBefore(item: TreeItem): Unit { @@ -1014,8 +1020,7 @@ public open class TreeItem internal constructor() : Object() { } /** - * Moves this TreeItem right after the given [item]. - * + * Moves this TreeItem right after the given [param item]. * **Note:** You can't move to the root or move the root. */ public fun moveAfter(item: TreeItem): Unit { @@ -1024,7 +1029,8 @@ public open class TreeItem internal constructor() : Object() { } /** - * Calls the [method] on the actual TreeItem and its children recursively. Pass parameters as a comma separated list. + * Calls the [param method] on the actual TreeItem and its children recursively. Pass parameters + * as a comma separated list. */ public fun callRecursive(method: StringName, vararg __var_args: Any?): Unit { TransferContext.writeArguments(STRING_NAME to method, *__var_args.map { ANY to it }.toTypedArray()) @@ -1050,9 +1056,6 @@ public open class TreeItem internal constructor() : Object() { * Cell contains an icon. */ CELL_MODE_ICON(3), - /** - * - */ CELL_MODE_CUSTOM(4), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/TriangleMesh.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/TriangleMesh.kt index ddcb75dd3..2a713b75e 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/TriangleMesh.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/TriangleMesh.kt @@ -12,8 +12,6 @@ import kotlin.Int import kotlin.Suppress /** - * Internal mesh type. - * * Mesh type used internally for collision calculations. */ @GodotBaseType diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/TubeTrailMesh.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/TubeTrailMesh.kt index dcd647dae..f51fcbbac 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/TubeTrailMesh.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/TubeTrailMesh.kt @@ -23,19 +23,17 @@ import kotlin.Long import kotlin.Suppress /** - * Represents a straight tube-shaped [godot.PrimitiveMesh] with variable width. - * - * Tutorials: - * [$DOCS_URL/tutorials/3d/particles/index.html]($DOCS_URL/tutorials/3d/particles/index.html) - * - * [godot.TubeTrailMesh] represents a straight tube-shaped mesh with variable width. The tube is composed of a number of cylindrical sections, each with the same [sectionLength] and number of [sectionRings]. A [curve] is sampled along the total length of the tube, meaning that the curve determines the radius of the tube along its length. - * + * [TubeTrailMesh] represents a straight tube-shaped mesh with variable width. The tube is composed + * of a number of cylindrical sections, each with the same [sectionLength] and number of + * [sectionRings]. A [curve] is sampled along the total length of the tube, meaning that the curve + * determines the radius of the tube along its length. * This primitive mesh is usually used for particle trails. */ @GodotBaseType public open class TubeTrailMesh : PrimitiveMesh() { /** - * The baseline radius of the tube. The radius of a particular section ring is obtained by multiplying this radius by the value of the [curve] at the given distance. + * The baseline radius of the tube. The radius of a particular section ring is obtained by + * multiplying this radius by the value of the [curve] at the given distance. */ public var radius: Float get() { @@ -49,7 +47,8 @@ public open class TubeTrailMesh : PrimitiveMesh() { } /** - * The number of sides on the tube. For example, a value of `5` means the tube will be pentagonal. Higher values result in a more detailed tube at the cost of performance. + * The number of sides on the tube. For example, a value of `5` means the tube will be pentagonal. + * Higher values result in a more detailed tube at the cost of performance. */ public var radialSteps: Int get() { @@ -91,7 +90,8 @@ public open class TubeTrailMesh : PrimitiveMesh() { } /** - * The number of rings in a section. The [curve] is sampled on each ring to determine its radius. Higher values result in a more detailed tube at the cost of performance. + * The number of rings in a section. The [curve] is sampled on each ring to determine its radius. + * Higher values result in a more detailed tube at the cost of performance. */ public var sectionRings: Int get() { @@ -105,7 +105,8 @@ public open class TubeTrailMesh : PrimitiveMesh() { } /** - * If `true`, generates a cap at the top of the tube. This can be set to `false` to speed up generation and rendering when the cap is never seen by the camera. + * If `true`, generates a cap at the top of the tube. This can be set to `false` to speed up + * generation and rendering when the cap is never seen by the camera. */ public var capTop: Boolean get() { @@ -119,7 +120,8 @@ public open class TubeTrailMesh : PrimitiveMesh() { } /** - * If `true`, generates a cap at the bottom of the tube. This can be set to `false` to speed up generation and rendering when the cap is never seen by the camera. + * If `true`, generates a cap at the bottom of the tube. This can be set to `false` to speed up + * generation and rendering when the cap is never seen by the camera. */ public var capBottom: Boolean get() { @@ -133,7 +135,9 @@ public open class TubeTrailMesh : PrimitiveMesh() { } /** - * Determines the radius of the tube along its length. The radius of a particular section ring is obtained by multiplying the baseline [radius] by the value of this curve at the given distance. For values smaller than `0`, the faces will be inverted. + * Determines the radius of the tube along its length. The radius of a particular section ring is + * obtained by multiplying the baseline [radius] by the value of this curve at the given distance. + * For values smaller than `0`, the faces will be inverted. */ public var curve: Curve? get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Tweener.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Tweener.kt index 99f9de965..f4265307a 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Tweener.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Tweener.kt @@ -14,14 +14,14 @@ import kotlin.Int import kotlin.Suppress /** - * Abstract class for all Tweeners used by [godot.Tween]. - * - * Tweeners are objects that perform a specific animating task, e.g. interpolating a property or calling a method at a given time. A [godot.Tweener] can't be created manually, you need to use a dedicated method from [godot.Tween]. + * Tweeners are objects that perform a specific animating task, e.g. interpolating a property or + * calling a method at a given time. A [Tweener] can't be created manually, you need to use a dedicated + * method from [Tween]. */ @GodotBaseType public open class Tweener internal constructor() : RefCounted() { /** - * Emitted when the [godot.Tweener] has just finished its job. + * Emitted when the [Tweener] has just finished its job. */ public val finished: Signal0 by signal() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/UDPServer.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/UDPServer.kt index b0a8518db..6b367af96 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/UDPServer.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/UDPServer.kt @@ -25,246 +25,137 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * Helper class to implement a UDP server. - * - * A simple server that opens a UDP socket and returns connected [godot.PacketPeerUDP] upon receiving new packets. See also [godot.PacketPeerUDP.connectToHost]. - * - * After starting the server ([listen]), you will need to [poll] it at regular intervals (e.g. inside [godot.Node.Process]) for it to process new packets, delivering them to the appropriate [godot.PacketPeerUDP], and taking new connections. - * + * A simple server that opens a UDP socket and returns connected [PacketPeerUDP] upon receiving new + * packets. See also [PacketPeerUDP.connectToHost]. + * After starting the server ([listen]), you will need to [poll] it at regular intervals (e.g. + * inside [Node.Process]) for it to process new packets, delivering them to the appropriate + * [PacketPeerUDP], and taking new connections. * Below a small example of how it can be used: * - * [codeblocks] - * - * [gdscript] - * + * gdscript: + * ```gdscript * # server_node.gd - * * class_name ServerNode - * * extends Node * - * - * * var server := UDPServer.new() - * * var peers = [] * - * - * * func _ready(): - * * server.listen(4242) * - * - * * func _process(delta): - * * server.poll() # Important! - * * if server.is_connection_available(): - * * var peer: PacketPeerUDP = server.take_connection() - * * var packet = peer.get_packet() - * - * print("Accepted peer: %s:%s" % [peer.get_packet_ip(), peer.get_packet_port()]) - * - * print("Received data: %s" % [packet.get_string_from_utf8()]) - * + * print("Accepted peer: %s:%s" % [peer.get_packet_ip(), + * peer.get_packet_port()]) + * print("Received data: %s" % [packet.get_string_from_utf8()]) * # Reply so it knows we received the message. - * * peer.put_packet(packet) - * * # Keep a reference so we can keep contacting the remote peer. - * * peers.append(peer) * - * - * * for i in range(0, peers.size()): - * * pass # Do something with the connected peers. - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * // ServerNode.cs - * * using Godot; - * * using System.Collections.Generic; * - * - * * public partial class ServerNode : Node - * * { - * * private UdpServer _server = new UdpServer(); - * * private List _peers = new List(); * - * - * * public override void _Ready() - * * { - * * _server.Listen(4242); - * * } * - * - * * public override void _Process(double delta) - * * { - * * _server.Poll(); // Important! - * * if (_server.IsConnectionAvailable()) - * * { - * * PacketPeerUdp peer = _server.TakeConnection(); - * * byte[] packet = peer.GetPacket(); - * * GD.Print($"Accepted Peer: {peer.GetPacketIP()}:{peer.GetPacketPort()}"); - * * GD.Print($"Received Data: {packet.GetStringFromUtf8()}"); - * * // Reply so it knows we received the message. - * * peer.PutPacket(packet); - * * // Keep a reference so we can keep contacting the remote peer. - * * _peers.Add(peer); - * * } - * * foreach (var peer in _peers) - * * { - * * // Do something with the peers. - * * } - * * } - * * } + * ``` * - * [/csharp] - * - * [/codeblocks] - * - * [codeblocks] - * - * [gdscript] * + * gdscript: + * ```gdscript * # client_node.gd - * * class_name ClientNode - * * extends Node * - * - * * var udp := PacketPeerUDP.new() - * * var connected = false * - * - * * func _ready(): - * * udp.connect_to_host("127.0.0.1", 4242) * - * - * * func _process(delta): - * * if !connected: - * * # Try to contact server - * * udp.put_packet("The answer is... 42!".to_utf8_buffer()) - * * if udp.get_available_packet_count() > 0: - * - * print("Connected: %s" % udp.get_packet().get_string_from_utf8()) - * + * print("Connected: %s" % udp.get_packet().get_string_from_utf8()) * connected = true - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * // ClientNode.cs - * * using Godot; * - * - * * public partial class ClientNode : Node - * * { - * * private PacketPeerUdp _udp = new PacketPeerUdp(); - * * private bool _connected = false; * - * - * * public override void _Ready() - * * { - * * _udp.ConnectToHost("127.0.0.1", 4242); - * * } * - * - * * public override void _Process(double delta) - * * { - * * if (!_connected) - * * { - * * // Try to contact server - * * _udp.PutPacket("The Answer Is..42!".ToUtf8Buffer()); - * * } - * * if (_udp.GetAvailablePacketCount() > 0) - * * { - * * GD.Print($"Connected: {_udp.GetPacket().GetStringFromUtf8()}"); - * * _connected = true; - * * } - * * } - * * } - * - * [/csharp] - * - * [/codeblocks] + * ``` */ @GodotBaseType public open class UDPServer : RefCounted() { /** - * Define the maximum number of pending connections, during [poll], any new pending connection exceeding that value will be automatically dropped. Setting this value to `0` effectively prevents any new pending connection to be accepted (e.g. when all your players have connected). + * Define the maximum number of pending connections, during [poll], any new pending connection + * exceeding that value will be automatically dropped. Setting this value to `0` effectively prevents + * any new pending connection to be accepted (e.g. when all your players have connected). */ public var maxPendingConnections: Int get() { @@ -283,7 +174,9 @@ public open class UDPServer : RefCounted() { } /** - * Starts the server by opening a UDP socket listening on the given [port]. You can optionally specify a [bindAddress] to only listen for packets sent to that address. See also [godot.PacketPeerUDP.bind]. + * Starts the server by opening a UDP socket listening on the given [param port]. You can + * optionally specify a [param bind_address] to only listen for packets sent to that address. See + * also [PacketPeerUDP.bind]. */ @JvmOverloads public fun listen(port: Int, bindAddress: String = "*"): GodotError { @@ -293,7 +186,11 @@ public open class UDPServer : RefCounted() { } /** - * Call this method at regular intervals (e.g. inside [godot.Node.Process]) to process new packets. And packet from known address/port pair will be delivered to the appropriate [godot.PacketPeerUDP], any packet received from an unknown address/port pair will be added as a pending connection (see [isConnectionAvailable], [takeConnection]). The maximum number of pending connection is defined via [maxPendingConnections]. + * Call this method at regular intervals (e.g. inside [Node.Process]) to process new packets. And + * packet from known address/port pair will be delivered to the appropriate [PacketPeerUDP], any + * packet received from an unknown address/port pair will be added as a pending connection (see + * [isConnectionAvailable], [takeConnection]). The maximum number of pending connection is defined + * via [maxPendingConnections]. */ public fun poll(): GodotError { TransferContext.writeArguments() @@ -329,7 +226,9 @@ public open class UDPServer : RefCounted() { } /** - * Returns the first pending connection (connected to the appropriate address/port). Will return `null` if no new connection is available. See also [isConnectionAvailable], [godot.PacketPeerUDP.connectToHost]. + * Returns the first pending connection (connected to the appropriate address/port). Will return + * `null` if no new connection is available. See also [isConnectionAvailable], + * [PacketPeerUDP.connectToHost]. */ public fun takeConnection(): PacketPeerUDP? { TransferContext.writeArguments() @@ -338,7 +237,8 @@ public open class UDPServer : RefCounted() { } /** - * Stops the server, closing the UDP socket if open. Will close all connected [godot.PacketPeerUDP] accepted via [takeConnection] (remote peers will not be notified). + * Stops the server, closing the UDP socket if open. Will close all connected [PacketPeerUDP] + * accepted via [takeConnection] (remote peers will not be notified). */ public fun stop(): Unit { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/UPNP.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/UPNP.kt index 83618113c..f29f611c5 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/UPNP.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/UPNP.kt @@ -23,8 +23,91 @@ import kotlin.Suppress import kotlin.Unit import kotlin.jvm.JvmOverloads +/** + * This class can be used to discover compatible [UPNPDevice]s on the local network and execute + * commands on them, like managing port mappings (for port forwarding/NAT traversal) and querying the + * local and remote network IP address. Note that methods on this class are synchronous and block the + * calling thread. + * To forward a specific port (here `7777`, note both [discover] and [addPortMapping] can return + * errors that should be checked): + * [codeblock] + * var upnp = UPNP.new() + * upnp.discover() + * upnp.add_port_mapping(7777) + * [/codeblock] + * To close a specific port (e.g. after you have finished using it): + * [codeblock] + * upnp.delete_port_mapping(port) + * [/codeblock] + * **Note:** UPnP discovery blocks the current thread. To perform discovery without blocking the + * main thread, use [Thread]s like this: + * [codeblock] + * # Emitted when UPnP port mapping setup is completed (regardless of success or failure). + * signal upnp_completed(error) + * + * # Replace this with your own server port number between 1024 and 65535. + * const SERVER_PORT = 3928 + * var thread = null + * + * func _upnp_setup(server_port): + * # UPNP queries take some time. + * var upnp = UPNP.new() + * var err = upnp.discover() + * + * if err != OK: + * push_error(str(err)) + * emit_signal("upnp_completed", err) + * return + * + * if upnp.get_gateway() and upnp.get_gateway().is_valid_gateway(): + * upnp.add_port_mapping(server_port, server_port, + * ProjectSettings.get_setting("application/config/name"), "UDP") + * upnp.add_port_mapping(server_port, server_port, + * ProjectSettings.get_setting("application/config/name"), "TCP") + * emit_signal("upnp_completed", OK) + * + * func _ready(): + * thread = Thread.new() + * thread.start(_upnp_setup.bind(SERVER_PORT)) + * + * func _exit_tree(): + * # Wait for thread finish here to handle game exit while the thread is running. + * thread.wait_to_finish() + * [/codeblock] + * **Terminology:** In the context of UPnP networking, "gateway" (or "internet gateway device", + * short IGD) refers to network devices that allow computers in the local network to access the + * internet ("wide area network", WAN). These gateways are often also called "routers". + * **Pitfalls:** + * - As explained above, these calls are blocking and shouldn't be run on the main thread, + * especially as they can block for multiple seconds at a time. Use threading! + * - Networking is physical and messy. Packets get lost in transit or get filtered, addresses, free + * ports and assigned mappings change, and devices may leave or join the network at any time. Be + * mindful of this, be diligent when checking and handling errors, and handle these gracefully if you + * can: add clear error UI, timeouts and re-try handling. + * - Port mappings may change (and be removed) at any time, and the remote/external IP address of + * the gateway can change likewise. You should consider re-querying the external IP and try to + * update/refresh the port mapping periodically (for example, every 5 minutes and on networking + * failures). + * - Not all devices support UPnP, and some users disable UPnP support. You need to handle this + * (e.g. documenting and requiring the user to manually forward ports, or adding alternative methods of + * NAT traversal, like a relay/mirror server, or NAT hole punching, STUN/TURN, etc.). + * - Consider what happens on mapping conflicts. Maybe multiple users on the same network would like + * to play your game at the same time, or maybe another application uses the same port. Make the port + * configurable, and optimally choose a port automatically (re-trying with a different port on + * failure). + * **Further reading:** If you want to know more about UPnP (and the Internet Gateway Device (IGD) + * and Port Control Protocol (PCP) specifically), + * [url=https://en.wikipedia.org/wiki/Universal_Plug_and_Play]Wikipedia[/url] is a good first stop, the + * specification can be found at the + * [url=https://openconnectivity.org/developer/specifications/upnp-resources/upnp/]Open Connectivity + * Foundation[/url] and Godot's implementation is based on the + * [url=https://github.com/miniupnp/miniupnp]MiniUPnP client[/url]. + */ @GodotBaseType public open class UPNP : RefCounted() { + /** + * Multicast interface to use for discovery. Uses the default multicast interface if empty. + */ public var discoverMulticastIf: String get() { TransferContext.writeArguments() @@ -36,6 +119,11 @@ public open class UPNP : RefCounted() { TransferContext.callMethod(rawPtr, MethodBindings.setDiscoverMulticastIfPtr, NIL) } + /** + * If `0`, the local port to use for discovery is chosen automatically by the system. If `1`, + * discovery will be done from the source port 1900 (same as destination port). Otherwise, the value + * will be used as the port. + */ public var discoverLocalPort: Int get() { TransferContext.writeArguments() @@ -47,6 +135,9 @@ public open class UPNP : RefCounted() { TransferContext.callMethod(rawPtr, MethodBindings.setDiscoverLocalPortPtr, NIL) } + /** + * If `true`, IPv6 is used for [UPNPDevice] discovery. + */ public var discoverIpv6: Boolean get() { TransferContext.writeArguments() @@ -63,44 +154,73 @@ public open class UPNP : RefCounted() { return true } + /** + * Returns the number of discovered [UPNPDevice]s. + */ public fun getDeviceCount(): Int { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getDeviceCountPtr, LONG) return (TransferContext.readReturnValue(LONG, false) as Long).toInt() } + /** + * Returns the [UPNPDevice] at the given [param index]. + */ public fun getDevice(index: Int): UPNPDevice? { TransferContext.writeArguments(LONG to index.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.getDevicePtr, OBJECT) return (TransferContext.readReturnValue(OBJECT, true) as UPNPDevice?) } + /** + * Adds the given [UPNPDevice] to the list of discovered devices. + */ public fun addDevice(device: UPNPDevice): Unit { TransferContext.writeArguments(OBJECT to device) TransferContext.callMethod(rawPtr, MethodBindings.addDevicePtr, NIL) } + /** + * Sets the device at [param index] from the list of discovered devices to [param device]. + */ public fun setDevice(index: Int, device: UPNPDevice): Unit { TransferContext.writeArguments(LONG to index.toLong(), OBJECT to device) TransferContext.callMethod(rawPtr, MethodBindings.setDevicePtr, NIL) } + /** + * Removes the device at [param index] from the list of discovered devices. + */ public fun removeDevice(index: Int): Unit { TransferContext.writeArguments(LONG to index.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.removeDevicePtr, NIL) } + /** + * Clears the list of discovered devices. + */ public fun clearDevices(): Unit { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.clearDevicesPtr, NIL) } + /** + * Returns the default gateway. That is the first discovered [UPNPDevice] that is also a valid IGD + * (InternetGatewayDevice). + */ public fun getGateway(): UPNPDevice? { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getGatewayPtr, OBJECT) return (TransferContext.readReturnValue(OBJECT, true) as UPNPDevice?) } + /** + * Discovers local [UPNPDevice]s. Clears the list of previously discovered devices. + * Filters for IGD (InternetGatewayDevice) type devices by default, as those manage port + * forwarding. [param timeout] is the time to wait for responses in milliseconds. [param ttl] is the + * time-to-live; only touch this if you know what you're doing. + * See [enum UPNPResult] for possible return values. + */ @JvmOverloads public fun discover( timeout: Int = 2000, @@ -112,12 +232,41 @@ public open class UPNP : RefCounted() { return (TransferContext.readReturnValue(LONG, false) as Long).toInt() } + /** + * Returns the external [IP] address of the default gateway (see [getGateway]) as string. Returns + * an empty string on error. + */ public fun queryExternalAddress(): String { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.queryExternalAddressPtr, STRING) return (TransferContext.readReturnValue(STRING, false) as String) } + /** + * Adds a mapping to forward the external [param port] (between 1 and 65535, although recommended + * to use port 1024 or above) on the default gateway (see [getGateway]) to the [param port_internal] + * on the local machine for the given protocol [param proto] (either `"TCP"` or `"UDP"`, with UDP + * being the default). If a port mapping for the given port and protocol combination already exists + * on that gateway device, this method tries to overwrite it. If that is not desired, you can + * retrieve the gateway manually with [getGateway] and call [addPortMapping] on it, if any. Note that + * forwarding a well-known port (below 1024) with UPnP may fail depending on the device. + * Depending on the gateway device, if a mapping for that port already exists, it will either be + * updated or it will refuse this command due to that conflict, especially if the existing mapping + * for that port wasn't created via UPnP or points to a different network address (or device) than + * this one. + * If [param port_internal] is `0` (the default), the same port number is used for both the + * external and the internal port (the [param port] value). + * The description ([param desc]) is shown in some routers management UIs and can be used to point + * out which application added the mapping. + * The mapping's lease [param duration] can be limited by specifying a duration in seconds. The + * default of `0` means no duration, i.e. a permanent lease and notably some devices only support + * these permanent leases. Note that whether permanent or not, this is only a request and the gateway + * may still decide at any point to remove the mapping (which usually happens on a reboot of the + * gateway, when its external IP address changes, or on some models when it detects a port mapping + * has become inactive, i.e. had no traffic for multiple minutes). If not `0` (permanent), the + * allowed range according to spec is between `120` (2 minutes) and `86400` seconds (24 hours). + * See [enum UPNPResult] for possible return values. + */ @JvmOverloads public fun addPortMapping( port: Int, @@ -131,6 +280,13 @@ public open class UPNP : RefCounted() { return (TransferContext.readReturnValue(LONG, false) as Long).toInt() } + /** + * Deletes the port mapping for the given port and protocol combination on the default gateway + * (see [getGateway]) if one exists. [param port] must be a valid port between 1 and 65535, [param + * proto] can be either `"TCP"` or `"UDP"`. May be refused for mappings pointing to addresses other + * than this one, for well-known ports (below 1024), or for mappings not added via UPnP. See [enum + * UPNPResult] for possible return values. + */ @JvmOverloads public fun deletePortMapping(port: Int, proto: String = "UDP"): Int { TransferContext.writeArguments(LONG to port.toLong(), STRING to proto) @@ -141,34 +297,128 @@ public open class UPNP : RefCounted() { public enum class UPNPResult( id: Long, ) { + /** + * UPNP command or discovery was successful. + */ UPNP_RESULT_SUCCESS(0), + /** + * Not authorized to use the command on the [UPNPDevice]. May be returned when the user disabled + * UPNP on their router. + */ UPNP_RESULT_NOT_AUTHORIZED(1), + /** + * No port mapping was found for the given port, protocol combination on the given [UPNPDevice]. + */ UPNP_RESULT_PORT_MAPPING_NOT_FOUND(2), + /** + * Inconsistent parameters. + */ UPNP_RESULT_INCONSISTENT_PARAMETERS(3), + /** + * No such entry in array. May be returned if a given port, protocol combination is not found on + * an [UPNPDevice]. + */ UPNP_RESULT_NO_SUCH_ENTRY_IN_ARRAY(4), + /** + * The action failed. + */ UPNP_RESULT_ACTION_FAILED(5), + /** + * The [UPNPDevice] does not allow wildcard values for the source IP address. + */ UPNP_RESULT_SRC_IP_WILDCARD_NOT_PERMITTED(6), + /** + * The [UPNPDevice] does not allow wildcard values for the external port. + */ UPNP_RESULT_EXT_PORT_WILDCARD_NOT_PERMITTED(7), + /** + * The [UPNPDevice] does not allow wildcard values for the internal port. + */ UPNP_RESULT_INT_PORT_WILDCARD_NOT_PERMITTED(8), + /** + * The remote host value must be a wildcard. + */ UPNP_RESULT_REMOTE_HOST_MUST_BE_WILDCARD(9), + /** + * The external port value must be a wildcard. + */ UPNP_RESULT_EXT_PORT_MUST_BE_WILDCARD(10), + /** + * No port maps are available. May also be returned if port mapping functionality is not + * available. + */ UPNP_RESULT_NO_PORT_MAPS_AVAILABLE(11), + /** + * Conflict with other mechanism. May be returned instead of [constant + * UPNP_RESULT_CONFLICT_WITH_OTHER_MAPPING] if a port mapping conflicts with an existing one. + */ UPNP_RESULT_CONFLICT_WITH_OTHER_MECHANISM(12), + /** + * Conflict with an existing port mapping. + */ UPNP_RESULT_CONFLICT_WITH_OTHER_MAPPING(13), + /** + * External and internal port values must be the same. + */ UPNP_RESULT_SAME_PORT_VALUES_REQUIRED(14), + /** + * Only permanent leases are supported. Do not use the `duration` parameter when adding port + * mappings. + */ UPNP_RESULT_ONLY_PERMANENT_LEASE_SUPPORTED(15), + /** + * Invalid gateway. + */ UPNP_RESULT_INVALID_GATEWAY(16), + /** + * Invalid port. + */ UPNP_RESULT_INVALID_PORT(17), + /** + * Invalid protocol. + */ UPNP_RESULT_INVALID_PROTOCOL(18), + /** + * Invalid duration. + */ UPNP_RESULT_INVALID_DURATION(19), + /** + * Invalid arguments. + */ UPNP_RESULT_INVALID_ARGS(20), + /** + * Invalid response. + */ UPNP_RESULT_INVALID_RESPONSE(21), + /** + * Invalid parameter. + */ UPNP_RESULT_INVALID_PARAM(22), + /** + * HTTP error. + */ UPNP_RESULT_HTTP_ERROR(23), + /** + * Socket error. + */ UPNP_RESULT_SOCKET_ERROR(24), + /** + * Error allocating memory. + */ UPNP_RESULT_MEM_ALLOC_ERROR(25), + /** + * No gateway available. You may need to call [discover] first, or discovery didn't detect any + * valid IGDs (InternetGatewayDevices). + */ UPNP_RESULT_NO_GATEWAY(26), + /** + * No devices available. You may need to call [discover] first, or discovery didn't detect any + * valid [UPNPDevice]s. + */ UPNP_RESULT_NO_DEVICES(27), + /** + * Unknown error. + */ UPNP_RESULT_UNKNOWN_ERROR(28), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/UPNPDevice.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/UPNPDevice.kt index e4dcdee7e..d70a69359 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/UPNPDevice.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/UPNPDevice.kt @@ -21,8 +21,17 @@ import kotlin.String import kotlin.Suppress import kotlin.jvm.JvmOverloads +/** + * Universal Plug and Play (UPnP) device. See [UPNP] for UPnP discovery and utility functions. + * Provides low-level access to UPNP control commands. Allows to manage port mappings (port forwarding) + * and to query network information of the device (like local and external IP address and status). Note + * that methods on this class are synchronous and block the calling thread. + */ @GodotBaseType public open class UPNPDevice : RefCounted() { + /** + * URL to the device description. + */ public var descriptionUrl: String get() { TransferContext.writeArguments() @@ -34,6 +43,9 @@ public open class UPNPDevice : RefCounted() { TransferContext.callMethod(rawPtr, MethodBindings.setDescriptionUrlPtr, NIL) } + /** + * Service type. + */ public var serviceType: String get() { TransferContext.writeArguments() @@ -45,6 +57,9 @@ public open class UPNPDevice : RefCounted() { TransferContext.callMethod(rawPtr, MethodBindings.setServiceTypePtr, NIL) } + /** + * IDG control URL. + */ public var igdControlUrl: String get() { TransferContext.writeArguments() @@ -56,6 +71,9 @@ public open class UPNPDevice : RefCounted() { TransferContext.callMethod(rawPtr, MethodBindings.setIgdControlUrlPtr, NIL) } + /** + * IGD service type. + */ public var igdServiceType: String get() { TransferContext.writeArguments() @@ -67,6 +85,9 @@ public open class UPNPDevice : RefCounted() { TransferContext.callMethod(rawPtr, MethodBindings.setIgdServiceTypePtr, NIL) } + /** + * Address of the local machine in the network connecting it to this [UPNPDevice]. + */ public var igdOurAddr: String get() { TransferContext.writeArguments() @@ -78,6 +99,9 @@ public open class UPNPDevice : RefCounted() { TransferContext.callMethod(rawPtr, MethodBindings.setIgdOurAddrPtr, NIL) } + /** + * IGD status. See [enum IGDStatus]. + */ public var igdStatus: IGDStatus get() { TransferContext.writeArguments() @@ -94,18 +118,29 @@ public open class UPNPDevice : RefCounted() { return true } + /** + * Returns `true` if this is a valid IGD (InternetGatewayDevice) which potentially supports port + * forwarding. + */ public fun isValidGateway(): Boolean { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.isValidGatewayPtr, BOOL) return (TransferContext.readReturnValue(BOOL, false) as Boolean) } + /** + * Returns the external IP address of this [UPNPDevice] or an empty string. + */ public fun queryExternalAddress(): String { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.queryExternalAddressPtr, STRING) return (TransferContext.readReturnValue(STRING, false) as String) } + /** + * Adds a port mapping to forward the given external port on this [UPNPDevice] for the given + * protocol to the local machine. See [UPNP.addPortMapping]. + */ @JvmOverloads public fun addPortMapping( port: Int, @@ -119,6 +154,10 @@ public open class UPNPDevice : RefCounted() { return (TransferContext.readReturnValue(LONG, false) as Long).toInt() } + /** + * Deletes the port mapping identified by the given port and protocol combination on this device. + * See [UPNP.deletePortMapping]. + */ @JvmOverloads public fun deletePortMapping(port: Int, proto: String = "UDP"): Int { TransferContext.writeArguments(LONG to port.toLong(), STRING to proto) @@ -129,15 +168,45 @@ public open class UPNPDevice : RefCounted() { public enum class IGDStatus( id: Long, ) { + /** + * OK. + */ IGD_STATUS_OK(0), + /** + * HTTP error. + */ IGD_STATUS_HTTP_ERROR(1), + /** + * Empty HTTP response. + */ IGD_STATUS_HTTP_EMPTY(2), + /** + * Returned response contained no URLs. + */ IGD_STATUS_NO_URLS(3), + /** + * Not a valid IGD. + */ IGD_STATUS_NO_IGD(4), + /** + * Disconnected. + */ IGD_STATUS_DISCONNECTED(5), + /** + * Unknown device. + */ IGD_STATUS_UNKNOWN_DEVICE(6), + /** + * Invalid control. + */ IGD_STATUS_INVALID_CONTROL(7), + /** + * Memory allocation error. + */ IGD_STATUS_MALLOC_ERROR(8), + /** + * Unknown error. + */ IGD_STATUS_UNKNOWN_ERROR(9), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/UndoRedo.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/UndoRedo.kt index 6b6037ee9..a4529785f 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/UndoRedo.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/UndoRedo.kt @@ -32,175 +32,103 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * Provides a high-level interface for implementing undo and redo operations. - * - * UndoRedo works by registering methods and property changes inside "actions". You can create an action, then provide ways to do and undo this action using function calls and property changes, then commit the action. - * - * When an action is committed, all of the `do_*` methods will run. If the [undo] method is used, the `undo_*` methods will run. If the [redo] method is used, once again, all of the `do_*` methods will run. - * + * UndoRedo works by registering methods and property changes inside "actions". You can create an + * action, then provide ways to do and undo this action using function calls and property changes, then + * commit the action. + * When an action is committed, all of the `do_*` methods will run. If the [undo] method is used, + * the `undo_*` methods will run. If the [redo] method is used, once again, all of the `do_*` methods + * will run. * Here's an example on how to add an action: * - * [codeblocks] - * - * [gdscript] - * + * gdscript: + * ```gdscript * var undo_redo = UndoRedo.new() * - * - * * func do_something(): - * * pass # Put your code here. * - * - * * func undo_something(): - * * pass # Put here the code that reverts what's done by "do_something()". * - * - * * func _on_my_button_pressed(): - * * var node = get_node("MyNode2D") - * * undo_redo.create_action("Move the node") - * * undo_redo.add_do_method(do_something) - * * undo_redo.add_undo_method(undo_something) - * * undo_redo.add_do_property(node, "position", Vector2(100,100)) - * * undo_redo.add_undo_property(node, "position", node.position) - * * undo_redo.commit_action() - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * private UndoRedo _undoRedo; * - * - * * public override void _Ready() - * * { - * * _undoRedo = new UndoRedo(); - * * } * - * - * * public void DoSomething() - * * { - * * // Put your code here. - * * } * - * - * * public void UndoSomething() - * * { - * * // Put here the code that reverts what's done by "DoSomething()". - * * } * - * - * * private void OnMyButtonPressed() - * * { - * * var node = GetNode("MyNode2D"); - * * _undoRedo.CreateAction("Move the node"); - * * _undoRedo.AddDoMethod(new Callable(this, MethodName.DoSomething)); - * * _undoRedo.AddUndoMethod(new Callable(this, MethodName.UndoSomething)); - * * _undoRedo.AddDoProperty(node, "position", new Vector2(100, 100)); - * * _undoRedo.AddUndoProperty(node, "position", node.Position); - * * _undoRedo.CommitAction(); - * * } - * - * [/csharp] - * - * [/codeblocks] - * - * Before calling any of the `add_(un)do_*` methods, you need to first call [createAction]. Afterwards you need to call [commitAction]. - * - * If you don't need to register a method, you can leave [addDoMethod] and [addUndoMethod] out; the same goes for properties. You can also register more than one method/property. - * - * If you are making an [godot.EditorPlugin] and want to integrate into the editor's undo history, use [godot.EditorUndoRedoManager] instead. - * - * If you are registering multiple properties/method which depend on one another, be aware that by default undo operation are called in the same order they have been added. Therefore instead of grouping do operation with their undo operations it is better to group do on one side and undo on the other as shown below. - * - * [codeblocks] - * - * [gdscript] - * + * ``` + * + * Before calling any of the `add_(un)do_*` methods, you need to first call [createAction]. + * Afterwards you need to call [commitAction]. + * If you don't need to register a method, you can leave [addDoMethod] and [addUndoMethod] out; the + * same goes for properties. You can also register more than one method/property. + * If you are making an [EditorPlugin] and want to integrate into the editor's undo history, use + * [EditorUndoRedoManager] instead. + * If you are registering multiple properties/method which depend on one another, be aware that by + * default undo operation are called in the same order they have been added. Therefore instead of + * grouping do operation with their undo operations it is better to group do on one side and undo on + * the other as shown below. + * + * gdscript: + * ```gdscript * undo_redo.create_action("Add object") * - * - * * # DO - * * undo_redo.add_do_method(_create_object) - * * undo_redo.add_do_method(_add_object_to_singleton) * - * - * * # UNDO - * * undo_redo.add_undo_method(_remove_object_from_singleton) - * * undo_redo.add_undo_method(_destroy_that_object) * - * - * * undo_redo.commit_action() - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * _undo_redo.CreateAction("Add object"); * - * - * * // DO - * * _undo_redo.AddDoMethod(new Callable(this, MethodName.CreateObject)); - * * _undo_redo.AddDoMethod(new Callable(this, MethodName.AddObjectToSingleton)); * - * - * * // UNDO - * * _undo_redo.AddUndoMethod(new Callable(this, MethodName.RemoveObjectFromSingleton)); - * * _undo_redo.AddUndoMethod(new Callable(this, MethodName.DestroyThatObject)); * - * - * * _undo_redo.CommitAction(); - * - * [/csharp] - * - * [/codeblocks] + * ``` */ @GodotBaseType public open class UndoRedo : Object() { @@ -215,11 +143,12 @@ public open class UndoRedo : Object() { } /** - * Create a new action. After this is called, do all your calls to [addDoMethod], [addUndoMethod], [addDoProperty], and [addUndoProperty], then commit the action with [commitAction]. - * - * The way actions are merged is dictated by [mergeMode]. See [enum MergeMode] for details. - * - * The way undo operation are ordered in actions is dictated by [backwardUndoOps]. When [backwardUndoOps] is `false` undo option are ordered in the same order they were added. Which means the first operation to be added will be the first to be undone. + * Create a new action. After this is called, do all your calls to [addDoMethod], [addUndoMethod], + * [addDoProperty], and [addUndoProperty], then commit the action with [commitAction]. + * The way actions are merged is dictated by [param merge_mode]. See [enum MergeMode] for details. + * The way undo operation are ordered in actions is dictated by [param backward_undo_ops]. When + * [param backward_undo_ops] is `false` undo option are ordered in the same order they were added. + * Which means the first operation to be added will be the first to be undone. */ @JvmOverloads public fun createAction( @@ -232,7 +161,8 @@ public open class UndoRedo : Object() { } /** - * Commit the action. If [execute] is `true` (which it is by default), all "do" methods/properties are called/set when this function is called. + * Commit the action. If [param execute] is `true` (which it is by default), all "do" + * methods/properties are called/set when this function is called. */ @JvmOverloads public fun commitAction(execute: Boolean = true): Unit { @@ -241,7 +171,8 @@ public open class UndoRedo : Object() { } /** - * Returns `true` if the [godot.UndoRedo] is currently committing the action, i.e. running its "do" method or property change (see [commitAction]). + * Returns `true` if the [UndoRedo] is currently committing the action, i.e. running its "do" + * method or property change (see [commitAction]). */ public fun isCommittingAction(): Boolean { TransferContext.writeArguments() @@ -250,7 +181,7 @@ public open class UndoRedo : Object() { } /** - * Register a [godot.Callable] that will be called when the action is committed. + * Register a [Callable] that will be called when the action is committed. */ public fun addDoMethod(callable: Callable): Unit { TransferContext.writeArguments(CALLABLE to callable) @@ -258,7 +189,7 @@ public open class UndoRedo : Object() { } /** - * Register a [godot.Callable] that will be called when the action is undone. + * Register a [Callable] that will be called when the action is undone. */ public fun addUndoMethod(callable: Callable): Unit { TransferContext.writeArguments(CALLABLE to callable) @@ -266,7 +197,8 @@ public open class UndoRedo : Object() { } /** - * Register a [property] that would change its value to [value] when the action is committed. + * Register a [param property] that would change its value to [param value] when the action is + * committed. */ public fun addDoProperty( _object: Object, @@ -278,7 +210,8 @@ public open class UndoRedo : Object() { } /** - * Register a [property] that would change its value to [value] when the action is undone. + * Register a [param property] that would change its value to [param value] when the action is + * undone. */ public fun addUndoProperty( _object: Object, @@ -290,16 +223,16 @@ public open class UndoRedo : Object() { } /** - * Register a reference for "do" that will be erased if the "do" history is lost. This is useful mostly for new nodes created for the "do" call. Do not use for resources. - * - * ``` - * var node = Node2D.new() - * undo_redo.create_action("Add node") - * undo_redo.add_do_method(add_child.bind(node)) - * undo_redo.add_do_reference(node) - * undo_redo.add_undo_method(remove_child.bind(node)) - * undo_redo.commit_action() - * ``` + * Register a reference for "do" that will be erased if the "do" history is lost. This is useful + * mostly for new nodes created for the "do" call. Do not use for resources. + * [codeblock] + * var node = Node2D.new() + * undo_redo.create_action("Add node") + * undo_redo.add_do_method(add_child.bind(node)) + * undo_redo.add_do_reference(node) + * undo_redo.add_undo_method(remove_child.bind(node)) + * undo_redo.commit_action() + * [/codeblock] */ public fun addDoReference(_object: Object): Unit { TransferContext.writeArguments(OBJECT to _object) @@ -307,16 +240,16 @@ public open class UndoRedo : Object() { } /** - * Register a reference for "undo" that will be erased if the "undo" history is lost. This is useful mostly for nodes removed with the "do" call (not the "undo" call!). - * - * ``` - * var node = $Node2D - * undo_redo.create_action("Remove node") - * undo_redo.add_do_method(remove_child.bind(node)) - * undo_redo.add_undo_method(add_child.bind(node)) - * undo_redo.add_undo_reference(node) - * undo_redo.commit_action() - * ``` + * Register a reference for "undo" that will be erased if the "undo" history is lost. This is + * useful mostly for nodes removed with the "do" call (not the "undo" call!). + * [codeblock] + * var node = $Node2D + * undo_redo.create_action("Remove node") + * undo_redo.add_do_method(remove_child.bind(node)) + * undo_redo.add_undo_method(add_child.bind(node)) + * undo_redo.add_undo_reference(node) + * undo_redo.commit_action() + * [/codeblock] */ public fun addUndoReference(_object: Object): Unit { TransferContext.writeArguments(OBJECT to _object) @@ -324,7 +257,9 @@ public open class UndoRedo : Object() { } /** - * Marks the next "do" and "undo" operations to be processed even if the action gets merged with another in the [MERGE_ENDS] mode. Return to normal operation using [endForceKeepInMergeEnds]. + * Marks the next "do" and "undo" operations to be processed even if the action gets merged with + * another in the [constant MERGE_ENDS] mode. Return to normal operation using + * [endForceKeepInMergeEnds]. */ public fun startForceKeepInMergeEnds(): Unit { TransferContext.writeArguments() @@ -332,7 +267,8 @@ public open class UndoRedo : Object() { } /** - * Stops marking operations as to be processed even if the action gets merged with another in the [MERGE_ENDS] mode. See [startForceKeepInMergeEnds]. + * Stops marking operations as to be processed even if the action gets merged with another in the + * [constant MERGE_ENDS] mode. See [startForceKeepInMergeEnds]. */ public fun endForceKeepInMergeEnds(): Unit { TransferContext.writeArguments() @@ -368,8 +304,8 @@ public open class UndoRedo : Object() { /** * Clear the undo/redo history and associated references. - * - * Passing `false` to [increaseVersion] will prevent the version number from increasing when the history is cleared. + * Passing `false` to [param increase_version] will prevent the version number from increasing + * when the history is cleared. */ @JvmOverloads public fun clearHistory(increaseVersion: Boolean = true): Unit { @@ -405,8 +341,8 @@ public open class UndoRedo : Object() { } /** - * Gets the version. Every time a new action is committed, the [godot.UndoRedo]'s version number is increased automatically. - * + * Gets the version. Every time a new action is committed, the [UndoRedo]'s version number is + * increased automatically. * This is useful mostly to check if something changed from a saved version. */ public fun getVersion(): Long { @@ -441,7 +377,8 @@ public open class UndoRedo : Object() { */ MERGE_DISABLE(0), /** - * Makes so that the action's "undo" operations are from the first action created and the "do" operations are from the last subsequent action with the same name. + * Makes so that the action's "undo" operations are from the first action created and the "do" + * operations are from the last subsequent action with the same name. */ MERGE_ENDS(1), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VBoxContainer.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VBoxContainer.kt index 4f8e5f98c..ca4973887 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VBoxContainer.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VBoxContainer.kt @@ -12,12 +12,8 @@ import kotlin.Int import kotlin.Suppress /** - * A container that arranges its child controls vertically. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/676](https://godotengine.org/asset-library/asset/676) - * - * A variant of [godot.BoxContainer] that can only arrange its child controls vertically. Child controls are rearranged automatically when their minimum size changes. + * A variant of [BoxContainer] that can only arrange its child controls vertically. Child controls + * are rearranged automatically when their minimum size changes. */ @GodotBaseType public open class VBoxContainer : BoxContainer() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VFlowContainer.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VFlowContainer.kt index cb1912a56..511b631ea 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VFlowContainer.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VFlowContainer.kt @@ -12,12 +12,9 @@ import kotlin.Int import kotlin.Suppress /** - * A container that arranges its child controls vertically and wraps them around at the borders. - * - * Tutorials: - * [$DOCS_URL/tutorials/ui/gui_containers.html]($DOCS_URL/tutorials/ui/gui_containers.html) - * - * A variant of [godot.FlowContainer] that can only arrange its child controls vertically, wrapping them around at the borders. This is similar to how text in a book wraps around when no more words can fit on a line, except vertically. + * A variant of [FlowContainer] that can only arrange its child controls vertically, wrapping them + * around at the borders. This is similar to how text in a book wraps around when no more words can fit + * on a line, except vertically. */ @GodotBaseType public open class VFlowContainer : FlowContainer() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VScrollBar.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VScrollBar.kt index d31fa9acc..28f1f8726 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VScrollBar.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VScrollBar.kt @@ -12,9 +12,9 @@ import kotlin.Int import kotlin.Suppress /** - * A vertical scrollbar that goes from top (min) to bottom (max). - * - * A vertical scrollbar, typically used to navigate through content that extends beyond the visible height of a control. It is a [godot.Range]-based control and goes from top (min) to bottom (max). Note that this direction is the opposite of [godot.VSlider]'s. + * A vertical scrollbar, typically used to navigate through content that extends beyond the visible + * height of a control. It is a [Range]-based control and goes from top (min) to bottom (max). Note + * that this direction is the opposite of [VSlider]'s. */ @GodotBaseType public open class VScrollBar : ScrollBar() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VSeparator.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VSeparator.kt index c9c8ef6d3..7251ab673 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VSeparator.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VSeparator.kt @@ -12,9 +12,8 @@ import kotlin.Int import kotlin.Suppress /** - * A vertical line used for separating other controls. - * - * A vertical separator used for separating other controls that are arranged **horizontally**. [godot.VSeparator] is purely visual and normally drawn as a [godot.StyleBoxLine]. + * A vertical separator used for separating other controls that are arranged **horizontally**. + * [VSeparator] is purely visual and normally drawn as a [StyleBoxLine]. */ @GodotBaseType public open class VSeparator : Separator() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VSlider.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VSlider.kt index 08aebe665..0b6e34980 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VSlider.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VSlider.kt @@ -12,9 +12,9 @@ import kotlin.Int import kotlin.Suppress /** - * A vertical slider that goes from bottom (min) to top (max). - * - * A vertical slider, used to adjust a value by moving a grabber along a vertical axis. It is a [godot.Range]-based control and goes from bottom (min) to top (max). Note that this direction is the opposite of [godot.VScrollBar]'s. + * A vertical slider, used to adjust a value by moving a grabber along a vertical axis. It is a + * [Range]-based control and goes from bottom (min) to top (max). Note that this direction is the + * opposite of [VScrollBar]'s. */ @GodotBaseType public open class VSlider : Slider() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VSplitContainer.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VSplitContainer.kt index eb4949f2f..60a6bc303 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VSplitContainer.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VSplitContainer.kt @@ -12,12 +12,9 @@ import kotlin.Int import kotlin.Suppress /** - * A container that splits two child controls vertically and provides a grabber for adjusting the split ratio. - * - * Tutorials: - * [$DOCS_URL/tutorials/ui/gui_containers.html]($DOCS_URL/tutorials/ui/gui_containers.html) - * - * A container that accepts only two child controls, then arranges them vertically and creates a divisor between them. The divisor can be dragged around to change the size relation between the child controls. + * A container that accepts only two child controls, then arranges them vertically and creates a + * divisor between them. The divisor can be dragged around to change the size relation between the + * child controls. */ @GodotBaseType public open class VSplitContainer : SplitContainer() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VariantOperator.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VariantOperator.kt index 0f90cd507..f5af749e8 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VariantOperator.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VariantOperator.kt @@ -6,31 +6,109 @@ import kotlin.Long public enum class VariantOperator( id: Long, ) { + /** + * Equality operator (`==`). + */ OP_EQUAL(0), + /** + * Inequality operator (`!=`). + */ OP_NOT_EQUAL(1), + /** + * Less than operator (`<`). + */ OP_LESS(2), + /** + * Less than or equal operator (`<=`). + */ OP_LESS_EQUAL(3), + /** + * Greater than operator (`>`). + */ OP_GREATER(4), + /** + * Greater than or equal operator (`>=`). + */ OP_GREATER_EQUAL(5), + /** + * Addition operator (`+`). + */ OP_ADD(6), + /** + * Subtraction operator (`-`). + */ OP_SUBTRACT(7), + /** + * Multiplication operator (`*`). + */ OP_MULTIPLY(8), + /** + * Division operator (`/`). + */ OP_DIVIDE(9), + /** + * Unary negation operator (`-`). + */ OP_NEGATE(10), + /** + * Unary plus operator (`+`). + */ OP_POSITIVE(11), + /** + * Remainder/modulo operator (`%`). + */ OP_MODULE(12), + /** + * Power operator (`**`). + */ OP_POWER(13), + /** + * Left shift operator (`<<`). + */ OP_SHIFT_LEFT(14), + /** + * Right shift operator (`>>`). + */ OP_SHIFT_RIGHT(15), + /** + * Bitwise AND operator (`&`). + */ OP_BIT_AND(16), + /** + * Bitwise OR operator (`|`). + */ OP_BIT_OR(17), + /** + * Bitwise XOR operator (`^`). + */ OP_BIT_XOR(18), + /** + * Bitwise NOT operator (`~`). + */ OP_BIT_NEGATE(19), + /** + * Logical AND operator (`and` or `&&`). + */ OP_AND(20), + /** + * Logical OR operator (`or` or `||`). + */ OP_OR(21), + /** + * Logical XOR operator (not implemented in GDScript). + */ OP_XOR(22), + /** + * Logical NOT operator (`not` or `!`). + */ OP_NOT(23), + /** + * Logical IN operator (`in`). + */ OP_IN(24), + /** + * Represents the size of the [enum Variant.Operator] enum. + */ OP_MAX(25), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VariantType.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VariantType.kt index ffb8d6ed5..931822eab 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VariantType.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VariantType.kt @@ -6,44 +6,161 @@ import kotlin.Long public enum class VariantType( id: Long, ) { + /** + * Variable is `null`. + */ TYPE_NIL(0), + /** + * Variable is of type [bool]. + */ TYPE_BOOL(1), + /** + * Variable is of type [int]. + */ TYPE_INT(2), + /** + * Variable is of type [float]. + */ TYPE_FLOAT(3), + /** + * Variable is of type [String]. + */ TYPE_STRING(4), + /** + * Variable is of type [Vector2]. + */ TYPE_VECTOR2(5), + /** + * Variable is of type [Vector2i]. + */ TYPE_VECTOR2I(6), + /** + * Variable is of type [Rect2]. + */ TYPE_RECT2(7), + /** + * Variable is of type [Rect2i]. + */ TYPE_RECT2I(8), + /** + * Variable is of type [Vector3]. + */ TYPE_VECTOR3(9), + /** + * Variable is of type [Vector3i]. + */ TYPE_VECTOR3I(10), + /** + * Variable is of type [Transform2D]. + */ TYPE_TRANSFORM2D(11), + /** + * Variable is of type [Vector4]. + */ TYPE_VECTOR4(12), + /** + * Variable is of type [Vector4i]. + */ TYPE_VECTOR4I(13), + /** + * Variable is of type [Plane]. + */ TYPE_PLANE(14), + /** + * Variable is of type [Quaternion]. + */ TYPE_QUATERNION(15), + /** + * Variable is of type [AABB]. + */ TYPE_AABB(16), + /** + * Variable is of type [Basis]. + */ TYPE_BASIS(17), + /** + * Variable is of type [Transform3D]. + */ TYPE_TRANSFORM3D(18), + /** + * Variable is of type [Projection]. + */ TYPE_PROJECTION(19), + /** + * Variable is of type [Color]. + */ TYPE_COLOR(20), + /** + * Variable is of type [StringName]. + */ TYPE_STRING_NAME(21), + /** + * Variable is of type [NodePath]. + */ TYPE_NODE_PATH(22), + /** + * Variable is of type [RID]. + */ TYPE_RID(23), + /** + * Variable is of type [Object]. + */ TYPE_OBJECT(24), + /** + * Variable is of type [Callable]. + */ TYPE_CALLABLE(25), + /** + * Variable is of type [Signal]. + */ TYPE_SIGNAL(26), + /** + * Variable is of type [Dictionary]. + */ TYPE_DICTIONARY(27), + /** + * Variable is of type [Array]. + */ TYPE_ARRAY(28), + /** + * Variable is of type [PackedByteArray]. + */ TYPE_PACKED_BYTE_ARRAY(29), + /** + * Variable is of type [PackedInt32Array]. + */ TYPE_PACKED_INT32_ARRAY(30), + /** + * Variable is of type [PackedInt64Array]. + */ TYPE_PACKED_INT64_ARRAY(31), + /** + * Variable is of type [PackedFloat32Array]. + */ TYPE_PACKED_FLOAT32_ARRAY(32), + /** + * Variable is of type [PackedFloat64Array]. + */ TYPE_PACKED_FLOAT64_ARRAY(33), + /** + * Variable is of type [PackedStringArray]. + */ TYPE_PACKED_STRING_ARRAY(34), + /** + * Variable is of type [PackedVector2Array]. + */ TYPE_PACKED_VECTOR2_ARRAY(35), + /** + * Variable is of type [PackedVector3Array]. + */ TYPE_PACKED_VECTOR3_ARRAY(36), + /** + * Variable is of type [PackedColorArray]. + */ TYPE_PACKED_COLOR_ARRAY(37), + /** + * Represents the size of the [enum Variant.Type] enum. + */ TYPE_MAX(38), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VehicleBody3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VehicleBody3D.kt index f77358ad4..0178a1e57 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VehicleBody3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VehicleBody3D.kt @@ -19,24 +19,28 @@ import kotlin.Int import kotlin.Suppress /** - * A 3D physics body that simulates the behavior of a car. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/524](https://godotengine.org/asset-library/asset/524) - * - * This physics body implements all the physics logic needed to simulate a car. It is based on the raycast vehicle system commonly found in physics engines. Aside from a [godot.CollisionShape3D] for the main body of the vehicle, you must also add a [godot.VehicleWheel3D] node for each wheel. You should also add a [godot.MeshInstance3D] to this node for the 3D model of the vehicle, but this model should generally not include meshes for the wheels. You can control the vehicle by using the [brake], [engineForce], and [steering] properties. The position or orientation of this node shouldn't be changed directly. - * - * **Note:** The origin point of your VehicleBody3D will determine the center of gravity of your vehicle. To make the vehicle more grounded, the origin point is usually kept low, moving the [godot.CollisionShape3D] and [godot.MeshInstance3D] upwards. - * - * **Note:** This class has known issues and isn't designed to provide realistic 3D vehicle physics. If you want advanced vehicle physics, you may have to write your own physics integration using [godot.CharacterBody3D] or [godot.RigidBody3D]. + * This physics body implements all the physics logic needed to simulate a car. It is based on the + * raycast vehicle system commonly found in physics engines. Aside from a [CollisionShape3D] for the + * main body of the vehicle, you must also add a [VehicleWheel3D] node for each wheel. You should also + * add a [MeshInstance3D] to this node for the 3D model of the vehicle, but this model should generally + * not include meshes for the wheels. You can control the vehicle by using the [brake], [engineForce], + * and [steering] properties. The position or orientation of this node shouldn't be changed directly. + * **Note:** The origin point of your VehicleBody3D will determine the center of gravity of your + * vehicle. To make the vehicle more grounded, the origin point is usually kept low, moving the + * [CollisionShape3D] and [MeshInstance3D] upwards. + * **Note:** This class has known issues and isn't designed to provide realistic 3D vehicle physics. + * If you want advanced vehicle physics, you may have to write your own physics integration using + * [CharacterBody3D] or [RigidBody3D]. */ @GodotBaseType public open class VehicleBody3D : RigidBody3D() { /** - * Accelerates the vehicle by applying an engine force. The vehicle is only sped up if the wheels that have [godot.VehicleWheel3D.useAsTraction] set to `true` and are in contact with a surface. The [godot.RigidBody3D.mass] of the vehicle has an effect on the acceleration of the vehicle. For a vehicle with a mass set to 1000, try a value in the 25 - 50 range for acceleration. - * - * **Note:** The simulation does not take the effect of gears into account, you will need to add logic for this if you wish to simulate gears. - * + * Accelerates the vehicle by applying an engine force. The vehicle is only sped up if the wheels + * that have [VehicleWheel3D.useAsTraction] set to `true` and are in contact with a surface. The + * [RigidBody3D.mass] of the vehicle has an effect on the acceleration of the vehicle. For a vehicle + * with a mass set to 1000, try a value in the 25 - 50 range for acceleration. + * **Note:** The simulation does not take the effect of gears into account, you will need to add + * logic for this if you wish to simulate gears. * A negative value will result in the vehicle reversing. */ public var engineForce: Float @@ -51,7 +55,10 @@ public open class VehicleBody3D : RigidBody3D() { } /** - * Slows down the vehicle by applying a braking force. The vehicle is only slowed down if the wheels are in contact with a surface. The force you need to apply to adequately slow down your vehicle depends on the [godot.RigidBody3D.mass] of the vehicle. For a vehicle with a mass set to 1000, try a value in the 25 - 30 range for hard braking. + * Slows down the vehicle by applying a braking force. The vehicle is only slowed down if the + * wheels are in contact with a surface. The force you need to apply to adequately slow down your + * vehicle depends on the [RigidBody3D.mass] of the vehicle. For a vehicle with a mass set to 1000, + * try a value in the 25 - 30 range for hard braking. */ public var brake: Float get() { @@ -65,9 +72,11 @@ public open class VehicleBody3D : RigidBody3D() { } /** - * The steering angle for the vehicle. Setting this to a non-zero value will result in the vehicle turning when it's moving. Wheels that have [godot.VehicleWheel3D.useAsSteering] set to `true` will automatically be rotated. - * - * **Note:** This property is edited in the inspector in degrees. In code the property is set in radians. + * The steering angle for the vehicle. Setting this to a non-zero value will result in the vehicle + * turning when it's moving. Wheels that have [VehicleWheel3D.useAsSteering] set to `true` will + * automatically be rotated. + * **Note:** This property is edited in the inspector in degrees. In code the property is set in + * radians. */ public var steering: Float get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VerticalAlignment.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VerticalAlignment.kt index 5b4254f1f..4a4deed0a 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VerticalAlignment.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VerticalAlignment.kt @@ -6,9 +6,21 @@ import kotlin.Long public enum class VerticalAlignment( id: Long, ) { + /** + * Vertical top alignment, usually for text-derived classes. + */ VERTICAL_ALIGNMENT_TOP(0), + /** + * Vertical center alignment, usually for text-derived classes. + */ VERTICAL_ALIGNMENT_CENTER(1), + /** + * Vertical bottom alignment, usually for text-derived classes. + */ VERTICAL_ALIGNMENT_BOTTOM(2), + /** + * Expand rows to fit height, usually for text-derived classes. + */ VERTICAL_ALIGNMENT_FILL(3), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VideoStreamPlayback.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VideoStreamPlayback.kt index 1f1cbb89b..9681aae7c 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VideoStreamPlayback.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VideoStreamPlayback.kt @@ -23,9 +23,8 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * Internal class used by [godot.VideoStream] to manage playback state when played from a [godot.VideoStreamPlayer]. - * - * This class is intended to be overridden by video decoder extensions with custom implementations of [godot.VideoStream]. + * This class is intended to be overridden by video decoder extensions with custom implementations + * of [VideoStream]. */ @GodotBaseType public open class VideoStreamPlayback : Resource() { @@ -35,13 +34,16 @@ public open class VideoStreamPlayback : Resource() { } /** - * Stops playback. May be called multiple times before [_play], or in response to [godot.VideoStreamPlayer.stop]. [_isPlaying] should return false once stopped. + * Stops playback. May be called multiple times before [_play], or in response to + * [VideoStreamPlayer.stop]. [_isPlaying] should return false once stopped. */ public open fun _stop(): Unit { } /** - * Called in response to [godot.VideoStreamPlayer.autoplay] or [godot.VideoStreamPlayer.play]. Note that manual playback may also invoke [_stop] multiple times before this method is called. [_isPlaying] should return true once playing. + * Called in response to [VideoStreamPlayer.autoplay] or [VideoStreamPlayer.play]. Note that + * manual playback may also invoke [_stop] multiple times before this method is called. [_isPlaying] + * should return true once playing. */ public open fun _play(): Unit { } @@ -54,7 +56,8 @@ public open class VideoStreamPlayback : Resource() { } /** - * Set the paused status of video playback. [_isPaused] must return [paused]. Called in response to the [godot.VideoStreamPlayer.paused] setter. + * Set the paused status of video playback. [_isPaused] must return [param paused]. Called in + * response to the [VideoStreamPlayer.paused] setter. */ public open fun _setPaused(paused: Boolean): Unit { } @@ -74,33 +77,37 @@ public open class VideoStreamPlayback : Resource() { } /** - * Return the current playback timestamp. Called in response to the [godot.VideoStreamPlayer.streamPosition] getter. + * Return the current playback timestamp. Called in response to the + * [VideoStreamPlayer.streamPosition] getter. */ public open fun _getPlaybackPosition(): Double { throw NotImplementedError("_get_playback_position is not implemented for VideoStreamPlayback") } /** - * Seeks to [time] seconds. Called in response to the [godot.VideoStreamPlayer.streamPosition] setter. + * Seeks to [param time] seconds. Called in response to the [VideoStreamPlayer.streamPosition] + * setter. */ public open fun _seek(time: Double): Unit { } /** - * Select the audio track [idx]. Called when playback starts, and in response to the [godot.VideoStreamPlayer.audioTrack] setter. + * Select the audio track [param idx]. Called when playback starts, and in response to the + * [VideoStreamPlayer.audioTrack] setter. */ public open fun _setAudioTrack(idx: Int): Unit { } /** - * Allocates a [godot.Texture2D] in which decoded video frames will be drawn. + * Allocates a [Texture2D] in which decoded video frames will be drawn. */ public open fun _getTexture(): Texture2D? { throw NotImplementedError("_get_texture is not implemented for VideoStreamPlayback") } /** - * Ticks video playback for [delta] seconds. Called every frame as long as [_isPaused] and [_isPlaying] return true. + * Ticks video playback for [param delta] seconds. Called every frame as long as [_isPaused] and + * [_isPlaying] return true. */ public open fun _update(delta: Double): Unit { } @@ -120,7 +127,9 @@ public open class VideoStreamPlayback : Resource() { } /** - * Render [numFrames] audio frames (of [_getChannels] floats each) from [buffer], starting from index [offset] in the array. Returns the number of audio frames rendered, or -1 on error. + * Render [param num_frames] audio frames (of [_getChannels] floats each) from [param buffer], + * starting from index [param offset] in the array. Returns the number of audio frames rendered, + * or -1 on error. */ @JvmOverloads public fun mixAudio( diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VideoStreamTheora.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VideoStreamTheora.kt index e00184e8c..a8b2d5cf0 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VideoStreamTheora.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VideoStreamTheora.kt @@ -11,6 +11,12 @@ import kotlin.Boolean import kotlin.Int import kotlin.Suppress +/** + * [VideoStream] resource handling the [url=https://www.theora.org/]Ogg Theora[/url] video format + * with `.ogv` extension. The Theora codec is decoded on the CPU. + * **Note:** While Ogg Theora videos can also have an `.ogg` extension, you will have to rename the + * extension to `.ogv` to use those videos within Godot. + */ @GodotBaseType public open class VideoStreamTheora : VideoStream() { public override fun new(scriptIndex: Int): Boolean { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ViewportTexture.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ViewportTexture.kt index f9b635192..7024c3be2 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ViewportTexture.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ViewportTexture.kt @@ -18,23 +18,21 @@ import kotlin.Int import kotlin.Suppress /** - * Provides the content of a [godot.Viewport] as a dynamic texture. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/586](https://godotengine.org/asset-library/asset/586) - * - * Provides the content of a [godot.Viewport] as a dynamic [godot.Texture2D]. This can be used to mix controls, 2D game objects, and 3D game objects in the same scene. - * - * To create a [godot.ViewportTexture] in code, use the [godot.Viewport.getTexture] method on the target viewport. - * - * **Note:** A [godot.ViewportTexture] is always local to its scene (see [godot.Resource.resourceLocalToScene]). If the scene root is not ready, it may return incorrect data (see [godot.Node.ready]). + * Provides the content of a [Viewport] as a dynamic [Texture2D]. This can be used to mix controls, + * 2D game objects, and 3D game objects in the same scene. + * To create a [ViewportTexture] in code, use the [Viewport.getTexture] method on the target + * viewport. + * **Note:** A [ViewportTexture] is always local to its scene (see [Resource.resourceLocalToScene]). + * If the scene root is not ready, it may return incorrect data (see [signal Node.ready]). */ @GodotBaseType public open class ViewportTexture : Texture2D() { /** - * The path to the [godot.Viewport] node to display. This is relative to the scene root, not to the node that uses the texture. - * - * **Note:** In the editor, this path is automatically updated when the target viewport or one of its ancestors is renamed or moved. At runtime, the path may not be able to automatically update due to the inability to determine the scene root. + * The path to the [Viewport] node to display. This is relative to the scene root, not to the node + * that uses the texture. + * **Note:** In the editor, this path is automatically updated when the target viewport or one of + * its ancestors is renamed or moved. At runtime, the path may not be able to automatically update + * due to the inability to determine the scene root. */ public var viewportPath: NodePath get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualInstance3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualInstance3D.kt index 02e374422..65169c9f1 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualInstance3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualInstance3D.kt @@ -27,22 +27,27 @@ import kotlin.Suppress import kotlin.Unit /** - * Parent of all visual 3D nodes. - * - * The [godot.VisualInstance3D] is used to connect a resource to a visual representation. All visual 3D nodes inherit from the [godot.VisualInstance3D]. In general, you should not access the [godot.VisualInstance3D] properties directly as they are accessed and managed by the nodes that inherit from [godot.VisualInstance3D]. [godot.VisualInstance3D] is the node representation of the [godot.RenderingServer] instance. + * The [VisualInstance3D] is used to connect a resource to a visual representation. All visual 3D + * nodes inherit from the [VisualInstance3D]. In general, you should not access the [VisualInstance3D] + * properties directly as they are accessed and managed by the nodes that inherit from + * [VisualInstance3D]. [VisualInstance3D] is the node representation of the [RenderingServer] instance. */ @GodotBaseType public open class VisualInstance3D : Node3D() { /** - * The render layer(s) this [godot.VisualInstance3D] is drawn on. - * - * This object will only be visible for [godot.Camera3D]s whose cull mask includes any of the render layers this [godot.VisualInstance3D] is set to. - * - * For [godot.Light3D]s, this can be used to control which [godot.VisualInstance3D]s are affected by a specific light. For [godot.GPUParticles3D], this can be used to control which particles are effected by a specific attractor. For [godot.Decal]s, this can be used to control which [godot.VisualInstance3D]s are affected by a specific decal. - * + * The render layer(s) this [VisualInstance3D] is drawn on. + * This object will only be visible for [Camera3D]s whose cull mask includes any of the render + * layers this [VisualInstance3D] is set to. + * For [Light3D]s, this can be used to control which [VisualInstance3D]s are affected by a + * specific light. For [GPUParticles3D], this can be used to control which particles are effected by + * a specific attractor. For [Decal]s, this can be used to control which [VisualInstance3D]s are + * affected by a specific decal. * To adjust [layers] more easily using a script, use [getLayerMaskValue] and [setLayerMaskValue]. - * - * **Note:** [godot.VoxelGI], SDFGI and [godot.LightmapGI] will always take all layers into account to determine what contributes to global illumination. If this is an issue, set [godot.GeometryInstance3D.giMode] to [godot.GeometryInstance3D.GI_MODE_DISABLED] for meshes and [godot.Light3D.lightBakeMode] to [godot.Light3D.BAKE_DISABLED] for lights to exclude them from global illumination. + * **Note:** [VoxelGI], SDFGI and [LightmapGI] will always take all layers into account to + * determine what contributes to global illumination. If this is an issue, set + * [GeometryInstance3D.giMode] to [constant GeometryInstance3D.GI_MODE_DISABLED] for meshes and + * [Light3D.lightBakeMode] to [constant Light3D.BAKE_DISABLED] for lights to exclude them from global + * illumination. */ public var layers: Long get() { @@ -56,7 +61,12 @@ public open class VisualInstance3D : Node3D() { } /** - * The amount by which the depth of this [godot.VisualInstance3D] will be adjusted when sorting by depth. Uses the same units as the engine (which are typically meters). Adjusting it to a higher value will make the [godot.VisualInstance3D] reliably draw on top of other [godot.VisualInstance3D]s that are otherwise positioned at the same spot. To ensure it always draws on top of other objects around it (not positioned at the same spot), set the value to be greater than the distance between this [godot.VisualInstance3D] and the other nearby [godot.VisualInstance3D]s. + * The amount by which the depth of this [VisualInstance3D] will be adjusted when sorting by + * depth. Uses the same units as the engine (which are typically meters). Adjusting it to a higher + * value will make the [VisualInstance3D] reliably draw on top of other [VisualInstance3D]s that are + * otherwise positioned at the same spot. To ensure it always draws on top of other objects around it + * (not positioned at the same spot), set the value to be greater than the distance between this + * [VisualInstance3D] and the other nearby [VisualInstance3D]s. */ public var sortingOffset: Float get() { @@ -70,9 +80,11 @@ public open class VisualInstance3D : Node3D() { } /** - * If `true`, the object is sorted based on the [AABB] center. The object will be sorted based on the global position otherwise. - * - * The [AABB] center based sorting is generally more accurate for 3D models. The position based sorting instead allows to better control the drawing order when working with [godot.GPUParticles3D] and [godot.CPUParticles3D]. + * If `true`, the object is sorted based on the [AABB] center. The object will be sorted based on + * the global position otherwise. + * The [AABB] center based sorting is generally more accurate for 3D models. The position based + * sorting instead allows to better control the drawing order when working with [GPUParticles3D] and + * [CPUParticles3D]. */ public var sortingUseAabbCenter: Boolean get() { @@ -90,15 +102,13 @@ public open class VisualInstance3D : Node3D() { return true } - /** - * - */ public open fun _getAabb(): AABB { throw NotImplementedError("_get_aabb is not implemented for VisualInstance3D") } /** - * Sets the resource that is instantiated by this [godot.VisualInstance3D], which changes how the engine handles the [godot.VisualInstance3D] under the hood. Equivalent to [godot.RenderingServer.instanceSetBase]. + * Sets the resource that is instantiated by this [VisualInstance3D], which changes how the engine + * handles the [VisualInstance3D] under the hood. Equivalent to [RenderingServer.instanceSetBase]. */ public fun setBase(base: RID): Unit { TransferContext.writeArguments(_RID to base) @@ -106,7 +116,8 @@ public open class VisualInstance3D : Node3D() { } /** - * Returns the RID of the resource associated with this [godot.VisualInstance3D]. For example, if the Node is a [godot.MeshInstance3D], this will return the RID of the associated [godot.Mesh]. + * Returns the RID of the resource associated with this [VisualInstance3D]. For example, if the + * Node is a [MeshInstance3D], this will return the RID of the associated [Mesh]. */ public fun getBase(): RID { TransferContext.writeArguments() @@ -115,7 +126,9 @@ public open class VisualInstance3D : Node3D() { } /** - * Returns the RID of this instance. This RID is the same as the RID returned by [godot.RenderingServer.instanceCreate]. This RID is needed if you want to call [godot.RenderingServer] functions directly on this [godot.VisualInstance3D]. + * Returns the RID of this instance. This RID is the same as the RID returned by + * [RenderingServer.instanceCreate]. This RID is needed if you want to call [RenderingServer] + * functions directly on this [VisualInstance3D]. */ public fun getInstance(): RID { TransferContext.writeArguments() @@ -124,7 +137,8 @@ public open class VisualInstance3D : Node3D() { } /** - * Based on [value], enables or disables the specified layer in the [layers], given a [layerNumber] between 1 and 20. + * Based on [param value], enables or disables the specified layer in the [layers], given a [param + * layer_number] between 1 and 20. */ public fun setLayerMaskValue(layerNumber: Int, `value`: Boolean): Unit { TransferContext.writeArguments(LONG to layerNumber.toLong(), BOOL to value) @@ -132,7 +146,8 @@ public open class VisualInstance3D : Node3D() { } /** - * Returns whether or not the specified layer of the [layers] is enabled, given a [layerNumber] between 1 and 20. + * Returns whether or not the specified layer of the [layers] is enabled, given a [param + * layer_number] between 1 and 20. */ public fun getLayerMaskValue(layerNumber: Int): Boolean { TransferContext.writeArguments(LONG to layerNumber.toLong()) @@ -141,7 +156,7 @@ public open class VisualInstance3D : Node3D() { } /** - * Returns the [AABB] (also known as the bounding box) for this [godot.VisualInstance3D]. + * Returns the [AABB] (also known as the bounding box) for this [VisualInstance3D]. */ public fun getAabb(): AABB { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShader.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShader.kt index 3322e9953..ff487acf7 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShader.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShader.kt @@ -36,12 +36,10 @@ import kotlin.Suppress import kotlin.Unit /** - * A custom shader program with a visual editor. - * - * Tutorials: - * [$DOCS_URL/tutorials/shaders/visual_shaders.html]($DOCS_URL/tutorials/shaders/visual_shaders.html) - * - * This class provides a graph-like visual editor for creating a [godot.Shader]. Although [godot.VisualShader]s do not require coding, they share the same logic with script shaders. They use [godot.VisualShaderNode]s that can be connected to each other to control the flow of the shader. The visual shader graph is converted to a script shader behind the scenes. + * This class provides a graph-like visual editor for creating a [Shader]. Although [VisualShader]s + * do not require coding, they share the same logic with script shaders. They use [VisualShaderNode]s + * that can be connected to each other to control the flow of the shader. The visual shader graph is + * converted to a script shader behind the scenes. */ @GodotBaseType public open class VisualShader : Shader() { @@ -98,7 +96,7 @@ public open class VisualShader : Shader() { } /** - * Adds the specified [node] to the shader. + * Adds the specified [param node] to the shader. */ public fun addNode( type: Type, @@ -111,7 +109,7 @@ public open class VisualShader : Shader() { } /** - * Returns the shader node instance with specified [type] and [id]. + * Returns the shader node instance with specified [param type] and [param id]. */ public fun getNode(type: Type, id: Int): VisualShaderNode? { TransferContext.writeArguments(LONG to type.id, LONG to id.toLong()) @@ -238,7 +236,8 @@ public open class VisualShader : Shader() { } /** - * Connects the specified nodes and ports, even if they can't be connected. Such connection is invalid and will not function properly. + * Connects the specified nodes and ports, even if they can't be connected. Such connection is + * invalid and will not function properly. */ public fun connectNodesForced( type: Type, @@ -273,7 +272,8 @@ public open class VisualShader : Shader() { } /** - * Removes a varying value node with the given [name]. Prints an error if a node with this name is not found. + * Removes a varying value node with the given [param name]. Prints an error if a node with this + * name is not found. */ public fun removeVarying(name: String): Unit { TransferContext.writeArguments(STRING to name) @@ -281,7 +281,7 @@ public open class VisualShader : Shader() { } /** - * Returns `true` if the shader has a varying with the given [name]. + * Returns `true` if the shader has a varying with the given [param name]. */ public fun hasVarying(name: String): Boolean { TransferContext.writeArguments(STRING to name) @@ -391,15 +391,15 @@ public open class VisualShader : Shader() { */ VARYING_TYPE_UINT(2), /** - * Varying is of type [godot.core.Vector2]. + * Varying is of type [Vector2]. */ VARYING_TYPE_VECTOR_2D(3), /** - * Varying is of type [godot.core.Vector3]. + * Varying is of type [Vector3]. */ VARYING_TYPE_VECTOR_3D(4), /** - * Varying is of type [godot.Vector4]. + * Varying is of type [Vector4]. */ VARYING_TYPE_VECTOR_4D(5), /** @@ -407,7 +407,7 @@ public open class VisualShader : Shader() { */ VARYING_TYPE_BOOLEAN(6), /** - * Varying is of type [godot.Transform3D]. + * Varying is of type [Transform3D]. */ VARYING_TYPE_TRANSFORM(7), /** @@ -428,12 +428,12 @@ public open class VisualShader : Shader() { public companion object { /** - * Denotes invalid [godot.VisualShader] node. + * Denotes invalid [VisualShader] node. */ public final const val NODE_ID_INVALID: Long = -1 /** - * Denotes output node of [godot.VisualShader]. + * Denotes output node of [VisualShader]. */ public final const val NODE_ID_OUTPUT: Long = 0 } diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNode.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNode.kt index b42c4990e..4bd1ea47e 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNode.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNode.kt @@ -24,17 +24,15 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * Base class for [godot.VisualShader] nodes. Not related to scene nodes. - * - * Tutorials: - * [$DOCS_URL/tutorials/shaders/visual_shaders.html]($DOCS_URL/tutorials/shaders/visual_shaders.html) - * - * Visual shader graphs consist of various nodes. Each node in the graph is a separate object and they are represented as a rectangular boxes with title and a set of properties. Each node also has connection ports that allow to connect it to another nodes and control the flow of the shader. + * Visual shader graphs consist of various nodes. Each node in the graph is a separate object and + * they are represented as a rectangular boxes with title and a set of properties. Each node also has + * connection ports that allow to connect it to another nodes and control the flow of the shader. */ @GodotBaseType public open class VisualShaderNode internal constructor() : Resource() { /** - * Sets the output port index which will be showed for preview. If set to `-1` no port will be open for preview. + * Sets the output port index which will be showed for preview. If set to `-1` no port will be + * open for preview. */ public var outputPortForPreview: Int get() { @@ -64,7 +62,8 @@ public open class VisualShaderNode internal constructor() : Resource() { } /** - * Returns the input port which should be connected by default when this node is created as a result of dragging a connection from an existing node to the empty space on the graph. + * Returns the input port which should be connected by default when this node is created as a + * result of dragging a connection from an existing node to the empty space on the graph. */ public fun getDefaultInputPort(type: PortType): Int { TransferContext.writeArguments(LONG to type.id) @@ -73,7 +72,7 @@ public open class VisualShaderNode internal constructor() : Resource() { } /** - * Sets the default [value] for the selected input [port]. + * Sets the default [param value] for the selected input [param port]. */ @JvmOverloads public fun setInputPortDefaultValue( @@ -86,7 +85,7 @@ public open class VisualShaderNode internal constructor() : Resource() { } /** - * Returns the default value of the input [port]. + * Returns the default value of the input [param port]. */ public fun getInputPortDefaultValue(port: Int): Any? { TransferContext.writeArguments(LONG to port.toLong()) @@ -95,7 +94,7 @@ public open class VisualShaderNode internal constructor() : Resource() { } /** - * Removes the default value of the input [port]. + * Removes the default value of the input [param port]. */ public fun removeInputPortDefaultValue(port: Int): Unit { TransferContext.writeArguments(LONG to port.toLong()) @@ -114,39 +113,43 @@ public open class VisualShaderNode internal constructor() : Resource() { id: Long, ) { /** - * Floating-point scalar. Translated to [code skip-lint]float` type in shader code. + * Floating-point scalar. Translated to [code skip-lint]float[/code] type in shader code. */ PORT_TYPE_SCALAR(0), /** - * Integer scalar. Translated to [code skip-lint]int` type in shader code. + * Integer scalar. Translated to [code skip-lint]int[/code] type in shader code. */ PORT_TYPE_SCALAR_INT(1), /** - * Unsigned integer scalar. Translated to [code skip-lint]uint` type in shader code. + * Unsigned integer scalar. Translated to [code skip-lint]uint[/code] type in shader code. */ PORT_TYPE_SCALAR_UINT(2), /** - * 2D vector of floating-point values. Translated to [code skip-lint]vec2` type in shader code. + * 2D vector of floating-point values. Translated to [code skip-lint]vec2[/code] type in shader + * code. */ PORT_TYPE_VECTOR_2D(3), /** - * 3D vector of floating-point values. Translated to [code skip-lint]vec3` type in shader code. + * 3D vector of floating-point values. Translated to [code skip-lint]vec3[/code] type in shader + * code. */ PORT_TYPE_VECTOR_3D(4), /** - * 4D vector of floating-point values. Translated to [code skip-lint]vec4` type in shader code. + * 4D vector of floating-point values. Translated to [code skip-lint]vec4[/code] type in shader + * code. */ PORT_TYPE_VECTOR_4D(5), /** - * Boolean type. Translated to [code skip-lint]bool` type in shader code. + * Boolean type. Translated to [code skip-lint]bool[/code] type in shader code. */ PORT_TYPE_BOOLEAN(6), /** - * Transform type. Translated to [code skip-lint]mat4` type in shader code. + * Transform type. Translated to [code skip-lint]mat4[/code] type in shader code. */ PORT_TYPE_TRANSFORM(7), /** - * Sampler type. Translated to reference of sampler uniform in shader code. Can only be used for input ports in non-uniform nodes. + * Sampler type. Translated to reference of sampler uniform in shader code. Can only be used for + * input ports in non-uniform nodes. */ PORT_TYPE_SAMPLER(8), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeBillboard.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeBillboard.kt index 4ab0af5de..2efa7e359 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeBillboard.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeBillboard.kt @@ -19,9 +19,8 @@ import kotlin.Long import kotlin.Suppress /** - * A node that controls how the object faces the camera to be used within the visual shader graph. - * - * The output port of this node needs to be connected to `Model View Matrix` port of [godot.VisualShaderNodeOutput]. + * The output port of this node needs to be connected to `Model View Matrix` port of + * [VisualShaderNodeOutput]. */ @GodotBaseType public open class VisualShaderNodeBillboard : VisualShaderNode() { @@ -40,7 +39,8 @@ public open class VisualShaderNodeBillboard : VisualShaderNode() { } /** - * If `true`, the shader will keep the scale set for the mesh. Otherwise, the scale is lost when billboarding. + * If `true`, the shader will keep the scale set for the mesh. Otherwise, the scale is lost when + * billboarding. */ public var keepScale: Boolean get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeBooleanConstant.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeBooleanConstant.kt index 8b1e815b5..1e4995e08 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeBooleanConstant.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeBooleanConstant.kt @@ -17,11 +17,8 @@ import kotlin.Int import kotlin.Suppress /** - * A boolean constant to be used within the visual shader graph. - * * Has only one output port and no inputs. - * - * Translated to [code skip-lint]bool` in the shader language. + * Translated to [code skip-lint]bool[/code] in the shader language. */ @GodotBaseType public open class VisualShaderNodeBooleanConstant : VisualShaderNodeConstant() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeBooleanParameter.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeBooleanParameter.kt index 4b02431a7..fd71f22f9 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeBooleanParameter.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeBooleanParameter.kt @@ -17,8 +17,6 @@ import kotlin.Int import kotlin.Suppress /** - * A boolean parameter to be used within the visual shader graph. - * * Translated to `uniform bool` in the shader language. */ @GodotBaseType diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeClamp.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeClamp.kt index ca38f8790..f9ab164b9 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeClamp.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeClamp.kt @@ -18,8 +18,6 @@ import kotlin.Long import kotlin.Suppress /** - * Clamps a value within the visual shader graph. - * * Constrains a value to lie between `min` and `max` values. */ @GodotBaseType diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeColorConstant.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeColorConstant.kt index 16b07af12..958a655c6 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeColorConstant.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeColorConstant.kt @@ -21,16 +21,13 @@ import kotlin.Suppress import kotlin.Unit /** - * A [godot.core.Color] constant to be used within the visual shader graph. - * - * Has two output ports representing RGB and alpha channels of [godot.core.Color]. - * + * Has two output ports representing RGB and alpha channels of [Color]. * Translated to `vec3 rgb` and `float alpha` in the shader language. */ @GodotBaseType public open class VisualShaderNodeColorConstant : VisualShaderNodeConstant() { /** - * A [godot.core.Color] constant which represents a state of this node. + * A [Color] constant which represents a state of this node. */ @CoreTypeLocalCopy public var constant: Color @@ -50,7 +47,7 @@ public open class VisualShaderNodeColorConstant : VisualShaderNodeConstant() { } /** - * A [godot.core.Color] constant which represents a state of this node. + * A [Color] constant which represents a state of this node. * * This is a helper function to make dealing with local copies easier. * diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeColorFunc.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeColorFunc.kt index f6e87f9fb..2534b379c 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeColorFunc.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeColorFunc.kt @@ -18,9 +18,7 @@ import kotlin.Long import kotlin.Suppress /** - * A [godot.core.Color] function to be used within the visual shader graph. - * - * Accept a [godot.core.Color] to the input port and transform it according to [function]. + * Accept a [Color] to the input port and transform it according to [function]. */ @GodotBaseType public open class VisualShaderNodeColorFunc : VisualShaderNode() { @@ -48,14 +46,13 @@ public open class VisualShaderNodeColorFunc : VisualShaderNode() { ) { /** * Converts the color to grayscale using the following formula: - * - * ``` - * vec3 c = input; - * float max1 = max(c.r, c.g); - * float max2 = max(max1, c.b); - * float max3 = max(max1, max2); - * return vec3(max3, max3, max3); - * ``` + * [codeblock] + * vec3 c = input; + * float max1 = max(c.r, c.g); + * float max2 = max(max1, c.b); + * float max3 = max(max1, max2); + * return vec3(max3, max3, max3); + * [/codeblock] */ FUNC_GRAYSCALE(0), /** @@ -68,14 +65,13 @@ public open class VisualShaderNodeColorFunc : VisualShaderNode() { FUNC_RGB2HSV(2), /** * Applies sepia tone effect using the following formula: - * - * ``` - * vec3 c = input; - * float r = (c.r * 0.393) + (c.g * 0.769) + (c.b * 0.189); - * float g = (c.r * 0.349) + (c.g * 0.686) + (c.b * 0.168); - * float b = (c.r * 0.272) + (c.g * 0.534) + (c.b * 0.131); - * return vec3(r, g, b); - * ``` + * [codeblock] + * vec3 c = input; + * float r = (c.r * 0.393) + (c.g * 0.769) + (c.b * 0.189); + * float g = (c.r * 0.349) + (c.g * 0.686) + (c.b * 0.168); + * float b = (c.r * 0.272) + (c.g * 0.534) + (c.b * 0.131); + * return vec3(r, g, b); + * [/codeblock] */ FUNC_SEPIA(3), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeColorOp.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeColorOp.kt index 69edd32b2..2bf9d4502 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeColorOp.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeColorOp.kt @@ -18,8 +18,6 @@ import kotlin.Long import kotlin.Suppress /** - * A [godot.core.Color] operator to be used within the visual shader graph. - * * Applies [operator] to two color inputs. */ @GodotBaseType @@ -48,98 +46,89 @@ public open class VisualShaderNodeColorOp : VisualShaderNode() { ) { /** * Produce a screen effect with the following formula: - * - * ``` - * result = vec3(1.0) - (vec3(1.0) - a) * (vec3(1.0) - b); - * ``` + * [codeblock] + * result = vec3(1.0) - (vec3(1.0) - a) * (vec3(1.0) - b); + * [/codeblock] */ OP_SCREEN(0), /** * Produce a difference effect with the following formula: - * - * ``` - * result = abs(a - b); - * ``` + * [codeblock] + * result = abs(a - b); + * [/codeblock] */ OP_DIFFERENCE(1), /** * Produce a darken effect with the following formula: - * - * ``` - * result = min(a, b); - * ``` + * [codeblock] + * result = min(a, b); + * [/codeblock] */ OP_DARKEN(2), /** * Produce a lighten effect with the following formula: - * - * ``` - * result = max(a, b); - * ``` + * [codeblock] + * result = max(a, b); + * [/codeblock] */ OP_LIGHTEN(3), /** * Produce an overlay effect with the following formula: - * - * ``` - * for (int i = 0; i < 3; i++) { - * float base = a*; - * float blend = b*; - * if (base < 0.5) { - * result* = 2.0 * base * blend; - * } else { - * result* = 1.0 - 2.0 * (1.0 - blend) * (1.0 - base); - * } - * } - * ``` + * [codeblock] + * for (int i = 0; i < 3; i++) { + * float base = a[i]; + * float blend = b[i]; + * if (base < 0.5) { + * result[i] = 2.0 * base * blend; + * } else { + * result[i] = 1.0 - 2.0 * (1.0 - blend) * (1.0 - base); + * } + * } + * [/codeblock] */ OP_OVERLAY(4), /** * Produce a dodge effect with the following formula: - * - * ``` - * result = a / (vec3(1.0) - b); - * ``` + * [codeblock] + * result = a / (vec3(1.0) - b); + * [/codeblock] */ OP_DODGE(5), /** * Produce a burn effect with the following formula: - * - * ``` - * result = vec3(1.0) - (vec3(1.0) - a) / b; - * ``` + * [codeblock] + * result = vec3(1.0) - (vec3(1.0) - a) / b; + * [/codeblock] */ OP_BURN(6), /** * Produce a soft light effect with the following formula: - * - * ``` - * for (int i = 0; i < 3; i++) { - * float base = a*; - * float blend = b*; - * if (base < 0.5) { - * result* = base * (blend + 0.5); - * } else { - * result* = 1.0 - (1.0 - base) * (1.0 - (blend - 0.5)); - * } - * } - * ``` + * [codeblock] + * for (int i = 0; i < 3; i++) { + * float base = a[i]; + * float blend = b[i]; + * if (base < 0.5) { + * result[i] = base * (blend + 0.5); + * } else { + * result[i] = 1.0 - (1.0 - base) * (1.0 - (blend - 0.5)); + * } + * } + * [/codeblock] */ OP_SOFT_LIGHT(7), /** * Produce a hard light effect with the following formula: - * - * ``` - * for (int i = 0; i < 3; i++) { - * float base = a*; - * float blend = b*; - * if (base < 0.5) { - * result* = base * (2.0 * blend); - * } else { - * result* = 1.0 - (1.0 - base) * (1.0 - 2.0 * (blend - 0.5)); - * } - * } - * ``` + * [codeblock] + * for (int i = 0; i < 3; i++) { + * float base = a[i]; + * float blend = b[i]; + * if (base < 0.5) { + * result[i] = base * (2.0 * blend); + * } else { + * result[i] = 1.0 - (1.0 - base) * (1.0 - 2.0 * (blend - 0.5)); + * } + * } + * [/codeblock] */ OP_HARD_LIGHT(8), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeColorParameter.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeColorParameter.kt index 9a3931608..304c4f79c 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeColorParameter.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeColorParameter.kt @@ -22,8 +22,6 @@ import kotlin.Suppress import kotlin.Unit /** - * A [godot.core.Color] parameter to be used within the visual shader graph. - * * Translated to `uniform vec4` in the shader language. */ @GodotBaseType diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeComment.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeComment.kt index be9a48bc9..c5f1a2112 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeComment.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeComment.kt @@ -18,9 +18,8 @@ import kotlin.String import kotlin.Suppress /** - * A comment node to be placed on visual shader graph. - * - * A resizable rectangular area with changeable [title] and [description] used for better organizing of other visual shader nodes. + * A resizable rectangular area with changeable [title] and [description] used for better organizing + * of other visual shader nodes. */ @GodotBaseType public open class VisualShaderNodeComment : VisualShaderNodeResizableBase() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeCompare.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeCompare.kt index a016a8d25..2b63a1ff8 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeCompare.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeCompare.kt @@ -18,9 +18,8 @@ import kotlin.Long import kotlin.Suppress /** - * A comparison function for common types within the visual shader graph. - * - * Compares `a` and `b` of [type] by [function]. Returns a boolean scalar. Translates to `if` instruction in shader code. + * Compares `a` and `b` of [type] by [function]. Returns a boolean scalar. Translates to `if` + * instruction in shader code. */ @GodotBaseType public open class VisualShaderNodeCompare : VisualShaderNode() { @@ -53,7 +52,7 @@ public open class VisualShaderNodeCompare : VisualShaderNode() { } /** - * Extra condition which is applied if [type] is set to [godot.CTYPE_VECTOR_3D]. + * Extra condition which is applied if [type] is set to [constant CTYPE_VECTOR_3D]. */ public var condition: Condition get() { @@ -134,19 +133,23 @@ public open class VisualShaderNodeCompare : VisualShaderNode() { */ FUNC_NOT_EQUAL(1), /** - * Comparison for greater than (`a > b`). Cannot be used if [type] set to [CTYPE_BOOLEAN] or [CTYPE_TRANSFORM]. + * Comparison for greater than (`a > b`). Cannot be used if [type] set to [constant + * CTYPE_BOOLEAN] or [constant CTYPE_TRANSFORM]. */ FUNC_GREATER_THAN(2), /** - * Comparison for greater than or equal (`a >= b`). Cannot be used if [type] set to [CTYPE_BOOLEAN] or [CTYPE_TRANSFORM]. + * Comparison for greater than or equal (`a >= b`). Cannot be used if [type] set to [constant + * CTYPE_BOOLEAN] or [constant CTYPE_TRANSFORM]. */ FUNC_GREATER_THAN_EQUAL(3), /** - * Comparison for less than (`a < b`). Cannot be used if [type] set to [CTYPE_BOOLEAN] or [CTYPE_TRANSFORM]. + * Comparison for less than (`a < b`). Cannot be used if [type] set to [constant CTYPE_BOOLEAN] + * or [constant CTYPE_TRANSFORM]. */ FUNC_LESS_THAN(4), /** - * Comparison for less than or equal (`a <= b`). Cannot be used if [type] set to [CTYPE_BOOLEAN] or [CTYPE_TRANSFORM]. + * Comparison for less than or equal (`a <= b`). Cannot be used if [type] set to [constant + * CTYPE_BOOLEAN] or [constant CTYPE_TRANSFORM]. */ FUNC_LESS_THAN_EQUAL(5), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeConstant.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeConstant.kt index a40f18743..3256714e6 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeConstant.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeConstant.kt @@ -12,8 +12,6 @@ import kotlin.Int import kotlin.Suppress /** - * A base type for the constants within the visual shader graph. - * * This is an abstract class. See the derived types for descriptions of the possible values. */ @GodotBaseType diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeCubemap.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeCubemap.kt index f1c7be979..d89239df6 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeCubemap.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeCubemap.kt @@ -19,9 +19,8 @@ import kotlin.Long import kotlin.Suppress /** - * A [godot.Cubemap] sampling node to be used within the visual shader graph. - * - * Translated to `texture(cubemap, vec3)` in the shader language. Returns a color vector and alpha channel as scalar. + * Translated to `texture(cubemap, vec3)` in the shader language. Returns a color vector and alpha + * channel as scalar. */ @GodotBaseType public open class VisualShaderNodeCubemap : VisualShaderNode() { @@ -40,7 +39,7 @@ public open class VisualShaderNodeCubemap : VisualShaderNode() { } /** - * The [godot.Cubemap] texture to sample when using [SOURCE_TEXTURE] as [source]. + * The [Cubemap] texture to sample when using [constant SOURCE_TEXTURE] as [source]. */ public var cubeMap: Cubemap? get() { @@ -76,11 +75,13 @@ public open class VisualShaderNodeCubemap : VisualShaderNode() { id: Long, ) { /** - * Use the [godot.Cubemap] set via [cubeMap]. If this is set to [source], the `samplerCube` port is ignored. + * Use the [Cubemap] set via [cubeMap]. If this is set to [source], the `samplerCube` port is + * ignored. */ SOURCE_TEXTURE(0), /** - * Use the [godot.Cubemap] sampler reference passed via the `samplerCube` port. If this is set to [source], the [cubeMap] texture is ignored. + * Use the [Cubemap] sampler reference passed via the `samplerCube` port. If this is set to + * [source], the [cubeMap] texture is ignored. */ SOURCE_PORT(1), /** @@ -111,7 +112,8 @@ public open class VisualShaderNodeCubemap : VisualShaderNode() { */ TYPE_COLOR(1), /** - * Adds `hint_normal` as hint to the uniform declaration, which internally converts the texture for proper usage as normal map. + * Adds `hint_normal` as hint to the uniform declaration, which internally converts the texture + * for proper usage as normal map. */ TYPE_NORMAL_MAP(2), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeCubemapParameter.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeCubemapParameter.kt index 5203724e7..0edfa5640 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeCubemapParameter.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeCubemapParameter.kt @@ -12,9 +12,8 @@ import kotlin.Int import kotlin.Suppress /** - * A [godot.Cubemap] parameter node to be used within the visual shader graph. - * - * Translated to `uniform samplerCube` in the shader language. The output value can be used as port for [godot.VisualShaderNodeCubemap]. + * Translated to `uniform samplerCube` in the shader language. The output value can be used as port + * for [VisualShaderNodeCubemap]. */ @GodotBaseType public open class VisualShaderNodeCubemapParameter : VisualShaderNodeTextureParameter() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeCurveTexture.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeCurveTexture.kt index 2ef0fea24..d2eb14368 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeCurveTexture.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeCurveTexture.kt @@ -17,8 +17,6 @@ import kotlin.Int import kotlin.Suppress /** - * Performs a [godot.CurveTexture] lookup within the visual shader graph. - * * Comes with a built-in editor for texture's curves. */ @GodotBaseType diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeCurveXYZTexture.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeCurveXYZTexture.kt index d726324d1..3a6e82f1c 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeCurveXYZTexture.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeCurveXYZTexture.kt @@ -17,8 +17,6 @@ import kotlin.Int import kotlin.Suppress /** - * Performs a [godot.CurveXYZTexture] lookup within the visual shader graph. - * * Comes with a built-in editor for texture's curves. */ @GodotBaseType diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeCustom.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeCustom.kt index b58ed88cb..555d73e7f 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeCustom.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeCustom.kt @@ -22,20 +22,16 @@ import kotlin.String import kotlin.Suppress /** - * Virtual class to define custom [godot.VisualShaderNode]s for use in the Visual Shader Editor. - * - * Tutorials: - * [$DOCS_URL/tutorials/plugins/editor/visual_shader_plugins.html]($DOCS_URL/tutorials/plugins/editor/visual_shader_plugins.html) - * - * By inheriting this class you can create a custom [godot.VisualShader] script addon which will be automatically added to the Visual Shader Editor. The [godot.VisualShaderNode]'s behavior is defined by overriding the provided virtual methods. - * - * In order for the node to be registered as an editor addon, you must use the `@tool` annotation and provide a `class_name` for your custom script. For example: - * - * ``` - * @tool - * extends VisualShaderNodeCustom - * class_name VisualShaderNodeNoise - * ``` + * By inheriting this class you can create a custom [VisualShader] script addon which will be + * automatically added to the Visual Shader Editor. The [VisualShaderNode]'s behavior is defined by + * overriding the provided virtual methods. + * In order for the node to be registered as an editor addon, you must use the `@tool` annotation + * and provide a `class_name` for your custom script. For example: + * [codeblock] + * @tool + * extends VisualShaderNodeCustom + * class_name VisualShaderNodeNoise + * [/codeblock] */ @GodotBaseType public open class VisualShaderNodeCustom : VisualShaderNode() { @@ -45,17 +41,18 @@ public open class VisualShaderNodeCustom : VisualShaderNode() { } /** - * Override this method to define the name of the associated custom node in the Visual Shader Editor's members dialog and graph. - * - * Defining this method is **optional**, but recommended. If not overridden, the node will be named as "Unnamed". + * Override this method to define the name of the associated custom node in the Visual Shader + * Editor's members dialog and graph. + * Defining this method is **optional**, but recommended. If not overridden, the node will be + * named as "Unnamed". */ public open fun _getName(): String { throw NotImplementedError("_get_name is not implemented for VisualShaderNodeCustom") } /** - * Override this method to define the description of the associated custom node in the Visual Shader Editor's members dialog. - * + * Override this method to define the description of the associated custom node in the Visual + * Shader Editor's members dialog. * Defining this method is **optional**. */ public open fun _getDescription(): String { @@ -63,17 +60,18 @@ public open class VisualShaderNodeCustom : VisualShaderNode() { } /** - * Override this method to define the path to the associated custom node in the Visual Shader Editor's members dialog. The path may look like `"MyGame/MyFunctions/Noise"`. - * - * Defining this method is **optional**. If not overridden, the node will be filed under the "Addons" category. + * Override this method to define the path to the associated custom node in the Visual Shader + * Editor's members dialog. The path may look like `"MyGame/MyFunctions/Noise"`. + * Defining this method is **optional**. If not overridden, the node will be filed under the + * "Addons" category. */ public open fun _getCategory(): String { throw NotImplementedError("_get_category is not implemented for VisualShaderNodeCustom") } /** - * Override this method to define the return icon of the associated custom node in the Visual Shader Editor's members dialog. - * + * Override this method to define the return icon of the associated custom node in the Visual + * Shader Editor's members dialog. * Defining this method is **optional**. If not overridden, no return icon is shown. */ public open fun _getReturnIconType(): VisualShaderNode.PortType { @@ -82,7 +80,6 @@ public open class VisualShaderNodeCustom : VisualShaderNode() { /** * Override this method to define the number of input ports of the associated custom node. - * * Defining this method is **required**. If not overridden, the node has no input ports. */ public open fun _getInputPortCount(): Int { @@ -90,36 +87,42 @@ public open class VisualShaderNodeCustom : VisualShaderNode() { } /** - * Override this method to define the returned type of each input port of the associated custom node (see [enum VisualShaderNode.PortType] for possible types). - * - * Defining this method is **optional**, but recommended. If not overridden, input ports will return the [godot.VisualShaderNode.PORT_TYPE_SCALAR] type. + * Override this method to define the returned type of each input port of the associated custom + * node (see [enum VisualShaderNode.PortType] for possible types). + * Defining this method is **optional**, but recommended. If not overridden, input ports will + * return the [constant VisualShaderNode.PORT_TYPE_SCALAR] type. */ public open fun _getInputPortType(port: Int): VisualShaderNode.PortType { throw NotImplementedError("_get_input_port_type is not implemented for VisualShaderNodeCustom") } /** - * Override this method to define the names of input ports of the associated custom node. The names are used both for the input slots in the editor and as identifiers in the shader code, and are passed in the `input_vars` array in [_getCode]. - * - * Defining this method is **optional**, but recommended. If not overridden, input ports are named as `"in" + str(port)`. + * Override this method to define the names of input ports of the associated custom node. The + * names are used both for the input slots in the editor and as identifiers in the shader code, and + * are passed in the `input_vars` array in [_getCode]. + * Defining this method is **optional**, but recommended. If not overridden, input ports are named + * as `"in" + str(port)`. */ public open fun _getInputPortName(port: Int): String { throw NotImplementedError("_get_input_port_name is not implemented for VisualShaderNodeCustom") } /** - * Override this method to define the default value for the specified input port. Prefer use this over [godot.VisualShaderNode.setInputPortDefaultValue]. - * - * Defining this method is **required**. If not overridden, the node has no default values for their input ports. + * Override this method to define the default value for the specified input port. Prefer use this + * over [VisualShaderNode.setInputPortDefaultValue]. + * Defining this method is **required**. If not overridden, the node has no default values for + * their input ports. */ public open fun _getInputPortDefaultValue(port: Int): Any? { throw NotImplementedError("_get_input_port_default_value is not implemented for VisualShaderNodeCustom") } /** - * Override this method to define the input port which should be connected by default when this node is created as a result of dragging a connection from an existing node to the empty space on the graph. - * - * Defining this method is **optional**. If not overridden, the connection will be created to the first valid port. + * Override this method to define the input port which should be connected by default when this + * node is created as a result of dragging a connection from an existing node to the empty space on + * the graph. + * Defining this method is **optional**. If not overridden, the connection will be created to the + * first valid port. */ public open fun _getDefaultInputPort(type: VisualShaderNode.PortType): Int { throw NotImplementedError("_get_default_input_port is not implemented for VisualShaderNodeCustom") @@ -127,7 +130,6 @@ public open class VisualShaderNodeCustom : VisualShaderNode() { /** * Override this method to define the number of output ports of the associated custom node. - * * Defining this method is **required**. If not overridden, the node has no output ports. */ public open fun _getOutputPortCount(): Int { @@ -135,18 +137,21 @@ public open class VisualShaderNodeCustom : VisualShaderNode() { } /** - * Override this method to define the returned type of each output port of the associated custom node (see [enum VisualShaderNode.PortType] for possible types). - * - * Defining this method is **optional**, but recommended. If not overridden, output ports will return the [godot.VisualShaderNode.PORT_TYPE_SCALAR] type. + * Override this method to define the returned type of each output port of the associated custom + * node (see [enum VisualShaderNode.PortType] for possible types). + * Defining this method is **optional**, but recommended. If not overridden, output ports will + * return the [constant VisualShaderNode.PORT_TYPE_SCALAR] type. */ public open fun _getOutputPortType(port: Int): VisualShaderNode.PortType { throw NotImplementedError("_get_output_port_type is not implemented for VisualShaderNodeCustom") } /** - * Override this method to define the names of output ports of the associated custom node. The names are used both for the output slots in the editor and as identifiers in the shader code, and are passed in the `output_vars` array in [_getCode]. - * - * Defining this method is **optional**, but recommended. If not overridden, output ports are named as `"out" + str(port)`. + * Override this method to define the names of output ports of the associated custom node. The + * names are used both for the output slots in the editor and as identifiers in the shader code, and + * are passed in the `output_vars` array in [_getCode]. + * Defining this method is **optional**, but recommended. If not overridden, output ports are + * named as `"out" + str(port)`. */ public open fun _getOutputPortName(port: Int): String { throw NotImplementedError("_get_output_port_name is not implemented for VisualShaderNodeCustom") @@ -154,7 +159,6 @@ public open class VisualShaderNodeCustom : VisualShaderNode() { /** * Override this method to define the number of the properties. - * * Defining this method is **optional**. */ public open fun _getPropertyCount(): Int { @@ -163,7 +167,6 @@ public open class VisualShaderNodeCustom : VisualShaderNode() { /** * Override this method to define the names of the property of the associated custom node. - * * Defining this method is **optional**. */ public open fun _getPropertyName(index: Int): String { @@ -172,7 +175,6 @@ public open class VisualShaderNodeCustom : VisualShaderNode() { /** * Override this method to define the default index of the property of the associated custom node. - * * Defining this method is **optional**. */ public open fun _getPropertyDefaultIndex(index: Int): Int { @@ -180,8 +182,8 @@ public open class VisualShaderNodeCustom : VisualShaderNode() { } /** - * Override this method to define the options inside the drop-down list property of the associated custom node. - * + * Override this method to define the options inside the drop-down list property of the associated + * custom node. * Defining this method is **optional**. */ public open fun _getPropertyOptions(index: Int): PackedStringArray { @@ -189,14 +191,16 @@ public open class VisualShaderNodeCustom : VisualShaderNode() { } /** - * Override this method to define the actual shader code of the associated custom node. The shader code should be returned as a string, which can have multiple lines (the `"""` multiline string construct can be used for convenience). - * - * The [inputVars] and [outputVars] arrays contain the string names of the various input and output variables, as defined by `_get_input_*` and `_get_output_*` virtual methods in this class. - * - * The output ports can be assigned values in the shader code. For example, `return output_vars[0] + " = " + input_vars[0] + ";"`. - * - * You can customize the generated code based on the shader [mode] (see [enum Shader.Mode]) and/or [type] (see [enum VisualShader.Type]). - * + * Override this method to define the actual shader code of the associated custom node. The shader + * code should be returned as a string, which can have multiple lines (the `"""` multiline string + * construct can be used for convenience). + * The [param input_vars] and [param output_vars] arrays contain the string names of the various + * input and output variables, as defined by `_get_input_*` and `_get_output_*` virtual methods in + * this class. + * The output ports can be assigned values in the shader code. For example, `return + * output_vars[0] + " = " + input_vars[0] + ";"`. + * You can customize the generated code based on the shader [param mode] (see [enum Shader.Mode]) + * and/or [param type] (see [enum VisualShader.Type]). * Defining this method is **required**. */ public open fun _getCode( @@ -209,12 +213,13 @@ public open class VisualShaderNodeCustom : VisualShaderNode() { } /** - * Override this method to add a shader code to the beginning of each shader function (once). The shader code should be returned as a string, which can have multiple lines (the `"""` multiline string construct can be used for convenience). - * - * If there are multiple custom nodes of different types which use this feature the order of each insertion is undefined. - * - * You can customize the generated code based on the shader [mode] (see [enum Shader.Mode]) and/or [type] (see [enum VisualShader.Type]). - * + * Override this method to add a shader code to the beginning of each shader function (once). The + * shader code should be returned as a string, which can have multiple lines (the `"""` multiline + * string construct can be used for convenience). + * If there are multiple custom nodes of different types which use this feature the order of each + * insertion is undefined. + * You can customize the generated code based on the shader [param mode] (see [enum Shader.Mode]) + * and/or [param type] (see [enum VisualShader.Type]). * Defining this method is **optional**. */ public open fun _getFuncCode(mode: Shader.Mode, type: VisualShader.Type): String { @@ -222,12 +227,13 @@ public open class VisualShaderNodeCustom : VisualShaderNode() { } /** - * Override this method to add shader code on top of the global shader, to define your own standard library of reusable methods, varyings, constants, uniforms, etc. The shader code should be returned as a string, which can have multiple lines (the `"""` multiline string construct can be used for convenience). - * - * Be careful with this functionality as it can cause name conflicts with other custom nodes, so be sure to give the defined entities unique names. - * - * You can customize the generated code based on the shader [mode] (see [enum Shader.Mode]). - * + * Override this method to add shader code on top of the global shader, to define your own + * standard library of reusable methods, varyings, constants, uniforms, etc. The shader code should + * be returned as a string, which can have multiple lines (the `"""` multiline string construct can + * be used for convenience). + * Be careful with this functionality as it can cause name conflicts with other custom nodes, so + * be sure to give the defined entities unique names. + * You can customize the generated code based on the shader [param mode] (see [enum Shader.Mode]). * Defining this method is **optional**. */ public open fun _getGlobalCode(mode: Shader.Mode): String { @@ -236,7 +242,6 @@ public open class VisualShaderNodeCustom : VisualShaderNode() { /** * Override this method to enable high-end mark in the Visual Shader Editor's members dialog. - * * Defining this method is **optional**. If not overridden, it's `false`. */ public open fun _isHighend(): Boolean { @@ -244,8 +249,8 @@ public open class VisualShaderNodeCustom : VisualShaderNode() { } /** - * Override this method to prevent the node to be visible in the member dialog for the certain [mode] (see [enum Shader.Mode]) and/or [type] (see [enum VisualShader.Type]). - * + * Override this method to prevent the node to be visible in the member dialog for the certain + * [param mode] (see [enum Shader.Mode]) and/or [param type] (see [enum VisualShader.Type]). * Defining this method is **optional**. If not overridden, it's `true`. */ public open fun _isAvailable(mode: Shader.Mode, type: VisualShader.Type): Boolean { @@ -253,7 +258,8 @@ public open class VisualShaderNodeCustom : VisualShaderNode() { } /** - * Returns the selected index of the drop-down list option within a graph. You may use this function to define the specific behavior in the [_getCode] or [_getGlobalCode]. + * Returns the selected index of the drop-down list option within a graph. You may use this + * function to define the specific behavior in the [_getCode] or [_getGlobalCode]. */ public fun getOptionIndex(option: Int): Int { TransferContext.writeArguments(LONG to option.toLong()) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeDerivativeFunc.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeDerivativeFunc.kt index 9ef3a6fe1..10510e6c0 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeDerivativeFunc.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeDerivativeFunc.kt @@ -18,8 +18,6 @@ import kotlin.Long import kotlin.Suppress /** - * Calculates a derivative within the visual shader graph. - * * This node is only available in `Fragment` and `Light` visual shaders. */ @GodotBaseType @@ -53,7 +51,8 @@ public open class VisualShaderNodeDerivativeFunc : VisualShaderNode() { } /** - * Sets the level of precision to use for the derivative function. See [enum Precision] for options. When using the GL Compatibility renderer, this setting has no effect. + * Sets the level of precision to use for the derivative function. See [enum Precision] for + * options. When using the GL Compatibility renderer, this setting has no effect. */ public var precision: Precision get() { @@ -141,15 +140,22 @@ public open class VisualShaderNodeDerivativeFunc : VisualShaderNode() { id: Long, ) { /** - * No precision is specified, the GPU driver is allowed to use whatever level of precision it chooses. This is the default option and is equivalent to using `dFdx()` or `dFdy()` in text shaders. + * No precision is specified, the GPU driver is allowed to use whatever level of precision it + * chooses. This is the default option and is equivalent to using `dFdx()` or `dFdy()` in text + * shaders. */ PRECISION_NONE(0), /** - * The derivative will be calculated using the current fragment's neighbors (which may not include the current fragment). This tends to be faster than using [PRECISION_FINE], but may not be suitable when more precision is needed. This is equivalent to using `dFdxCoarse()` or `dFdyCoarse()` in text shaders. + * The derivative will be calculated using the current fragment's neighbors (which may not + * include the current fragment). This tends to be faster than using [constant PRECISION_FINE], but + * may not be suitable when more precision is needed. This is equivalent to using `dFdxCoarse()` or + * `dFdyCoarse()` in text shaders. */ PRECISION_COARSE(1), /** - * The derivative will be calculated using the current fragment and its immediate neighbors. This tends to be slower than using [PRECISION_COARSE], but may be necessary when more precision is needed. This is equivalent to using `dFdxFine()` or `dFdyFine()` in text shaders. + * The derivative will be calculated using the current fragment and its immediate neighbors. + * This tends to be slower than using [constant PRECISION_COARSE], but may be necessary when more + * precision is needed. This is equivalent to using `dFdxFine()` or `dFdyFine()` in text shaders. */ PRECISION_FINE(2), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeDeterminant.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeDeterminant.kt index 6f6714cb9..c36200359 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeDeterminant.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeDeterminant.kt @@ -12,8 +12,6 @@ import kotlin.Int import kotlin.Suppress /** - * Calculates the determinant of a [godot.Transform3D] within the visual shader graph. - * * Translates to `determinant(x)` in the shader language. */ @GodotBaseType diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeDistanceFade.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeDistanceFade.kt index e923d6b38..169d237f4 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeDistanceFade.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeDistanceFade.kt @@ -12,8 +12,6 @@ import kotlin.Int import kotlin.Suppress /** - * A visual shader node representing distance fade effect. - * * The distance fade effect fades out each pixel based on its distance to another object. */ @GodotBaseType diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeDotProduct.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeDotProduct.kt index 3f1d9c151..04ddd04c2 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeDotProduct.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeDotProduct.kt @@ -12,8 +12,6 @@ import kotlin.Int import kotlin.Suppress /** - * Calculates a dot product of two vectors within the visual shader graph. - * * Translates to `dot(a, b)` in the shader language. */ @GodotBaseType diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeExpression.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeExpression.kt index 0651ef9c3..b2cde81f5 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeExpression.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeExpression.kt @@ -18,16 +18,17 @@ import kotlin.String import kotlin.Suppress /** - * A custom visual shader graph expression written in Godot Shading Language. - * * Custom Godot Shading Language expression, with a custom number of input and output ports. - * - * The provided code is directly injected into the graph's matching shader function (`vertex`, `fragment`, or `light`), so it cannot be used to declare functions, varyings, uniforms, or global constants. See [godot.VisualShaderNodeGlobalExpression] for such global definitions. + * The provided code is directly injected into the graph's matching shader function (`vertex`, + * `fragment`, or `light`), so it cannot be used to declare functions, varyings, uniforms, or global + * constants. See [VisualShaderNodeGlobalExpression] for such global definitions. */ @GodotBaseType public open class VisualShaderNodeExpression : VisualShaderNodeGroupBase() { /** - * An expression in Godot Shading Language, which will be injected at the start of the graph's matching shader function (`vertex`, `fragment`, or `light`), and thus cannot be used to declare functions, varyings, uniforms, or global constants. + * An expression in Godot Shading Language, which will be injected at the start of the graph's + * matching shader function (`vertex`, `fragment`, or `light`), and thus cannot be used to declare + * functions, varyings, uniforms, or global constants. */ public var expression: String get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeFaceForward.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeFaceForward.kt index d41d8513b..faaf376cc 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeFaceForward.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeFaceForward.kt @@ -12,9 +12,10 @@ import kotlin.Int import kotlin.Suppress /** - * Returns the vector that points in the same direction as a reference vector within the visual shader graph. - * - * Translates to `faceforward(N, I, Nref)` in the shader language. The function has three vector parameters: `N`, the vector to orient, `I`, the incident vector, and `Nref`, the reference vector. If the dot product of `I` and `Nref` is smaller than zero the return value is `N`. Otherwise, `-N` is returned. + * Translates to `faceforward(N, I, Nref)` in the shader language. The function has three vector + * parameters: `N`, the vector to orient, `I`, the incident vector, and `Nref`, the reference vector. + * If the dot product of `I` and `Nref` is smaller than zero the return value is `N`. Otherwise, `-N` + * is returned. */ @GodotBaseType public open class VisualShaderNodeFaceForward : VisualShaderNodeVectorBase() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeFloatConstant.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeFloatConstant.kt index 67aa1f0cc..6bd08a94a 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeFloatConstant.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeFloatConstant.kt @@ -19,9 +19,7 @@ import kotlin.Int import kotlin.Suppress /** - * A scalar floating-point constant to be used within the visual shader graph. - * - * Translated to [code skip-lint]float` in the shader language. + * Translated to [code skip-lint]float[/code] in the shader language. */ @GodotBaseType public open class VisualShaderNodeFloatConstant : VisualShaderNodeConstant() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeFloatFunc.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeFloatFunc.kt index cd3183324..66ebbd02b 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeFloatFunc.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeFloatFunc.kt @@ -18,8 +18,6 @@ import kotlin.Long import kotlin.Suppress /** - * A scalar floating-point function to be used within the visual shader graph. - * * Accept a floating-point scalar (`x`) to the input port and transform it according to [function]. */ @GodotBaseType @@ -63,39 +61,48 @@ public open class VisualShaderNodeFloatFunc : VisualShaderNode() { */ FUNC_ASIN(3), /** - * Returns the arc-cosine of the parameter. Translates to `acos(x)` in the Godot Shader Language. + * Returns the arc-cosine of the parameter. Translates to `acos(x)` in the Godot Shader + * Language. */ FUNC_ACOS(4), /** - * Returns the arc-tangent of the parameter. Translates to `atan(x)` in the Godot Shader Language. + * Returns the arc-tangent of the parameter. Translates to `atan(x)` in the Godot Shader + * Language. */ FUNC_ATAN(5), /** - * Returns the hyperbolic sine of the parameter. Translates to `sinh(x)` in the Godot Shader Language. + * Returns the hyperbolic sine of the parameter. Translates to `sinh(x)` in the Godot Shader + * Language. */ FUNC_SINH(6), /** - * Returns the hyperbolic cosine of the parameter. Translates to `cosh(x)` in the Godot Shader Language. + * Returns the hyperbolic cosine of the parameter. Translates to `cosh(x)` in the Godot Shader + * Language. */ FUNC_COSH(7), /** - * Returns the hyperbolic tangent of the parameter. Translates to `tanh(x)` in the Godot Shader Language. + * Returns the hyperbolic tangent of the parameter. Translates to `tanh(x)` in the Godot Shader + * Language. */ FUNC_TANH(8), /** - * Returns the natural logarithm of the parameter. Translates to `log(x)` in the Godot Shader Language. + * Returns the natural logarithm of the parameter. Translates to `log(x)` in the Godot Shader + * Language. */ FUNC_LOG(9), /** - * Returns the natural exponentiation of the parameter. Translates to `exp(x)` in the Godot Shader Language. + * Returns the natural exponentiation of the parameter. Translates to `exp(x)` in the Godot + * Shader Language. */ FUNC_EXP(10), /** - * Returns the square root of the parameter. Translates to `sqrt(x)` in the Godot Shader Language. + * Returns the square root of the parameter. Translates to `sqrt(x)` in the Godot Shader + * Language. */ FUNC_SQRT(11), /** - * Returns the absolute value of the parameter. Translates to `abs(x)` in the Godot Shader Language. + * Returns the absolute value of the parameter. Translates to `abs(x)` in the Godot Shader + * Language. */ FUNC_ABS(12), /** @@ -103,19 +110,23 @@ public open class VisualShaderNodeFloatFunc : VisualShaderNode() { */ FUNC_SIGN(13), /** - * Finds the nearest integer less than or equal to the parameter. Translates to `floor(x)` in the Godot Shader Language. + * Finds the nearest integer less than or equal to the parameter. Translates to `floor(x)` in + * the Godot Shader Language. */ FUNC_FLOOR(14), /** - * Finds the nearest integer to the parameter. Translates to `round(x)` in the Godot Shader Language. + * Finds the nearest integer to the parameter. Translates to `round(x)` in the Godot Shader + * Language. */ FUNC_ROUND(15), /** - * Finds the nearest integer that is greater than or equal to the parameter. Translates to `ceil(x)` in the Godot Shader Language. + * Finds the nearest integer that is greater than or equal to the parameter. Translates to + * `ceil(x)` in the Godot Shader Language. */ FUNC_CEIL(16), /** - * Computes the fractional part of the argument. Translates to `fract(x)` in the Godot Shader Language. + * Computes the fractional part of the argument. Translates to `fract(x)` in the Godot Shader + * Language. */ FUNC_FRACT(17), /** @@ -127,35 +138,43 @@ public open class VisualShaderNodeFloatFunc : VisualShaderNode() { */ FUNC_NEGATE(19), /** - * Returns the arc-hyperbolic-cosine of the parameter. Translates to `acosh(x)` in the Godot Shader Language. + * Returns the arc-hyperbolic-cosine of the parameter. Translates to `acosh(x)` in the Godot + * Shader Language. */ FUNC_ACOSH(20), /** - * Returns the arc-hyperbolic-sine of the parameter. Translates to `asinh(x)` in the Godot Shader Language. + * Returns the arc-hyperbolic-sine of the parameter. Translates to `asinh(x)` in the Godot + * Shader Language. */ FUNC_ASINH(21), /** - * Returns the arc-hyperbolic-tangent of the parameter. Translates to `atanh(x)` in the Godot Shader Language. + * Returns the arc-hyperbolic-tangent of the parameter. Translates to `atanh(x)` in the Godot + * Shader Language. */ FUNC_ATANH(22), /** - * Convert a quantity in radians to degrees. Translates to `degrees(x)` in the Godot Shader Language. + * Convert a quantity in radians to degrees. Translates to `degrees(x)` in the Godot Shader + * Language. */ FUNC_DEGREES(23), /** - * Returns 2 raised by the power of the parameter. Translates to `exp2(x)` in the Godot Shader Language. + * Returns 2 raised by the power of the parameter. Translates to `exp2(x)` in the Godot Shader + * Language. */ FUNC_EXP2(24), /** - * Returns the inverse of the square root of the parameter. Translates to `inversesqrt(x)` in the Godot Shader Language. + * Returns the inverse of the square root of the parameter. Translates to `inversesqrt(x)` in + * the Godot Shader Language. */ FUNC_INVERSE_SQRT(25), /** - * Returns the base 2 logarithm of the parameter. Translates to `log2(x)` in the Godot Shader Language. + * Returns the base 2 logarithm of the parameter. Translates to `log2(x)` in the Godot Shader + * Language. */ FUNC_LOG2(26), /** - * Convert a quantity in degrees to radians. Translates to `radians(x)` in the Godot Shader Language. + * Convert a quantity in degrees to radians. Translates to `radians(x)` in the Godot Shader + * Language. */ FUNC_RADIANS(27), /** @@ -163,11 +182,13 @@ public open class VisualShaderNodeFloatFunc : VisualShaderNode() { */ FUNC_RECIPROCAL(28), /** - * Finds the nearest even integer to the parameter. Translates to `roundEven(x)` in the Godot Shader Language. + * Finds the nearest even integer to the parameter. Translates to `roundEven(x)` in the Godot + * Shader Language. */ FUNC_ROUNDEVEN(29), /** - * Returns a value equal to the nearest integer to `x` whose absolute value is not larger than the absolute value of `x`. Translates to `trunc(x)` in the Godot Shader Language. + * Returns a value equal to the nearest integer to `x` whose absolute value is not larger than + * the absolute value of `x`. Translates to `trunc(x)` in the Godot Shader Language. */ FUNC_TRUNC(30), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeFloatOp.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeFloatOp.kt index ce534adb0..a1b94e950 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeFloatOp.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeFloatOp.kt @@ -18,8 +18,6 @@ import kotlin.Long import kotlin.Suppress /** - * A floating-point scalar operator to be used within the visual shader graph. - * * Applies [operator] to two floating-point inputs: `a` and `b`. */ @GodotBaseType @@ -63,7 +61,8 @@ public open class VisualShaderNodeFloatOp : VisualShaderNode() { */ OP_DIV(3), /** - * Calculates the remainder of two numbers. Translates to `mod(a, b)` in the Godot Shader Language. + * Calculates the remainder of two numbers. Translates to `mod(a, b)` in the Godot Shader + * Language. */ OP_MOD(4), /** @@ -79,11 +78,13 @@ public open class VisualShaderNodeFloatOp : VisualShaderNode() { */ OP_MIN(7), /** - * Returns the arc-tangent of the parameters. Translates to `atan(a, b)` in the Godot Shader Language. + * Returns the arc-tangent of the parameters. Translates to `atan(a, b)` in the Godot Shader + * Language. */ OP_ATAN2(8), /** - * Generates a step function by comparing `b`(x) to `a`(edge). Returns 0.0 if `x` is smaller than `edge` and otherwise 1.0. Translates to `step(a, b)` in the Godot Shader Language. + * Generates a step function by comparing `b`(x) to `a`(edge). Returns 0.0 if `x` is smaller + * than `edge` and otherwise 1.0. Translates to `step(a, b)` in the Godot Shader Language. */ OP_STEP(9), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeFloatParameter.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeFloatParameter.kt index e96d99f2f..04c5b6377 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeFloatParameter.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeFloatParameter.kt @@ -22,14 +22,13 @@ import kotlin.Long import kotlin.Suppress /** - * A scalar float parameter to be used within the visual shader graph. - * * Translated to `uniform float` in the shader language. */ @GodotBaseType public open class VisualShaderNodeFloatParameter : VisualShaderNodeParameter() { /** - * A hint applied to the uniform, which controls the values it can take when set through the Inspector. + * A hint applied to the uniform, which controls the values it can take when set through the + * Inspector. */ public var hint: Hint get() { @@ -43,7 +42,8 @@ public open class VisualShaderNodeFloatParameter : VisualShaderNodeParameter() { } /** - * Maximum value for range hints. Used if [hint] is set to [HINT_RANGE] or [HINT_RANGE_STEP]. + * Maximum value for range hints. Used if [hint] is set to [constant HINT_RANGE] or [constant + * HINT_RANGE_STEP]. */ public var min: Float get() { @@ -57,7 +57,8 @@ public open class VisualShaderNodeFloatParameter : VisualShaderNodeParameter() { } /** - * Minimum value for range hints. Used if [hint] is set to [HINT_RANGE] or [HINT_RANGE_STEP]. + * Minimum value for range hints. Used if [hint] is set to [constant HINT_RANGE] or [constant + * HINT_RANGE_STEP]. */ public var max: Float get() { @@ -71,7 +72,8 @@ public open class VisualShaderNodeFloatParameter : VisualShaderNodeParameter() { } /** - * Step (increment) value for the range hint with step. Used if [hint] is set to [HINT_RANGE_STEP]. + * Step (increment) value for the range hint with step. Used if [hint] is set to [constant + * HINT_RANGE_STEP]. */ public var step: Float get() { @@ -125,11 +127,14 @@ public open class VisualShaderNodeFloatParameter : VisualShaderNodeParameter() { */ HINT_NONE(0), /** - * A range hint for scalar value, which limits possible input values between [min] and [max]. Translated to `hint_range(min, max)` in shader code. + * A range hint for scalar value, which limits possible input values between [min] and [max]. + * Translated to `hint_range(min, max)` in shader code. */ HINT_RANGE(1), /** - * A range hint for scalar value with step, which limits possible input values between [min] and [max], with a step (increment) of [step]). Translated to `hint_range(min, max, step)` in shader code. + * A range hint for scalar value with step, which limits possible input values between [min] and + * [max], with a step (increment) of [step]). Translated to `hint_range(min, max, step)` in shader + * code. */ HINT_RANGE_STEP(2), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeFresnel.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeFresnel.kt index a9fdd55a2..f5ea2a812 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeFresnel.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeFresnel.kt @@ -12,9 +12,8 @@ import kotlin.Int import kotlin.Suppress /** - * A Fresnel effect to be used within the visual shader graph. - * - * Returns falloff based on the dot product of surface normal and view direction of camera (pass associated inputs to it). + * Returns falloff based on the dot product of surface normal and view direction of camera (pass + * associated inputs to it). */ @GodotBaseType public open class VisualShaderNodeFresnel : VisualShaderNode() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeGlobalExpression.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeGlobalExpression.kt index cecabbade..bfdaee2ab 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeGlobalExpression.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeGlobalExpression.kt @@ -12,9 +12,10 @@ import kotlin.Int import kotlin.Suppress /** - * A custom global visual shader graph expression written in Godot Shading Language. - * - * Custom Godot Shader Language expression, which is placed on top of the generated shader. You can place various function definitions inside to call later in [godot.VisualShaderNodeExpression]s (which are injected in the main shader functions). You can also declare varyings, uniforms and global constants. + * Custom Godot Shader Language expression, which is placed on top of the generated shader. You can + * place various function definitions inside to call later in [VisualShaderNodeExpression]s (which are + * injected in the main shader functions). You can also declare varyings, uniforms and global + * constants. */ @GodotBaseType public open class VisualShaderNodeGlobalExpression : VisualShaderNodeExpression() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeGroupBase.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeGroupBase.kt index 20155ecc4..944b2aa35 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeGroupBase.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeGroupBase.kt @@ -22,8 +22,6 @@ import kotlin.Suppress import kotlin.Unit /** - * Base class for a family of nodes with variable number of input and output ports within the visual shader graph. - * * Currently, has no direct usage, use the derived classes instead. */ @GodotBaseType @@ -35,7 +33,8 @@ public open class VisualShaderNodeGroupBase internal constructor() : VisualShade } /** - * Defines all input ports using a [godot.String] formatted as a colon-separated list: `id,type,name;` (see [addInputPort]). + * Defines all input ports using a [String] formatted as a colon-separated list: `id,type,name;` + * (see [addInputPort]). */ public fun setInputs(inputs: String): Unit { TransferContext.writeArguments(STRING to inputs) @@ -43,7 +42,8 @@ public open class VisualShaderNodeGroupBase internal constructor() : VisualShade } /** - * Returns a [godot.String] description of the input ports as a colon-separated list using the format `id,type,name;` (see [addInputPort]). + * Returns a [String] description of the input ports as a colon-separated list using the format + * `id,type,name;` (see [addInputPort]). */ public fun getInputs(): String { TransferContext.writeArguments() @@ -52,7 +52,8 @@ public open class VisualShaderNodeGroupBase internal constructor() : VisualShade } /** - * Defines all output ports using a [godot.String] formatted as a colon-separated list: `id,type,name;` (see [addOutputPort]). + * Defines all output ports using a [String] formatted as a colon-separated list: `id,type,name;` + * (see [addOutputPort]). */ public fun setOutputs(outputs: String): Unit { TransferContext.writeArguments(STRING to outputs) @@ -60,7 +61,8 @@ public open class VisualShaderNodeGroupBase internal constructor() : VisualShade } /** - * Returns a [godot.String] description of the output ports as a colon-separated list using the format `id,type,name;` (see [addOutputPort]). + * Returns a [String] description of the output ports as a colon-separated list using the format + * `id,type,name;` (see [addOutputPort]). */ public fun getOutputs(): String { TransferContext.writeArguments() @@ -69,7 +71,8 @@ public open class VisualShaderNodeGroupBase internal constructor() : VisualShade } /** - * Returns `true` if the specified port name does not override an existed port name and is valid within the shader. + * Returns `true` if the specified port name does not override an existed port name and is valid + * within the shader. */ public fun isValidPortName(name: String): Boolean { TransferContext.writeArguments(STRING to name) @@ -78,7 +81,8 @@ public open class VisualShaderNodeGroupBase internal constructor() : VisualShade } /** - * Adds an input port with the specified [type] (see [enum VisualShaderNode.PortType]) and [name]. + * Adds an input port with the specified [param type] (see [enum VisualShaderNode.PortType]) and + * [param name]. */ public fun addInputPort( id: Int, @@ -124,7 +128,8 @@ public open class VisualShaderNodeGroupBase internal constructor() : VisualShade } /** - * Adds an output port with the specified [type] (see [enum VisualShaderNode.PortType]) and [name]. + * Adds an output port with the specified [param type] (see [enum VisualShaderNode.PortType]) and + * [param name]. */ public fun addOutputPort( id: Int, diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeIf.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeIf.kt index 199e4bda8..7969eca85 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeIf.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeIf.kt @@ -12,9 +12,10 @@ import kotlin.Int import kotlin.Suppress /** - * Outputs a 3D vector based on the result of a floating point comparison within the visual shader graph. - * - * This visual shader node has six input ports. Port 1 and 2 provide the two floating point numbers `a` and `b` that will be compared. Port 3 is the tolerance, which allows similar floating point number to be considered equal. Ports 4 to 6 are the possible outputs, returned if `a == b`, `a > b`, or `a < b` respectively. + * This visual shader node has six input ports. Port 1 and 2 provide the two floating point numbers + * `a` and `b` that will be compared. Port 3 is the tolerance, which allows similar floating point + * number to be considered equal. Ports 4 to 6 are the possible outputs, returned if `a == b`, `a > b`, + * or `a < b` respectively. */ @GodotBaseType public open class VisualShaderNodeIf : VisualShaderNode() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeInput.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeInput.kt index 81db505e5..d76001dc7 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeInput.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeInput.kt @@ -20,12 +20,8 @@ import kotlin.String import kotlin.Suppress /** - * Represents the input shader parameter within the visual shader graph. - * - * Tutorials: - * [$DOCS_URL/tutorials/shaders/shader_reference/index.html]($DOCS_URL/tutorials/shaders/shader_reference/index.html) - * - * Gives access to input variables (built-ins) available for the shader. See the shading reference for the list of available built-ins for each shader type (check `Tutorials` section for link). + * Gives access to input variables (built-ins) available for the shader. See the shading reference + * for the list of available built-ins for each shader type (check `Tutorials` section for link). */ @GodotBaseType public open class VisualShaderNodeInput : VisualShaderNode() { @@ -35,7 +31,8 @@ public open class VisualShaderNodeInput : VisualShaderNode() { public val inputTypeChanged: Signal0 by signal() /** - * One of the several input constants in lower-case style like: "vertex" (`VERTEX`) or "point_size" (`POINT_SIZE`). + * One of the several input constants in lower-case style like: "vertex" (`VERTEX`) or + * "point_size" (`POINT_SIZE`). */ public var inputName: String get() { @@ -54,7 +51,8 @@ public open class VisualShaderNodeInput : VisualShaderNode() { } /** - * Returns a translated name of the current constant in the Godot Shader Language. E.g. `"ALBEDO"` if the [inputName] equal to `"albedo"`. + * Returns a translated name of the current constant in the Godot Shader Language. E.g. `"ALBEDO"` + * if the [inputName] equal to `"albedo"`. */ public fun getInputRealName(): String { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeIntConstant.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeIntConstant.kt index 348c6b312..b03c07269 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeIntConstant.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeIntConstant.kt @@ -18,9 +18,7 @@ import kotlin.Long import kotlin.Suppress /** - * A scalar integer constant to be used within the visual shader graph. - * - * Translated to [code skip-lint]int` in the shader language. + * Translated to [code skip-lint]int[/code] in the shader language. */ @GodotBaseType public open class VisualShaderNodeIntConstant : VisualShaderNodeConstant() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeIntFunc.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeIntFunc.kt index 7033b1263..2d691f39f 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeIntFunc.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeIntFunc.kt @@ -18,8 +18,6 @@ import kotlin.Long import kotlin.Suppress /** - * A scalar integer function to be used within the visual shader graph. - * * Accept an integer scalar (`x`) to the input port and transform it according to [function]. */ @GodotBaseType @@ -47,7 +45,8 @@ public open class VisualShaderNodeIntFunc : VisualShaderNode() { id: Long, ) { /** - * Returns the absolute value of the parameter. Translates to `abs(x)` in the Godot Shader Language. + * Returns the absolute value of the parameter. Translates to `abs(x)` in the Godot Shader + * Language. */ FUNC_ABS(0), /** @@ -59,7 +58,8 @@ public open class VisualShaderNodeIntFunc : VisualShaderNode() { */ FUNC_SIGN(2), /** - * Returns the result of bitwise `NOT` operation on the integer. Translates to `~a` in the Godot Shader Language. + * Returns the result of bitwise `NOT` operation on the integer. Translates to `~a` in the Godot + * Shader Language. */ FUNC_BITWISE_NOT(3), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeIntOp.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeIntOp.kt index 0f44f1893..470c9aafa 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeIntOp.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeIntOp.kt @@ -18,8 +18,6 @@ import kotlin.Long import kotlin.Suppress /** - * An integer scalar operator to be used within the visual shader graph. - * * Applies [operator] to two integer inputs: `a` and `b`. */ @GodotBaseType @@ -63,7 +61,7 @@ public open class VisualShaderNodeIntOp : VisualShaderNode() { */ OP_DIV(3), /** - * Calculates the remainder of two numbers using `a % b`. + * Calculates the remainder of two numbers using `a % b`. */ OP_MOD(4), /** @@ -75,23 +73,28 @@ public open class VisualShaderNodeIntOp : VisualShaderNode() { */ OP_MIN(6), /** - * Returns the result of bitwise `AND` operation on the integer. Translates to `a & b` in the Godot Shader Language. + * Returns the result of bitwise `AND` operation on the integer. Translates to `a & b` in the + * Godot Shader Language. */ OP_BITWISE_AND(7), /** - * Returns the result of bitwise `OR` operation for two integers. Translates to `a | b` in the Godot Shader Language. + * Returns the result of bitwise `OR` operation for two integers. Translates to `a | b` in the + * Godot Shader Language. */ OP_BITWISE_OR(8), /** - * Returns the result of bitwise `XOR` operation for two integers. Translates to `a ^ b` in the Godot Shader Language. + * Returns the result of bitwise `XOR` operation for two integers. Translates to `a ^ b` in the + * Godot Shader Language. */ OP_BITWISE_XOR(9), /** - * Returns the result of bitwise left shift operation on the integer. Translates to `a << b` in the Godot Shader Language. + * Returns the result of bitwise left shift operation on the integer. Translates to `a << b` in + * the Godot Shader Language. */ OP_BITWISE_LEFT_SHIFT(10), /** - * Returns the result of bitwise right shift operation on the integer. Translates to `a >> b` in the Godot Shader Language. + * Returns the result of bitwise right shift operation on the integer. Translates to `a >> b` in + * the Godot Shader Language. */ OP_BITWISE_RIGHT_SHIFT(11), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeIntParameter.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeIntParameter.kt index 2b0f7e37f..230d422b0 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeIntParameter.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeIntParameter.kt @@ -19,9 +19,8 @@ import kotlin.Long import kotlin.Suppress /** - * A visual shader node for shader parameter (uniform) of type [int]. - * - * A [godot.VisualShaderNodeParameter] of type [int]. Offers additional customization for range of accepted values. + * A [VisualShaderNodeParameter] of type [int]. Offers additional customization for range of + * accepted values. */ @GodotBaseType public open class VisualShaderNodeIntParameter : VisualShaderNodeParameter() { @@ -40,7 +39,8 @@ public open class VisualShaderNodeIntParameter : VisualShaderNodeParameter() { } /** - * The minimum value this parameter can take. [hint] must be either [HINT_RANGE] or [HINT_RANGE_STEP] for this to take effect. + * The minimum value this parameter can take. [hint] must be either [constant HINT_RANGE] or + * [constant HINT_RANGE_STEP] for this to take effect. */ public var min: Int get() { @@ -54,7 +54,8 @@ public open class VisualShaderNodeIntParameter : VisualShaderNodeParameter() { } /** - * The maximum value this parameter can take. [hint] must be either [HINT_RANGE] or [HINT_RANGE_STEP] for this to take effect. + * The maximum value this parameter can take. [hint] must be either [constant HINT_RANGE] or + * [constant HINT_RANGE_STEP] for this to take effect. */ public var max: Int get() { @@ -68,7 +69,8 @@ public open class VisualShaderNodeIntParameter : VisualShaderNodeParameter() { } /** - * The step between parameter's values. Forces the parameter to be a multiple of the given value. [hint] must be [HINT_RANGE_STEP] for this to take effect. + * The step between parameter's values. Forces the parameter to be a multiple of the given value. + * [hint] must be [constant HINT_RANGE_STEP] for this to take effect. */ public var step: Int get() { @@ -96,7 +98,8 @@ public open class VisualShaderNodeIntParameter : VisualShaderNodeParameter() { } /** - * Default value of this parameter, which will be used if not set externally. [defaultValueEnabled] must be enabled; defaults to `0` otherwise. + * Default value of this parameter, which will be used if not set externally. + * [defaultValueEnabled] must be enabled; defaults to `0` otherwise. */ public var defaultValue: Int get() { @@ -126,7 +129,8 @@ public open class VisualShaderNodeIntParameter : VisualShaderNodeParameter() { */ HINT_RANGE(1), /** - * The parameter's value must be within the specified range, with the given [step] between values. + * The parameter's value must be within the specified range, with the given [step] between + * values. */ HINT_RANGE_STEP(2), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeIs.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeIs.kt index 5cbd21e21..7159fce3a 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeIs.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeIs.kt @@ -18,8 +18,6 @@ import kotlin.Long import kotlin.Suppress /** - * A boolean comparison operator to be used within the visual shader graph. - * * Returns the boolean result of the comparison between `INF` or `NaN` and a scalar parameter. */ @GodotBaseType diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeLinearSceneDepth.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeLinearSceneDepth.kt index 97c71c420..6787fc082 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeLinearSceneDepth.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeLinearSceneDepth.kt @@ -12,8 +12,6 @@ import kotlin.Int import kotlin.Suppress /** - * A visual shader node that returns the depth value of the DEPTH_TEXTURE node in a linear space. - * * This node can be used in fragment shaders. */ @GodotBaseType diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeMix.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeMix.kt index 5be8d2814..a67ab6dfc 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeMix.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeMix.kt @@ -18,8 +18,6 @@ import kotlin.Long import kotlin.Suppress /** - * Linearly interpolates between two values within the visual shader graph. - * * Translates to `mix(a, b, weight)` in the shader language. */ @GodotBaseType diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeMultiplyAdd.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeMultiplyAdd.kt index dfa499612..62cd91d33 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeMultiplyAdd.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeMultiplyAdd.kt @@ -18,8 +18,6 @@ import kotlin.Long import kotlin.Suppress /** - * Performs a fused multiply-add operation within the visual shader graph. - * * Uses three operands to compute `(a * b + c)` expression. */ @GodotBaseType diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeOuterProduct.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeOuterProduct.kt index aedd23819..64e992b8a 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeOuterProduct.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeOuterProduct.kt @@ -12,9 +12,10 @@ import kotlin.Int import kotlin.Suppress /** - * Calculates an outer product of two vectors within the visual shader graph. - * - * `OuterProduct` treats the first parameter `c` as a column vector (matrix with one column) and the second parameter `r` as a row vector (matrix with one row) and does a linear algebraic matrix multiply `c * r`, yielding a matrix whose number of rows is the number of components in `c` and whose number of columns is the number of components in `r`. + * `OuterProduct` treats the first parameter `c` as a column vector (matrix with one column) and the + * second parameter `r` as a row vector (matrix with one row) and does a linear algebraic matrix + * multiply `c * r`, yielding a matrix whose number of rows is the number of components in `c` and + * whose number of columns is the number of components in `r`. */ @GodotBaseType public open class VisualShaderNodeOuterProduct : VisualShaderNode() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeOutput.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeOutput.kt index 06645406e..8be377d44 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeOutput.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeOutput.kt @@ -12,9 +12,8 @@ import kotlin.Int import kotlin.Suppress /** - * Represents the output shader parameters within the visual shader graph. - * - * This visual shader node is present in all shader graphs in form of "Output" block with multiple output value ports. + * This visual shader node is present in all shader graphs in form of "Output" block with multiple + * output value ports. */ @GodotBaseType public open class VisualShaderNodeOutput internal constructor() : VisualShaderNode() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParameter.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParameter.kt index 19e0f091a..99276b6cb 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParameter.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParameter.kt @@ -20,14 +20,14 @@ import kotlin.String import kotlin.Suppress /** - * A base type for the parameters within the visual shader graph. - * - * A parameter represents a variable in the shader which is set externally, i.e. from the [godot.ShaderMaterial]. Parameters are exposed as properties in the [godot.ShaderMaterial] and can be assigned from the Inspector or from a script. + * A parameter represents a variable in the shader which is set externally, i.e. from the + * [ShaderMaterial]. Parameters are exposed as properties in the [ShaderMaterial] and can be assigned + * from the Inspector or from a script. */ @GodotBaseType public open class VisualShaderNodeParameter internal constructor() : VisualShaderNode() { /** - * Name of the parameter, by which it can be accessed through the [godot.ShaderMaterial] properties. + * Name of the parameter, by which it can be accessed through the [ShaderMaterial] properties. */ public var parameterName: String get() { @@ -63,7 +63,7 @@ public open class VisualShaderNodeParameter internal constructor() : VisualShade id: Long, ) { /** - * The parameter will be tied to the [godot.ShaderMaterial] using this shader. + * The parameter will be tied to the [ShaderMaterial] using this shader. */ QUAL_NONE(0), /** @@ -71,7 +71,7 @@ public open class VisualShaderNodeParameter internal constructor() : VisualShade */ QUAL_GLOBAL(1), /** - * The parameter will be tied to the node with attached [godot.ShaderMaterial] using this shader. + * The parameter will be tied to the node with attached [ShaderMaterial] using this shader. */ QUAL_INSTANCE(2), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParameterRef.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParameterRef.kt index 15411e53c..1e65916d2 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParameterRef.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParameterRef.kt @@ -18,9 +18,8 @@ import kotlin.String import kotlin.Suppress /** - * A reference to an existing [godot.VisualShaderNodeParameter]. - * - * Creating a reference to a [godot.VisualShaderNodeParameter] allows you to reuse this parameter in different shaders or shader stages easily. + * Creating a reference to a [VisualShaderNodeParameter] allows you to reuse this parameter in + * different shaders or shader stages easily. */ @GodotBaseType public open class VisualShaderNodeParameterRef : VisualShaderNode() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParticleAccelerator.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParticleAccelerator.kt index cff98e4eb..99fbd76c3 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParticleAccelerator.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParticleAccelerator.kt @@ -18,9 +18,8 @@ import kotlin.Long import kotlin.Suppress /** - * A visual shader node that accelerates particles. - * - * Particle accelerator can be used in "process" step of particle shader. It will accelerate the particles. Connect it to the Velocity output port. + * Particle accelerator can be used in "process" step of particle shader. It will accelerate the + * particles. Connect it to the Velocity output port. */ @GodotBaseType public open class VisualShaderNodeParticleAccelerator : VisualShaderNode() { @@ -55,7 +54,8 @@ public open class VisualShaderNodeParticleAccelerator : VisualShaderNode() { */ MODE_RADIAL(1), /** - * The particles will be accelerated tangentially to the radius vector from center to their position. + * The particles will be accelerated tangentially to the radius vector from center to their + * position. */ MODE_TANGENTIAL(2), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParticleBoxEmitter.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParticleBoxEmitter.kt index 4ecccebf1..d94c54f93 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParticleBoxEmitter.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParticleBoxEmitter.kt @@ -12,9 +12,8 @@ import kotlin.Int import kotlin.Suppress /** - * A visual shader node that makes particles emitted in a box shape. - * - * [godot.VisualShaderNodeParticleEmitter] that makes the particles emitted in box shape with the specified extents. + * [VisualShaderNodeParticleEmitter] that makes the particles emitted in box shape with the + * specified extents. */ @GodotBaseType public open class VisualShaderNodeParticleBoxEmitter : VisualShaderNodeParticleEmitter() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParticleConeVelocity.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParticleConeVelocity.kt index 7ca778ce4..1bfe1fd6c 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParticleConeVelocity.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParticleConeVelocity.kt @@ -12,9 +12,8 @@ import kotlin.Int import kotlin.Suppress /** - * A visual shader node that makes particles move in a cone shape. - * - * This node can be used in "start" step of particle shader. It defines the initial velocity of the particles, making them move in cone shape starting from the center, with a given spread. + * This node can be used in "start" step of particle shader. It defines the initial velocity of the + * particles, making them move in cone shape starting from the center, with a given spread. */ @GodotBaseType public open class VisualShaderNodeParticleConeVelocity : VisualShaderNode() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParticleEmit.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParticleEmit.kt index 4a5ecb20e..976b327e7 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParticleEmit.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParticleEmit.kt @@ -18,9 +18,9 @@ import kotlin.Long import kotlin.Suppress /** - * A visual shader node that forces to emit a particle from a sub-emitter. - * - * This node internally calls `emit_subparticle` shader method. It will emit a particle from the configured sub-emitter and also allows to customize how its emitted. Requires a sub-emitter assigned to the particles node with this shader. + * This node internally calls `emit_subparticle` shader method. It will emit a particle from the + * configured sub-emitter and also allows to customize how its emitted. Requires a sub-emitter assigned + * to the particles node with this shader. */ @GodotBaseType public open class VisualShaderNodeParticleEmit : VisualShaderNode() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParticleEmitter.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParticleEmitter.kt index f8b7cef5c..70354ad27 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParticleEmitter.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParticleEmitter.kt @@ -17,14 +17,14 @@ import kotlin.Int import kotlin.Suppress /** - * A base class for particle emitters. - * - * Particle emitter nodes can be used in "start" step of particle shaders and they define the starting position of the particles. Connect them to the Position output port. + * Particle emitter nodes can be used in "start" step of particle shaders and they define the + * starting position of the particles. Connect them to the Position output port. */ @GodotBaseType public open class VisualShaderNodeParticleEmitter internal constructor() : VisualShaderNode() { /** - * If `true`, the result of this emitter is projected to 2D space. By default it is `false` and meant for use in 3D space. + * If `true`, the result of this emitter is projected to 2D space. By default it is `false` and + * meant for use in 3D space. */ public var mode2d: Boolean get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParticleMeshEmitter.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParticleMeshEmitter.kt index 0abab5a3e..be875bca8 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParticleMeshEmitter.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParticleMeshEmitter.kt @@ -20,14 +20,13 @@ import kotlin.Long import kotlin.Suppress /** - * A visual shader node that makes particles emitted in a shape defined by a [godot.Mesh]. - * - * [godot.VisualShaderNodeParticleEmitter] that makes the particles emitted in a shape of the assigned [mesh]. It will emit from the mesh's surfaces, either all or only the specified one. + * [VisualShaderNodeParticleEmitter] that makes the particles emitted in a shape of the assigned + * [mesh]. It will emit from the mesh's surfaces, either all or only the specified one. */ @GodotBaseType public open class VisualShaderNodeParticleMeshEmitter : VisualShaderNodeParticleEmitter() { /** - * The [godot.Mesh] that defines emission shape. + * The [Mesh] that defines emission shape. */ public var mesh: Mesh? get() { @@ -55,7 +54,8 @@ public open class VisualShaderNodeParticleMeshEmitter : VisualShaderNodeParticle } /** - * Index of the surface that emits particles. [useAllSurfaces] must be `false` for this to take effect. + * Index of the surface that emits particles. [useAllSurfaces] must be `false` for this to take + * effect. */ public var surfaceIndex: Int get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParticleMultiplyByAxisAngle.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParticleMultiplyByAxisAngle.kt index 524d7ec59..675680535 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParticleMultiplyByAxisAngle.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParticleMultiplyByAxisAngle.kt @@ -17,9 +17,8 @@ import kotlin.Int import kotlin.Suppress /** - * A visual shader helper node for multiplying position and rotation of particles. - * - * This node helps to multiply a position input vector by rotation using specific axis. Intended to work with emitters. + * This node helps to multiply a position input vector by rotation using specific axis. Intended to + * work with emitters. */ @GodotBaseType public open class VisualShaderNodeParticleMultiplyByAxisAngle : VisualShaderNode() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParticleOutput.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParticleOutput.kt index 8e7b78231..ae316a9a8 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParticleOutput.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParticleOutput.kt @@ -12,9 +12,9 @@ import kotlin.Int import kotlin.Suppress /** - * Visual shader node that defines output values for particle emitting. - * - * This node defines how particles are emitted. It allows to customize e.g. position and velocity. Available ports are different depending on which function this node is inside (start, process, collision) and whether custom data is enabled. + * This node defines how particles are emitted. It allows to customize e.g. position and velocity. + * Available ports are different depending on which function this node is inside (start, process, + * collision) and whether custom data is enabled. */ @GodotBaseType public open class VisualShaderNodeParticleOutput : VisualShaderNodeOutput() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParticleRandomness.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParticleRandomness.kt index 130c9ff6c..5f11f912a 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParticleRandomness.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParticleRandomness.kt @@ -18,9 +18,8 @@ import kotlin.Long import kotlin.Suppress /** - * Visual shader node for randomizing particle values. - * - * Randomness node will output pseudo-random values of the given type based on the specified minimum and maximum values. + * Randomness node will output pseudo-random values of the given type based on the specified minimum + * and maximum values. */ @GodotBaseType public open class VisualShaderNodeParticleRandomness : VisualShaderNode() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParticleRingEmitter.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParticleRingEmitter.kt index a62326506..8f57d8220 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParticleRingEmitter.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParticleRingEmitter.kt @@ -12,9 +12,8 @@ import kotlin.Int import kotlin.Suppress /** - * A visual shader node that makes particles emitted in a ring shape. - * - * [godot.VisualShaderNodeParticleEmitter] that makes the particles emitted in ring shape with the specified inner and outer radii and height. + * [VisualShaderNodeParticleEmitter] that makes the particles emitted in ring shape with the + * specified inner and outer radii and height. */ @GodotBaseType public open class VisualShaderNodeParticleRingEmitter : VisualShaderNodeParticleEmitter() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParticleSphereEmitter.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParticleSphereEmitter.kt index 549bd9e82..c7467bc80 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParticleSphereEmitter.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeParticleSphereEmitter.kt @@ -12,9 +12,8 @@ import kotlin.Int import kotlin.Suppress /** - * A visual shader node that makes particles emitted in a sphere shape. - * - * [godot.VisualShaderNodeParticleEmitter] that makes the particles emitted in sphere shape with the specified inner and outer radii. + * [VisualShaderNodeParticleEmitter] that makes the particles emitted in sphere shape with the + * specified inner and outer radii. */ @GodotBaseType public open class VisualShaderNodeParticleSphereEmitter : VisualShaderNodeParticleEmitter() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeProximityFade.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeProximityFade.kt index 56f10b40f..2f04505b4 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeProximityFade.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeProximityFade.kt @@ -12,8 +12,6 @@ import kotlin.Int import kotlin.Suppress /** - * A visual shader node representing proximity fade effect. - * * The proximity fade effect fades out each pixel based on its distance to another object. */ @GodotBaseType diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeRandomRange.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeRandomRange.kt index 6038b0dd8..9fdf76092 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeRandomRange.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeRandomRange.kt @@ -12,9 +12,9 @@ import kotlin.Int import kotlin.Suppress /** - * A visual shader node that generates a pseudo-random scalar. - * - * Random range node will output a pseudo-random scalar value in the specified range, based on the seed. The value is always the same for the given seed and range, so you should provide a changing input, e.g. by using time. + * Random range node will output a pseudo-random scalar value in the specified range, based on the + * seed. The value is always the same for the given seed and range, so you should provide a changing + * input, e.g. by using time. */ @GodotBaseType public open class VisualShaderNodeRandomRange : VisualShaderNode() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeRemap.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeRemap.kt index 34239f069..0d5bc786d 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeRemap.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeRemap.kt @@ -12,9 +12,8 @@ import kotlin.Int import kotlin.Suppress /** - * A visual shader node for remap function. - * - * Remap will transform the input range into output range, e.g. you can change a `0..1` value to `-2..2` etc. See [@GlobalScope.remap] for more details. + * Remap will transform the input range into output range, e.g. you can change a `0..1` value to + * `-2..2` etc. See [@GlobalScope.remap] for more details. */ @GodotBaseType public open class VisualShaderNodeRemap : VisualShaderNode() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeResizableBase.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeResizableBase.kt index 66b22f951..d5f973758 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeResizableBase.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeResizableBase.kt @@ -21,8 +21,6 @@ import kotlin.Suppress import kotlin.Unit /** - * Base class for resizable nodes in a visual shader graph. - * * Resizable nodes have a handle that allows the user to adjust their size as needed. */ @GodotBaseType diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeRotationByAxis.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeRotationByAxis.kt index f06b72b00..b9a16ede2 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeRotationByAxis.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeRotationByAxis.kt @@ -12,9 +12,8 @@ import kotlin.Int import kotlin.Suppress /** - * A visual shader node that modifies the rotation of the object using a rotation matrix. - * - * RotationByAxis node will transform the vertices of a mesh with specified axis and angle in radians. It can be used to rotate an object in an arbitrary axis. + * RotationByAxis node will transform the vertices of a mesh with specified axis and angle in + * radians. It can be used to rotate an object in an arbitrary axis. */ @GodotBaseType public open class VisualShaderNodeRotationByAxis : VisualShaderNode() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeSDFRaymarch.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeSDFRaymarch.kt index 184b336c9..1c3afa3f7 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeSDFRaymarch.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeSDFRaymarch.kt @@ -12,8 +12,6 @@ import kotlin.Int import kotlin.Suppress /** - * SDF raymarching algorithm to be used within the visual shader graph. - * * Casts a ray against the screen SDF (signed-distance field) and returns the distance travelled. */ @GodotBaseType diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeSDFToScreenUV.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeSDFToScreenUV.kt index 661a86137..a827ebbcd 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeSDFToScreenUV.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeSDFToScreenUV.kt @@ -12,8 +12,6 @@ import kotlin.Int import kotlin.Suppress /** - * A function to convert an SDF (signed-distance field) to screen UV, to be used within the visual shader graph. - * * Translates to `sdf_to_screen_uv(sdf_pos)` in the shader language. */ @GodotBaseType diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeSample3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeSample3D.kt index 10b942491..36922a219 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeSample3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeSample3D.kt @@ -18,8 +18,6 @@ import kotlin.Long import kotlin.Suppress /** - * A base node for nodes which samples 3D textures in the visual shader graph. - * * A virtual class, use the descendants instead. */ @GodotBaseType diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeScreenNormalWorldSpace.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeScreenNormalWorldSpace.kt index c5c0187de..68d02f3cb 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeScreenNormalWorldSpace.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeScreenNormalWorldSpace.kt @@ -12,8 +12,6 @@ import kotlin.Int import kotlin.Suppress /** - * A visual shader node that unpacks the screen normal texture in World Space. - * * The ScreenNormalWorldSpace node allows to create outline effects. */ @GodotBaseType diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeScreenUVToSDF.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeScreenUVToSDF.kt index a01193ffc..67ca5d7f1 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeScreenUVToSDF.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeScreenUVToSDF.kt @@ -12,9 +12,8 @@ import kotlin.Int import kotlin.Suppress /** - * A function to convert screen UV to an SDF (signed-distance field), to be used within the visual shader graph. - * - * Translates to `screen_uv_to_sdf(uv)` in the shader language. If the UV port isn't connected, `SCREEN_UV` is used instead. + * Translates to `screen_uv_to_sdf(uv)` in the shader language. If the UV port isn't connected, + * `SCREEN_UV` is used instead. */ @GodotBaseType public open class VisualShaderNodeScreenUVToSDF : VisualShaderNode() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeSmoothStep.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeSmoothStep.kt index 5978176a8..a8954f22e 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeSmoothStep.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeSmoothStep.kt @@ -18,11 +18,9 @@ import kotlin.Long import kotlin.Suppress /** - * Calculates a SmoothStep function within the visual shader graph. - * * Translates to `smoothstep(edge0, edge1, x)` in the shader language. - * - * Returns `0.0` if `x` is smaller than `edge0` and `1.0` if `x` is larger than `edge1`. Otherwise, the return value is interpolated between `0.0` and `1.0` using Hermite polynomials. + * Returns `0.0` if `x` is smaller than `edge0` and `1.0` if `x` is larger than `edge1`. Otherwise, + * the return value is interpolated between `0.0` and `1.0` using Hermite polynomials. */ @GodotBaseType public open class VisualShaderNodeSmoothStep : VisualShaderNode() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeStep.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeStep.kt index 1c1362fe7..c827eefa4 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeStep.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeStep.kt @@ -18,10 +18,7 @@ import kotlin.Long import kotlin.Suppress /** - * Calculates a Step function within the visual shader graph. - * * Translates to `step(edge, x)` in the shader language. - * * Returns `0.0` if `x` is smaller than `edge` and `1.0` otherwise. */ @GodotBaseType diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeSwitch.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeSwitch.kt index 24f34239b..24958cc36 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeSwitch.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeSwitch.kt @@ -18,9 +18,8 @@ import kotlin.Long import kotlin.Suppress /** - * A selector function for use within the visual shader graph. - * - * Returns an associated value of the [opType] type if the provided boolean value is `true` or `false`. + * Returns an associated value of the [opType] type if the provided boolean value is `true` or + * `false`. */ @GodotBaseType public open class VisualShaderNodeSwitch : VisualShaderNode() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTexture.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTexture.kt index b656cb096..dc48170ee 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTexture.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTexture.kt @@ -19,9 +19,8 @@ import kotlin.Long import kotlin.Suppress /** - * Performs a 2D texture lookup within the visual shader graph. - * - * Performs a lookup operation on the provided texture, with support for multiple texture sources to choose from. + * Performs a lookup operation on the provided texture, with support for multiple texture sources to + * choose from. */ @GodotBaseType public open class VisualShaderNodeTexture : VisualShaderNode() { @@ -54,7 +53,8 @@ public open class VisualShaderNodeTexture : VisualShaderNode() { } /** - * Specifies the type of the texture if [source] is set to [SOURCE_TEXTURE]. See [enum TextureType] for options. + * Specifies the type of the texture if [source] is set to [constant SOURCE_TEXTURE]. See [enum + * TextureType] for options. */ public var textureType: TextureType get() { @@ -84,7 +84,7 @@ public open class VisualShaderNodeTexture : VisualShaderNode() { */ SOURCE_SCREEN(1), /** - * Use the texture from this shader's texture built-in (e.g. a texture of a [godot.Sprite2D]). + * Use the texture from this shader's texture built-in (e.g. a texture of a [Sprite2D]). */ SOURCE_2D_TEXTURE(2), /** @@ -92,7 +92,8 @@ public open class VisualShaderNodeTexture : VisualShaderNode() { */ SOURCE_2D_NORMAL(3), /** - * Use the depth texture captured during the depth prepass. Only available when the depth prepass is used (i.e. in spatial shaders and in the forward_plus or gl_compatibility renderers). + * Use the depth texture captured during the depth prepass. Only available when the depth + * prepass is used (i.e. in spatial shaders and in the forward_plus or gl_compatibility renderers). */ SOURCE_DEPTH(4), /** @@ -100,11 +101,13 @@ public open class VisualShaderNodeTexture : VisualShaderNode() { */ SOURCE_PORT(5), /** - * Use the normal buffer captured during the depth prepass. Only available when the normal-roughness buffer is available (i.e. in spatial shaders and in the forward_plus renderer). + * Use the normal buffer captured during the depth prepass. Only available when the + * normal-roughness buffer is available (i.e. in spatial shaders and in the forward_plus renderer). */ SOURCE_3D_NORMAL(6), /** - * Use the roughness buffer captured during the depth prepass. Only available when the normal-roughness buffer is available (i.e. in spatial shaders and in the forward_plus renderer). + * Use the roughness buffer captured during the depth prepass. Only available when the + * normal-roughness buffer is available (i.e. in spatial shaders and in the forward_plus renderer). */ SOURCE_ROUGHNESS(7), /** @@ -135,7 +138,8 @@ public open class VisualShaderNodeTexture : VisualShaderNode() { */ TYPE_COLOR(1), /** - * Adds `hint_normal` as hint to the uniform declaration, which internally converts the texture for proper usage as normal map. + * Adds `hint_normal` as hint to the uniform declaration, which internally converts the texture + * for proper usage as normal map. */ TYPE_NORMAL_MAP(2), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTexture2DArray.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTexture2DArray.kt index 97161650d..8e097bb14 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTexture2DArray.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTexture2DArray.kt @@ -17,14 +17,13 @@ import kotlin.Int import kotlin.Suppress /** - * A 2D texture uniform array to be used within the visual shader graph. - * * Translated to `uniform sampler2DArray` in the shader language. */ @GodotBaseType public open class VisualShaderNodeTexture2DArray : VisualShaderNodeSample3D() { /** - * A source texture array. Used if [godot.VisualShaderNodeSample3D.source] is set to [godot.VisualShaderNodeSample3D.SOURCE_TEXTURE]. + * A source texture array. Used if [VisualShaderNodeSample3D.source] is set to [constant + * VisualShaderNodeSample3D.SOURCE_TEXTURE]. */ public var textureArray: Texture2DArray? get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTexture2DArrayParameter.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTexture2DArrayParameter.kt index 7137bd828..461861f10 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTexture2DArrayParameter.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTexture2DArrayParameter.kt @@ -12,9 +12,8 @@ import kotlin.Int import kotlin.Suppress /** - * A visual shader node for shader parameter (uniform) of type [godot.Texture2DArray]. - * - * This parameter allows to provide a collection of textures for the shader. You can use [godot.VisualShaderNodeTexture2DArray] to extract the textures from array. + * This parameter allows to provide a collection of textures for the shader. You can use + * [VisualShaderNodeTexture2DArray] to extract the textures from array. */ @GodotBaseType public open class VisualShaderNodeTexture2DArrayParameter : VisualShaderNodeTextureParameter() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTexture2DParameter.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTexture2DParameter.kt index 5a3a8535a..856c6f7da 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTexture2DParameter.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTexture2DParameter.kt @@ -12,8 +12,6 @@ import kotlin.Int import kotlin.Suppress /** - * Provides a 2D texture parameter within the visual shader graph. - * * Translated to `uniform sampler2D` in the shader language. */ @GodotBaseType diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTexture3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTexture3D.kt index 25ff97f5d..f89f2efe1 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTexture3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTexture3D.kt @@ -17,14 +17,14 @@ import kotlin.Int import kotlin.Suppress /** - * Performs a 3D texture lookup within the visual shader graph. - * - * Performs a lookup operation on the provided texture, with support for multiple texture sources to choose from. + * Performs a lookup operation on the provided texture, with support for multiple texture sources to + * choose from. */ @GodotBaseType public open class VisualShaderNodeTexture3D : VisualShaderNodeSample3D() { /** - * A source texture. Used if [godot.VisualShaderNodeSample3D.source] is set to [godot.VisualShaderNodeSample3D.SOURCE_TEXTURE]. + * A source texture. Used if [VisualShaderNodeSample3D.source] is set to [constant + * VisualShaderNodeSample3D.SOURCE_TEXTURE]. */ public var texture: Texture3D? get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTexture3DParameter.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTexture3DParameter.kt index f6733737c..773849f1f 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTexture3DParameter.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTexture3DParameter.kt @@ -12,8 +12,6 @@ import kotlin.Int import kotlin.Suppress /** - * Provides a 3D texture parameter within the visual shader graph. - * * Translated to `uniform sampler3D` in the shader language. */ @GodotBaseType diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTextureParameterTriplanar.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTextureParameterTriplanar.kt index 792220412..2df56a092 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTextureParameterTriplanar.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTextureParameterTriplanar.kt @@ -12,9 +12,8 @@ import kotlin.Int import kotlin.Suppress /** - * Performs a uniform texture lookup with triplanar within the visual shader graph. - * - * Performs a lookup operation on the texture provided as a uniform for the shader, with support for triplanar mapping. + * Performs a lookup operation on the texture provided as a uniform for the shader, with support for + * triplanar mapping. */ @GodotBaseType public open class VisualShaderNodeTextureParameterTriplanar : VisualShaderNodeTextureParameter() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTextureSDF.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTextureSDF.kt index 248f17f26..0b54816c4 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTextureSDF.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTextureSDF.kt @@ -12,8 +12,6 @@ import kotlin.Int import kotlin.Suppress /** - * Performs an SDF (signed-distance field) texture lookup within the visual shader graph. - * * Translates to `texture_sdf(sdf_pos)` in the shader language. */ @GodotBaseType diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTextureSDFNormal.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTextureSDFNormal.kt index 3563abe4d..19d418941 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTextureSDFNormal.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTextureSDFNormal.kt @@ -12,8 +12,6 @@ import kotlin.Int import kotlin.Suppress /** - * Performs an SDF (signed-distance field) normal texture lookup within the visual shader graph. - * * Translates to `texture_sdf_normal(sdf_pos)` in the shader language. */ @GodotBaseType diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTransformCompose.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTransformCompose.kt index 2b52ea42c..22d82706a 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTransformCompose.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTransformCompose.kt @@ -12,9 +12,8 @@ import kotlin.Int import kotlin.Suppress /** - * Composes a [godot.Transform3D] from four [godot.core.Vector3]s within the visual shader graph. - * - * Creates a 4x4 transform matrix using four vectors of type `vec3`. Each vector is one row in the matrix and the last column is a `vec4(0, 0, 0, 1)`. + * Creates a 4x4 transform matrix using four vectors of type `vec3`. Each vector is one row in the + * matrix and the last column is a `vec4(0, 0, 0, 1)`. */ @GodotBaseType public open class VisualShaderNodeTransformCompose : VisualShaderNode() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTransformConstant.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTransformConstant.kt index ff8812e00..928b67c5d 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTransformConstant.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTransformConstant.kt @@ -21,14 +21,12 @@ import kotlin.Suppress import kotlin.Unit /** - * A [godot.Transform3D] constant for use within the visual shader graph. - * - * A constant [godot.Transform3D], which can be used as an input node. + * A constant [Transform3D], which can be used as an input node. */ @GodotBaseType public open class VisualShaderNodeTransformConstant : VisualShaderNodeConstant() { /** - * A [godot.Transform3D] constant which represents the state of this node. + * A [Transform3D] constant which represents the state of this node. */ @CoreTypeLocalCopy public var constant: Transform3D @@ -48,7 +46,7 @@ public open class VisualShaderNodeTransformConstant : VisualShaderNodeConstant() } /** - * A [godot.Transform3D] constant which represents the state of this node. + * A [Transform3D] constant which represents the state of this node. * * This is a helper function to make dealing with local copies easier. * diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTransformDecompose.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTransformDecompose.kt index b2b57362f..7ff23b264 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTransformDecompose.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTransformDecompose.kt @@ -12,9 +12,8 @@ import kotlin.Int import kotlin.Suppress /** - * Decomposes a [godot.Transform3D] into four [godot.core.Vector3]s within the visual shader graph. - * - * Takes a 4x4 transform matrix and decomposes it into four `vec3` values, one from each row of the matrix. + * Takes a 4x4 transform matrix and decomposes it into four `vec3` values, one from each row of the + * matrix. */ @GodotBaseType public open class VisualShaderNodeTransformDecompose : VisualShaderNode() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTransformFunc.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTransformFunc.kt index b819060d0..0b6cfa1da 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTransformFunc.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTransformFunc.kt @@ -18,9 +18,7 @@ import kotlin.Long import kotlin.Suppress /** - * Computes a [godot.Transform3D] function within the visual shader graph. - * - * Computes an inverse or transpose function on the provided [godot.Transform3D]. + * Computes an inverse or transpose function on the provided [Transform3D]. */ @GodotBaseType public open class VisualShaderNodeTransformFunc : VisualShaderNode() { @@ -47,11 +45,11 @@ public open class VisualShaderNodeTransformFunc : VisualShaderNode() { id: Long, ) { /** - * Perform the inverse operation on the [godot.Transform3D] matrix. + * Perform the inverse operation on the [Transform3D] matrix. */ FUNC_INVERSE(0), /** - * Perform the transpose operation on the [godot.Transform3D] matrix. + * Perform the transpose operation on the [Transform3D] matrix. */ FUNC_TRANSPOSE(1), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTransformOp.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTransformOp.kt index 62b9eda88..d78757f1c 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTransformOp.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTransformOp.kt @@ -18,8 +18,6 @@ import kotlin.Long import kotlin.Suppress /** - * A [godot.Transform3D] operator to be used within the visual shader graph. - * * Applies [operator] to two transform (4x4 matrices) inputs. */ @GodotBaseType diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTransformParameter.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTransformParameter.kt index 14c5ff9a1..f63aee48c 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTransformParameter.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTransformParameter.kt @@ -22,8 +22,6 @@ import kotlin.Suppress import kotlin.Unit /** - * A [godot.Transform3D] parameter for use within the visual shader graph. - * * Translated to `uniform mat4` in the shader language. */ @GodotBaseType diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTransformVecMult.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTransformVecMult.kt index 952fb3104..f00dd63f2 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTransformVecMult.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeTransformVecMult.kt @@ -18,9 +18,8 @@ import kotlin.Long import kotlin.Suppress /** - * Multiplies a [godot.Transform3D] and a [godot.core.Vector3] within the visual shader graph. - * - * A multiplication operation on a transform (4x4 matrix) and a vector, with support for different multiplication operators. + * A multiplication operation on a transform (4x4 matrix) and a vector, with support for different + * multiplication operators. */ @GodotBaseType public open class VisualShaderNodeTransformVecMult : VisualShaderNode() { @@ -55,11 +54,13 @@ public open class VisualShaderNodeTransformVecMult : VisualShaderNode() { */ OP_BxA(1), /** - * Multiplies transform `a` by the vector `b`, skipping the last row and column of the transform. + * Multiplies transform `a` by the vector `b`, skipping the last row and column of the + * transform. */ OP_3x3_AxB(2), /** - * Multiplies vector `b` by the transform `a`, skipping the last row and column of the transform. + * Multiplies vector `b` by the transform `a`, skipping the last row and column of the + * transform. */ OP_3x3_BxA(3), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeUIntConstant.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeUIntConstant.kt index 4cb9de625..fcd90ef0d 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeUIntConstant.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeUIntConstant.kt @@ -18,8 +18,6 @@ import kotlin.Long import kotlin.Suppress /** - * An unsigned scalar integer constant to be used within the visual shader graph. - * * Translated to `uint` in the shader language. */ @GodotBaseType diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeUIntFunc.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeUIntFunc.kt index a9e9d11b2..a7b9177ab 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeUIntFunc.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeUIntFunc.kt @@ -18,9 +18,8 @@ import kotlin.Long import kotlin.Suppress /** - * An unsigned scalar integer function to be used within the visual shader graph. - * - * Accept an unsigned integer scalar (`x`) to the input port and transform it according to [function]. + * Accept an unsigned integer scalar (`x`) to the input port and transform it according to + * [function]. */ @GodotBaseType public open class VisualShaderNodeUIntFunc : VisualShaderNode() { @@ -51,7 +50,8 @@ public open class VisualShaderNodeUIntFunc : VisualShaderNode() { */ FUNC_NEGATE(0), /** - * Returns the result of bitwise `NOT` operation on the integer. Translates to `~a` in the Godot Shader Language. + * Returns the result of bitwise `NOT` operation on the integer. Translates to `~a` in the Godot + * Shader Language. */ FUNC_BITWISE_NOT(1), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeUIntOp.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeUIntOp.kt index ab9931a88..f769dfeed 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeUIntOp.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeUIntOp.kt @@ -18,8 +18,6 @@ import kotlin.Long import kotlin.Suppress /** - * An unsigned integer scalar operator to be used within the visual shader graph. - * * Applies [operator] to two unsigned integer inputs: `a` and `b`. */ @GodotBaseType @@ -63,7 +61,7 @@ public open class VisualShaderNodeUIntOp : VisualShaderNode() { */ OP_DIV(3), /** - * Calculates the remainder of two numbers using `a % b`. + * Calculates the remainder of two numbers using `a % b`. */ OP_MOD(4), /** @@ -75,23 +73,28 @@ public open class VisualShaderNodeUIntOp : VisualShaderNode() { */ OP_MIN(6), /** - * Returns the result of bitwise `AND` operation on the integer. Translates to `a & b` in the Godot Shader Language. + * Returns the result of bitwise `AND` operation on the integer. Translates to `a & b` in the + * Godot Shader Language. */ OP_BITWISE_AND(7), /** - * Returns the result of bitwise `OR` operation for two integers. Translates to `a | b` in the Godot Shader Language. + * Returns the result of bitwise `OR` operation for two integers. Translates to `a | b` in the + * Godot Shader Language. */ OP_BITWISE_OR(8), /** - * Returns the result of bitwise `XOR` operation for two integers. Translates to `a ^ b` in the Godot Shader Language. + * Returns the result of bitwise `XOR` operation for two integers. Translates to `a ^ b` in the + * Godot Shader Language. */ OP_BITWISE_XOR(9), /** - * Returns the result of bitwise left shift operation on the integer. Translates to `a << b` in the Godot Shader Language. + * Returns the result of bitwise left shift operation on the integer. Translates to `a << b` in + * the Godot Shader Language. */ OP_BITWISE_LEFT_SHIFT(10), /** - * Returns the result of bitwise right shift operation on the integer. Translates to `a >> b` in the Godot Shader Language. + * Returns the result of bitwise right shift operation on the integer. Translates to `a >> b` in + * the Godot Shader Language. */ OP_BITWISE_RIGHT_SHIFT(11), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeUIntParameter.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeUIntParameter.kt index f9dd99ca4..2e7b89647 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeUIntParameter.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeUIntParameter.kt @@ -19,9 +19,8 @@ import kotlin.Long import kotlin.Suppress /** - * A visual shader node for shader parameter (uniform) of type unsigned [int]. - * - * A [godot.VisualShaderNodeParameter] of type unsigned [int]. Offers additional customization for range of accepted values. + * A [VisualShaderNodeParameter] of type unsigned [int]. Offers additional customization for range + * of accepted values. */ @GodotBaseType public open class VisualShaderNodeUIntParameter : VisualShaderNodeParameter() { @@ -40,7 +39,8 @@ public open class VisualShaderNodeUIntParameter : VisualShaderNodeParameter() { } /** - * Default value of this parameter, which will be used if not set externally. [defaultValueEnabled] must be enabled; defaults to `0` otherwise. + * Default value of this parameter, which will be used if not set externally. + * [defaultValueEnabled] must be enabled; defaults to `0` otherwise. */ public var defaultValue: Int get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeUVFunc.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeUVFunc.kt index 373e105c1..c9bb47a68 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeUVFunc.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeUVFunc.kt @@ -18,9 +18,8 @@ import kotlin.Long import kotlin.Suppress /** - * Contains functions to modify texture coordinates (`uv`) to be used within the visual shader graph. - * - * UV functions are similar to [godot.core.Vector2] functions, but the input port of this node uses the shader's UV value by default. + * UV functions are similar to [Vector2] functions, but the input port of this node uses the + * shader's UV value by default. */ @GodotBaseType public open class VisualShaderNodeUVFunc : VisualShaderNode() { @@ -47,11 +46,13 @@ public open class VisualShaderNodeUVFunc : VisualShaderNode() { id: Long, ) { /** - * Translates `uv` by using `scale` and `offset` values using the following formula: `uv = uv + offset * scale`. `uv` port is connected to `UV` built-in by default. + * Translates `uv` by using `scale` and `offset` values using the following formula: `uv = uv + + * offset * scale`. `uv` port is connected to `UV` built-in by default. */ FUNC_PANNING(0), /** - * Scales `uv` by using `scale` and `pivot` values using the following formula: `uv = (uv - pivot) * scale + pivot`. `uv` port is connected to `UV` built-in by default. + * Scales `uv` by using `scale` and `pivot` values using the following formula: `uv = (uv - + * pivot) * scale + pivot`. `uv` port is connected to `UV` built-in by default. */ FUNC_SCALING(1), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeUVPolarCoord.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeUVPolarCoord.kt index 66b438c89..75e671d88 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeUVPolarCoord.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeUVPolarCoord.kt @@ -12,9 +12,8 @@ import kotlin.Int import kotlin.Suppress /** - * A visual shader node that modifies the texture UV using polar coordinates. - * - * UV polar coord node will transform UV values into polar coordinates, with specified scale, zoom strength and repeat parameters. It can be used to create various swirl distortions. + * UV polar coord node will transform UV values into polar coordinates, with specified scale, zoom + * strength and repeat parameters. It can be used to create various swirl distortions. */ @GodotBaseType public open class VisualShaderNodeUVPolarCoord : VisualShaderNode() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVarying.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVarying.kt index 1ac25c7ee..31a2ff91b 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVarying.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVarying.kt @@ -20,9 +20,8 @@ import kotlin.String import kotlin.Suppress /** - * A visual shader node that represents a "varying" shader value. - * - * Varying values are shader variables that can be passed between shader functions, e.g. from Vertex shader to Fragment shader. + * Varying values are shader variables that can be passed between shader functions, e.g. from Vertex + * shader to Fragment shader. */ @GodotBaseType public open class VisualShaderNodeVarying internal constructor() : VisualShaderNode() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVaryingGetter.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVaryingGetter.kt index aab35a054..6ca04e8a7 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVaryingGetter.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVaryingGetter.kt @@ -12,9 +12,9 @@ import kotlin.Int import kotlin.Suppress /** - * A visual shader node that gets a value of a varying. - * - * Outputs a value of a varying defined in the shader. You need to first create a varying that can be used in the given function, e.g. varying getter in Fragment shader requires a varying with mode set to [godot.VisualShader.VARYING_MODE_VERTEX_TO_FRAG_LIGHT]. + * Outputs a value of a varying defined in the shader. You need to first create a varying that can + * be used in the given function, e.g. varying getter in Fragment shader requires a varying with mode + * set to [constant VisualShader.VARYING_MODE_VERTEX_TO_FRAG_LIGHT]. */ @GodotBaseType public open class VisualShaderNodeVaryingGetter : VisualShaderNodeVarying() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVaryingSetter.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVaryingSetter.kt index a2da5de76..2704dc39e 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVaryingSetter.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVaryingSetter.kt @@ -12,9 +12,9 @@ import kotlin.Int import kotlin.Suppress /** - * A visual shader node that sets a value of a varying. - * - * Inputs a value to a varying defined in the shader. You need to first create a varying that can be used in the given function, e.g. varying setter in Fragment shader requires a varying with mode set to [godot.VisualShader.VARYING_MODE_FRAG_TO_LIGHT]. + * Inputs a value to a varying defined in the shader. You need to first create a varying that can be + * used in the given function, e.g. varying setter in Fragment shader requires a varying with mode set + * to [constant VisualShader.VARYING_MODE_FRAG_TO_LIGHT]. */ @GodotBaseType public open class VisualShaderNodeVaryingSetter : VisualShaderNodeVarying() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVec2Constant.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVec2Constant.kt index 93d4134ce..a9ea3498f 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVec2Constant.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVec2Constant.kt @@ -21,14 +21,12 @@ import kotlin.Suppress import kotlin.Unit /** - * A [godot.core.Vector2] constant to be used within the visual shader graph. - * - * A constant [godot.core.Vector2], which can be used as an input node. + * A constant [Vector2], which can be used as an input node. */ @GodotBaseType public open class VisualShaderNodeVec2Constant : VisualShaderNodeConstant() { /** - * A [godot.core.Vector2] constant which represents the state of this node. + * A [Vector2] constant which represents the state of this node. */ @CoreTypeLocalCopy public var constant: Vector2 @@ -48,7 +46,7 @@ public open class VisualShaderNodeVec2Constant : VisualShaderNodeConstant() { } /** - * A [godot.core.Vector2] constant which represents the state of this node. + * A [Vector2] constant which represents the state of this node. * * This is a helper function to make dealing with local copies easier. * diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVec2Parameter.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVec2Parameter.kt index c75c8cf62..680481a40 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVec2Parameter.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVec2Parameter.kt @@ -22,8 +22,6 @@ import kotlin.Suppress import kotlin.Unit /** - * A [godot.core.Vector2] parameter to be used within the visual shader graph. - * * Translated to `uniform vec2` in the shader language. */ @GodotBaseType diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVec3Constant.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVec3Constant.kt index c487d07a1..e82bbd339 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVec3Constant.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVec3Constant.kt @@ -21,14 +21,12 @@ import kotlin.Suppress import kotlin.Unit /** - * A [godot.core.Vector3] constant to be used within the visual shader graph. - * - * A constant [godot.core.Vector3], which can be used as an input node. + * A constant [Vector3], which can be used as an input node. */ @GodotBaseType public open class VisualShaderNodeVec3Constant : VisualShaderNodeConstant() { /** - * A [godot.core.Vector3] constant which represents the state of this node. + * A [Vector3] constant which represents the state of this node. */ @CoreTypeLocalCopy public var constant: Vector3 @@ -48,7 +46,7 @@ public open class VisualShaderNodeVec3Constant : VisualShaderNodeConstant() { } /** - * A [godot.core.Vector3] constant which represents the state of this node. + * A [Vector3] constant which represents the state of this node. * * This is a helper function to make dealing with local copies easier. * diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVec3Parameter.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVec3Parameter.kt index d90e292ab..6d0bbeaef 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVec3Parameter.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVec3Parameter.kt @@ -22,8 +22,6 @@ import kotlin.Suppress import kotlin.Unit /** - * A [godot.core.Vector3] parameter to be used within the visual shader graph. - * * Translated to `uniform vec3` in the shader language. */ @GodotBaseType diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVec4Constant.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVec4Constant.kt index ef4235ddb..0a6540a7e 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVec4Constant.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVec4Constant.kt @@ -21,14 +21,12 @@ import kotlin.Suppress import kotlin.Unit /** - * A 4D vector constant to be used within the visual shader graph. - * * A constant 4D vector, which can be used as an input node. */ @GodotBaseType public open class VisualShaderNodeVec4Constant : VisualShaderNodeConstant() { /** - * A 4D vector (represented as a [godot.Quaternion]) constant which represents the state of this node. + * A 4D vector (represented as a [Quaternion]) constant which represents the state of this node. */ @CoreTypeLocalCopy public var constant: Quaternion @@ -48,7 +46,7 @@ public open class VisualShaderNodeVec4Constant : VisualShaderNodeConstant() { } /** - * A 4D vector (represented as a [godot.Quaternion]) constant which represents the state of this node. + * A 4D vector (represented as a [Quaternion]) constant which represents the state of this node. * * This is a helper function to make dealing with local copies easier. * diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVec4Parameter.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVec4Parameter.kt index 5cc321b23..7d5ae60e9 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVec4Parameter.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVec4Parameter.kt @@ -22,8 +22,6 @@ import kotlin.Suppress import kotlin.Unit /** - * A 4D vector parameter to be used within the visual shader graph. - * * Translated to `uniform vec4` in the shader language. */ @GodotBaseType diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVectorBase.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVectorBase.kt index 02a6e3fe0..dd0c14252 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVectorBase.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVectorBase.kt @@ -18,8 +18,6 @@ import kotlin.Long import kotlin.Suppress /** - * A base type for the nodes that perform vector operations within the visual shader graph. - * * This is an abstract class. See the derived types for descriptions of the possible operations. */ @GodotBaseType diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVectorCompose.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVectorCompose.kt index 05171aa29..4cb58f016 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVectorCompose.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVectorCompose.kt @@ -12,8 +12,6 @@ import kotlin.Int import kotlin.Suppress /** - * Composes a [godot.core.Vector2], [godot.core.Vector3] or 4D vector (represented as a [godot.Quaternion]) from scalars within the visual shader graph. - * * Creates a `vec2`, `vec3` or `vec4` using scalar values that can be provided from separate inputs. */ @GodotBaseType diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVectorDecompose.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVectorDecompose.kt index ed6ac8194..49c21a629 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVectorDecompose.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVectorDecompose.kt @@ -12,9 +12,8 @@ import kotlin.Int import kotlin.Suppress /** - * Decomposes a [godot.core.Vector2], [godot.core.Vector3] or 4D vector (represented as a [godot.Quaternion]) into scalars within the visual shader graph. - * - * Takes a `vec2`, `vec3` or `vec4` and decomposes it into scalar values that can be used as separate outputs. + * Takes a `vec2`, `vec3` or `vec4` and decomposes it into scalar values that can be used as + * separate outputs. */ @GodotBaseType public open class VisualShaderNodeVectorDecompose : VisualShaderNodeVectorBase() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVectorDistance.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVectorDistance.kt index f3566b62d..b01a5132c 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVectorDistance.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVectorDistance.kt @@ -12,10 +12,7 @@ import kotlin.Int import kotlin.Suppress /** - * Returns the distance between two points. To be used within the visual shader graph. - * * Calculates distance from point represented by vector `p0` to vector `p1`. - * * Translated to `distance(p0, p1)` in the shader language. */ @GodotBaseType diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVectorFunc.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVectorFunc.kt index 54408cd36..1bc296218 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVectorFunc.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVectorFunc.kt @@ -18,8 +18,6 @@ import kotlin.Long import kotlin.Suppress /** - * A vector function to be used within the visual shader graph. - * * A visual shader node able to perform different functions using vectors. */ @GodotBaseType @@ -147,7 +145,8 @@ public open class VisualShaderNodeVectorFunc : VisualShaderNodeVectorBase() { */ FUNC_ROUNDEVEN(24), /** - * Extracts the sign of the parameter, i.e. returns `-1` if the parameter is negative, `1` if it's positive and `0` otherwise. + * Extracts the sign of the parameter, i.e. returns `-1` if the parameter is negative, `1` if + * it's positive and `0` otherwise. */ FUNC_SIGN(25), /** @@ -171,7 +170,8 @@ public open class VisualShaderNodeVectorFunc : VisualShaderNodeVectorBase() { */ FUNC_TANH(30), /** - * Returns a value equal to the nearest integer to the parameter whose absolute value is not larger than the absolute value of the parameter. + * Returns a value equal to the nearest integer to the parameter whose absolute value is not + * larger than the absolute value of the parameter. */ FUNC_TRUNC(31), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVectorLen.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVectorLen.kt index 38a957f83..d92d722aa 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVectorLen.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVectorLen.kt @@ -12,8 +12,6 @@ import kotlin.Int import kotlin.Suppress /** - * Returns the length of a [godot.core.Vector3] within the visual shader graph. - * * Translated to `length(p0)` in the shader language. */ @GodotBaseType diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVectorOp.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVectorOp.kt index a8dac1510..596e2a1b5 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVectorOp.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVectorOp.kt @@ -18,8 +18,6 @@ import kotlin.Long import kotlin.Suppress /** - * A vector operator to be used within the visual shader graph. - * * A visual shader node for use of vector operators. Operates on vector `a` and vector `b`. */ @GodotBaseType @@ -67,7 +65,8 @@ public open class VisualShaderNodeVectorOp : VisualShaderNodeVectorBase() { */ OP_MOD(4), /** - * Returns the value of the first parameter raised to the power of the second, for each component of the vectors. + * Returns the value of the first parameter raised to the power of the second, for each + * component of the vectors. */ OP_POW(5), /** @@ -87,7 +86,8 @@ public open class VisualShaderNodeVectorOp : VisualShaderNodeVectorBase() { */ OP_ATAN2(9), /** - * Returns the vector that points in the direction of reflection. `a` is incident vector and `b` is the normal vector. + * Returns the vector that points in the direction of reflection. `a` is incident vector and `b` + * is the normal vector. */ OP_REFLECT(10), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVectorRefract.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVectorRefract.kt index d073f7ef5..939ee09e8 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVectorRefract.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeVectorRefract.kt @@ -12,9 +12,8 @@ import kotlin.Int import kotlin.Suppress /** - * Returns the vector that points in the direction of refraction. For use within the visual shader graph. - * - * Translated to `refract(I, N, eta)` in the shader language, where `I` is the incident vector, `N` is the normal vector and `eta` is the ratio of the indices of the refraction. + * Translated to `refract(I, N, eta)` in the shader language, where `I` is the incident vector, `N` + * is the normal vector and `eta` is the ratio of the indices of the refraction. */ @GodotBaseType public open class VisualShaderNodeVectorRefract : VisualShaderNodeVectorBase() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeWorldPositionFromDepth.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeWorldPositionFromDepth.kt index 837e7431d..9dc42a02e 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeWorldPositionFromDepth.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VisualShaderNodeWorldPositionFromDepth.kt @@ -12,9 +12,8 @@ import kotlin.Int import kotlin.Suppress /** - * A visual shader node that calculates the position of the pixel in world space using the depth texture. - * - * The WorldPositionFromDepth node reconstructs the depth position of the pixel in world space. This can be used to obtain world space UVs for projection mapping like Caustics. + * The WorldPositionFromDepth node reconstructs the depth position of the pixel in world space. This + * can be used to obtain world space UVs for projection mapping like Caustics. */ @GodotBaseType public open class VisualShaderNodeWorldPositionFromDepth : VisualShaderNode() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VoxelGI.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VoxelGI.kt index 6f6bcdf68..33e5eb92c 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VoxelGI.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VoxelGI.kt @@ -26,25 +26,35 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * Real-time global illumination (GI) probe. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/678](https://godotengine.org/asset-library/asset/678) - * - * [godot.VoxelGI]s are used to provide high-quality real-time indirect light and reflections to scenes. They precompute the effect of objects that emit light and the effect of static geometry to simulate the behavior of complex light in real-time. [godot.VoxelGI]s need to be baked before having a visible effect. However, once baked, dynamic objects will receive light from them. Furthermore, lights can be fully dynamic or baked. - * - * **Note:** [godot.VoxelGI] is only supported in the Forward+ rendering method, not Mobile or Compatibility. - * - * **Procedural generation:** [godot.VoxelGI] can be baked in an exported project, which makes it suitable for procedurally generated or user-built levels as long as all the geometry is generated in advance. For games where geometry is generated at any time during gameplay, SDFGI is more suitable (see [godot.Environment.sdfgiEnabled]). - * - * **Performance:** [godot.VoxelGI] is relatively demanding on the GPU and is not suited to low-end hardware such as integrated graphics (consider [godot.LightmapGI] instead). To improve performance, adjust [godot.ProjectSettings.rendering/globalIllumination/voxelGi/quality] and enable [godot.ProjectSettings.rendering/globalIllumination/gi/useHalfResolution] in the Project Settings. To provide a fallback for low-end hardware, consider adding an option to disable [godot.VoxelGI] in your project's options menus. A [godot.VoxelGI] node can be disabled by hiding it. - * - * **Note:** Meshes should have sufficiently thick walls to avoid light leaks (avoid one-sided walls). For interior levels, enclose your level geometry in a sufficiently large box and bridge the loops to close the mesh. To further prevent light leaks, you can also strategically place temporary [godot.MeshInstance3D] nodes with their [godot.GeometryInstance3D.giMode] set to [godot.GeometryInstance3D.GI_MODE_STATIC]. These temporary nodes can then be hidden after baking the [godot.VoxelGI] node. + * [VoxelGI]s are used to provide high-quality real-time indirect light and reflections to scenes. + * They precompute the effect of objects that emit light and the effect of static geometry to simulate + * the behavior of complex light in real-time. [VoxelGI]s need to be baked before having a visible + * effect. However, once baked, dynamic objects will receive light from them. Furthermore, lights can + * be fully dynamic or baked. + * **Note:** [VoxelGI] is only supported in the Forward+ rendering method, not Mobile or + * Compatibility. + * **Procedural generation:** [VoxelGI] can be baked in an exported project, which makes it suitable + * for procedurally generated or user-built levels as long as all the geometry is generated in advance. + * For games where geometry is generated at any time during gameplay, SDFGI is more suitable (see + * [Environment.sdfgiEnabled]). + * **Performance:** [VoxelGI] is relatively demanding on the GPU and is not suited to low-end + * hardware such as integrated graphics (consider [LightmapGI] instead). To improve performance, adjust + * [ProjectSettings.rendering/globalIllumination/voxelGi/quality] and enable + * [ProjectSettings.rendering/globalIllumination/gi/useHalfResolution] in the Project Settings. To + * provide a fallback for low-end hardware, consider adding an option to disable [VoxelGI] in your + * project's options menus. A [VoxelGI] node can be disabled by hiding it. + * **Note:** Meshes should have sufficiently thick walls to avoid light leaks (avoid one-sided + * walls). For interior levels, enclose your level geometry in a sufficiently large box and bridge the + * loops to close the mesh. To further prevent light leaks, you can also strategically place temporary + * [MeshInstance3D] nodes with their [GeometryInstance3D.giMode] set to [constant + * GeometryInstance3D.GI_MODE_STATIC]. These temporary nodes can then be hidden after baking the + * [VoxelGI] node. */ @GodotBaseType public open class VoxelGI : VisualInstance3D() { /** - * Number of times to subdivide the grid that the [godot.VoxelGI] operates on. A higher number results in finer detail and thus higher visual quality, while lower numbers result in better performance. + * Number of times to subdivide the grid that the [VoxelGI] operates on. A higher number results + * in finer detail and thus higher visual quality, while lower numbers result in better performance. */ public var subdiv: Subdiv get() { @@ -58,8 +68,9 @@ public open class VoxelGI : VisualInstance3D() { } /** - * The size of the area covered by the [godot.VoxelGI]. If you make the size larger without increasing the subdivisions with [subdiv], the size of each cell will increase and result in lower detailed lighting. - * + * The size of the area covered by the [VoxelGI]. If you make the size larger without increasing + * the subdivisions with [subdiv], the size of each cell will increase and result in lower detailed + * lighting. * **Note:** Size is clamped to 1.0 unit or more on each axis. */ @CoreTypeLocalCopy @@ -75,7 +86,10 @@ public open class VoxelGI : VisualInstance3D() { } /** - * The [godot.CameraAttributes] resource that specifies exposure levels to bake at. Auto-exposure and non exposure properties will be ignored. Exposure settings should be used to reduce the dynamic range present when baking. If exposure is too high, the [godot.VoxelGI] will have banding artifacts or may have over-exposure artifacts. + * The [CameraAttributes] resource that specifies exposure levels to bake at. Auto-exposure and + * non exposure properties will be ignored. Exposure settings should be used to reduce the dynamic + * range present when baking. If exposure is too high, the [VoxelGI] will have banding artifacts or + * may have over-exposure artifacts. */ public var cameraAttributes: Material? get() { @@ -89,7 +103,7 @@ public open class VoxelGI : VisualInstance3D() { } /** - * The [godot.VoxelGIData] resource that holds the data for this [godot.VoxelGI]. + * The [VoxelGIData] resource that holds the data for this [VoxelGI]. */ public var `data`: VoxelGIData? get() { @@ -108,8 +122,9 @@ public open class VoxelGI : VisualInstance3D() { } /** - * The size of the area covered by the [godot.VoxelGI]. If you make the size larger without increasing the subdivisions with [subdiv], the size of each cell will increase and result in lower detailed lighting. - * + * The size of the area covered by the [VoxelGI]. If you make the size larger without increasing + * the subdivisions with [subdiv], the size of each cell will increase and result in lower detailed + * lighting. * **Note:** Size is clamped to 1.0 unit or more on each axis. * * This is a helper function to make dealing with local copies easier. @@ -134,11 +149,18 @@ public open class VoxelGI : VisualInstance3D() { /** - * Bakes the effect from all [godot.GeometryInstance3D]s marked with [godot.GeometryInstance3D.GI_MODE_STATIC] and [godot.Light3D]s marked with either [godot.Light3D.BAKE_STATIC] or [godot.Light3D.BAKE_DYNAMIC]. If [createVisualDebug] is `true`, after baking the light, this will generate a [godot.MultiMesh] that has a cube representing each solid cell with each cube colored to the cell's albedo color. This can be used to visualize the [godot.VoxelGI]'s data and debug any issues that may be occurring. - * - * **Note:** [bake] works from the editor and in exported projects. This makes it suitable for procedurally generated or user-built levels. Baking a [godot.VoxelGI] node generally takes from 5 to 20 seconds in most scenes. Reducing [subdiv] can speed up baking. - * - * **Note:** [godot.GeometryInstance3D]s and [godot.Light3D]s must be fully ready before [bake] is called. If you are procedurally creating those and some meshes or lights are missing from your baked [godot.VoxelGI], use `call_deferred("bake")` instead of calling [bake] directly. + * Bakes the effect from all [GeometryInstance3D]s marked with [constant + * GeometryInstance3D.GI_MODE_STATIC] and [Light3D]s marked with either [constant + * Light3D.BAKE_STATIC] or [constant Light3D.BAKE_DYNAMIC]. If [param create_visual_debug] is `true`, + * after baking the light, this will generate a [MultiMesh] that has a cube representing each solid + * cell with each cube colored to the cell's albedo color. This can be used to visualize the + * [VoxelGI]'s data and debug any issues that may be occurring. + * **Note:** [bake] works from the editor and in exported projects. This makes it suitable for + * procedurally generated or user-built levels. Baking a [VoxelGI] node generally takes from 5 to 20 + * seconds in most scenes. Reducing [subdiv] can speed up baking. + * **Note:** [GeometryInstance3D]s and [Light3D]s must be fully ready before [bake] is called. If + * you are procedurally creating those and some meshes or lights are missing from your baked + * [VoxelGI], use `call_deferred("bake")` instead of calling [bake] directly. */ @JvmOverloads public fun bake(fromNode: Node? = null, createVisualDebug: Boolean = false): Unit { @@ -158,7 +180,8 @@ public open class VoxelGI : VisualInstance3D() { id: Long, ) { /** - * Use 64 subdivisions. This is the lowest quality setting, but the fastest. Use it if you can, but especially use it on lower-end hardware. + * Use 64 subdivisions. This is the lowest quality setting, but the fastest. Use it if you can, + * but especially use it on lower-end hardware. */ SUBDIV_64(0), /** @@ -170,7 +193,8 @@ public open class VoxelGI : VisualInstance3D() { */ SUBDIV_256(2), /** - * Use 512 subdivisions. This is the highest quality setting, but the slowest. On lower-end hardware, this could cause the GPU to stall. + * Use 512 subdivisions. This is the highest quality setting, but the slowest. On lower-end + * hardware, this could cause the GPU to stall. */ SUBDIV_512(3), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/VoxelGIData.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/VoxelGIData.kt index ede1c9d61..f24ba7464 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/VoxelGIData.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/VoxelGIData.kt @@ -30,19 +30,22 @@ import kotlin.Suppress import kotlin.Unit /** - * Contains baked voxel global illumination data for use in a [godot.VoxelGI] node. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/678](https://godotengine.org/asset-library/asset/678) - * - * [godot.VoxelGIData] contains baked voxel global illumination for use in a [godot.VoxelGI] node. [godot.VoxelGIData] also offers several properties to adjust the final appearance of the global illumination. These properties can be adjusted at run-time without having to bake the [godot.VoxelGI] node again. - * - * **Note:** To prevent text-based scene files (`.tscn`) from growing too much and becoming slow to load and save, always save [godot.VoxelGIData] to an external binary resource file (`.res`) instead of embedding it within the scene. This can be done by clicking the dropdown arrow next to the [godot.VoxelGIData] resource, choosing **Edit**, clicking the floppy disk icon at the top of the Inspector then choosing **Save As...**. + * [VoxelGIData] contains baked voxel global illumination for use in a [VoxelGI] node. [VoxelGIData] + * also offers several properties to adjust the final appearance of the global illumination. These + * properties can be adjusted at run-time without having to bake the [VoxelGI] node again. + * **Note:** To prevent text-based scene files (`.tscn`) from growing too much and becoming slow to + * load and save, always save [VoxelGIData] to an external binary resource file (`.res`) instead of + * embedding it within the scene. This can be done by clicking the dropdown arrow next to the + * [VoxelGIData] resource, choosing **Edit**, clicking the floppy disk icon at the top of the Inspector + * then choosing **Save As...**. */ @GodotBaseType public open class VoxelGIData : Resource() { /** - * The dynamic range to use (`1.0` represents a low dynamic range scene brightness). Higher values can be used to provide brighter indirect lighting, at the cost of more visible color banding in dark areas (both in indirect lighting and reflections). To avoid color banding, it's recommended to use the lowest value that does not result in visible light clipping. + * The dynamic range to use (`1.0` represents a low dynamic range scene brightness). Higher values + * can be used to provide brighter indirect lighting, at the cost of more visible color banding in + * dark areas (both in indirect lighting and reflections). To avoid color banding, it's recommended + * to use the lowest value that does not result in visible light clipping. */ public var dynamicRange: Float get() { @@ -56,7 +59,10 @@ public open class VoxelGIData : Resource() { } /** - * The energy of the indirect lighting and reflections produced by the [godot.VoxelGI] node. Higher values result in brighter indirect lighting. If indirect lighting looks too flat, try decreasing [propagation] while increasing [energy] at the same time. See also [useTwoBounces] which influences the indirect lighting's effective brightness. + * The energy of the indirect lighting and reflections produced by the [VoxelGI] node. Higher + * values result in brighter indirect lighting. If indirect lighting looks too flat, try decreasing + * [propagation] while increasing [energy] at the same time. See also [useTwoBounces] which + * influences the indirect lighting's effective brightness. */ public var energy: Float get() { @@ -70,7 +76,10 @@ public open class VoxelGIData : Resource() { } /** - * The normal bias to use for indirect lighting and reflections. Higher values reduce self-reflections visible in non-rough materials, at the cost of more visible light leaking and flatter-looking indirect lighting. To prioritize hiding self-reflections over lighting quality, set [bias] to `0.0` and [normalBias] to a value between `1.0` and `2.0`. + * The normal bias to use for indirect lighting and reflections. Higher values reduce + * self-reflections visible in non-rough materials, at the cost of more visible light leaking and + * flatter-looking indirect lighting. To prioritize hiding self-reflections over lighting quality, + * set [bias] to `0.0` and [normalBias] to a value between `1.0` and `2.0`. */ public var bias: Float get() { @@ -84,7 +93,10 @@ public open class VoxelGIData : Resource() { } /** - * The normal bias to use for indirect lighting and reflections. Higher values reduce self-reflections visible in non-rough materials, at the cost of more visible light leaking and flatter-looking indirect lighting. See also [bias]. To prioritize hiding self-reflections over lighting quality, set [bias] to `0.0` and [normalBias] to a value between `1.0` and `2.0`. + * The normal bias to use for indirect lighting and reflections. Higher values reduce + * self-reflections visible in non-rough materials, at the cost of more visible light leaking and + * flatter-looking indirect lighting. See also [bias]. To prioritize hiding self-reflections over + * lighting quality, set [bias] to `0.0` and [normalBias] to a value between `1.0` and `2.0`. */ public var normalBias: Float get() { @@ -98,7 +110,10 @@ public open class VoxelGIData : Resource() { } /** - * The multiplier to use when light bounces off a surface. Higher values result in brighter indirect lighting. If indirect lighting looks too flat, try decreasing [propagation] while increasing [energy] at the same time. See also [useTwoBounces] which influences the indirect lighting's effective brightness. + * The multiplier to use when light bounces off a surface. Higher values result in brighter + * indirect lighting. If indirect lighting looks too flat, try decreasing [propagation] while + * increasing [energy] at the same time. See also [useTwoBounces] which influences the indirect + * lighting's effective brightness. */ public var propagation: Float get() { @@ -112,7 +127,10 @@ public open class VoxelGIData : Resource() { } /** - * If `true`, performs two bounces of indirect lighting instead of one. This makes indirect lighting look more natural and brighter at a small performance cost. The second bounce is also visible in reflections. If the scene appears too bright after enabling [useTwoBounces], adjust [propagation] and [energy]. + * If `true`, performs two bounces of indirect lighting instead of one. This makes indirect + * lighting look more natural and brighter at a small performance cost. The second bounce is also + * visible in reflections. If the scene appears too bright after enabling [useTwoBounces], adjust + * [propagation] and [energy]. */ public var useTwoBounces: Boolean get() { @@ -126,7 +144,9 @@ public open class VoxelGIData : Resource() { } /** - * If `true`, [godot.Environment] lighting is ignored by the [godot.VoxelGI] node. If `false`, [godot.Environment] lighting is taken into account by the [godot.VoxelGI] node. [godot.Environment] lighting updates in real-time, which means it can be changed without having to bake the [godot.VoxelGI] node again. + * If `true`, [Environment] lighting is ignored by the [VoxelGI] node. If `false`, [Environment] + * lighting is taken into account by the [VoxelGI] node. [Environment] lighting updates in real-time, + * which means it can be changed without having to bake the [VoxelGI] node again. */ public var interior: Boolean get() { @@ -144,9 +164,6 @@ public open class VoxelGIData : Resource() { return true } - /** - * - */ public fun allocate( toCellXform: Transform3D, aabb: AABB, @@ -161,9 +178,10 @@ public open class VoxelGIData : Resource() { } /** - * Returns the bounds of the baked voxel data as an [AABB], which should match [godot.VoxelGI.size] after being baked (which only contains the size as a [godot.core.Vector3]). - * - * **Note:** If the size was modified without baking the VoxelGI data, then the value of [getBounds] and [godot.VoxelGI.size] will not match. + * Returns the bounds of the baked voxel data as an [AABB], which should match [VoxelGI.size] + * after being baked (which only contains the size as a [Vector3]). + * **Note:** If the size was modified without baking the VoxelGI data, then the value of + * [getBounds] and [VoxelGI.size] will not match. */ public fun getBounds(): AABB { TransferContext.writeArguments() @@ -171,45 +189,30 @@ public open class VoxelGIData : Resource() { return (TransferContext.readReturnValue(godot.core.VariantType.AABB, false) as AABB) } - /** - * - */ public fun getOctreeSize(): Vector3 { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getOctreeSizePtr, VECTOR3) return (TransferContext.readReturnValue(VECTOR3, false) as Vector3) } - /** - * - */ public fun getToCellXform(): Transform3D { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getToCellXformPtr, TRANSFORM3D) return (TransferContext.readReturnValue(TRANSFORM3D, false) as Transform3D) } - /** - * - */ public fun getOctreeCells(): PackedByteArray { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getOctreeCellsPtr, PACKED_BYTE_ARRAY) return (TransferContext.readReturnValue(PACKED_BYTE_ARRAY, false) as PackedByteArray) } - /** - * - */ public fun getDataCells(): PackedByteArray { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getDataCellsPtr, PACKED_BYTE_ARRAY) return (TransferContext.readReturnValue(PACKED_BYTE_ARRAY, false) as PackedByteArray) } - /** - * - */ public fun getLevelCounts(): PackedInt32Array { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getLevelCountsPtr, PACKED_INT_32_ARRAY) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/WeakRef.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/WeakRef.kt index 8bf144b33..d853e5a52 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/WeakRef.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/WeakRef.kt @@ -17,9 +17,13 @@ import kotlin.Int import kotlin.Suppress /** - * Holds an [godot.Object]. If the object is [godot.RefCounted], it doesn't update the reference count. - * - * A weakref can hold a [godot.RefCounted] without contributing to the reference counter. A weakref can be created from an [godot.Object] using [@GlobalScope.weakref]. If this object is not a reference, weakref still works, however, it does not have any effect on the object. Weakrefs are useful in cases where multiple classes have variables that refer to each other. Without weakrefs, using these classes could lead to memory leaks, since both references keep each other from being released. Making part of the variables a weakref can prevent this cyclic dependency, and allows the references to be released. + * A weakref can hold a [RefCounted] without contributing to the reference counter. A weakref can be + * created from an [Object] using [@GlobalScope.weakref]. If this object is not a reference, weakref + * still works, however, it does not have any effect on the object. Weakrefs are useful in cases where + * multiple classes have variables that refer to each other. Without weakrefs, using these classes + * could lead to memory leaks, since both references keep each other from being released. Making part + * of the variables a weakref can prevent this cyclic dependency, and allows the references to be + * released. */ @GodotBaseType public open class WeakRef : RefCounted() { @@ -29,7 +33,8 @@ public open class WeakRef : RefCounted() { } /** - * Returns the [godot.Object] this weakref is referring to. Returns `null` if that object no longer exists. + * Returns the [Object] this weakref is referring to. Returns `null` if that object no longer + * exists. */ public fun getRef(): Any? { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/WebRTCDataChannel.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/WebRTCDataChannel.kt index fcd53d959..0ddb1a1a8 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/WebRTCDataChannel.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/WebRTCDataChannel.kt @@ -24,6 +24,9 @@ import kotlin.Unit @GodotBaseType public open class WebRTCDataChannel internal constructor() : PacketPeer() { + /** + * The transfer mode to use when sending outgoing packet. Either text or binary. + */ public var writeMode: WriteMode get() { TransferContext.writeArguments() @@ -40,71 +43,112 @@ public open class WebRTCDataChannel internal constructor() : PacketPeer() { return true } + /** + * Reserved, but not used for now. + */ public fun poll(): GodotError { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.pollPtr, LONG) return GodotError.from(TransferContext.readReturnValue(LONG) as Long) } + /** + * Closes this data channel, notifying the other peer. + */ public fun close(): Unit { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.closePtr, NIL) } + /** + * Returns `true` if the last received packet was transferred as text. See [writeMode]. + */ public fun wasStringPacket(): Boolean { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.wasStringPacketPtr, BOOL) return (TransferContext.readReturnValue(BOOL, false) as Boolean) } + /** + * Returns the current state of this channel, see [enum ChannelState]. + */ public fun getReadyState(): ChannelState { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getReadyStatePtr, LONG) return WebRTCDataChannel.ChannelState.from(TransferContext.readReturnValue(LONG) as Long) } + /** + * Returns the label assigned to this channel during creation. + */ public fun getLabel(): String { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getLabelPtr, STRING) return (TransferContext.readReturnValue(STRING, false) as String) } + /** + * Returns `true` if this channel was created with ordering enabled (default). + */ public fun isOrdered(): Boolean { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.isOrderedPtr, BOOL) return (TransferContext.readReturnValue(BOOL, false) as Boolean) } + /** + * Returns the ID assigned to this channel during creation (or auto-assigned during negotiation). + * If the channel is not negotiated out-of-band the ID will only be available after the connection + * is established (will return `65535` until then). + */ public fun getId(): Int { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getIdPtr, LONG) return (TransferContext.readReturnValue(LONG, false) as Long).toInt() } + /** + * Returns the `maxPacketLifeTime` value assigned to this channel during creation. + * Will be `65535` if not specified. + */ public fun getMaxPacketLifeTime(): Int { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getMaxPacketLifeTimePtr, LONG) return (TransferContext.readReturnValue(LONG, false) as Long).toInt() } + /** + * Returns the `maxRetransmits` value assigned to this channel during creation. + * Will be `65535` if not specified. + */ public fun getMaxRetransmits(): Int { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getMaxRetransmitsPtr, LONG) return (TransferContext.readReturnValue(LONG, false) as Long).toInt() } + /** + * Returns the sub-protocol assigned to this channel during creation. An empty string if not + * specified. + */ public fun getProtocol(): String { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getProtocolPtr, STRING) return (TransferContext.readReturnValue(STRING, false) as String) } + /** + * Returns `true` if this channel was created with out-of-band configuration. + */ public fun isNegotiated(): Boolean { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.isNegotiatedPtr, BOOL) return (TransferContext.readReturnValue(BOOL, false) as Boolean) } + /** + * Returns the number of bytes currently queued to be sent over this channel. + */ public fun getBufferedAmount(): Int { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getBufferedAmountPtr, LONG) @@ -114,7 +158,15 @@ public open class WebRTCDataChannel internal constructor() : PacketPeer() { public enum class WriteMode( id: Long, ) { + /** + * Tells the channel to send data over this channel as text. An external peer (non-Godot) would + * receive this as a string. + */ WRITE_MODE_TEXT(0), + /** + * Tells the channel to send data over this channel as binary. An external peer (non-Godot) + * would receive this as array buffer or blob. + */ WRITE_MODE_BINARY(1), ; @@ -131,9 +183,22 @@ public open class WebRTCDataChannel internal constructor() : PacketPeer() { public enum class ChannelState( id: Long, ) { + /** + * The channel was created, but it's still trying to connect. + */ STATE_CONNECTING(0), + /** + * The channel is currently open, and data can flow over it. + */ STATE_OPEN(1), + /** + * The channel is being closed, no new messages will be accepted, but those already in queue + * will be flushed. + */ STATE_CLOSING(2), + /** + * The channel was closed, or connection failed. + */ STATE_CLOSED(3), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/WebRTCMultiplayerPeer.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/WebRTCMultiplayerPeer.kt index 5a777ef03..f179fdf3c 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/WebRTCMultiplayerPeer.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/WebRTCMultiplayerPeer.kt @@ -27,6 +27,20 @@ import kotlin.Suppress import kotlin.Unit import kotlin.jvm.JvmOverloads +/** + * This class constructs a full mesh of [WebRTCPeerConnection] (one connection for each peer) that + * can be used as a [MultiplayerAPI.multiplayerPeer]. + * You can add each [WebRTCPeerConnection] via [addPeer] or remove them via [removePeer]. Peers must + * be added in [constant WebRTCPeerConnection.STATE_NEW] state to allow it to create the appropriate + * channels. This class will not create offers nor set descriptions, it will only poll them, and notify + * connections and disconnections. + * When creating the peer via [createClient] or [createServer] the + * [MultiplayerPeer.isServerRelaySupported] method will return `true` enabling peer exchange and packet + * relaying when supported by the [MultiplayerAPI] implementation. + * **Note:** When exporting to Android, make sure to enable the `INTERNET` permission in the Android + * export preset before exporting the project or using one-click deploy. Otherwise, network + * communication of any kind will be blocked by Android. + */ @GodotBaseType public open class WebRTCMultiplayerPeer : MultiplayerPeer() { public override fun new(scriptIndex: Int): Boolean { @@ -34,6 +48,14 @@ public open class WebRTCMultiplayerPeer : MultiplayerPeer() { return true } + /** + * Initialize the multiplayer peer as a server (with unique ID of `1`). This mode enables + * [MultiplayerPeer.isServerRelaySupported], allowing the upper [MultiplayerAPI] layer to perform + * peer exchange and packet relaying. + * You can optionally specify a [param channels_config] array of [enum + * MultiplayerPeer.TransferMode] which will be used to create extra channels (WebRTC only supports + * one transfer mode per channel). + */ @JvmOverloads public fun createServer(channelsConfig: VariantArray = godot.core.variantArrayOf()): GodotError { @@ -42,6 +64,15 @@ public open class WebRTCMultiplayerPeer : MultiplayerPeer() { return GodotError.from(TransferContext.readReturnValue(LONG) as Long) } + /** + * Initialize the multiplayer peer as a client with the given [param peer_id] (must be between 2 + * and 2147483647). In this mode, you should only call [addPeer] once and with [param peer_id] of + * `1`. This mode enables [MultiplayerPeer.isServerRelaySupported], allowing the upper + * [MultiplayerAPI] layer to perform peer exchange and packet relaying. + * You can optionally specify a [param channels_config] array of [enum + * MultiplayerPeer.TransferMode] which will be used to create extra channels (WebRTC only supports + * one transfer mode per channel). + */ @JvmOverloads public fun createClient(peerId: Int, channelsConfig: VariantArray = godot.core.variantArrayOf()): GodotError { @@ -50,6 +81,10 @@ public open class WebRTCMultiplayerPeer : MultiplayerPeer() { return GodotError.from(TransferContext.readReturnValue(LONG) as Long) } + /** + * Initialize the multiplayer peer as a mesh (i.e. all peers connect to each other) with the given + * [param peer_id] (must be between 1 and 2147483647). + */ @JvmOverloads public fun createMesh(peerId: Int, channelsConfig: VariantArray = godot.core.variantArrayOf()): GodotError { @@ -58,6 +93,13 @@ public open class WebRTCMultiplayerPeer : MultiplayerPeer() { return GodotError.from(TransferContext.readReturnValue(LONG) as Long) } + /** + * Add a new peer to the mesh with the given [param peer_id]. The [WebRTCPeerConnection] must be + * in state [constant WebRTCPeerConnection.STATE_NEW]. + * Three channels will be created for reliable, unreliable, and ordered transport. The value of + * [param unreliable_lifetime] will be passed to the `"maxPacketLifetime"` option when creating + * unreliable and ordered channels (see [WebRTCPeerConnection.createDataChannel]). + */ @JvmOverloads public fun addPeer( peer: WebRTCPeerConnection, @@ -69,23 +111,42 @@ public open class WebRTCMultiplayerPeer : MultiplayerPeer() { return GodotError.from(TransferContext.readReturnValue(LONG) as Long) } + /** + * Remove the peer with given [param peer_id] from the mesh. If the peer was connected, and + * [signal MultiplayerPeer.peer_connected] was emitted for it, then [signal + * MultiplayerPeer.peer_disconnected] will be emitted. + */ public fun removePeer(peerId: Int): Unit { TransferContext.writeArguments(LONG to peerId.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.removePeerPtr, NIL) } + /** + * Returns `true` if the given [param peer_id] is in the peers map (it might not be connected + * though). + */ public fun hasPeer(peerId: Int): Boolean { TransferContext.writeArguments(LONG to peerId.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.hasPeerPtr, BOOL) return (TransferContext.readReturnValue(BOOL, false) as Boolean) } + /** + * Returns a dictionary representation of the peer with given [param peer_id] with three keys. + * `"connection"` containing the [WebRTCPeerConnection] to this peer, `"channels"` an array of three + * [WebRTCDataChannel], and `"connected"` a boolean representing if the peer connection is currently + * connected (all three channels are open). + */ public fun getPeer(peerId: Int): Dictionary { TransferContext.writeArguments(LONG to peerId.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.getPeerPtr, DICTIONARY) return (TransferContext.readReturnValue(DICTIONARY, false) as Dictionary) } + /** + * Returns a dictionary which keys are the peer ids and values the peer representation as in + * [getPeer]. + */ public fun getPeers(): Dictionary { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getPeersPtr, DICTIONARY) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/WebRTCPeerConnection.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/WebRTCPeerConnection.kt index 2569db60c..125bf3765 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/WebRTCPeerConnection.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/WebRTCPeerConnection.kt @@ -32,12 +32,39 @@ import kotlin.Suppress import kotlin.Unit import kotlin.jvm.JvmOverloads +/** + * A WebRTC connection between the local computer and a remote peer. Provides an interface to + * connect, maintain and monitor the connection. + * Setting up a WebRTC connection between two peers may not seem a trivial task, but it can be + * broken down into 3 main steps: + * - The peer that wants to initiate the connection (`A` from now on) creates an offer and send it + * to the other peer (`B` from now on). + * - `B` receives the offer, generate and answer, and sends it to `A`). + * - `A` and `B` then generates and exchange ICE candidates with each other. + * After these steps, the connection should become connected. Keep on reading or look into the + * tutorial for more information. + */ @GodotBaseType public open class WebRTCPeerConnection : RefCounted() { + /** + * Emitted after a successful call to [createOffer] or [setRemoteDescription] (when it generates + * an answer). The parameters are meant to be passed to [setLocalDescription] on this object, and + * sent to the remote peer over the signaling server. + */ public val sessionDescriptionCreated: Signal2 by signal("type", "sdp") + /** + * Emitted when a new ICE candidate has been created. The three parameters are meant to be passed + * to the remote peer over the signaling server. + */ public val iceCandidateCreated: Signal3 by signal("media", "index", "name") + /** + * Emitted when a new in-band channel is received, i.e. when the channel was created with + * `negotiated: false` (default). + * The object will be an instance of [WebRTCDataChannel]. You must keep a reference of it or it + * will be closed automatically. See [createDataChannel]. + */ public val dataChannelReceived: Signal1 by signal("channel") public override fun new(scriptIndex: Int): Boolean { @@ -45,6 +72,26 @@ public open class WebRTCPeerConnection : RefCounted() { return true } + /** + * Re-initialize this peer connection, closing any previously active connection, and going back to + * state [constant STATE_NEW]. A dictionary of [param configuration] options can be passed to + * configure the peer connection. + * Valid [param configuration] options are: + * [codeblock] + * { + * "iceServers": [ + * { + * "urls": [ "stun:stun.example.com:3478" ], # One or more STUN servers. + * }, + * { + * "urls": [ "turn:turn.example.com:3478" ], # One or more TURN servers. + * "username": "a_username", # Optional username for the TURN server. + * "credential": "a_password", # Optional password for the TURN server. + * } + * ] + * } + * [/codeblock] + */ @JvmOverloads public fun initialize(configuration: Dictionary = Dictionary()): GodotError { TransferContext.writeArguments(DICTIONARY to configuration) @@ -52,6 +99,37 @@ public open class WebRTCPeerConnection : RefCounted() { return GodotError.from(TransferContext.readReturnValue(LONG) as Long) } + /** + * Returns a new [WebRTCDataChannel] (or `null` on failure) with given [param label] and + * optionally configured via the [param options] dictionary. This method can only be called when the + * connection is in state [constant STATE_NEW]. + * There are two ways to create a working data channel: either call [createDataChannel] on only + * one of the peer and listen to [signal data_channel_received] on the other, or call + * [createDataChannel] on both peers, with the same values, and the `"negotiated"` option set to + * `true`. + * Valid [param options] are: + * [codeblock] + * { + * "negotiated": true, # When set to true (default off), means the channel is negotiated out + * of band. "id" must be set too. "data_channel_received" will not be called. + * "id": 1, # When "negotiated" is true this value must also be set to the same value on both + * peer. + * + * # Only one of maxRetransmits and maxPacketLifeTime can be specified, not both. They make + * the channel unreliable (but also better at real time). + * "maxRetransmits": 1, # Specify the maximum number of attempt the peer will make to + * retransmits packets if they are not acknowledged. + * "maxPacketLifeTime": 100, # Specify the maximum amount of time before giving up + * retransmitions of unacknowledged packets (in milliseconds). + * "ordered": true, # When in unreliable mode (i.e. either "maxRetransmits" or + * "maxPacketLifetime" is set), "ordered" (true by default) specify if packet ordering is to be + * enforced. + * + * "protocol": "my-custom-protocol", # A custom sub-protocol string for this channel. + * } + * [/codeblock] + * **Note:** You must keep a reference to channels created this way, or it will be closed. + */ @JvmOverloads public fun createDataChannel(label: String, options: Dictionary = Dictionary()): WebRTCDataChannel? { @@ -60,24 +138,47 @@ public open class WebRTCPeerConnection : RefCounted() { return (TransferContext.readReturnValue(OBJECT, true) as WebRTCDataChannel?) } + /** + * Creates a new SDP offer to start a WebRTC connection with a remote peer. At least one + * [WebRTCDataChannel] must have been created before calling this method. + * If this functions returns [constant OK], [signal session_description_created] will be called + * when the session is ready to be sent. + */ public fun createOffer(): GodotError { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.createOfferPtr, LONG) return GodotError.from(TransferContext.readReturnValue(LONG) as Long) } + /** + * Sets the SDP description of the local peer. This should be called in response to [signal + * session_description_created]. + * After calling this function the peer will start emitting [signal ice_candidate_created] (unless + * an [enum Error] different from [constant OK] is returned). + */ public fun setLocalDescription(type: String, sdp: String): GodotError { TransferContext.writeArguments(STRING to type, STRING to sdp) TransferContext.callMethod(rawPtr, MethodBindings.setLocalDescriptionPtr, LONG) return GodotError.from(TransferContext.readReturnValue(LONG) as Long) } + /** + * Sets the SDP description of the remote peer. This should be called with the values generated by + * a remote peer and received over the signaling server. + * If [param type] is `"offer"` the peer will emit [signal session_description_created] with the + * appropriate answer. + * If [param type] is `"answer"` the peer will start emitting [signal ice_candidate_created]. + */ public fun setRemoteDescription(type: String, sdp: String): GodotError { TransferContext.writeArguments(STRING to type, STRING to sdp) TransferContext.callMethod(rawPtr, MethodBindings.setRemoteDescriptionPtr, LONG) return GodotError.from(TransferContext.readReturnValue(LONG) as Long) } + /** + * Add an ice candidate generated by a remote peer (and received over the signaling server). See + * [signal ice_candidate_created]. + */ public fun addIceCandidate( media: String, index: Int, @@ -88,29 +189,48 @@ public open class WebRTCPeerConnection : RefCounted() { return GodotError.from(TransferContext.readReturnValue(LONG) as Long) } + /** + * Call this method frequently (e.g. in [Node.Process] or [Node.PhysicsProcess]) to properly + * receive signals. + */ public fun poll(): GodotError { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.pollPtr, LONG) return GodotError.from(TransferContext.readReturnValue(LONG) as Long) } + /** + * Close the peer connection and all data channels associated with it. + * **Note:** You cannot reuse this object for a new connection unless you call [initialize]. + */ public fun close(): Unit { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.closePtr, NIL) } + /** + * Returns the connection state. See [enum ConnectionState]. + */ public fun getConnectionState(): ConnectionState { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getConnectionStatePtr, LONG) return WebRTCPeerConnection.ConnectionState.from(TransferContext.readReturnValue(LONG) as Long) } + /** + * Returns the ICE [enum GatheringState] of the connection. This lets you detect, for example, + * when collection of ICE candidates has finished. + */ public fun getGatheringState(): GatheringState { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getGatheringStatePtr, LONG) return WebRTCPeerConnection.GatheringState.from(TransferContext.readReturnValue(LONG) as Long) } + /** + * Returns the [enum SignalingState] on the local end of the connection while connecting or + * reconnecting to another peer. + */ public fun getSignalingState(): SignalingState { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getSignalingStatePtr, LONG) @@ -120,11 +240,29 @@ public open class WebRTCPeerConnection : RefCounted() { public enum class ConnectionState( id: Long, ) { + /** + * The connection is new, data channels and an offer can be created in this state. + */ STATE_NEW(0), + /** + * The peer is connecting, ICE is in progress, none of the transports has failed. + */ STATE_CONNECTING(1), + /** + * The peer is connected, all ICE transports are connected. + */ STATE_CONNECTED(2), + /** + * At least one ICE transport is disconnected. + */ STATE_DISCONNECTED(3), + /** + * One or more of the ICE transports failed. + */ STATE_FAILED(4), + /** + * The peer connection is closed (after calling [close] for example). + */ STATE_CLOSED(5), ; @@ -141,8 +279,19 @@ public open class WebRTCPeerConnection : RefCounted() { public enum class GatheringState( id: Long, ) { + /** + * The peer connection was just created and hasn't done any networking yet. + */ GATHERING_STATE_NEW(0), + /** + * The ICE agent is in the process of gathering candidates for the connection. + */ GATHERING_STATE_GATHERING(1), + /** + * The ICE agent has finished gathering candidates. If something happens that requires + * collecting new candidates, such as a new interface being added or the addition of a new ICE + * server, the state will revert to gathering to gather those candidates. + */ GATHERING_STATE_COMPLETE(2), ; @@ -159,11 +308,37 @@ public open class WebRTCPeerConnection : RefCounted() { public enum class SignalingState( id: Long, ) { + /** + * There is no ongoing exchange of offer and answer underway. This may mean that the + * [WebRTCPeerConnection] is new ([constant STATE_NEW]) or that negotiation is complete and a + * connection has been established ([constant STATE_CONNECTED]). + */ SIGNALING_STATE_STABLE(0), + /** + * The local peer has called [setLocalDescription], passing in SDP representing an offer + * (usually created by calling [createOffer]), and the offer has been applied successfully. + */ SIGNALING_STATE_HAVE_LOCAL_OFFER(1), + /** + * The remote peer has created an offer and used the signaling server to deliver it to the local + * peer, which has set the offer as the remote description by calling [setRemoteDescription]. + */ SIGNALING_STATE_HAVE_REMOTE_OFFER(2), + /** + * The offer sent by the remote peer has been applied and an answer has been created and applied + * by calling [setLocalDescription]. This provisional answer describes the supported media formats + * and so forth, but may not have a complete set of ICE candidates included. Further candidates + * will be delivered separately later. + */ SIGNALING_STATE_HAVE_LOCAL_PRANSWER(3), + /** + * A provisional answer has been received and successfully applied in response to an offer + * previously sent and established by calling [setLocalDescription]. + */ SIGNALING_STATE_HAVE_REMOTE_PRANSWER(4), + /** + * The [WebRTCPeerConnection] has been closed. + */ SIGNALING_STATE_CLOSED(5), ; @@ -178,6 +353,10 @@ public open class WebRTCPeerConnection : RefCounted() { } public companion object { + /** + * Sets the [param extension_class] as the default [WebRTCPeerConnectionExtension] returned when + * creating a new [WebRTCPeerConnection]. + */ public fun setDefaultExtension(extensionClass: StringName): Unit { TransferContext.writeArguments(STRING_NAME to extensionClass) TransferContext.callMethod(0, MethodBindings.setDefaultExtensionPtr, NIL) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/WebSocketMultiplayerPeer.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/WebSocketMultiplayerPeer.kt index 6c6eb504c..e5ad7fa79 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/WebSocketMultiplayerPeer.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/WebSocketMultiplayerPeer.kt @@ -27,8 +27,18 @@ import kotlin.String import kotlin.Suppress import kotlin.jvm.JvmOverloads +/** + * Base class for WebSocket server and client, allowing them to be used as multiplayer peer for the + * [MultiplayerAPI]. + * **Note:** When exporting to Android, make sure to enable the `INTERNET` permission in the Android + * export preset before exporting the project or using one-click deploy. Otherwise, network + * communication of any kind will be blocked by Android. + */ @GodotBaseType public open class WebSocketMultiplayerPeer : MultiplayerPeer() { + /** + * The supported WebSocket sub-protocols. See [WebSocketPeer.supportedProtocols] for more details. + */ public var supportedProtocols: PackedStringArray get() { TransferContext.writeArguments() @@ -41,6 +51,10 @@ public open class WebSocketMultiplayerPeer : MultiplayerPeer() { TransferContext.callMethod(rawPtr, MethodBindings.setSupportedProtocolsPtr, NIL) } + /** + * The extra headers to use during handshake. See [WebSocketPeer.handshakeHeaders] for more + * details. + */ public var handshakeHeaders: PackedStringArray get() { TransferContext.writeArguments() @@ -52,6 +66,10 @@ public open class WebSocketMultiplayerPeer : MultiplayerPeer() { TransferContext.callMethod(rawPtr, MethodBindings.setHandshakeHeadersPtr, NIL) } + /** + * The inbound buffer size for connected peers. See [WebSocketPeer.inboundBufferSize] for more + * details. + */ public var inboundBufferSize: Int get() { TransferContext.writeArguments() @@ -63,6 +81,10 @@ public open class WebSocketMultiplayerPeer : MultiplayerPeer() { TransferContext.callMethod(rawPtr, MethodBindings.setInboundBufferSizePtr, NIL) } + /** + * The outbound buffer size for connected peers. See [WebSocketPeer.outboundBufferSize] for more + * details. + */ public var outboundBufferSize: Int get() { TransferContext.writeArguments() @@ -74,6 +96,9 @@ public open class WebSocketMultiplayerPeer : MultiplayerPeer() { TransferContext.callMethod(rawPtr, MethodBindings.setOutboundBufferSizePtr, NIL) } + /** + * The maximum time each peer can stay in a connecting state before being dropped. + */ public var handshakeTimeout: Float get() { TransferContext.writeArguments() @@ -85,6 +110,10 @@ public open class WebSocketMultiplayerPeer : MultiplayerPeer() { TransferContext.callMethod(rawPtr, MethodBindings.setHandshakeTimeoutPtr, NIL) } + /** + * The maximum number of queued packets for connected peers. See [WebSocketPeer.maxQueuedPackets] + * for more details. + */ public var maxQueuedPackets: Int get() { TransferContext.writeArguments() @@ -101,6 +130,14 @@ public open class WebSocketMultiplayerPeer : MultiplayerPeer() { return true } + /** + * Starts a new multiplayer client connecting to the given [param url]. TLS certificates will be + * verified against the hostname when connecting using the `wss://` protocol. You can pass the + * optional [param tls_client_options] parameter to customize the trusted certification authorities, + * or disable the common name verification. See [TLSOptions.client] and [TLSOptions.clientUnsafe]. + * **Note:** It is recommended to specify the scheme part of the URL, i.e. the [param url] should + * start with either `ws://` or `wss://`. + */ @JvmOverloads public fun createClient(url: String, tlsClientOptions: TLSOptions? = null): GodotError { TransferContext.writeArguments(STRING to url, OBJECT to tlsClientOptions) @@ -108,6 +145,11 @@ public open class WebSocketMultiplayerPeer : MultiplayerPeer() { return GodotError.from(TransferContext.readReturnValue(LONG) as Long) } + /** + * Starts a new multiplayer server listening on the given [param port]. You can optionally specify + * a [param bind_address], and provide valid [param tls_server_options] to use TLS. See + * [TLSOptions.server]. + */ @JvmOverloads public fun createServer( port: Int, @@ -119,18 +161,27 @@ public open class WebSocketMultiplayerPeer : MultiplayerPeer() { return GodotError.from(TransferContext.readReturnValue(LONG) as Long) } + /** + * Returns the [WebSocketPeer] associated to the given [param peer_id]. + */ public fun getPeer(peerId: Int): WebSocketPeer? { TransferContext.writeArguments(LONG to peerId.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.getPeerPtr, OBJECT) return (TransferContext.readReturnValue(OBJECT, true) as WebSocketPeer?) } + /** + * Returns the IP address of the given peer. + */ public fun getPeerAddress(id: Int): String { TransferContext.writeArguments(LONG to id.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.getPeerAddressPtr, STRING) return (TransferContext.readReturnValue(STRING, false) as String) } + /** + * Returns the remote port of the given peer. + */ public fun getPeerPort(id: Int): Int { TransferContext.writeArguments(LONG to id.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.getPeerPortPtr, LONG) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/WebSocketPeer.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/WebSocketPeer.kt index d862dc51e..fc14df34a 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/WebSocketPeer.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/WebSocketPeer.kt @@ -28,8 +28,49 @@ import kotlin.Suppress import kotlin.Unit import kotlin.jvm.JvmOverloads +/** + * This class represents WebSocket connection, and can be used as a WebSocket client (RFC + * 6455-compliant) or as a remote peer of a WebSocket server. + * You can send WebSocket binary frames using [PacketPeer.putPacket], and WebSocket text frames + * using [send] (prefer text frames when interacting with text-based API). You can check the frame type + * of the last packet via [wasStringPacket]. + * To start a WebSocket client, first call [connectToUrl], then regularly call [poll] (e.g. during + * [Node] process). You can query the socket state via [getReadyState], get the number of pending + * packets using [PacketPeer.getAvailablePacketCount], and retrieve them via [PacketPeer.getPacket]. + * + * gdscript: + * ```gdscript + * extends Node + * + * var socket = WebSocketPeer.new() + * + * func _ready(): + * socket.connect_to_url("wss://example.com") + * + * func _process(delta): + * socket.poll() + * var state = socket.get_ready_state() + * if state == WebSocketPeer.STATE_OPEN: + * while socket.get_available_packet_count(): + * print("Packet: ", socket.get_packet()) + * elif state == WebSocketPeer.STATE_CLOSING: + * # Keep polling to achieve proper close. + * pass + * elif state == WebSocketPeer.STATE_CLOSED: + * var code = socket.get_close_code() + * var reason = socket.get_close_reason() + * print("WebSocket closed with code: %d, reason %s. Clean: %s" % [code, + * reason, code != -1]) + * set_process(false) # Stop processing. + * ``` + * + * To use the peer as part of a WebSocket server refer to [acceptStream] and the online tutorial. + */ @GodotBaseType public open class WebSocketPeer : PacketPeer() { + /** + * The WebSocket sub-protocols allowed during the WebSocket handshake. + */ public var supportedProtocols: PackedStringArray get() { TransferContext.writeArguments() @@ -42,6 +83,10 @@ public open class WebSocketPeer : PacketPeer() { TransferContext.callMethod(rawPtr, MethodBindings.setSupportedProtocolsPtr, NIL) } + /** + * The extra HTTP headers to be sent during the WebSocket handshake. + * **Note:** Not supported in Web exports due to browsers' restrictions. + */ public var handshakeHeaders: PackedStringArray get() { TransferContext.writeArguments() @@ -53,6 +98,10 @@ public open class WebSocketPeer : PacketPeer() { TransferContext.callMethod(rawPtr, MethodBindings.setHandshakeHeadersPtr, NIL) } + /** + * The size of the input buffer in bytes (roughly the maximum amount of memory that will be + * allocated for the inbound packets). + */ public var inboundBufferSize: Int get() { TransferContext.writeArguments() @@ -64,6 +113,10 @@ public open class WebSocketPeer : PacketPeer() { TransferContext.callMethod(rawPtr, MethodBindings.setInboundBufferSizePtr, NIL) } + /** + * The size of the input buffer in bytes (roughly the maximum amount of memory that will be + * allocated for the outbound packets). + */ public var outboundBufferSize: Int get() { TransferContext.writeArguments() @@ -75,6 +128,9 @@ public open class WebSocketPeer : PacketPeer() { TransferContext.callMethod(rawPtr, MethodBindings.setOutboundBufferSizePtr, NIL) } + /** + * The maximum amount of packets that will be allowed in the queues (both inbound and outbound). + */ public var maxQueuedPackets: Int get() { TransferContext.writeArguments() @@ -91,6 +147,16 @@ public open class WebSocketPeer : PacketPeer() { return true } + /** + * Connects to the given URL. TLS certificates will be verified against the hostname when + * connecting using the `wss://` protocol. You can pass the optional [param tls_client_options] + * parameter to customize the trusted certification authorities, or disable the common name + * verification. See [TLSOptions.client] and [TLSOptions.clientUnsafe]. + * **Note:** To avoid mixed content warnings or errors in Web, you may have to use a [param url] + * that starts with `wss://` (secure) instead of `ws://`. When doing so, make sure to use the fully + * qualified domain name that matches the one defined in the server's TLS certificate. Do not connect + * directly via the IP address for `wss://` connections, as it won't match with the TLS certificate. + */ @JvmOverloads public fun connectToUrl(url: String, tlsClientOptions: TLSOptions? = null): GodotError { TransferContext.writeArguments(STRING to url, OBJECT to tlsClientOptions) @@ -98,12 +164,22 @@ public open class WebSocketPeer : PacketPeer() { return GodotError.from(TransferContext.readReturnValue(LONG) as Long) } + /** + * Accepts a peer connection performing the HTTP handshake as a WebSocket server. The [param + * stream] must be a valid TCP stream retrieved via [TCPServer.takeConnection], or a TLS stream + * accepted via [StreamPeerTLS.acceptStream]. + * **Note:** Not supported in Web exports due to browsers' restrictions. + */ public fun acceptStream(stream: StreamPeer): GodotError { TransferContext.writeArguments(OBJECT to stream) TransferContext.callMethod(rawPtr, MethodBindings.acceptStreamPtr, LONG) return GodotError.from(TransferContext.readReturnValue(LONG) as Long) } + /** + * Sends the given [param message] using the desired [param write_mode]. When sending a [String], + * prefer using [sendText]. + */ @JvmOverloads public fun send(message: PackedByteArray, writeMode: WriteMode = WebSocketPeer.WriteMode.WRITE_MODE_BINARY): GodotError { @@ -112,76 +188,134 @@ public open class WebSocketPeer : PacketPeer() { return GodotError.from(TransferContext.readReturnValue(LONG) as Long) } + /** + * Sends the given [param message] using WebSocket text mode. Prefer this method over + * [PacketPeer.putPacket] when interacting with third-party text-based API (e.g. when using [JSON] + * formatted messages). + */ public fun sendText(message: String): GodotError { TransferContext.writeArguments(STRING to message) TransferContext.callMethod(rawPtr, MethodBindings.sendTextPtr, LONG) return GodotError.from(TransferContext.readReturnValue(LONG) as Long) } + /** + * Returns `true` if the last received packet was sent as a text payload. See [enum WriteMode]. + */ public fun wasStringPacket(): Boolean { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.wasStringPacketPtr, BOOL) return (TransferContext.readReturnValue(BOOL, false) as Boolean) } + /** + * Updates the connection state and receive incoming packets. Call this function regularly to keep + * it in a clean state. + */ public fun poll(): Unit { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.pollPtr, NIL) } + /** + * Closes this WebSocket connection. [param code] is the status code for the closure (see RFC 6455 + * section 7.4 for a list of valid status codes). [param reason] is the human readable reason for + * closing the connection (can be any UTF-8 string that's smaller than 123 bytes). If [param code] is + * negative, the connection will be closed immediately without notifying the remote peer. + * **Note:** To achieve a clean close, you will need to keep polling until [constant STATE_CLOSED] + * is reached. + * **Note:** The Web export might not support all status codes. Please refer to browser-specific + * documentation for more details. + */ @JvmOverloads public fun close(code: Int = 1000, reason: String = ""): Unit { TransferContext.writeArguments(LONG to code.toLong(), STRING to reason) TransferContext.callMethod(rawPtr, MethodBindings.closePtr, NIL) } + /** + * Returns the IP address of the connected peer. + * **Note:** Not available in the Web export. + */ public fun getConnectedHost(): String { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getConnectedHostPtr, STRING) return (TransferContext.readReturnValue(STRING, false) as String) } + /** + * Returns the remote port of the connected peer. + * **Note:** Not available in the Web export. + */ public fun getConnectedPort(): Int { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getConnectedPortPtr, LONG) return (TransferContext.readReturnValue(LONG, false) as Long).toInt() } + /** + * Returns the selected WebSocket sub-protocol for this connection or an empty string if the + * sub-protocol has not been selected yet. + */ public fun getSelectedProtocol(): String { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getSelectedProtocolPtr, STRING) return (TransferContext.readReturnValue(STRING, false) as String) } + /** + * Returns the URL requested by this peer. The URL is derived from the `url` passed to + * [connectToUrl] or from the HTTP headers when acting as server (i.e. when using [acceptStream]). + */ public fun getRequestedUrl(): String { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getRequestedUrlPtr, STRING) return (TransferContext.readReturnValue(STRING, false) as String) } + /** + * Disable Nagle's algorithm on the underling TCP socket (default). See [StreamPeerTCP.setNoDelay] + * for more information. + * **Note:** Not available in the Web export. + */ public fun setNoDelay(enabled: Boolean): Unit { TransferContext.writeArguments(BOOL to enabled) TransferContext.callMethod(rawPtr, MethodBindings.setNoDelayPtr, NIL) } + /** + * Returns the current amount of data in the outbound websocket buffer. **Note:** Web exports use + * WebSocket.bufferedAmount, while other platforms use an internal buffer. + */ public fun getCurrentOutboundBufferedAmount(): Int { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getCurrentOutboundBufferedAmountPtr, LONG) return (TransferContext.readReturnValue(LONG, false) as Long).toInt() } + /** + * Returns the ready state of the connection. See [enum State]. + */ public fun getReadyState(): State { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getReadyStatePtr, LONG) return WebSocketPeer.State.from(TransferContext.readReturnValue(LONG) as Long) } + /** + * Returns the received WebSocket close frame status code, or `-1` when the connection was not + * cleanly closed. Only call this method when [getReadyState] returns [constant STATE_CLOSED]. + */ public fun getCloseCode(): Int { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getCloseCodePtr, LONG) return (TransferContext.readReturnValue(LONG, false) as Long).toInt() } + /** + * Returns the received WebSocket close frame status reason string. Only call this method when + * [getReadyState] returns [constant STATE_CLOSED]. + */ public fun getCloseReason(): String { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getCloseReasonPtr, STRING) @@ -191,7 +325,15 @@ public open class WebSocketPeer : PacketPeer() { public enum class WriteMode( id: Long, ) { + /** + * Specifies that WebSockets messages should be transferred as text payload (only valid UTF-8 is + * allowed). + */ WRITE_MODE_TEXT(0), + /** + * Specifies that WebSockets messages should be transferred as binary payload (any byte + * combination is allowed). + */ WRITE_MODE_BINARY(1), ; @@ -208,9 +350,22 @@ public open class WebSocketPeer : PacketPeer() { public enum class State( id: Long, ) { + /** + * Socket has been created. The connection is not yet open. + */ STATE_CONNECTING(0), + /** + * The connection is open and ready to communicate. + */ STATE_OPEN(1), + /** + * The connection is in the process of closing. This means a close request has been sent to the + * remote peer but confirmation has not been received. + */ STATE_CLOSING(2), + /** + * The connection is closed or couldn't be opened. + */ STATE_CLOSED(3), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/WebXRInterface.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/WebXRInterface.kt index a537118f3..b2a4edc6d 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/WebXRInterface.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/WebXRInterface.kt @@ -32,34 +32,203 @@ import kotlin.String import kotlin.Suppress import kotlin.Unit +/** + * WebXR is an open standard that allows creating VR and AR applications that run in the web + * browser. + * As such, this interface is only available when running in Web exports. + * WebXR supports a wide range of devices, from the very capable (like Valve Index, HTC Vive, Oculus + * Rift and Quest) down to the much less capable (like Google Cardboard, Oculus Go, GearVR, or plain + * smartphones). + * Since WebXR is based on JavaScript, it makes extensive use of callbacks, which means that + * [WebXRInterface] is forced to use signals, where other XR interfaces would instead use functions + * that return a result immediately. This makes [WebXRInterface] quite a bit more complicated to + * initialize than other XR interfaces. + * Here's the minimum code required to start an immersive VR session: + * [codeblock] + * extends Node3D + * + * var webxr_interface + * var vr_supported = false + * + * func _ready(): + * # We assume this node has a button as a child. + * # This button is for the user to consent to entering immersive VR mode. + * $Button.pressed.connect(self._on_button_pressed) + * + * webxr_interface = XRServer.find_interface("WebXR") + * if webxr_interface: + * # WebXR uses a lot of asynchronous callbacks, so we connect to various + * # signals in order to receive them. + * webxr_interface.session_supported.connect(self._webxr_session_supported) + * webxr_interface.session_started.connect(self._webxr_session_started) + * webxr_interface.session_ended.connect(self._webxr_session_ended) + * webxr_interface.session_failed.connect(self._webxr_session_failed) + * + * # This returns immediately - our _webxr_session_supported() method + * # (which we connected to the "session_supported" signal above) will + * # be called sometime later to let us know if it's supported or not. + * webxr_interface.is_session_supported("immersive-vr") + * + * func _webxr_session_supported(session_mode, supported): + * if session_mode == 'immersive-vr': + * vr_supported = supported + * + * func _on_button_pressed(): + * if not vr_supported: + * OS.alert("Your browser doesn't support VR") + * return + * + * # We want an immersive VR session, as opposed to AR ('immersive-ar') or a + * # simple 3DoF viewer ('viewer'). + * webxr_interface.session_mode = 'immersive-vr' + * # 'bounded-floor' is room scale, 'local-floor' is a standing or sitting + * # experience (it puts you 1.6m above the ground if you have 3DoF headset), + * # whereas as 'local' puts you down at the XROrigin. + * # This list means it'll first try to request 'bounded-floor', then + * # fallback on 'local-floor' and ultimately 'local', if nothing else is + * # supported. + * webxr_interface.requested_reference_space_types = 'bounded-floor, local-floor, local' + * # In order to use 'local-floor' or 'bounded-floor' we must also + * # mark the features as required or optional. + * webxr_interface.required_features = 'local-floor' + * webxr_interface.optional_features = 'bounded-floor' + * + * # This will return false if we're unable to even request the session, + * # however, it can still fail asynchronously later in the process, so we + * # only know if it's really succeeded or failed when our + * # _webxr_session_started() or _webxr_session_failed() methods are called. + * if not webxr_interface.initialize(): + * OS.alert("Failed to initialize") + * return + * + * func _webxr_session_started(): + * $Button.visible = false + * # This tells Godot to start rendering to the headset. + * get_viewport().use_xr = true + * # This will be the reference space type you ultimately got, out of the + * # types that you requested above. This is useful if you want the game to + * # work a little differently in 'bounded-floor' versus 'local-floor'. + * print ("Reference space type: " + webxr_interface.reference_space_type) + * + * func _webxr_session_ended(): + * $Button.visible = true + * # If the user exits immersive mode, then we tell Godot to render to the web + * # page again. + * get_viewport().use_xr = false + * + * func _webxr_session_failed(message): + * OS.alert("Failed to initialize: " + message) + * [/codeblock] + * There are a couple ways to handle "controller" input: + * - Using [XRController3D] nodes and their [signal XRController3D.button_pressed] and [signal + * XRController3D.button_released] signals. This is how controllers are typically handled in XR apps in + * Godot, however, this will only work with advanced VR controllers like the Oculus Touch or Index + * controllers, for example. + * - Using the [signal select], [signal squeeze] and related signals. This method will work for both + * advanced VR controllers, and non-traditional input sources like a tap on the screen, a spoken voice + * command or a button press on the device itself. + * You can use both methods to allow your game or app to support a wider or narrower set of devices + * and input methods, or to allow more advanced interactions with more advanced devices. + */ @GodotBaseType public open class WebXRInterface internal constructor() : XRInterface() { + /** + * Emitted by [isSessionSupported] to indicate if the given [param session_mode] is supported or + * not. + */ public val sessionSupported: Signal2 by signal("sessionMode", "supported") + /** + * Emitted by [XRInterface.initialize] if the session is successfully started. + * At this point, it's safe to do `get_viewport().use_xr = true` to instruct Godot to start + * rendering to the XR device. + */ public val sessionStarted: Signal0 by signal() + /** + * Emitted when the user ends the WebXR session (which can be done using UI from the browser or + * device). + * At this point, you should do `get_viewport().use_xr = false` to instruct Godot to resume + * rendering to the screen. + */ public val sessionEnded: Signal0 by signal() + /** + * Emitted by [XRInterface.initialize] if the session fails to start. + * [param message] may optionally contain an error message from WebXR, or an empty string if no + * message is available. + */ public val sessionFailed: Signal1 by signal("message") + /** + * Emitted when one of the input source has started its "primary action". + * Use [getInputSourceTracker] and [getInputSourceTargetRayMode] to get more information about the + * input source. + */ public val selectstart: Signal1 by signal("inputSourceId") + /** + * Emitted after one of the input sources has finished its "primary action". + * Use [getInputSourceTracker] and [getInputSourceTargetRayMode] to get more information about the + * input source. + */ public val select: Signal1 by signal("inputSourceId") + /** + * Emitted when one of the input sources has finished its "primary action". + * Use [getInputSourceTracker] and [getInputSourceTargetRayMode] to get more information about the + * input source. + */ public val selectend: Signal1 by signal("inputSourceId") + /** + * Emitted when one of the input sources has started its "primary squeeze action". + * Use [getInputSourceTracker] and [getInputSourceTargetRayMode] to get more information about the + * input source. + */ public val squeezestart: Signal1 by signal("inputSourceId") + /** + * Emitted after one of the input sources has finished its "primary squeeze action". + * Use [getInputSourceTracker] and [getInputSourceTargetRayMode] to get more information about the + * input source. + */ public val squeeze: Signal1 by signal("inputSourceId") + /** + * Emitted when one of the input sources has finished its "primary squeeze action". + * Use [getInputSourceTracker] and [getInputSourceTargetRayMode] to get more information about the + * input source. + */ public val squeezeend: Signal1 by signal("inputSourceId") + /** + * Emitted when [visibilityState] has changed. + */ public val visibilityStateChanged: Signal0 by signal() + /** + * Emitted to indicate that the reference space has been reset or reconfigured. + * When (or whether) this is emitted depends on the user's browser or device, but may include when + * the user has changed the dimensions of their play space (which you may be able to access via + * [XRInterface.getPlayArea]) or pressed/held a button to recenter their position. + * See [url=https://developer.mozilla.org/en-US/docs/Web/API/XRReferenceSpace/reset_event]WebXR's + * XRReferenceSpace reset event[/url] for more information. + */ public val referenceSpaceReset: Signal0 by signal() + /** + * Emitted after the display's refresh rate has changed. + */ public val displayRefreshRateChanged: Signal0 by signal() + /** + * The session mode used by [XRInterface.initialize] when setting up the WebXR session. + * This doesn't have any effect on the interface when already initialized. + * Possible values come from + * [url=https://developer.mozilla.org/en-US/docs/Web/API/XRSessionMode]WebXR's XRSessionMode[/url], + * including: `"immersive-vr"`, `"immersive-ar"`, and `"inline"`. + */ public var sessionMode: String get() { TransferContext.writeArguments() @@ -71,6 +240,17 @@ public open class WebXRInterface internal constructor() : XRInterface() { TransferContext.callMethod(rawPtr, MethodBindings.setSessionModePtr, NIL) } + /** + * A comma-seperated list of required features used by [XRInterface.initialize] when setting up + * the WebXR session. + * If a user's browser or device doesn't support one of the given features, initialization will + * fail and [signal session_failed] will be emitted. + * This doesn't have any effect on the interface when already initialized. + * Possible values come from + * [url=https://developer.mozilla.org/en-US/docs/Web/API/XRReferenceSpaceType]WebXR's + * XRReferenceSpaceType[/url]. If you want to use a particular reference space type, it must be + * listed in either [requiredFeatures] or [optionalFeatures]. + */ public var requiredFeatures: String get() { TransferContext.writeArguments() @@ -82,6 +262,17 @@ public open class WebXRInterface internal constructor() : XRInterface() { TransferContext.callMethod(rawPtr, MethodBindings.setRequiredFeaturesPtr, NIL) } + /** + * A comma-seperated list of optional features used by [XRInterface.initialize] when setting up + * the WebXR session. + * If a user's browser or device doesn't support one of the given features, initialization will + * continue, but you won't be able to use the requested feature. + * This doesn't have any effect on the interface when already initialized. + * Possible values come from + * [url=https://developer.mozilla.org/en-US/docs/Web/API/XRReferenceSpaceType]WebXR's + * XRReferenceSpaceType[/url]. If you want to use a particular reference space type, it must be + * listed in either [requiredFeatures] or [optionalFeatures]. + */ public var optionalFeatures: String get() { TransferContext.writeArguments() @@ -93,6 +284,18 @@ public open class WebXRInterface internal constructor() : XRInterface() { TransferContext.callMethod(rawPtr, MethodBindings.setOptionalFeaturesPtr, NIL) } + /** + * A comma-seperated list of reference space types used by [XRInterface.initialize] when setting + * up the WebXR session. + * The reference space types are requested in order, and the first one supported by the users + * device or browser will be used. The [referenceSpaceType] property contains the reference space + * type that was ultimately selected. + * This doesn't have any effect on the interface when already initialized. + * Possible values come from + * [url=https://developer.mozilla.org/en-US/docs/Web/API/XRReferenceSpaceType]WebXR's + * XRReferenceSpaceType[/url]. If you want to use a particular reference space type, it must be + * listed in either [requiredFeatures] or [optionalFeatures]. + */ public var requestedReferenceSpaceTypes: String get() { TransferContext.writeArguments() @@ -104,6 +307,15 @@ public open class WebXRInterface internal constructor() : XRInterface() { TransferContext.callMethod(rawPtr, MethodBindings.setRequestedReferenceSpaceTypesPtr, NIL) } + /** + * The reference space type (from the list of requested types set in the + * [requestedReferenceSpaceTypes] property), that was ultimately used by [XRInterface.initialize] + * when setting up the WebXR session. + * Possible values come from + * [url=https://developer.mozilla.org/en-US/docs/Web/API/XRReferenceSpaceType]WebXR's + * XRReferenceSpaceType[/url]. If you want to use a particular reference space type, it must be + * listed in either [requiredFeatures] or [optionalFeatures]. + */ public val referenceSpaceType: String get() { TransferContext.writeArguments() @@ -111,6 +323,12 @@ public open class WebXRInterface internal constructor() : XRInterface() { return (TransferContext.readReturnValue(STRING, false) as String) } + /** + * Indicates if the WebXR session's imagery is visible to the user. + * Possible values come from + * [url=https://developer.mozilla.org/en-US/docs/Web/API/XRVisibilityState]WebXR's + * XRVisibilityState[/url], including `"hidden"`, `"visible"`, and `"visible-blurred"`. + */ public val visibilityState: String get() { TransferContext.writeArguments() @@ -123,40 +341,83 @@ public open class WebXRInterface internal constructor() : XRInterface() { return true } + /** + * Checks if the given [param session_mode] is supported by the user's browser. + * Possible values come from + * [url=https://developer.mozilla.org/en-US/docs/Web/API/XRSessionMode]WebXR's XRSessionMode[/url], + * including: `"immersive-vr"`, `"immersive-ar"`, and `"inline"`. + * This method returns nothing, instead it emits the [signal session_supported] signal with the + * result. + */ public fun isSessionSupported(sessionMode: String): Unit { TransferContext.writeArguments(STRING to sessionMode) TransferContext.callMethod(rawPtr, MethodBindings.isSessionSupportedPtr, NIL) } + /** + * Returns `true` if there is an active input source with the given [param input_source_id]. + */ public fun isInputSourceActive(inputSourceId: Int): Boolean { TransferContext.writeArguments(LONG to inputSourceId.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.isInputSourceActivePtr, BOOL) return (TransferContext.readReturnValue(BOOL, false) as Boolean) } + /** + * Gets an [XRPositionalTracker] for the given [param input_source_id]. + * In the context of WebXR, an input source can be an advanced VR controller like the Oculus Touch + * or Index controllers, or even a tap on the screen, a spoken voice command or a button press on the + * device itself. When a non-traditional input source is used, interpret the position and orientation + * of the [XRPositionalTracker] as a ray pointing at the object the user wishes to interact with. + * Use this method to get information about the input source that triggered one of these signals: + * - [signal selectstart] + * - [signal select] + * - [signal selectend] + * - [signal squeezestart] + * - [signal squeeze] + * - [signal squeezestart] + */ public fun getInputSourceTracker(inputSourceId: Int): XRPositionalTracker? { TransferContext.writeArguments(LONG to inputSourceId.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.getInputSourceTrackerPtr, OBJECT) return (TransferContext.readReturnValue(OBJECT, true) as XRPositionalTracker?) } + /** + * Returns the target ray mode for the given [param input_source_id]. + * This can help interpret the input coming from that input source. See + * [url=https://developer.mozilla.org/en-US/docs/Web/API/XRInputSource/targetRayMode]XRInputSource.targetRayMode[/url] + * for more information. + */ public fun getInputSourceTargetRayMode(inputSourceId: Int): TargetRayMode { TransferContext.writeArguments(LONG to inputSourceId.toLong()) TransferContext.callMethod(rawPtr, MethodBindings.getInputSourceTargetRayModePtr, LONG) return WebXRInterface.TargetRayMode.from(TransferContext.readReturnValue(LONG) as Long) } + /** + * Returns the display refresh rate for the current HMD. Not supported on all HMDs and browsers. + * It may not report an accurate value until after using [setDisplayRefreshRate]. + */ public fun getDisplayRefreshRate(): Float { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getDisplayRefreshRatePtr, DOUBLE) return (TransferContext.readReturnValue(DOUBLE, false) as Double).toFloat() } + /** + * Sets the display refresh rate for the current HMD. Not supported on all HMDs and browsers. It + * won't take effect right away until after [signal display_refresh_rate_changed] is emitted. + */ public fun setDisplayRefreshRate(refreshRate: Float): Unit { TransferContext.writeArguments(DOUBLE to refreshRate.toDouble()) TransferContext.callMethod(rawPtr, MethodBindings.setDisplayRefreshRatePtr, NIL) } + /** + * Returns display refresh rates supported by the current HMD. Only returned if this feature is + * supported by the web browser and after the interface has been initialized. + */ public fun getAvailableDisplayRefreshRates(): VariantArray { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getAvailableDisplayRefreshRatesPtr, ARRAY) @@ -166,9 +427,21 @@ public open class WebXRInterface internal constructor() : XRInterface() { public enum class TargetRayMode( id: Long, ) { + /** + * We don't know the the target ray mode. + */ TARGET_RAY_MODE_UNKNOWN(0), + /** + * Target ray originates at the viewer's eyes and points in the direction they are looking. + */ TARGET_RAY_MODE_GAZE(1), + /** + * Target ray from a handheld pointer, most likely a VR touch controller. + */ TARGET_RAY_MODE_TRACKED_POINTER(2), + /** + * Target ray from touch screen, mouse or other tactile input device. + */ TARGET_RAY_MODE_SCREEN(3), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/WorkerThreadPool.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/WorkerThreadPool.kt index c1b0bf5f7..b18d7ddf0 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/WorkerThreadPool.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/WorkerThreadPool.kt @@ -26,84 +26,53 @@ import kotlin.Unit import kotlin.jvm.JvmOverloads /** - * A singleton that allocates some [godot.Thread]s on startup, used to offload tasks to these threads. - * - * Tutorials: - * [$DOCS_URL/tutorials/performance/thread_safe_apis.html]($DOCS_URL/tutorials/performance/thread_safe_apis.html) - * - * The [godot.WorkerThreadPool] singleton allocates a set of [godot.Thread]s (called worker threads) on project startup and provides methods for offloading tasks to them. This can be used for simple multithreading without having to create [godot.Thread]s. - * - * Tasks hold the [godot.Callable] to be run by the threads. [godot.WorkerThreadPool] can be used to create regular tasks, which will be taken by one worker thread, or group tasks, which can be distributed between multiple worker threads. Group tasks execute the [godot.Callable] multiple times, which makes them useful for iterating over a lot of elements, such as the enemies in an arena. - * + * The [WorkerThreadPool] singleton allocates a set of [Thread]s (called worker threads) on project + * startup and provides methods for offloading tasks to them. This can be used for simple + * multithreading without having to create [Thread]s. + * Tasks hold the [Callable] to be run by the threads. [WorkerThreadPool] can be used to create + * regular tasks, which will be taken by one worker thread, or group tasks, which can be distributed + * between multiple worker threads. Group tasks execute the [Callable] multiple times, which makes them + * useful for iterating over a lot of elements, such as the enemies in an arena. * Here's a sample on how to offload an expensive function to worker threads: * - * [codeblocks] - * - * [gdscript] - * + * gdscript: + * ```gdscript * var enemies = [] # An array to be filled with enemies. * - * - * * func process_enemy_ai(enemy_index): - * * var processed_enemy = enemies[enemy_index] - * * # Expensive logic... * - * - * * func _process(delta): - * * var task_id = WorkerThreadPool.add_group_task(process_enemy_ai, enemies.size()) - * * # Other code... - * * WorkerThreadPool.wait_for_group_task_completion(task_id) - * * # Other code that depends on the enemy AI already being processed. - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * private List _enemies = new List(); // A list to be filled with enemies. * - * - * * private void ProcessEnemyAI(int enemyIndex) - * * { - * * Node processedEnemy = _enemies[enemyIndex]; - * * // Expensive logic here. - * * } * - * - * * public override void _Process(double delta) - * * { - * - * long taskId = WorkerThreadPool.AddGroupTask(Callable.From(ProcessEnemyAI), _enemies.Count); - * + * long taskId = WorkerThreadPool.AddGroupTask(Callable.From(ProcessEnemyAI), + * _enemies.Count); * // Other code... - * * WorkerThreadPool.WaitForGroupTaskCompletion(taskId); - * * // Other code that depends on the enemy AI already being processed. - * * } + * ``` * - * [/csharp] - * - * [/codeblocks] - * - * The above code relies on the number of elements in the `enemies` array remaining constant during the multithreaded part. - * - * **Note:** Using this singleton could affect performance negatively if the task being distributed between threads is not computationally expensive. + * The above code relies on the number of elements in the `enemies` array remaining constant during + * the multithreaded part. + * **Note:** Using this singleton could affect performance negatively if the task being distributed + * between threads is not computationally expensive. */ @GodotBaseType public object WorkerThreadPool : Object() { @@ -113,8 +82,9 @@ public object WorkerThreadPool : Object() { } /** - * Adds [action] as a task to be executed by a worker thread. [highPriority] determines if the task has a high priority or a low priority (default). You can optionally provide a [description] to help with debugging. - * + * Adds [param action] as a task to be executed by a worker thread. [param high_priority] + * determines if the task has a high priority or a low priority (default). You can optionally provide + * a [param description] to help with debugging. * Returns a task ID that can be used by other methods. */ @JvmOverloads @@ -139,12 +109,12 @@ public object WorkerThreadPool : Object() { /** * Pauses the thread that calls this method until the task with the given ID is completed. - * - * Returns [@GlobalScope.OK] if the task could be successfully awaited. - * - * Returns [@GlobalScope.ERR_INVALID_PARAMETER] if a task with the passed ID does not exist (maybe because it was already awaited and disposed of). - * - * Returns [@GlobalScope.ERR_BUSY] if the call is made from another running task and, due to task scheduling, the task to await is at a lower level in the call stack and therefore can't progress. This is an advanced situation that should only matter when some tasks depend on others. + * Returns [constant @GlobalScope.OK] if the task could be successfully awaited. + * Returns [constant @GlobalScope.ERR_INVALID_PARAMETER] if a task with the passed ID does not + * exist (maybe because it was already awaited and disposed of). + * Returns [constant @GlobalScope.ERR_BUSY] if the call is made from another running task and, due + * to task scheduling, the task to await is at a lower level in the call stack and therefore can't + * progress. This is an advanced situation that should only matter when some tasks depend on others. */ public fun waitForTaskCompletion(taskId: Long): GodotError { TransferContext.writeArguments(LONG to taskId) @@ -153,10 +123,14 @@ public object WorkerThreadPool : Object() { } /** - * Adds [action] as a group task to be executed by the worker threads. The [godot.Callable] will be called a number of times based on [elements], with the first thread calling it with the value `0` as a parameter, and each consecutive execution incrementing this value by 1 until it reaches `element - 1`. - * - * The number of threads the task is distributed to is defined by [tasksNeeded], where the default value `-1` means it is distributed to all worker threads. [highPriority] determines if the task has a high priority or a low priority (default). You can optionally provide a [description] to help with debugging. - * + * Adds [param action] as a group task to be executed by the worker threads. The [Callable] will + * be called a number of times based on [param elements], with the first thread calling it with the + * value `0` as a parameter, and each consecutive execution incrementing this value by 1 until it + * reaches `element - 1`. + * The number of threads the task is distributed to is defined by [param tasks_needed], where the + * default value `-1` means it is distributed to all worker threads. [param high_priority] determines + * if the task has a high priority or a low priority (default). You can optionally provide a [param + * description] to help with debugging. * Returns a group task ID that can be used by other methods. */ @JvmOverloads @@ -182,9 +156,10 @@ public object WorkerThreadPool : Object() { } /** - * Returns how many times the [godot.Callable] of the group task with the given ID has already been executed by the worker threads. - * - * **Note:** If a thread has started executing the [godot.Callable] but is yet to finish, it won't be counted. + * Returns how many times the [Callable] of the group task with the given ID has already been + * executed by the worker threads. + * **Note:** If a thread has started executing the [Callable] but is yet to finish, it won't be + * counted. */ public fun getGroupProcessedElementCount(groupId: Long): Long { TransferContext.writeArguments(LONG to groupId) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/World2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/World2D.kt index ccff74feb..0cd62d61b 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/World2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/World2D.kt @@ -18,17 +18,13 @@ import kotlin.Int import kotlin.Suppress /** - * A resource that holds all components of a 2D world, such as a canvas and a physics space. - * - * Tutorials: - * [$DOCS_URL/tutorials/physics/ray-casting.html]($DOCS_URL/tutorials/physics/ray-casting.html) - * - * Class that has everything pertaining to a 2D world: A physics space, a canvas, and a sound space. 2D nodes register their resources into the current 2D world. + * Class that has everything pertaining to a 2D world: A physics space, a canvas, and a sound space. + * 2D nodes register their resources into the current 2D world. */ @GodotBaseType public open class World2D : Resource() { /** - * The [RID] of this world's canvas resource. Used by the [godot.RenderingServer] for 2D drawing. + * The [RID] of this world's canvas resource. Used by the [RenderingServer] for 2D drawing. */ public val canvas: RID get() { @@ -38,7 +34,8 @@ public open class World2D : Resource() { } /** - * The [RID] of this world's physics space resource. Used by the [godot.PhysicsServer2D] for 2D physics, treating it as both a space and an area. + * The [RID] of this world's physics space resource. Used by the [PhysicsServer2D] for 2D physics, + * treating it as both a space and an area. */ public val space: RID get() { @@ -48,7 +45,7 @@ public open class World2D : Resource() { } /** - * The [RID] of this world's navigation map. Used by the [godot.NavigationServer2D]. + * The [RID] of this world's navigation map. Used by the [NavigationServer2D]. */ public val navigationMap: RID get() { @@ -58,7 +55,9 @@ public open class World2D : Resource() { } /** - * Direct access to the world's physics 2D space state. Used for querying current and potential collisions. When using multi-threaded physics, access is limited to [godot.Node.PhysicsProcess] in the main thread. + * Direct access to the world's physics 2D space state. Used for querying current and potential + * collisions. When using multi-threaded physics, access is limited to [Node.PhysicsProcess] in the + * main thread. */ public val directSpaceState: PhysicsDirectSpaceState2D? get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/World3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/World3D.kt index f2c7f5d33..75d596579 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/World3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/World3D.kt @@ -19,17 +19,13 @@ import kotlin.Int import kotlin.Suppress /** - * A resource that holds all components of a 3D world, such as a visual scenario and a physics space. - * - * Tutorials: - * [$DOCS_URL/tutorials/physics/ray-casting.html]($DOCS_URL/tutorials/physics/ray-casting.html) - * - * Class that has everything pertaining to a world: A physics space, a visual scenario, and a sound space. 3D nodes register their resources into the current 3D world. + * Class that has everything pertaining to a world: A physics space, a visual scenario, and a sound + * space. 3D nodes register their resources into the current 3D world. */ @GodotBaseType public open class World3D : Resource() { /** - * The World3D's [godot.Environment]. + * The World3D's [Environment]. */ public var environment: Environment? get() { @@ -57,7 +53,7 @@ public open class World3D : Resource() { } /** - * The default [godot.CameraAttributes] resource to use if none set on the [godot.Camera3D]. + * The default [CameraAttributes] resource to use if none set on the [Camera3D]. */ public var cameraAttributes: Material? get() { @@ -81,7 +77,7 @@ public open class World3D : Resource() { } /** - * The [RID] of this world's navigation map. Used by the [godot.NavigationServer3D]. + * The [RID] of this world's navigation map. Used by the [NavigationServer3D]. */ public val navigationMap: RID get() { @@ -101,7 +97,9 @@ public open class World3D : Resource() { } /** - * Direct access to the world's physics 3D space state. Used for querying current and potential collisions. When using multi-threaded physics, access is limited to [godot.Node.PhysicsProcess] in the main thread. + * Direct access to the world's physics 3D space state. Used for querying current and potential + * collisions. When using multi-threaded physics, access is limited to [Node.PhysicsProcess] in the + * main thread. */ public val directSpaceState: PhysicsDirectSpaceState3D? get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/WorldBoundaryShape2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/WorldBoundaryShape2D.kt index 9bf460cf6..5dfea7500 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/WorldBoundaryShape2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/WorldBoundaryShape2D.kt @@ -24,14 +24,16 @@ import kotlin.Suppress import kotlin.Unit /** - * A 2D world boundary (half-plane) shape used for physics collision. - * - * A 2D world boundary shape, intended for use in physics. [godot.WorldBoundaryShape2D] works like an infinite straight line that forces all physics bodies to stay above it. The line's normal determines which direction is considered as "above" and in the editor, the smaller line over it represents this direction. It can for example be used for endless flat floors. + * A 2D world boundary shape, intended for use in physics. [WorldBoundaryShape2D] works like an + * infinite straight line that forces all physics bodies to stay above it. The line's normal determines + * which direction is considered as "above" and in the editor, the smaller line over it represents this + * direction. It can for example be used for endless flat floors. */ @GodotBaseType public open class WorldBoundaryShape2D : Shape2D() { /** - * The line's normal, typically a unit vector. Its direction indicates the non-colliding half-plane. Can be of any length but zero. Defaults to [godot.Vector2.UP]. + * The line's normal, typically a unit vector. Its direction indicates the non-colliding + * half-plane. Can be of any length but zero. Defaults to [constant Vector2.UP]. */ @CoreTypeLocalCopy public var normal: Vector2 @@ -46,9 +48,11 @@ public open class WorldBoundaryShape2D : Shape2D() { } /** - * The distance from the origin to the line, expressed in terms of [normal] (according to its direction and magnitude). Actual absolute distance from the origin to the line can be calculated as `abs(distance) / normal.length()`. - * - * In the scalar equation of the line `ax + by = d`, this is `d`, while the `(a, b)` coordinates are represented by the [normal] property. + * The distance from the origin to the line, expressed in terms of [normal] (according to its + * direction and magnitude). Actual absolute distance from the origin to the line can be calculated + * as `abs(distance) / normal.length()`. + * In the scalar equation of the line `ax + by = d`, this is `d`, while the `(a, b)` coordinates + * are represented by the [normal] property. */ public var distance: Float get() { @@ -67,7 +71,8 @@ public open class WorldBoundaryShape2D : Shape2D() { } /** - * The line's normal, typically a unit vector. Its direction indicates the non-colliding half-plane. Can be of any length but zero. Defaults to [godot.Vector2.UP]. + * The line's normal, typically a unit vector. Its direction indicates the non-colliding + * half-plane. Can be of any length but zero. Defaults to [constant Vector2.UP]. * * This is a helper function to make dealing with local copies easier. * diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/WorldBoundaryShape3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/WorldBoundaryShape3D.kt index 4a93b5293..5abfe9a88 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/WorldBoundaryShape3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/WorldBoundaryShape3D.kt @@ -21,14 +21,15 @@ import kotlin.Suppress import kotlin.Unit /** - * A 3D world boundary (half-space) shape used for physics collision. - * - * A 3D world boundary shape, intended for use in physics. [godot.WorldBoundaryShape3D] works like an infinite plane that forces all physics bodies to stay above it. The [plane]'s normal determines which direction is considered as "above" and in the editor, the line over the plane represents this direction. It can for example be used for endless flat floors. + * A 3D world boundary shape, intended for use in physics. [WorldBoundaryShape3D] works like an + * infinite plane that forces all physics bodies to stay above it. The [plane]'s normal determines + * which direction is considered as "above" and in the editor, the line over the plane represents this + * direction. It can for example be used for endless flat floors. */ @GodotBaseType public open class WorldBoundaryShape3D : Shape3D() { /** - * The [godot.core.Plane] used by the [godot.WorldBoundaryShape3D] for collision. + * The [Plane] used by the [WorldBoundaryShape3D] for collision. */ @CoreTypeLocalCopy public var plane: Plane @@ -48,7 +49,7 @@ public open class WorldBoundaryShape3D : Shape3D() { } /** - * The [godot.core.Plane] used by the [godot.WorldBoundaryShape3D] for collision. + * The [Plane] used by the [WorldBoundaryShape3D] for collision. * * This is a helper function to make dealing with local copies easier. * diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/WorldEnvironment.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/WorldEnvironment.kt index fd2dec3d1..97fd36a96 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/WorldEnvironment.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/WorldEnvironment.kt @@ -17,21 +17,19 @@ import kotlin.Int import kotlin.Suppress /** - * Default environment properties for the entire scene (post-processing effects, lighting and background settings). - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/678](https://godotengine.org/asset-library/asset/678) - * - * The [godot.WorldEnvironment] node is used to configure the default [godot.Environment] for the scene. - * - * The parameters defined in the [godot.WorldEnvironment] can be overridden by an [godot.Environment] node set on the current [godot.Camera3D]. Additionally, only one [godot.WorldEnvironment] may be instantiated in a given scene at a time. - * - * The [godot.WorldEnvironment] allows the user to specify default lighting parameters (e.g. ambient lighting), various post-processing effects (e.g. SSAO, DOF, Tonemapping), and how to draw the background (e.g. solid color, skybox). Usually, these are added in order to improve the realism/color balance of the scene. + * The [WorldEnvironment] node is used to configure the default [Environment] for the scene. + * The parameters defined in the [WorldEnvironment] can be overridden by an [Environment] node set + * on the current [Camera3D]. Additionally, only one [WorldEnvironment] may be instantiated in a given + * scene at a time. + * The [WorldEnvironment] allows the user to specify default lighting parameters (e.g. ambient + * lighting), various post-processing effects (e.g. SSAO, DOF, Tonemapping), and how to draw the + * background (e.g. solid color, skybox). Usually, these are added in order to improve the + * realism/color balance of the scene. */ @GodotBaseType public open class WorldEnvironment : Node() { /** - * The [godot.Environment] resource used by this [godot.WorldEnvironment], defining the default properties. + * The [Environment] resource used by this [WorldEnvironment], defining the default properties. */ public var environment: Environment? get() { @@ -45,7 +43,7 @@ public open class WorldEnvironment : Node() { } /** - * The default [godot.CameraAttributes] resource to use if none set on the [godot.Camera3D]. + * The default [CameraAttributes] resource to use if none set on the [Camera3D]. */ public var cameraAttributes: Material? get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/X509Certificate.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/X509Certificate.kt index 9058260e2..c1555d052 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/X509Certificate.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/X509Certificate.kt @@ -20,14 +20,11 @@ import kotlin.String import kotlin.Suppress /** - * An X509 certificate (e.g. for TLS). - * - * Tutorials: - * [$DOCS_URL/tutorials/networking/ssl_certificates.html]($DOCS_URL/tutorials/networking/ssl_certificates.html) - * - * The X509Certificate class represents an X509 certificate. Certificates can be loaded and saved like any other [godot.Resource]. - * - * They can be used as the server certificate in [godot.StreamPeerTLS.acceptStream] (along with the proper [godot.CryptoKey]), and to specify the only certificate that should be accepted when connecting to a TLS server via [godot.StreamPeerTLS.connectToStream]. + * The X509Certificate class represents an X509 certificate. Certificates can be loaded and saved + * like any other [Resource]. + * They can be used as the server certificate in [StreamPeerTLS.acceptStream] (along with the proper + * [CryptoKey]), and to specify the only certificate that should be accepted when connecting to a TLS + * server via [StreamPeerTLS.connectToStream]. */ @GodotBaseType public open class X509Certificate : Resource() { @@ -37,7 +34,7 @@ public open class X509Certificate : Resource() { } /** - * Saves a certificate to the given [path] (should be a "*.crt" file). + * Saves a certificate to the given [param path] (should be a "*.crt" file). */ public fun save(path: String): GodotError { TransferContext.writeArguments(STRING to path) @@ -46,7 +43,7 @@ public open class X509Certificate : Resource() { } /** - * Loads a certificate from [path] ("*.crt" file). + * Loads a certificate from [param path] ("*.crt" file). */ public fun load(path: String): GodotError { TransferContext.writeArguments(STRING to path) @@ -55,7 +52,8 @@ public open class X509Certificate : Resource() { } /** - * Returns a string representation of the certificate, or an empty string if the certificate is invalid. + * Returns a string representation of the certificate, or an empty string if the certificate is + * invalid. */ public fun saveToString(): String { TransferContext.writeArguments() @@ -64,7 +62,7 @@ public open class X509Certificate : Resource() { } /** - * Loads a certificate from the given [string]. + * Loads a certificate from the given [param string]. */ public fun loadFromString(string: String): GodotError { TransferContext.writeArguments(STRING to string) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/XMLParser.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/XMLParser.kt index 223edc83c..80e5f5526 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/XMLParser.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/XMLParser.kt @@ -25,73 +25,45 @@ import kotlin.Suppress import kotlin.Unit /** - * Provides a low-level interface for creating parsers for XML files. - * - * Provides a low-level interface for creating parsers for [XML](https://en.wikipedia.org/wiki/XML) files. This class can serve as base to make custom XML parsers. - * - * To parse XML, you must open a file with the [open] method or a buffer with the [openBuffer] method. Then, the [read] method must be called to parse the next nodes. Most of the methods take into consideration the currently parsed node. - * - * Here is an example of using [godot.XMLParser] to parse a SVG file (which is based on XML), printing each element and its attributes as a dictionary: - * - * [codeblocks] - * - * [gdscript] - * + * Provides a low-level interface for creating parsers for + * [url=https://en.wikipedia.org/wiki/XML]XML[/url] files. This class can serve as base to make custom + * XML parsers. + * To parse XML, you must open a file with the [open] method or a buffer with the [openBuffer] + * method. Then, the [read] method must be called to parse the next nodes. Most of the methods take + * into consideration the currently parsed node. + * Here is an example of using [XMLParser] to parse a SVG file (which is based on XML), printing + * each element and its attributes as a dictionary: + * + * gdscript: + * ```gdscript * var parser = XMLParser.new() - * * parser.open("path/to/file.svg") - * * while parser.read() != ERR_FILE_EOF: - * * if parser.get_node_type() == XMLParser.NODE_ELEMENT: - * * var node_name = parser.get_node_name() - * * var attributes_dict = {} - * * for idx in range(parser.get_attribute_count()): - * * attributes_dict[parser.get_attribute_name(idx)] = parser.get_attribute_value(idx) - * * print("The ", node_name, " element has the following attributes: ", attributes_dict) - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * var parser = new XmlParser(); - * * parser.Open("path/to/file.svg"); - * * while (parser.Read() != Error.FileEof) - * * { - * * if (parser.GetNodeType() == XmlParser.NodeType.Element) - * * { - * * var nodeName = parser.GetNodeName(); - * * var attributesDict = new Godot.Collections.Dictionary(); - * * for (int idx = 0; idx < parser.GetAttributeCount(); idx++) - * * { - * * attributesDict[parser.GetAttributeName(idx)] = parser.GetAttributeValue(idx); - * * } - * * GD.Print($"The {nodeName} element has the following attributes: {attributesDict}"); - * * } - * * } - * - * [/csharp] - * - * [/codeblocks] + * ``` */ @GodotBaseType public open class XMLParser : RefCounted() { @@ -119,7 +91,8 @@ public open class XMLParser : RefCounted() { } /** - * Returns the name of an element node. This method will raise an error if the currently parsed node is not of [NODE_ELEMENT] or [NODE_ELEMENT_END] type. + * Returns the name of an element node. This method will raise an error if the currently parsed + * node is not of [constant NODE_ELEMENT] or [constant NODE_ELEMENT_END] type. */ public fun getNodeName(): String { TransferContext.writeArguments() @@ -128,7 +101,8 @@ public open class XMLParser : RefCounted() { } /** - * Returns the contents of a text node. This method will raise an error if the current parsed node is of any other type. + * Returns the contents of a text node. This method will raise an error if the current parsed node + * is of any other type. */ public fun getNodeData(): String { TransferContext.writeArguments() @@ -137,7 +111,8 @@ public open class XMLParser : RefCounted() { } /** - * Returns the byte offset of the currently parsed node since the beginning of the file or buffer. This is usually equivalent to the number of characters before the read position. + * Returns the byte offset of the currently parsed node since the beginning of the file or buffer. + * This is usually equivalent to the number of characters before the read position. */ public fun getNodeOffset(): Long { TransferContext.writeArguments() @@ -147,8 +122,9 @@ public open class XMLParser : RefCounted() { /** * Returns the number of attributes in the currently parsed element. - * - * **Note:** If this method is used while the currently parsed node is not [NODE_ELEMENT] or [NODE_ELEMENT_END], this count will not be updated and will still reflect the last element. + * **Note:** If this method is used while the currently parsed node is not [constant NODE_ELEMENT] + * or [constant NODE_ELEMENT_END], this count will not be updated and will still reflect the last + * element. */ public fun getAttributeCount(): Int { TransferContext.writeArguments() @@ -157,7 +133,8 @@ public open class XMLParser : RefCounted() { } /** - * Returns the name of an attribute of the currently parsed element, specified by the [idx] index. + * Returns the name of an attribute of the currently parsed element, specified by the [param idx] + * index. */ public fun getAttributeName(idx: Int): String { TransferContext.writeArguments(LONG to idx.toLong()) @@ -166,7 +143,8 @@ public open class XMLParser : RefCounted() { } /** - * Returns the value of an attribute of the currently parsed element, specified by the [idx] index. + * Returns the value of an attribute of the currently parsed element, specified by the [param idx] + * index. */ public fun getAttributeValue(idx: Int): String { TransferContext.writeArguments(LONG to idx.toLong()) @@ -175,7 +153,7 @@ public open class XMLParser : RefCounted() { } /** - * Returns `true` if the currently parsed element has an attribute with the [name]. + * Returns `true` if the currently parsed element has an attribute with the [param name]. */ public fun hasAttribute(name: String): Boolean { TransferContext.writeArguments(STRING to name) @@ -184,7 +162,8 @@ public open class XMLParser : RefCounted() { } /** - * Returns the value of an attribute of the currently parsed element, specified by its [name]. This method will raise an error if the element has no such attribute. + * Returns the value of an attribute of the currently parsed element, specified by its [param + * name]. This method will raise an error if the element has no such attribute. */ public fun getNamedAttributeValue(name: String): String { TransferContext.writeArguments(STRING to name) @@ -193,7 +172,8 @@ public open class XMLParser : RefCounted() { } /** - * Returns the value of an attribute of the currently parsed element, specified by its [name]. This method will return an empty string if the element has no such attribute. + * Returns the value of an attribute of the currently parsed element, specified by its [param + * name]. This method will return an empty string if the element has no such attribute. */ public fun getNamedAttributeValueSafe(name: String): String { TransferContext.writeArguments(STRING to name) @@ -220,7 +200,8 @@ public open class XMLParser : RefCounted() { } /** - * Skips the current section. If the currently parsed node contains more inner nodes, they will be ignored and the cursor will go to the closing of the current element. + * Skips the current section. If the currently parsed node contains more inner nodes, they will be + * ignored and the cursor will go to the closing of the current element. */ public fun skipSection(): Unit { TransferContext.writeArguments() @@ -228,7 +209,8 @@ public open class XMLParser : RefCounted() { } /** - * Moves the buffer cursor to a certain offset (since the beginning) and reads the next node there. This method returns an error code. + * Moves the buffer cursor to a certain offset (since the beginning) and reads the next node + * there. This method returns an error code. */ public fun seek(position: Long): GodotError { TransferContext.writeArguments(LONG to position) @@ -237,7 +219,7 @@ public open class XMLParser : RefCounted() { } /** - * Opens an XML [file] for parsing. This method returns an error code. + * Opens an XML [param file] for parsing. This method returns an error code. */ public fun `open`(`file`: String): GodotError { TransferContext.writeArguments(STRING to file) @@ -246,7 +228,7 @@ public open class XMLParser : RefCounted() { } /** - * Opens an XML raw [buffer] for parsing. This method returns an error code. + * Opens an XML raw [param buffer] for parsing. This method returns an error code. */ public fun openBuffer(buffer: PackedByteArray): GodotError { TransferContext.writeArguments(PACKED_BYTE_ARRAY to buffer) @@ -278,7 +260,7 @@ public open class XMLParser : RefCounted() { */ NODE_COMMENT(4), /** - * A node type for CDATA (Character Data) sections, e.g. ``. + * A node type for CDATA (Character Data) sections, e.g. ``. */ NODE_CDATA(5), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/XRAnchor3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/XRAnchor3D.kt index 46e90aece..06fb26002 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/XRAnchor3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/XRAnchor3D.kt @@ -19,16 +19,16 @@ import kotlin.Int import kotlin.Suppress /** - * An anchor point in AR space. - * - * Tutorials: - * [$DOCS_URL/tutorials/xr/index.html]($DOCS_URL/tutorials/xr/index.html) - * - * The [godot.XRAnchor3D] point is a spatial node that maps a real world location identified by the AR platform to a position within the game world. For example, as long as plane detection in ARKit is on, ARKit will identify and update the position of planes (tables, floors, etc) and create anchors for them. - * - * This node is mapped to one of the anchors through its unique ID. When you receive a signal that a new anchor is available, you should add this node to your scene for that anchor. You can predefine nodes and set the ID; the nodes will simply remain on 0,0,0 until a plane is recognized. - * - * Keep in mind that, as long as plane detection is enabled, the size, placing and orientation of an anchor will be updated as the detection logic learns more about the real world out there especially if only part of the surface is in view. + * The [XRAnchor3D] point is a spatial node that maps a real world location identified by the AR + * platform to a position within the game world. For example, as long as plane detection in ARKit is + * on, ARKit will identify and update the position of planes (tables, floors, etc) and create anchors + * for them. + * This node is mapped to one of the anchors through its unique ID. When you receive a signal that a + * new anchor is available, you should add this node to your scene for that anchor. You can predefine + * nodes and set the ID; the nodes will simply remain on 0,0,0 until a plane is recognized. + * Keep in mind that, as long as plane detection is enabled, the size, placing and orientation of an + * anchor will be updated as the detection logic learns more about the real world out there especially + * if only part of the surface is in view. */ @GodotBaseType public open class XRAnchor3D : XRNode3D() { @@ -38,7 +38,8 @@ public open class XRAnchor3D : XRNode3D() { } /** - * Returns the estimated size of the plane that was detected. Say when the anchor relates to a table in the real world, this is the estimated size of the surface of that table. + * Returns the estimated size of the plane that was detected. Say when the anchor relates to a + * table in the real world, this is the estimated size of the surface of that table. */ public fun getSize(): Vector3 { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/XRCamera3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/XRCamera3D.kt index 71b9dcb91..fec93618a 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/XRCamera3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/XRCamera3D.kt @@ -12,14 +12,14 @@ import kotlin.Int import kotlin.Suppress /** - * A camera node with a few overrules for AR/VR applied, such as location tracking. - * - * Tutorials: - * [$DOCS_URL/tutorials/xr/index.html]($DOCS_URL/tutorials/xr/index.html) - * - * This is a helper spatial node for our camera; note that, if stereoscopic rendering is applicable (VR-HMD), most of the camera properties are ignored, as the HMD information overrides them. The only properties that can be trusted are the near and far planes. - * - * The position and orientation of this node is automatically updated by the XR Server to represent the location of the HMD if such tracking is available and can thus be used by game logic. Note that, in contrast to the XR Controller, the render thread has access to the most up-to-date tracking data of the HMD and the location of the XRCamera3D can lag a few milliseconds behind what is used for rendering as a result. + * This is a helper spatial node for our camera; note that, if stereoscopic rendering is applicable + * (VR-HMD), most of the camera properties are ignored, as the HMD information overrides them. The only + * properties that can be trusted are the near and far planes. + * The position and orientation of this node is automatically updated by the XR Server to represent + * the location of the HMD if such tracking is available and can thus be used by game logic. Note that, + * in contrast to the XR Controller, the render thread has access to the most up-to-date tracking data + * of the HMD and the location of the XRCamera3D can lag a few milliseconds behind what is used for + * rendering as a result. */ @GodotBaseType public open class XRCamera3D : Camera3D() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/XRController3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/XRController3D.kt index f330f8da9..7266d8744 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/XRController3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/XRController3D.kt @@ -31,17 +31,15 @@ import kotlin.String import kotlin.Suppress /** - * A spatial node representing a spatially-tracked controller. - * - * Tutorials: - * [$DOCS_URL/tutorials/xr/index.html]($DOCS_URL/tutorials/xr/index.html) - * - * This is a helper spatial node that is linked to the tracking of controllers. It also offers several handy passthroughs to the state of buttons and such on the controllers. - * - * Controllers are linked by their ID. You can create controller nodes before the controllers are available. If your game always uses two controllers (one for each hand), you can predefine the controllers with ID 1 and 2; they will become active as soon as the controllers are identified. If you expect additional controllers to be used, you should react to the signals and add XRController3D nodes to your scene. - * - * The position of the controller node is automatically updated by the [godot.XRServer]. This makes this node ideal to add child nodes to visualize the controller. - * + * This is a helper spatial node that is linked to the tracking of controllers. It also offers + * several handy passthroughs to the state of buttons and such on the controllers. + * Controllers are linked by their ID. You can create controller nodes before the controllers are + * available. If your game always uses two controllers (one for each hand), you can predefine the + * controllers with ID 1 and 2; they will become active as soon as the controllers are identified. If + * you expect additional controllers to be used, you should react to the signals and add XRController3D + * nodes to your scene. + * The position of the controller node is automatically updated by the [XRServer]. This makes this + * node ideal to add child nodes to visualize the controller. * As many XR runtimes now use a configurable action map all inputs are named. */ @GodotBaseType @@ -72,7 +70,7 @@ public open class XRController3D : XRNode3D() { } /** - * Returns `true` if the button with the given [name] is pressed. + * Returns `true` if the button with the given [param name] is pressed. */ public fun isButtonPressed(name: StringName): Boolean { TransferContext.writeArguments(STRING_NAME to name) @@ -81,7 +79,8 @@ public open class XRController3D : XRNode3D() { } /** - * Returns a [Variant] for the input with the given [name]. This works for any input type, the variant will be typed according to the actions configuration. + * Returns a [Variant] for the input with the given [param name]. This works for any input type, + * the variant will be typed according to the actions configuration. */ public fun getInput(name: StringName): Any? { TransferContext.writeArguments(STRING_NAME to name) @@ -90,7 +89,8 @@ public open class XRController3D : XRNode3D() { } /** - * Returns a numeric value for the input with the given [name]. This is used for triggers and grip sensors. + * Returns a numeric value for the input with the given [param name]. This is used for triggers + * and grip sensors. */ public fun getFloat(name: StringName): Float { TransferContext.writeArguments(STRING_NAME to name) @@ -99,7 +99,8 @@ public open class XRController3D : XRNode3D() { } /** - * Returns a [godot.core.Vector2] for the input with the given [name]. This is used for thumbsticks and thumbpads found on many controllers. + * Returns a [Vector2] for the input with the given [param name]. This is used for thumbsticks and + * thumbpads found on many controllers. */ public fun getVector2(name: StringName): Vector2 { TransferContext.writeArguments(STRING_NAME to name) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/XRInterface.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/XRInterface.kt index fde28fd4d..9b42369fb 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/XRInterface.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/XRInterface.kt @@ -41,19 +41,18 @@ import kotlin.Suppress import kotlin.Unit /** - * Base class for an XR interface implementation. - * - * Tutorials: - * [$DOCS_URL/tutorials/xr/index.html]($DOCS_URL/tutorials/xr/index.html) - * - * This class needs to be implemented to make an AR or VR platform available to Godot and these should be implemented as C++ modules or GDExtension modules. Part of the interface is exposed to GDScript so you can detect, enable and configure an AR or VR platform. - * - * Interfaces should be written in such a way that simply enabling them will give us a working setup. You can query the available interfaces through [godot.XRServer]. + * This class needs to be implemented to make an AR or VR platform available to Godot and these + * should be implemented as C++ modules or GDExtension modules. Part of the interface is exposed to + * GDScript so you can detect, enable and configure an AR or VR platform. + * Interfaces should be written in such a way that simply enabling them will give us a working + * setup. You can query the available interfaces through [XRServer]. */ @GodotBaseType public open class XRInterface internal constructor() : RefCounted() { /** - * Emitted when the play area is changed. This can be a result of the player resetting the boundary or entering a new play area, the player changing the play area mode, the world scale changing or the player resetting their headset orientation. + * Emitted when the play area is changed. This can be a result of the player resetting the + * boundary or entering a new play area, the player changing the play area mode, the world scale + * changing or the player resetting their headset orientation. */ public val playAreaChanged: Signal1 by signal("mode") @@ -82,7 +81,8 @@ public open class XRInterface internal constructor() : RefCounted() { } /** - * Specify how XR should blend in the environment. This is specific to certain AR and passthrough devices where camera images are blended in by the XR compositor. + * Specify how XR should blend in the environment. This is specific to certain AR and passthrough + * devices where camera images are blended in by the XR compositor. */ public val environmentBlendMode: EnvironmentBlendMode get() { @@ -120,7 +120,8 @@ public open class XRInterface internal constructor() : RefCounted() { } /** - * Returns a combination of [enum Capabilities] flags providing information about the capabilities of this interface. + * Returns a combination of [enum Capabilities] flags providing information about the capabilities + * of this interface. */ public fun getCapabilities(): Long { TransferContext.writeArguments() @@ -138,15 +139,20 @@ public open class XRInterface internal constructor() : RefCounted() { } /** - * Call this to initialize this interface. The first interface that is initialized is identified as the primary interface and it will be used for rendering output. - * - * After initializing the interface you want to use you then need to enable the AR/VR mode of a viewport and rendering should commence. - * - * **Note:** You must enable the XR mode on the main viewport for any device that uses the main output of Godot, such as for mobile VR. - * - * If you do this for a platform that handles its own output (such as OpenVR) Godot will show just one eye without distortion on screen. Alternatively, you can add a separate viewport node to your scene and enable AR/VR on that viewport. It will be used to output to the HMD, leaving you free to do anything you like in the main window, such as using a separate camera as a spectator camera or rendering something completely different. - * - * While currently not used, you can activate additional interfaces. You may wish to do this if you want to track controllers from other platforms. However, at this point in time only one interface can render to an HMD. + * Call this to initialize this interface. The first interface that is initialized is identified + * as the primary interface and it will be used for rendering output. + * After initializing the interface you want to use you then need to enable the AR/VR mode of a + * viewport and rendering should commence. + * **Note:** You must enable the XR mode on the main viewport for any device that uses the main + * output of Godot, such as for mobile VR. + * If you do this for a platform that handles its own output (such as OpenVR) Godot will show just + * one eye without distortion on screen. Alternatively, you can add a separate viewport node to your + * scene and enable AR/VR on that viewport. It will be used to output to the HMD, leaving you free to + * do anything you like in the main window, such as using a separate camera as a spectator camera or + * rendering something completely different. + * While currently not used, you can activate additional interfaces. You may wish to do this if + * you want to track controllers from other platforms. However, at this point in time only one + * interface can render to an HMD. */ public fun initialize(): Boolean { TransferContext.writeArguments() @@ -163,8 +169,9 @@ public open class XRInterface internal constructor() : RefCounted() { } /** - * Returns a [godot.core.Dictionary] with extra system info. Interfaces are expected to return `XRRuntimeName` and `XRRuntimeVersion` providing info about the used XR runtime. Additional entries may be provided specific to an interface. - * + * Returns a [Dictionary] with extra system info. Interfaces are expected to return + * `XRRuntimeName` and `XRRuntimeVersion` providing info about the used XR runtime. Additional + * entries may be provided specific to an interface. * **Note:**This information may only be available after [initialize] was successfully called. */ public fun getSystemInfo(): Dictionary { @@ -174,7 +181,8 @@ public open class XRInterface internal constructor() : RefCounted() { } /** - * If supported, returns the status of our tracking. This will allow you to provide feedback to the user whether there are issues with positional tracking. + * If supported, returns the status of our tracking. This will allow you to provide feedback to + * the user whether there are issues with positional tracking. */ public fun getTrackingStatus(): TrackingStatus { TransferContext.writeArguments() @@ -183,7 +191,8 @@ public open class XRInterface internal constructor() : RefCounted() { } /** - * Returns the resolution at which we should render our intermediate results before things like lens distortion are applied by the VR platform. + * Returns the resolution at which we should render our intermediate results before things like + * lens distortion are applied by the VR platform. */ public fun getRenderTargetSize(): Vector2 { TransferContext.writeArguments() @@ -192,7 +201,8 @@ public open class XRInterface internal constructor() : RefCounted() { } /** - * Returns the number of views that need to be rendered for this device. 1 for Monoscopic, 2 for Stereoscopic. + * Returns the number of views that need to be rendered for this device. 1 for Monoscopic, 2 for + * Stereoscopic. */ public fun getViewCount(): Long { TransferContext.writeArguments() @@ -202,10 +212,9 @@ public open class XRInterface internal constructor() : RefCounted() { /** * Triggers a haptic pulse on a device associated with this interface. - * - * [actionName] is the name of the action for this pulse. - * - * [trackerName] is optional and can be used to direct the pulse to a specific device provided that device is bound to this haptic. + * [param action_name] is the name of the action for this pulse. + * [param tracker_name] is optional and can be used to direct the pulse to a specific device + * provided that device is bound to this haptic. */ public fun triggerHapticPulse( actionName: String, @@ -229,7 +238,8 @@ public open class XRInterface internal constructor() : RefCounted() { } /** - * Sets the active play area mode, will return `false` if the mode can't be used with this interface. + * Sets the active play area mode, will return `false` if the mode can't be used with this + * interface. */ public fun setPlayAreaMode(mode: PlayAreaMode): Boolean { TransferContext.writeArguments(LONG to mode.id) @@ -238,7 +248,10 @@ public open class XRInterface internal constructor() : RefCounted() { } /** - * Returns an array of vectors that denotes the physical play area mapped to the virtual space around the [godot.XROrigin3D] point. The points form a convex polygon that can be used to react to or visualize the play area. This returns an empty array if this feature is not supported or if the information is not yet available. + * Returns an array of vectors that denotes the physical play area mapped to the virtual space + * around the [XROrigin3D] point. The points form a convex polygon that can be used to react to or + * visualize the play area. This returns an empty array if this feature is not supported or if the + * information is not yet available. */ public fun getPlayArea(): PackedVector3Array { TransferContext.writeArguments() @@ -247,7 +260,8 @@ public open class XRInterface internal constructor() : RefCounted() { } /** - * If this is an AR interface that requires displaying a camera feed as the background, this method returns the feed ID in the [godot.CameraServer] for this interface. + * If this is an AR interface that requires displaying a camera feed as the background, this + * method returns the feed ID in the [CameraServer] for this interface. */ public fun getCameraFeedId(): Int { TransferContext.writeArguments() @@ -275,8 +289,8 @@ public open class XRInterface internal constructor() : RefCounted() { /** * Starts passthrough, will return `false` if passthrough couldn't be started. - * - * **Note:** The viewport used for XR must have a transparent background, otherwise passthrough may not properly render. + * **Note:** The viewport used for XR must have a transparent background, otherwise passthrough + * may not properly render. */ public fun startPassthrough(): Boolean { TransferContext.writeArguments() @@ -294,10 +308,9 @@ public open class XRInterface internal constructor() : RefCounted() { /** * Returns the transform for a view/eye. - * - * [view] is the view/eye index. - * - * [camTransform] is the transform that maps device coordinates to scene coordinates, typically the [godot.Node3D.globalTransform] of the current XROrigin3D. + * [param view] is the view/eye index. + * [param cam_transform] is the transform that maps device coordinates to scene coordinates, + * typically the [Node3D.globalTransform] of the current XROrigin3D. */ public fun getTransformForView(view: Long, camTransform: Transform3D): Transform3D { TransferContext.writeArguments(LONG to view, TRANSFORM3D to camTransform) @@ -320,7 +333,8 @@ public open class XRInterface internal constructor() : RefCounted() { } /** - * Returns the an array of supported environment blend modes, see [enum XRInterface.EnvironmentBlendMode]. + * Returns the an array of supported environment blend modes, see [enum + * XRInterface.EnvironmentBlendMode]. */ public fun getSupportedEnvironmentBlendModes(): VariantArray { TransferContext.writeArguments() @@ -330,24 +344,23 @@ public open class XRInterface internal constructor() : RefCounted() { /** * Sets the active environment blend mode. - * - * [mode] is the [enum XRInterface.EnvironmentBlendMode] starting with the next frame. - * - * **Note:** Not all runtimes support all environment blend modes, so it is important to check this at startup. For example: - * - * ``` - * func _ready(): - * var xr_interface: XRInterface = XRServer.find_interface("OpenXR") - * if xr_interface and xr_interface.is_initialized(): - * var vp: Viewport = get_viewport() - * vp.use_xr = true - * var acceptable_modes = [ XRInterface.XR_ENV_BLEND_MODE_OPAQUE, XRInterface.XR_ENV_BLEND_MODE_ADDITIVE ] - * var modes = xr_interface.get_supported_environment_blend_modes() - * for mode in acceptable_modes: - * if mode in modes: - * xr_interface.set_environment_blend_mode(mode) - * break - * ``` + * [param mode] is the [enum XRInterface.EnvironmentBlendMode] starting with the next frame. + * **Note:** Not all runtimes support all environment blend modes, so it is important to check + * this at startup. For example: + * [codeblock] + * func _ready(): + * var xr_interface: XRInterface = XRServer.find_interface("OpenXR") + * if xr_interface and xr_interface.is_initialized(): + * var vp: Viewport = get_viewport() + * vp.use_xr = true + * var acceptable_modes = [ XRInterface.XR_ENV_BLEND_MODE_OPAQUE, + * XRInterface.XR_ENV_BLEND_MODE_ADDITIVE ] + * var modes = xr_interface.get_supported_environment_blend_modes() + * for mode in acceptable_modes: + * if mode in modes: + * xr_interface.set_environment_blend_mode(mode) + * break + * [/codeblock] */ public fun setEnvironmentBlendMode(mode: EnvironmentBlendMode): Boolean { TransferContext.writeArguments(LONG to mode.id) @@ -383,7 +396,10 @@ public open class XRInterface internal constructor() : RefCounted() { */ XR_AR(16), /** - * This interface outputs to an external device. If the main viewport is used, the on screen output is an unmodified buffer of either the left or right eye (stretched if the viewport size is not changed to the same aspect ratio of [getRenderTargetSize]). Using a separate viewport node frees up the main viewport for other purposes. + * This interface outputs to an external device. If the main viewport is used, the on screen + * output is an unmodified buffer of either the left or right eye (stretched if the viewport size + * is not changed to the same aspect ratio of [getRenderTargetSize]). Using a separate viewport + * node frees up the main viewport for other purposes. */ XR_EXTERNAL(32), ; @@ -406,11 +422,13 @@ public open class XRInterface internal constructor() : RefCounted() { */ XR_NORMAL_TRACKING(0), /** - * Tracking is hindered by excessive motion (the player is moving faster than tracking can keep up). + * Tracking is hindered by excessive motion (the player is moving faster than tracking can keep + * up). */ XR_EXCESSIVE_MOTION(1), /** - * Tracking is hindered by insufficient features, it's too dark (for camera-based tracking), player is blocked, etc. + * Tracking is hindered by insufficient features, it's too dark (for camera-based tracking), + * player is blocked, etc. */ XR_INSUFFICIENT_FEATURES(2), /** @@ -441,7 +459,8 @@ public open class XRInterface internal constructor() : RefCounted() { */ XR_PLAY_AREA_UNKNOWN(0), /** - * Play area only supports orientation tracking, no positional tracking, area will center around player. + * Play area only supports orientation tracking, no positional tracking, area will center around + * player. */ XR_PLAY_AREA_3DOF(1), /** @@ -453,7 +472,8 @@ public open class XRInterface internal constructor() : RefCounted() { */ XR_PLAY_AREA_ROOMSCALE(3), /** - * Same as [XR_PLAY_AREA_ROOMSCALE] but origin point is fixed to the center of the physical space, [godot.XRServer.centerOnHmd] disabled. + * Same as [constant XR_PLAY_AREA_ROOMSCALE] but origin point is fixed to the center of the + * physical space, [XRServer.centerOnHmd] disabled. */ XR_PLAY_AREA_STAGE(4), ; @@ -480,7 +500,10 @@ public open class XRInterface internal constructor() : RefCounted() { */ XR_ENV_BLEND_MODE_ADDITIVE(1), /** - * Alpha blend mode. This is typically used for AR or VR devices with passthrough capabilities. The alpha channel controls how much of the passthrough is visible. Alpha of 0.0 means the passthrough is visible and this pixel works in ADDITIVE mode. Alpha of 1.0 means that the passthrough is not visible and this pixel works in OPAQUE mode. + * Alpha blend mode. This is typically used for AR or VR devices with passthrough capabilities. + * The alpha channel controls how much of the passthrough is visible. Alpha of 0.0 means the + * passthrough is visible and this pixel works in ADDITIVE mode. Alpha of 1.0 means that the + * passthrough is not visible and this pixel works in OPAQUE mode. */ XR_ENV_BLEND_MODE_ALPHA_BLEND(2), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/XRInterfaceExtension.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/XRInterfaceExtension.kt index 233ad1b49..1e8b3518e 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/XRInterfaceExtension.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/XRInterfaceExtension.kt @@ -39,11 +39,6 @@ import kotlin.Suppress import kotlin.Unit /** - * Base class for XR interface extensions (plugins). - * - * Tutorials: - * [$DOCS_URL/tutorials/xr/index.html]($DOCS_URL/tutorials/xr/index.html) - * * External XR interface plugins should inherit from this class. */ @GodotBaseType @@ -88,7 +83,7 @@ public open class XRInterfaceExtension : XRInterface() { } /** - * Returns a [godot.core.Dictionary] with system information related to this interface. + * Returns a [Dictionary] with system information related to this interface. */ public open fun _getSystemInfo(): Dictionary { throw NotImplementedError("_get_system_info is not implemented for XRInterfaceExtension") @@ -116,14 +111,15 @@ public open class XRInterfaceExtension : XRInterface() { } /** - * Returns an [godot.PackedVector3Array] that denotes the play areas boundaries (if applicable). + * Returns an [PackedVector3Array] that denotes the play areas boundaries (if applicable). */ public open fun _getPlayArea(): PackedVector3Array { throw NotImplementedError("_get_play_area is not implemented for XRInterfaceExtension") } /** - * Returns the size of our render target for this interface, this overrides the size of the [godot.Viewport] marked as the xr viewport. + * Returns the size of our render target for this interface, this overrides the size of the + * [Viewport] marked as the xr viewport. */ public open fun _getRenderTargetSize(): Vector2 { throw NotImplementedError("_get_render_target_size is not implemented for XRInterfaceExtension") @@ -137,21 +133,21 @@ public open class XRInterfaceExtension : XRInterface() { } /** - * Returns the [godot.Transform3D] that positions the [godot.XRCamera3D] in the world. + * Returns the [Transform3D] that positions the [XRCamera3D] in the world. */ public open fun _getCameraTransform(): Transform3D { throw NotImplementedError("_get_camera_transform is not implemented for XRInterfaceExtension") } /** - * Returns a [godot.Transform3D] for a given view. + * Returns a [Transform3D] for a given view. */ public open fun _getTransformForView(view: Long, camTransform: Transform3D): Transform3D { throw NotImplementedError("_get_transform_for_view is not implemented for XRInterfaceExtension") } /** - * Returns the projection matrix for the given view as a [godot.PackedFloat64Array]. + * Returns the projection matrix for the given view as a [PackedFloat64Array]. */ public open fun _getProjectionForView( view: Long, @@ -162,34 +158,35 @@ public open class XRInterfaceExtension : XRInterface() { throw NotImplementedError("_get_projection_for_view is not implemented for XRInterfaceExtension") } - /** - * - */ public open fun _getVrsTexture(): RID { throw NotImplementedError("_get_vrs_texture is not implemented for XRInterfaceExtension") } /** - * Called if this [godot.XRInterfaceExtension] is active before our physics and game process is called. Most XR interfaces will update its [godot.XRPositionalTracker]s at this point in time. + * Called if this [XRInterfaceExtension] is active before our physics and game process is called. + * Most XR interfaces will update its [XRPositionalTracker]s at this point in time. */ public open fun _process(): Unit { } /** - * Called if this [godot.XRInterfaceExtension] is active before rendering starts. Most XR interfaces will sync tracking at this point in time. + * Called if this [XRInterfaceExtension] is active before rendering starts. Most XR interfaces + * will sync tracking at this point in time. */ public open fun _preRender(): Unit { } /** - * Called if this is our primary [godot.XRInterfaceExtension] before we start processing a [godot.Viewport] for every active XR [godot.Viewport], returns `true` if that viewport should be rendered. An XR interface may return `false` if the user has taken off their headset and we can pause rendering. + * Called if this is our primary [XRInterfaceExtension] before we start processing a [Viewport] + * for every active XR [Viewport], returns `true` if that viewport should be rendered. An XR + * interface may return `false` if the user has taken off their headset and we can pause rendering. */ public open fun _preDrawViewport(renderTarget: RID): Boolean { throw NotImplementedError("_pre_draw_viewport is not implemented for XRInterfaceExtension") } /** - * Called after the XR [godot.Viewport] draw logic has completed. + * Called after the XR [Viewport] draw logic has completed. */ public open fun _postDrawViewport(renderTarget: RID, screenRect: Rect2): Unit { } @@ -201,14 +198,16 @@ public open class XRInterfaceExtension : XRInterface() { } /** - * Returns a [godot.PackedStringArray] with tracker names configured by this interface. Note that user configuration can override this list. + * Returns a [PackedStringArray] with tracker names configured by this interface. Note that user + * configuration can override this list. */ public open fun _getSuggestedTrackerNames(): PackedStringArray { throw NotImplementedError("_get_suggested_tracker_names is not implemented for XRInterfaceExtension") } /** - * Returns a [godot.PackedStringArray] with pose names configured by this interface. Note that user configuration can override this list. + * Returns a [PackedStringArray] with pose names configured by this interface. Note that user + * configuration can override this list. */ public open fun _getSuggestedPoseNames(trackerName: StringName): PackedStringArray { throw NotImplementedError("_get_suggested_pose_names is not implemented for XRInterfaceExtension") @@ -248,7 +247,8 @@ public open class XRInterfaceExtension : XRInterface() { } /** - * Returns the camera feed ID for the [godot.CameraFeed] registered with the [godot.CameraServer] that should be presented as the background on an AR capable device (if applicable). + * Returns the camera feed ID for the [CameraFeed] registered with the [CameraServer] that should + * be presented as the background on an AR capable device (if applicable). */ public open fun _getCameraFeedId(): Int { throw NotImplementedError("_get_camera_feed_id is not implemented for XRInterfaceExtension") @@ -275,27 +275,18 @@ public open class XRInterfaceExtension : XRInterface() { throw NotImplementedError("_get_velocity_texture is not implemented for XRInterfaceExtension") } - /** - * - */ public fun getColorTexture(): RID { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getColorTexturePtr, _RID) return (TransferContext.readReturnValue(_RID, false) as RID) } - /** - * - */ public fun getDepthTexture(): RID { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getDepthTexturePtr, _RID) return (TransferContext.readReturnValue(_RID, false) as RID) } - /** - * - */ public fun getVelocityTexture(): RID { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getVelocityTexturePtr, _RID) @@ -303,7 +294,8 @@ public open class XRInterfaceExtension : XRInterface() { } /** - * Blits our render results to screen optionally applying lens distortion. This can only be called while processing `_commit_views`. + * Blits our render results to screen optionally applying lens distortion. This can only be called + * while processing `_commit_views`. */ public fun addBlit( renderTarget: RID, @@ -323,7 +315,8 @@ public open class XRInterfaceExtension : XRInterface() { } /** - * Returns a valid [RID] for a texture to which we should render the current frame if supported by the interface. + * Returns a valid [RID] for a texture to which we should render the current frame if supported by + * the interface. */ public fun getRenderTargetTexture(renderTarget: RID): RID { TransferContext.writeArguments(_RID to renderTarget) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/XRNode3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/XRNode3D.kt index a3c5ee042..18e1fb6ca 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/XRNode3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/XRNode3D.kt @@ -27,24 +27,24 @@ import kotlin.Suppress import kotlin.Unit /** - * A spatial node that has its position automatically updated by the [godot.XRServer]. - * - * Tutorials: - * [$DOCS_URL/tutorials/xr/index.html]($DOCS_URL/tutorials/xr/index.html) - * - * This node can be bound to a specific pose of a [godot.XRPositionalTracker] and will automatically have its [godot.Node3D.transform] updated by the [godot.XRServer]. Nodes of this type must be added as children of the [godot.XROrigin3D] node. + * This node can be bound to a specific pose of a [XRPositionalTracker] and will automatically have + * its [Node3D.transform] updated by the [XRServer]. Nodes of this type must be added as children of + * the [XROrigin3D] node. */ @GodotBaseType public open class XRNode3D internal constructor() : Node3D() { /** - * Emitted when the [tracker] starts or stops receiving updated tracking data for the [pose] being tracked. The [tracking] argument indicates whether the tracker is getting updated tracking data. + * Emitted when the [tracker] starts or stops receiving updated tracking data for the [pose] being + * tracked. The [param tracking] argument indicates whether the tracker is getting updated tracking + * data. */ public val trackingChanged: Signal1 by signal("tracking") /** - * The name of the tracker we're bound to. Which trackers are available is not known during design time. - * - * Godot defines a number of standard trackers such as `left_hand` and `right_hand` but others may be configured within a given [godot.XRInterface]. + * The name of the tracker we're bound to. Which trackers are available is not known during design + * time. + * Godot defines a number of standard trackers such as `left_hand` and `right_hand` but others may + * be configured within a given [XRInterface]. */ public var tracker: StringName get() { @@ -58,9 +58,10 @@ public open class XRNode3D internal constructor() : Node3D() { } /** - * The name of the pose we're bound to. Which poses a tracker supports is not known during design time. - * - * Godot defines number of standard pose names such as `aim` and `grip` but other may be configured within a given [godot.XRInterface]. + * The name of the pose we're bound to. Which poses a tracker supports is not known during design + * time. + * Godot defines number of standard pose names such as `aim` and `grip` but other may be + * configured within a given [XRInterface]. */ public var pose: StringName get() { @@ -97,7 +98,8 @@ public open class XRNode3D internal constructor() : Node3D() { } /** - * Returns the [godot.XRPose] containing the current state of the pose being tracked. This gives access to additional properties of this pose. + * Returns the [XRPose] containing the current state of the pose being tracked. This gives access + * to additional properties of this pose. */ public fun getPose(): XRPose? { TransferContext.writeArguments() @@ -107,8 +109,7 @@ public open class XRNode3D internal constructor() : Node3D() { /** * Triggers a haptic pulse on a device associated with this interface. - * - * [actionName] is the name of the action for this pulse. + * [param action_name] is the name of the action for this pulse. */ public fun triggerHapticPulse( actionName: String, diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/XRPose.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/XRPose.kt index 6aca3eb5f..f318a0896 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/XRPose.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/XRPose.kt @@ -28,19 +28,16 @@ import kotlin.Suppress import kotlin.Unit /** - * This object contains all data related to a pose on a tracked object. - * - * Tutorials: - * [$DOCS_URL/tutorials/xr/index.html]($DOCS_URL/tutorials/xr/index.html) - * - * XR runtimes often identify multiple locations on devices such as controllers that are spatially tracked. - * - * Orientation, location, linear velocity and angular velocity are all provided for each pose by the XR runtime. This object contains this state of a pose. + * XR runtimes often identify multiple locations on devices such as controllers that are spatially + * tracked. + * Orientation, location, linear velocity and angular velocity are all provided for each pose by the + * XR runtime. This object contains this state of a pose. */ @GodotBaseType public open class XRPose : RefCounted() { /** - * If `true` our tracking data is up to date. If `false` we're no longer receiving new tracking data and our state is whatever that last valid state was. + * If `true` our tracking data is up to date. If `false` we're no longer receiving new tracking + * data and our state is whatever that last valid state was. */ public var hasTrackingData: Boolean get() { @@ -54,15 +51,15 @@ public open class XRPose : RefCounted() { } /** - * The name of this pose. Pose names are often driven by an action map setup by the user. Godot does suggest a number of pose names that it expects [godot.XRInterface]s to implement: - * - * - `root` defines a root location, often used for tracked objects that do not have further nodes. - * - * - `aim` defines the tip of a controller with the orientation pointing outwards, for example: add your raycasts to this. - * + * The name of this pose. Pose names are often driven by an action map setup by the user. Godot + * does suggest a number of pose names that it expects [XRInterface]s to implement: + * - `root` defines a root location, often used for tracked objects that do not have further + * nodes. + * - `aim` defines the tip of a controller with the orientation pointing outwards, for example: + * add your raycasts to this. * - `grip` defines the location where the user grips the controller - * - * - `skeleton` defines the root location a hand mesh should be placed when using hand tracking and the animated skeleton supplied by the XR runtime. + * - `skeleton` defines the root location a hand mesh should be placed when using hand tracking + * and the animated skeleton supplied by the XR runtime. */ public var name: StringName get() { @@ -121,7 +118,8 @@ public open class XRPose : RefCounted() { } /** - * The tracking confidence for this pose, provides insight on how accurate the spatial positioning of this record is. + * The tracking confidence for this pose, provides insight on how accurate the spatial positioning + * of this record is. */ public var trackingConfidence: TrackingConfidence get() { @@ -212,7 +210,8 @@ public open class XRPose : RefCounted() { /** - * Returns the [transform] with world scale and our reference frame applied. This is the transform used to position [godot.XRNode3D] objects. + * Returns the [transform] with world scale and our reference frame applied. This is the transform + * used to position [XRNode3D] objects. */ public fun getAdjustedTransform(): Transform3D { TransferContext.writeArguments() @@ -228,7 +227,8 @@ public open class XRPose : RefCounted() { */ XR_TRACKING_CONFIDENCE_NONE(0), /** - * Tracking information may be inaccurate or estimated. For example, with inside out tracking this would indicate a controller may be (partially) obscured. + * Tracking information may be inaccurate or estimated. For example, with inside out tracking + * this would indicate a controller may be (partially) obscured. */ XR_TRACKING_CONFIDENCE_LOW(1), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/XRPositionalTracker.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/XRPositionalTracker.kt index 1df23d526..7e3c096c1 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/XRPositionalTracker.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/XRPositionalTracker.kt @@ -36,16 +36,13 @@ import kotlin.Suppress import kotlin.Unit /** - * A tracked object. - * - * Tutorials: - * [$DOCS_URL/tutorials/xr/index.html]($DOCS_URL/tutorials/xr/index.html) - * - * An instance of this object represents a device that is tracked, such as a controller or anchor point. HMDs aren't represented here as they are handled internally. - * - * As controllers are turned on and the [godot.XRInterface] detects them, instances of this object are automatically added to this list of active tracking objects accessible through the [godot.XRServer]. - * - * The [godot.XRController3D] and [godot.XRAnchor3D] both consume objects of this type and should be used in your project. The positional trackers are just under-the-hood objects that make this all work. These are mostly exposed so that GDExtension-based interfaces can interact with them. + * An instance of this object represents a device that is tracked, such as a controller or anchor + * point. HMDs aren't represented here as they are handled internally. + * As controllers are turned on and the [XRInterface] detects them, instances of this object are + * automatically added to this list of active tracking objects accessible through the [XRServer]. + * The [XRController3D] and [XRAnchor3D] both consume objects of this type and should be used in + * your project. The positional trackers are just under-the-hood objects that make this all work. These + * are mostly exposed so that GDExtension-based interfaces can interact with them. */ @GodotBaseType public open class XRPositionalTracker : RefCounted() { @@ -60,7 +57,8 @@ public open class XRPositionalTracker : RefCounted() { public val poseLostTracking: Signal1 by signal("pose") /** - * Emitted when a button on this tracker is pressed. Note that many XR runtimes allow other inputs to be mapped to buttons. + * Emitted when a button on this tracker is pressed. Note that many XR runtimes allow other inputs + * to be mapped to buttons. */ public val buttonPressed: Signal1 by signal("name") @@ -99,10 +97,10 @@ public open class XRPositionalTracker : RefCounted() { } /** - * The unique name of this tracker. The trackers that are available differ between various XR runtimes and can often be configured by the user. Godot maintains a number of reserved names that it expects the [godot.XRInterface] to implement if applicable: - * + * The unique name of this tracker. The trackers that are available differ between various XR + * runtimes and can often be configured by the user. Godot maintains a number of reserved names that + * it expects the [XRInterface] to implement if applicable: * - `left_hand` identifies the controller held in the players left hand - * * - `right_hand` identifies the controller held in the players right hand */ public var name: StringName @@ -131,7 +129,8 @@ public open class XRPositionalTracker : RefCounted() { } /** - * The profile associated with this tracker, interface dependent but will indicate the type of controller being tracked. + * The profile associated with this tracker, interface dependent but will indicate the type of + * controller being tracked. */ public var profile: String get() { @@ -164,7 +163,8 @@ public open class XRPositionalTracker : RefCounted() { } /** - * Returns `true` if the tracker is available and is currently tracking the bound [name] pose. + * Returns `true` if the tracker is available and is currently tracking the bound [param name] + * pose. */ public fun hasPose(name: StringName): Boolean { TransferContext.writeArguments(STRING_NAME to name) @@ -173,7 +173,7 @@ public open class XRPositionalTracker : RefCounted() { } /** - * Returns the current [godot.XRPose] state object for the bound [name] pose. + * Returns the current [XRPose] state object for the bound [param name] pose. */ public fun getPose(name: StringName): XRPose? { TransferContext.writeArguments(STRING_NAME to name) @@ -182,7 +182,9 @@ public open class XRPositionalTracker : RefCounted() { } /** - * Marks this pose as invalid, we don't clear the last reported state but it allows users to decide if trackers need to be hidden if we lose tracking or just remain at their last known position. + * Marks this pose as invalid, we don't clear the last reported state but it allows users to + * decide if trackers need to be hidden if we lose tracking or just remain at their last known + * position. */ public fun invalidatePose(name: StringName): Unit { TransferContext.writeArguments(STRING_NAME to name) @@ -190,7 +192,8 @@ public open class XRPositionalTracker : RefCounted() { } /** - * Sets the transform, linear velocity, angular velocity and tracking confidence for the given pose. This method is called by a [godot.XRInterface] implementation and should not be used directly. + * Sets the transform, linear velocity, angular velocity and tracking confidence for the given + * pose. This method is called by a [XRInterface] implementation and should not be used directly. */ public fun setPose( name: StringName, @@ -204,7 +207,8 @@ public open class XRPositionalTracker : RefCounted() { } /** - * Returns an input for this tracker. It can return a boolean, float or [godot.core.Vector2] value depending on whether the input is a button, trigger or thumbstick/thumbpad. + * Returns an input for this tracker. It can return a boolean, float or [Vector2] value depending + * on whether the input is a button, trigger or thumbstick/thumbpad. */ public fun getInput(name: StringName): Any? { TransferContext.writeArguments(STRING_NAME to name) @@ -213,7 +217,8 @@ public open class XRPositionalTracker : RefCounted() { } /** - * Changes the value for the given input. This method is called by a [godot.XRInterface] implementation and should not be used directly. + * Changes the value for the given input. This method is called by a [XRInterface] implementation + * and should not be used directly. */ public fun setInput(name: StringName, `value`: Any?): Unit { TransferContext.writeArguments(STRING_NAME to name, ANY to value) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/XRServer.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/XRServer.kt index 84fcf1e6e..f701a5ec6 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/XRServer.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/XRServer.kt @@ -37,12 +37,8 @@ import kotlin.Suppress import kotlin.Unit /** - * Server for AR and VR features. - * - * Tutorials: - * [$DOCS_URL/tutorials/xr/index.html]($DOCS_URL/tutorials/xr/index.html) - * - * The AR/VR server is the heart of our Advanced and Virtual Reality solution and handles all the processing. + * The AR/VR server is the heart of our Advanced and Virtual Reality solution and handles all the + * processing. */ @GodotBaseType public object XRServer : Object() { @@ -57,17 +53,23 @@ public object XRServer : Object() { public val interfaceRemoved: Signal1 by signal("interfaceName") /** - * Emitted when a new tracker has been added. If you don't use a fixed number of controllers or if you're using [godot.XRAnchor3D]s for an AR solution, it is important to react to this signal to add the appropriate [godot.XRController3D] or [godot.XRAnchor3D] nodes related to this new tracker. + * Emitted when a new tracker has been added. If you don't use a fixed number of controllers or if + * you're using [XRAnchor3D]s for an AR solution, it is important to react to this signal to add the + * appropriate [XRController3D] or [XRAnchor3D] nodes related to this new tracker. */ public val trackerAdded: Signal2 by signal("trackerName", "type") /** - * Emitted when an existing tracker has been updated. This can happen if the user switches controllers. + * Emitted when an existing tracker has been updated. This can happen if the user switches + * controllers. */ public val trackerUpdated: Signal2 by signal("trackerName", "type") /** - * Emitted when a tracker is removed. You should remove any [godot.XRController3D] or [godot.XRAnchor3D] points if applicable. This is not mandatory, the nodes simply become inactive and will be made active again when a new tracker becomes available (i.e. a new controller is switched on that takes the place of the previous one). + * Emitted when a tracker is removed. You should remove any [XRController3D] or [XRAnchor3D] + * points if applicable. This is not mandatory, the nodes simply become inactive and will be made + * active again when a new tracker becomes available (i.e. a new controller is switched on that takes + * the place of the previous one). */ public val trackerRemoved: Signal2 by signal("trackerName", "type") @@ -99,7 +101,8 @@ public object XRServer : Object() { } /** - * Returns the reference frame transform. Mostly used internally and exposed for GDExtension build interfaces. + * Returns the reference frame transform. Mostly used internally and exposed for GDExtension build + * interfaces. */ public fun getReferenceFrame(): Transform3D { TransferContext.writeArguments() @@ -108,17 +111,21 @@ public object XRServer : Object() { } /** - * This is an important function to understand correctly. AR and VR platforms all handle positioning slightly differently. - * - * For platforms that do not offer spatial tracking, our origin point (0, 0, 0) is the location of our HMD, but you have little control over the direction the player is facing in the real world. - * - * For platforms that do offer spatial tracking, our origin point depends very much on the system. For OpenVR, our origin point is usually the center of the tracking space, on the ground. For other platforms, it's often the location of the tracking camera. - * - * This method allows you to center your tracker on the location of the HMD. It will take the current location of the HMD and use that to adjust all your tracking data; in essence, realigning the real world to your player's current position in the game world. - * - * For this method to produce usable results, tracking information must be available. This often takes a few frames after starting your game. - * - * You should call this method after a few seconds have passed. For example, when the user requests a realignment of the display holding a designated button on a controller for a short period of time, or when implementing a teleport mechanism. + * This is an important function to understand correctly. AR and VR platforms all handle + * positioning slightly differently. + * For platforms that do not offer spatial tracking, our origin point (0, 0, 0) is the location of + * our HMD, but you have little control over the direction the player is facing in the real world. + * For platforms that do offer spatial tracking, our origin point depends very much on the system. + * For OpenVR, our origin point is usually the center of the tracking space, on the ground. For other + * platforms, it's often the location of the tracking camera. + * This method allows you to center your tracker on the location of the HMD. It will take the + * current location of the HMD and use that to adjust all your tracking data; in essence, realigning + * the real world to your player's current position in the game world. + * For this method to produce usable results, tracking information must be available. This often + * takes a few frames after starting your game. + * You should call this method after a few seconds have passed. For example, when the user + * requests a realignment of the display holding a designated button on a controller for a short + * period of time, or when implementing a teleport mechanism. */ public fun centerOnHmd(rotationMode: RotationMode, keepHeight: Boolean): Unit { TransferContext.writeArguments(LONG to rotationMode.id, BOOL to keepHeight) @@ -135,7 +142,7 @@ public object XRServer : Object() { } /** - * Registers an [godot.XRInterface] object. + * Registers an [XRInterface] object. */ public fun addInterface(_interface: XRInterface): Unit { TransferContext.writeArguments(OBJECT to _interface) @@ -143,7 +150,10 @@ public object XRServer : Object() { } /** - * Returns the number of interfaces currently registered with the AR/VR server. If your project supports multiple AR/VR platforms, you can look through the available interface, and either present the user with a selection or simply try to initialize each interface and use the first one that returns `true`. + * Returns the number of interfaces currently registered with the AR/VR server. If your project + * supports multiple AR/VR platforms, you can look through the available interface, and either + * present the user with a selection or simply try to initialize each interface and use the first one + * that returns `true`. */ public fun getInterfaceCount(): Int { TransferContext.writeArguments() @@ -152,7 +162,7 @@ public object XRServer : Object() { } /** - * Removes this [interface]. + * Removes this [param interface]. */ public fun removeInterface(_interface: XRInterface): Unit { TransferContext.writeArguments(OBJECT to _interface) @@ -160,7 +170,7 @@ public object XRServer : Object() { } /** - * Returns the interface registered at the given [idx] index in the list of interfaces. + * Returns the interface registered at the given [param idx] index in the list of interfaces. */ public fun getInterface(idx: Int): XRInterface? { TransferContext.writeArguments(LONG to idx.toLong()) @@ -178,7 +188,8 @@ public object XRServer : Object() { } /** - * Finds an interface by its [name]. For example, if your project uses capabilities of an AR/VR platform, you can find the interface for that platform by name and initialize it. + * Finds an interface by its [param name]. For example, if your project uses capabilities of an + * AR/VR platform, you can find the interface for that platform by name and initialize it. */ public fun findInterface(name: String): XRInterface? { TransferContext.writeArguments(STRING to name) @@ -187,7 +198,7 @@ public object XRServer : Object() { } /** - * Registers a new [godot.XRPositionalTracker] that tracks a spatial location in real space. + * Registers a new [XRPositionalTracker] that tracks a spatial location in real space. */ public fun addTracker(tracker: XRPositionalTracker): Unit { TransferContext.writeArguments(OBJECT to tracker) @@ -195,7 +206,7 @@ public object XRServer : Object() { } /** - * Removes this positional [tracker]. + * Removes this positional [param tracker]. */ public fun removeTracker(tracker: XRPositionalTracker): Unit { TransferContext.writeArguments(OBJECT to tracker) @@ -203,7 +214,7 @@ public object XRServer : Object() { } /** - * Returns a dictionary of trackers for [trackerTypes]. + * Returns a dictionary of trackers for [param tracker_types]. */ public fun getTrackers(trackerTypes: Int): Dictionary { TransferContext.writeArguments(LONG to trackerTypes.toLong()) @@ -212,7 +223,7 @@ public object XRServer : Object() { } /** - * Returns the positional tracker with the given [trackerName]. + * Returns the positional tracker with the given [param tracker_name]. */ public fun getTracker(trackerName: StringName): XRPositionalTracker? { TransferContext.writeArguments(STRING_NAME to trackerName) @@ -235,7 +246,9 @@ public object XRServer : Object() { id: Long, ) { /** - * The tracker tracks the location of the players head. This is usually a location centered between the players eyes. Note that for handheld AR devices this can be the current location of the device. + * The tracker tracks the location of the players head. This is usually a location centered + * between the players eyes. Note that for handheld AR devices this can be the current location of + * the device. */ TRACKER_HEAD(1), /** @@ -278,11 +291,13 @@ public object XRServer : Object() { id: Long, ) { /** - * Fully reset the orientation of the HMD. Regardless of what direction the user is looking to in the real world. The user will look dead ahead in the virtual world. + * Fully reset the orientation of the HMD. Regardless of what direction the user is looking to + * in the real world. The user will look dead ahead in the virtual world. */ RESET_FULL_ROTATION(0), /** - * Resets the orientation but keeps the tilt of the device. So if we're looking down, we keep looking down but heading will be reset. + * Resets the orientation but keeps the tilt of the device. So if we're looking down, we keep + * looking down but heading will be reset. */ RESET_BUT_KEEP_TILT(1), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ZIPPacker.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ZIPPacker.kt index b0c482cf5..abbd63bb3 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ZIPPacker.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ZIPPacker.kt @@ -22,6 +22,22 @@ import kotlin.String import kotlin.Suppress import kotlin.jvm.JvmOverloads +/** + * This class implements a writer that allows storing the multiple blobs in a zip archive. + * [codeblock] + * func write_zip_file(): + * var writer := ZIPPacker.new() + * var err := writer.open("user://archive.zip") + * if err != OK: + * return err + * writer.start_file("hello.txt") + * writer.write_file("Hello World".to_utf8_buffer()) + * writer.close_file() + * + * writer.close() + * return OK + * [/codeblock] + */ @GodotBaseType public open class ZIPPacker : RefCounted() { public override fun new(scriptIndex: Int): Boolean { @@ -29,6 +45,10 @@ public open class ZIPPacker : RefCounted() { return true } + /** + * Opens a zip file for writing at the given path using the specified write mode. + * This must be called before everything else. + */ @JvmOverloads public fun `open`(path: String, append: ZipAppend = ZIPPacker.ZipAppend.APPEND_CREATE): GodotError { @@ -37,24 +57,39 @@ public open class ZIPPacker : RefCounted() { return GodotError.from(TransferContext.readReturnValue(LONG) as Long) } + /** + * Starts writing to a file within the archive. Only one file can be written at the same time. + * Must be called after [open]. + */ public fun startFile(path: String): GodotError { TransferContext.writeArguments(STRING to path) TransferContext.callMethod(rawPtr, MethodBindings.startFilePtr, LONG) return GodotError.from(TransferContext.readReturnValue(LONG) as Long) } + /** + * Write the given [param data] to the file. + * Needs to be called after [startFile]. + */ public fun writeFile(`data`: PackedByteArray): GodotError { TransferContext.writeArguments(PACKED_BYTE_ARRAY to data) TransferContext.callMethod(rawPtr, MethodBindings.writeFilePtr, LONG) return GodotError.from(TransferContext.readReturnValue(LONG) as Long) } + /** + * Stops writing to a file within the archive. + * It will fail if there is no open file. + */ public fun closeFile(): GodotError { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.closeFilePtr, LONG) return GodotError.from(TransferContext.readReturnValue(LONG) as Long) } + /** + * Closes the underlying resources used by this instance. + */ public fun close(): GodotError { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.closePtr, LONG) @@ -64,8 +99,17 @@ public open class ZIPPacker : RefCounted() { public enum class ZipAppend( id: Long, ) { + /** + * Create a new zip archive at the given path. + */ APPEND_CREATE(0), + /** + * Append a new zip archive to the end of the already existing file at the given path. + */ APPEND_CREATEAFTER(1), + /** + * Add new files to the existing zip archive at the given path. + */ APPEND_ADDINZIP(2), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ZIPReader.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ZIPReader.kt index 421cdffb9..0e3ff508a 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ZIPReader.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ZIPReader.kt @@ -25,6 +25,20 @@ import kotlin.String import kotlin.Suppress import kotlin.jvm.JvmOverloads +/** + * This class implements a reader that can extract the content of individual files inside a zip + * archive. + * [codeblock] + * func read_zip_file(): + * var reader := ZIPReader.new() + * var err := reader.open("user://archive.zip") + * if err != OK: + * return PackedByteArray() + * var res := reader.read_file("hello.txt") + * reader.close() + * return res + * [/codeblock] + */ @GodotBaseType public open class ZIPReader : RefCounted() { public override fun new(scriptIndex: Int): Boolean { @@ -32,24 +46,38 @@ public open class ZIPReader : RefCounted() { return true } + /** + * Opens the zip archive at the given [param path] and reads its file index. + */ public fun `open`(path: String): GodotError { TransferContext.writeArguments(STRING to path) TransferContext.callMethod(rawPtr, MethodBindings.openPtr, LONG) return GodotError.from(TransferContext.readReturnValue(LONG) as Long) } + /** + * Closes the underlying resources used by this instance. + */ public fun close(): GodotError { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.closePtr, LONG) return GodotError.from(TransferContext.readReturnValue(LONG) as Long) } + /** + * Returns the list of names of all files in the loaded archive. + * Must be called after [open]. + */ public fun getFiles(): PackedStringArray { TransferContext.writeArguments() TransferContext.callMethod(rawPtr, MethodBindings.getFilesPtr, PACKED_STRING_ARRAY) return (TransferContext.readReturnValue(PACKED_STRING_ARRAY, false) as PackedStringArray) } + /** + * Loads the whole content of a file in the loaded zip archive into memory and returns it. + * Must be called after [open]. + */ @JvmOverloads public fun readFile(path: String, caseSensitive: Boolean = true): PackedByteArray { TransferContext.writeArguments(STRING to path, BOOL to caseSensitive) @@ -57,6 +85,10 @@ public open class ZIPReader : RefCounted() { return (TransferContext.readReturnValue(PACKED_BYTE_ARRAY, false) as PackedByteArray) } + /** + * Returns `true` if the file exists in the loaded zip archive. + * Must be called after [open]. + */ @JvmOverloads public fun fileExists(path: String, caseSensitive: Boolean = true): Boolean { TransferContext.writeArguments(STRING to path, BOOL to caseSensitive) From 5ef8cbb43af3eb025637596f5d47cbc9b4139e7f Mon Sep 17 00:00:00 2001 From: Pierre-Thomas Meisels Date: Thu, 21 Dec 2023 18:44:17 +0100 Subject: [PATCH 2/4] fix(api-gen): regenerate api json and add briefDescription field to raw data models --- .../codegen/constants/JvmReservedMethods.kt | 3 +- .../godot/codegen/models/BuiltinClass.kt | 3 +- .../main/kotlin/godot/codegen/models/Class.kt | 6 +- .../kotlin/godot/codegen/models/Constant.kt | 3 +- .../godot/codegen/models/Constructor.kt | 3 +- .../kotlin/godot/codegen/models/EnumValue.kt | 2 +- .../kotlin/godot/codegen/models/Member.kt | 3 +- .../kotlin/godot/codegen/models/Method.kt | 3 +- .../kotlin/godot/codegen/models/Operator.kt | 3 +- .../kotlin/godot/codegen/models/Property.kt | 3 +- .../kotlin/godot/codegen/models/Signal.kt | 3 +- .../godot/codegen/models/UtilityFunction.kt | 3 +- .../codegen/models/enriched/EnrichedClass.kt | 2 +- .../models/enriched/EnrichedConstant.kt | 2 +- .../codegen/models/enriched/EnrichedMethod.kt | 2 +- .../models/enriched/EnrichedProperty.kt | 2 +- .../codegen/models/enriched/EnrichedSignal.kt | 2 +- .../codegen/services/impl/ClassService.kt | 3 +- .../godot/codegen/traits/IDocumented.kt | 4 +- .../godot/gen/godot/AudioStreamGenerator.kt | 109 +- .../gen/godot/AudioStreamGeneratorPlayback.kt | 25 +- .../gen/godot/AudioStreamPlaybackOggVorbis.kt | 8 - .../kotlin/godot/gen/godot/AudioStreamWAV.kt | 47 +- .../kotlin/godot/gen/godot/CPUParticles2D.kt | 3 +- .../kotlin/godot/gen/godot/CPUParticles3D.kt | 3 +- .../godot/gen/godot/ConcavePolygonShape2D.kt | 33 +- .../godot/gen/godot/ConcavePolygonShape3D.kt | 35 +- .../main/kotlin/godot/gen/godot/Control.kt | 1312 ++++++++--------- .../main/kotlin/godot/gen/godot/DirAccess.kt | 4 +- .../kotlin/godot/gen/godot/ENetConnection.kt | 5 +- .../main/kotlin/godot/gen/godot/FontFile.kt | 178 +-- .../kotlin/godot/gen/godot/GPUParticles2D.kt | 151 +- .../kotlin/godot/gen/godot/GPUParticles3D.kt | 175 ++- .../kotlin/godot/gen/godot/ImmediateMesh.kt | 41 +- .../kotlin/godot/gen/godot/ImporterMesh.kt | 85 +- .../kotlin/godot/gen/godot/InputEventKey.kt | 132 +- .../gen/godot/InputEventMagnifyGesture.kt | 16 +- .../godot/gen/godot/InputEventPanGesture.kt | 13 +- .../main/kotlin/godot/gen/godot/Light3D.kt | 226 +-- .../kotlin/godot/gen/godot/LightOccluder2D.kt | 16 +- .../kotlin/godot/gen/godot/LightmapGIData.kt | 1 - .../main/kotlin/godot/gen/godot/LineEdit.kt | 232 +-- .../main/kotlin/godot/gen/godot/Material.kt | 54 +- .../gen/godot/MultiplayerAPIExtension.kt | 131 +- .../godot/gen/godot/NavigationAgent3D.kt | 4 +- .../gen/godot/OggPacketSequencePlayback.kt | 12 - .../gen/godot/ParticleProcessMaterial.kt | 393 +++-- .../main/kotlin/godot/gen/godot/PopupMenu.kt | 332 +++-- .../kotlin/godot/gen/godot/PropertyHint.kt | 39 + .../main/kotlin/godot/gen/godot/RefCounted.kt | 37 +- .../main/kotlin/godot/gen/godot/Resource.kt | 135 +- .../kotlin/godot/gen/godot/ResourceSaver.kt | 31 +- .../main/kotlin/godot/gen/godot/SceneTree.kt | 272 ++-- .../kotlin/godot/gen/godot/ShapeCast2D.kt | 71 +- .../kotlin/godot/gen/godot/ShapeCast3D.kt | 93 +- .../main/kotlin/godot/gen/godot/SpinBox.kt | 80 +- .../src/main/kotlin/godot/gen/godot/TabBar.kt | 3 +- .../kotlin/godot/gen/godot/TabContainer.kt | 3 +- .../main/kotlin/godot/gen/godot/TextServer.kt | 6 +- .../godot/gen/godot/TextServerExtension.kt | 607 +------- .../kotlin/godot/gen/godot/VideoStream.kt | 17 +- .../gen/godot/VisibleOnScreenEnabler2D.kt | 29 +- .../gen/godot/VisibleOnScreenEnabler3D.kt | 30 +- .../gen/godot/VisibleOnScreenNotifier2D.kt | 22 +- .../gen/godot/VisibleOnScreenNotifier3D.kt | 29 +- 65 files changed, 2463 insertions(+), 2872 deletions(-) diff --git a/kt/api-generator/src/main/kotlin/godot/codegen/constants/JvmReservedMethods.kt b/kt/api-generator/src/main/kotlin/godot/codegen/constants/JvmReservedMethods.kt index 5867c66ac..931475c3d 100644 --- a/kt/api-generator/src/main/kotlin/godot/codegen/constants/JvmReservedMethods.kt +++ b/kt/api-generator/src/main/kotlin/godot/codegen/constants/JvmReservedMethods.kt @@ -15,7 +15,8 @@ val jvmReservedMethods = listOf( returnValue = null, returnType = null, arguments = null, - documentation = null + description = null, + briefDescription = null ), "" ) diff --git a/kt/api-generator/src/main/kotlin/godot/codegen/models/BuiltinClass.kt b/kt/api-generator/src/main/kotlin/godot/codegen/models/BuiltinClass.kt index a501e8e88..5c4c7230b 100644 --- a/kt/api-generator/src/main/kotlin/godot/codegen/models/BuiltinClass.kt +++ b/kt/api-generator/src/main/kotlin/godot/codegen/models/BuiltinClass.kt @@ -14,5 +14,6 @@ data class BuiltinClass @JsonCreator constructor ( @JsonProperty("constants") val constants: List?, @JsonProperty("enums") val enums: List?, @JsonProperty("indexing_return_type") val indexingReturnType: String?, - @JsonProperty("documentation") val documentation: String? + @JsonProperty("description") val description: String?, + @JsonProperty("brief_description") val briefDescription: String? ) diff --git a/kt/api-generator/src/main/kotlin/godot/codegen/models/Class.kt b/kt/api-generator/src/main/kotlin/godot/codegen/models/Class.kt index dec94ce4c..59f0ede3d 100644 --- a/kt/api-generator/src/main/kotlin/godot/codegen/models/Class.kt +++ b/kt/api-generator/src/main/kotlin/godot/codegen/models/Class.kt @@ -14,7 +14,8 @@ data class Class @JsonCreator constructor ( @JsonProperty("properties") val properties: List?, @JsonProperty("constants") val constants: List?, @JsonProperty("signals") val signals : List?, - @JsonProperty("documentation") val documentation: String? + @JsonProperty("description") val description: String?, + @JsonProperty("brief_description") val briefDescription: String? ) { fun copy(newName: String) = Class( newName, @@ -27,6 +28,7 @@ data class Class @JsonCreator constructor ( properties, constants, signals, - documentation + description, + briefDescription ) } \ No newline at end of file diff --git a/kt/api-generator/src/main/kotlin/godot/codegen/models/Constant.kt b/kt/api-generator/src/main/kotlin/godot/codegen/models/Constant.kt index 0ac3fc994..c70650e3f 100644 --- a/kt/api-generator/src/main/kotlin/godot/codegen/models/Constant.kt +++ b/kt/api-generator/src/main/kotlin/godot/codegen/models/Constant.kt @@ -8,5 +8,6 @@ data class Constant @JsonCreator constructor( @JsonProperty("name") val name: String, @JsonProperty("type") val type: String?, @JsonProperty("value") val value: String, - @JsonProperty("documentation") val documentation: String? + @JsonProperty("description") val description: String?, + @JsonProperty("brief_description") val briefDescription: String? ) diff --git a/kt/api-generator/src/main/kotlin/godot/codegen/models/Constructor.kt b/kt/api-generator/src/main/kotlin/godot/codegen/models/Constructor.kt index aaa8adaf6..9dec0131f 100644 --- a/kt/api-generator/src/main/kotlin/godot/codegen/models/Constructor.kt +++ b/kt/api-generator/src/main/kotlin/godot/codegen/models/Constructor.kt @@ -6,5 +6,6 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Constructor @JsonCreator constructor ( @JsonProperty("index") val index : Int, @JsonProperty("arguments") val arguments: List?, - @JsonProperty("documentation") val documentation: String? + @JsonProperty("description") val description: String?, + @JsonProperty("brief_description") val briefDescription: String? ) diff --git a/kt/api-generator/src/main/kotlin/godot/codegen/models/EnumValue.kt b/kt/api-generator/src/main/kotlin/godot/codegen/models/EnumValue.kt index bd73cf427..85d511eaa 100644 --- a/kt/api-generator/src/main/kotlin/godot/codegen/models/EnumValue.kt +++ b/kt/api-generator/src/main/kotlin/godot/codegen/models/EnumValue.kt @@ -7,5 +7,5 @@ import godot.codegen.traits.IDocumented data class EnumValue @JsonCreator constructor( @JsonProperty("name") val name : String, @JsonProperty("value") val value : Long, - @JsonProperty("documentation") override val documentation: String? = null + @JsonProperty("description") override val description: String? = null ) : IDocumented diff --git a/kt/api-generator/src/main/kotlin/godot/codegen/models/Member.kt b/kt/api-generator/src/main/kotlin/godot/codegen/models/Member.kt index c82870fdc..bdc57210f 100644 --- a/kt/api-generator/src/main/kotlin/godot/codegen/models/Member.kt +++ b/kt/api-generator/src/main/kotlin/godot/codegen/models/Member.kt @@ -7,5 +7,6 @@ import godot.codegen.traits.TypedTrait data class Member @JsonCreator constructor( @JsonProperty("name") val name: String, @JsonProperty("type") override val type: String, - @JsonProperty("documentation") val documentation: String? + @JsonProperty("description") val description: String?, + @JsonProperty("brief_description") val briefDescription: String? ) : TypedTrait diff --git a/kt/api-generator/src/main/kotlin/godot/codegen/models/Method.kt b/kt/api-generator/src/main/kotlin/godot/codegen/models/Method.kt index 6e830f9f5..682425e7a 100644 --- a/kt/api-generator/src/main/kotlin/godot/codegen/models/Method.kt +++ b/kt/api-generator/src/main/kotlin/godot/codegen/models/Method.kt @@ -14,5 +14,6 @@ data class Method @JsonCreator constructor( @JsonProperty("return_value") val returnValue : ReturnValue?, @JsonProperty("return_type") val returnType: String?, @JsonProperty("arguments") val arguments : List?, - @JsonProperty("documentation") val documentation: String? + @JsonProperty("description") val description: String?, + @JsonProperty("brief_description") val briefDescription: String? ) diff --git a/kt/api-generator/src/main/kotlin/godot/codegen/models/Operator.kt b/kt/api-generator/src/main/kotlin/godot/codegen/models/Operator.kt index 20acc9fd6..0d5110e1c 100644 --- a/kt/api-generator/src/main/kotlin/godot/codegen/models/Operator.kt +++ b/kt/api-generator/src/main/kotlin/godot/codegen/models/Operator.kt @@ -8,5 +8,6 @@ data class Operator @JsonCreator constructor( @JsonProperty("name") val name : String, @JsonProperty("right_type") val rightType : String?, @JsonProperty("return_type") val returnType : String, - @JsonProperty("documentation") val documentation: String? + @JsonProperty("description") val description: String?, + @JsonProperty("brief_description") val briefDescription: String? ) diff --git a/kt/api-generator/src/main/kotlin/godot/codegen/models/Property.kt b/kt/api-generator/src/main/kotlin/godot/codegen/models/Property.kt index 305086327..8a4f0aba7 100644 --- a/kt/api-generator/src/main/kotlin/godot/codegen/models/Property.kt +++ b/kt/api-generator/src/main/kotlin/godot/codegen/models/Property.kt @@ -10,5 +10,6 @@ data class Property @JsonCreator constructor( @JsonProperty("setter") val setter: String?, @JsonProperty("getter") val getter: String, @JsonProperty("index") val index: Int?, - @JsonProperty("documentation") val documentation: String? + @JsonProperty("description") val description: String?, + @JsonProperty("brief_description") val briefDescription: String? ) : TypedTrait diff --git a/kt/api-generator/src/main/kotlin/godot/codegen/models/Signal.kt b/kt/api-generator/src/main/kotlin/godot/codegen/models/Signal.kt index 72114f66a..aec3a4f75 100644 --- a/kt/api-generator/src/main/kotlin/godot/codegen/models/Signal.kt +++ b/kt/api-generator/src/main/kotlin/godot/codegen/models/Signal.kt @@ -6,5 +6,6 @@ import com.fasterxml.jackson.annotation.JsonProperty data class Signal @JsonCreator constructor( @JsonProperty("name") val name: String, @JsonProperty("arguments") val arguments: List?, - @JsonProperty("documentation") val documentation: String? + @JsonProperty("description") val description: String?, + @JsonProperty("brief_description") val briefDescription: String? ) diff --git a/kt/api-generator/src/main/kotlin/godot/codegen/models/UtilityFunction.kt b/kt/api-generator/src/main/kotlin/godot/codegen/models/UtilityFunction.kt index 5e89202ed..709e636fd 100644 --- a/kt/api-generator/src/main/kotlin/godot/codegen/models/UtilityFunction.kt +++ b/kt/api-generator/src/main/kotlin/godot/codegen/models/UtilityFunction.kt @@ -11,5 +11,6 @@ data class UtilityFunction @JsonCreator constructor ( @JsonProperty("is_vararg") val isVararg : Boolean, @JsonProperty("hash") val hash : Long, @JsonProperty("arguments") val arguments : List?, - @JsonProperty("documentation") val documentation: String? + @JsonProperty("description") val description: String?, + @JsonProperty("brief_description") val briefDescription: String? ) diff --git a/kt/api-generator/src/main/kotlin/godot/codegen/models/enriched/EnrichedClass.kt b/kt/api-generator/src/main/kotlin/godot/codegen/models/enriched/EnrichedClass.kt index 782e0c7af..58bf664a7 100644 --- a/kt/api-generator/src/main/kotlin/godot/codegen/models/enriched/EnrichedClass.kt +++ b/kt/api-generator/src/main/kotlin/godot/codegen/models/enriched/EnrichedClass.kt @@ -17,7 +17,7 @@ class EnrichedClass(val internal: Class) : TypedTrait, IDocumented { val properties= internal.properties?.toEnriched() ?: listOf() val methods = internal.methods?.toEnriched(engineClassDBIndexName) ?: listOf() val apiType = ApiType.from(internal.apiType) - override val documentation = internal.documentation + override val description = internal.description override val type = name diff --git a/kt/api-generator/src/main/kotlin/godot/codegen/models/enriched/EnrichedConstant.kt b/kt/api-generator/src/main/kotlin/godot/codegen/models/enriched/EnrichedConstant.kt index c7dea3b08..84b4f6318 100644 --- a/kt/api-generator/src/main/kotlin/godot/codegen/models/enriched/EnrichedConstant.kt +++ b/kt/api-generator/src/main/kotlin/godot/codegen/models/enriched/EnrichedConstant.kt @@ -7,7 +7,7 @@ import godot.codegen.traits.TypedTrait class EnrichedConstant(val internal: Constant) : TypedTrait, IDocumented { override val type = internal.type?.sanitizeApiType() ?: "int" - override val documentation = internal.documentation + override val description = internal.description } fun List.toEnriched() = map { EnrichedConstant(it) } \ No newline at end of file diff --git a/kt/api-generator/src/main/kotlin/godot/codegen/models/enriched/EnrichedMethod.kt b/kt/api-generator/src/main/kotlin/godot/codegen/models/enriched/EnrichedMethod.kt index 8253aeba9..1af5e2d47 100644 --- a/kt/api-generator/src/main/kotlin/godot/codegen/models/enriched/EnrichedMethod.kt +++ b/kt/api-generator/src/main/kotlin/godot/codegen/models/enriched/EnrichedMethod.kt @@ -36,7 +36,7 @@ class EnrichedMethod(val internal: Method, engineClassIndexName: String) : Calla override val type = internal.returnValue?.type?.sanitizeApiType() override val meta: String? = internal.returnValue?.meta override val nullable = isObjectSubClass() || type == GodotTypes.variant - override val documentation = internal.documentation + override val description = internal.description } fun List.toEnriched(engineClassIndexName: String) = map { EnrichedMethod(it, engineClassIndexName) } diff --git a/kt/api-generator/src/main/kotlin/godot/codegen/models/enriched/EnrichedProperty.kt b/kt/api-generator/src/main/kotlin/godot/codegen/models/enriched/EnrichedProperty.kt index b41d17de5..a66ae58a0 100644 --- a/kt/api-generator/src/main/kotlin/godot/codegen/models/enriched/EnrichedProperty.kt +++ b/kt/api-generator/src/main/kotlin/godot/codegen/models/enriched/EnrichedProperty.kt @@ -49,7 +49,7 @@ class EnrichedProperty(val internal: Property) : CastableTrait, NullableTrait, I override val nullable = isObjectSubClass() || type == GodotTypes.variant override val meta: String? get() = getterMethod?.meta - override val documentation = internal.documentation + override val description = internal.description } fun List.toEnriched() = map { diff --git a/kt/api-generator/src/main/kotlin/godot/codegen/models/enriched/EnrichedSignal.kt b/kt/api-generator/src/main/kotlin/godot/codegen/models/enriched/EnrichedSignal.kt index a8005153a..6953c7efc 100644 --- a/kt/api-generator/src/main/kotlin/godot/codegen/models/enriched/EnrichedSignal.kt +++ b/kt/api-generator/src/main/kotlin/godot/codegen/models/enriched/EnrichedSignal.kt @@ -12,7 +12,7 @@ class EnrichedSignal(val internal: Signal) : TypedTrait, IDocumented { val name = internal.name.convertToCamelCase().escapeKotlinReservedNames() val arguments = internal.arguments?.toEnriched() ?: listOf() override val type = "Signal${arguments.size}" - override val documentation = internal.documentation + override val description = internal.description init{ if (arguments.size > Constraints.MAX_SIGNAL_ARG_COUNT) { diff --git a/kt/api-generator/src/main/kotlin/godot/codegen/services/impl/ClassService.kt b/kt/api-generator/src/main/kotlin/godot/codegen/services/impl/ClassService.kt index 779feb180..19bc4a840 100644 --- a/kt/api-generator/src/main/kotlin/godot/codegen/services/impl/ClassService.kt +++ b/kt/api-generator/src/main/kotlin/godot/codegen/services/impl/ClassService.kt @@ -65,7 +65,8 @@ class ClassService( returnValue = ReturnValue(returnType, null), returnType = null, arguments = arguments, - documentation = null + description = null, + briefDescription = null ), clazz.engineClassDBIndexName ) diff --git a/kt/api-generator/src/main/kotlin/godot/codegen/traits/IDocumented.kt b/kt/api-generator/src/main/kotlin/godot/codegen/traits/IDocumented.kt index 357309bf0..681f62c95 100644 --- a/kt/api-generator/src/main/kotlin/godot/codegen/traits/IDocumented.kt +++ b/kt/api-generator/src/main/kotlin/godot/codegen/traits/IDocumented.kt @@ -22,11 +22,11 @@ private val languages = arrayOf( ) interface IDocumented { - val documentation: String? + val description: String? val sanitizedDocumentation: String? get() { - var unicodeString = documentation + var unicodeString = description ?.replace("/*", "/*") ?.replace("%", "%") ?.replace("*/", "*\") diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamGenerator.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamGenerator.kt index 407288cbb..8363e75d3 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamGenerator.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamGenerator.kt @@ -19,133 +19,84 @@ import kotlin.Int import kotlin.Suppress /** - * An audio stream with utilities for procedural sound generation. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/526](https://godotengine.org/asset-library/asset/526) - * - * [godot.AudioStreamGenerator] is a type of audio stream that does not play back sounds on its own; instead, it expects a script to generate audio data for it. See also [godot.AudioStreamGeneratorPlayback]. - * + * [AudioStreamGenerator] is a type of audio stream that does not play back sounds on its own; + * instead, it expects a script to generate audio data for it. See also [AudioStreamGeneratorPlayback]. * Here's a sample on how to use it to generate a sine wave: * - * [codeblocks] - * - * [gdscript] - * + * gdscript: + * ```gdscript * var playback # Will hold the AudioStreamGeneratorPlayback. - * * @onready var sample_hz = $AudioStreamPlayer.stream.mix_rate - * * var pulse_hz = 440.0 # The frequency of the sound wave. * - * - * * func _ready(): - * * $AudioStreamPlayer.play() - * * playback = $AudioStreamPlayer.get_stream_playback() - * * fill_buffer() * - * - * * func fill_buffer(): - * * var phase = 0.0 - * * var increment = pulse_hz / sample_hz - * * var frames_available = playback.get_frames_available() * - * - * * for i in range(frames_available): - * * playback.push_frame(Vector2.ONE * sin(phase * TAU)) - * * phase = fmod(phase + increment, 1.0) - * - * [/gdscript] - * - * [csharp] - * - * [godot.Export] public AudioStreamPlayer Player { get; set; } - * - * + * ``` + * csharp: + * ```csharp + * [Export] public AudioStreamPlayer Player { get; set; } * * private AudioStreamGeneratorPlayback _playback; // Will hold the AudioStreamGeneratorPlayback. - * * private float _sampleHz; - * * private float _pulseHz = 440.0f; // The frequency of the sound wave. * - * - * * public override void _Ready() - * * { - * - * if (Player.Stream is AudioStreamGenerator generator) // Type as a generator to access MixRate. - * + * if (Player.Stream is AudioStreamGenerator generator) // Type as a generator to access + * MixRate. * { - * * _sampleHz = generator.MixRate; - * * Player.Play(); - * * _playback = (AudioStreamGeneratorPlayback)Player.GetStreamPlayback(); - * * FillBuffer(); - * * } - * * } * - * - * * public void FillBuffer() - * * { - * * double phase = 0.0; - * * float increment = _pulseHz / _sampleHz; - * * int framesAvailable = _playback.GetFramesAvailable(); * - * - * * for (int i = 0; i < framesAvailable; i++) - * * { - * * _playback.PushFrame(Vector2.One * (float)Mathf.Sin(phase * Mathf.Tau)); - * * phase = Mathf.PosMod(phase + increment, 1.0); - * * } - * * } - * - * [/csharp] - * - * [/codeblocks] - * - * In the example above, the "AudioStreamPlayer" node must use an [godot.AudioStreamGenerator] as its stream. The `fill_buffer` function provides audio data for approximating a sine wave. - * - * See also [godot.AudioEffectSpectrumAnalyzer] for performing real-time audio spectrum analysis. - * - * **Note:** Due to performance constraints, this class is best used from C# or from a compiled language via GDExtension. If you still want to use this class from GDScript, consider using a lower [mixRate] such as 11,025 Hz or 22,050 Hz. + * ``` + * + * In the example above, the "AudioStreamPlayer" node must use an [AudioStreamGenerator] as its + * stream. The `fill_buffer` function provides audio data for approximating a sine wave. + * See also [AudioEffectSpectrumAnalyzer] for performing real-time audio spectrum analysis. + * **Note:** Due to performance constraints, this class is best used from C# or from a compiled + * language via GDExtension. If you still want to use this class from GDScript, consider using a lower + * [mixRate] such as 11,025 Hz or 22,050 Hz. */ @GodotBaseType public open class AudioStreamGenerator : AudioStream() { /** - * The sample rate to use (in Hz). Higher values are more demanding for the CPU to generate, but result in better quality. - * - * In games, common sample rates in use are `11025`, `16000`, `22050`, `32000`, `44100`, and `48000`. - * - * According to the [godot.Nyquist-Shannon sampling theorem](https://en.wikipedia.org/wiki/Nyquist%E2%80%93Shannon_sampling_theorem), there is no quality difference to human hearing when going past 40,000 Hz (since most humans can only hear up to ~20,000 Hz, often less). If you are generating lower-pitched sounds such as voices, lower sample rates such as `32000` or `22050` may be usable with no loss in quality. + * The sample rate to use (in Hz). Higher values are more demanding for the CPU to generate, but + * result in better quality. + * In games, common sample rates in use are `11025`, `16000`, `22050`, `32000`, `44100`, and + * `48000`. + * According to the + * [url=https://en.wikipedia.org/wiki/Nyquist%E2%80%93Shannon_sampling_theorem]Nyquist-Shannon + * sampling theorem[/url], there is no quality difference to human hearing when going past 40,000 Hz + * (since most humans can only hear up to ~20,000 Hz, often less). If you are generating + * lower-pitched sounds such as voices, lower sample rates such as `32000` or `22050` may be usable + * with no loss in quality. */ public var mixRate: Float get() { @@ -159,7 +110,9 @@ public open class AudioStreamGenerator : AudioStream() { } /** - * The length of the buffer to generate (in seconds). Lower values result in less latency, but require the script to generate audio data faster, resulting in increased CPU usage and more risk for audio cracking if the CPU can't keep up. + * The length of the buffer to generate (in seconds). Lower values result in less latency, but + * require the script to generate audio data faster, resulting in increased CPU usage and more risk + * for audio cracking if the CPU can't keep up. */ public var bufferLength: Float get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamGeneratorPlayback.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamGeneratorPlayback.kt index f4a5b95a2..eca80c617 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamGeneratorPlayback.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamGeneratorPlayback.kt @@ -24,12 +24,8 @@ import kotlin.Suppress import kotlin.Unit /** - * Plays back audio generated using [godot.AudioStreamGenerator]. - * - * Tutorials: - * [https://godotengine.org/article/godot-32-will-get-new-audio-features](https://godotengine.org/article/godot-32-will-get-new-audio-features) - * - * This class is meant to be used with [godot.AudioStreamGenerator] to play back the generated audio in real-time. + * This class is meant to be used with [AudioStreamGenerator] to play back the generated audio in + * real-time. */ @GodotBaseType public open class AudioStreamGeneratorPlayback internal constructor() : @@ -40,7 +36,9 @@ public open class AudioStreamGeneratorPlayback internal constructor() : } /** - * Pushes a single audio data frame to the buffer. This is usually less efficient than [pushBuffer] in C# and compiled languages via GDExtension, but [pushFrame] may be *more* efficient in GDScript. + * Pushes a single audio data frame to the buffer. This is usually less efficient than + * [pushBuffer] in C# and compiled languages via GDExtension, but [pushFrame] may be *more* efficient + * in GDScript. */ public fun pushFrame(frame: Vector2): Boolean { TransferContext.writeArguments(VECTOR2 to frame) @@ -49,7 +47,8 @@ public open class AudioStreamGeneratorPlayback internal constructor() : } /** - * Returns `true` if a buffer of the size [amount] can be pushed to the audio sample data buffer without overflowing it, `false` otherwise. + * Returns `true` if a buffer of the size [param amount] can be pushed to the audio sample data + * buffer without overflowing it, `false` otherwise. */ public fun canPushBuffer(amount: Int): Boolean { TransferContext.writeArguments(LONG to amount.toLong()) @@ -58,7 +57,9 @@ public open class AudioStreamGeneratorPlayback internal constructor() : } /** - * Pushes several audio data frames to the buffer. This is usually more efficient than [pushFrame] in C# and compiled languages via GDExtension, but [pushBuffer] may be *less* efficient in GDScript. + * Pushes several audio data frames to the buffer. This is usually more efficient than [pushFrame] + * in C# and compiled languages via GDExtension, but [pushBuffer] may be *less* efficient in + * GDScript. */ public fun pushBuffer(frames: PackedVector2Array): Boolean { TransferContext.writeArguments(PACKED_VECTOR2_ARRAY to frames) @@ -67,7 +68,8 @@ public open class AudioStreamGeneratorPlayback internal constructor() : } /** - * Returns the number of frames that can be pushed to the audio sample data buffer without overflowing it. If the result is `0`, the buffer is full. + * Returns the number of frames that can be pushed to the audio sample data buffer without + * overflowing it. If the result is `0`, the buffer is full. */ public fun getFramesAvailable(): Int { TransferContext.writeArguments() @@ -76,7 +78,8 @@ public open class AudioStreamGeneratorPlayback internal constructor() : } /** - * Returns the number of times the playback skipped due to a buffer underrun in the audio sample data. This value is reset at the start of the playback. + * Returns the number of times the playback skipped due to a buffer underrun in the audio sample + * data. This value is reset at the start of the playback. */ public fun getSkips(): Int { TransferContext.writeArguments() diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamPlaybackOggVorbis.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamPlaybackOggVorbis.kt index de8c6d4e7..a31bd6c4c 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamPlaybackOggVorbis.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamPlaybackOggVorbis.kt @@ -11,14 +11,6 @@ import kotlin.Boolean import kotlin.Int import kotlin.Suppress -/** - * Imports Autodesk FBX 3D scenes by way of converting them to glTF 2.0 using the FBX2glTF command - * line tool. - * The location of the FBX2glTF binary is set via the `filesystem/import/fbx/fbx2gltf_path` editor - * setting. - * This importer is only used if [ProjectSettings.filesystem/import/fbx/enabled] is enabled, - * otherwise `.fbx` files present in the project folder are not imported. - */ @GodotBaseType public open class AudioStreamPlaybackOggVorbis : AudioStreamPlaybackResampled() { public override fun new(scriptIndex: Int): Boolean { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamWAV.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamWAV.kt index c0208b608..9b1209874 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamWAV.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/AudioStreamWAV.kt @@ -24,21 +24,18 @@ import kotlin.String import kotlin.Suppress /** - * Stores audio data loaded from WAV files. - * - * Tutorials: - * [$DOCS_URL/tutorials/io/runtime_file_loading_and_saving.html]($DOCS_URL/tutorials/io/runtime_file_loading_and_saving.html) - * - * AudioStreamWAV stores sound samples loaded from WAV files. To play the stored sound, use an [godot.AudioStreamPlayer] (for non-positional audio) or [godot.AudioStreamPlayer2D]/[godot.AudioStreamPlayer3D] (for positional audio). The sound can be looped. - * - * This class can also be used to store dynamically-generated PCM audio data. See also [godot.AudioStreamGenerator] for procedural audio generation. + * AudioStreamWAV stores sound samples loaded from WAV files. To play the stored sound, use an + * [AudioStreamPlayer] (for non-positional audio) or [AudioStreamPlayer2D]/[AudioStreamPlayer3D] (for + * positional audio). The sound can be looped. + * This class can also be used to store dynamically-generated PCM audio data. See also + * [AudioStreamGenerator] for procedural audio generation. */ @GodotBaseType public open class AudioStreamWAV : AudioStream() { /** * Contains the audio data in bytes. - * - * **Note:** This property expects signed PCM8 data. To convert unsigned PCM8 to signed PCM8, subtract 128 from each byte. + * **Note:** This property expects signed PCM8 data. To convert unsigned PCM8 to signed PCM8, + * subtract 128 from each byte. */ public var `data`: PackedByteArray get() { @@ -66,7 +63,8 @@ public open class AudioStreamWAV : AudioStream() { } /** - * The loop mode. This information will be imported automatically from the WAV file if present. See [enum LoopMode] constants for values. + * The loop mode. This information will be imported automatically from the WAV file if present. + * See [enum LoopMode] constants for values. */ public var loopMode: LoopMode get() { @@ -80,7 +78,8 @@ public open class AudioStreamWAV : AudioStream() { } /** - * The loop start point (in number of samples, relative to the beginning of the sample). This information will be imported automatically from the WAV file if present. + * The loop start point (in number of samples, relative to the beginning of the sample). This + * information will be imported automatically from the WAV file if present. */ public var loopBegin: Int get() { @@ -94,7 +93,8 @@ public open class AudioStreamWAV : AudioStream() { } /** - * The loop end point (in number of samples, relative to the beginning of the sample). This information will be imported automatically from the WAV file if present. + * The loop end point (in number of samples, relative to the beginning of the sample). This + * information will be imported automatically from the WAV file if present. */ public var loopEnd: Int get() { @@ -108,11 +108,16 @@ public open class AudioStreamWAV : AudioStream() { } /** - * The sample rate for mixing this audio. Higher values require more storage space, but result in better quality. - * - * In games, common sample rates in use are `11025`, `16000`, `22050`, `32000`, `44100`, and `48000`. - * - * According to the [godot.Nyquist-Shannon sampling theorem](https://en.wikipedia.org/wiki/Nyquist%E2%80%93Shannon_sampling_theorem), there is no quality difference to human hearing when going past 40,000 Hz (since most humans can only hear up to ~20,000 Hz, often less). If you are using lower-pitched sounds such as voices, lower sample rates such as `32000` or `22050` may be usable with no loss in quality. + * The sample rate for mixing this audio. Higher values require more storage space, but result in + * better quality. + * In games, common sample rates in use are `11025`, `16000`, `22050`, `32000`, `44100`, and + * `48000`. + * According to the + * [url=https://en.wikipedia.org/wiki/Nyquist%E2%80%93Shannon_sampling_theorem]Nyquist-Shannon + * sampling theorem[/url], there is no quality difference to human hearing when going past 40,000 Hz + * (since most humans can only hear up to ~20,000 Hz, often less). If you are using lower-pitched + * sounds such as voices, lower sample rates such as `32000` or `22050` may be usable with no loss in + * quality. */ public var mixRate: Int get() { @@ -145,9 +150,9 @@ public open class AudioStreamWAV : AudioStream() { } /** - * Saves the AudioStreamWAV as a WAV file to [path]. Samples with IMA ADPCM format can't be saved. - * - * **Note:** A `.wav` extension is automatically appended to [path] if it is missing. + * Saves the AudioStreamWAV as a WAV file to [param path]. Samples with IMA ADPCM format can't be + * saved. + * **Note:** A `.wav` extension is automatically appended to [param path] if it is missing. */ public fun saveToWav(path: String): GodotError { TransferContext.writeArguments(STRING to path) diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CPUParticles2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CPUParticles2D.kt index b532471cb..53dea4657 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CPUParticles2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CPUParticles2D.kt @@ -1118,7 +1118,8 @@ public open class CPUParticles2D : Node2D() { */ DRAW_ORDER_INDEX(0), /** - * Particles are drawn in order of remaining lifetime. In other words, the particle with the highest lifetime is drawn at the front. + * Particles are drawn in order of remaining lifetime. In other words, the particle with the + * highest lifetime is drawn at the front. */ DRAW_ORDER_LIFETIME(1), ; diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/CPUParticles3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/CPUParticles3D.kt index d66b4205e..660bb0f68 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/CPUParticles3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/CPUParticles3D.kt @@ -1268,7 +1268,8 @@ public open class CPUParticles3D : GeometryInstance3D() { */ DRAW_ORDER_INDEX(0), /** - * Particles are drawn in order of remaining lifetime. In other words, the particle with the highest lifetime is drawn at the front. + * Particles are drawn in order of remaining lifetime. In other words, the particle with the + * highest lifetime is drawn at the front. */ DRAW_ORDER_LIFETIME(1), /** diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ConcavePolygonShape2D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ConcavePolygonShape2D.kt index 13b8f7397..617dd9f17 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ConcavePolygonShape2D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ConcavePolygonShape2D.kt @@ -18,22 +18,31 @@ import kotlin.Int import kotlin.Suppress /** - * A 2D polyline shape used for physics collision. - * - * A 2D polyline shape, intended for use in physics. Used internally in [godot.CollisionPolygon2D] when it's in [godot.CollisionPolygon2D.BUILD_SEGMENTS] mode. - * - * Being just a collection of interconnected line segments, [godot.ConcavePolygonShape2D] is the most freely configurable single 2D shape. It can be used to form polygons of any nature, or even shapes that don't enclose an area. However, [godot.ConcavePolygonShape2D] is *hollow* even if the interconnected line segments do enclose an area, which often makes it unsuitable for physics or detection. - * - * **Note:** When used for collision, [godot.ConcavePolygonShape2D] is intended to work with static [godot.CollisionShape2D] nodes like [godot.StaticBody2D] and will likely not behave well for [godot.CharacterBody2D]s or [godot.RigidBody2D]s in a mode other than Static. - * - * **Warning:** Physics bodies that are small have a chance to clip through this shape when moving fast. This happens because on one frame, the physics body may be on the "outside" of the shape, and on the next frame it may be "inside" it. [godot.ConcavePolygonShape2D] is hollow, so it won't detect a collision. - * - * **Performance:** Due to its complexity, [godot.ConcavePolygonShape2D] is the slowest 2D collision shape to check collisions against. Its use should generally be limited to level geometry. If the polyline is closed, [godot.CollisionPolygon2D]'s [godot.CollisionPolygon2D.BUILD_SOLIDS] mode can be used, which decomposes the polygon into convex ones; see [godot.ConvexPolygonShape2D]'s documentation for instructions. + * A 2D polyline shape, intended for use in physics. Used internally in [CollisionPolygon2D] when + * it's in [constant CollisionPolygon2D.BUILD_SEGMENTS] mode. + * Being just a collection of interconnected line segments, [ConcavePolygonShape2D] is the most + * freely configurable single 2D shape. It can be used to form polygons of any nature, or even shapes + * that don't enclose an area. However, [ConcavePolygonShape2D] is *hollow* even if the interconnected + * line segments do enclose an area, which often makes it unsuitable for physics or detection. + * **Note:** When used for collision, [ConcavePolygonShape2D] is intended to work with static + * [CollisionShape2D] nodes like [StaticBody2D] and will likely not behave well for [CharacterBody2D]s + * or [RigidBody2D]s in a mode other than Static. + * **Warning:** Physics bodies that are small have a chance to clip through this shape when moving + * fast. This happens because on one frame, the physics body may be on the "outside" of the shape, and + * on the next frame it may be "inside" it. [ConcavePolygonShape2D] is hollow, so it won't detect a + * collision. + * **Performance:** Due to its complexity, [ConcavePolygonShape2D] is the slowest 2D collision shape + * to check collisions against. Its use should generally be limited to level geometry. If the polyline + * is closed, [CollisionPolygon2D]'s [constant CollisionPolygon2D.BUILD_SOLIDS] mode can be used, which + * decomposes the polygon into convex ones; see [ConvexPolygonShape2D]'s documentation for + * instructions. */ @GodotBaseType public open class ConcavePolygonShape2D : Shape2D() { /** - * The array of points that make up the [godot.ConcavePolygonShape2D]'s line segments. The array (of length divisible by two) is naturally divided into pairs (one pair for each segment); each pair consists of the starting point of a segment and the endpoint of a segment. + * The array of points that make up the [ConcavePolygonShape2D]'s line segments. The array (of + * length divisible by two) is naturally divided into pairs (one pair for each segment); each pair + * consists of the starting point of a segment and the endpoint of a segment. */ public var segments: PackedVector2Array get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/ConcavePolygonShape3D.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/ConcavePolygonShape3D.kt index 3a21539f5..20694d590 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/ConcavePolygonShape3D.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/ConcavePolygonShape3D.kt @@ -19,20 +19,24 @@ import kotlin.Int import kotlin.Suppress /** - * A 3D trimesh shape used for physics collision. - * - * Tutorials: - * [https://godotengine.org/asset-library/asset/675](https://godotengine.org/asset-library/asset/675) - * - * A 3D trimesh shape, intended for use in physics. Usually used to provide a shape for a [godot.CollisionShape3D]. - * - * Being just a collection of interconnected triangles, [godot.ConcavePolygonShape3D] is the most freely configurable single 3D shape. It can be used to form polyhedra of any nature, or even shapes that don't enclose a volume. However, [godot.ConcavePolygonShape3D] is *hollow* even if the interconnected triangles do enclose a volume, which often makes it unsuitable for physics or detection. - * - * **Note:** When used for collision, [godot.ConcavePolygonShape3D] is intended to work with static [godot.CollisionShape3D] nodes like [godot.StaticBody3D] and will likely not behave well for [godot.CharacterBody3D]s or [godot.RigidBody3D]s in a mode other than Static. - * - * **Warning:** Physics bodies that are small have a chance to clip through this shape when moving fast. This happens because on one frame, the physics body may be on the "outside" of the shape, and on the next frame it may be "inside" it. [godot.ConcavePolygonShape3D] is hollow, so it won't detect a collision. - * - * **Performance:** Due to its complexity, [godot.ConcavePolygonShape3D] is the slowest 3D collision shape to check collisions against. Its use should generally be limited to level geometry. For convex geometry, [godot.ConvexPolygonShape3D] should be used. For dynamic physics bodies that need concave collision, several [godot.ConvexPolygonShape3D]s can be used to represent its collision by using convex decomposition; see [godot.ConvexPolygonShape3D]'s documentation for instructions. + * A 3D trimesh shape, intended for use in physics. Usually used to provide a shape for a + * [CollisionShape3D]. + * Being just a collection of interconnected triangles, [ConcavePolygonShape3D] is the most freely + * configurable single 3D shape. It can be used to form polyhedra of any nature, or even shapes that + * don't enclose a volume. However, [ConcavePolygonShape3D] is *hollow* even if the interconnected + * triangles do enclose a volume, which often makes it unsuitable for physics or detection. + * **Note:** When used for collision, [ConcavePolygonShape3D] is intended to work with static + * [CollisionShape3D] nodes like [StaticBody3D] and will likely not behave well for [CharacterBody3D]s + * or [RigidBody3D]s in a mode other than Static. + * **Warning:** Physics bodies that are small have a chance to clip through this shape when moving + * fast. This happens because on one frame, the physics body may be on the "outside" of the shape, and + * on the next frame it may be "inside" it. [ConcavePolygonShape3D] is hollow, so it won't detect a + * collision. + * **Performance:** Due to its complexity, [ConcavePolygonShape3D] is the slowest 3D collision shape + * to check collisions against. Its use should generally be limited to level geometry. For convex + * geometry, [ConvexPolygonShape3D] should be used. For dynamic physics bodies that need concave + * collision, several [ConvexPolygonShape3D]s can be used to represent its collision by using convex + * decomposition; see [ConvexPolygonShape3D]'s documentation for instructions. */ @GodotBaseType public open class ConcavePolygonShape3D : Shape3D() { @@ -48,7 +52,8 @@ public open class ConcavePolygonShape3D : Shape3D() { } /** - * If set to `true`, collisions occur on both sides of the concave shape faces. Otherwise they occur only along the face normals. + * If set to `true`, collisions occur on both sides of the concave shape faces. Otherwise they + * occur only along the face normals. */ public var backfaceCollision: Boolean get() { diff --git a/kt/godot-library/src/main/kotlin/godot/gen/godot/Control.kt b/kt/godot-library/src/main/kotlin/godot/gen/godot/Control.kt index 60adc0958..bd2624551 100644 --- a/kt/godot-library/src/main/kotlin/godot/gen/godot/Control.kt +++ b/kt/godot-library/src/main/kotlin/godot/gen/godot/Control.kt @@ -50,30 +50,35 @@ import kotlin.jvm.JvmInline import kotlin.jvm.JvmOverloads /** - * Base class for all GUI controls. Adapts its position and size based on its parent control. - * - * Tutorials: - * [https://github.com/godotengine/godot-demo-projects/tree/master/gui](https://github.com/godotengine/godot-demo-projects/tree/master/gui) - * - * Base class for all UI-related nodes. [godot.Control] features a bounding rectangle that defines its extents, an anchor position relative to its parent control or the current viewport, and offsets relative to the anchor. The offsets update automatically when the node, any of its parents, or the screen size change. - * - * For more information on Godot's UI system, anchors, offsets, and containers, see the related tutorials in the manual. To build flexible UIs, you'll need a mix of UI elements that inherit from [godot.Control] and [godot.Container] nodes. - * + * Base class for all UI-related nodes. [Control] features a bounding rectangle that defines its + * extents, an anchor position relative to its parent control or the current viewport, and offsets + * relative to the anchor. The offsets update automatically when the node, any of its parents, or the + * screen size change. + * For more information on Godot's UI system, anchors, offsets, and containers, see the related + * tutorials in the manual. To build flexible UIs, you'll need a mix of UI elements that inherit from + * [Control] and [Container] nodes. * **User Interface nodes and input** - * - * Godot propagates input events via viewports. Each [godot.Viewport] is responsible for propagating [godot.InputEvent]s to their child nodes. As the [godot.SceneTree.root] is a [godot.Window], this already happens automatically for all UI elements in your game. - * - * Input events are propagated through the [godot.SceneTree] from the root node to all child nodes by calling [godot.Node.Input]. For UI elements specifically, it makes more sense to override the virtual method [_guiInput], which filters out unrelated input events, such as by checking z-order, [mouseFilter], focus, or if the event was inside of the control's bounding box. - * - * Call [acceptEvent] so no other node receives the event. Once you accept an input, it becomes handled so [godot.Node.UnhandledInput] will not process it. - * - * Only one [godot.Control] node can be in focus. Only the node in focus will receive events. To get the focus, call [grabFocus]. [godot.Control] nodes lose focus when another node grabs it, or if you hide the node in focus. - * - * Sets [mouseFilter] to [MOUSE_FILTER_IGNORE] to tell a [godot.Control] node to ignore mouse or touch events. You'll need it if you place an icon on top of a button. - * - * [godot.Theme] resources change the Control's appearance. If you change the [godot.Theme] on a [godot.Control] node, it affects all of its children. To override some of the theme's parameters, call one of the `add_theme_*_override` methods, like [addThemeFontOverride]. You can override the theme with the Inspector. - * - * **Note:** Theme items are *not* [godot.Object] properties. This means you can't access their values using [godot.Object.get] and [godot.Object.set]. Instead, use the `get_theme_*` and `add_theme_*_override` methods provided by this class. + * Godot propagates input events via viewports. Each [Viewport] is responsible for propagating + * [InputEvent]s to their child nodes. As the [SceneTree.root] is a [Window], this already happens + * automatically for all UI elements in your game. + * Input events are propagated through the [SceneTree] from the root node to all child nodes by + * calling [Node.Input]. For UI elements specifically, it makes more sense to override the virtual + * method [_guiInput], which filters out unrelated input events, such as by checking z-order, + * [mouseFilter], focus, or if the event was inside of the control's bounding box. + * Call [acceptEvent] so no other node receives the event. Once you accept an input, it becomes + * handled so [Node.UnhandledInput] will not process it. + * Only one [Control] node can be in focus. Only the node in focus will receive events. To get the + * focus, call [grabFocus]. [Control] nodes lose focus when another node grabs it, or if you hide the + * node in focus. + * Sets [mouseFilter] to [constant MOUSE_FILTER_IGNORE] to tell a [Control] node to ignore mouse or + * touch events. You'll need it if you place an icon on top of a button. + * [Theme] resources change the Control's appearance. If you change the [Theme] on a [Control] node, + * it affects all of its children. To override some of the theme's parameters, call one of the + * `add_theme_*_override` methods, like [addThemeFontOverride]. You can override the theme with the + * Inspector. + * **Note:** Theme items are *not* [Object] properties. This means you can't access their values + * using [Object.get] and [Object.set]. Instead, use the `get_theme_*` and `add_theme_*_override` + * methods provided by this class. */ @GodotBaseType public open class Control : CanvasItem() { @@ -83,29 +88,30 @@ public open class Control : CanvasItem() { public val resized: Signal0 by signal() /** - * Emitted when the node receives an [godot.InputEvent]. + * Emitted when the node receives an [InputEvent]. */ public val guiInput: Signal1 by signal("event") /** - * Emitted when the mouse cursor enters the control's (or any child control's) visible area, that is not occluded behind other Controls or Windows, provided its [mouseFilter] lets the event reach it and regardless if it's currently focused or not. - * - * **Note:** [godot.CanvasItem.zIndex] doesn't affect, which Control receives the signal. + * Emitted when the mouse cursor enters the control's (or any child control's) visible area, that + * is not occluded behind other Controls or Windows, provided its [mouseFilter] lets the event reach + * it and regardless if it's currently focused or not. + * **Note:** [CanvasItem.zIndex] doesn't affect, which Control receives the signal. */ public val mouseEntered: Signal0 by signal() /** - * Emitted when the mouse cursor leaves the control's (and all child control's) visible area, that is not occluded behind other Controls or Windows, provided its [mouseFilter] lets the event reach it and regardless if it's currently focused or not. - * - * **Note:** [godot.CanvasItem.zIndex] doesn't affect, which Control receives the signal. - * - * **Note:** If you want to check whether the mouse truly left the area, ignoring any top nodes, you can use code like this: - * - * ``` - * func _on_mouse_exited(): - * if not Rect2(Vector2(), size).has_point(get_local_mouse_position()): - * # Not hovering over area. - * ``` + * Emitted when the mouse cursor leaves the control's (and all child control's) visible area, that + * is not occluded behind other Controls or Windows, provided its [mouseFilter] lets the event reach + * it and regardless if it's currently focused or not. + * **Note:** [CanvasItem.zIndex] doesn't affect, which Control receives the signal. + * **Note:** If you want to check whether the mouse truly left the area, ignoring any top nodes, + * you can use code like this: + * [codeblock] + * func _on_mouse_exited(): + * if not Rect2(Vector2(), size).has_point(get_local_mouse_position()): + * # Not hovering over area. + * [/codeblock] */ public val mouseExited: Signal0 by signal() @@ -130,12 +136,14 @@ public open class Control : CanvasItem() { public val minimumSizeChanged: Signal0 by signal() /** - * Emitted when the [NOTIFICATION_THEME_CHANGED] notification is sent. + * Emitted when the [constant NOTIFICATION_THEME_CHANGED] notification is sent. */ public val themeChanged: Signal0 by signal() /** - * Enables whether rendering of [godot.CanvasItem] based children should be clipped to this control's rectangle. If `true`, parts of a child which would be visibly outside of this control's rectangle will not be rendered and won't receive input. + * Enables whether rendering of [CanvasItem] based children should be clipped to this control's + * rectangle. If `true`, parts of a child which would be visibly outside of this control's rectangle + * will not be rendered and won't receive input. */ public var clipContents: Boolean get() { @@ -149,7 +157,10 @@ public open class Control : CanvasItem() { } /** - * The minimum size of the node's bounding rectangle. If you set it to a value greater than (0, 0), the node's bounding rectangle will always have at least this size, even if its content is smaller. If it's set to (0, 0), the node sizes automatically to fit its content, be it a texture or child nodes. + * The minimum size of the node's bounding rectangle. If you set it to a value greater than (0, + * 0), the node's bounding rectangle will always have at least this size, even if its content is + * smaller. If it's set to (0, 0), the node sizes automatically to fit its content, be it a texture + * or child nodes. */ @CoreTypeLocalCopy public var customMinimumSize: Vector2 @@ -164,7 +175,8 @@ public open class Control : CanvasItem() { } /** - * Controls layout direction and text writing direction. Right-to-left layouts are necessary for certain languages (e.g. Arabic and Hebrew). + * Controls layout direction and text writing direction. Right-to-left layouts are necessary for + * certain languages (e.g. Arabic and Hebrew). */ public var layoutDirection: LayoutDirection get() { @@ -178,7 +190,9 @@ public open class Control : CanvasItem() { } /** - * Anchors the left edge of the node to the origin, the center or the end of its parent control. It changes how the left offset updates when the node moves or changes size. You can use one of the [enum Anchor] constants for convenience. + * Anchors the left edge of the node to the origin, the center or the end of its parent control. + * It changes how the left offset updates when the node moves or changes size. You can use one of the + * [enum Anchor] constants for convenience. */ public val anchorLeft: Float get() { @@ -188,7 +202,9 @@ public open class Control : CanvasItem() { } /** - * Anchors the top edge of the node to the origin, the center or the end of its parent control. It changes how the top offset updates when the node moves or changes size. You can use one of the [enum Anchor] constants for convenience. + * Anchors the top edge of the node to the origin, the center or the end of its parent control. It + * changes how the top offset updates when the node moves or changes size. You can use one of the + * [enum Anchor] constants for convenience. */ public val anchorTop: Float get() { @@ -198,7 +214,9 @@ public open class Control : CanvasItem() { } /** - * Anchors the right edge of the node to the origin, the center or the end of its parent control. It changes how the right offset updates when the node moves or changes size. You can use one of the [enum Anchor] constants for convenience. + * Anchors the right edge of the node to the origin, the center or the end of its parent control. + * It changes how the right offset updates when the node moves or changes size. You can use one of + * the [enum Anchor] constants for convenience. */ public val anchorRight: Float get() { @@ -208,7 +226,9 @@ public open class Control : CanvasItem() { } /** - * Anchors the bottom edge of the node to the origin, the center, or the end of its parent control. It changes how the bottom offset updates when the node moves or changes size. You can use one of the [enum Anchor] constants for convenience. + * Anchors the bottom edge of the node to the origin, the center, or the end of its parent + * control. It changes how the bottom offset updates when the node moves or changes size. You can use + * one of the [enum Anchor] constants for convenience. */ public val anchorBottom: Float get() { @@ -219,8 +239,9 @@ public open class Control : CanvasItem() { /** * Distance between the node's left edge and its parent control, based on [anchorLeft]. - * - * Offsets are often controlled by one or multiple parent [godot.Container] nodes, so you should not modify them manually if your node is a direct child of a [godot.Container]. Offsets update automatically when you move or resize the node. + * Offsets are often controlled by one or multiple parent [Container] nodes, so you should not + * modify them manually if your node is a direct child of a [Container]. Offsets update automatically + * when you move or resize the node. */ public var offsetLeft: Float get() { @@ -235,8 +256,9 @@ public open class Control : CanvasItem() { /** * Distance between the node's top edge and its parent control, based on [anchorTop]. - * - * Offsets are often controlled by one or multiple parent [godot.Container] nodes, so you should not modify them manually if your node is a direct child of a [godot.Container]. Offsets update automatically when you move or resize the node. + * Offsets are often controlled by one or multiple parent [Container] nodes, so you should not + * modify them manually if your node is a direct child of a [Container]. Offsets update automatically + * when you move or resize the node. */ public var offsetTop: Float get() { @@ -251,8 +273,9 @@ public open class Control : CanvasItem() { /** * Distance between the node's right edge and its parent control, based on [anchorRight]. - * - * Offsets are often controlled by one or multiple parent [godot.Container] nodes, so you should not modify them manually if your node is a direct child of a [godot.Container]. Offsets update automatically when you move or resize the node. + * Offsets are often controlled by one or multiple parent [Container] nodes, so you should not + * modify them manually if your node is a direct child of a [Container]. Offsets update automatically + * when you move or resize the node. */ public var offsetRight: Float get() { @@ -267,8 +290,9 @@ public open class Control : CanvasItem() { /** * Distance between the node's bottom edge and its parent control, based on [anchorBottom]. - * - * Offsets are often controlled by one or multiple parent [godot.Container] nodes, so you should not modify them manually if your node is a direct child of a [godot.Container]. Offsets update automatically when you move or resize the node. + * Offsets are often controlled by one or multiple parent [Container] nodes, so you should not + * modify them manually if your node is a direct child of a [Container]. Offsets update automatically + * when you move or resize the node. */ public var offsetBottom: Float get() { @@ -282,7 +306,9 @@ public open class Control : CanvasItem() { } /** - * Controls the direction on the horizontal axis in which the control should grow if its horizontal minimum size is changed to be greater than its current size, as the control always has to be at least the minimum size. + * Controls the direction on the horizontal axis in which the control should grow if its + * horizontal minimum size is changed to be greater than its current size, as the control always has + * to be at least the minimum size. */ public var growHorizontal: GrowDirection get() { @@ -296,7 +322,9 @@ public open class Control : CanvasItem() { } /** - * Controls the direction on the vertical axis in which the control should grow if its vertical minimum size is changed to be greater than its current size, as the control always has to be at least the minimum size. + * Controls the direction on the vertical axis in which the control should grow if its vertical + * minimum size is changed to be greater than its current size, as the control always has to be at + * least the minimum size. */ public var growVertical: GrowDirection get() { @@ -310,7 +338,8 @@ public open class Control : CanvasItem() { } /** - * The size of the node's bounding rectangle, in the node's coordinate system. [godot.Container] nodes update this property automatically. + * The size of the node's bounding rectangle, in the node's coordinate system. [Container] nodes + * update this property automatically. */ @CoreTypeLocalCopy public val size: Vector2 @@ -321,7 +350,8 @@ public open class Control : CanvasItem() { } /** - * The node's position, relative to its containing node. It corresponds to the rectangle's top-left corner. The property is not affected by [pivotOffset]. + * The node's position, relative to its containing node. It corresponds to the rectangle's + * top-left corner. The property is not affected by [pivotOffset]. */ @CoreTypeLocalCopy public val position: Vector2 @@ -332,7 +362,7 @@ public open class Control : CanvasItem() { } /** - * The node's global position, relative to the world (usually to the [godot.CanvasLayer]). + * The node's global position, relative to the world (usually to the [CanvasLayer]). */ @CoreTypeLocalCopy public val globalPosition: Vector2 @@ -343,9 +373,10 @@ public open class Control : CanvasItem() { } /** - * The node's rotation around its pivot, in radians. See [pivotOffset] to change the pivot's position. - * - * **Note:** This property is edited in the inspector in degrees. If you want to use degrees in a script, use [rotationDegrees]. + * The node's rotation around its pivot, in radians. See [pivotOffset] to change the pivot's + * position. + * **Note:** This property is edited in the inspector in degrees. If you want to use degrees in a + * script, use [rotationDegrees]. */ public var rotation: Float get() { @@ -373,13 +404,22 @@ public open class Control : CanvasItem() { } /** - * The node's scale, relative to its [size]. Change this property to scale the node around its [pivotOffset]. The Control's [tooltipText] will also scale according to this value. - * - * **Note:** This property is mainly intended to be used for animation purposes. To support multiple resolutions in your project, use an appropriate viewport stretch mode as described in the [documentation]($DOCS_URL/tutorials/rendering/multiple_resolutions.html) instead of scaling Controls individually. - * - * **Note:** [godot.FontFile.oversampling] does *not* take [godot.Control] [scale] into account. This means that scaling up/down will cause bitmap fonts and rasterized (non-MSDF) dynamic fonts to appear blurry or pixelated. To ensure text remains crisp regardless of scale, you can enable MSDF font rendering by enabling [godot.ProjectSettings.gui/theme/defaultFontMultichannelSignedDistanceField] (applies to the default project font only), or enabling **Multichannel Signed Distance Field** in the import options of a DynamicFont for custom fonts. On system fonts, [godot.SystemFont.multichannelSignedDistanceField] can be enabled in the inspector. - * - * **Note:** If the Control node is a child of a [godot.Container] node, the scale will be reset to `Vector2(1, 1)` when the scene is instantiated. To set the Control's scale when it's instantiated, wait for one frame using `await get_tree().process_frame` then set its [scale] property. + * The node's scale, relative to its [size]. Change this property to scale the node around its + * [pivotOffset]. The Control's [tooltipText] will also scale according to this value. + * **Note:** This property is mainly intended to be used for animation purposes. To support + * multiple resolutions in your project, use an appropriate viewport stretch mode as described in the + * [url=$DOCS_URL/tutorials/rendering/multiple_resolutions.html]documentation[/url] instead of + * scaling Controls individually. + * **Note:** [FontFile.oversampling] does *not* take [Control] [scale] into account. This means + * that scaling up/down will cause bitmap fonts and rasterized (non-MSDF) dynamic fonts to appear + * blurry or pixelated. To ensure text remains crisp regardless of scale, you can enable MSDF font + * rendering by enabling [ProjectSettings.gui/theme/defaultFontMultichannelSignedDistanceField] + * (applies to the default project font only), or enabling **Multichannel Signed Distance Field** in + * the import options of a DynamicFont for custom fonts. On system fonts, + * [SystemFont.multichannelSignedDistanceField] can be enabled in the inspector. + * **Note:** If the Control node is a child of a [Container] node, the scale will be reset to + * `Vector2(1, 1)` when the scene is instantiated. To set the Control's scale when it's instantiated, + * wait for one frame using `await get_tree().process_frame` then set its [scale] property. */ @CoreTypeLocalCopy public var scale: Vector2 @@ -394,7 +434,9 @@ public open class Control : CanvasItem() { } /** - * By default, the node's pivot is its top-left corner. When you change its [rotation] or [scale], it will rotate or scale around this pivot. Set this property to [size] / 2 to pivot around the Control's center. + * By default, the node's pivot is its top-left corner. When you change its [rotation] or [scale], + * it will rotate or scale around this pivot. Set this property to [size] / 2 to pivot around the + * Control's center. */ @CoreTypeLocalCopy public var pivotOffset: Vector2 @@ -409,7 +451,9 @@ public open class Control : CanvasItem() { } /** - * Tells the parent [godot.Container] nodes how they should resize and place the node on the X axis. Use a combination of the [enum SizeFlags] constants to change the flags. See the constants to learn what each does. + * Tells the parent [Container] nodes how they should resize and place the node on the X axis. Use + * a combination of the [enum SizeFlags] constants to change the flags. See the constants to learn + * what each does. */ public var sizeFlagsHorizontal: SizeFlags get() { @@ -423,7 +467,9 @@ public open class Control : CanvasItem() { } /** - * Tells the parent [godot.Container] nodes how they should resize and place the node on the Y axis. Use a combination of the [enum SizeFlags] constants to change the flags. See the constants to learn what each does. + * Tells the parent [Container] nodes how they should resize and place the node on the Y axis. Use + * a combination of the [enum SizeFlags] constants to change the flags. See the constants to learn + * what each does. */ public var sizeFlagsVertical: SizeFlags get() { @@ -437,7 +483,10 @@ public open class Control : CanvasItem() { } /** - * If the node and at least one of its neighbors uses the [SIZE_EXPAND] size flag, the parent [godot.Container] will let it take more or less space depending on this property. If this node has a stretch ratio of 2 and its neighbor a ratio of 1, this node will take two thirds of the available space. + * If the node and at least one of its neighbors uses the [constant SIZE_EXPAND] size flag, the + * parent [Container] will let it take more or less space depending on this property. If this node + * has a stretch ratio of 2 and its neighbor a ratio of 1, this node will take two thirds of the + * available space. */ public var sizeFlagsStretchRatio: Float get() { @@ -451,8 +500,8 @@ public open class Control : CanvasItem() { } /** - * Toggles if any text should automatically change to its translated version depending on the current locale. - * + * Toggles if any text should automatically change to its translated version depending on the + * current locale. * Also decides if the node's strings should be parsed for POT generation. */ public var autoTranslate: Boolean @@ -467,9 +516,10 @@ public open class Control : CanvasItem() { } /** - * If `true`, automatically converts code line numbers, list indices, [godot.SpinBox] and [godot.ProgressBar] values from the Western Arabic (0..9) to the numeral systems used in current locale. - * - * **Note:** Numbers within the text are not automatically converted, it can be done manually, using [godot.TextServer.formatNumber]. + * If `true`, automatically converts code line numbers, list indices, [SpinBox] and [ProgressBar] + * values from the Western Arabic (0..9) to the numeral systems used in current locale. + * **Note:** Numbers within the text are not automatically converted, it can be done manually, + * using [TextServer.formatNumber]. */ public var localizeNumeralSystem: Boolean get() { @@ -483,45 +533,33 @@ public open class Control : CanvasItem() { } /** - * The default tooltip text. The tooltip appears when the user's mouse cursor stays idle over this control for a few moments, provided that the [mouseFilter] property is not [MOUSE_FILTER_IGNORE]. The time required for the tooltip to appear can be changed with the [godot.ProjectSettings.gui/timers/tooltipDelaySec] option. See also [getTooltip]. - * - * The tooltip popup will use either a default implementation, or a custom one that you can provide by overriding [_makeCustomTooltip]. The default tooltip includes a [godot.PopupPanel] and [godot.Label] whose theme properties can be customized using [godot.Theme] methods with the `"TooltipPanel"` and `"TooltipLabel"` respectively. For example: - * - * [codeblocks] - * - * [gdscript] + * The default tooltip text. The tooltip appears when the user's mouse cursor stays idle over this + * control for a few moments, provided that the [mouseFilter] property is not [constant + * MOUSE_FILTER_IGNORE]. The time required for the tooltip to appear can be changed with the + * [ProjectSettings.gui/timers/tooltipDelaySec] option. See also [getTooltip]. + * The tooltip popup will use either a default implementation, or a custom one that you can + * provide by overriding [_makeCustomTooltip]. The default tooltip includes a [PopupPanel] and + * [Label] whose theme properties can be customized using [Theme] methods with the `"TooltipPanel"` + * and `"TooltipLabel"` respectively. For example: * + * gdscript: + * ```gdscript * var style_box = StyleBoxFlat.new() - * * style_box.set_bg_color(Color(1, 1, 0)) - * * style_box.set_border_width_all(2) - * * # We assume here that the `theme` property has been assigned a custom Theme beforehand. - * * theme.set_stylebox("panel", "TooltipPanel", style_box) - * * theme.set_color("font_color", "TooltipLabel", Color(0, 1, 1)) - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * var styleBox = new StyleBoxFlat(); - * * styleBox.SetBgColor(new Color(1, 1, 0)); - * * styleBox.SetBorderWidthAll(2); - * * // We assume here that the `Theme` property has been assigned a custom Theme beforehand. - * * Theme.SetStyleBox("panel", "TooltipPanel", styleBox); - * * Theme.SetColor("font_color", "TooltipLabel", new Color(0, 1, 1)); - * - * [/csharp] - * - * [/codeblocks] + * ``` */ public var tooltipText: String get() { @@ -535,7 +573,10 @@ public open class Control : CanvasItem() { } /** - * Tells Godot which node it should give focus to if the user presses the left arrow on the keyboard or left on a gamepad by default. You can change the key by editing the [godot.ProjectSettings.input/uiLeft] input action. The node must be a [godot.Control]. If this property is not set, Godot will give focus to the closest [godot.Control] to the left of this one. + * Tells Godot which node it should give focus to if the user presses the left arrow on the + * keyboard or left on a gamepad by default. You can change the key by editing the + * [ProjectSettings.input/uiLeft] input action. The node must be a [Control]. If this property is not + * set, Godot will give focus to the closest [Control] to the left of this one. */ public var focusNeighborLeft: NodePath get() { @@ -549,7 +590,10 @@ public open class Control : CanvasItem() { } /** - * Tells Godot which node it should give focus to if the user presses the top arrow on the keyboard or top on a gamepad by default. You can change the key by editing the [godot.ProjectSettings.input/uiUp] input action. The node must be a [godot.Control]. If this property is not set, Godot will give focus to the closest [godot.Control] to the top of this one. + * Tells Godot which node it should give focus to if the user presses the top arrow on the + * keyboard or top on a gamepad by default. You can change the key by editing the + * [ProjectSettings.input/uiUp] input action. The node must be a [Control]. If this property is not + * set, Godot will give focus to the closest [Control] to the top of this one. */ public var focusNeighborTop: NodePath get() { @@ -563,7 +607,10 @@ public open class Control : CanvasItem() { } /** - * Tells Godot which node it should give focus to if the user presses the right arrow on the keyboard or right on a gamepad by default. You can change the key by editing the [godot.ProjectSettings.input/uiRight] input action. The node must be a [godot.Control]. If this property is not set, Godot will give focus to the closest [godot.Control] to the right of this one. + * Tells Godot which node it should give focus to if the user presses the right arrow on the + * keyboard or right on a gamepad by default. You can change the key by editing the + * [ProjectSettings.input/uiRight] input action. The node must be a [Control]. If this property is + * not set, Godot will give focus to the closest [Control] to the right of this one. */ public var focusNeighborRight: NodePath get() { @@ -577,7 +624,10 @@ public open class Control : CanvasItem() { } /** - * Tells Godot which node it should give focus to if the user presses the down arrow on the keyboard or down on a gamepad by default. You can change the key by editing the [godot.ProjectSettings.input/uiDown] input action. The node must be a [godot.Control]. If this property is not set, Godot will give focus to the closest [godot.Control] to the bottom of this one. + * Tells Godot which node it should give focus to if the user presses the down arrow on the + * keyboard or down on a gamepad by default. You can change the key by editing the + * [ProjectSettings.input/uiDown] input action. The node must be a [Control]. If this property is not + * set, Godot will give focus to the closest [Control] to the bottom of this one. */ public var focusNeighborBottom: NodePath get() { @@ -591,9 +641,11 @@ public open class Control : CanvasItem() { } /** - * Tells Godot which node it should give focus to if the user presses [kbd]Tab[/kbd] on a keyboard by default. You can change the key by editing the [godot.ProjectSettings.input/uiFocusNext] input action. - * - * If this property is not set, Godot will select a "best guess" based on surrounding nodes in the scene tree. + * Tells Godot which node it should give focus to if the user presses [kbd]Tab[/kbd] on a keyboard + * by default. You can change the key by editing the [ProjectSettings.input/uiFocusNext] input + * action. + * If this property is not set, Godot will select a "best guess" based on surrounding nodes in the + * scene tree. */ public var focusNext: NodePath get() { @@ -607,9 +659,11 @@ public open class Control : CanvasItem() { } /** - * Tells Godot which node it should give focus to if the user presses [kbd]Shift + Tab[/kbd] on a keyboard by default. You can change the key by editing the [godot.ProjectSettings.input/uiFocusPrev] input action. - * - * If this property is not set, Godot will select a "best guess" based on surrounding nodes in the scene tree. + * Tells Godot which node it should give focus to if the user presses [kbd]Shift + Tab[/kbd] on a + * keyboard by default. You can change the key by editing the [ProjectSettings.input/uiFocusPrev] + * input action. + * If this property is not set, Godot will select a "best guess" based on surrounding nodes in the + * scene tree. */ public var focusPrevious: NodePath get() { @@ -623,7 +677,8 @@ public open class Control : CanvasItem() { } /** - * The focus access mode for the control (None, Click or All). Only one Control can be focused at the same time, and it will receive keyboard, gamepad, and mouse signals. + * The focus access mode for the control (None, Click or All). Only one Control can be focused at + * the same time, and it will receive keyboard, gamepad, and mouse signals. */ public var focusMode: FocusMode get() { @@ -637,7 +692,10 @@ public open class Control : CanvasItem() { } /** - * Controls whether the control will be able to receive mouse button input events through [_guiInput] and how these events should be handled. Also controls whether the control can receive the [mouseEntered], and [mouseExited] signals. See the constants to learn what each does. + * Controls whether the control will be able to receive mouse button input events through + * [_guiInput] and how these events should be handled. Also controls whether the control can receive + * the [signal mouse_entered], and [signal mouse_exited] signals. See the constants to learn what + * each does. */ public var mouseFilter: MouseFilter get() { @@ -651,9 +709,11 @@ public open class Control : CanvasItem() { } /** - * When enabled, scroll wheel events processed by [_guiInput] will be passed to the parent control even if [mouseFilter] is set to [MOUSE_FILTER_STOP]. As it defaults to true, this allows nested scrollable containers to work out of the box. - * - * You should disable it on the root of your UI if you do not want scroll events to go to the [godot.Node.UnhandledInput] processing. + * When enabled, scroll wheel events processed by [_guiInput] will be passed to the parent control + * even if [mouseFilter] is set to [constant MOUSE_FILTER_STOP]. As it defaults to true, this allows + * nested scrollable containers to work out of the box. + * You should disable it on the root of your UI if you do not want scroll events to go to the + * [Node.UnhandledInput] processing. */ public var mouseForcePassScrollEvents: Boolean get() { @@ -667,8 +727,8 @@ public open class Control : CanvasItem() { } /** - * The default cursor shape for this control. Useful for Godot plugins and applications or games that use the system's mouse cursors. - * + * The default cursor shape for this control. Useful for Godot plugins and applications or games + * that use the system's mouse cursors. * **Note:** On Linux, shapes may vary depending on the cursor theme of the system. */ public var mouseDefaultCursorShape: CursorShape @@ -683,7 +743,9 @@ public open class Control : CanvasItem() { } /** - * The [godot.Node] which must be a parent of the focused [godot.Control] for the shortcut to be activated. If `null`, the shortcut can be activated when any control is focused (a global shortcut). This allows shortcuts to be accepted only when the user has a certain area of the GUI focused. + * The [Node] which must be a parent of the focused [Control] for the shortcut to be activated. If + * `null`, the shortcut can be activated when any control is focused (a global shortcut). This allows + * shortcuts to be accepted only when the user has a certain area of the GUI focused. */ public var shortcutContext: Node? get() { @@ -697,9 +759,10 @@ public open class Control : CanvasItem() { } /** - * The [godot.Theme] resource this node and all its [godot.Control] and [godot.Window] children use. If a child node has its own [godot.Theme] resource set, theme items are merged with child's definitions having higher priority. - * - * **Note:** [godot.Window] styles will have no effect unless the window is embedded. + * The [Theme] resource this node and all its [Control] and [Window] children use. If a child node + * has its own [Theme] resource set, theme items are merged with child's definitions having higher + * priority. + * **Note:** [Window] styles will have no effect unless the window is embedded. */ public var theme: Theme? get() { @@ -713,13 +776,18 @@ public open class Control : CanvasItem() { } /** - * The name of a theme type variation used by this [godot.Control] to look up its own theme items. When empty, the class name of the node is used (e.g. [code skip-lint]Button` for the [godot.Button] control), as well as the class names of all parent classes (in order of inheritance). - * - * When set, this property gives the highest priority to the type of the specified name. This type can in turn extend another type, forming a dependency chain. See [godot.Theme.setTypeVariation]. If the theme item cannot be found using this type or its base types, lookup falls back on the class names. - * - * **Note:** To look up [godot.Control]'s own items use various `get_theme_*` methods without specifying `theme_type`. - * - * **Note:** Theme items are looked for in the tree order, from branch to root, where each [godot.Control] node is checked for its [theme] property. The earliest match against any type/class name is returned. The project-level Theme and the default Theme are checked last. + * The name of a theme type variation used by this [Control] to look up its own theme items. When + * empty, the class name of the node is used (e.g. [code skip-lint]Button[/code] for the [Button] + * control), as well as the class names of all parent classes (in order of inheritance). + * When set, this property gives the highest priority to the type of the specified name. This type + * can in turn extend another type, forming a dependency chain. See [Theme.setTypeVariation]. If the + * theme item cannot be found using this type or its base types, lookup falls back on the class + * names. + * **Note:** To look up [Control]'s own items use various `get_theme_*` methods without specifying + * `theme_type`. + * **Note:** Theme items are looked for in the tree order, from branch to root, where each + * [Control] node is checked for its [theme] property. The earliest match against any type/class name + * is returned. The project-level Theme and the default Theme are checked last. */ public var themeTypeVariation: StringName get() { @@ -738,7 +806,10 @@ public open class Control : CanvasItem() { } /** - * The minimum size of the node's bounding rectangle. If you set it to a value greater than (0, 0), the node's bounding rectangle will always have at least this size, even if its content is smaller. If it's set to (0, 0), the node sizes automatically to fit its content, be it a texture or child nodes. + * The minimum size of the node's bounding rectangle. If you set it to a value greater than (0, + * 0), the node's bounding rectangle will always have at least this size, even if its content is + * smaller. If it's set to (0, 0), the node sizes automatically to fit its content, be it a texture + * or child nodes. * * This is a helper function to make dealing with local copies easier. * @@ -763,13 +834,22 @@ public open class Control : CanvasItem() { /** - * The node's scale, relative to its [size]. Change this property to scale the node around its [pivotOffset]. The Control's [tooltipText] will also scale according to this value. - * - * **Note:** This property is mainly intended to be used for animation purposes. To support multiple resolutions in your project, use an appropriate viewport stretch mode as described in the [documentation]($DOCS_URL/tutorials/rendering/multiple_resolutions.html) instead of scaling Controls individually. - * - * **Note:** [godot.FontFile.oversampling] does *not* take [godot.Control] [scale] into account. This means that scaling up/down will cause bitmap fonts and rasterized (non-MSDF) dynamic fonts to appear blurry or pixelated. To ensure text remains crisp regardless of scale, you can enable MSDF font rendering by enabling [godot.ProjectSettings.gui/theme/defaultFontMultichannelSignedDistanceField] (applies to the default project font only), or enabling **Multichannel Signed Distance Field** in the import options of a DynamicFont for custom fonts. On system fonts, [godot.SystemFont.multichannelSignedDistanceField] can be enabled in the inspector. - * - * **Note:** If the Control node is a child of a [godot.Container] node, the scale will be reset to `Vector2(1, 1)` when the scene is instantiated. To set the Control's scale when it's instantiated, wait for one frame using `await get_tree().process_frame` then set its [scale] property. + * The node's scale, relative to its [size]. Change this property to scale the node around its + * [pivotOffset]. The Control's [tooltipText] will also scale according to this value. + * **Note:** This property is mainly intended to be used for animation purposes. To support + * multiple resolutions in your project, use an appropriate viewport stretch mode as described in the + * [url=$DOCS_URL/tutorials/rendering/multiple_resolutions.html]documentation[/url] instead of + * scaling Controls individually. + * **Note:** [FontFile.oversampling] does *not* take [Control] [scale] into account. This means + * that scaling up/down will cause bitmap fonts and rasterized (non-MSDF) dynamic fonts to appear + * blurry or pixelated. To ensure text remains crisp regardless of scale, you can enable MSDF font + * rendering by enabling [ProjectSettings.gui/theme/defaultFontMultichannelSignedDistanceField] + * (applies to the default project font only), or enabling **Multichannel Signed Distance Field** in + * the import options of a DynamicFont for custom fonts. On system fonts, + * [SystemFont.multichannelSignedDistanceField] can be enabled in the inspector. + * **Note:** If the Control node is a child of a [Container] node, the scale will be reset to + * `Vector2(1, 1)` when the scene is instantiated. To set the Control's scale when it's instantiated, + * wait for one frame using `await get_tree().process_frame` then set its [scale] property. * * This is a helper function to make dealing with local copies easier. * @@ -793,7 +873,9 @@ public open class Control : CanvasItem() { /** - * By default, the node's pivot is its top-left corner. When you change its [rotation] or [scale], it will rotate or scale around this pivot. Set this property to [size] / 2 to pivot around the Control's center. + * By default, the node's pivot is its top-left corner. When you change its [rotation] or [scale], + * it will rotate or scale around this pivot. Set this property to [size] / 2 to pivot around the + * Control's center. * * This is a helper function to make dealing with local copies easier. * @@ -817,11 +899,11 @@ public open class Control : CanvasItem() { /** - * Virtual method to be implemented by the user. Returns whether the given [point] is inside this control. - * + * Virtual method to be implemented by the user. Returns whether the given [param point] is inside + * this control. * If not overridden, default behavior is checking if the point is within control's Rect. - * - * **Note:** If you want to check if a point is inside the control, you can use `Rect2(Vector2.ZERO, size).has_point(point)`. + * **Note:** If you want to check if a point is inside the control, you can use + * `Rect2(Vector2.ZERO, size).has_point(point)`. */ public open fun _hasPoint(point: Vector2): Boolean { throw NotImplementedError("_has_point is not implemented for Control") @@ -829,8 +911,9 @@ public open class Control : CanvasItem() { /** * User defined BiDi algorithm override function. - * - * Returns an [godot.Array] of [godot.Vector3i] text ranges and text base directions, in the left-to-right order. Ranges should cover full source [text] without overlaps. BiDi algorithm will be used on each range separately. + * Returns an [Array] of [Vector3i] text ranges and text base directions, in the left-to-right + * order. Ranges should cover full source [param text] without overlaps. BiDi algorithm will be used + * on each range separately. */ public open fun _structuredTextParser(args: VariantArray, text: String): VariantArray { @@ -838,302 +921,219 @@ public open class Control : CanvasItem() { } /** - * Virtual method to be implemented by the user. Returns the minimum size for this control. Alternative to [customMinimumSize] for controlling minimum size via code. The actual minimum size will be the max value of these two (in each axis separately). - * - * If not overridden, defaults to [godot.Vector2.ZERO]. - * - * **Note:** This method will not be called when the script is attached to a [godot.Control] node that already overrides its minimum size (e.g. [godot.Label], [godot.Button], [godot.PanelContainer] etc.). It can only be used with most basic GUI nodes, like [godot.Control], [godot.Container], [godot.Panel] etc. + * Virtual method to be implemented by the user. Returns the minimum size for this control. + * Alternative to [customMinimumSize] for controlling minimum size via code. The actual minimum size + * will be the max value of these two (in each axis separately). + * If not overridden, defaults to [constant Vector2.ZERO]. + * **Note:** This method will not be called when the script is attached to a [Control] node that + * already overrides its minimum size (e.g. [Label], [Button], [PanelContainer] etc.). It can only be + * used with most basic GUI nodes, like [Control], [Container], [Panel] etc. */ public open fun _getMinimumSize(): Vector2 { throw NotImplementedError("_get_minimum_size is not implemented for Control") } /** - * Virtual method to be implemented by the user. Returns the tooltip text for the position [atPosition] in control's local coordinates, which will typically appear when the cursor is resting over this control. See [getTooltip]. - * - * **Note:** If this method returns an empty [godot.String], no tooltip is displayed. + * Virtual method to be implemented by the user. Returns the tooltip text for the position [param + * at_position] in control's local coordinates, which will typically appear when the cursor is + * resting over this control. See [getTooltip]. + * **Note:** If this method returns an empty [String], no tooltip is displayed. */ public open fun _getTooltip(atPosition: Vector2): String { throw NotImplementedError("_get_tooltip is not implemented for Control") } /** - * Godot calls this method to get data that can be dragged and dropped onto controls that expect drop data. Returns `null` if there is no data to drag. Controls that want to receive drop data should implement [_canDropData] and [_dropData]. [atPosition] is local to this control. Drag may be forced with [forceDrag]. - * - * A preview that will follow the mouse that should represent the data can be set with [setDragPreview]. A good time to set the preview is in this method. - * - * [codeblocks] - * - * [gdscript] + * Godot calls this method to get data that can be dragged and dropped onto controls that expect + * drop data. Returns `null` if there is no data to drag. Controls that want to receive drop data + * should implement [_canDropData] and [_dropData]. [param at_position] is local to this control. + * Drag may be forced with [forceDrag]. + * A preview that will follow the mouse that should represent the data can be set with + * [setDragPreview]. A good time to set the preview is in this method. * + * gdscript: + * ```gdscript * func _get_drag_data(position): - * * var mydata = make_data() # This is your custom method generating the drag data. - * - * set_drag_preview(make_preview(mydata)) # This is your custom method generating the preview of the drag data. - * + * set_drag_preview(make_preview(mydata)) # This is your custom method generating the preview + * of the drag data. * return mydata - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * public override Variant _GetDragData(Vector2 atPosition) - * * { - * * var myData = MakeData(); // This is your custom method generating the drag data. - * - * SetDragPreview(MakePreview(myData)); // This is your custom method generating the preview of the drag data. - * + * SetDragPreview(MakePreview(myData)); // This is your custom method generating the preview + * of the drag data. * return myData; - * * } - * - * [/csharp] - * - * [/codeblocks] + * ``` */ public open fun _getDragData(atPosition: Vector2): Any? { throw NotImplementedError("_get_drag_data is not implemented for Control") } /** - * Godot calls this method to test if [data] from a control's [_getDragData] can be dropped at [atPosition]. [atPosition] is local to this control. - * + * Godot calls this method to test if [param data] from a control's [_getDragData] can be dropped + * at [param at_position]. [param at_position] is local to this control. * This method should only be used to test the data. Process the data in [_dropData]. * - * [codeblocks] - * - * [gdscript] - * + * gdscript: + * ```gdscript * func _can_drop_data(position, data): - * * # Check position if it is relevant to you - * * # Otherwise, just check data - * * return typeof(data) == TYPE_DICTIONARY and data.has("expected") - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * public override bool _CanDropData(Vector2 atPosition, Variant data) - * * { - * * // Check position if it is relevant to you - * * // Otherwise, just check data - * - * return data.VariantType == Variant.Type.Dictionary && data.AsGodotDictionary().ContainsKey("expected"); - * + * return data.VariantType == Variant.Type.Dictionary && + * data.AsGodotDictionary().ContainsKey("expected"); * } - * - * [/csharp] - * - * [/codeblocks] + * ``` */ public open fun _canDropData(atPosition: Vector2, `data`: Any?): Boolean { throw NotImplementedError("_can_drop_data is not implemented for Control") } /** - * Godot calls this method to pass you the [data] from a control's [_getDragData] result. Godot first calls [_canDropData] to test if [data] is allowed to drop at [atPosition] where [atPosition] is local to this control. - * - * [codeblocks] - * - * [gdscript] + * Godot calls this method to pass you the [param data] from a control's [_getDragData] result. + * Godot first calls [_canDropData] to test if [param data] is allowed to drop at [param at_position] + * where [param at_position] is local to this control. * + * gdscript: + * ```gdscript * func _can_drop_data(position, data): - * * return typeof(data) == TYPE_DICTIONARY and data.has("color") * - * - * * func _drop_data(position, data): - * * var color = data["color"] - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * public override bool _CanDropData(Vector2 atPosition, Variant data) - * * { - * - * return data.VariantType == Variant.Type.Dictionary && dict.AsGodotDictionary().ContainsKey("color"); - * + * return data.VariantType == Variant.Type.Dictionary && + * dict.AsGodotDictionary().ContainsKey("color"); * } * - * - * * public override void _DropData(Vector2 atPosition, Variant data) - * * { - * * Color color = data.AsGodotDictionary()["color"].AsColor(); - * * } - * - * [/csharp] - * - * [/codeblocks] + * ``` */ public open fun _dropData(atPosition: Vector2, `data`: Any?): Unit { } /** - * Virtual method to be implemented by the user. Returns a [godot.Control] node that should be used as a tooltip instead of the default one. The [forText] includes the contents of the [tooltipText] property. - * - * The returned node must be of type [godot.Control] or Control-derived. It can have child nodes of any type. It is freed when the tooltip disappears, so make sure you always provide a new instance (if you want to use a pre-existing node from your scene tree, you can duplicate it and pass the duplicated instance). When `null` or a non-Control node is returned, the default tooltip will be used instead. - * - * The returned node will be added as child to a [godot.PopupPanel], so you should only provide the contents of that panel. That [godot.PopupPanel] can be themed using [godot.Theme.setStylebox] for the type `"TooltipPanel"` (see [tooltipText] for an example). - * - * **Note:** The tooltip is shrunk to minimal size. If you want to ensure it's fully visible, you might want to set its [customMinimumSize] to some non-zero value. - * - * **Note:** The node (and any relevant children) should be [godot.CanvasItem.visible] when returned, otherwise, the viewport that instantiates it will not be able to calculate its minimum size reliably. - * + * Virtual method to be implemented by the user. Returns a [Control] node that should be used as a + * tooltip instead of the default one. The [param for_text] includes the contents of the + * [tooltipText] property. + * The returned node must be of type [Control] or Control-derived. It can have child nodes of any + * type. It is freed when the tooltip disappears, so make sure you always provide a new instance (if + * you want to use a pre-existing node from your scene tree, you can duplicate it and pass the + * duplicated instance). When `null` or a non-Control node is returned, the default tooltip will be + * used instead. + * The returned node will be added as child to a [PopupPanel], so you should only provide the + * contents of that panel. That [PopupPanel] can be themed using [Theme.setStylebox] for the type + * `"TooltipPanel"` (see [tooltipText] for an example). + * **Note:** The tooltip is shrunk to minimal size. If you want to ensure it's fully visible, you + * might want to set its [customMinimumSize] to some non-zero value. + * **Note:** The node (and any relevant children) should be [CanvasItem.visible] when returned, + * otherwise, the viewport that instantiates it will not be able to calculate its minimum size + * reliably. * **Example of usage with a custom-constructed node:** * - * [codeblocks] - * - * [gdscript] - * + * gdscript: + * ```gdscript * func _make_custom_tooltip(for_text): - * * var label = Label.new() - * * label.text = for_text - * * return label - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * public override Control _MakeCustomTooltip(string forText) - * * { - * * var label = new Label(); - * * label.Text = forText; - * * return label; - * * } - * - * [/csharp] - * - * [/codeblocks] + * ``` * * **Example of usage with a custom scene instance:** * - * [codeblocks] - * - * [gdscript] - * + * gdscript: + * ```gdscript * func _make_custom_tooltip(for_text): - * * var tooltip = preload("res://some_tooltip_scene.tscn").instantiate() - * * tooltip.get_node("Label").text = for_text - * * return tooltip - * - * [/gdscript] - * - * [csharp] - * + * ``` + * csharp: + * ```csharp * public override Control _MakeCustomTooltip(string forText) - * * { - * - * Node tooltip = ResourceLoader.Load("res://some_tooltip_scene.tscn").Instantiate(); - * + * Node tooltip = + * ResourceLoader.Load("res://some_tooltip_scene.tscn").Instantiate(); * tooltip.GetNode