source: trunk/packages/vizservers/nanovis/vrmath/vrLineSegment.cpp @ 2840

Last change on this file since 2840 was 2840, checked in by ldelgass, 12 years ago

Use trace macros in image loader. Formatting fixes in libs

  • Property svn:eol-style set to native
File size: 471 bytes
Line 
1/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2#include <vrmath/vrLineSegment.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.