The Socrates Gameboy Advance Development Engine
The SGADE is a development library for the Nintendo Gameboy
Advance. It's free for all uses and is distributed without guarantees.
For more information visit
the SGADE page.
Files | |
| file | SoTransform.c |
| file | SoTransform.h |
Data Structures | |
| struct | SoTransform |
| Transformation class definition. More... | |
Functions | |
| void | SoTransformMakeIdentity (SoTransform *a_This) |
| Resets the transformation. | |
| void | SoTransformSetRotateX (SoTransform *a_This, s32 a_Angle) |
| Sets the rotation angle around the X-axis. | |
| void | SoTransformSetRotateY (SoTransform *a_This, s32 a_Angle) |
| Sets the rotation angle around the Y-axis. | |
| void | SoTransformSetRotateZ (SoTransform *a_This, s32 a_Angle) |
| Sets the rotation angle around the Z-axis. | |
| void | SoTransformSetTranslation (SoTransform *a_This, sofixedpoint a_X, sofixedpoint a_Y, sofixedpoint a_Z) |
| Sets the translational part of the transform. | |
| void | SoTransformRotateX (SoTransform *a_This, s32 a_Angle) |
| Rotates the transform around the X-axis. | |
| void | SoTransformRotateY (SoTransform *a_This, s32 a_Angle) |
| Rotates the transform around the Y-axis. | |
| void | SoTransformRotateZ (SoTransform *a_This, s32 a_Angle) |
| Rotates the transform around the Z-axis. | |
| void | SoTransformTranslate (SoTransform *a_This, sofixedpoint a_X, sofixedpoint a_Y, sofixedpoint a_Z) |
| Translates the transform. | |
| void | SoTransformToMatrix (SoTransform *a_This, SoMatrix *a_Matrix) |
| Returns a 3 by 4 matrix representation of the transform. | |
| void | SoTransformToInverseMatrix (SoTransform *a_This, SoMatrix *a_Matrix) |
| Returns a 3 by 4 matrix representation of the inverse of this transform. | |
| void | SoTransformSetScale (SoTransform *a_This, sofixedpoint a_ScaleX, sofixedpoint a_ScaleY, sofixedpoint a_ScaleZ) |
| Sets the uniform scale value. | |
This module contains the definition of a transformation. A transformation can be represented by a matrix as well, but a matrix is more sensitive for accumulating errors, especially because we are using a low-precision fixed point format. That's why you should use this transformation class and not convert it to a matrix until the very last moment.
Note that the transform separately stores its translation, scaling, and rotation and they do not interact with each other. When constructing a matrix from a transform, we always composite them in the order X rotation, Y rotation, Z rotation, translation, scale. For this reason, transforms are not ideal for use in hierarchical scene graphs.
|
|
Resets the transformation.
Sets the transformation to the identity-transform. Sets the translation part to zero. Sets the rotational part to zero, and sets the uniform scale to one.
|
|
||||||||||||
|
Rotates the transform around the X-axis.
The difference between this one and SetTransformRotateX is that this one adds the angle to the existing angle.
|
|
||||||||||||
|
Rotates the transform around the Y-axis.
The difference between this one and SetTransformRotateY is that this one adds the angle to the existing angle.
|
|
||||||||||||
|
Rotates the transform around the Z-axis.
The difference between this one and SetTransformRotateZ is that this one adds the angle to the existing angle.
|
|
||||||||||||
|
Sets the rotation angle around the X-axis.
|
|
||||||||||||
|
Sets the rotation angle around the Y-axis.
|
|
||||||||||||
|
Sets the rotation angle around the Z-axis.
|
|
||||||||||||||||||||
|
Sets the uniform scale value.
|
|
||||||||||||||||||||
|
Sets the translational part of the transform.
|
|
||||||||||||
|
Returns a 3 by 4 matrix representation of the inverse of this transform.
|
|
||||||||||||
|
Returns a 3 by 4 matrix representation of the transform.
|
|
||||||||||||||||||||
|
Translates the transform.
The difference between this one and SoTransformSetTranslate is that in this Method the translation is added to the existing transformation.
|