PixelLightAPI  .
Public Member Functions | Public Attributes | Static Public Attributes
PLMath::Matrix3x3 Class Reference

3x3 matrix More...

#include <Matrix3x3.h>

List of all members.

Public Member Functions

 Matrix3x3 ()
 Default constructor setting an identity matrix.
 Matrix3x3 (const float fS[])
 Matrix3x3 (const Matrix3x3 &mM)
PLMATH_API Matrix3x3 (const Matrix3x4 &mM)
PLMATH_API Matrix3x3 (const Matrix4x4 &mM)
 Matrix3x3 (float fXX, float fXY, float fXZ, float fYX, float fYY, float fYZ, float fZX, float fZY, float fZZ)
 ~Matrix3x3 ()
PLMATH_API bool operator== (const Matrix3x3 &mM) const
PLMATH_API bool operator!= (const Matrix3x3 &mM) const
PLMATH_API bool CompareScale (const Matrix3x3 &mM, float fEpsilon=Math::Epsilon) const
PLMATH_API bool CompareRotation (const Matrix3x3 &mM, float fEpsilon=Math::Epsilon) const
Matrix3x3operator= (const float fS[])
Matrix3x3operator= (const Matrix3x3 &mM)
PLMATH_API Matrix3x3operator= (const Matrix3x4 &mM)
PLMATH_API Matrix3x3operator= (const Matrix4x4 &mM)
Matrix3x3 operator+ (const Matrix3x3 &mM) const
void operator+= (const Matrix3x3 &mM)
Matrix3x3 operator- () const
Matrix3x3 operator- (const Matrix3x3 &mM) const
void operator-= (const Matrix3x3 &mM)
Matrix3x3 operator* (float fS) const
void operator*= (float fS)
Vector2 operator* (const Vector2 &vV) const
Vector3 operator* (const Vector3 &vV) const
PLMATH_API Vector4 operator* (const Vector4 &vV) const
PLMATH_API Matrix3x3 operator* (const Matrix3x3 &mM) const
void operator*= (const Matrix3x3 &mM)
Matrix3x3 operator/ (float fS) const
void operator/= (float fS)
float operator[] (int nIndex) const
float & operator[] (int nIndex)
float operator() (PLCore::uint32 nRow=0, PLCore::uint32 nColumn=0) const
float & operator() (PLCore::uint32 nRow=0, PLCore::uint32 nColumn=0)
 operator float * ()
 operator const float * () const
bool IsZero () const
 Returns whether or not this matrix is the zero matrix using an epsilon environment.
bool IsTrueZero () const
 Returns whether or not this matrix is truly the zero matrix.
void SetZero ()
 Sets a zero matrix.
bool IsIdentity () const
 Returns whether or not this matrix is the identity matrix using an epsilon environment.
bool IsTrueIdentity () const
 Returns whether or not this matrix is truly the identity matrix.
void SetIdentity ()
 Sets an identity matrix.
void Set (float fXX, float fXY, float fXZ, float fYX, float fYY, float fYZ, float fZX, float fZY, float fZZ)
 Sets the elements of the matrix.
Vector3 GetRow (PLCore::uint8 nRow) const
 Returns a requested row.
void SetRow (PLCore::uint8 nRow, const Vector3 &vRow)
 Sets a row.
Vector3 GetColumn (PLCore::uint8 nColumn) const
 Returns a requested column.
void SetColumn (PLCore::uint8 nColumn, const Vector3 &vColumn)
 Sets a column.
bool IsSymmetric () const
 Returns true if the matrix is symmetric.
bool IsOrthogonal () const
 Returns true if this matrix is orthogonal.
bool IsRotationMatrix () const
 Returns true if this matrix is a rotation matrix.
float GetTrace () const
 Returns the trace of the matrix.
float GetDeterminant () const
 Returns the determinant of the matrix.
void Transpose ()
 Transpose this matrix.
Matrix3x3 GetTransposed () const
 Returns the transposed matrix.
PLMATH_API bool Invert ()
 Inverts the matrix.
PLMATH_API Matrix3x3 GetInverted () const
 Returns the inverse of the matrix.
PLMATH_API Vector3 RotateVector (float fX, float fY, float fZ, bool bUniformScale=false) const
 Rotates a vector.
