source: trunk/packages/vizservers/nanovis/vrmath/LineSegment.cpp @ 3467

Last change on this file since 3467 was 3467, checked in by ldelgass, 11 years ago

Begin process of renaming/merging vrmath library

  • Property svn:eol-style set to native
File size: 469 bytes
Line 
1/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2#include <vrmath/LineSegment.h>
3
4
5vrLineSegment::vrLineSegment():
6    pos(0.0f, 0.0f, 0.0f), dir(0.0f, 0.0f, -1.0f), length(0.0f)
7{
8}
9
10void vrLineSegment::transform(const vrMatrix4x4f &mat, const vrLineSegment &seg)
11{
12    pos.transform(mat, seg.pos);
13       
14    dir.x *= length;
15    dir.y *= length;
16    dir.z *= length;
17
18    dir.transformVec(mat, seg.dir);
19    length = dir.length();
20    dir.normalize();
21}
Note: See TracBrowser for help on using the repository browser.