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

Allow connecting all basic types to a boolean input pin #648

Closed
Naros opened this issue Aug 3, 2024 · 0 comments · Fixed by #672
Closed

Allow connecting all basic types to a boolean input pin #648

Naros opened this issue Aug 3, 2024 · 0 comments · Fixed by #672
Labels
kind/enhancement New feature or request
Milestone

Comments

@Naros
Copy link
Member

Naros commented Aug 3, 2024

Description

Godot has a concept called Variant::booleanize where any Variant type can be applied in a boolean operator condition to determine whether or not it evaluates to true or false. This can be useful in graphs to minimize the number of nodes needed to test specific conditions.

There is a few caveats, such as types like the Vector, Projection, Quaternion, and others have what is called a baseline representation of their internal indexed/keyed components that represent a false condition. For example, Vector2, Vector3, and Vector4 all will return false when their internal x, y, z, and w fields equal 0. Similarly when Projection, Quaternion, and others internally represent their "Identity" or default value when using Projection() or Quaternion(), this too represents false.

Implementation ideas

Adjust OScriptNodePin::can_accept to always allow connecting to BOOL input pins.

@Naros Naros added the kind/enhancement New feature or request label Aug 3, 2024
@Naros Naros added this to the 2.2 milestone Aug 3, 2024
Naros added a commit to Naros/godot-orchestrator that referenced this issue Aug 5, 2024
@Naros Naros modified the milestones: 2.2, 2.1 Aug 7, 2024
@Naros Naros closed this as completed in #672 Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant