source: nanovis/trunk/vrmath/LineSegment.cpp

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

Remove last uses of float Matrix4x4 class from vrmath library

  • Property svn:eol-style set to native
File size: 573 bytes
Line 
1/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2/*
3 * Copyright (c) 2004-2013  HUBzero Foundation, LLC
4 *
5 * Author: Insoo Woo <iwoo@purdue.edu>
6 */
7
8#include <vrmath/LineSegment.h>
9#include <vrmath/Matrix4x4d.h>
10
11using namespace vrmath;
12
13LineSegment::LineSegment():
14    pos(0, 0, 0, 1), dir(0.0f, 0.0f, -1.0f), length(0.0f)
15{
16}
17
18void LineSegment::transform(const Matrix4x4d &mat, const LineSegment &seg)
19{
20    pos = mat.transform(seg.pos);
21
22    dir *= length;
23
24    dir = mat.transformVec(seg.dir);
25    length = dir.length();
26    dir = dir.normalize();
27}
Note: See TracBrowser for help on using the repository browser.