added get_relative_vector

This commit is contained in:
Dave Schuyler 2003-05-06 04:19:17 +00:00
parent 362c716a82
commit 0575f75afd
2 changed files with 14 additions and 0 deletions

View File

@ -1316,6 +1316,19 @@ get_relative_point(const NodePath &other, const LVecBase3f &point) {
return rel_point;
}
////////////////////////////////////////////////////////////////////
// Function: NodePath::get_relative_vector
// Access: Published
// Description: Given that the indicated vector is in the coordinate
// system of the other node, returns the same vector in
// this node's coordinate system.
////////////////////////////////////////////////////////////////////
LVector3f NodePath::
get_relative_vector(const NodePath &other, const LVecBase3f &vec) {
LVector3f rel_vector = LVector3f(vec) * other.get_mat(*this);
return rel_vector;
}
////////////////////////////////////////////////////////////////////
// Function: NodePath::look_at
// Access: Published

View File

@ -378,6 +378,7 @@ PUBLISHED:
void set_mat(const NodePath &other, const LMatrix4f &mat);
LPoint3f get_relative_point(const NodePath &other, const LVecBase3f &point);
LVector3f get_relative_vector(const NodePath &other, const LVecBase3f &vec);
INLINE void look_at(const NodePath &other,
float x, float y, float z);