PLMATH_API Vector3 RotateVector (const Vector3 &vV, bool bUniformScale=false) const
 Rotates a vector.
void SetScaleMatrix (float fX, float fY, float fZ)
 Sets a scale matrix.
void SetScaleMatrix (const Vector3 &vV)
PLMATH_API void GetScale (float &fX, float &fY, float &fZ) const
 Extracts the scale vector from the matrix as good as possible.
Vector3 GetScale () const
void GetScale (float fV[]) const
PLMATH_API void FromEulerAngleX (float fAngleX)
 Sets an x axis rotation matrix by using one given Euler angle.
PLMATH_API void FromEulerAngleY (float fAngleY)
 Sets an y axis rotation matrix by using one given Euler angle.
PLMATH_API void FromEulerAngleZ (float fAngleZ)
 Sets an z axis rotation matrix by using one given Euler angle.
PLMATH_API void ToAxisAngle (float &fX, float &fY, float &fZ, float &fAngle) const
 Returns a rotation matrix as a selected axis and angle.
PLMATH_API void FromAxisAngle (float fX, float fY, float fZ, float fAngle)
 Sets a rotation matrix by using a selected axis and angle.
Vector3 GetXAxis () const
 Returns the x (left) axis.
Vector3 GetYAxis () const
 Returns the y (up) axis.
Vector3 GetZAxis () const
 Returns the z (forward) axis.
PLMATH_API void ToAxis (Vector3 &vX, Vector3 &vY, Vector3 &vZ) const
 Returns the three axis of a rotation matrix (not normalized)
PLMATH_API void FromAxis (const Vector3 &vX, const Vector3 &vY, const Vector3 &vZ)
 Sets a rotation matrix by using three given axis.
PLMATH_API Matrix3x3LookAt (const Vector3 &vEye, const Vector3 &vAt, const Vector3 &vUp)
 Builds a look-at matrix.
Matrix3x3SetShearing (float fShearXY, float fShearXZ, float fShearYX, float fShearYZ, float fShearZX, float fShearZY)
 Sets a shearing matrix.

Public Attributes

union {
   float   fM [9]
 One dimensional array representation.
   struct {
      float   xx
      float   yx
      float   zx
      float   xy
      float   yy
      float   zy
      float   xz
      float   yz
      float   zz
   } 
 Direct element representation.
   struct {
      float   fM33 [3][3]
   } 
 Two dimensional array representation.
}; 
 Some direct matrix accesses.

Static Public Attributes

static PLMATH_API const Matrix3x3 Zero
static PLMATH_API const Matrix3x3 Identity

Detailed Description

3x3 matrix

Remarks:
Matrices are stored in column major order like OpenGL does. (right-handed matrix) So, it's possible to give OpenGL the matrix data without transposing it first.
Note:
  • Some symbols within the comments: T = transposed, I = identity

Constructor & Destructor Documentation

Default constructor setting an identity matrix.

PLMath::Matrix3x3::Matrix3x3 ( const float  fS[]) [inline]
PLMath::Matrix3x3::Matrix3x3 ( const Matrix3x3 mM) [inline]
PLMATH_API PLMath::Matrix3x3::Matrix3x3 ( const Matrix3x4 mM)
PLMATH_API PLMath::Matrix3x3::Matrix3x3 ( const Matrix4x4 mM)
PLMath::Matrix3x3::Matrix3x3 ( float  fXX,
float  fXY,
float  fXZ,
float  fYX,
float  fYY,
float  fYZ,
float  fZX,
float  fZY,
float  fZZ 
) [inline]

Member Function Documentation

