Torque 3D 3.7
ContentsIndexHome
PreviousUpNext
Functions

The following table lists functions in this documentation.

 
Name 
Description 
 
WORK IN PROGRESS
Creates an orthonormal basis matrix from one, two, or three unit length input vectors. If more than one input vector is provided they must be mutually perpendicular.
@param rvec Optional unit length right vector. @param fvec Optional unit length forward vector. @param uvec Optional unit length up vector. @param pos Optional position to initialize the matrix. @param outMat The output matrix which must be initialized prior to the call.
 
 
Collide two capsules (sphere swept lines) against each other, reporting only if they intersect or not. Based on routine from "Real Time Collision Detection" by Christer Ericson pp 114.
 
 
Return capsule-sphere overlap. Returns time of first overlap, where time is viewed as a sphere of radius radA moving from point A0 to A1.
 
 
Clip @a inFrustum by the given polygon.
@note The input polygon is limited to 58 vertices.
@param points Polygon vertices. @param numPoints Number of vertices in @a points. @param viewport Screen viewport. Note that this corresponds to the root frustum and not necessarily to @a inFrustum. @param world World->view transform. @param projection Projection matrix. @param inFrustum Frustum to clip. @param rootFrustum Frustum corresponding to @a viewport. @param outFrustum Resulting clipped frustum.
@return True if the frustum was successfully clipped and @a outFrustum is valid, false otherwise (if, for example, the input polygon... more 
 
Creates orientation matrix from a direction vector. Assumes ( 0 0 1 ) is up.
 
 
Find the intersection of the line going from @a edgeA to @a edgeB with the triangle given by @a faceA, @a faceB, and @a faceC. @param edgeA Starting point of edge. @param edgeB End point of edge. @param faceA First vertex of triangle. @param faceB Second vertex of triangle. @param faceC Third vertex of triangle. @param intersection If there is an intersection, the point of intersection on the triangle's face is stored here. @param True if there is an intersection, false otherwise.
 
 
Extrude the given polygon along the given direction.
 
 
Extrude the edges of the given polygon away from @a fromPoint by constructing a set of planes that each go through @a fromPoint and a pair of vertices.
The resulting planes are in the same order as the vertices and have their normals facing *inwards*, i.e. the resulting volume will enclose the polygon's interior space.
@param vertices Vertices of the polygon in CCW or CW order (both are acceptable). @param numVertices Number of vertices in @a vertices. @param fromPoint @param outPlanes Array in which the resulting planes are stored. Must have room for at least as... more 
 
Returns yaw and pitch angles from a given vector.
Angles are in RADIANS.
Assumes north is (0.0, 1.0, 0.0), the degrees move upwards clockwise.
The range of yaw is 0 - 2PI. The range of pitch is -PI/2 - PI/2.
ASSUMES Z AXIS IS UP
 
 
Creates an orthonormal basis matrix with the unit length input vector in column 1 (forward vector).
@param forward The non-zero unit length forward vector. @param outMat The output matrix which must be initialized prior to the call.
 
 
Creates an orthonormal basis matrix with the unit length input vector in column 2 (up vector).
@param up The non-zero unit length up vector. @param outMat The output matrix which must be initialized prior to the call.
 
 
Returns vector from given yaw and pitch angles.
Angles are in RADIANS.
Assumes north is (0.0, 1.0, 0.0), the degrees move upwards clockwise.
The range of yaw is 0 - 2PI. The range of pitch is -PI/2 - PI/2.
ASSUMES Z AXIS IS UP
 
 
Generates a projection matrix with the near plane moved forward by the bias amount. This function is a helper primarily for working around z-fighting issues.
@param bias The amount to move the near plane forward. @param frustum The frustum to generate the new projection matrix from. @param outMat The resulting z-biased projection matrix. Note: It must be initialized before the call. @param rotate Optional parameter specifying whether to rotate the projection matrix similarly to GFXDevice.
 
 
Returns the greatest common divisor of two positive integers.
 
 
Find out whether the given polygon is convex. @param vertices Array of vertices of the polygon. @param numVertices Number of vertices in @a vertices. @return True if the polygon is convex, false otherwise.
 
 
Find out whether the given polygon is planar. @param vertices Array of vertices of the polygon. @param numVertices Number of vertices in @a vertices. @return True if the polygon is planar, false otherwise.
 
 
 
 
Build the frustum near plane dimensions from the parameters.
 
 
Build an orthographic projection matrix from the frustum near plane dimensions including the optional rotation required by GFX.
 
 
Build a projection matrix from the frustum near plane dimensions including the optional rotation required by GFX
 
Build a GFX projection matrix from the frustum parameters including the optional rotation required by GFX.
 
 
Returns the closest point on the segment defined by points a, b to the point p.
 
 
Returns the barycentric coordinates and time of intersection between a line segment and a triangle.
@param p1 The first point of the line segment. @param p2 The second point of the line segment. @param t1 The first point of the triangle. @param t2 The second point of the triangle. @param t2 The third point of the triangle. @param outUVW The optional output barycentric coords. @param outT The optional output time of intersection.
@return Returns true if a collision occurs.
 
 
 
 
 
 
 
 
Returns the uv coords and time of intersection between a ray and a quad.
@param quad The quad. @param ray The ray. @param outUV The optional output UV coords of the intersection. @param outT The optional output time of intersection.
@return Returns true if a collision occurs.
 
 
Calculates the shortest line segment between two lines.
@param outSegment The result where .p0 is the point on line0 and .p1 is the point on line1.
 
 
Returns the distance between a point and triangle 'abc'.
 
 
Returns the normal of the passed triangle 'abc'.
If we assume counter-clockwise triangle culling, normal will point out from the 'solid' side of the triangle.
 
 
Returns true if the test point is within the polygon. @param verts The array of points which forms the polygon. @param vertCount The number of points in the polygon. @param testPt The point to test.
 
 
Creates random direction given angle parameters similar to the particle system.
The angles are relative to the specified axis. Both phi and theta are in degrees.
 
 
Returns a random 2D point within a circle of the specified radius centered at the origin.
 
 
Returns a random 3D point within a sphere of the specified radius centered at the origin.
 
 
 
 
Remove all edges from the given polygon that have a total length shorter than @a epsilon
 
Intersect two line segments (p1,q1) and (p2,q2), returning points on lines (c1 & c2) and line parameters (s,t). Based on routine from "Real Time Collision Detection" by Christer Ericson pp 149.
 
 
This is the special rotation matrix applied to projection matricies for GFX.
It is a wart of the OGL to DX change over. 
 
< Our random number generator. 
 
Sort the passed verts ( Point3F ) in a clockwise or counter-clockwise winding order. Verts must be co-planar and non-collinear.
@param quadMat Transform matrix from vert space to quad space. @param clockwise Sort clockwise or counter-clockwise @param verts Array of Point3F verts. @param vertMap Output - Array of vert element ids sorted by winding order. @param count Element count of the verts and vertMap arrays which must be allocated prior to this call. 
 
Same as above except we assume that the passed verts ( Point3F ) are already transformed into 'quad space'. If this was done correctly and the points are coplanar this means their z components will all be zero. 
 
Transform bounding box making sure to keep original box entirely contained.
 
 
This is function MathUtils::vectorRotateZAxis. 
 
Rotate the passed vector around the world-z axis by the passed radians.
 
Copyright (c) 2015. All rights reserved.
What do you think about this topic? Send feedback!