Quaternion.pm (PDL-2.076) | : | Quaternion.pm (PDL-2.077) | ||
---|---|---|---|---|
skipping to change at line 16 | skipping to change at line 16 | |||
# | # | |||
# Stored as [c,x,y,z]. | # Stored as [c,x,y,z]. | |||
# | # | |||
# XXX REMEMBER!!!! First component = cos(angle*2), *NOT* cos(angle) | # XXX REMEMBER!!!! First component = cos(angle*2), *NOT* cos(angle) | |||
package PDL::Graphics::TriD::Quaternion; | package PDL::Graphics::TriD::Quaternion; | |||
use strict; | use strict; | |||
use warnings; | use warnings; | |||
use overload | ||||
'""' => sub { ref($_[0])."->new(".join(',', @{$_[0]}).")" }; | ||||
sub new { | sub new { | |||
my($type,$c,$x,$y,$z) = @_; | my($type,$c,$x,$y,$z) = @_; | |||
my $this; | my $this; | |||
if(ref($type)){ | if(ref($type)){ | |||
$this = $type; | $this = $type; | |||
}else{ | }else{ | |||
$this = bless [$c,$x,$y,$z],$type; | $this = bless [$c,$x,$y,$z],$type; | |||
} | } | |||
return $this; | return $this; | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 3 lines changed or added |