# Changeset 819

Ignore:
Timestamp:
Nov 26, 2007 11:29:55 AM (13 years ago)
Message:

Location:
trunk/vizservers/nanovis
Files:
4 edited

Unmodified
Removed
• ## trunk/vizservers/nanovis/Vector3.cpp

 r226 */ #include "Vector3.h" #include "Mat4x4.h" #include #include y*op2.y + z*op2.z; } float Vector3::dot(const Vector3& vec) const { return x*vec.x + y*vec.y + z*vec.z; } } float Vector3::distance(Vector3 &another){ float Vector3::distance(Vector3 &another) const { return sqrtf( (x - another.x) * (x - another.x) + (y - another.y) * (y - another.y) } float Vector3::distanceSquare(Vector3 &another) const { return ( (x - another.x) * (x - another.x) + (y - another.y) * (y - another.y) + (z - another.z) * (z - another.z) ); } float Vector3::distanceSquare(float vx, float vy, float vz) const { return ( (x - vx) * (x - vx) + (y - vy) * (y - vy) + (z - vz) * (z - vz) ); } void Vector3::transform(const Vector3& v, const Mat4x4& mat) { const float* m = mat.m; x = m[0] * v.x + m[4] * v.y + m[8] * v.z + m[12]; y = m[1] * v.x + m[5] * v.y + m[9] * v.z + m[13]; z = m[2] * v.x + m[6] * v.y + m[10] * v.z + m[14]; } float Vector3::length() const { return sqrt(x * x + y * y + z * z); }
• ## trunk/vizservers/nanovis/Vector3.h

 r226 #ifndef _VECTOR3_H_ #define _VECTOR3_H_ class Mat4x4; class Vector3{ void set(float newx, float newy, float newz); void print(); float distance(Vector3 &another);       //compute distance float distance(Vector3 &another) const; //compute distance float distanceSquare(Vector3 &another) const;   //compute distance float distanceSquare(float vx, float vy, float vz) const;       //compute distance //fast version Vector3 cross(Vector3 op2); float dot(const Vector3& vec) const; void transform(const Vector3& vec, const Mat4x4& mat); float length() const; };
• ## trunk/vizservers/nanovis/Vector4.cpp

 r226 w = op2.w; } void Vector4::set(float x1, float y1, float z1, float w1) { x = x1; y = y1; z = z1; w = w1; }
• ## trunk/vizservers/nanovis/Vector4.h

 r226 Vector4 operator/(float op2);     //mul per component void operator <(Vector4 &op2);    //assign void set(float x1, float y1, float z1, float w1); };
Note: See TracChangeset for help on using the changeset viewer.