SecondLife::Rotation - Second Life's rotations (quarterions with a non-standard representation)
version 0.900
use SecondLife::DataTypes qw( slrot slvec ); my $rot1 = SecondLife::Rotation->new( "<0,0,0,1>" ); # create a null rotation my $rot2 = slrot "<0,0,0,1>"; # the same my $rot3 = SecondLife::Rotation->new( x=>0, y=>0, z=>0, s=>1 ); # the same my $rot4 = SecondLife::Rotation->new( Math::Quaternion->new( 1, 0, 0, 0 ) ); # The same # Rotate the specified vector by the rotation and return the new vector my $vec = $rot1->rotate_vector( slvec "<1,2,3>" ); print "$rot1\n"; # Prints <0, 0, 0, 1>
This is a subclass of Math::Quaternion. The constructor can accept the Second Life string representation of a rotation, x, y, z, s key/value pairs, a hashref to be passed to Math::Quaternion->new, or a Math::Quaternion object.
Stringifying produces the SecondLife form, not the Math::Quaternion form.
Rotate_vector expects and returns a SecondLife::Vector object.
There are x, y, z, and s accessors.
Otherwise, this is the same as a Math::Quaternion object. If you want to know more about the operations available to, please see its documentation.
Construct a SecondLife::Rotation object from either the SL string representation, or a hash with keys for the individual elements, or a Math::Quaternion object, or a hashref to pass to Math::Quaternion's constructor.
The X value of this rotation.
The Y value of this rotation.
The Z value of this rotation.
The S value of this rotation.
Returns the Second Life string representation of this rotation
Rotates $vector by this rotation and returns the resulting vector. This does not mutate.
Please see those modules/websites for more information related to this module.
SecondLife::DataTypes
Math::Quaternion
Rebecca Turner <becca@referencethis.com>
This software is copyright (c) 2011 by Rebecca Turner.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
To install SecondLife::DataTypes, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SecondLife::DataTypes
CPAN shell
perl -MCPAN -e shell install SecondLife::DataTypes
For more information on module installation, please visit the detailed CPAN module installation guide.