Const versions of Vector4's X(), Y(), and Z()
This commit is contained in:
parent
584d0326a9
commit
9b6b6a20b7
2 changed files with 26 additions and 0 deletions
|
@ -42,6 +42,13 @@ Vector4::X()
|
|||
return mData[0];
|
||||
}
|
||||
|
||||
const Double&
|
||||
Vector4::X()
|
||||
const
|
||||
{
|
||||
return mData[0];
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* charles::basics::Vector4::Y --
|
||||
|
@ -53,6 +60,14 @@ Vector4::Y()
|
|||
}
|
||||
|
||||
|
||||
const Double&
|
||||
Vector4::Y()
|
||||
const
|
||||
{
|
||||
return mData[1];
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* charles::basics::Vector4::Z --
|
||||
*/
|
||||
|
@ -63,6 +78,14 @@ Vector4::Z()
|
|||
}
|
||||
|
||||
|
||||
const Double&
|
||||
Vector4::Z()
|
||||
const
|
||||
{
|
||||
return mData[2];
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* charles::basics::Vector4::Length2 --
|
||||
*/
|
||||
|
|
|
@ -26,8 +26,11 @@ struct Vector4
|
|||
Vector4(const Double& x, const Double& y, const Double& z);
|
||||
|
||||
Double& X();
|
||||
const Double& X() const;
|
||||
Double& Y();
|
||||
const Double& Y() const;
|
||||
Double& Z();
|
||||
const Double& Z() const;
|
||||
|
||||
/** Get the length-squared of this vector. */
|
||||
Double Length2() const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue