Changeset 3872
 Timestamp:
 Aug 19, 2013, 2:11:14 AM (6 years ago)
 Location:
 trunk/packages/vizservers/nanovis/vrmath/include/vrmath
 Files:

 3 edited
Legend:
 Unmodified
 Added
 Removed

trunk/packages/vizservers/nanovis/vrmath/include/vrmath/Vector2f.h
r3628 r3872 40 40 void set(const Vector2f& v); 41 41 42 floatdot() const;42 double dot() const; 43 43 44 44 double length() const; … … 67 67 } 68 68 69 inline floatVector2f::dot() const69 inline double Vector2f::dot() const 70 70 { 71 71 return (x * x + y * y); 
trunk/packages/vizservers/nanovis/vrmath/include/vrmath/Vector3f.h
r3628 r3872 58 58 Vector3f scale(const Vector3f& scale) const; 59 59 60 Vector3f scale( floatscale) const;60 Vector3f scale(double scale) const; 61 61 62 62 bool operator==(const Vector3f& v) const; … … 67 67 68 68 // scalar ops 69 Vector3f operator+( floatscalar) const;70 Vector3f operator( floatscalar) const;71 Vector3f operator*( floatscalar) const;72 Vector3f operator/( floatscalar) const;73 Vector3f& operator*=( floatscalar);69 Vector3f operator+(double scalar) const; 70 Vector3f operator(double scalar) const; 71 Vector3f operator*(double scalar) const; 72 Vector3f operator/(double scalar) const; 73 Vector3f& operator*=(double scalar); 74 74 75 75 // vector ops … … 113 113 } 114 114 115 inline Vector3f Vector3f::operator+( floatscalar) const115 inline Vector3f Vector3f::operator+(double scalar) const 116 116 { 117 117 return Vector3f(x + scalar, y + scalar, z + scalar); 118 118 } 119 119 120 inline Vector3f Vector3f::operator( floatscalar) const120 inline Vector3f Vector3f::operator(double scalar) const 121 121 { 122 122 return Vector3f(x  scalar, y  scalar, z  scalar); 123 123 } 124 124 125 inline Vector3f Vector3f::operator*( floatscalar) const125 inline Vector3f Vector3f::operator*(double scalar) const 126 126 { 127 127 return Vector3f(x * scalar, y * scalar, z * scalar); 128 128 } 129 129 130 inline Vector3f Vector3f::operator/( floatscalar) const130 inline Vector3f Vector3f::operator/(double scalar) const 131 131 { 132 132 return Vector3f(x / scalar, y / scalar, z / scalar); 133 133 } 134 134 135 inline Vector3f& Vector3f::operator*=( floatscalar)135 inline Vector3f& Vector3f::operator*=(double scalar) 136 136 { 137 137 x *= scalar; … … 168 168 169 169 #if 0 170 inline Vector3f operator*( floatscale, const Vector3f& value)170 inline Vector3f operator*(double scale, const Vector3f& value) 171 171 { 172 172 return Vector3f(value.x * scale, value.y * scale, value.z * scale); … … 231 231 inline Vector3f Vector3f::normalize() const 232 232 { 233 floatlen = length();234 if (len > 1.0e6) {233 double len = length(); 234 if (len > 0.0) { 235 235 return Vector3f(x / len, y / len, z / len); 236 236 } else { … … 239 239 } 240 240 241 inline Vector3f Vector3f::scale( floatscale) const241 inline Vector3f Vector3f::scale(double scale) const 242 242 { 243 243 return Vector3f(x * scale, y * scale, z * scale); 
trunk/packages/vizservers/nanovis/vrmath/include/vrmath/Vector4f.h
r3628 r3872 66 66 } 67 67 68 Vector4f operator*( floatop2) const68 Vector4f operator*(double op2) const 69 69 { 70 70 return Vector4f(x * op2, y * op2, z * op2, w * op2); 71 71 } 72 72 73 Vector4f operator/( floatop2) const73 Vector4f operator/(double op2) const 74 74 { 75 75 return Vector4f(x / op2, y / op2, z / op2, w / op2); … … 78 78 void divideByW(); 79 79 80 floatdot(const Vector4f& vec) const;80 double dot(const Vector4f& vec) const; 81 81 82 82 union { … … 122 122 } 123 123 124 inline floatVector4f::dot(const Vector4f& v) const124 inline double Vector4f::dot(const Vector4f& v) const 125 125 { 126 return ( x * v.x + y * v.y + z * v.z +w * v.w);126 return ((double)x * v.x + (double)y * v.y + (double)z * v.z + (double)w * v.w); 127 127 } 128 128
Note: See TracChangeset
for help on using the changeset viewer.