Merge remote-tracking branch 'origin/GamePhysics' into GameLogic

This commit is contained in:
Erik Persson 2014-02-12 13:57:01 +01:00
commit 8f627f8a71
11 changed files with 11 additions and 8 deletions

View File

@ -112,6 +112,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<ModuleDefinitionFile>
</ModuleDefinitionFile>
<AdditionalDependencies>$(SolutionDir)Physics/lib/debug/BulletCollision_Debugx64.lib;$(SolutionDir)Physics/lib/debug/BulletDynamics_Debugx64.lib;$(SolutionDir)Physics/lib/debug/LinearMath_Debugx64.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@ -130,6 +131,7 @@
<OptimizeReferences>true</OptimizeReferences>
<ModuleDefinitionFile>
</ModuleDefinitionFile>
<AdditionalDependencies>$(SolutionDir)Physics/lib/release/BulletCollision.lib;$(SolutionDir)Physics/lib/release/BulletDynamics.lib;$(SolutionDir)Physics/lib/release/LinearMath.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@ -148,6 +150,7 @@
<OptimizeReferences>true</OptimizeReferences>
<ModuleDefinitionFile>
</ModuleDefinitionFile>
<AdditionalDependencies>$(SolutionDir)Physics/lib/release/BulletCollisionx64.lib;$(SolutionDir)Physics/lib/release/BulletDynamicsx64.lib;$(SolutionDir)Physics/lib/release/LinearMathx64.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>

View File

@ -106,36 +106,36 @@ void SimpleRigidBody::SetLinearVelocity(Float3 velocity)
void SimpleRigidBody::SetPosition(::Oyster::Math::Float3 position)
{
btTransform trans;
this->motionState->getWorldTransform(trans);
trans = this->rigidBody->getWorldTransform();
trans.setOrigin(btVector3(position.x, position.y, position.z));
this->motionState->setWorldTransform(trans);
this->rigidBody->setWorldTransform(trans);
this->state.centerPos = position;
}
void SimpleRigidBody::SetRotation(Float4 quaternion)
{
btTransform trans;
this->motionState->getWorldTransform(trans);
trans = this->rigidBody->getWorldTransform();
trans.setRotation(btQuaternion(quaternion.x, quaternion.y, quaternion.z, quaternion.w));
this->motionState->setWorldTransform(trans);
this->rigidBody->setWorldTransform(trans);
this->state.quaternion = Quaternion(quaternion.xyz, quaternion.w);
}
void SimpleRigidBody::SetRotation(::Oyster::Math::Quaternion quaternion)
{
btTransform trans;
this->motionState->getWorldTransform(trans);
trans = this->rigidBody->getWorldTransform();
trans.setRotation(btQuaternion(quaternion.imaginary.x, quaternion.imaginary.y, quaternion.imaginary.z, quaternion.real));
this->motionState->setWorldTransform(trans);
this->rigidBody->setWorldTransform(trans);
this->state.quaternion = quaternion;
}
void SimpleRigidBody::SetRotation(Float3 eulerAngles)
{
btTransform trans;
this->motionState->getWorldTransform(trans);
trans = this->rigidBody->getWorldTransform();
trans.setRotation(btQuaternion(eulerAngles.x, eulerAngles.y, eulerAngles.z));
this->motionState->setWorldTransform(trans);
this->rigidBody->setWorldTransform(trans);
this->state.quaternion = Quaternion(Float3(trans.getRotation().x(), trans.getRotation().y(), trans.getRotation().z()), trans.getRotation().w());
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.