-
-
Save FROGGS/2148e2b9f241e106963a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Box2D::Vec2 is repr<CStruct> { | |
has num32 $.x; | |
has num32 $.y; | |
multi method new(Num(Numeric) $x, Num(Numeric) $y = 0e0) { | |
my $self = nqp::create(Box2D::Vec2); | |
nqp::bindattr_n(nqp::decont($self), Box2D::Vec2, '$!x', nqp::unbox_n($x)); | |
nqp::bindattr_n(nqp::decont($self), Box2D::Vec2, '$!y', nqp::unbox_n($y)); | |
$self | |
} | |
} | |
class Box2D::Vec2 is repr<CStruct> { | |
has num32 $.x is rw; | |
has num32 $.y is rw; | |
multi method new(Num(Numeric) $x, Num(Numeric) $y = 0e0) { | |
self.bless( :$x, :$y ) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment