add getNormalized()
This commit is contained in:
@@ -87,6 +87,8 @@ class Vec4 {
|
|||||||
/** Normalize vector */
|
/** Normalize vector */
|
||||||
void normalize();
|
void normalize();
|
||||||
|
|
||||||
|
Vec4 getNormalized() const;
|
||||||
|
|
||||||
/** Returns distance between two vectors */
|
/** Returns distance between two vectors */
|
||||||
float distanceTo(const Vec4& v) const;
|
float distanceTo(const Vec4& v) const;
|
||||||
|
|
||||||
|
|||||||
@@ -228,6 +228,12 @@ void Vec4::normalize() {
|
|||||||
: "r"(this->xyzw));
|
: "r"(this->xyzw));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Vec4 Vec4::getNormalized() const {
|
||||||
|
Vec4 result(*this);
|
||||||
|
result.normalize();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
float Vec4::distanceTo(const Vec4& v) const {
|
float Vec4::distanceTo(const Vec4& v) const {
|
||||||
float result;
|
float result;
|
||||||
asm volatile(
|
asm volatile(
|
||||||
|
|||||||
Reference in New Issue
Block a user