From: <av...@us...> - 2010-08-01 13:34:09
|
Revision: 34642 http://crystal.svn.sourceforge.net/crystal/?rev=34642&view=rev Author: avoicu Date: 2010-08-01 13:34:03 +0000 (Sun, 01 Aug 2010) Log Message: ----------- Added SetInitialTransform method for PhysicsAnimationControl. Modified Paths: -------------- CS/branches/soc2010/hair/apps/tests/hairtest/krystal.cpp CS/branches/soc2010/hair/include/imaterial/furmaterial.h CS/branches/soc2010/hair/plugins/material/furmaterial/animationphysicscontrol.cpp CS/branches/soc2010/hair/plugins/material/furmaterial/animationphysicscontrol.h CS/branches/soc2010/hair/plugins/material/furmaterial/hairphysicscontrol.cpp CS/branches/soc2010/hair/plugins/material/furmaterial/hairphysicscontrol.h Modified: CS/branches/soc2010/hair/apps/tests/hairtest/krystal.cpp =================================================================== --- CS/branches/soc2010/hair/apps/tests/hairtest/krystal.cpp 2010-08-01 09:39:50 UTC (rev 34641) +++ CS/branches/soc2010/hair/apps/tests/hairtest/krystal.cpp 2010-08-01 13:34:03 UTC (rev 34642) @@ -147,7 +147,8 @@ { furMaterial->SetGuideLOD(0.0f); furMaterial->StopPhysicsControl(); - animationPhysicsControl->SetRigidBody(headBody); + animationPhysicsControl-> + SetInitialTransform(headBody->GetTransform().GetInverse()); furMaterial->SetPhysicsControl(animationPhysicsControl); furMaterial->StartPhysicsControl(); hairPhysicsEnabled = false; @@ -402,6 +403,7 @@ hairPhysicsControl->SetRigidBody(headBody); animationPhysicsControl->SetRigidBody(headBody); + animationPhysicsControl->SetInitialTransform(headBody->GetTransform().GetInverse()); // Initialize fur material furMaterial = furMaterialType->CreateFurMaterial("hair"); Modified: CS/branches/soc2010/hair/include/imaterial/furmaterial.h =================================================================== --- CS/branches/soc2010/hair/include/imaterial/furmaterial.h 2010-08-01 09:39:50 UTC (rev 34641) +++ CS/branches/soc2010/hair/include/imaterial/furmaterial.h 2010-08-01 13:34:03 UTC (rev 34642) @@ -36,6 +36,7 @@ { SCF_INTERFACE (iFurPhysicsControl, 1, 0, 0); + virtual void SetInitialTransform(csReversibleTransform initialTransform) = 0; virtual void SetRigidBody (iRigidBody* rigidBody) = 0; virtual void SetBulletDynamicSystem (iBulletDynamicSystem* bulletDynamicSystem) = 0; Modified: CS/branches/soc2010/hair/plugins/material/furmaterial/animationphysicscontrol.cpp =================================================================== --- CS/branches/soc2010/hair/plugins/material/furmaterial/animationphysicscontrol.cpp 2010-08-01 09:39:50 UTC (rev 34641) +++ CS/branches/soc2010/hair/plugins/material/furmaterial/animationphysicscontrol.cpp 2010-08-01 13:34:03 UTC (rev 34642) @@ -44,16 +44,21 @@ // From iComponent bool AnimationPhysicsControl::Initialize (iObjectRegistry* r) { + initialTransform.Identity(); object_reg = r; return true; } //-- iFurPhysicsControl + void AnimationPhysicsControl::SetInitialTransform(csReversibleTransform initialTransform) + { + this->initialTransform = initialTransform; + } + void AnimationPhysicsControl::SetRigidBody (iRigidBody* rigidBody) { this->rigidBody = rigidBody; - initialTransform = rigidBody->GetTransform().GetInverse(); } void AnimationPhysicsControl::SetBulletDynamicSystem (iBulletDynamicSystem* Modified: CS/branches/soc2010/hair/plugins/material/furmaterial/animationphysicscontrol.h =================================================================== --- CS/branches/soc2010/hair/plugins/material/furmaterial/animationphysicscontrol.h 2010-08-01 09:39:50 UTC (rev 34641) +++ CS/branches/soc2010/hair/plugins/material/furmaterial/animationphysicscontrol.h 2010-08-01 13:34:03 UTC (rev 34642) @@ -52,6 +52,7 @@ virtual bool Initialize (iObjectRegistry*); //-- iFurPhysicsControl + virtual void SetInitialTransform(csReversibleTransform initialTransform); virtual void SetRigidBody (iRigidBody* rigidBody); virtual void SetBulletDynamicSystem (iBulletDynamicSystem* bulletDynamicSystem); // Initialize the strand with the given ID Modified: CS/branches/soc2010/hair/plugins/material/furmaterial/hairphysicscontrol.cpp =================================================================== --- CS/branches/soc2010/hair/plugins/material/furmaterial/hairphysicscontrol.cpp 2010-08-01 09:39:50 UTC (rev 34641) +++ CS/branches/soc2010/hair/plugins/material/furmaterial/hairphysicscontrol.cpp 2010-08-01 13:34:03 UTC (rev 34642) @@ -50,6 +50,10 @@ //-- iFurPhysicsControl + void HairPhysicsControl::SetInitialTransform(csReversibleTransform initialTransform) + { + } + void HairPhysicsControl::SetRigidBody (iRigidBody* rigidBody) { this->rigidBody = rigidBody; Modified: CS/branches/soc2010/hair/plugins/material/furmaterial/hairphysicscontrol.h =================================================================== --- CS/branches/soc2010/hair/plugins/material/furmaterial/hairphysicscontrol.h 2010-08-01 09:39:50 UTC (rev 34641) +++ CS/branches/soc2010/hair/plugins/material/furmaterial/hairphysicscontrol.h 2010-08-01 13:34:03 UTC (rev 34642) @@ -46,6 +46,7 @@ virtual bool Initialize (iObjectRegistry*); //-- iFurPhysicsControl + virtual void SetInitialTransform(csReversibleTransform initialTransform); virtual void SetRigidBody (iRigidBody* rigidBody); virtual void SetBulletDynamicSystem (iBulletDynamicSystem* bulletDynamicSystem); // Initialize the strand with the given ID This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |