How do I know which class is which in Godot source code?

NeronNeron Posts: 12Member

I'm trying to extend functionality of base classes in Godot source code. The problem is the modules don't have clear names. How do I know which class is which in Godot source code?

Best Answer

  • TwistedTwiglegTwistedTwigleg Posts: 4,277
    Accepted Answer

    Since it’s a 3D node, generally a good place to look is the scene/3d folder for 3D nodes. Its not for sure there, but that’s generally where I’d look first if looking for a 3D node. Likewise, scene/2d generally has 2D nodes.
    Though searching by downloading the source code and using the search function in an editor like VisualStudio code can tell you all occurrences of the node name, which generally points to the exact file that contains the code.

    In the case of the VechicleBody node, its at scene/3d/vechicle_body_3d in the Godot master branch.

Answers

  • CalinouCalinou Posts: 607Admin Godot Developer
    edited May 2

    The problem is the modules don't have clear names.

    Can you give an example here? I don't understand exactly what kind of files do you need.

    If you need to perform full code search, I recommend using a tool like ripgrep or Visual Studio Code's Ctrl + Shift + F functionality and searching for classname:: (e.g. RigidBody2D::).

  • NeronNeron Posts: 12Member

    @Calinou said:

    The problem is the modules don't have clear names.

    Can you give an example here? I don't understand exactly what kind of files do you need.

    If you need to perform full code search, I recommend using a tool like ripgrep or Visual Studio Code's Ctrl + Shift + F functionality and searching for classname:: (e.g. RigidBody2D::).

    I wanna search for VehicleBody and VehicleWheel...

  • TwistedTwiglegTwistedTwigleg Posts: 4,277Admin
    Accepted Answer

    Since it’s a 3D node, generally a good place to look is the scene/3d folder for 3D nodes. Its not for sure there, but that’s generally where I’d look first if looking for a 3D node. Likewise, scene/2d generally has 2D nodes.
    Though searching by downloading the source code and using the search function in an editor like VisualStudio code can tell you all occurrences of the node name, which generally points to the exact file that contains the code.

    In the case of the VechicleBody node, its at scene/3d/vechicle_body_3d in the Godot master branch.

  • dotteddotted Posts: 258Member

    Most IDEs (Eclipse/CodeLion/VStudio) have a find declaration/definitions option. Use this to locate a class' declaration or implementations.

    If you are not using an IDE I highly recommend getting one. Eclipse is opensource and its C++ variant will work quite nicely. I think it will also handle the build system SCONS

  • NeronNeron Posts: 12Member

    @TwistedTwigleg said:
    Since it’s a 3D node, generally a good place to look is the scene/3d folder for 3D nodes. Its not for sure there, but that’s generally where I’d look first if looking for a 3D node. Likewise, scene/2d generally has 2D nodes.
    Though searching by downloading the source code and using the search function in an editor like VisualStudio code can tell you all occurrences of the node name, which generally points to the exact file that contains the code.

    In the case of the VechicleBody node, its at scene/3d/vechicle_body_3d in the Godot master branch.

    Thanks! This is helpful.

  • NeronNeron Posts: 12Member

    @dotted said:
    Most IDEs (Eclipse/CodeLion/VStudio) have a find declaration/definitions option. Use this to locate a class' declaration or implementations.

    If you are not using an IDE I highly recommend getting one. Eclipse is opensource and its C++ variant will work quite nicely. I think it will also handle the build system SCONS

    Thanks!

  • DaveTheCoderDaveTheCoder Posts: 231Member

    If you are not using an IDE I highly recommend getting one. Eclipse is opensource and its C++ variant will work quite nicely. I think it will also handle the build system SCONS.

    I'm having trouble configuring Eclipse to work with the Godot source code. Maybe I should post a new thread about that.

  • NeronNeron Posts: 12Member

    @DaveTheCoder said:

    If you are not using an IDE I highly recommend getting one. Eclipse is opensource and its C++ variant will work quite nicely. I think it will also handle the build system SCONS.

    I'm having trouble configuring Eclipse to work with the Godot source code. Maybe I should post a new thread about that.

    Sorry mate, I use Visual Studio and sometimes Visual Studio Code...I've no experience when it comes to Eclipse...

  • dotteddotted Posts: 258Member

    I'll offer any help I can, but yes start a new thread for the topic.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file