Optimization: cache model bounding box

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

No files matched your search

+12
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;