PLMATH_API bool PLMath::Matrix3x3::operator== ( const Matrix3x3 mM) const
PLMATH_API bool PLMath::Matrix3x3::operator!= ( const Matrix3x3 mM) const
PLMATH_API bool PLMath::Matrix3x3::CompareScale ( const Matrix3x3 mM,
float  fEpsilon = Math::Epsilon 
) const
PLMATH_API bool PLMath::Matrix3x3::CompareRotation ( const Matrix3x3 mM,
float  fEpsilon = Math::Epsilon 
) const
Matrix3x3 & PLMath::Matrix3x3::operator= ( const float  fS[]) [inline]
Matrix3x3 & PLMath::Matrix3x3::operator= ( const Matrix3x3 mM) [inline]
PLMATH_API Matrix3x3& PLMath::Matrix3x3::operator= ( const Matrix3x4 mM)
PLMATH_API Matrix3x3& PLMath::Matrix3x3::operator= ( const Matrix4x4 mM)
Matrix3x3 PLMath::Matrix3x3::operator+ ( const Matrix3x3 mM) const [inline]
void PLMath::Matrix3x3::operator+= ( const Matrix3x3 mM) [inline]
Matrix3x3 PLMath::Matrix3x3::operator- ( ) const [inline]
Matrix3x3 PLMath::Matrix3x3::operator- ( const Matrix3x3 mM) const [inline]
void PLMath::Matrix3x3::operator-= ( const Matrix3x3 mM) [inline]
Matrix3x3 PLMath::Matrix3x3::operator* ( float  fS) const [inline]
void PLMath::Matrix3x3::operator*= ( float  fS) [inline]
Vector2 PLMath::Matrix3x3::operator* ( const Vector2 vV) const [inline]
Vector3 PLMath::Matrix3x3::operator* ( const Vector3 vV) const [inline]
PLMATH_API Vector4 PLMath::Matrix3x3::operator* ( const Vector4 vV) const
PLMATH_API Matrix3x3 PLMath::Matrix3x3::operator* ( const Matrix3x3 mM) const
void PLMath::Matrix3x3::operator*= ( const Matrix3x3 mM) [inline]
Matrix3x3 PLMath::Matrix3x3::operator/ ( float  fS) const [inline]
void PLMath::Matrix3x3::operator/= ( float  fS) [inline]
float PLMath::Matrix3x3::operator[] ( int  nIndex) const [inline]
float & PLMath::Matrix3x3::operator[] ( int  nIndex) [inline]
float PLMath::Matrix3x3::operator() ( PLCore::uint32  nRow = 0,
PLCore::uint32  nColumn = 0 
) const [inline]
float & PLMath::Matrix3x3::operator() ( PLCore::uint32  nRow = 0,
PLCore::uint32  nColumn = 0 
) [inline]
PLMath::Matrix3x3::operator float * ( ) [inline]
PLMath::Matrix3x3::operator const float * ( ) const [inline]
bool PLMath::Matrix3x3::IsZero ( ) const [inline]

Returns whether or not this matrix is the zero matrix using an epsilon environment.

Returns:
'true' if this matrix is the zero matrix, else 'false'
bool PLMath::Matrix3x3::IsTrueZero ( ) const [inline]

Returns whether or not this matrix is truly the zero matrix.

Remarks:
All components MUST be exactly 0. Floating point inaccuracy is not taken into account.
Returns:
'true' if this matrix is truly the zero matrix, else 'false'
void PLMath::Matrix3x3::SetZero ( ) [inline]

Sets a zero matrix.

Remarks:
    | 0 0 0 |
    | 0 0 0 |
    | 0 0 0 |
bool PLMath::Matrix3x3::IsIdentity ( ) const [inline]

Returns whether or not this matrix is the identity matrix using an epsilon environment.

Returns:
'true' if this matrix is the identity matrix, else 'false'
bool PLMath::Matrix3x3::IsTrueIdentity ( ) const [inline]

Returns whether or not this matrix is truly the identity matrix.

Remarks:
All components MUST be exactly either 0 or 1. Floating point inaccuracy is not taken into account.
Returns:
'true' if this matrix is truly the identity matrix, else 'false'
void PLMath::Matrix3x3::SetIdentity ( ) [inline]

Sets an identity matrix.

Remarks:
    | 1 0 0 |
    | 0 1 0 |
    | 0 0 1 |
void PLMath::Matrix3x3::Set ( float  fXX,
float  fXY,
float  fXZ,
float  fYX,
float  fYY,
float  fYZ,
float  fZX,
float  fZY,
float  fZZ 
) [inline]

Sets the elements of the matrix.

Vector3 PLMath::Matrix3x3::GetRow ( PLCore::uint8  nRow) const [inline]

Returns a requested row.

Parameters:
[in]nRowIndex of the row to return (0-2)
Returns:
The requested row (null vector on error)
Remarks:
    | x y z | <- Row 0
    | 0 0 0 |
    | 0 0 0 |
void PLMath::Matrix3x3::SetRow ( PLCore::uint8  nRow,
const Vector3 vRow 
) [inline]

