Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 25 lines (17 sloc) 0.411 kb
5ae919d @jtpalmer Initial b2RayCastCallback implementation
jtpalmer authored
1 package Box2D::b2RayCastCallback;
2 use strict;
3 use warnings;
4 use Box2D;
38aedea @jtpalmer Inheritable b2RayCastCallback
jtpalmer authored
5 use Carp;
5ae919d @jtpalmer Initial b2RayCastCallback implementation
jtpalmer authored
6
7 sub new {
38aedea @jtpalmer Inheritable b2RayCastCallback
jtpalmer authored
8 my ($class) = @_;
5ae919d @jtpalmer Initial b2RayCastCallback implementation
jtpalmer authored
9
38aedea @jtpalmer Inheritable b2RayCastCallback
jtpalmer authored
10 my $self = bless {}, $class;
5ae919d @jtpalmer Initial b2RayCastCallback implementation
jtpalmer authored
11
38aedea @jtpalmer Inheritable b2RayCastCallback
jtpalmer authored
12 $self->{_callback}
13 = Box2D::PerlRayCastCallback->new( sub { $self->ReportFixture(@_) } );
14
15 return $self;
16 }
17
18 sub ReportFixture {
19 croak 'You must override Box2D::b2RayCastCallback::ReportFixture';
5ae919d @jtpalmer Initial b2RayCastCallback implementation
jtpalmer authored
20 }
21
38aedea @jtpalmer Inheritable b2RayCastCallback
jtpalmer authored
22 sub _getCallback { $_[0]->{_callback} }
23
5ae919d @jtpalmer Initial b2RayCastCallback implementation
jtpalmer authored
24 1;
Something went wrong with that request. Please try again.