struct State::GetView() overload

Can now provide an offset vector as argument
This commit is contained in:
Dander7BD 2014-01-09 10:42:22 +01:00
parent 42de421904
commit 687ffa4f99
2 changed files with 12 additions and 0 deletions

View File

@ -122,11 +122,21 @@ namespace Oyster { namespace Physics
return ::Oyster::Math3D::OrientationMatrix( this->angularAxis.xyz, this->centerPos.xyz ); return ::Oyster::Math3D::OrientationMatrix( this->angularAxis.xyz, this->centerPos.xyz );
} }
inline ::Oyster::Math::Float4x4 CustomBodyState::GetOrientation( const ::Oyster::Math::Float4 &offset ) const
{
return ::Oyster::Math3D::OrientationMatrix( this->angularAxis.xyz, (this->centerPos + offset).xyz );
}
inline ::Oyster::Math::Float4x4 CustomBodyState::GetView() const inline ::Oyster::Math::Float4x4 CustomBodyState::GetView() const
{ {
return ::Oyster::Math3D::ViewMatrix( this->angularAxis.xyz, this->centerPos.xyz ); return ::Oyster::Math3D::ViewMatrix( this->angularAxis.xyz, this->centerPos.xyz );
} }
inline ::Oyster::Math::Float4x4 CustomBodyState::GetView( const ::Oyster::Math::Float4 &offset ) const
{
return ::Oyster::Math3D::ViewMatrix( this->angularAxis.xyz, (this->centerPos + offset).xyz );
}
inline const ::Oyster::Math::Float4 & CustomBodyState::GetLinearMomentum() const inline const ::Oyster::Math::Float4 & CustomBodyState::GetLinearMomentum() const
{ {
return this->linearMomentum; return this->linearMomentum;

View File

@ -60,7 +60,9 @@ namespace Oyster { namespace Physics
const ::Oyster::Math::Float4 & GetAngularAxis() const; const ::Oyster::Math::Float4 & GetAngularAxis() const;
::Oyster::Math::Float4x4 GetRotation() const; ::Oyster::Math::Float4x4 GetRotation() const;
::Oyster::Math::Float4x4 GetOrientation() const; ::Oyster::Math::Float4x4 GetOrientation() const;
::Oyster::Math::Float4x4 GetOrientation( const ::Oyster::Math::Float4 &offset ) const;
::Oyster::Math::Float4x4 GetView() const; ::Oyster::Math::Float4x4 GetView() const;
::Oyster::Math::Float4x4 GetView( const ::Oyster::Math::Float4 &offset ) const;
const ::Oyster::Math::Float4 & GetLinearMomentum() const; const ::Oyster::Math::Float4 & GetLinearMomentum() const;
::Oyster::Math::Float4 GetLinearMomentum( const ::Oyster::Math::Float4 &at ) const; ::Oyster::Math::Float4 GetLinearMomentum( const ::Oyster::Math::Float4 &at ) const;
const ::Oyster::Math::Float4 & GetAngularMomentum() const; const ::Oyster::Math::Float4 & GetAngularMomentum() const;