Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose built-in types default constructors #6977

Closed
Zylann opened this issue Oct 30, 2016 · 5 comments · Fixed by #43403, #43417 or #43421
Closed

Expose built-in types default constructors #6977

Zylann opened this issue Oct 30, 2016 · 5 comments · Fixed by #43403, #43417 or #43421

Comments

@Zylann
Copy link
Contributor

Zylann commented Oct 30, 2016

  • Vector2
  • Vector3
  • Matrix32
  • Matrix3
  • Quaternion
  • Color
  • Transform
  • ...

Primitive math types often have multiple constructors, but the default one is not listed. Also, some people read the docs first before writing code (especially with a scripting API), it can be misleading to hint there is no default constructor, leading them to not even try.

These constructors exist, they can be used. But if they are not found by doctool... then we have another problem, because not a single default constructor is ever documented, not just math primitives. Which leads me to think they are bound automatically, and unavailable to doctool.

Original request: #6752 (comment)

@neikeq neikeq added this to the 3.0 milestone Oct 30, 2016
@bojidar-bg
Copy link
Contributor

core/variant_call.cpp:1743 is responsible for registering most of them.

@vnen
Copy link
Member

vnen commented Oct 30, 2016

@bojidar-bg it doesn't seem to register default constructors. Considering the comment in get_constuctor_list, they might be implied to exist. The change may need to be done in the doctool side.

@reduz
Copy link
Member

reduz commented Aug 5, 2017

kicking to 3.1 unless someone adds it

@reduz reduz modified the milestones: 3.1, 3.0 Aug 5, 2017
@Zylann
Copy link
Contributor Author

Zylann commented Aug 11, 2017

Found another confused post, PoolVectors default constructors aren't listed either https://godotengine.org/qa/17117/how-to-construct-a-poolbytearray?show=17118#a17118 (but he/she also seem to have mixed the two doc versions)

And this another one https://godotengine.org/qa/20879/correct-vector2array-syntax?show=20916#c20916

Aaand another one https://godotengine.org/qa/21415/how-do-i-declare-vector3array-in-gdscript

@Chaosus Chaosus changed the title [Documentation] Expose math types default constructors Expose math types default constructors Dec 25, 2018
@akien-mga akien-mga changed the title Expose math types default constructors Expose built-in types default constructors Jan 9, 2019
@akien-mga akien-mga modified the milestones: 3.1, 3.2 Jan 9, 2019
@akien-mga akien-mga modified the milestones: 3.2, 4.0 Nov 11, 2019
@akien-mga
Copy link
Member

@vnen @bojidar-bg Any idea on how to do this for 4.0? Worst case we could register them manually I guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment