| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
- //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
- #pragma once
- #include "BsCorePrerequisites.h"
- #include "foundation\PxVec3.h"
- #include "foundation\PxVec4.h"
- #include "foundation\PxQuat.h"
- #include "foundation\PxTransform.h"
- namespace BansheeEngine
- {
- #if (BS_PLATFORM == BS_PLATFORM_WIN32) && !defined(BS_STATIC_LIB)
- # ifdef BS_PHYSX_EXPORTS
- # define BS_PHYSX_EXPORT __declspec(dllexport)
- # else
- # if defined( __MINGW32__ )
- # define BS_PHYSX_EXPORT
- # else
- # define BS_PHYSX_EXPORT __declspec(dllimport)
- # endif
- # endif
- #else
- # define BS_PHYSX_EXPORT
- #endif
- /** @addtogroup Plugins
- * @{
- */
- /** @defgroup PhysX BansheePhysX
- * NVIDIA %PhysX implementation of Banshee's physics.
- * @{
- */
- /** @cond RTTI */
- /** @defgroup RTTI-Impl-PhysX RTTI types
- * Types containing RTTI for specific classes.
- */
- /** @endcond */
- /** @} */
- /** @} */
- class PhysXRigidbody;
- class PhsyXMaterial;
- class FPhysXCollider;
- /** @addtogroup PhysX
- * @{
- */
- /** Type IDs used by the RTTI system for the PhysX library. */
- enum TypeID_BansheeEditor
- {
- TID_FPhysXMesh = 100000,
- };
- /** Converts a Banshee vector to a PhysX vector. */
- inline const physx::PxVec3& toPxVector(const Vector3& input)
- {
- return *(physx::PxVec3*)&input;
- }
- /** Converts a Banshee vector to a PhysX vector. */
- inline const physx::PxVec4& toPxVector(const Vector4& input)
- {
- return *(physx::PxVec4*)&input;
- }
- /** Converts a Banshee quaternion to a PhysX quaternion. */
- inline const physx::PxQuat& toPxQuaternion(const Quaternion& input)
- {
- return *(physx::PxQuat*)&input;
- }
- /** Converts a Banshee position/rotation pair to a PhysX transform. */
- inline physx::PxTransform toPxTransform(const Vector3& pos, const Quaternion& rot)
- {
- return physx::PxTransform(toPxVector(pos), toPxQuaternion(rot));
- }
- /** Converts a PhysX vector to a Banshee vector. */
- inline const Vector3& fromPxVector(const physx::PxVec3& input)
- {
- return *(Vector3*)&input;
- }
- /** Converts a PhysX vector to a Banshee vector. */
- inline const Vector4& fromPxVector(const physx::PxVec4& input)
- {
- return *(Vector4*)&input;
- }
- /** Converts a PhysX quaternion to a Banshee quaternion. */
- inline const Quaternion& fromPxQuaternion(const physx::PxQuat& input)
- {
- return *(Quaternion*)&input;
- }
- /** Flags used on PhysX shape filters. */
- enum class PhysXObjectFilterFlag
- {
- NoReport = 1 << 0, /**< Don't report collision events. */
- ReportBasic = 1 << 1, /**< Report start/begin collision events. */
- ReportAll = 1 << 2, /**< Report start/begin, as well as persistant collision events. */
- CCD = 1 << 3 /**< Use continous collision detection for this shape. */
- };
- /** @copydoc PhysXObjectFilterFlag */
- typedef Flags<PhysXObjectFilterFlag> PhysXObjectFilterFlags;
- BS_FLAGS_OPERATORS(PhysXObjectFilterFlag)
- /** @} */
- }
|