Additional vector routines. More...
#include <simgear/compiler.h>
#include <plib/sg.h>
Go to the source code of this file.
Functions | |
void | sgProjection (sgVec3 p, const sgVec3 u, const sgVec3 d) |
calculate the projection, p, of u along the direction of d. | |
void | sgmap_vec_onto_cur_surface_plane (sgVec3 normal, sgVec3 v0, sgVec3 vec, sgVec3 result) |
Map i.e. | |
void | sgCopyNegateVec4 (sgVec4 dst, sgVec4 src) |
Copy and negate a vector. | |
void | sgClosestPointToLine (sgVec3 p1, const sgVec3 p, const sgVec3 p0, const sgVec3 d) |
Given a point p, and a line through p0 with direction vector d, find the closest point (p1) on the line (float version). | |
void | sgdClosestPointToLine (sgdVec3 p1, const sgdVec3 p, const sgdVec3 p0, const sgdVec3 d) |
Given a point p, and a line through p0 with direction vector d, find the closest point (p1) on the line (double version). | |
double | sgClosestPointToLineDistSquared (const sgVec3 p, const sgVec3 p0, const sgVec3 d) |
Given a point p, and a line through p0 with direction vector d, find the shortest distance (squared) from the point to the line (float version. | |
double | sgdClosestPointToLineDistSquared (const sgdVec3 p, const sgdVec3 p0, const sgdVec3 d) |
Given a point p, and a line through p0 with direction vector d, find the shortest distance (squared) from the point to the line (double version. | |
void | sgPostMultMat4ByTransMat4 (sgMat4 src, const sgVec3 trans) |
This is same as:. |
Additional vector routines.
Definition in file vector.hxx.
void sgClosestPointToLine | ( | sgVec3 | p1, | |
const sgVec3 | p, | |||
const sgVec3 | p0, | |||
const sgVec3 | d | |||
) |
Given a point p, and a line through p0 with direction vector d, find the closest point (p1) on the line (float version).
p1 | (out) closest point to p on the line | |
p | (in) original point | |
p0 | (in) point on the line | |
d | (in) vector defining line direction |
Definition at line 48 of file vector.cxx.
double sgClosestPointToLineDistSquared | ( | const sgVec3 | p, | |
const sgVec3 | p0, | |||
const sgVec3 | d | |||
) |
Given a point p, and a line through p0 with direction vector d, find the shortest distance (squared) from the point to the line (float version.
)
p | (in) original point | |
p0 | (in) point on the line | |
d | (in) vector defining line direction |
Definition at line 86 of file vector.cxx.
void sgCopyNegateVec4 | ( | sgVec4 | dst, | |
sgVec4 | src | |||
) | [inline] |
Copy and negate a vector.
dst | (out) result vector | |
src | (in) input vector |
Definition at line 107 of file vector.hxx.
void sgdClosestPointToLine | ( | sgdVec3 | p1, | |
const sgdVec3 | p, | |||
const sgdVec3 | p0, | |||
const sgdVec3 | d | |||
) |
Given a point p, and a line through p0 with direction vector d, find the closest point (p1) on the line (double version).
p1 | (out) closest point to p on the line | |
p | (in) original point | |
p0 | (in) point on the line | |
d | (in) vector defining line direction |
Definition at line 67 of file vector.cxx.
double sgdClosestPointToLineDistSquared | ( | const sgdVec3 | p, | |
const sgdVec3 | p0, | |||
const sgdVec3 | d | |||
) |
Given a point p, and a line through p0 with direction vector d, find the shortest distance (squared) from the point to the line (double version.
)
p | (in) original point | |
p0 | (in) point on the line | |
d | (in) vector defining line direction |
Definition at line 107 of file vector.cxx.
void sgmap_vec_onto_cur_surface_plane | ( | sgVec3 | normal, | |
sgVec3 | v0, | |||
sgVec3 | vec, | |||
sgVec3 | result | |||
) | [inline] |
Map i.e.
project a vector onto a plane.
normal | (in) normal vector for the plane | |
v0 | (in) a point on the plane | |
vec | (in) the vector to map onto the plane | |
result | (out) the result vector |
Definition at line 57 of file vector.hxx.
void sgPostMultMat4ByTransMat4 | ( | sgMat4 | src, | |
const sgVec3 | trans | |||
) |
This is same as:.
sgMakeMatTrans4( sgMat4 sgTrans, sgVec3 trans ) sgPostMultMat4( sgMat4 src, sgTRANS );
src | starting sgMat4 matrix | |
trans | translation vector |
Definition at line 129 of file vector.cxx.
void sgProjection | ( | sgVec3 | p, | |
const sgVec3 | u, | |||
const sgVec3 | d | |||
) |
calculate the projection, p, of u along the direction of d.
p | (out) the projection | |
u | (in) the vector to be projected | |
d | (in) the direction onto which we project |
Definition at line 33 of file vector.cxx.