Last change
on this file since 5048 was
3494,
checked in by ldelgass, 12 years ago
|
Remove last uses of float Matrix4x4 class from vrmath library
|
-
Property svn:eol-style set to
native
|
File size:
618 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/Plane.h> |
---|
9 | #include <vrmath/Matrix4x4d.h> |
---|
10 | |
---|
11 | using namespace vrmath; |
---|
12 | |
---|
13 | void Plane::transform(Matrix4x4d& mat) |
---|
14 | { |
---|
15 | Vector4f v(normal.x, normal.y, normal.z, distance); |
---|
16 | double* m = mat.get(); |
---|
17 | |
---|
18 | normal.set(m[0]*v.x + m[1]*v.y + m[2]*v.z + m[3]*v.w, |
---|
19 | m[4]*v.x + m[5]*v.y + m[6]*v.z + m[7]*v.w, |
---|
20 | m[8]*v.x + m[9]*v.y + m[10]*v.z + m[11]*v.w); |
---|
21 | |
---|
22 | distance = m[12]*v.x + m[13]*v.y + m[14]*v.z + m[15]*v.w; |
---|
23 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.