diff --git a/Code/DanBias.sln b/Code/DanBias.sln index f2bf5f98..c01d5969 100644 --- a/Code/DanBias.sln +++ b/Code/DanBias.sln @@ -70,6 +70,8 @@ Global {0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|Win32.Deploy.0 = Debug|Win32 {0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|x64.ActiveCfg = Release|x64 {0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|x64.Build.0 = Release|x64 + {0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|x64.ActiveCfg = Debug|x64 + {0EC83E64-230E-48EF-B08C-6AC9651B4F82}.Debug|x64.Build.0 = Debug|x64 {0EC83E64-230E-48EF-B08C-6AC9651B4F82}.MinSizeRel|Mixed Platforms.ActiveCfg = Release|Win32 {0EC83E64-230E-48EF-B08C-6AC9651B4F82}.MinSizeRel|Mixed Platforms.Build.0 = Release|Win32 {0EC83E64-230E-48EF-B08C-6AC9651B4F82}.MinSizeRel|Win32.ActiveCfg = Release|Win32 @@ -95,6 +97,8 @@ Global {F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|Win32.Deploy.0 = Debug|Win32 {F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|x64.ActiveCfg = Release|x64 {F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|x64.Build.0 = Release|x64 + {F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|x64.ActiveCfg = Debug|x64 + {F10CBC03-9809-4CBA-95D8-327C287B18EE}.Debug|x64.Build.0 = Debug|x64 {F10CBC03-9809-4CBA-95D8-327C287B18EE}.MinSizeRel|Mixed Platforms.ActiveCfg = Release|Win32 {F10CBC03-9809-4CBA-95D8-327C287B18EE}.MinSizeRel|Mixed Platforms.Build.0 = Release|Win32 {F10CBC03-9809-4CBA-95D8-327C287B18EE}.MinSizeRel|Win32.ActiveCfg = Release|Win32 @@ -120,6 +124,13 @@ Global {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|Win32.Deploy.0 = Debug|Win32 {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|x64.ActiveCfg = Release|x64 {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|x64.Build.0 = Release|x64 + {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 + {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|Mixed Platforms.Build.0 = Debug|x64 + {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|Win32.ActiveCfg = Debug|Win32 + {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|Win32.Build.0 = Debug|Win32 + {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|Win32.Deploy.0 = Debug|Win32 + {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|x64.ActiveCfg = Debug|x64 + {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.Debug|x64.Build.0 = Debug|x64 {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.MinSizeRel|Mixed Platforms.ActiveCfg = Release|Win32 {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.MinSizeRel|Mixed Platforms.Build.0 = Release|Win32 {2EC4DDED-8F75-4C86-A10B-E1E8EB29F3EE}.MinSizeRel|Win32.ActiveCfg = Release|Win32 @@ -176,6 +187,8 @@ Global {6A066806-F43F-4B31-A4E3-57179674F460}.RelWithDebInfo|x64.ActiveCfg = Release|x64 {C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|Mixed Platforms.ActiveCfg = Release|x64 {C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|Mixed Platforms.Build.0 = Release|x64 + {C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 + {C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|Mixed Platforms.Build.0 = Debug|x64 {C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|Win32.ActiveCfg = Debug|Win32 {C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|Win32.Build.0 = Debug|Win32 {C5AA09D0-6594-4CD3-BD92-1D380C7B3B50}.Debug|x64.ActiveCfg = Release|x64 @@ -198,6 +211,8 @@ Global {1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Debug|Win32.Build.0 = Debug|Win32 {1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Debug|x64.ActiveCfg = Release|Win32 {1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Debug|x64.Build.0 = Release|Win32 + {1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Debug|x64.ActiveCfg = Debug|x64 + {1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Debug|x64.Build.0 = Debug|x64 {1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.MinSizeRel|Mixed Platforms.ActiveCfg = Debug|Win32 {1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.MinSizeRel|Win32.ActiveCfg = Debug|Win32 {1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.MinSizeRel|x64.ActiveCfg = Debug|Win32 @@ -210,6 +225,11 @@ Global {1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.RelWithDebInfo|Mixed Platforms.ActiveCfg = Release|Win32 {1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.RelWithDebInfo|Win32.ActiveCfg = Release|Win32 {1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.RelWithDebInfo|x64.ActiveCfg = Release|Win32 + {1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Release|x64.ActiveCfg = Release|x64 + {1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.Release|x64.Build.0 = Release|x64 + {1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.RelWithDebInfo|Mixed Platforms.ActiveCfg = Release|Win32 + {1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.RelWithDebInfo|Win32.ActiveCfg = Release|Win32 + {1B3BEA4C-CF75-438A-9693-60FB8444BBF3}.RelWithDebInfo|x64.ActiveCfg = Release|x64 {666FEA52-975F-41CD-B224-B19AF3C0ABBA}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 {666FEA52-975F-41CD-B224-B19AF3C0ABBA}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {666FEA52-975F-41CD-B224-B19AF3C0ABBA}.Debug|Win32.ActiveCfg = Debug|Win32 diff --git a/Code/GamePhysics/GamePhysics.vcxproj b/Code/GamePhysics/GamePhysics.vcxproj index 84d380be..dd2f8fd5 100644 --- a/Code/GamePhysics/GamePhysics.vcxproj +++ b/Code/GamePhysics/GamePhysics.vcxproj @@ -89,7 +89,7 @@ Level3 Disabled - $(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterPhysics3D;$(SolutionDir)Physics\Bullet Source\;%(AdditionalIncludeDirectories) + $(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterPhysics3D;$(SolutionDir)Physics\Bullet Source\ _WINDLL;PHYSICS_DLL_EXPORT;%(PreprocessorDefinitions) false @@ -104,7 +104,7 @@ Level3 Disabled - $(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterPhysics3D;%(AdditionalIncludeDirectories) + $(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterPhysics3D;$(SolutionDir)Physics\Bullet Source\ _WINDLL;PHYSICS_DLL_EXPORT;%(PreprocessorDefinitions) false @@ -120,7 +120,7 @@ MaxSpeed true true - $(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterPhysics3D;$(SolutionDir)Physics\src;%(AdditionalIncludeDirectories) + $(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterPhysics3D;$(SolutionDir)Physics\Bullet Source\ _WINDLL;PHYSICS_DLL_EXPORT;%(PreprocessorDefinitions) false @@ -138,7 +138,7 @@ MaxSpeed true true - $(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterPhysics3D;%(AdditionalIncludeDirectories) + $(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterPhysics3D;$(SolutionDir)Physics\Bullet Source\ _WINDLL;PHYSICS_DLL_EXPORT;%(PreprocessorDefinitions) false diff --git a/Code/GamePhysics/Implementation/PhysicsAPI_Impl.cpp b/Code/GamePhysics/Implementation/PhysicsAPI_Impl.cpp index 820688a5..3b4fc74d 100644 --- a/Code/GamePhysics/Implementation/PhysicsAPI_Impl.cpp +++ b/Code/GamePhysics/Implementation/PhysicsAPI_Impl.cpp @@ -297,10 +297,10 @@ void API_Impl::ApplyEffect(Oyster::Collision3D::ICollideable* collideable, void* case ICollideable::Type::Type_cone: cone = dynamic_cast(collideable); // Add collision shape - shape = new btConeShape(cone->radius, cone->height.GetLength()); + shape = new btConeShapeZ(cone->radius, cone->length); // Add motion state - state = new btDefaultMotionState(btTransform(btQuaternion(btVector3(cone->height.x, cone->height.y, cone->height.z).normalized(), 0.0f),btVector3(cone->position.x, cone->position.y, cone->position.z))); + state = new btDefaultMotionState(btTransform(btQuaternion(cone->quaternion.x, cone->quaternion.y, cone->quaternion.z, cone->quaternion.w),btVector3(cone->center.x, cone->center.y, cone->center.z))); // Add rigid body rigidBodyCI = btRigidBody::btRigidBodyConstructionInfo (0, state, shape); diff --git a/Code/GamePhysics/Implementation/PhysicsAPI_Impl.h b/Code/GamePhysics/Implementation/PhysicsAPI_Impl.h index c2e3d5ea..422e82ef 100644 --- a/Code/GamePhysics/Implementation/PhysicsAPI_Impl.h +++ b/Code/GamePhysics/Implementation/PhysicsAPI_Impl.h @@ -39,7 +39,7 @@ namespace Oyster } else { - assert(colObj1->m_collisionObject == &body && "Body does not match either collision object"); + //assert(colObj1->m_collisionObject == &body && "Body does not match either collision object"); pt = cp.m_localPointB; this->func((ICustomBody*)(colObj0->getCollisionObject()->getUserPointer()), this->args); } diff --git a/Code/OysterPhysics3D/Cone.cpp b/Code/OysterPhysics3D/Cone.cpp index 61d7faf3..ccc190d6 100644 --- a/Code/OysterPhysics3D/Cone.cpp +++ b/Code/OysterPhysics3D/Cone.cpp @@ -11,22 +11,36 @@ using namespace ::Oyster::Math3D; Cone::Cone( ) : ICollideable(Type_cone) { + this->center = Float3(0, 0, 0); + this->quaternion = Float4(0, 0, 0, 1); this->radius = 1; - this->height = Oyster::Math::Float3(0,0,0); + this->length = 0; } -Cone::Cone( const ::Oyster::Math::Float3 &height, const Oyster::Math::Float3 &position, const ::Oyster::Math::Float &radius ) : ICollideable(Type_cone) +Cone & Cone::operator = ( const Cone &Cone ) { - this->radius = radius; - this->height = height; - this->position = position; + this->center = Cone.center; + this->quaternion = Cone.quaternion; + this->radius = Cone.radius; + this->length = Cone.length; + + return *this; } -Cone::Cone( const ::Oyster::Math::Float4 &height, const Oyster::Math::Float4 &position, const ::Oyster::Math::Float &radius ) : ICollideable(Type_cone) +Cone::Cone( const ::Oyster::Math::Float &height, const Oyster::Math::Float3 &position, const Oyster::Math::Float4 &quaternion, const ::Oyster::Math::Float &radius ) : ICollideable(Type_cone) { + this->center = position; + this->quaternion = quaternion; this->radius = radius; - this->height = (Oyster::Math::Float3)height; - this->position = (Oyster::Math::Float3)position; + this->length = height; +} + +Cone::Cone( const ::Oyster::Math::Float &height, const Oyster::Math::Float4 &position, const Oyster::Math::Float4 &quaternion, const ::Oyster::Math::Float &radius ) : ICollideable(Type_cone) +{ + this->center = position; + this->quaternion = quaternion; + this->radius = radius; + this->length = height; } Cone::~Cone( ) @@ -34,14 +48,6 @@ Cone::~Cone( ) } -Cone & Cone::operator = ( const Cone &cone ) -{ - this->radius = cone.radius; - this->height = cone.height; - this->position = cone.position; - return *this; -} - ::Utility::DynamicMemory::UniquePointer Cone::Clone( ) const { return ::Utility::DynamicMemory::UniquePointer( new Cone(*this) ); diff --git a/Code/OysterPhysics3D/Cone.h b/Code/OysterPhysics3D/Cone.h index 3bae3df3..64ff98b9 100644 --- a/Code/OysterPhysics3D/Cone.h +++ b/Code/OysterPhysics3D/Cone.h @@ -18,9 +18,15 @@ namespace Oyster { public: + union + { + struct{ ::Oyster::Math::Float3 center; ::Oyster::Math::Float4 quaternion; ::Oyster::Math::Float radius; ::Oyster::Math::Float length; }; + char byte[sizeof(::Oyster::Math::Float3) + sizeof(::Oyster::Math::Float4) + sizeof(::Oyster::Math::Float) + sizeof(::Oyster::Math::Float)]; + }; + Cone(); - Cone( const ::Oyster::Math::Float3 &height, const Oyster::Math::Float3 &position, const ::Oyster::Math::Float &radius ); - Cone( const ::Oyster::Math::Float4 &height, const Oyster::Math::Float4 &position, const ::Oyster::Math::Float &radius ); + Cone( const ::Oyster::Math::Float &height, const Oyster::Math::Float3 &position, const Oyster::Math::Float4 &quaternion, const ::Oyster::Math::Float &radius ); + Cone( const ::Oyster::Math::Float &height, const Oyster::Math::Float4 &position, const Oyster::Math::Float4 &quaternion, const ::Oyster::Math::Float &radius ); virtual ~Cone( ); Cone & operator = ( const Cone &Cone ); @@ -32,11 +38,6 @@ namespace Oyster bool Contains( const ICollideable &target ) const{return false;}; ::Oyster::Math::Float TimeOfContact( const ICollideable &deuterStart, const ICollideable &deuterEnd ) const{return 0;}; - - - Oyster::Math::Float3 height; - Oyster::Math::Float3 position; - Oyster::Math::Float radius; }; }