Sets a row.

Parameters:
[in]nRowIndex of the row to set (0-2)
[in]vRowRow vector
See also:
Vector3 PLMath::Matrix3x3::GetColumn ( PLCore::uint8  nColumn) const [inline]

Returns a requested column.

Parameters:
[in]nColumnIndex of the column to return (0-2)
Returns:
The requested column (null vector on error)
Remarks:
    | x 0 0 |
    | y 0 0 |
    | z 0 0 |
      ^
      |
      Column 0
void PLMath::Matrix3x3::SetColumn ( PLCore::uint8  nColumn,
const Vector3 vColumn 
) [inline]

Sets a column.

Parameters:
[in]nColumnIndex of the column to set (0-2)
[in]vColumnColumn vector
See also:
bool PLMath::Matrix3x3::IsSymmetric ( ) const [inline]

Returns true if the matrix is symmetric.

Returns:
'true' if the matrix is symmetric, else 'false'
Remarks:
A matrix is symmetric if it is equal to it's transposed matrix.
A = A^T -> a(i, j) = a(j, i)
bool PLMath::Matrix3x3::IsOrthogonal ( ) const [inline]

Returns true if this matrix is orthogonal.

Returns:
'true' if the matrix is orthogonal, else 'false'
Remarks:
A matrix is orthogonal if it's transposed matrix is equal to it's inversed matrix.
A^T = A^-1 or A*A^T = A^T*A = I
Note:
  • An orthogonal matrix is always nonsingular (invertible) and it's inverse is equal to it's transposed
  • The transpose and inverse of the matrix is orthogonal, too
  • Products of orthogonal matrices are orthogonal, too
  • The determinant of a orthogonal matrix is +/- 1
  • The row and column vectors of an orthogonal matrix form an orthonormal basis, that is, these vectors are unit-length and they are mutually perpendicular
bool PLMath::Matrix3x3::IsRotationMatrix ( ) const [inline]

Returns true if this matrix is a rotation matrix.

Returns:
'true' if this matrix is a rotation matrix, else 'false'
Remarks:
A rotation matrix is orthogonal and it's determinant is 1 to rule out reflections.
See also:
float PLMath::Matrix3x3::GetTrace ( ) const [inline]

Returns the trace of the matrix.

Returns:
The trace of the matrix
Remarks:
The trace of the matrix is the sum of the main diagonal elements:
xx+yy+zz
float PLMath::Matrix3x3::GetDeterminant ( ) const [inline]

Returns the determinant of the matrix.

Returns:
Determinant of the matrix
Remarks:
The determinant is calculated using the Sarrus diagram:
      | xx   xy   xz  |  xx   xy |
      |     \   /\   /\     /    |
      | yx   yy   yz  |  yx   yy | =  xx*yy*zz + xy*yz*zx + xz*yx*zy -
      |    /    /\   /\      \   |   (zx*yy*xz + zy*yz*xx + zz*yx*xy)
      | zx   zy   zz  |  zx   zy |
Note:
  • If the determinant is non-zero, then an inverse matrix exists
  • If the determinant is 0, the matrix is called singular, else nonsingular (invertible) matrix
  • If the determinant is 1, the inverse matrix is equal to the transpose of the matrix
void PLMath::Matrix3x3::Transpose ( ) [inline]

Transpose this matrix.

Remarks:
The transpose of matrix is the matrix generated when every element in the matrix is swapped with the opposite relative to the major diagonal This can be expressed as the mathematical operation:
      M'   = M
        ij    ji

     | xx xy xz |                    | xx yx zx |
     | yx yy yz |  the transpose is  | xy yy zy |
     | zx zy zz |                    | xz yz zz |
Note:
  • If the matrix is a rotation matrix (= isotropic matrix = determinant is 1), then the transpose is guaranteed to be the inverse of the matrix

Returns the transposed matrix.

Returns:
Transposed matrix
See also:
PLMATH_API bool PLMath::Matrix3x3::Invert ( )

Inverts the matrix.

