vector.hxx File Reference

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:.

Detailed Description

Additional vector routines.

Definition in file vector.hxx.


Function Documentation

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).

Parameters:
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.

)

Parameters:
p (in) original point
p0 (in) point on the line
d (in) vector defining line direction
Returns:
shortest distance (squared) from p to line

Definition at line 86 of file vector.cxx.

void sgCopyNegateVec4 ( sgVec4  dst,
sgVec4  src 
) [inline]

Copy and negate a vector.

Parameters:
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).

Parameters:
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.

)

Parameters:
p (in) original point
p0 (in) point on the line
d (in) vector defining line direction
Returns:
shortest distance (squared) from p to line

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.

Parameters:
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 );

Parameters:
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.

Parameters:
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.


Generated on 23 Feb 2010 for SimGear by  doxygen 1.6.1