The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Graphics::Raylib::Util - Utility functions for use With Graphics::Raylib::XS

VERSION

version 0.017

SYNOPSIS

    use Graphics::Raylib::Util;

    # returns Graphics::Raylib::XS::{Vector2,Vector3} depending on scalar @coords
    my $vector = Graphics::Raylib::Util::vector(@coords);

DESCRIPTION

Raylib deals a lot in value-passed structs. This module builds these structs.

METHODS AND ARGUMENTS

vector(@coords)

Constructs a Graphics::Raylib::XS::Vector2 or Graphics::Raylib::XS::Vector3 depending on number of arguments. Croaks otherwise.

    typedef struct Vector2 {
        float x;
        float y;
    } Vector2;

    typedef struct Vector3 {
        float x;
        float y;
        float z;
    } Vector3;
rectangle(x => $x, y => $y, width => $width, height => $height) or rectangle(position => $posVector2, size => $sizeVector2)

Constructs a Graphics::Raylib::XS::Rectangle.

camera(position => $pos3d, target => $target3d, up => $up3d, fovy => $fovy)

Constructs a Graphics::Raylib::XS::Camera.

    typedef struct Camera {
        Vector3 position;
        Vector3 target;
        Vector3 up;
        float fovy;
    } Camera;

GIT REPOSITORY

http://github.com/athreef/Graphics-Raylib

SEE ALSO

Graphics::Raylib Graphics::Raylib::Color

AUTHOR

Ahmad Fatoum <athreef@cpan.org>, http://a3f.at

COPYRIGHT AND LICENSE

Copyright (C) 2017 Ahmad Fatoum

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.