Returns:
'true' if all went fine, else 'false' (maybe the determinant is null?)
Remarks:
Providing that the determinant is non-zero, then the inverse is calculated using Kramer's rule as:
     -1     1     |   yy*zz-yz*zy  -(xy*zz-zy*xz)   xy*yz-yy*xz  |
    M   = ----- . | -(yx*zz-yz*zx)   xx*zz-zx*xz  -(xx*yz-yx*xz) |
          det M   |   yx*zy-zx*yy  -(xx*zy-zx*xy)   xx*yy-xy*yx  |
Note:
  • If the determinant is 1, the inversed matrix is equal to the transposed one

Returns the inverse of the matrix.

Returns:
Inverse of the matrix, if the determinant is null, an identity matrix is returned
PLMATH_API Vector3 PLMath::Matrix3x3::RotateVector ( float  fX,
float  fY,
float  fZ,
bool  bUniformScale = false 
) const

Rotates a vector.

Parameters:
[in]fXX component of the vector to rotate
[in]fYY component of the vector to rotate
[in]fZZ component of the vector to rotate
[in]bUniformScaleIs this a uniform scale matrix? (all axis are scaled equally) If you know EXACTLY it's one, set this to 'true' to gain some more speed, else DON'T set to 'true'!
Returns:
The rotated vector
Remarks:
This function is similar to a matrix * vector operation - except that it can also deal with none uniform scale. So, this function can for instance be used to rotate a direction vector. (matrix * direction vector)
Note:
  • You can't assume that the resulting vector is normalized
  • Use this function to rotate for example a normal vector
PLMATH_API Vector3 PLMath::Matrix3x3::RotateVector ( const Vector3 vV,
bool  bUniformScale = false 
) const

Rotates a vector.

Parameters:
[in]vVVector to rotate
[in]bUniformScaleIs this a uniform scale matrix? (all axis are scaled equally) If you know EXACTLY it's one, set this to 'true' to gain some more speed, else DON'T set to 'true'!
Returns:
The rotated vector
See also:
  • RotateVector(float, float, float) above
void PLMath::Matrix3x3::SetScaleMatrix ( float  fX,
float  fY,
float  fZ 
) [inline]

Sets a scale matrix.

Parameters:
[in]fXX scale
[in]fYY scale
[in]fZZ scale
Remarks:
    | x 0 0 |
    | 0 y 0 |
    | 0 0 z |
void PLMath::Matrix3x3::SetScaleMatrix ( const Vector3 vV) [inline]
PLMATH_API void PLMath::Matrix3x3::GetScale ( float &  fX,
float &  fY,
float &  fZ 
) const

Extracts the scale vector from the matrix as good as possible.

