Optimization: cache model bounding box

This commit is contained in:
Alessandro Ranellucci 2013-06-22 19:36:50 +02:00
parent c88d8a5842
commit 82fbdb603f
2 changed files with 51 additions and 13 deletions

View file

@ -62,6 +62,18 @@ sub scale {
$self;
}
sub translate {
my $self = shift;
my @shift = @_;
for my $axis (X .. $#{$self->extents}) {
$self->extents->[$axis][MIN] += $shift[$axis];
$self->extents->[$axis][MAX] += $shift[$axis];
}
$self;
}
sub size {
my $self = shift;