diff --git a/Code/GamePhysics/PhysicsStructs-Impl.h b/Code/GamePhysics/PhysicsStructs-Impl.h index e7704460..f7b5e83c 100644 --- a/Code/GamePhysics/PhysicsStructs-Impl.h +++ b/Code/GamePhysics/PhysicsStructs-Impl.h @@ -122,11 +122,21 @@ namespace Oyster { namespace Physics 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 { 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 { return this->linearMomentum; diff --git a/Code/GamePhysics/PhysicsStructs.h b/Code/GamePhysics/PhysicsStructs.h index 3c17ae6d..e4d70c4f 100644 --- a/Code/GamePhysics/PhysicsStructs.h +++ b/Code/GamePhysics/PhysicsStructs.h @@ -60,7 +60,9 @@ namespace Oyster { namespace Physics const ::Oyster::Math::Float4 & GetAngularAxis() const; ::Oyster::Math::Float4x4 GetRotation() 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::Float4 &offset ) const; const ::Oyster::Math::Float4 & GetLinearMomentum() const; ::Oyster::Math::Float4 GetLinearMomentum( const ::Oyster::Math::Float4 &at ) const; const ::Oyster::Math::Float4 & GetAngularMomentum() const;