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

Arrow/Ray shape #1

Closed
Tracked by #31
nixon-voxell opened this issue Mar 20, 2024 · 0 comments · Fixed by #3
Closed
Tracked by #31

Arrow/Ray shape #1

nixon-voxell opened this issue Mar 20, 2024 · 0 comments · Fixed by #3
Labels
enhancement New feature or request good first issue Good for newcomers
Milestone

Comments

@nixon-voxell
Copy link
Member

nixon-voxell commented Mar 20, 2024

Goal

Ability to create an arrow shape that is appended on the ends of VelloLine or VelloBezPath.

Example: https://motioncanvas.io/api/2d/components/Ray

Proposed Solution

/// Attach an arrow head to the end of a [`VelloBezPath`] or [`VelloLine`].
#[derive(Component, Clone, Copy)]
pub struct ArrowHead {
    pub shape: ArrowShape,
    /// Size of the arrow.
    pub size: f32,
    /// Offset of the arrow from the origin point (0 - 1 to stay within the path).
    pub offset: f32,
    /// Rotation offset of the arrow from the original tangent direction of the path.
    pub rotation_offset: f32,
}

pub enum ArrowShape {
    Triangle,
    Line,
    Point,
}

We also need a sensible default for these arrows:

impl Default for ArrowHead {
    fn default() -> Self {
        Self {
            shape: ArrowShape::Triangle,
            size: 10.0,
            offset: 0.0,
            rotation_offset: 0.0,
        }
    }
}
@nixon-voxell nixon-voxell changed the title Arrow/Ray Arrow/Ray shape Mar 20, 2024
@nixon-voxell nixon-voxell added enhancement New feature or request good first issue Good for newcomers labels Mar 26, 2024
@nixon-voxell nixon-voxell transferred this issue from voxell-tech/motiongfx May 28, 2024
@nixon-voxell nixon-voxell added this to the 0.1.0 milestone May 30, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in Bevy Vello Graphics Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
1 participant