Title |
Function |
Function Name |
No |
format Fixed32 result = MTH_Sqrt (Fixed32x) Input x: Positive fixed-point real value Output None Function value result: Calculated value of square root Function Calculates and returns the square root of the input value.
Title |
Function |
Function Name |
No |
format Fixed32 z = MTH_Hypot (Fixed32 x, Fixed32 y) Input x: Horizontal side of right triangle y y: vertical side of right triangle Output None Function value z: Length of hypotenuse of right triangle Function Returns z that satisfies the following expression. z z squared = x squared + y squared and z ≧ 0
Title |
Function |
Function Name |
No |
format voidMTH_ComputeNormVect (Fixed32 surfNormK, (: MthXyz * p0, MthXyz * p1, MthXyz * p3, MthXyz * normal) Input surfNormK: Vertex distance correction value : p0: Coordinate of the first clockwise vertex on the surface : p1: Coordinates of the clockwise second vertex on the surface : p2: The coordinates of the third vertex on the right-hand side on the surface Output normal: Normal vector of the surface (unit vector) Function value None Function Calculates the normal to the specified clockwise vertex face. For normal vector surfaces The direction of is the reverse direction of the right-hand thread. The normal vector is calculated using two vectors based on the difference between two vertices of the three vertices of the surface. Get and obtain it by the outer product. The correction value for the specified distance between vertices is converted to an absolute value to obtain two vectors for obtaining the outer product. Can be multiplied by This is too small or too large between the three vertices of the face If . is used, 32-bit fixed-point operations will use underflow or off for cross product calculations. -It may not be possible to calculate correctly due to an overflow. : In order to avoid this, the vector is calculated at the stage of obtaining the vector based on the difference between the three vertices of the surface. Set the correction value for the distance between vertices so that the absolute value of is as close to 1.0 as possible. . : If the sign of the correction value for the distance between vertices is negative, the normal vector is reversed. .