Parameters:
[out]fXReceives the x scale
[out]fYReceives the y scale
[out]fZReceives the z scale
Note:
  • This function will not work correctly if one or two components are negative while another is/are not (we can't figure out WHICH axis are negative!)
void PLMath::Matrix3x3::GetScale ( float  fV[]) const [inline]
PLMATH_API void PLMath::Matrix3x3::FromEulerAngleX ( float  fAngleX)

Sets an x axis rotation matrix by using one given Euler angle.

Parameters:
[in]fAngleXRotation angle around the x axis (in radian, between [0, Math::Pi2])
Remarks:
         |    1       0       0    |
    RX = |    0     cos(a) -sin(a) |
         |    0     sin(a)  cos(a) |
where a > 0 indicates a counterclockwise rotation in the yz-plane (if you look along -x)
PLMATH_API void PLMath::Matrix3x3::FromEulerAngleY ( float  fAngleY)

Sets an y axis rotation matrix by using one given Euler angle.

Parameters:
[in]fAngleYRotation angle around the y axis (in radian, between [0, Math::Pi2])
Remarks:
         |  cos(a)    0     sin(a) |
    RY = |    0       1       0    |
         | -sin(a)    0     cos(a) |
where a > 0 indicates a counterclockwise rotation in the zx-plane (if you look along -y)
PLMATH_API void PLMath::Matrix3x3::FromEulerAngleZ ( float  fAngleZ)

Sets an z axis rotation matrix by using one given Euler angle.

Parameters:
[in]fAngleZRotation angle around the z axis (in radian, between [0, Math::Pi2])
Remarks:
         |  cos(a) -sin(a)    0    |
    RZ = |  sin(a)  cos(a)    0    |
         |    0       0       1    |
where a > 0 indicates a counterclockwise rotation in the xy-plane (if you look along -z)
PLMATH_API void PLMath::Matrix3x3::ToAxisAngle ( float &  fX,
float &  fY,
float &  fZ,
float &  fAngle 
) const

Returns a rotation matrix as a selected axis and angle.

Parameters:
[out]fXWill receive the x component of the selected axis
[out]fYWill receive the y component of the selected axis
[out]fZWill receive the z component of the selected axis
[out]fAngleWill receive the rotation angle around the selected axis (in radian, between [0, Math::Pi])
PLMATH_API void PLMath::Matrix3x3::FromAxisAngle ( float  fX,
float  fY,
float  fZ,
float  fAngle 
)

Sets a rotation matrix by using a selected axis and angle.

Parameters:
[in]fXX component of the selected axis
[in]fYY component of the selected axis
[in]fZZ component of the selected axis
[in]fAngleRotation angle around the selected axis (in radian, between [0, Math::Pi])
Note:
  • The given selected axis must be normalized!

Returns the x (left) axis.

Returns:
The x (left) axis
Remarks:
    | x 0 0 |
    | y 0 0 |
    | z 0 0 |
Note:
  • It's possible that the axis vector is not normalized because for instance the matrix was scaled

Returns the y (up) axis.

Returns:
The y (up) axis
Remarks:
    | 0 x 0 |
    | 0 y 0 |
    | 0 z 0 |
See also:

Returns the z (forward) axis.

Returns:
The z (forward) axis
Remarks:
    | 0 0 x |
    | 0 0 y |
    | 0 0 z |
See also:
PLMATH_API void PLMath::Matrix3x3::ToAxis ( Vector3 vX,
Vector3 vY,
Vector3 vZ 
) const

Returns the three axis of a rotation matrix (not normalized)

Parameters:
[out]vXWill receive the x axis
[out]vYWill receive the y axis
[out]vZWill receive the z axis
Remarks:
    | vX.x vY.x vZ.x |
    | vX.y vY.y vZ.y |
    | vX.z vY.z vZ.z |
PLMATH_API void PLMath::Matrix3x3::FromAxis ( const Vector3 vX,
const Vector3 vY,
const Vector3 vZ 
)

Sets a rotation matrix by using three given axis.

Parameters:
[in]vXX axis
[in]vYY axis
[in]vZZ axis
See also:
PLMATH_API Matrix3x3& PLMath::Matrix3x3::LookAt ( const Vector3 vEye,
const Vector3 vAt,
const Vector3 vUp 
)

Builds a look-at matrix.

Parameters:
[in]vEyeEye position
[in]vAtCamera look-at target
[in]vUpCurrent world's up, usually [0, 1, 0]
Returns:
This instance
Matrix3x3 & PLMath::Matrix3x3::SetShearing ( float  fShearXY,
float  fShearXZ,
float  fShearYX,
float  fShearYZ,
float  fShearZX,
float  fShearZY 
) [inline]

Sets a shearing matrix.

Parameters:
[in]fShearXYShear X by Y
[in]fShearXZShear X by Z
[in]fShearYXShear Y by X
[in]fShearYZShear Y by Z
[in]fShearZXShear Z by X
[in]fShearZYShear Z by Y
Returns:
This instance
Remarks:
A shearing matrix can be used to for instance make a 3D model appear to slant sideways. Here's a table showing how a combined shearing matrix looks like:
    | 1        fShearYX  fShearZX  |
    | fShearXY 1         fShearZY  |
    | fShearXZ fShearYZ  1         |
If you only want to shear one axis it's recommended to construct the matrix by yourself.

Member Data Documentation

PLMATH_API const Matrix3x3 PLMath::Matrix3x3::Zero [static]

Zero matrix

PLMATH_API const Matrix3x3 PLMath::Matrix3x3::Identity [static]

Identity matrix

One dimensional array representation.

Remarks:
The entry of the matrix in row r (0 <= r <= 2) and column c (0 <= c <= 2) is stored at index i = r+3*c (0 <= i <= 8).
Indices:
      | 0 3 6 |
      | 1 4 7 |
      | 2 5 8 |
union { ... }

Some direct matrix accesses.


The documentation for this class was generated from the following files:


PixelLight PixelLight 0.9.11-R1
Copyright (C) 2002-2012 by The PixelLight Team
Last modified Thu Feb 23 2012 14:09:35
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported