From 5d1e05cc4e4f5749c846213190d9518cd551f77a Mon Sep 17 00:00:00 2001 From: Robin Engman Date: Tue, 28 Jan 2014 09:24:51 +0100 Subject: [PATCH] Added new function to set orientation. --- Code/GamePhysics/PhysicsStructs-Impl.h | 9 +++++++++ Code/GamePhysics/PhysicsStructs.h | 5 +++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Code/GamePhysics/PhysicsStructs-Impl.h b/Code/GamePhysics/PhysicsStructs-Impl.h index 7e1e8c46..3fd430ff 100644 --- a/Code/GamePhysics/PhysicsStructs-Impl.h +++ b/Code/GamePhysics/PhysicsStructs-Impl.h @@ -256,6 +256,13 @@ namespace Oyster this->isSpatiallyAltered = this->isDisturbed = true; } + inline void CustomBodyState::SetOrientation( const ::Oyster::Math::Float3 &angularAxis, const ::Oyster::Math::Float3 &translation ) + { + this->angularAxis.xyz = angularAxis ; + this->centerPos.xyz = translation; + this->isSpatiallyAltered = this->isDisturbed = true; + } + /*inline void CustomBodyState::SetRotation( const ::Oyster::Math::Float4x4 &rotation ) { this->SetRotation( ::Oyster::Math3D::AngularAxis(rotation) ); @@ -267,6 +274,8 @@ namespace Oyster this->SetCenterPosition( orientation.v[3] ); }*/ + + inline void CustomBodyState::SetLinearMomentum( const ::Oyster::Math::Float4 &g ) { this->linearMomentum.xyz = g; diff --git a/Code/GamePhysics/PhysicsStructs.h b/Code/GamePhysics/PhysicsStructs.h index 4eaaf46d..00b382c5 100644 --- a/Code/GamePhysics/PhysicsStructs.h +++ b/Code/GamePhysics/PhysicsStructs.h @@ -94,8 +94,9 @@ namespace Oyster { namespace Physics void SetReach( const ::Oyster::Math::Float4 &halfSize ); void SetCenterPosition( const ::Oyster::Math::Float4 ¢erPos ); void SetRotation( const ::Oyster::Math::Float4 &angularAxis ); - void SetRotation( const ::Oyster::Math::Float4x4 &rotation ); - void SetOrientation( const ::Oyster::Math::Float4x4 &orientation ); + //void SetRotation( const ::Oyster::Math::Float4x4 &rotation ); + //void SetOrientation( const ::Oyster::Math::Float4x4 &orientation ); + void SetOrientation( const ::Oyster::Math::Float3 &angularAxis, const ::Oyster::Math::Float3 &translation ); void SetLinearMomentum( const ::Oyster::Math::Float4 &g ); void SetAngularMomentum( const ::Oyster::Math::Float4 &h ); void SetLinearImpulse( const ::Oyster::Math::Float4 &j );